summaryrefslogtreecommitdiffstats
path: root/sys/compat
diff options
context:
space:
mode:
authorjkim <jkim@FreeBSD.org>2009-12-15 22:44:28 +0000
committerjkim <jkim@FreeBSD.org>2009-12-15 22:44:28 +0000
commitddc390f24bcd6429544e60de4083375c77a39386 (patch)
treebd7053a1c4635505603e1e025803da8282d143b4 /sys/compat
parent0b02c03e54e6cefe1efe02b0dd9d885768f4d901 (diff)
downloadFreeBSD-src-ddc390f24bcd6429544e60de4083375c77a39386.zip
FreeBSD-src-ddc390f24bcd6429544e60de4083375c77a39386.tar.gz
Add two new debugging tunables for x86bios instead of abusing bootverbose,
i.e., debug.x86bios.call and debug.x86bios.int.
Diffstat (limited to 'sys/compat')
-rw-r--r--sys/compat/x86bios/x86bios.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c
index be57887..34da07c 100644
--- a/sys/compat/x86bios/x86bios.c
+++ b/sys/compat/x86bios/x86bios.c
@@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$");
#include <sys/module.h>
#include <sys/mutex.h>
#include <sys/proc.h>
+#include <sys/sysctl.h>
#include <contrib/x86emu/x86emu.h>
#include <contrib/x86emu/x86emu_regs.h>
@@ -80,6 +81,16 @@ static vm_offset_t *x86bios_map;
static vm_paddr_t x86bios_seg_phys;
+SYSCTL_NODE(_debug, OID_AUTO, x86bios, CTLFLAG_RD, NULL, "x86bios debugging");
+static int x86bios_trace_call;
+TUNABLE_INT("debug.x86bios.call", &x86bios_trace_call);
+SYSCTL_INT(_debug_x86bios, OID_AUTO, call, CTLFLAG_RW, &x86bios_trace_call, 0,
+ "Trace far function calls");
+static int x86bios_trace_int;
+TUNABLE_INT("debug.x86bios.int", &x86bios_trace_int);
+SYSCTL_INT(_debug_x86bios, OID_AUTO, int, CTLFLAG_RW, &x86bios_trace_int, 0,
+ "Trace software interrupt handlers");
+
static void *
x86bios_get_pages(uint32_t offset, size_t size)
{
@@ -312,7 +323,7 @@ x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off)
if (x86bios_map == NULL)
return;
- if (bootverbose)
+ if (x86bios_trace_call)
printf("Calling 0x%05x (ax=0x%04x bx=0x%04x "
"cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n",
(seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX,
@@ -324,7 +335,7 @@ x86bios_call(struct x86regs *regs, uint16_t seg, uint16_t off)
memcpy(regs, &x86bios_emu.x86, sizeof(*regs));
mtx_unlock_spin(&x86bios_lock);
- if (bootverbose)
+ if (x86bios_trace_call)
printf("Exiting 0x%05x (ax=0x%04x bx=0x%04x "
"cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n",
(seg << 4) + off, regs->R_AX, regs->R_BX, regs->R_CX,
@@ -351,7 +362,7 @@ x86bios_intr(struct x86regs *regs, int intno)
if (x86bios_map == NULL)
return;
- if (bootverbose)
+ if (x86bios_trace_int)
printf("Calling int 0x%x (ax=0x%04x bx=0x%04x "
"cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n",
intno, regs->R_AX, regs->R_BX, regs->R_CX,
@@ -363,7 +374,7 @@ x86bios_intr(struct x86regs *regs, int intno)
memcpy(regs, &x86bios_emu.x86, sizeof(*regs));
mtx_unlock_spin(&x86bios_lock);
- if (bootverbose)
+ if (x86bios_trace_int)
printf("Exiting int 0x%x (ax=0x%04x bx=0x%04x "
"cx=0x%04x dx=0x%04x es=0x%04x di=0x%04x)\n",
intno, regs->R_AX, regs->R_BX, regs->R_CX,
OpenPOWER on IntegriCloud