diff options
author | jhb <jhb@FreeBSD.org> | 2005-01-18 20:24:47 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2005-01-18 20:24:47 +0000 |
commit | 5a3bc2892ea0f6b77fd8dfd236132abbac0d7455 (patch) | |
tree | 536171824438871e1f5eafb3dfb2bb55536ecaad /sys/i386 | |
parent | 557809eac4b7b9411efe30f91c98a42fe9a2e05d (diff) | |
download | FreeBSD-src-5a3bc2892ea0f6b77fd8dfd236132abbac0d7455.zip FreeBSD-src-5a3bc2892ea0f6b77fd8dfd236132abbac0d7455.tar.gz |
Tweak the ELCR support slightly. Explicitly probe the ELCR during boot
instead of burying that in the atpic(4) code as atpic(4) is not the only
user of elcr(4). Change the elcr(4) code to export a global elcr_found
variable that other code can check to see if a valid ELCR was found.
MFC after: 1 month
Diffstat (limited to 'sys/i386')
-rw-r--r-- | sys/i386/i386/machdep.c | 1 | ||||
-rw-r--r-- | sys/i386/include/intr_machdep.h | 1 | ||||
-rw-r--r-- | sys/i386/isa/atpic.c | 10 | ||||
-rw-r--r-- | sys/i386/isa/elcr.c | 6 |
4 files changed, 6 insertions, 12 deletions
diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 80099aa..9c3b98a 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -2098,6 +2098,7 @@ init386(first) printf("WARNING: loader(8) metadata is missing!\n"); #ifdef DEV_ISA + elcr_probe(); atpic_startup(); #endif diff --git a/sys/i386/include/intr_machdep.h b/sys/i386/include/intr_machdep.h index a988063..ff19346 100644 --- a/sys/i386/include/intr_machdep.h +++ b/sys/i386/include/intr_machdep.h @@ -84,6 +84,7 @@ struct intsrc { struct intrframe; extern struct mtx icu_lock; +extern int elcr_found; /* XXX: The elcr_* prototypes probably belong somewhere else. */ int elcr_probe(void); diff --git a/sys/i386/isa/atpic.c b/sys/i386/isa/atpic.c index 8f456ac..d326c68 100644 --- a/sys/i386/isa/atpic.c +++ b/sys/i386/isa/atpic.c @@ -112,9 +112,6 @@ __FBSDID("$FreeBSD$"); static void atpic_init(void *dummy); unsigned int imen; /* XXX */ -#ifndef PC98 -static int using_elcr; -#endif inthand_t IDTVEC(atpic_intr0), IDTVEC(atpic_intr1), IDTVEC(atpic_intr2), @@ -313,7 +310,7 @@ atpic_resume(struct intsrc *isrc) if (ai->at_irq == 0) { i8259_init(ap, ap == &atpics[SLAVE]); #ifndef PC98 - if (ap == &atpics[SLAVE] && using_elcr) + if (ap == &atpics[SLAVE] && elcr_found) elcr_resume(); #endif } @@ -369,7 +366,7 @@ atpic_config_intr(struct intsrc *isrc, enum intr_trigger trig, vector); return (EINVAL); } - if (!using_elcr) { + if (!elcr_found) { if (bootverbose) printf("atpic: No ELCR to configure IRQ%u as %s\n", vector, trig == INTR_TRIGGER_EDGE ? "edge/high" : @@ -492,8 +489,7 @@ atpic_startup(void) * assume level trigger for any interrupt that we aren't sure is * edge triggered. */ - if (elcr_probe() == 0) { - using_elcr = 1; + if (elcr_found) { for (i = 0, ai = atintrs; i < NUM_ISA_IRQS; i++, ai++) ai->at_trigger = elcr_read_trigger(i); } else { diff --git a/sys/i386/isa/elcr.c b/sys/i386/isa/elcr.c index 2cfcfa4..266d783 100644 --- a/sys/i386/isa/elcr.c +++ b/sys/i386/isa/elcr.c @@ -57,9 +57,7 @@ __FBSDID("$FreeBSD$"); #define ELCR_MASK(irq) (1 << (irq)) static int elcr_status; -#ifdef INVARIANTS -static int elcr_found; -#endif +int elcr_found; /* * Check to see if we have what looks like a valid ELCR. We do this by @@ -88,9 +86,7 @@ elcr_probe(void) } if (resource_disabled("elcr", 0)) return (ENXIO); -#ifdef INVARIANTS elcr_found = 1; -#endif return (0); } |