mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-15 10:17:20 +00:00
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
This commit is contained in:
parent
dcb6fc4fc4
commit
42f0ddd465
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140451
@ -2098,6 +2098,7 @@ init386(first)
|
||||
printf("WARNING: loader(8) metadata is missing!\n");
|
||||
|
||||
#ifdef DEV_ISA
|
||||
elcr_probe();
|
||||
atpic_startup();
|
||||
#endif
|
||||
|
||||
|
@ -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);
|
||||
|
@ -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 {
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user