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 / tss.h
1 /*
2  * x86 TSS data structure and routines
3  * Copyright (c) 2001,2004 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_TSS_H
11 #define GEEKOS_TSS_H
12
13 /*
14  * Source: _Protected Mode Software Architecture_ by Tom Shanley,
15  * ISBN 020155447X.
16  */
17
18 /*
19  * NOTE: all reserved fields must be set to zero.
20  */
21
22 struct TSS {
23     /*
24      * Link to nested task.  For example, if an interrupt is handled
25      * by a task gate, the link field will contain the selector for
26      * the TSS of the interrupted task.
27      */
28     ushort_t link;
29     ushort_t reserved1;
30
31     /* Stacks for privilege levels.  esp0/ss0 specifies the kernel stack. */
32     ulong_t esp0;
33     ushort_t ss0;
34     ushort_t reserved2;
35     ulong_t esp1;
36     ushort_t ss1;
37     ushort_t reserved3;
38     ulong_t esp2;
39     ushort_t ss2;
40     ushort_t reserved4;
41
42     /* Page directory register. */
43     ulong_t cr3;
44
45     /* General processor registers. */
46     ulong_t eip;
47     ulong_t eflags;
48     ulong_t eax;
49     ulong_t ecx;
50     ulong_t edx;
51     ulong_t ebx;
52     ulong_t esp;
53     ulong_t ebp;
54     ulong_t esi;
55     ulong_t edi;
56
57     /* Segment registers and padding. */
58     ushort_t es;
59     ushort_t reserved5;
60     ushort_t cs;
61     ushort_t reserved6;
62     ushort_t ss;
63     ushort_t reserved7;
64     ushort_t ds;
65     ushort_t reserved8;
66     ushort_t fs;
67     ushort_t reserved9;
68     ushort_t gs;
69     ushort_t reserved10;
70
71     /* GDT selector for the LDT descriptor. */
72     ushort_t ldt;
73     ushort_t reserved11;
74
75     /*
76      * The debug trap bit causes a debug exception upon a switch
77      * to the task specified by this TSS.
78      */
79     uint_t debugTrap : 1;
80     uint_t reserved12 : 15;
81
82     /* Offset in the TSS specifying where the io map is located. */
83     ushort_t ioMapBase;
84 };
85
86 void Init_TSS(void);
87 void Set_Kernel_Stack_Pointer(ulong_t esp0);
88
89 #endif  /* GEEKOS_TSS_H */