X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/34f6af4f61e0eec9c96113e07f140b609b4113c8..836d44ecb7a2c37427f6baf8b25e872e9e943d5b:/lunaix-os/arch/x86/exceptions/isrm.c diff --git a/lunaix-os/arch/x86/exceptions/isrm.c b/lunaix-os/arch/x86/exceptions/isrm.c index dea130c..cd2d81b 100644 --- a/lunaix-os/arch/x86/exceptions/isrm.c +++ b/lunaix-os/arch/x86/exceptions/isrm.c @@ -1,9 +1,7 @@ #include -#include -#include +#include #include "asm/x86.h" -#include "asm/soc/ioapic.h" #include "asm/soc/apic.h" /* @@ -17,8 +15,6 @@ static char iv_bmp[(IV_EX_END - IV_BASE_END) / 8]; static isr_cb handlers[TOTAL_IV]; static ptr_t ivhand_payload[TOTAL_IV]; -static struct x86_intc arch_intc_ctx; - extern void intr_routine_fallback(const struct hart_state* state); @@ -95,21 +91,6 @@ isrm_ivfree(int iv) handlers[iv] = intr_routine_fallback; } -int -isrm_bindirq(int irq, isr_cb irq_handler) -{ - int iv; - if (!(iv = isrm_ivexalloc(irq_handler))) { - fail("out of IV resource."); - return 0; // never reach - } - - // fixed, edge trigged, polarity=high - isrm_irq_attach(irq, iv, 0, IRQ_DEFAULT); - - return iv; -} - void isrm_bindiv(int iv, isr_cb handler) { @@ -145,35 +126,4 @@ isrm_set_payload(int iv, ptr_t payload) assert(iv < 256); ivhand_payload[iv] = payload; -} - -void -isrm_irq_attach(int irq, int iv, cpu_t dest, u32_t flags) -{ - arch_intc_ctx.irq_attach(&arch_intc_ctx, irq, iv, dest, flags); -} - -void -isrm_notify_eoi(cpu_t id, int iv) -{ - arch_intc_ctx.notify_eoi(&arch_intc_ctx, id, iv); -} - -void -isrm_notify_eos(cpu_t id) -{ - isrm_notify_eoi(id, LUNAIX_SCHED); -} - - -static void -__intc_init() -{ - apic_init(); - ioapic_init(); - - arch_intc_ctx.name = "i386_apic"; - arch_intc_ctx.irq_attach = ioapic_irq_remap; - arch_intc_ctx.notify_eoi = apic_on_eoi; -} -owloysius_fetch_init(__intc_init, on_earlyboot); \ No newline at end of file +} \ No newline at end of file