diff options
-rw-r--r-- | sys/arch/amd64/amd64/conf.c | 4 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/consinit.c | 9 | ||||
-rw-r--r-- | sys/arch/amd64/amd64/machdep.c | 36 | ||||
-rw-r--r-- | sys/dev/ic/comvar.h | 3 |
4 files changed, 24 insertions, 28 deletions
diff --git a/sys/arch/amd64/amd64/conf.c b/sys/arch/amd64/amd64/conf.c index 0d0cfbd60ad..02f89f38b81 100644 --- a/sys/arch/amd64/amd64/conf.c +++ b/sys/arch/amd64/amd64/conf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: conf.c,v 1.18 2008/04/08 14:31:54 claudio Exp $ */ +/* $OpenBSD: conf.c,v 1.19 2008/04/30 13:59:32 dlg Exp $ */ /* * Copyright (c) 1994, 1995 Charles M. Hannum. All rights reserved. @@ -446,7 +446,7 @@ struct consdev constab[] = { #if 1 || NWSDISPLAY > 0 cons_init(ws), #endif -#if NCOM + NPCCOM > 0 +#if NCOM > 0 cons_init(com), #endif { 0 }, diff --git a/sys/arch/amd64/amd64/consinit.c b/sys/arch/amd64/amd64/consinit.c index 7f051dc4306..10edb215b2a 100644 --- a/sys/arch/amd64/amd64/consinit.c +++ b/sys/arch/amd64/amd64/consinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: consinit.c,v 1.3 2004/11/02 21:20:58 miod Exp $ */ +/* $OpenBSD: consinit.c,v 1.4 2008/04/30 13:59:32 dlg Exp $ */ /* $NetBSD: consinit.c,v 1.2 2003/03/02 18:27:14 fvdl Exp $ */ /* @@ -37,10 +37,5 @@ void consinit() { - static int initted; - - if (initted) - return; - initted = 1; - cninit(); + /* already done in machdep.c */ } diff --git a/sys/arch/amd64/amd64/machdep.c b/sys/arch/amd64/amd64/machdep.c index 57ba0eed1c1..8c99f42b4e9 100644 --- a/sys/arch/amd64/amd64/machdep.c +++ b/sys/arch/amd64/amd64/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.73 2008/04/25 11:30:22 dlg Exp $ */ +/* $OpenBSD: machdep.c,v 1.74 2008/04/30 13:59:33 dlg Exp $ */ /* $NetBSD: machdep.c,v 1.3 2003/05/07 22:58:18 fvdl Exp $ */ /*- @@ -143,6 +143,12 @@ #include <dev/acpi/acpivar.h> #endif +#include "com.h" +#if NCOM > 0 +#include <sys/tty.h> +#include <dev/ic/comvar.h> +#include <dev/ic/comreg.h> +#endif /* the following is used externally (sysctl_hw) */ char machine[] = MACHINE; @@ -1174,7 +1180,6 @@ extern vector *IDTVEC(exceptions)[]; void init_x86_64(paddr_t first_avail) { - extern void consinit(void); extern struct extent *iomem_ex; struct region_descriptor region; struct mem_segment_descriptor *ldt_segp; @@ -1189,17 +1194,16 @@ init_x86_64(paddr_t first_avail) x86_bus_space_init(); - consinit(); /* XXX SHOULD NOT BE DONE HERE */ + /* + * Attach the glass console early in case we need to display a panic. + */ + cninit(); /* * Initailize PAGE_SIZE-dependent variables. */ uvm_setpagesize(); -#if 0 - uvmexp.ncolors = 2; -#endif - /* * Boot arguments are in a single page specified by /boot. * @@ -1813,21 +1817,17 @@ getbootinfo(char *bootinfo, int bootinfo_size) if (q->ba_size >= sizeof(bios_consdev_t)) { bios_consdev_t *cdp = (bios_consdev_t*)q->ba_arg; -#include "com.h" #if NCOM > 0 static const int ports[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; - if (major(cdp->consdev) == 8) { - int unit = minor(cdp->consdev); - /* ic/com.c */ - extern int comconsrate; - extern int comconsaddr; - - if (unit >= 0 && unit < - (sizeof(ports) / sizeof(ports[0]))) - comconsaddr = ports[unit]; - + int unit = minor(cdp->consdev); + if (major(cdp->consdev) == 8 && unit >= 0 && + unit < (sizeof(ports)/sizeof(ports[0]))) { + comconsaddr = ports[unit]; comconsrate = cdp->conspeed; + + /* Probe the serial port this time. */ + cninit(); } #endif #ifdef BOOTINFO_DEBUG diff --git a/sys/dev/ic/comvar.h b/sys/dev/ic/comvar.h index 0c22660f9c8..c629d3d89c7 100644 --- a/sys/dev/ic/comvar.h +++ b/sys/dev/ic/comvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: comvar.h,v 1.43 2007/05/08 21:28:11 deraadt Exp $ */ +/* $OpenBSD: comvar.h,v 1.44 2008/04/30 13:59:32 dlg Exp $ */ /* $NetBSD: comvar.h,v 1.5 1996/05/05 19:50:47 christos Exp $ */ /* @@ -173,6 +173,7 @@ int kgdbintr(void *); void com_attach_subr(struct com_softc *); extern int comdefaultrate; +extern int comconsrate; extern int comconsfreq; extern bus_addr_t comconsaddr; extern bus_addr_t comsiraddr; |