diff options
author | jhb <jhb@FreeBSD.org> | 2006-10-10 23:23:12 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2006-10-10 23:23:12 +0000 |
commit | 920b219fcf73ff01950bf272923fd4b46e75fb62 (patch) | |
tree | eb9c93770a076684865872d673c762161b0390f7 /sys/i386/include | |
parent | 98af27d199c605e0cfa80eee1e631093cf1bf30a (diff) | |
download | FreeBSD-src-920b219fcf73ff01950bf272923fd4b46e75fb62.zip FreeBSD-src-920b219fcf73ff01950bf272923fd4b46e75fb62.tar.gz |
Change the x86 interrupt code to suspend/resume interrupt controllers
(PICs) rather than interrupt sources. This allows interrupt controllers
with no interrupt pics (such as the 8259As when APIC is in use) to
participate in suspend/resume.
- Always register the 8259A PICs even if we don't use any of their pins.
- Explicitly reset the 8259As on resume on amd64 if 'device atpic' isn't
included.
- Add a "dummy" PIC for the local APIC on the BSP to reset the local APIC
on resume. This gets suspend/resume working with APIC on UP systems.
SMP still needs more work to bring the APs back to life.
The MFC after is tentative.
Tested by: anholt (i386)
Submitted by: Andrea Bittau <a.bittau at cs.ucl.ac.uk> (3)
MFC after: 1 week
Diffstat (limited to 'sys/i386/include')
-rw-r--r-- | sys/i386/include/apicvar.h | 2 | ||||
-rw-r--r-- | sys/i386/include/intr_machdep.h | 6 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/i386/include/apicvar.h b/sys/i386/include/apicvar.h index bca7bb1..99c3028 100644 --- a/sys/i386/include/apicvar.h +++ b/sys/i386/include/apicvar.h @@ -210,7 +210,7 @@ int lapic_set_lvt_polarity(u_int apic_id, u_int lvt, int lapic_set_lvt_triggermode(u_int apic_id, u_int lvt, enum intr_trigger trigger); void lapic_set_tpr(u_int vector); -void lapic_setup(void); +void lapic_setup(int boot); int lapic_setup_clock(void); #endif /* !LOCORE */ diff --git a/sys/i386/include/intr_machdep.h b/sys/i386/include/intr_machdep.h index 886811c..4884fd5 100644 --- a/sys/i386/include/intr_machdep.h +++ b/sys/i386/include/intr_machdep.h @@ -81,11 +81,12 @@ struct pic { void (*pic_enable_intr)(struct intsrc *); int (*pic_vector)(struct intsrc *); int (*pic_source_pending)(struct intsrc *); - void (*pic_suspend)(struct intsrc *); - void (*pic_resume)(struct intsrc *); + void (*pic_suspend)(struct pic *); + void (*pic_resume)(struct pic *); int (*pic_config_intr)(struct intsrc *, enum intr_trigger, enum intr_polarity); void (*pic_assign_cpu)(struct intsrc *, u_int apic_id); + STAILQ_ENTRY(pic) pics; }; /* Flags for pic_disable_source() */ @@ -130,6 +131,7 @@ int intr_config_intr(int vector, enum intr_trigger trig, enum intr_polarity pol); void intr_execute_handlers(struct intsrc *isrc, struct trapframe *frame); struct intsrc *intr_lookup_source(int vector); +int intr_register_pic(struct pic *pic); int intr_register_source(struct intsrc *isrc); int intr_remove_handler(void *cookie); void intr_resume(void); |