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:
Liav A 2022-04-01 19:52:22 +03:00 committed by Andreas Kling
parent 916e093d4a
commit d0abae8907
Notes: sideshowbarker 2024-07-18 01:43:16 +09:00
3 changed files with 6 additions and 3 deletions

View file

@ -207,6 +207,10 @@
#cmakedefine01 MOUSE_DEBUG
#endif
#ifndef MEMORY_DEVICE_DEBUG
#cmakedefine01 MEMORY_DEVICE_DEBUG
#endif
#ifndef MULTIPROCESSOR_DEBUG
#cmakedefine01 MULTIPROCESSOR_DEBUG
#endif

View file

@ -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),

View file

@ -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)