ReactOS  0.4.15-dev-4914-g2220e56
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
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 // See Version table at:
159 // https://www.geoffchappell.com/studies/windows/km/ntoskrnl/inc/ntos/hal/hal_private_dispatch.htm
160 //
161 #if (NTDDI_VERSION < NTDDI_WINXP)
162 #define HAL_PRIVATE_DISPATCH_VERSION 1
163 #elif (NTDDI_VERSION < NTDDI_LONGHORN)
164 #define HAL_PRIVATE_DISPATCH_VERSION 2
165 #elif (NTDDI_VERSION >= NTDDI_LONGHORN)
166 #define HAL_PRIVATE_DISPATCH_VERSION 5
167 #else
168 /* Not yet defined */
169 #endif
170 typedef struct _HAL_PRIVATE_DISPATCH
171 {
192 #if (NTDDI_VERSION >= NTDDI_LONGHORN)
197 #endif
199 
200 //
201 // HAL Supported Range
202 //
203 #define HAL_SUPPORTED_RANGE_VERSION 1
204 typedef struct _SUPPORTED_RANGE
205 {
212 
213 typedef struct _SUPPORTED_RANGES
214 {
227 
228 //
229 // HAL Bus Handler
230 //
231 #define HAL_BUS_HANDLER_VERSION 1
232 typedef struct _BUS_HANDLER
233 {
258 } BUS_HANDLER;
259 
260 //
261 // HAL Chip Hacks
262 //
263 #define HAL_PCI_CHIP_HACK_BROKEN_ACPI_TIMER 0x01
264 #define HAL_PCI_CHIP_HACK_DISABLE_HIBERNATE 0x02
265 #define HAL_PCI_CHIP_HACK_DISABLE_ACPI_IRQ_ROUTING 0x04
266 #define HAL_PCI_CHIP_HACK_USB_SMI_DISABLE 0x08
267 
268 //
269 // Kernel Exports
270 //
271 #if !defined(_NTSYSTEM_) && (defined(_NTDRIVER_) || defined(_NTDDK_) || defined(_NTIFS_) || defined(_NTHAL_))
273 #define HALPRIVATEDISPATCH ((PHAL_PRIVATE_DISPATCH)&HalPrivateDispatchTable)
274 #else
276 #define HALPRIVATEDISPATCH (&HalPrivateDispatchTable)
277 #endif
278 
279 //
280 // HAL Exports
281 //
283 
284 //
285 // HAL Constants
286 //
287 #define HAL_IRQ_TRANSLATOR_VERSION 0x0
288 
289 //
290 // BIOS call structure
291 //
292 #ifdef _M_AMD64
293 
294 typedef struct _X86_BIOS_REGISTERS
295 {
296  ULONG Eax;
297  ULONG Ecx;
298  ULONG Edx;
299  ULONG Ebx;
300  ULONG Ebp;
301  ULONG Esi;
302  ULONG Edi;
303  USHORT SegDs;
304  USHORT SegEs;
305 } X86_BIOS_REGISTERS, *PX86_BIOS_REGISTERS;
306 
307 #endif // _M_AMD64
308 
309 #endif
310 #endif
311 
312 
313 
PVOID HalGetVectorInputOverride
Definition: haltypes.h:196
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:65
LONGLONG SystemBase
Definition: haltypes.h:208
PSUPPORTED_RANGES BusAddresses
Definition: haltypes.h:242
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:170
LONGLONG Limit
Definition: haltypes.h:210
BOOLEAN(NTAPI * pHalResetDisplay)(VOID)
Definition: haltypes.h:183
ULONG Version
Definition: haltypes.h:234
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2272
pHalHandlerForBus HalHandlerForBus
Definition: haltypes.h:173
_FIRMWARE_REENTRY
Definition: haltypes.h:32
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
enum _INTERFACE_TYPE INTERFACE_TYPE
#define _Inout_
Definition: ms_sal.h:378
SUPPORTED_RANGE IO
Definition: haltypes.h:219
VOID(NTAPI * pKdCheckPowerButton)(VOID)
Definition: kdtypes.h:134
#define _Out_
Definition: ms_sal.h:345
#define NTHALAPI
Definition: ntoskrnl.h:40
NTSYSAPI HAL_PRIVATE_DISPATCH HalPrivateDispatchTable
Definition: halstub.c:75
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
BUS_DATA_TYPE ConfigurationType
Definition: haltypes.h:236
_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:184
pKdGetPciDataByOffset KdGetPciDataByOffset
Definition: haltypes.h:193
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:2272
unsigned char * PUCHAR
Definition: retypes.h:3
ULONG NoPrefetchMemory
Definition: haltypes.h:222
LONGLONG Base
Definition: haltypes.h:209
pHalLocateHiberRanges HalLocateHiberRanges
Definition: haltypes.h:175
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:140
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:213
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:187
PVOID Spare5
Definition: haltypes.h:254
struct _HAL_PRIVATE_DISPATCH * PHAL_PRIVATE_DISPATCH
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
Definition: fltkernel.h:1443
SUPPORTED_RANGE PrefetchMemory
Definition: haltypes.h:223
_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:2272
pHalRegisterBusHandler HalRegisterBusHandler
Definition: haltypes.h:176
#define FASTCALL
Definition: nt_native.h:50
#define NTSYSAPI
Definition: ntoskrnl.h:12
PVOID Spare3
Definition: haltypes.h:252
_Out_ PKIRQL Irql
Definition: csq.h:179
pHalFindBusAddressTranslation HalFindBusAddressTranslation
Definition: haltypes.h:182
PDEVICE_OBJECT DeviceObject
Definition: haltypes.h:238
pKdUnmapVirtualAddress KdUnmapVirtualAddress
Definition: haltypes.h:191
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
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
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
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:207
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:180
#define _In_
Definition: ms_sal.h:308
NTHALAPI PUCHAR KdComPortInUse
Definition: usage.c:17
PVOID Spare1
Definition: haltypes.h:250
WDF_EXTERN_C_START typedef _In_ WDFCMRESLIST Resources
Definition: wdfpdo.h:63
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
PVOID Spare6
Definition: haltypes.h:255
PVOID Spare4
Definition: haltypes.h:253
struct _BUS_HANDLER * ParentHandler
Definition: haltypes.h:239
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:156
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
struct _SUPPORTED_RANGES SUPPORTED_RANGES
pHalHandlerForConfigSpace HalHandlerForConfigSpace
Definition: haltypes.h:174
int64_t LONGLONG
Definition: typedefs.h:68
ULONG BusNumber
Definition: haltypes.h:237
pHalResetDisplay HalResetDisplay
Definition: haltypes.h:183
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:169
PVOID(NTAPI * pKdMapPhysicalMemory64)(_In_ PHYSICAL_ADDRESS PhysicalAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:138
uint64_t ULONGLONG
Definition: typedefs.h:67
PVOID Spare7
Definition: haltypes.h:256
PTRANSLATEBUSADDRESS TranslateBusAddress
Definition: haltypes.h:249
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:170
PVOID HalGetInterruptVectorOverride
Definition: haltypes.h:195
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:161
PASSIGNSLOTRESOURCES AssignSlotResources
Definition: haltypes.h:247
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:188
#define VOID
Definition: acefi.h:82
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
pKdSetupPciDeviceForDebugging KdSetupPciDeviceForDebugging
Definition: haltypes.h:185
BOOLEAN Sorted
Definition: haltypes.h:216
struct _HAL_PRIVATE_DISPATCH HAL_PRIVATE_DISPATCH
pHalTranslateBusAddress HalPciTranslateBusAddress
Definition: haltypes.h:179
VOID(NTAPI * pHalSetWakeEnable)(_In_ BOOLEAN Enable)
Definition: haltypes.h:73
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
NTSTATUS(NTAPI * pKdReleasePciDeviceForDebugging)(_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdtypes.h:125
VOID(NTAPI * pHalSetWakeAlarm)(_In_ ULONGLONG AlartTime, _In_ PTIME_FIELDS TimeFields)
Definition: haltypes.h:79
pHalSetWakeEnable HalSetWakeEnable
Definition: haltypes.h:177
VOID(NTAPI * pHalHaltSystem)(VOID)
Definition: haltypes.h:180
pHalSetWakeAlarm HalSetWakeAlarm
Definition: haltypes.h:178
pHalHaltSystem HalHaltSystem
Definition: haltypes.h:181
unsigned short USHORT
Definition: pedump.c:61
UCHAR(NTAPI * pHalVectorToIDTEntry)(ULONG Vector)
Definition: haltypes.h:191
PGETSETBUSDATA SetBusData
Definition: haltypes.h:245
PGETINTERRUPTVECTOR GetInterruptVector
Definition: haltypes.h:248
struct _BUS_HANDLER BUS_HANDLER
pHalVectorToIDTEntry HalVectorToIDTEntry
Definition: haltypes.h:189
unsigned int * PULONG
Definition: retypes.h:1
PVOID Spare8
Definition: haltypes.h:257
PBUS_HANDLER(FASTCALL * pHalHandlerForConfigSpace)(_In_ BUS_DATA_TYPE ConfigSpace, _In_ ULONG BusNumber)
Definition: haltypes.h:47
pKdSetPciDataByOffset KdSetPciDataByOffset
Definition: haltypes.h:194
SUPPORTED_RANGE Memory
Definition: haltypes.h:221
#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:235
unsigned int ULONG
Definition: retypes.h:1
VOID(NTAPI * pKdUnmapVirtualAddress)(_In_ PVOID VirtualAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:144
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:120
struct _SUPPORTED_RANGE * PSUPPORTED_RANGE
PGETSETBUSDATA GetBusData
Definition: haltypes.h:244
PADJUSTRESOURCELIST AdjustResourceList
Definition: haltypes.h:246
VOID(NTAPI * pHalLocateHiberRanges)(_In_ PVOID MemoryMap)
Definition: haltypes.h:86
PVOID Spare2
Definition: haltypes.h:251
PVOID(NTAPI * pKdGetAcpiTablePhase0)(_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock, _In_ ULONG Signature)
Definition: kdtypes.h:129
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:241
static PTIME_FIELDS TimeFields
Definition: time.c:104
SUPPORTED_RANGE Dma
Definition: haltypes.h:225
enum _FIRMWARE_REENTRY * PFIRMWARE_REENTRY
PVOID BusData
Definition: haltypes.h:240
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:461
pKdReleasePciDeviceForDebugging KdReleasePciDeviceforDebugging
Definition: haltypes.h:186
pKdMapPhysicalMemory64 KdMapPhysicalMemory64
Definition: haltypes.h:190
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:206