ReactOS  0.4.14-dev-114-gc8cbd56
haltypes.h
Go to the documentation of this file.
1 /*++ NDK Version: 0098
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 (alexi@tinykrnl.org) - Updated - 27-Feb-2006
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 // HalShutdownSystem Types
31 //
32 typedef enum _FIRMWARE_REENTRY
33 {
41 
42 //
43 // HAL Private function Types
44 //
45 typedef
48  _In_ BUS_DATA_TYPE ConfigSpace,
50 );
51 
52 typedef
55  _In_ PBUS_HANDLER Bus
56 );
57 
58 typedef
61  _In_ INTERFACE_TYPE InterfaceType,
62  _In_ BUS_DATA_TYPE ConfigSpace,
64  _In_ INTERFACE_TYPE ParentInterfaceType,
65  _In_ ULONG ParentBusNumber,
68  _Out_ PBUS_HANDLER *BusHandler
69 );
70 
71 typedef
72 VOID
75 );
76 
77 typedef
78 VOID
80  _In_ ULONGLONG AlartTime,
82 );
83 
84 typedef
85 VOID
88 );
89 
90 typedef
93  _In_ PADAPTER_OBJECT AdapterObject,
95  _In_ ULONG Unknown2,
96  PMAP_REGISTER_ENTRY Registers
97 );
98 
99 //
100 // HAL Bus Handler Callback Types
101 //
102 typedef
103 NTSTATUS
105  _In_ PBUS_HANDLER BusHandler,
106  _In_ PBUS_HANDLER RootHandler,
108 );
109 
110 typedef
111 NTSTATUS
113  _In_ PBUS_HANDLER BusHandler,
114  _In_ PBUS_HANDLER RootHandler,
121 );
122 
123 typedef
124 ULONG
126  _In_ PBUS_HANDLER BusHandler,
127  _In_ PBUS_HANDLER RootHandler,
130  _In_ ULONG Offset,
132 );
133 
134 typedef
135 ULONG
137  _In_ PBUS_HANDLER BusHandler,
138  _In_ PBUS_HANDLER RootHandler,
141  _Out_ PKIRQL Irql,
143 );
144 
145 typedef
146 BOOLEAN
148  _In_ PBUS_HANDLER BusHandler,
149  _In_ PBUS_HANDLER RootHandler,
153 );
154 
155 //
156 // Hal Private dispatch Table
157 //
158 #define HAL_PRIVATE_DISPATCH_VERSION 2
159 typedef struct _HAL_PRIVATE_DISPATCH
160 {
181 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
186 #endif
188 
189 //
190 // HAL Supported Range
191 //
192 #define HAL_SUPPORTED_RANGE_VERSION 1
193 typedef struct _SUPPORTED_RANGE
194 {
201 
202 typedef struct _SUPPORTED_RANGES
203 {
216 
217 //
218 // HAL Bus Handler
219 //
220 #define HAL_BUS_HANDLER_VERSION 1
221 typedef struct _BUS_HANDLER
222 {
247 } BUS_HANDLER;
248 
249 //
250 // HAL Chip Hacks
251 //
252 #define HAL_PCI_CHIP_HACK_BROKEN_ACPI_TIMER 0x01
253 #define HAL_PCI_CHIP_HACK_DISABLE_HIBERNATE 0x02
254 #define HAL_PCI_CHIP_HACK_DISABLE_ACPI_IRQ_ROUTING 0x04
255 #define HAL_PCI_CHIP_HACK_USB_SMI_DISABLE 0x08
256 
257 //
258 // Kernel Exports
259 //
260 #if (defined(_NTDRIVER_) || defined(_NTHAL_)) && !defined(_BLDR_)
262 #define HALPRIVATEDISPATCH ((PHAL_PRIVATE_DISPATCH)&HalPrivateDispatchTable)
263 #else
265 #define HALPRIVATEDISPATCH (&HalPrivateDispatchTable)
266 #endif
267 
268 //
269 // HAL Exports
270 //
272 
273 //
274 // HAL Constants
275 //
276 #define HAL_IRQ_TRANSLATOR_VERSION 0x0
277 
278 //
279 // BIOS call structure
280 //
281 #ifdef _M_AMD64
282 
283 typedef struct _X86_BIOS_REGISTERS
284 {
285  ULONG Eax;
286  ULONG Ecx;
287  ULONG Edx;
288  ULONG Ebx;
289  ULONG Ebp;
290  ULONG Esi;
291  ULONG Edi;
292  USHORT SegDs;
293  USHORT SegEs;
294 } X86_BIOS_REGISTERS, *PX86_BIOS_REGISTERS;
295 
296 #endif // _M_AMD64
297 
298 #endif
299 #endif
300 
301 
302 
PVOID HalGetVectorInputOverride
Definition: haltypes.h:185
LONGLONG SystemBase
Definition: haltypes.h:197
PSUPPORTED_RANGES BusAddresses
Definition: haltypes.h:231
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:170
LONGLONG Limit
Definition: haltypes.h:199
BOOLEAN(NTAPI * pHalResetDisplay)(VOID)
Definition: haltypes.h:183
ULONG Version
Definition: haltypes.h:223
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2268
pHalHandlerForBus HalHandlerForBus
Definition: haltypes.h:162
_FIRMWARE_REENTRY
Definition: haltypes.h:32
enum _INTERFACE_TYPE INTERFACE_TYPE
SUPPORTED_RANGE IO
Definition: haltypes.h:208
VOID(NTAPI * pKdCheckPowerButton)(VOID)
Definition: kdtypes.h:52
#define NTHALAPI
Definition: ntoskrnl.h:40
NTSYSAPI HAL_PRIVATE_DISPATCH HalPrivateDispatchTable
Definition: halstub.c:77
BUS_DATA_TYPE ConfigurationType
Definition: haltypes.h:225
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4640
pHalAllocateMapRegisters HalAllocateMapRegisters
Definition: haltypes.h:173
pKdGetPciDataByOffset KdGetPciDataByOffset
Definition: haltypes.h:182
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
enum _BUS_DATA_TYPE BUS_DATA_TYPE
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG NoPrefetchMemory
Definition: haltypes.h:211
LONGLONG Base
Definition: haltypes.h:198
pHalLocateHiberRanges HalLocateHiberRanges
Definition: haltypes.h:164
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
struct _SUPPORTED_RANGE SUPPORTED_RANGE
PBUS_HANDLER(FASTCALL * pHalHandlerForBus)(_In_ INTERFACE_TYPE InterfaceType, _In_ ULONG BusNumber)
Definition: haltypes.h:10
pKdGetAcpiTablePhase0 KdGetAcpiTablePhase0
Definition: haltypes.h:176
PVOID Spare5
Definition: haltypes.h:243
struct _HAL_PRIVATE_DISPATCH * PHAL_PRIVATE_DISPATCH
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
Definition: fltkernel.h:1444
SUPPORTED_RANGE PrefetchMemory
Definition: haltypes.h:212
_In_ ULONG _In_ ULONG _In_ ULONG BusInterruptVector
Definition: halfuncs.h:170
ULONG(NTAPI * PGETINTERRUPTVECTOR)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _In_ ULONG BusInterruptLevel, _In_ ULONG BusInterruptVector, _Out_ PKIRQL Irql, _Out_ PKAFFINITY Affinity)
Definition: haltypes.h:136
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2268
pHalRegisterBusHandler HalRegisterBusHandler
Definition: haltypes.h:165
#define FASTCALL
Definition: nt_native.h:50
#define NTSYSAPI
Definition: ntoskrnl.h:14
PVOID Spare3
Definition: haltypes.h:241
_Out_ PKIRQL Irql
Definition: csq.h:179
pHalFindBusAddressTranslation HalFindBusAddressTranslation
Definition: haltypes.h:171
PDEVICE_OBJECT DeviceObject
Definition: haltypes.h:227
pKdUnmapVirtualAddress KdUnmapVirtualAddress
Definition: haltypes.h:180
static IBindStatusCallback InstallCallback
Definition: addons.c:350
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
BOOLEAN(NTAPI * pHalTranslateBusAddress)(_In_ INTERFACE_TYPE InterfaceType, _In_ ULONG BusNumber, _In_ PHYSICAL_ADDRESS BusAddress, _Inout_ PULONG AddressSpace, _Out_ PPHYSICAL_ADDRESS TranslatedAddress)
Definition: haltypes.h:161
Definition: haltypes.h:185
NTSTATUS(NTAPI * pHalRegisterBusHandler)(_In_ INTERFACE_TYPE InterfaceType, _In_ BUS_DATA_TYPE ConfigSpace, _In_ ULONG BusNumber, _In_ INTERFACE_TYPE ParentInterfaceType, _In_ ULONG ParentBusNumber, _In_ ULONG ContextSize, _In_ PINSTALL_BUS_HANDLER InstallCallback, _Out_ PBUS_HANDLER *BusHandler)
Definition: haltypes.h:60
BOOLEAN(NTAPI * pHalFindBusAddressTranslation)(_In_ PHYSICAL_ADDRESS BusAddress, _Inout_ PULONG AddressSpace, _Out_ PPHYSICAL_ADDRESS TranslatedAddress, _Inout_ PULONG_PTR Context, _In_ BOOLEAN NextBus)
Definition: haltypes.h:195
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
NTSTATUS(NTAPI * PADJUSTRESOURCELIST)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _Inout_ PIO_RESOURCE_REQUIREMENTS_LIST *Resources)
Definition: haltypes.h:104
ULONG SystemAddressSpace
Definition: haltypes.h:196
ULONG(NTAPI * PGETSETBUSDATA)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _In_ ULONG SlotNumber, _Out_ PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
Definition: haltypes.h:125
struct _SUPPORTED_RANGES * PSUPPORTED_RANGES
KAFFINITY * PKAFFINITY
Definition: basetsd.h:197
unsigned char BOOLEAN
pHalAssignSlotResources HalPciAssignSlotResources
Definition: haltypes.h:169
#define _Out_
Definition: no_sal2.h:323
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
PVOID Spare1
Definition: haltypes.h:239
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
PVOID Spare6
Definition: haltypes.h:244
PVOID Spare4
Definition: haltypes.h:242
struct _BUS_HANDLER * ParentHandler
Definition: haltypes.h:228
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
PUCHAR NTHALAPI KdComPortInUse
Definition: usage.c:17
struct _SUPPORTED_RANGES SUPPORTED_RANGES
pHalHandlerForConfigSpace HalHandlerForConfigSpace
Definition: haltypes.h:163
int64_t LONGLONG
Definition: typedefs.h:66
ULONG BusNumber
Definition: haltypes.h:226
pHalResetDisplay HalResetDisplay
Definition: haltypes.h:172
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
ULONG(NTAPI * pKdSetPciDataByOffset)(_In_ ULONG BusNumber, _In_ ULONG SlotNumber, _In_reads_bytes_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
Definition: kdtypes.h:87
PVOID(NTAPI * pKdMapPhysicalMemory64)(_In_ PHYSICAL_ADDRESS PhysicalAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:56
uint64_t ULONGLONG
Definition: typedefs.h:65
PVOID Spare7
Definition: haltypes.h:245
PTRANSLATEBUSADDRESS TranslateBusAddress
Definition: haltypes.h:238
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170
PVOID HalGetInterruptVectorOverride
Definition: haltypes.h:184
#define _Inout_
Definition: no_sal2.h:244
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG _In_ ULONG SlotNumber
Definition: halfuncs.h:156
unsigned char UCHAR
Definition: xmlstorage.h:181
ULONG(NTAPI * pKdGetPciDataByOffset)(_In_ ULONG BusNumber, _In_ ULONG SlotNumber, _Out_writes_bytes_(Length) PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
Definition: kdtypes.h:79
PASSIGNSLOTRESOURCES AssignSlotResources
Definition: haltypes.h:236
BOOLEAN(NTAPI * PTRANSLATEBUSADDRESS)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _In_ PHYSICAL_ADDRESS BusAddress, _Inout_ PULONG AddressSpace, _Out_ PPHYSICAL_ADDRESS TranslatedAddress)
Definition: haltypes.h:147
#define NTSTATUS
Definition: precomp.h:20
pKdCheckPowerButton KdCheckPowerButton
Definition: haltypes.h:177
#define VOID
Definition: acefi.h:82
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
pKdSetupPciDeviceForDebugging KdSetupPciDeviceForDebugging
Definition: haltypes.h:174
BOOLEAN Sorted
Definition: haltypes.h:205
struct _HAL_PRIVATE_DISPATCH HAL_PRIVATE_DISPATCH
pHalTranslateBusAddress HalPciTranslateBusAddress
Definition: haltypes.h:168
VOID(NTAPI * pHalSetWakeEnable)(_In_ BOOLEAN Enable)
Definition: haltypes.h:73
#define _In_
Definition: no_sal2.h:204
NTSTATUS(NTAPI * pKdReleasePciDeviceForDebugging)(_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdtypes.h:43
VOID(NTAPI * pHalSetWakeAlarm)(_In_ ULONGLONG AlartTime, _In_ PTIME_FIELDS TimeFields)
Definition: haltypes.h:79
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
pHalSetWakeEnable HalSetWakeEnable
Definition: haltypes.h:166
VOID(NTAPI * pHalHaltSystem)(VOID)
Definition: haltypes.h:180
pHalSetWakeAlarm HalSetWakeAlarm
Definition: haltypes.h:167
pHalHaltSystem HalHaltSystem
Definition: haltypes.h:170
unsigned short USHORT
Definition: pedump.c:61
UCHAR(NTAPI * pHalVectorToIDTEntry)(ULONG Vector)
Definition: haltypes.h:191
PGETSETBUSDATA SetBusData
Definition: haltypes.h:234
PGETINTERRUPTVECTOR GetInterruptVector
Definition: haltypes.h:237
struct _BUS_HANDLER BUS_HANDLER
pHalVectorToIDTEntry HalVectorToIDTEntry
Definition: haltypes.h:178
unsigned int * PULONG
Definition: retypes.h:1
PVOID Spare8
Definition: haltypes.h:246
PBUS_HANDLER(FASTCALL * pHalHandlerForConfigSpace)(_In_ BUS_DATA_TYPE ConfigSpace, _In_ ULONG BusNumber)
Definition: haltypes.h:47
pKdSetPciDataByOffset KdSetPciDataByOffset
Definition: haltypes.h:183
SUPPORTED_RANGE Memory
Definition: haltypes.h:210
#define BOOLEAN
Definition: pedump.c:73
NTSTATUS(NTAPI * PINSTALL_BUS_HANDLER)(_In_ PBUS_HANDLER Bus)
Definition: haltypes.h:54
INTERFACE_TYPE InterfaceType
Definition: haltypes.h:224
unsigned int ULONG
Definition: retypes.h:1
VOID(NTAPI * pKdUnmapVirtualAddress)(_In_ PVOID VirtualAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:62
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
struct _BUS_HANDLER * PBUS_HANDLER
Definition: nt_native.h:37
NTSTATUS(NTAPI * pKdSetupPciDeviceForDebugging)(_In_opt_ PVOID LoaderBlock, _Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdtypes.h:38
struct _SUPPORTED_RANGE * PSUPPORTED_RANGE
PGETSETBUSDATA GetBusData
Definition: haltypes.h:233
PADJUSTRESOURCELIST AdjustResourceList
Definition: haltypes.h:235
VOID(NTAPI * pHalLocateHiberRanges)(_In_ PVOID MemoryMap)
Definition: haltypes.h:86
PVOID Spare2
Definition: haltypes.h:240
PVOID(NTAPI * pKdGetAcpiTablePhase0)(_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock, _In_ ULONG Signature)
Definition: kdtypes.h:47
NTSTATUS(NTAPI * PASSIGNSLOTRESOURCES)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _In_ PUNICODE_STRING RegistryPath, _In_ PUNICODE_STRING DriverClassName, _In_ PDRIVER_OBJECT DriverObject, _In_ PDEVICE_OBJECT DeviceObject, _In_ ULONG SlotNumber, _Inout_ PCM_RESOURCE_LIST *AllocatedResources)
Definition: haltypes.h:112
NTSTATUS(NTAPI * pHalAssignSlotResources)(_In_ PUNICODE_STRING RegistryPath, _In_opt_ PUNICODE_STRING DriverClassName, _In_ PDRIVER_OBJECT DriverObject, _In_ PDEVICE_OBJECT DeviceObject, _In_ INTERFACE_TYPE BusType, _In_ ULONG BusNumber, _In_ ULONG SlotNumber, _Inout_ PCM_RESOURCE_LIST *AllocatedResources)
Definition: haltypes.h:169
ULONG DeviceControlExtensionSize
Definition: haltypes.h:230
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
static PTIME_FIELDS TimeFields
Definition: time.c:104
SUPPORTED_RANGE Dma
Definition: haltypes.h:214
enum _FIRMWARE_REENTRY * PFIRMWARE_REENTRY
PVOID BusData
Definition: haltypes.h:229
pKdReleasePciDeviceForDebugging KdReleasePciDeviceforDebugging
Definition: haltypes.h:175
pKdMapPhysicalMemory64 KdMapPhysicalMemory64
Definition: haltypes.h:179
NTSTATUS(NTAPI * pHalAllocateMapRegisters)(_In_ PADAPTER_OBJECT AdapterObject, _In_ ULONG Unknown, _In_ ULONG Unknown2, PMAP_REGISTER_ENTRY Registers)
Definition: haltypes.h:92
struct _SUPPORTED_RANGE * Next
Definition: haltypes.h:195