1 /* $NetBSD: i82093reg.h,v 1.8 2008/07/03 14:02:25 drochner Exp $ */
3 #include <x86/i82093reg.h>
7 #if defined(_KERNEL_OPT)
8 #include "opt_multiprocessor.h"
11 #define ioapic_asm_ack(num) \
12 movl $0,_C_LABEL(local_apic)+LAPIC_EOI
16 #define ioapic_asm_lock(num) \
19 xchgl %esi,PIC_LOCK(%edi) ;\
23 #define ioapic_asm_unlock(num) \
24 movl $0,PIC_LOCK(%edi)
28 #define ioapic_asm_lock(num)
29 #define ioapic_asm_unlock(num)
31 #endif /* MULTIPROCESSOR */
33 #define ioapic_mask(num) \
34 movl IS_PIC(%ebp),%edi ;\
35 ioapic_asm_lock(num) ;\
36 movl IS_PIN(%ebp),%esi ;\
37 leal 0x10(%esi,%esi,1),%esi ;\
38 movl PIC_IOAPIC(%edi),%edi ;\
39 movl IOAPIC_SC_REG(%edi),%ebx ;\
41 movl IOAPIC_SC_DATA(%edi),%ebx ;\
43 orl $IOAPIC_REDLO_MASK,%esi ;\
45 movl IS_PIC(%ebp),%edi ;\
46 ioapic_asm_unlock(num)
49 * Since this is called just before the interrupt stub exits, AND
50 * because the apic ACK doesn't use any registers, all registers
52 * XXX this is not obvious
54 #define ioapic_unmask(num) \
56 cmpl $IREENT_MAGIC,(TF_ERR+4)(%eax) ;\
58 movl IS_PIC(%ebp),%edi ;\
59 ioapic_asm_lock(num) ;\
60 movl IS_PIN(%ebp),%esi ;\
61 leal 0x10(%esi,%esi,1),%esi ;\
62 movl PIC_IOAPIC(%edi),%edi ;\
63 movl IOAPIC_SC_REG(%edi),%ebx ;\
64 movl IOAPIC_SC_DATA(%edi),%eax ;\
67 andl $~IOAPIC_REDLO_MASK,%edx ;\
70 movl IS_PIC(%ebp),%edi ;\
71 ioapic_asm_unlock(num) ;\