Changeset View
Changeset View
Standalone View
Standalone View
sys/x86/isa/atpic.c
Show First 20 Lines • Show All 585 Lines • ▼ Show 20 Lines | atpic_attach(device_t dev) | ||||
/* Try to allocate our IRQ and then free it. */ | /* Try to allocate our IRQ and then free it. */ | ||||
rid = 0; | rid = 0; | ||||
res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); | res = bus_alloc_resource_any(dev, SYS_RES_IRQ, &rid, 0); | ||||
if (res != NULL) | if (res != NULL) | ||||
bus_release_resource(dev, SYS_RES_IRQ, rid, res); | bus_release_resource(dev, SYS_RES_IRQ, rid, res); | ||||
return (0); | return (0); | ||||
} | } | ||||
/* | |||||
* Return a bitmap of the current interrupt requests. This is 8259-specific | |||||
* and is only suitable for use at probe time. | |||||
*/ | |||||
intrmask_t | |||||
isa_irq_pending(void) | |||||
{ | |||||
u_char irr1; | |||||
u_char irr2; | |||||
irr1 = inb(IO_ICU1); | |||||
irr2 = inb(IO_ICU2); | |||||
return ((irr2 << 8) | irr1); | |||||
} | |||||
static device_method_t atpic_methods[] = { | static device_method_t atpic_methods[] = { | ||||
/* Device interface */ | /* Device interface */ | ||||
DEVMETHOD(device_probe, atpic_probe), | DEVMETHOD(device_probe, atpic_probe), | ||||
DEVMETHOD(device_attach, atpic_attach), | DEVMETHOD(device_attach, atpic_attach), | ||||
DEVMETHOD(device_detach, bus_generic_detach), | DEVMETHOD(device_detach, bus_generic_detach), | ||||
DEVMETHOD(device_shutdown, bus_generic_shutdown), | DEVMETHOD(device_shutdown, bus_generic_shutdown), | ||||
DEVMETHOD(device_suspend, bus_generic_suspend), | DEVMETHOD(device_suspend, bus_generic_suspend), | ||||
DEVMETHOD(device_resume, bus_generic_resume), | DEVMETHOD(device_resume, bus_generic_resume), | ||||
Show All 15 Lines |