branch update for HEAD-2003021201
[reactos.git] / ntoskrnl / include / internal / i386 / ke.h
1 /*
2  *  ReactOS kernel
3  *  Copyright (C) 1998, 1999, 2000, 2001 ReactOS Team
4  *
5  *  This program is free software; you can redistribute it and/or modify
6  *  it under the terms of the GNU General Public License as published by
7  *  the Free Software Foundation; either version 2 of the License, or
8  *  (at your option) any later version.
9  *
10  *  This program is distributed in the hope that it will be useful,
11  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13  *  GNU General Public License for more details.
14  *
15  *  You should have received a copy of the GNU General Public License
16  *  along with this program; if not, write to the Free Software
17  *  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18  */
19 #ifndef __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H
20 #define __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H
21
22 #if __GNUC__ >=3
23 #pragma GCC system_header
24 #endif
25
26 #define KTRAP_FRAME_DEBUGEBP     (0x0)
27 #define KTRAP_FRAME_DEBUGEIP     (0x4)
28 #define KTRAP_FRAME_DEBUGARGMARK (0x8)
29 #define KTRAP_FRAME_DEBUGPOINTER (0xC)
30 #define KTRAP_FRAME_TEMPCS       (0x10)
31 #define KTRAP_FRAME_TEMPEIP      (0x14)
32 #define KTRAP_FRAME_DR0          (0x18)
33 #define KTRAP_FRAME_DR1          (0x1C)
34 #define KTRAP_FRAME_DR2          (0x20)
35 #define KTRAP_FRAME_DR3          (0x24)
36 #define KTRAP_FRAME_DR6          (0x28)
37 #define KTRAP_FRAME_DR7          (0x2C)
38 #define KTRAP_FRAME_GS           (0x30)
39 #define KTRAP_FRAME_RESERVED1    (0x32)
40 #define KTRAP_FRAME_ES           (0x34)
41 #define KTRAP_FRAME_RESERVED2    (0x36)
42 #define KTRAP_FRAME_DS           (0x38)
43 #define KTRAP_FRAME_RESERVED3    (0x3A)
44 #define KTRAP_FRAME_EDX          (0x3C)
45 #define KTRAP_FRAME_ECX          (0x40)
46 #define KTRAP_FRAME_EAX          (0x44)
47 #define KTRAP_FRAME_PREVIOUS_MODE (0x48)
48 #define KTRAP_FRAME_EXCEPTION_LIST (0x4C)
49 #define KTRAP_FRAME_FS             (0x50)
50 #define KTRAP_FRAME_RESERVED4      (0x52)
51 #define KTRAP_FRAME_EDI            (0x54)
52 #define KTRAP_FRAME_ESI            (0x58)
53 #define KTRAP_FRAME_EBX            (0x5C)
54 #define KTRAP_FRAME_EBP            (0x60)
55 #define KTRAP_FRAME_ERROR_CODE     (0x64)
56 #define KTRAP_FRAME_EIP            (0x68)
57 #define KTRAP_FRAME_CS             (0x6C)
58 #define KTRAP_FRAME_EFLAGS         (0x70)
59 #define KTRAP_FRAME_ESP            (0x74)
60 #define KTRAP_FRAME_SS             (0x78)
61 #define KTRAP_FRAME_RESERVED5      (0x7A)
62 #define KTRAP_FRAME_V86_ES         (0x7C)
63 #define KTRAP_FRAME_RESERVED6      (0x7E)
64 #define KTRAP_FRAME_V86_DS         (0x80)
65 #define KTRAP_FRAME_RESERVED7      (0x82)
66 #define KTRAP_FRAME_V86_FS         (0x84)
67 #define KTRAP_FRAME_RESERVED8      (0x86)
68 #define KTRAP_FRAME_V86_GS         (0x88)
69 #define KTRAP_FRAME_RESERVED9      (0x8A)
70 #define KTRAP_FRAME_SIZE           (0x8C)
71
72 #ifndef __ASM__
73
74 typedef struct _KTRAP_FRAME
75 {
76    PVOID DebugEbp;
77    PVOID DebugEip;
78    PVOID DebugArgMark;
79    PVOID DebugPointer;
80    PVOID TempCs;
81    PVOID TempEip;
82    PVOID Dr0;
83    PVOID Dr1;
84    PVOID Dr2;
85    PVOID Dr3;
86    PVOID Dr6;
87    PVOID Dr7;
88    USHORT Gs;
89    USHORT Reserved1;
90    USHORT Es;
91    USHORT Reserved2;
92    USHORT Ds;
93    USHORT Reserved3;
94    ULONG Edx;
95    ULONG Ecx;
96    ULONG Eax;
97    ULONG PreviousMode;
98    PVOID ExceptionList;
99    USHORT Fs;
100    USHORT Reserved4;
101    ULONG Edi;
102    ULONG Esi;
103    ULONG Ebx;
104    ULONG Ebp;
105    ULONG ErrorCode;
106    ULONG Eip;
107    ULONG Cs;
108    ULONG Eflags;
109    ULONG Esp;
110    USHORT Ss;
111    USHORT Reserved5;
112    USHORT V86_Es;
113    USHORT Reserved6;
114    USHORT V86_Ds;
115    USHORT Reserved7;
116    USHORT V86_Fs;
117    USHORT Reserved8;
118    USHORT V86_Gs;
119    USHORT Reserved9;
120 } KTRAP_FRAME, *PKTRAP_FRAME;
121
122 struct _KPCR;
123 VOID
124 KiInitializeGdt(struct _KPCR* Pcr);
125 VOID
126 Ki386ApplicationProcessorInitializeTSS(VOID);
127 VOID
128 Ki386BootInitializeTSS(VOID);
129 VOID
130 KiGdtPrepareForApplicationProcessorInit(ULONG Id);
131 VOID
132 Ki386InitializeLdt(VOID);
133 ULONG KeAllocateGdtSelector(ULONG Desc[2]);
134 VOID KeFreeGdtSelector(ULONG Entry);
135 VOID
136 NtEarlyInitVdm(VOID);
137
138 #endif /* __ASM__ */
139
140 #endif /* __NTOSKRNL_INCLUDE_INTERNAL_I386_KE_H */
141
142 /* EOF */