ld-tool portability fix: MacOS build experience
[lunaix-os.git] / lunaix-os / arch / i386 / includes / sys / x86_isa.h
index 0c53d9dc1ea1cad4839ebb286dc3439eaffe5694..7db8807e0f531197d0e35527c6b931b200b57498 100644 (file)
 
 #ifndef __ASM__
 #include <lunaix/types.h>
 
 #ifndef __ASM__
 #include <lunaix/types.h>
+
+#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;
 struct x86_tss
 {
   u32_t link;
@@ -20,6 +34,21 @@ struct x86_tss
 } __attribute__((packed));
 
 void tss_update_esp(u32_t esp0);
 } __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 */
 #endif
 
 #endif /* __LUNAIX_I386_ASM_H */