diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2009-04-30 01:16:57 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2009-04-30 01:16:57 +0000 |
commit | 240a6158ac08ed66b16846e1b0129a23dd34bb8b (patch) | |
tree | f56c5a84f2ed9b998eb697876a7307ba8d12ed2a /sys | |
parent | c4e186805a0e3fdc696e564818fa7de1ad3ef1fb (diff) |
pass db_console from the bootloader to the kernel, and then use it to
set ddb.console real early.
requested by art@
no problem! deraadt@
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 11 | ||||
-rw-r--r-- | sys/arch/amd64/include/biosvar.h | 7 | ||||
-rw-r--r-- | sys/arch/amd64/stand/libsa/exec_i386.c | 9 |
3 files changed, 24 insertions, 3 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 7524ab5b5e6..83087b3953b 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.89 2009/04/20 15:44:49 reyk Exp $ */ +/* $OpenBSD: machdep.c,v 1.90 2009/04/30 01:16:56 dlg Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -126,6 +126,7 @@ #ifdef DDB #include <machine/db_machdep.h> #include <ddb/db_extern.h> +extern int db_console; #endif #include "isa.h" @@ -1833,6 +1834,7 @@ void getbootinfo(char *bootinfo, int bootinfo_size) { bootarg32_t *q; + bios_ddb_t *bios_ddb; #undef BOOTINFO_DEBUG #ifdef BOOTINFO_DEBUG @@ -1912,6 +1914,13 @@ getbootinfo(char *bootinfo, int bootinfo_size) 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 + break; + default: #ifdef BOOTINFO_DEBUG printf(" unsupported arg (%d) %p", q->ba_type, diff --git a/sys/arch/amd64/include/biosvar.h b/sys/arch/amd64/include/biosvar.h index 95a86283986..6d0db3f8b2b 100644 --- a/sys/arch/amd64/include/biosvar.h +++ b/sys/arch/amd64/include/biosvar.h @@ -1,5 +1,5 @@ /* XXX - DSR */ -/* $OpenBSD: biosvar.h,v 1.9 2008/09/01 17:30:55 deraadt Exp $ */ +/* $OpenBSD: biosvar.h,v 1.10 2009/04/30 01:16:56 dlg Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -202,6 +202,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/amd64/stand/libsa/exec_i386.c b/sys/arch/amd64/stand/libsa/exec_i386.c index d05fb66b3db..c72a0d0a737 100644 --- a/sys/arch/amd64/stand/libsa/exec_i386.c +++ b/sys/arch/amd64/stand/libsa/exec_i386.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec_i386.c,v 1.5 2007/07/27 17:48:01 tom Exp $ */ +/* $OpenBSD: exec_i386.c,v 1.6 2009/04/30 01:16:56 dlg Exp $ */ /* * Copyright (c) 1997-1998 Michael Shalayeff @@ -54,6 +54,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)(); @@ -65,6 +67,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(); |