2 * GeekOS IDT initialization code
3 * Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
6 * This is free software. You are permitted to use,
7 * redistribute, and modify it as specified in the file "COPYING".
13 #include <geekos/int.h>
16 * We'll handle all possible interrupts.
18 #define NUM_IDT_ENTRIES 256
21 * Exceptions range from 0-17
23 #define FIRST_EXCEPTION 0
24 #define NUM_EXCEPTIONS 18
27 * External IRQs range from 32-47
29 #define FIRST_EXTERNAL_INT 32
30 #define NUM_EXTERNAL_INTS 16
32 struct Interrupt_Gate {
34 ushort_t segmentSelector;
35 unsigned reserved : 5;
36 unsigned signature : 8;
42 union IDT_Descriptor {
43 struct Interrupt_Gate ig;
45 * In theory we could have members for trap gates
46 * and task gates if we wanted.
56 void Init_Interrupt_Gate(union IDT_Descriptor* desc, ulong_t addr,
58 void Install_Interrupt_Handler(int interrupt, Interrupt_Handler handler);
61 * This is defined in lowlevel.asm.
62 * The parameter should consist of 16 bit base,
63 * followed by 32 bit base address, describing the IDT.
65 void Load_IDTR(ushort_t* limitAndBase);
67 #endif /* GEEKOS_IDT_H */