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);
/* 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 */
}
/*===========================================================================*
panic("return from inkernel_disaster");
}
+#if USE_SYSDEBUG
/*===========================================================================*
* proc_stacktrace_execute *
*===========================================================================*/
}
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)
#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
PRIVATE void mb_print(char *str)
{
+#if MULTIBOOT_VERBOSE
while (*str) {
if (*str == '\n') {
str++;
while (print_line >= MULTIBOOT_CONSOLE_LINES)
mb_scroll_up(1);
}
+#endif /* MULTIBOOT_VERBOSE */
}
PRIVATE void mb_print_hex(u32_t value)
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;
printf("DPL %d\n", dpl);
return;
+#endif /* USE_SYSDEBUG */
}
/*===========================================================================*
CPPFLAGS+= -DUSE_LIVEUPDATE
.endif
+.if ${USE_SYSDEBUG} != "no"
+CPPFLAGS+= -DUSE_SYSDEBUG
+.endif
+
CPPFLAGS.sched_start.c+= -I${MINIXSRCDIR}
.if (${CC} == "gcc") || (${CC} == "clang")
void util_nstrcat(char *str, unsigned long number)
{
+#if USE_SYSDEBUG
int n = 10, lead = 1;
char nbuf[12], *p;
p = nbuf;
*p++ = ' ';
*p++ = '\0';
strcat(str, nbuf);
+#endif /* USE_SYSDEBUG */
}
void util_stacktrace(void)
{
+#if USE_SYSDEBUG
FUNC_STACKTRACE(printf("0x%lx ", (unsigned long) pc));
printf("\n");
+#endif /* USE_SYSDEBUG */
}
void util_stacktrace_strcat(char *str)
{
+#if USE_SYSDEBUG
FUNC_STACKTRACE(util_nstrcat(str, pc));
+#endif /* USE_SYSDEBUG */
}