diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-12-30 18:14:13 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-12-30 18:14:13 +0000 |
commit | e4021e01bb99e4567a9194ab990184de4e823e19 (patch) | |
tree | 4e378caab8b64f13b58cee9985719e5a1352b0a7 /sys/arch/hp300/dev | |
parent | 5a5e42585277e6f9ae298508b0289638b926af16 (diff) |
Kill conforced, and have console devices use CN_FORCED priority instead.
This means we are no longer aborting the console scans even if the final
console has been found, but on the other hand makes some logic simpler;
plus it will be necessary for upcoming scode vs device loop order reversal.
No user-visible change.
Diffstat (limited to 'sys/arch/hp300/dev')
-rw-r--r-- | sys/arch/hp300/dev/apci.c | 6 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dca.c | 16 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dcm.c | 16 | ||||
-rw-r--r-- | sys/arch/hp300/dev/dvbox.c | 25 | ||||
-rw-r--r-- | sys/arch/hp300/dev/gbox.c | 25 | ||||
-rw-r--r-- | sys/arch/hp300/dev/hyper.c | 16 | ||||
-rw-r--r-- | sys/arch/hp300/dev/rbox.c | 25 | ||||
-rw-r--r-- | sys/arch/hp300/dev/sti_sgc.c | 16 | ||||
-rw-r--r-- | sys/arch/hp300/dev/topcat.c | 25 |
9 files changed, 53 insertions, 117 deletions
diff --git a/sys/arch/hp300/dev/apci.c b/sys/arch/hp300/dev/apci.c index 323ca84ea96..2540cfc15a6 100644 --- a/sys/arch/hp300/dev/apci.c +++ b/sys/arch/hp300/dev/apci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apci.c,v 1.26 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: apci.c,v 1.27 2005/12/30 18:14:09 miod Exp $ */ /* $NetBSD: apci.c,v 1.9 2000/11/02 00:35:05 eeh Exp $ */ /*- @@ -889,10 +889,6 @@ apcicnprobe(cp) cp->cn_dev = makedev(apcimajor, 0); /* XXX */ cp->cn_pri = CN_DEAD; - /* Abort early if console is already forced. */ - if (conforced) - return; - /* * The APCI can only be a console on a 425e; on other 4xx * models, the "first" serial port is mapped to the DCA diff --git a/sys/arch/hp300/dev/dca.c b/sys/arch/hp300/dev/dca.c index c8e1364cea9..69dfd03f2d5 100644 --- a/sys/arch/hp300/dev/dca.c +++ b/sys/arch/hp300/dev/dca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dca.c,v 1.28 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: dca.c,v 1.29 2005/12/30 18:14:09 miod Exp $ */ /* $NetBSD: dca.c,v 1.35 1997/05/05 20:58:18 thorpej Exp $ */ /* @@ -991,7 +991,7 @@ dca_console_scan(scode, va, arg) { struct dcadevice *dca = (struct dcadevice *)va; struct consdev *cp = arg; - int force = 0, pri; + u_int pri; switch (dca->dca_id) { case DCAID0: @@ -1012,10 +1012,8 @@ dca_console_scan(scode, va, arg) /* * Raise our priority, if appropriate. */ - if (scode == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (scode == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -1026,7 +1024,7 @@ dca_console_scan(scode, va, arg) * If our priority is higher than the currently-remembered * console, stash our priority, for the benefit of dcacninit(). */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = scode; return (DIO_SIZE(scode, va)); @@ -1048,10 +1046,6 @@ dcacnprobe(cp) cp->cn_dev = makedev(dcamajor, 0); /* XXX */ cp->cn_pri = CN_DEAD; - /* Abort early if console is already forced. */ - if (conforced) - return; - console_scan(dca_console_scan, cp, HP300_BUS_DIO); #ifdef KGDB diff --git a/sys/arch/hp300/dev/dcm.c b/sys/arch/hp300/dev/dcm.c index bbb8d857e3b..205bc3889e5 100644 --- a/sys/arch/hp300/dev/dcm.c +++ b/sys/arch/hp300/dev/dcm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dcm.c,v 1.25 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: dcm.c,v 1.26 2005/12/30 18:14:09 miod Exp $ */ /* $NetBSD: dcm.c,v 1.41 1997/05/05 20:59:16 thorpej Exp $ */ /* @@ -1504,7 +1504,7 @@ dcm_console_scan(scode, va, arg) { struct dcmdevice *dcm = (struct dcmdevice *)va; struct consdev *cp = arg; - int force = 0, pri; + u_int pri; switch (dcm->dcm_rsid) { case DCMID: @@ -1523,10 +1523,8 @@ dcm_console_scan(scode, va, arg) /* * Raise our priority, if appropriate. */ - if (scode == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (scode == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -1537,7 +1535,7 @@ dcm_console_scan(scode, va, arg) * If our priority is higher than the currently-remembered * console, stash our priority, for the benefit of dcmcninit(). */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = scode; return (DIO_SIZE(scode, va)); @@ -1559,10 +1557,6 @@ dcmcnprobe(cp) cp->cn_dev = makedev(dcmmajor, 0); /* XXX */ cp->cn_pri = CN_DEAD; - /* Abort early if console already forced. */ - if (conforced) - return; - console_scan(dcm_console_scan, cp, HP300_BUS_DIO); #ifdef KGDB_CHEAT diff --git a/sys/arch/hp300/dev/dvbox.c b/sys/arch/hp300/dev/dvbox.c index 69177198a21..3f31d0c4028 100644 --- a/sys/arch/hp300/dev/dvbox.c +++ b/sys/arch/hp300/dev/dvbox.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dvbox.c,v 1.10 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: dvbox.c,v 1.11 2005/12/30 18:14:09 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -428,7 +428,7 @@ dvbox_console_scan(int scode, caddr_t va, void *arg) { struct diofbreg *fbr = (struct diofbreg *)va; struct consdev *cp = arg; - int force = 0, pri; + u_int pri; if (fbr->id != GRFHWID || fbr->fbid != GID_DAVINCI) return (0); @@ -439,10 +439,8 @@ dvbox_console_scan(int scode, caddr_t va, void *arg) /* * Raise our priority, if appropriate. */ - if (scode == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (scode == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -453,7 +451,7 @@ dvbox_console_scan(int scode, caddr_t va, void *arg) * If our priority is higher than the currently-remembered * console, stash our priority. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = scode; return (DIO_SIZE(scode, va)); @@ -467,11 +465,6 @@ dvboxcnprobe(struct consdev *cp) int maj; caddr_t va; struct diofbreg *fbr; - int force = 0; - - /* Abort early if console is already forced. */ - if (conforced) - return; for (maj = 0; maj < nchrdev; maj++) { if (cdevsw[maj].d_open == wsdisplayopen) @@ -492,9 +485,8 @@ dvboxcnprobe(struct consdev *cp) cp->cn_pri = CN_INTERNAL; #ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) { - force = conforced = 1; - } + if (CONSCODE == CONSCODE_INTERNAL) + cp->cn_pri = CN_FORCED; #endif /* @@ -504,8 +496,7 @@ dvboxcnprobe(struct consdev *cp) * Since we're internal, we set the saved size to 0 * so they don't attempt to unmap our fixed VA later. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || - force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; if (convasize) iounmap(conaddr, convasize); diff --git a/sys/arch/hp300/dev/gbox.c b/sys/arch/hp300/dev/gbox.c index fcb0a634271..f954da36a6a 100644 --- a/sys/arch/hp300/dev/gbox.c +++ b/sys/arch/hp300/dev/gbox.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gbox.c,v 1.11 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: gbox.c,v 1.12 2005/12/30 18:14:09 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -448,7 +448,7 @@ gbox_console_scan(int scode, caddr_t va, void *arg) { struct diofbreg *fbr = (struct diofbreg *)va; struct consdev *cp = arg; - int force = 0, pri; + u_int pri; if (fbr->id != GRFHWID || fbr->fbid != GID_GATORBOX) return (0); @@ -459,10 +459,8 @@ gbox_console_scan(int scode, caddr_t va, void *arg) /* * Raise our priority, if appropriate. */ - if (scode == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (scode == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -473,7 +471,7 @@ gbox_console_scan(int scode, caddr_t va, void *arg) * If our priority is higher than the currently-remembered * console, stash our priority. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = scode; return (DIO_SIZE(scode, va)); @@ -487,11 +485,6 @@ gboxcnprobe(struct consdev *cp) int maj; caddr_t va; struct diofbreg *fbr; - int force = 0; - - /* Abort early if console already forced. */ - if (conforced) - return; for (maj = 0; maj < nchrdev; maj++) { if (cdevsw[maj].d_open == wsdisplayopen) @@ -512,9 +505,8 @@ gboxcnprobe(struct consdev *cp) cp->cn_pri = CN_INTERNAL; #ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) { - force = conforced = 1; - } + if (CONSCODE == CONSCODE_INTERNAL) + cp->cn_pri = CN_FORCED; #endif /* @@ -524,8 +516,7 @@ gboxcnprobe(struct consdev *cp) * Since we're internal, we set the saved size to 0 * so they don't attempt to unmap our fixed VA later. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) - || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; if (convasize) iounmap(conaddr, convasize); diff --git a/sys/arch/hp300/dev/hyper.c b/sys/arch/hp300/dev/hyper.c index 91d6f579160..5653e8b2a34 100644 --- a/sys/arch/hp300/dev/hyper.c +++ b/sys/arch/hp300/dev/hyper.c @@ -1,4 +1,4 @@ -/* $OpenBSD: hyper.c,v 1.12 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: hyper.c,v 1.13 2005/12/30 18:14:09 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -495,7 +495,7 @@ hyper_console_scan(int scode, caddr_t va, void *arg) { struct diofbreg *fbr = (struct diofbreg *)va; struct consdev *cp = arg; - int force = 0, pri; + u_int pri; if (fbr->id != GRFHWID || fbr->fbid != GID_HYPERION) return (0); @@ -506,10 +506,8 @@ hyper_console_scan(int scode, caddr_t va, void *arg) /* * Raise our prioity, if appropriate. */ - if (scode == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (scode == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -520,7 +518,7 @@ hyper_console_scan(int scode, caddr_t va, void *arg) * If our priority is higher than the currently-remembered * console, stash our priority. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = scode; return (DIO_SIZE(scode, va)); @@ -533,10 +531,6 @@ hypercnprobe(struct consdev *cp) { int maj; - /* Abort early if console is already forced. */ - if (conforced) - return; - for (maj = 0; maj < nchrdev; maj++) { if (cdevsw[maj].d_open == wsdisplayopen) break; diff --git a/sys/arch/hp300/dev/rbox.c b/sys/arch/hp300/dev/rbox.c index 01068802715..4d17431e8cd 100644 --- a/sys/arch/hp300/dev/rbox.c +++ b/sys/arch/hp300/dev/rbox.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rbox.c,v 1.11 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: rbox.c,v 1.12 2005/12/30 18:14:09 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -391,7 +391,7 @@ rbox_console_scan(int scode, caddr_t va, void *arg) { struct diofbreg *fbr = (struct diofbreg *)va; struct consdev *cp = arg; - int force = 0, pri; + u_int pri; if (fbr->id != GRFHWID || fbr->fbid != GID_RENAISSANCE) return (0); @@ -402,10 +402,8 @@ rbox_console_scan(int scode, caddr_t va, void *arg) /* * Raise our priority, if appropriate. */ - if (scode == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (scode == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -416,7 +414,7 @@ rbox_console_scan(int scode, caddr_t va, void *arg) * If our priority is higher than the currently-remembered * console, stash our priority. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = scode; return (DIO_SIZE(scode, va)); @@ -430,11 +428,6 @@ rboxcnprobe(struct consdev *cp) int maj; caddr_t va; struct diofbreg *fbr; - int force = 0; - - /* Abort early if console is already forced. */ - if (conforced) - return; for (maj = 0; maj < nchrdev; maj++) { if (cdevsw[maj].d_open == wsdisplayopen) @@ -455,9 +448,8 @@ rboxcnprobe(struct consdev *cp) cp->cn_pri = CN_INTERNAL; #ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) { - force = conforced = 1; - } + if (CONSCODE == CONSCODE_INTERNAL) + cp->cn_pri = CN_FORCED; #endif /* @@ -467,8 +459,7 @@ rboxcnprobe(struct consdev *cp) * Since we're internal, we set the saved size to 0 * so they don't attempt to unmap our fixed VA later. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) - || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; if (convasize) iounmap(conaddr, convasize); diff --git a/sys/arch/hp300/dev/sti_sgc.c b/sys/arch/hp300/dev/sti_sgc.c index bf9d72d0f7e..7e57692ae77 100644 --- a/sys/arch/hp300/dev/sti_sgc.c +++ b/sys/arch/hp300/dev/sti_sgc.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sti_sgc.c,v 1.4 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: sti_sgc.c,v 1.5 2005/12/30 18:14:09 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat @@ -166,8 +166,8 @@ sti_console_scan(int slot, caddr_t va, void *arg) struct consdev *cp = arg; bus_space_tag_t iot; bus_space_handle_t ioh; - int force = 0, pri; int devtype; + u_int pri; iot = HP300_BUS_TAG(HP300_BUS_SGC, slot); @@ -189,10 +189,8 @@ sti_console_scan(int slot, caddr_t va, void *arg) /* * Raise our priority, if appropriate. */ - if (SGC_SLOT_TO_CONSCODE(slot) == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (SGC_SLOT_TO_CONSCODE(slot) == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -203,7 +201,7 @@ sti_console_scan(int slot, caddr_t va, void *arg) * If our priority is higher than the currently-remembered * console, stash our priority. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = SGC_SLOT_TO_CONSCODE(slot); return (1); @@ -217,10 +215,6 @@ sticnprobe(struct consdev *cp) { int maj; - /* Abort early if the console is already forced. */ - if (conforced) - return; - for (maj = 0; maj < nchrdev; maj++) { if (cdevsw[maj].d_open == wsdisplayopen) break; diff --git a/sys/arch/hp300/dev/topcat.c b/sys/arch/hp300/dev/topcat.c index 795071da3b4..702bd35be2f 100644 --- a/sys/arch/hp300/dev/topcat.c +++ b/sys/arch/hp300/dev/topcat.c @@ -1,4 +1,4 @@ -/* $OpenBSD: topcat.c,v 1.12 2005/12/30 18:03:33 miod Exp $ */ +/* $OpenBSD: topcat.c,v 1.13 2005/12/30 18:14:09 miod Exp $ */ /* * Copyright (c) 2005, Miodrag Vallat. @@ -509,7 +509,7 @@ topcat_console_scan(int scode, caddr_t va, void *arg) { struct diofbreg *fbr = (struct diofbreg *)va; struct consdev *cp = arg; - int force = 0, pri; + u_int pri; if (fbr->id != GRFHWID) return (0); @@ -531,10 +531,8 @@ topcat_console_scan(int scode, caddr_t va, void *arg) /* * Raise our priority, if appropriate. */ - if (scode == CONSCODE) { - pri = CN_REMOTE; - force = conforced = 1; - } + if (scode == CONSCODE) + pri = CN_FORCED; #endif /* Only raise priority. */ @@ -545,7 +543,7 @@ topcat_console_scan(int scode, caddr_t va, void *arg) * If our priority is higher than the currently-remembered * console, stash our priority. */ - if (((cn_tab == NULL) || (cp->cn_pri > cn_tab->cn_pri)) || force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; conscode = scode; return (DIO_SIZE(scode, va)); @@ -559,11 +557,6 @@ topcatcnprobe(struct consdev *cp) int maj; caddr_t va; struct diofbreg *fbr; - int force = 0; - - /* Abort early if the console is already forced. */ - if (conforced) - return; for (maj = 0; maj < nchrdev; maj++) { if (cdevsw[maj].d_open == wsdisplayopen) @@ -588,9 +581,8 @@ topcatcnprobe(struct consdev *cp) cp->cn_pri = CN_INTERNAL; #ifdef CONSCODE - if (CONSCODE == CONSCODE_INTERNAL) { - force = conforced = 1; - } + if (CONSCODE == CONSCODE_INTERNAL) + cp->cn_pri = CN_FORCED; #endif /* @@ -600,8 +592,7 @@ topcatcnprobe(struct consdev *cp) * Since we're internal, we set the saved size to 0 * so they don't attempt to unmap our fixed VA later. */ - if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri || - force) { + if (cn_tab == NULL || cp->cn_pri > cn_tab->cn_pri) { cn_tab = cp; if (convasize) iounmap(conaddr, convasize); |