From a812e3cab187252cb38de954fc07c2384dbfbbbb Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Fri, 17 Sep 2021 16:06:13 -0400 Subject: [PATCH] kernel/debug: Only create an area for the debug syslog if reusing one. If the debug_output pointer is just a kernel_args_malloc'd structure, then it is already mapped and we should not be re-mapping it; we only need to do that if we are using a fixed-map ring. --- src/system/kernel/debug/debug.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/system/kernel/debug/debug.cpp b/src/system/kernel/debug/debug.cpp index 593d82b196..7d10bb928b 100644 --- a/src/system/kernel/debug/debug.cpp +++ b/src/system/kernel/debug/debug.cpp @@ -1373,8 +1373,8 @@ syslog_init_post_vm(struct kernel_args* args) status = B_NO_MEMORY; goto err2; } - } else if (args->debug_output != NULL) { - // create an area for the debug syslog buffer + } else if (args->keep_debug_output_buffer) { + // create an area for the already-existing debug syslog buffer void* base = (void*)ROUNDDOWN((addr_t)(void *)args->debug_output, B_PAGE_SIZE); size_t size = ROUNDUP(args->debug_size, B_PAGE_SIZE); area_id area = create_area("syslog debug", &base, B_EXACT_ADDRESS, size,