diff options
author | jhb <jhb@FreeBSD.org> | 2003-11-12 18:13:57 +0000 |
---|---|---|
committer | jhb <jhb@FreeBSD.org> | 2003-11-12 18:13:57 +0000 |
commit | 9428d57b9b941fb441c38cf34d96d7b30598e9a9 (patch) | |
tree | a6db7827fd51e3e1f795b089a12eea492087060b /sys/i386/isa | |
parent | c33bd8de4149ea8ab805371a6221a72533b3fa40 (diff) | |
download | FreeBSD-src-9428d57b9b941fb441c38cf34d96d7b30598e9a9.zip FreeBSD-src-9428d57b9b941fb441c38cf34d96d7b30598e9a9.tar.gz |
- Move manipulation of td_intr_nesting_level out of assembly interrupt
vector stubs and into the C functions they call.
- Move disabling and EOIing of interrupt sources out of PIC driver entry
points and into intr_execute_handlers(). Intr_execute_handlers() only
disables a source for an interrupt if it is a stray interrupt or has
threaded handlers. Sources with fast handlers no longer disable (mask)
the source while executing the handlers.
- Move the setting of clkintr_pending into intr_execute_handlers() and set
the variable for any interrupt source with a vector of 0. (Should only
be true for IRQ 0.) This fixes clkintr_pending in the NO_MIXED_MODE
case.
- Implement lapic_eoi() and use it to implement ioapic_eoi_source().
- Rename atpic_sched_ithd() to atpic_handle_intr() since it is used to
handle all atpic interrupts and not just threaded ones.
Inspired by: peter's changes to amd64 in p4 (1)
Requested by: bde (2)
Diffstat (limited to 'sys/i386/isa')
-rw-r--r-- | sys/i386/isa/atpic.c | 6 | ||||
-rw-r--r-- | sys/i386/isa/atpic_vector.s | 89 | ||||
-rw-r--r-- | sys/i386/isa/icu.h | 2 |
3 files changed, 24 insertions, 73 deletions
diff --git a/sys/i386/isa/atpic.c b/sys/i386/isa/atpic.c index 3dfb125..0f17af3 100644 --- a/sys/i386/isa/atpic.c +++ b/sys/i386/isa/atpic.c @@ -192,6 +192,10 @@ atpic_eoi_master(struct intsrc *isrc) #endif } +/* + * The data sheet says no auto-EOI on slave, but it sometimes works. + * So, if AUTO_EOI_2 is enabled, we use it. + */ static void atpic_eoi_slave(struct intsrc *isrc) { @@ -327,7 +331,7 @@ atpic_init(void *dummy __unused) SYSINIT(atpic_init, SI_SUB_INTR, SI_ORDER_SECOND + 1, atpic_init, NULL) void -atpic_sched_ithd(struct intrframe iframe) +atpic_handle_intr(struct intrframe iframe) { struct intsrc *isrc; diff --git a/sys/i386/isa/atpic_vector.s b/sys/i386/isa/atpic_vector.s index 2da86e0..d01be39 100644 --- a/sys/i386/isa/atpic_vector.s +++ b/sys/i386/isa/atpic_vector.s @@ -52,50 +52,10 @@ #include "assym.s" -#define IRQ_BIT(irq_num) (1 << ((irq_num) % 8)) -#define IRQ_BYTE(irq_num) ((irq_num) >> 3) - -#ifdef AUTO_EOI_1 - -#define ENABLE_ICU1 /* use auto-EOI to reduce i/o */ -#define OUTB_ICU1 - -#else - -#define ENABLE_ICU1 \ - movb $ICU_EOI,%al ; /* as soon as possible send EOI ... */ \ - OUTB_ICU1 /* ... to clear in service bit */ - -#define OUTB_ICU1 \ - outb %al,$IO_ICU1 - -#endif - -#ifdef AUTO_EOI_2 -/* - * The data sheet says no auto-EOI on slave, but it sometimes works. - */ -#define ENABLE_ICU1_AND_2 ENABLE_ICU1 - -#else - -#define ENABLE_ICU1_AND_2 \ - movb $ICU_EOI,%al ; /* as above */ \ - outb %al,$IO_ICU2 ; /* but do second icu first ... */ \ - OUTB_ICU1 /* ... then first icu (if !AUTO_EOI_1) */ - -#endif - /* * Macros for interrupt interrupt entry, call to handler, and exit. - * - * XXX Most of the parameters here are obsolete. Fix this when we're - * done. - * XXX we really shouldn't return via doreti if we just schedule the - * interrupt handler and don't run anything. We could just do an - * iret. FIXME. */ -#define INTR(irq_num, vec_name, icu, enable_icus, maybe_extra_ipending) \ +#define INTR(irq_num, vec_name) \ .text ; \ SUPERALIGN_TEXT ; \ IDTVEC(vec_name) ; \ @@ -111,42 +71,29 @@ IDTVEC(vec_name) ; \ mov $KPSEL,%ax ; \ mov %ax,%fs ; \ ; \ - maybe_extra_ipending ; \ - movb imen + IRQ_BYTE(irq_num),%al ; \ - orb $IRQ_BIT(irq_num),%al ; \ - movb %al,imen + IRQ_BYTE(irq_num) ; \ - outb %al,$icu+ICU_IMR_OFFSET ; \ - enable_icus ; \ -; \ - movl PCPU(CURTHREAD),%ebx ; \ - incl TD_INTR_NESTING_LEVEL(%ebx) ; \ -; \ FAKE_MCOUNT(13*4(%esp)) ; /* XXX late to avoid double count */ \ pushl $irq_num; /* pass the IRQ */ \ - call atpic_sched_ithd ; \ + call atpic_handle_intr ; \ addl $4, %esp ; /* discard the parameter */ \ ; \ - decl TD_INTR_NESTING_LEVEL(%ebx) ; \ MEXITCOUNT ; \ jmp doreti MCOUNT_LABEL(bintr) -#define CLKINTR_PENDING movl $1,CNAME(clkintr_pending) -/* Threaded interrupts */ - INTR(0,atpic_intr0, IO_ICU1, ENABLE_ICU1, CLKINTR_PENDING) - INTR(1,atpic_intr1, IO_ICU1, ENABLE_ICU1,) - INTR(2,atpic_intr2, IO_ICU1, ENABLE_ICU1,) - INTR(3,atpic_intr3, IO_ICU1, ENABLE_ICU1,) - INTR(4,atpic_intr4, IO_ICU1, ENABLE_ICU1,) - INTR(5,atpic_intr5, IO_ICU1, ENABLE_ICU1,) - INTR(6,atpic_intr6, IO_ICU1, ENABLE_ICU1,) - INTR(7,atpic_intr7, IO_ICU1, ENABLE_ICU1,) - INTR(8,atpic_intr8, IO_ICU2, ENABLE_ICU1_AND_2,) - INTR(9,atpic_intr9, IO_ICU2, ENABLE_ICU1_AND_2,) - INTR(10,atpic_intr10, IO_ICU2, ENABLE_ICU1_AND_2,) - INTR(11,atpic_intr11, IO_ICU2, ENABLE_ICU1_AND_2,) - INTR(12,atpic_intr12, IO_ICU2, ENABLE_ICU1_AND_2,) - INTR(13,atpic_intr13, IO_ICU2, ENABLE_ICU1_AND_2,) - INTR(14,atpic_intr14, IO_ICU2, ENABLE_ICU1_AND_2,) - INTR(15,atpic_intr15, IO_ICU2, ENABLE_ICU1_AND_2,) + INTR(0, atpic_intr0) + INTR(1, atpic_intr1) + INTR(2, atpic_intr2) + INTR(3, atpic_intr3) + INTR(4, atpic_intr4) + INTR(5, atpic_intr5) + INTR(6, atpic_intr6) + INTR(7, atpic_intr7) + INTR(8, atpic_intr8) + INTR(9, atpic_intr9) + INTR(10, atpic_intr10) + INTR(11, atpic_intr11) + INTR(12, atpic_intr12) + INTR(13, atpic_intr13) + INTR(14, atpic_intr14) + INTR(15, atpic_intr15) MCOUNT_LABEL(eintr) diff --git a/sys/i386/isa/icu.h b/sys/i386/isa/icu.h index 8958f4a..512afef 100644 --- a/sys/i386/isa/icu.h +++ b/sys/i386/isa/icu.h @@ -104,7 +104,7 @@ #define HWI_MASK 0xffff /* bits for h/w interrupts */ #ifndef LOCORE -void atpic_sched_ithd(struct intrframe iframe); +void atpic_handle_intr(struct intrframe iframe); void atpic_startup(void); #endif |