- Fix KeAttackProcess, KeStackAttachProcess, KeUnstackDetachProcess and KeDetachProce...
[reactos.git] / reactos / include / ndk / haltypes.h
1 /*++ NDK Version: 0095
2
3 Copyright (c) Alex Ionescu. All rights reserved.
4
5 Header Name:
6
7 haltypes.h
8
9 Abstract:
10
11 Type definitions for the HAL.
12
13 Author:
14
15 Alex Ionescu (alex.ionescu@reactos.com) 06-Oct-2004
16
17 --*/
18
19 #ifndef _HALTYPES_H
20 #define _HALTYPES_H
21
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26
27 #ifndef NTOS_MODE_USER
28
29 //
30 // Multi-Boot Flags (REMOVE ME)
31 //
32 #ifdef _REACTOS_
33 #define MB_FLAGS_MEM_INFO (0x1)
34 #define MB_FLAGS_BOOT_DEVICE (0x2)
35 #define MB_FLAGS_COMMAND_LINE (0x4)
36 #define MB_FLAGS_MODULE_INFO (0x8)
37 #define MB_FLAGS_AOUT_SYMS (0x10)
38 #define MB_FLAGS_ELF_SYMS (0x20)
39 #define MB_FLAGS_MMAP_INFO (0x40)
40 #define MB_FLAGS_DRIVES_INFO (0x80)
41 #define MB_FLAGS_CONFIG_TABLE (0x100)
42 #define MB_FLAGS_BOOT_LOADER_NAME (0x200)
43 #define MB_FLAGS_APM_TABLE (0x400)
44 #define MB_FLAGS_GRAPHICS_TABLE (0x800)
45 #define MB_FLAGS_ACPI_TABLE (0x1000)
46 #endif
47
48 //
49 // HalShutdownSystem Types
50 //
51 typedef enum _FIRMWARE_ENTRY
52 {
53 HalHaltRoutine,
54 HalPowerDownRoutine,
55 HalRestartRoutine,
56 HalRebootRoutine,
57 HalInteractiveModeRoutine,
58 HalMaximumRoutine
59 } FIRMWARE_REENTRY, *PFIRMWARE_REENTRY;
60
61 //
62 // Hal Private dispatch Table
63 //
64 #define HAL_PRIVATE_DISPATCH_VERSION 2
65 typedef struct _HAL_PRIVATE_DISPATCH
66 {
67 ULONG Version;
68 PVOID HalHandlerForBus;
69 PVOID HalHandlerForBus2;
70 PVOID HalLocateHiberRanges;
71 PVOID HalRegisterBusHandler;
72 PVOID HalSetWakeEnable;
73 PVOID HalSetWakeAlarm;
74 PVOID HalTranslateBusAddress;
75 PVOID HalTranslateBusAddress2;
76 PVOID HalHaltSystem;
77 PVOID Null;
78 PVOID Null2;
79 PVOID HalAllocateMapRegisters;
80 PVOID KdSetupPciDeviceForDebugging;
81 PVOID KdReleasePciDeviceforDebugging;
82 PVOID KdGetAcpiTablePhase0;
83 PVOID HalReferenceHandler;
84 PVOID HalVectorToIDTEntry;
85 PVOID MatchAll;
86 PVOID KdUnmapVirtualAddress;
87 } HAL_PRIVATE_DISPATCH, *PHAL_PRIVATE_DISPATCH;
88
89 #ifndef _REACTOS_
90 //
91 // NLS Data Block
92 //
93 typedef struct _NLS_TABLE_DATA
94 {
95 PVOID AnsiCodePageData;
96 PVOID OemCodePageData;
97 PVOID UnicodeCodePageData;
98 } NLS_TABLE_DATA, *PNLS_TABLE_DATA;
99
100 //
101 // Subsystem Specific Loader Blocks
102 //
103 typedef struct _PROFILE_PARAMETER_BLOCK
104 {
105 USHORT DockData0;
106 USHORT DockData1;
107 USHORT DockData2;
108 USHORT DockData3;
109 ULONG DockData4;
110 ULONG DockData5;
111 } PROFILE_PARAMETER_BLOCK, *PPROFILE_PARAMETER_BLOCK;
112
113 typedef struct _HEADLESS_LOADER_BLOCK
114 {
115 UCHAR Unknown[0xC];
116 } HEADLESS_LOADER_BLOCK, *PHEADLESS_LOADER_BLOCK;
117
118 typedef struct _NETWORK_LOADER_BLOCK
119 {
120 UCHAR Unknown[0xC];
121 } NETWORK_LOADER_BLOCK, *PNETWORK_LOADER_BLOCK;
122
123 //
124 // Extended Loader Parameter Block
125 //
126 typedef struct _LOADER_PARAMETER_EXTENSION
127 {
128 ULONG Size;
129 PROFILE_PARAMETER_BLOCK ProfileParameterBlock;
130 ULONG MajorVersion;
131 ULONG MinorVersion;
132 PVOID SpecialConfigInfFile;
133 ULONG SpecialConfigInfSize;
134 PVOID TriageDumpData;
135 //
136 // NT 5.1
137 //
138 ULONG NumberOfPages;
139 PHEADLESS_LOADER_BLOCK HeadlessLoaderBlock;
140 PVOID Unknown1;
141 PVOID PrefetchDatabaseBase;
142 ULONG PrefetchDatabaseSize;
143 PNETWORK_LOADER_BLOCK NetworkLoaderBlock;
144 //
145 // NT 5.2+
146 //
147 PVOID Reserved[2];
148 LIST_ENTRY FirmwareListEntry;
149 PVOID AcpiTableBase;
150 ULONG AcpiTableSize;
151 } LOADER_PARAMETER_EXTENSION, *PLOADER_PARAMETER_EXTENSION;
152
153 //
154 // Architecture specific Loader Parameter Blocks
155 //
156 typedef struct _I386_LOADER_BLOCK
157 {
158 PVOID CommonDataArea;
159 ULONG MachineType;
160 ULONG Reserved;
161 } I386_LOADER_BLOCK, *PI386_LOADER_BLOCK;
162
163 //
164 // Setup Loader Parameter Block
165 //
166 typedef struct _SETUP_LOADER_BLOCK
167 {
168 ULONG Unknown[139];
169 ULONG Flags;
170 } SETUP_LOADER_BLOCK, *PSETUP_LOADER_BLOCK;
171
172 //
173 // Loader Parameter Block
174 //
175 typedef struct _LOADER_PARAMETER_BLOCK
176 {
177 LIST_ENTRY LoadOrderListHead;
178 LIST_ENTRY MemoryDescriptorListHead;
179 LIST_ENTRY DriverList;
180 PVOID KernelStack;
181 PVOID Prcb;
182 PVOID Process;
183 PVOID Thread;
184 ULONG RegistryLength;
185 PVOID RegistryBase;
186 PCONFIGURATION_COMPONENT_DATA ConfigurationRoot;
187 LPSTR ArcBootDeviceName;
188 LPSTR ArcHalDeviceName;
189 LPSTR SystemRoot;
190 LPSTR BootRoot;
191 LPSTR CommandLine;
192 PNLS_TABLE_DATA NlsTables;
193 PARC_DISK_INFORMATION ArcDevices;
194 PVOID OEMFont;
195 PSETUP_LOADER_BLOCK SetupLdrBlock;
196 PLOADER_PARAMETER_EXTENSION LpbExtension;
197 union
198 {
199 I386_LOADER_BLOCK I386;
200 } u;
201 } LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK;
202
203 #else
204
205 //
206 // FIXME: ReactOS ONLY
207 //
208 typedef struct _LOADER_MODULE
209 {
210 ULONG ModStart;
211 ULONG ModEnd;
212 ULONG String;
213 ULONG Reserved;
214 } LOADER_MODULE, *PLOADER_MODULE;
215 typedef struct _LOADER_PARAMETER_BLOCK
216 {
217 ULONG Flags;
218 ULONG MemLower;
219 ULONG MemHigher;
220 ULONG BootDevice;
221 ULONG CommandLine;
222 ULONG ModsCount;
223 ULONG ModsAddr;
224 UCHAR Syms[12];
225 ULONG MmapLength;
226 ULONG MmapAddr;
227 ULONG DrivesCount;
228 ULONG DrivesAddr;
229 ULONG ConfigTable;
230 ULONG BootLoaderName;
231 ULONG PageDirectoryStart;
232 ULONG PageDirectoryEnd;
233 ULONG KernelBase;
234 } LOADER_PARAMETER_BLOCK, *PLOADER_PARAMETER_BLOCK;
235 #endif
236
237 //
238 // Kernel Exports
239 //
240 #ifdef __NTOSKRNL__
241 extern HAL_PRIVATE_DISPATCH NTSYSAPI HalPrivateDispatchTable;
242 #else
243 extern PHAL_PRIVATE_DISPATCH NTSYSAPI HalPrivateDispatchTable;
244 #endif
245 extern ULONG NTSYSAPI KdComPortInUse;
246
247 #endif
248 #endif
249