mirror of
https://github.com/SerenityOS/serenity
synced 2024-09-06 17:06:31 +00:00
Kernel: Stop debug spam when using mmap on /dev/mem device
This is not really useful and quite annoying so let's disable it by default.
This commit is contained in:
parent
916e093d4a
commit
d0abae8907
|
@ -207,6 +207,10 @@
|
|||
#cmakedefine01 MOUSE_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef MEMORY_DEVICE_DEBUG
|
||||
#cmakedefine01 MEMORY_DEVICE_DEBUG
|
||||
#endif
|
||||
|
||||
#ifndef MULTIPROCESSOR_DEBUG
|
||||
#cmakedefine01 MULTIPROCESSOR_DEBUG
|
||||
#endif
|
||||
|
|
|
@ -57,15 +57,13 @@ ErrorOr<Memory::Region*> MemoryDevice::mmap(Process& process, OpenFileDescriptio
|
|||
// is to be set to the page base of that start address.
|
||||
VERIFY(viewed_address == viewed_address.page_base());
|
||||
|
||||
dbgln("MemoryDevice: Trying to mmap physical memory at {} for range of {} bytes", viewed_address, range.size());
|
||||
if (!MM.is_allowed_to_read_physical_memory_for_userspace(viewed_address, range.size())) {
|
||||
dbgln("MemoryDevice: Trying to mmap physical memory at {} for range of {} bytes failed due to violation of access", viewed_address, range.size());
|
||||
dbgln_if(MEMORY_DEVICE_DEBUG, "MemoryDevice: Trying to mmap physical memory at {} for range of {} bytes failed due to violation of access", viewed_address, range.size());
|
||||
return EINVAL;
|
||||
}
|
||||
|
||||
auto vmobject = TRY(Memory::AnonymousVMObject::try_create_for_physical_range(viewed_address, range.size()));
|
||||
|
||||
dbgln("MemoryDevice: Mapped physical memory at {} for range of {} bytes", viewed_address, range.size());
|
||||
return process.address_space().allocate_region_with_vmobject(
|
||||
range,
|
||||
move(vmobject),
|
||||
|
|
|
@ -117,6 +117,7 @@ set(MATROSKA_DEBUG ON)
|
|||
set(MATROSKA_TRACE_DEBUG ON)
|
||||
set(MASTERPTY_DEBUG ON)
|
||||
set(MBR_DEBUG ON)
|
||||
set(MEMORY_DEVICE_DEBUG ON)
|
||||
set(MEMORY_DEBUG ON)
|
||||
set(MENU_DEBUG ON)
|
||||
set(MENUS_DEBUG ON)
|
||||
|
|
Loading…
Reference in a new issue