diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2008-04-24 12:33:15 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2008-04-24 12:33:15 +0000 |
commit | 05a077b09174cb24abd3bc3c03b0e5f232cf77ff (patch) | |
tree | e29e10eed35028360df631e1bccd742040b26cbb /sys | |
parent | 3354f891cb68fe04a5bfed6410c86ebe93f59616 (diff) |
allow amd64 to use serial ports other than com0 as the console. previously
it was stuck to com0 no matter what the boot loader told the kernel.
this relies on the com diff jsing just committed.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 59ba69927a3..c6f4af19880 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.71 2008/04/12 12:49:28 kettenis Exp $ */ +/* $OpenBSD: machdep.c,v 1.72 2008/04/24 12:33:14 dlg Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -1810,13 +1810,22 @@ getbootinfo(char *bootinfo, int bootinfo_size) #endif #endif case BOOTARG_CONSDEV: - if (q->ba_size >= sizeof(bios_consdev_t)) - { + if (q->ba_size >= sizeof(bios_consdev_t)) { bios_consdev_t *cdp = (bios_consdev_t*)q->ba_arg; #include "com.h" #if NCOM > 0 - extern int comconsrate; /* ic/com.c */ + static const int comports[] = + { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; + int unit = minor(cdp->consdev); + /* ic/com.c */ + extern int comconsrate; + extern int comconsaddr; + + if (unit >= 0 && unit < (sizeof(comports) / + sizeof(comports[0]))) + comconsaddr = comports[unit]; + comconsrate = cdp->conspeed; #endif #ifdef BOOTINFO_DEBUG |