summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorDavid Gwynne <dlg@cvs.openbsd.org>2009-04-30 13:47:17 +0000
committerDavid Gwynne <dlg@cvs.openbsd.org>2009-04-30 13:47:17 +0000
commit2f85dd3d494b333f0e62cd8916d0cc8aeafbaad3 (patch)
treea4265274184fee5a198d1c977300d80515b9424d /sys
parentc95191af68e9b67a525d4bc822680c727a371a6b (diff)
add support for passing db_console from the bootloader to the kernel.
based on the same change in amd64.
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/i386/i386/bios.c12
-rw-r--r--sys/arch/i386/include/biosvar.h7
-rw-r--r--sys/arch/i386/stand/libsa/exec_i386.c9
3 files changed, 25 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index 1012c54a47f..04a2854a832 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.84 2009/01/13 13:53:50 kettenis Exp $ */
+/* $OpenBSD: bios.c,v 1.85 2009/04/30 13:47:16 dlg Exp $ */
/*
* Copyright (c) 1997-2001 Michael Shalayeff
@@ -110,6 +110,9 @@ struct smbios_entry smbios_entry;
void *bios_smpinfo;
#endif
bios_bootmac_t *bios_bootmac;
+#ifdef DDB
+extern int db_console;
+#endif
void smbios_info(char*);
@@ -450,6 +453,7 @@ void
bios_getopt()
{
bootarg_t *q;
+ bios_ddb_t *bios_ddb;
#ifdef BIOS_DEBUG
printf("bootargv:");
@@ -528,6 +532,12 @@ bios_getopt()
bios_bootmac = (bios_bootmac_t *)q->ba_arg;
break;
+ case BOOTARG_DDB:
+ bios_ddb = (bios_ddb_t *)q->ba_arg;
+#ifdef DDB
+ db_console = bios_ddb->db_console;
+#endif
+
default:
#ifdef BIOS_DEBUG
printf(" unsupported arg (%d) %p", q->ba_type,
diff --git a/sys/arch/i386/include/biosvar.h b/sys/arch/i386/include/biosvar.h
index d807e1de5d2..8b3731157a6 100644
--- a/sys/arch/i386/include/biosvar.h
+++ b/sys/arch/i386/include/biosvar.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: biosvar.h,v 1.51 2009/01/20 20:21:03 mlarkin Exp $ */
+/* $OpenBSD: biosvar.h,v 1.52 2009/04/30 13:47:16 dlg Exp $ */
/*
* Copyright (c) 1997-1999 Michael Shalayeff
@@ -204,6 +204,11 @@ typedef struct _bios_bootmac {
char mac[6];
} __packed bios_bootmac_t;
+#define BOOTARG_DDB 8
+typedef struct _bios_ddb {
+ int db_console;
+} __packed bios_ddb_t;
+
#if defined(_KERNEL) || defined (_STANDALONE)
#ifdef _LOCORE
diff --git a/sys/arch/i386/stand/libsa/exec_i386.c b/sys/arch/i386/stand/libsa/exec_i386.c
index cfcefbcbb80..bd9821d910f 100644
--- a/sys/arch/i386/stand/libsa/exec_i386.c
+++ b/sys/arch/i386/stand/libsa/exec_i386.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exec_i386.c,v 1.32 2007/07/27 17:46:56 tom Exp $ */
+/* $OpenBSD: exec_i386.c,v 1.33 2009/04/30 13:47:16 dlg Exp $ */
/*
* Copyright (c) 1997-1998 Michael Shalayeff
@@ -52,6 +52,8 @@ run_loadfile(u_long *marks, int howto)
caddr_t av = (caddr_t)BOOTARG_OFF;
bios_consdev_t cd;
extern int com_speed; /* from bioscons.c */
+ bios_ddb_t ddb;
+ extern int db_console;
if (sa_cleanup != NULL)
(*sa_cleanup)();
@@ -63,6 +65,11 @@ run_loadfile(u_long *marks, int howto)
if (bootmac != NULL)
addbootarg(BOOTARG_BOOTMAC, sizeof(bios_bootmac_t), bootmac);
+ if (db_console != -1) {
+ ddb.db_console = db_console;
+ addbootarg(BOOTARG_DDB, sizeof(ddb), &ddb);
+ }
+
/* Pass memory map to the kernel */
mem_pass();