From 8c8fcd770ae49ca577c4b308549889c49f9f7807 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Axel=20D=C3=B6rfler?= Date: Wed, 5 May 2010 10:05:25 +0000 Subject: [PATCH] * Moved the addition of the basic debugger commands directly after the VM init. * Separated the other stuff previously done in debug_init_post_vm() to the new debug_init_post_settings(). * Removed superfluous status_t return codes - they are ignored, anyway, and if there really is a show stopper in the init process, panicking would be the thing one should do. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36623 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/private/kernel/debug.h | 9 +++++---- src/system/kernel/debug/debug.cpp | 20 ++++++++++++-------- src/system/kernel/main.cpp | 6 ++++-- 3 files changed, 21 insertions(+), 14 deletions(-) diff --git a/headers/private/kernel/debug.h b/headers/private/kernel/debug.h index b0c28bed93..46d3e84de8 100644 --- a/headers/private/kernel/debug.h +++ b/headers/private/kernel/debug.h @@ -1,5 +1,5 @@ /* - * Copyright 2002-2008, Axel Dörfler, axeld@pinc-software.de + * Copyright 2002-2010, Axel Dörfler, axeld@pinc-software.de * Distributed under the terms of the Haiku License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. @@ -114,9 +114,10 @@ extern "C" { struct kernel_args; -extern status_t debug_init(struct kernel_args *args); -extern status_t debug_init_post_vm(struct kernel_args *args); -extern status_t debug_init_post_modules(struct kernel_args *args); +extern void debug_init(struct kernel_args *args); +extern void debug_init_post_vm(struct kernel_args *args); +extern void debug_init_post_settings(struct kernel_args *args); +extern void debug_init_post_modules(struct kernel_args *args); extern void debug_early_boot_message(const char *string); extern void debug_puts(const char *s, int32 length); extern bool debug_debugger_running(void); diff --git a/src/system/kernel/debug/debug.cpp b/src/system/kernel/debug/debug.cpp index 67110ff918..03bc324a55 100644 --- a/src/system/kernel/debug/debug.cpp +++ b/src/system/kernel/debug/debug.cpp @@ -1,6 +1,6 @@ /* * Copyright 2008-2010, Ingo Weinhold, ingo_weinhold@gmx.de. - * Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2002-2010, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001, Travis Geiselbrecht. All rights reserved. @@ -1622,7 +1622,7 @@ debug_early_boot_message(const char* string) } -status_t +void debug_init(kernel_args* args) { new(&gDefaultDebugOutputFilter) DefaultDebugOutputFilter; @@ -1630,11 +1630,11 @@ debug_init(kernel_args* args) syslog_init(args); debug_paranoia_init(); - return arch_debug_console_init(args); + arch_debug_console_init(args); } -status_t +void debug_init_post_vm(kernel_args* args) { add_debugger_command_etc("cpu", &cmd_switch_cpu, @@ -1653,13 +1653,19 @@ debug_init_post_vm(kernel_args* args) "entering KDL.\n", 0); debug_builtin_commands_init(); + arch_debug_init(args); debug_heap_init(); debug_variables_init(); frame_buffer_console_init(args); arch_debug_console_init_settings(args); tracing_init(); +} + +void +debug_init_post_settings(struct kernel_args* args) +{ // get debug settings sSerialDebugEnabled = get_safemode_boolean("serial_debug_output", @@ -1679,12 +1685,10 @@ debug_init_post_vm(kernel_args* args) blue_screen_enter(true); syslog_init_post_vm(args); - - return arch_debug_init(args); } -status_t +void debug_init_post_modules(struct kernel_args* args) { void* cookie; @@ -1722,7 +1726,7 @@ debug_init_post_modules(struct kernel_args* args) } close_module_list(cookie); - return frame_buffer_console_init_post_modules(args); + frame_buffer_console_init_post_modules(args); } diff --git a/src/system/kernel/main.cpp b/src/system/kernel/main.cpp index c7d61e32ca..d049aa5cce 100644 --- a/src/system/kernel/main.cpp +++ b/src/system/kernel/main.cpp @@ -1,11 +1,12 @@ /* - * Copyright 2002-2009, Axel Dörfler, axeld@pinc-software.de. + * Copyright 2002-2010, Axel Dörfler, axeld@pinc-software.de. * Distributed under the terms of the MIT License. * * Copyright 2001-2002, Travis Geiselbrecht. All rights reserved. * Distributed under the terms of the NewOS License. */ + /*! This is main - initializes the kernel and launches the Bootscript */ @@ -122,6 +123,7 @@ _start(kernel_args *bootKernelArgs, int currentCPU) vm_init(&sKernelArgs); // Before vm_init_post_sem() is called, we have to make sure that // the boot loader allocated region is not used anymore + debug_init_post_vm(&sKernelArgs); low_resource_manager_init(); // now we can use the heap and create areas @@ -130,7 +132,7 @@ _start(kernel_args *bootKernelArgs, int currentCPU) TRACE("init driver_settings\n"); boot_item_init(); driver_settings_init(&sKernelArgs); - debug_init_post_vm(&sKernelArgs); + debug_init_post_settings(&sKernelArgs); TRACE("init notification services\n"); notifications_init(); TRACE("init teams\n");