diff options
author | Damien Zammit <damien@zamaudio.com> | 2021-04-04 15:08:12 +1000 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2021-04-04 16:27:17 +0200 |
commit | 214866d58ac2bd1060132b250bf391a495110015 (patch) | |
tree | faa4509549a8d4b580b4b52e00162efd30d3f480 /x86_64 | |
parent | 71db59f69602e54c33ba707c8e4a7a66f6c9ca0b (diff) | |
download | gnumach-214866d58ac2bd1060132b250bf391a495110015.tar.gz gnumach-214866d58ac2bd1060132b250bf391a495110015.tar.bz2 gnumach-214866d58ac2bd1060132b250bf391a495110015.zip |
Add ioapic support disabled by default
Use --enable-ncpus=x --enable-apic where x > 1 for SMP+APIC support.
Use neither for no SMP and old PIC support.
Message-Id: <20210404050812.145483-1-damien@zamaudio.com>
Diffstat (limited to 'x86_64')
-rw-r--r-- | x86_64/interrupt.S | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/x86_64/interrupt.S b/x86_64/interrupt.S index e634e34b..779eae67 100644 --- a/x86_64/interrupt.S +++ b/x86_64/interrupt.S @@ -16,7 +16,11 @@ #include <mach/machine/asm.h> #include <i386/ipl.h> -#include <i386/pic.h> +#ifdef APIC +# include <i386/apic.h> +#else +# include <i386/pic.h> +#endif #include <i386/i386asm.h> #define READ_ISR (OCW_TEMPLATE|READ_NEXT_RD|READ_IS_ONRD) @@ -27,6 +31,10 @@ * On entry, %rax contains the irq number. */ ENTRY(interrupt) +#ifdef APIC + cmpl $255,%eax /* was this a spurious intr? */ + je _null_eoi /* if so, null eoi handler */ +#endif pushq %rax /* save irq number */ call spl7 /* set ipl */ pushq %rax /* save previous ipl */ @@ -45,6 +53,7 @@ ENTRY(interrupt) cli /* XXX no more nested interrupts */ popq %rcx /* restore irq number */ +#ifndef APIC movl $1,%eax shll %cl,%eax /* get corresponding IRQ mask */ orl EXT(curr_pic_mask),%eax /* add current mask */ @@ -81,4 +90,17 @@ ENTRY(interrupt) outb %al,$(PIC_MASTER_OCW) /* unmask master */ 2: ret +#else + cmpl $16,%ecx /* was this a low ISA intr? */ + jl _isa_eoi /* no, must be PCI */ + ret /* NB: let irq_acknowledge handle pci EOI */ +_isa_eoi: + movl %ecx,%edi /* load irq number as 1st arg */ + call EXT(ioapic_irq_eoi) /* ioapic irq specific EOI */ + call EXT(lapic_eoi) /* lapic broadcast EOI */ + ret +_null_eoi: + call EXT(lapic_eoi) /* lapic broadcast EOI */ + ret +#endif END(interrupt) |