Palacios Public Git Repository

To checkout Palacios execute

  git clone http://v3vee.org/palacios/palacios.web/palacios.git
This will give you the master branch. You probably want the devel branch or one of the release branches. To switch to the devel branch, simply execute
  cd palacios
  git checkout --track -b devel origin/devel
The other branches are similar.


(no commit message)
[palacios.git] / palacios / include / geekos / idt.h
1 /*
2  * GeekOS IDT initialization code
3  * Copyright (c) 2001, David H. Hovemeyer <daveho@cs.umd.edu>
4  * $Revision: 1.1.1.1 $
5  * 
6  * This is free software.  You are permitted to use,
7  * redistribute, and modify it as specified in the file "COPYING".
8  */
9
10 #ifndef GEEKOS_IDT_H
11 #define GEEKOS_IDT_H
12
13 #include <geekos/int.h>
14
15 /*
16  * We'll handle all possible interrupts.
17  */
18 #define NUM_IDT_ENTRIES 256
19
20 /*
21  * Exceptions range from 0-17
22  */
23 #define FIRST_EXCEPTION 0
24 #define NUM_EXCEPTIONS 18
25
26 /*
27  * External IRQs range from 32-47
28  */
29 #define FIRST_EXTERNAL_INT 32
30 #define NUM_EXTERNAL_INTS 16
31
32 struct Interrupt_Gate {
33     ushort_t offsetLow;
34     ushort_t segmentSelector;
35     unsigned reserved : 5;
36     unsigned signature : 8;
37     unsigned dpl : 2;
38     unsigned present : 1;
39     ushort_t offsetHigh;
40 };
41
42 union IDT_Descriptor {
43     struct Interrupt_Gate ig;
44     /*
45      * In theory we could have members for trap gates
46      * and task gates if we wanted.
47      */
48 };
49
50
51
52 void DumpIDT();
53 void SerialDumpIDT();
54
55 void Init_IDT(void);
56 void Init_Interrupt_Gate(union IDT_Descriptor* desc, ulong_t addr,
57         int dpl);
58 void Install_Interrupt_Handler(int interrupt, Interrupt_Handler handler);
59
60 /*
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.
64  */
65 void Load_IDTR(ushort_t* limitAndBase);
66
67 #endif  /* GEEKOS_IDT_H */