summaryrefslogtreecommitdiff
path: root/src/stem/task/idt.h
diff options
context:
space:
mode:
authorAlexis211 <alexis211@gmail.com>2010-02-03 15:22:30 +0100
committerAlexis211 <alexis211@gmail.com>2010-02-03 15:22:30 +0100
commit9c4310651a91e64c10a17f3190c895a49096aeb1 (patch)
treeaf87d115512249458f80f184d53db403c3f0bb0f /src/stem/task/idt.h
parent7f72a900c12ba62db12df0872cb66f79a27aa9d9 (diff)
downloadTCE-9c4310651a91e64c10a17f3190c895a49096aeb1.tar.gz
TCE-9c4310651a91e64c10a17f3190c895a49096aeb1.zip
Reogranization
Diffstat (limited to 'src/stem/task/idt.h')
-rw-r--r--src/stem/task/idt.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/stem/task/idt.h b/src/stem/task/idt.h
new file mode 100644
index 0000000..bb89013
--- /dev/null
+++ b/src/stem/task/idt.h
@@ -0,0 +1,33 @@
+#ifndef DEF_IDT_H
+#define DEF_IDT_H
+
+#include <types.h>
+
+struct idt_entry {
+ uint16_t base_lo; //Low part of address to jump to
+ uint16_t sel; //Kernel segment selector
+ uint8_t always0;
+ uint8_t flags; //Flags
+ uint16_t base_hi; //High part of address to jump to
+} __attribute__((packed));
+
+struct idt_ptr {
+ uint16_t limit;
+ uint32_t base;
+} __attribute__((packed));
+
+struct registers {
+ uint32_t cr3; //page directory physical address
+ uint32_t ds; // Data segment selector
+ uint32_t edi, esi, ebp, esp, ebx, edx, ecx, eax; // Pushed by pusha.
+ uint32_t int_no, err_code; // Interrupt number and error code (if applicable)
+ uint32_t eip, cs, eflags, useresp, ss; // Pushed by the processor automatically.
+};
+
+typedef void (*int_callback)(struct registers*);
+
+void idt_init();
+void idt_handleIrq(int number, int_callback func);
+
+#endif
+