# first-stage, arch-dependent startup code
SRCS= mpx.S
SRCS+= start.c table.c main.c proc.c \
- system.c clock.c utility.c debug.c interrupt.c \
+ system.c clock.c utility.c interrupt.c \
cpulocals.c
.ifdef CONFIG_SMP
CPPFLAGS+= -DUSE_MCONTEXT
.endif
+.if ${USE_DEBUGREG} != "no"
+SRCS+= breakpoints.c debugreg.S
+.endif
+
+# Extra debugging routines
+.if ${USE_DEBUG} != "no"
+SRCS+= debug.c
+.endif
# These come last, so the profiling buffer is at the end of the data segment
SRCS+= profile.c do_sprofile.c
.PATH: ${.CURDIR}/arch/${ARCH}
SRCS+= arch_do_vmctl.c \
- breakpoints.c \
arch_clock.c \
- debugreg.S \
do_int86.c \
do_iopenable.c \
do_readbios.c \
#endif
}
+#if DEBUG_SERIAL
PUBLIC void ser_putc(char c)
{
int i;
#endif
}
+
/*===========================================================================*
* do_ser_debug *
*===========================================================================*/
}
#endif
+#endif /* DEBUG_SERIAL */
+
#if SPROFILE
PUBLIC int arch_init_profile_clock(const u32_t freq)
TMR_NEVER : clock_timers->tmr_exp_time;
}
+#if DEBUG_SERIAL
if (do_serial_debug)
do_ser_debug();
+#endif
+
}
return(1); /* reenable interrupts */
#include "config.h"
#endif
+/* Debug info via serial (see ser_debug()) */
+#define DEBUG_SERIAL 1
+
/* Enable prints such as
* . send/receive failed due to deadlock or dead source or dead destination
* . trap not allowed
/* DEBUG_IPCSTATS collects information on who sends messages to whom. */
#define DEBUG_IPCSTATS 0
+#if USE_SMALL
+#undef DEBUG_SERIAL
+#undef DEBUG_ENABLE_IPC_WARNINGS
+#endif
+
#if DEBUG_DUMPIPC || DEBUG_IPCSTATS /* either of these needs the hook */
#define DEBUG_IPC_HOOK 1
#endif
if(!value || system_hz < 2 || system_hz > 50000) /* sanity check */
system_hz = DEFAULT_HZ;
+#if DEBUG_SERIAL
/* Intitialize serial debugging */
value = env_get(SERVARNAME);
if(value && atoi(value) == 0) {
value = env_get(SERBAUDVARNAME);
if (value) serial_debug_baud = atoi(value);
}
+#endif
#ifdef USE_APIC
value = env_get("no_apic");
* to the output driver if an END_OF_KMESS is encountered.
*/
if (c != END_OF_KMESS) {
+#if DEBUG_SERIAL
if (do_serial_debug) {
if(c == '\n')
ser_putc('\r');
ser_putc(c);
}
+#endif
kmess.km_buf[kmess.km_next] = c; /* put normal char in buffer */
if (kmess.km_size < sizeof(kmess.km_buf))
kmess.km_size += 1;
MKYP
#MINIX-specific vars
_MKVARS.yes+= \
- MKWATCHDOG MKACPI MKAPIC MKMCONTEXT
+ MKWATCHDOG MKACPI MKAPIC MKMCONTEXT MKDEBUGREG MKDEBUG
.for var in ${_MKVARS.yes}
${var}?= yes
.endfor
MKAPIC:= no
MKMCONTEXT:= no
MKCOVERAGE:= no
+MKDEBUGREG:= no
+MKDEBUG:= no
.endif
#
# variable is set to "no".
#
.for var in USE_HESIOD USE_INET6 USE_KERBEROS USE_LDAP USE_PAM USE_YP \
-USE_WATCHDOG USE_ACPI USE_APIC USE_MCONTEXT
+USE_WATCHDOG USE_ACPI USE_APIC USE_MCONTEXT USE_DEBUGREG USE_DEBUG
.if (${${var:S/USE_/MK/}} == "no")
${var}:= no
.else
.if ${COMPILER_TYPE} == "gnu" && defined(MKSMALL) && ${MKSMALL} == "yes"
DBG= -Os
-CFLAGS+= -DNDEBUG=1
+CFLAGS+= -DNDEBUG=1 -DUSE_SMALL=1
.endif