X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/6c506d8916fb114675e93d0e2cb20831d4022294..d1b1c8d9119229dbeed06cd252917e54a1cb77f6:/lunaix-os/arch/i386/includes/sys/x86_isa.h?ds=sidebyside diff --git a/lunaix-os/arch/i386/includes/sys/x86_isa.h b/lunaix-os/arch/i386/includes/sys/x86_isa.h index 0c53d9d..7db8807 100644 --- a/lunaix-os/arch/i386/includes/sys/x86_isa.h +++ b/lunaix-os/arch/i386/includes/sys/x86_isa.h @@ -11,6 +11,20 @@ #ifndef __ASM__ #include + +#define IRQ_TRIG_EDGE 0b0 +#define IRQ_TRIG_LEVEL 0b1 + +#define IRQ_TYPE_FIXED (0b01 << 1) +#define IRQ_TYPE_NMI (0b11 << 1) +#define IRQ_TYPE (0b11 << 1) + +#define IRQ_VE_HI (0b1 << 3) +#define IRQ_VE_LO (0b0 << 3) + +#define IRQ_DEFAULT (IRQ_TRIG_EDGE | IRQ_TYPE_FIXED | IRQ_VE_HI) + + struct x86_tss { u32_t link; @@ -20,6 +34,21 @@ struct x86_tss } __attribute__((packed)); void tss_update_esp(u32_t esp0); + +struct x86_intc +{ + char* name; + void* data; + + void (*irq_attach)(struct x86_intc*, + int irq, + int iv, + cpu_t dest, + u32_t flags); + void (*notify_eoi)(struct x86_intc*, cpu_t id, int iv); +}; + + #endif #endif /* __LUNAIX_I386_ASM_H */