summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2004-07-10 22:47:06 +0000
committermarcel <marcel@FreeBSD.org>2004-07-10 22:47:06 +0000
commit95c6c430069ffa4db994a89c4ccbf54ff21dc643 (patch)
treea438f229e140d96a0cd69538555d6a439424e115
parent1339cad36a69faf633824fea64a263b07318911b (diff)
downloadFreeBSD-src-95c6c430069ffa4db994a89c4ccbf54ff21dc643.zip
FreeBSD-src-95c6c430069ffa4db994a89c4ccbf54ff21dc643.tar.gz
Update for the KDB framework:
o Make debugging code conditional upon KDB instead of DDB. o Declare ksym_start and ksym_end as extern and initialize them. This was previously and bogusly handled by DDB itself. o Call kdb_enter() instead of Debugger(). o Remove implementation of Debugger().
-rw-r--r--sys/i386/i386/machdep.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c
index b1b388c..a783e01 100644
--- a/sys/i386/i386/machdep.c
+++ b/sys/i386/i386/machdep.c
@@ -59,6 +59,7 @@ __FBSDID("$FreeBSD$");
#include <sys/sysproto.h>
#include <sys/signalvar.h>
#include <sys/imgact.h>
+#include <sys/kdb.h>
#include <sys/kernel.h>
#include <sys/ktr.h>
#include <sys/linker.h>
@@ -159,6 +160,10 @@ static void fill_fpregs_xmm(struct savexmm *, struct save87 *);
#endif /* CPU_ENABLE_SSE */
SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
+#ifdef DDB
+extern vm_offset_t ksym_start, ksym_end;
+#endif
+
int _udatasel, _ucodesel;
u_int basemem;
@@ -2080,9 +2085,15 @@ init386(first)
#endif
#ifdef DDB
+ ksym_start = bootinfo.bi_symtab;
+ ksym_end = bootinfo.bi_esymtab;
+#endif
+
kdb_init();
+
+#ifdef KDB
if (boothowto & RB_KDB)
- Debugger("Boot flags requested debugger");
+ kdb_enter("Boot flags requested debugger");
#endif
finishidentcpu(); /* Final stage of CPU initialization */
@@ -2744,14 +2755,6 @@ user_dbreg_trap(void)
return 0;
}
-#ifndef DDB
-void
-Debugger(const char *msg)
-{
- printf("Debugger(\"%s\") called.\n", msg);
-}
-#endif /* no DDB */
-
#ifndef DEV_APIC
#include <machine/apicvar.h>
@@ -2853,12 +2856,12 @@ lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger)
}
#endif
-#ifdef DDB
+#ifdef KDB
/*
* Provide inb() and outb() as functions. They are normally only
* available as macros calling inlined functions, thus cannot be
- * called inside DDB.
+ * called from the debugger.
*
* The actual code is stolen from <machine/cpufunc.h>, and de-inlined.
*/
@@ -2897,4 +2900,4 @@ outb(u_int port, u_char data)
__asm __volatile("outb %0,%%dx" : : "a" (al), "d" (port));
}
-#endif /* DDB */
+#endif /* KDB */
OpenPOWER on IntegriCloud