MKSYSDEBUG: conditionally compile more debug code
This commit is contained in:
@@ -136,6 +136,7 @@ PRIVATE void inkernel_disaster(struct proc *saved_proc,
|
||||
struct exception_frame * frame, struct ex_s *ep,
|
||||
int is_nested)
|
||||
{
|
||||
#if USE_SYSDEBUG
|
||||
if(ep) {
|
||||
if (ep->msg == NULL || machine.processor < ep->minprocessor)
|
||||
printf("\nIntel-reserved exception %d\n", frame->vector);
|
||||
@@ -177,6 +178,7 @@ PRIVATE void inkernel_disaster(struct proc *saved_proc,
|
||||
|
||||
/* in an early stage of boot process we don't have processes yet */
|
||||
panic("exception in kernel while booting, no saved_proc yet");
|
||||
#endif /* USE_SYSDEBUG */
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
@@ -261,6 +263,7 @@ PUBLIC void exception_handler(int is_nested, struct exception_frame * frame)
|
||||
panic("return from inkernel_disaster");
|
||||
}
|
||||
|
||||
#if USE_SYSDEBUG
|
||||
/*===========================================================================*
|
||||
* proc_stacktrace_execute *
|
||||
*===========================================================================*/
|
||||
@@ -303,13 +306,16 @@ PRIVATE void proc_stacktrace_execute(struct proc *whichproc, reg_t v_bp, reg_t p
|
||||
}
|
||||
printf("\n");
|
||||
}
|
||||
#endif /* USE_SYSDEBUG */
|
||||
|
||||
/*===========================================================================*
|
||||
* proc_stacktrace *
|
||||
*===========================================================================*/
|
||||
PUBLIC void proc_stacktrace(struct proc *whichproc)
|
||||
{
|
||||
#if USE_SYSDEBUG
|
||||
proc_stacktrace_execute(whichproc, whichproc->p_reg.fp, whichproc->p_reg.pc);
|
||||
#endif /* USE_SYSDEBUG */
|
||||
}
|
||||
|
||||
PUBLIC void enable_fpu_exception(void)
|
||||
|
||||
@@ -19,7 +19,9 @@
|
||||
#include "libexec.h"
|
||||
#include <machine/multiboot.h>
|
||||
|
||||
#if USE_SYSDEBUG
|
||||
#define MULTIBOOT_VERBOSE 1
|
||||
#endif
|
||||
|
||||
/* FIXME: Share this define with kernel linker script */
|
||||
#define MULTIBOOT_KERNEL_ADDR 0x00200000UL
|
||||
@@ -142,6 +144,7 @@ PRIVATE void mb_scroll_up(int lines)
|
||||
|
||||
PRIVATE void mb_print(char *str)
|
||||
{
|
||||
#if MULTIBOOT_VERBOSE
|
||||
while (*str) {
|
||||
if (*str == '\n') {
|
||||
str++;
|
||||
@@ -157,6 +160,7 @@ PRIVATE void mb_print(char *str)
|
||||
while (print_line >= MULTIBOOT_CONSOLE_LINES)
|
||||
mb_scroll_up(1);
|
||||
}
|
||||
#endif /* MULTIBOOT_VERBOSE */
|
||||
}
|
||||
|
||||
PRIVATE void mb_print_hex(u32_t value)
|
||||
|
||||
@@ -366,6 +366,7 @@ for (rp = BEG_PROC_ADDR; rp < END_PROC_ADDR; ++rp) {
|
||||
PUBLIC void printseg(char *banner, const int iscs, struct proc *pr,
|
||||
const u32_t selector)
|
||||
{
|
||||
#if USE_SYSDEBUG
|
||||
u32_t base, limit, index, dpl;
|
||||
struct segdesc_s *desc;
|
||||
|
||||
@@ -446,6 +447,7 @@ PUBLIC void printseg(char *banner, const int iscs, struct proc *pr,
|
||||
printf("DPL %d\n", dpl);
|
||||
|
||||
return;
|
||||
#endif /* USE_SYSDEBUG */
|
||||
}
|
||||
|
||||
/*===========================================================================*
|
||||
|
||||
Reference in New Issue
Block a user