ReactOS 0.4.15-dev-7942-gd23573b
haltypes.h
Go to the documentation of this file.
1/*++ NDK Version: 0098
2
3Copyright (c) Alex Ionescu. All rights reserved.
4
5Header Name:
6
7 haltypes.h
8
9Abstract:
10
11 Type definitions for the HAL.
12
13Author:
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//
33{
41
42//
43// HAL Private function Types
44//
45typedef
48 _In_ BUS_DATA_TYPE ConfigSpace,
50);
51
52typedef
56);
57
58typedef
62 _In_ BUS_DATA_TYPE ConfigSpace,
64 _In_ INTERFACE_TYPE ParentInterfaceType,
65 _In_ ULONG ParentBusNumber,
68 _Out_ PBUS_HANDLER *BusHandler
69);
70
71typedef
75);
76
77typedef
80 _In_ ULONGLONG AlartTime,
82);
83
84typedef
88);
89
90typedef
93 _In_ PADAPTER_OBJECT AdapterObject,
95 _In_ ULONG Unknown2,
96 PMAP_REGISTER_ENTRY Registers
97);
98
99//
100// HAL Bus Handler Callback Types
101//
102typedef
105 _In_ PBUS_HANDLER BusHandler,
106 _In_ PBUS_HANDLER RootHandler,
108);
109
110typedef
113 _In_ PBUS_HANDLER BusHandler,
114 _In_ PBUS_HANDLER RootHandler,
121);
122
123typedef
126 _In_ PBUS_HANDLER BusHandler,
127 _In_ PBUS_HANDLER RootHandler,
132);
133
134typedef
137 _In_ PBUS_HANDLER BusHandler,
138 _In_ PBUS_HANDLER RootHandler,
143);
144
145typedef
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
171{
192#if (NTDDI_VERSION >= NTDDI_LONGHORN)
197#endif
199
200//
201// HAL Supported Range
202//
203#define HAL_SUPPORTED_RANGE_VERSION 1
204typedef struct _SUPPORTED_RANGE
205{
212
213typedef struct _SUPPORTED_RANGES
214{
227
228//
229// HAL Bus Handler
230//
231#define HAL_BUS_HANDLER_VERSION 1
232typedef struct _BUS_HANDLER
233{
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//
293{
304
305#endif
306#endif
307
308
309
unsigned char BOOLEAN
#define VOID
Definition: acefi.h:82
KAFFINITY * PKAFFINITY
Definition: basetsd.h:195
BIOS_MEMORY_MAP MemoryMap[32]
Definition: loader.c:11
#define NTSYSAPI
Definition: ntoskrnl.h:12
Definition: bufpool.h:45
_Out_ PKIRQL Irql
Definition: csq.h:179
#define NTSTATUS
Definition: precomp.h:21
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T ContextSize
Definition: fltkernel.h:1444
enum _INTERFACE_TYPE INTERFACE_TYPE
@ Unknown
Definition: i8042prt.h:114
static PTIME_FIELDS TimeFields
Definition: time.c:104
#define _Inout_
Definition: ms_sal.h:378
#define _Out_
Definition: ms_sal.h:345
#define _In_
Definition: ms_sal.h:308
#define _In_opt_
Definition: ms_sal.h:309
_Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PDEVICE_OBJECT _Inout_opt_ PCM_RESOURCE_LIST * AllocatedResources
Definition: ndis.h:4643
struct _HAL_PRIVATE_DISPATCH HAL_PRIVATE_DISPATCH
enum _FIRMWARE_REENTRY * PFIRMWARE_REENTRY
ULONG(NTAPI * PGETSETBUSDATA)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _In_ ULONG SlotNumber, _In_ PVOID Buffer, _In_ ULONG Offset, _In_ ULONG Length)
Definition: haltypes.h:125
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
struct _BUS_HANDLER BUS_HANDLER
struct _SUPPORTED_RANGES SUPPORTED_RANGES
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
struct _SUPPORTED_RANGES * PSUPPORTED_RANGES
VOID(NTAPI * pHalLocateHiberRanges)(_In_ PVOID MemoryMap)
Definition: haltypes.h:86
struct _X86_BIOS_REGISTERS * PX86_BIOS_REGISTERS
NTSTATUS(NTAPI * PINSTALL_BUS_HANDLER)(_In_ PBUS_HANDLER Bus)
Definition: haltypes.h:54
NTSYSAPI HAL_PRIVATE_DISPATCH HalPrivateDispatchTable
Definition: halstub.c:75
struct _SUPPORTED_RANGE * PSUPPORTED_RANGE
VOID(NTAPI * pHalSetWakeAlarm)(_In_ ULONGLONG AlartTime, _In_ PTIME_FIELDS TimeFields)
Definition: haltypes.h:79
NTHALAPI PUCHAR KdComPortInUse
Definition: usage.c:17
NTSTATUS(NTAPI * PASSIGNSLOTRESOURCES)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _In_ PUNICODE_STRING RegistryPath, _In_opt_ PUNICODE_STRING DriverClassName, _In_ PDRIVER_OBJECT DriverObject, _In_opt_ PDEVICE_OBJECT DeviceObject, _In_ ULONG SlotNumber, _Inout_ PCM_RESOURCE_LIST *AllocatedResources)
Definition: haltypes.h:112
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
NTSTATUS(NTAPI * pHalAllocateMapRegisters)(_In_ PADAPTER_OBJECT AdapterObject, _In_ ULONG Unknown, _In_ ULONG Unknown2, PMAP_REGISTER_ENTRY Registers)
Definition: haltypes.h:92
struct _HAL_PRIVATE_DISPATCH * PHAL_PRIVATE_DISPATCH
PBUS_HANDLER(FASTCALL * pHalHandlerForConfigSpace)(_In_ BUS_DATA_TYPE ConfigSpace, _In_ ULONG BusNumber)
Definition: haltypes.h:47
NTSTATUS(NTAPI * PADJUSTRESOURCELIST)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _Inout_ PIO_RESOURCE_REQUIREMENTS_LIST *pResourceList)
Definition: haltypes.h:104
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
_FIRMWARE_REENTRY
Definition: haltypes.h:33
@ HalRestartRoutine
Definition: haltypes.h:36
@ HalHaltRoutine
Definition: haltypes.h:34
@ HalInteractiveModeRoutine
Definition: haltypes.h:38
@ HalPowerDownRoutine
Definition: haltypes.h:35
@ HalRebootRoutine
Definition: haltypes.h:37
@ HalMaximumRoutine
Definition: haltypes.h:39
struct _SUPPORTED_RANGE SUPPORTED_RANGE
VOID(NTAPI * pHalSetWakeEnable)(_In_ BOOLEAN Enable)
Definition: haltypes.h:73
struct _X86_BIOS_REGISTERS X86_BIOS_REGISTERS
#define FASTCALL
Definition: nt_native.h:50
struct _BUS_HANDLER * PBUS_HANDLER
Definition: nt_native.h:37
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142
#define NTHALAPI
Definition: ntoskrnl.h:40
#define BOOLEAN
Definition: pedump.c:73
unsigned short USHORT
Definition: pedump.c:61
enum _BUS_DATA_TYPE BUS_DATA_TYPE
PGETINTERRUPTVECTOR GetInterruptVector
Definition: haltypes.h:248
PGETSETBUSDATA GetBusData
Definition: haltypes.h:244
PVOID Spare4
Definition: haltypes.h:253
ULONG BusNumber
Definition: haltypes.h:237
ULONG Version
Definition: haltypes.h:234
PVOID Spare1
Definition: haltypes.h:250
PSUPPORTED_RANGES BusAddresses
Definition: haltypes.h:242
PVOID Spare7
Definition: haltypes.h:256
PVOID Spare5
Definition: haltypes.h:254
PVOID Spare8
Definition: haltypes.h:257
PTRANSLATEBUSADDRESS TranslateBusAddress
Definition: haltypes.h:249
PASSIGNSLOTRESOURCES AssignSlotResources
Definition: haltypes.h:247
PVOID Spare2
Definition: haltypes.h:251
BUS_DATA_TYPE ConfigurationType
Definition: haltypes.h:236
ULONG DeviceControlExtensionSize
Definition: haltypes.h:241
struct _BUS_HANDLER * ParentHandler
Definition: haltypes.h:239
PVOID Spare6
Definition: haltypes.h:255
PDEVICE_OBJECT DeviceObject
Definition: haltypes.h:238
PGETSETBUSDATA SetBusData
Definition: haltypes.h:245
PVOID Spare3
Definition: haltypes.h:252
INTERFACE_TYPE InterfaceType
Definition: haltypes.h:235
PADJUSTRESOURCELIST AdjustResourceList
Definition: haltypes.h:246
PVOID BusData
Definition: haltypes.h:240
pHalAssignSlotResources HalPciAssignSlotResources
Definition: haltypes.h:180
PVOID HalGetInterruptVectorOverride
Definition: haltypes.h:195
pHalLocateHiberRanges HalLocateHiberRanges
Definition: haltypes.h:175
pHalSetWakeEnable HalSetWakeEnable
Definition: haltypes.h:177
pKdCheckPowerButton KdCheckPowerButton
Definition: haltypes.h:188
pHalFindBusAddressTranslation HalFindBusAddressTranslation
Definition: haltypes.h:182
pKdMapPhysicalMemory64 KdMapPhysicalMemory64
Definition: haltypes.h:190
pHalAllocateMapRegisters HalAllocateMapRegisters
Definition: haltypes.h:184
pKdSetupPciDeviceForDebugging KdSetupPciDeviceForDebugging
Definition: haltypes.h:185
pKdGetAcpiTablePhase0 KdGetAcpiTablePhase0
Definition: haltypes.h:187
pHalRegisterBusHandler HalRegisterBusHandler
Definition: haltypes.h:176
pKdGetPciDataByOffset KdGetPciDataByOffset
Definition: haltypes.h:193
pKdReleasePciDeviceForDebugging KdReleasePciDeviceforDebugging
Definition: haltypes.h:186
pHalResetDisplay HalResetDisplay
Definition: haltypes.h:183
pHalHandlerForConfigSpace HalHandlerForConfigSpace
Definition: haltypes.h:174
pHalHandlerForBus HalHandlerForBus
Definition: haltypes.h:173
pHalTranslateBusAddress HalPciTranslateBusAddress
Definition: haltypes.h:179
PVOID HalGetVectorInputOverride
Definition: haltypes.h:196
pHalHaltSystem HalHaltSystem
Definition: haltypes.h:181
pHalVectorToIDTEntry HalVectorToIDTEntry
Definition: haltypes.h:189
pKdUnmapVirtualAddress KdUnmapVirtualAddress
Definition: haltypes.h:191
pKdSetPciDataByOffset KdSetPciDataByOffset
Definition: haltypes.h:194
pHalSetWakeAlarm HalSetWakeAlarm
Definition: haltypes.h:178
Definition: haltypes.h:185
SUPPORTED_RANGE Dma
Definition: haltypes.h:225
SUPPORTED_RANGE PrefetchMemory
Definition: haltypes.h:223
BOOLEAN Sorted
Definition: haltypes.h:216
SUPPORTED_RANGE Memory
Definition: haltypes.h:221
SUPPORTED_RANGE IO
Definition: haltypes.h:219
ULONG NoPrefetchMemory
Definition: haltypes.h:222
ULONG SystemAddressSpace
Definition: haltypes.h:207
LONGLONG SystemBase
Definition: haltypes.h:208
LONGLONG Base
Definition: haltypes.h:209
LONGLONG Limit
Definition: haltypes.h:210
struct _SUPPORTED_RANGE * Next
Definition: haltypes.h:206
uint32_t * PULONG
Definition: typedefs.h:59
int64_t LONGLONG
Definition: typedefs.h:68
#define NTAPI
Definition: typedefs.h:36
unsigned char * PUCHAR
Definition: typedefs.h:53
uint32_t ULONG
Definition: typedefs.h:59
uint64_t ULONGLONG
Definition: typedefs.h:67
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_Must_inspect_result_ _In_ PDRIVER_OBJECT _In_ PCUNICODE_STRING RegistryPath
Definition: wdfdriver.h:215
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_Must_inspect_result_ _In_ WDFDEVICE _In_ LPCGUID InterfaceType
Definition: wdffdo.h:463
_In_ WDFIORESREQLIST _In_ ULONG SlotNumber
Definition: wdfresource.h:68
_Reserved_ PVOID Reserved
Definition: winddi.h:3974
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:171
_In_opt_ PUNICODE_STRING _In_ PDRIVER_OBJECT _In_ PDEVICE_OBJECT _In_ INTERFACE_TYPE _In_ ULONG BusNumber
Definition: halfuncs.h:160
_In_ ULONG _In_ ULONG _In_ ULONG BusInterruptVector
Definition: halfuncs.h:172
_In_ ULONG _In_ ULONG _In_ ULONG _Out_ PKIRQL _Out_ PKAFFINITY Affinity
Definition: halfuncs.h:174
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
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
PBUS_HANDLER(FASTCALL * pHalHandlerForBus)(_In_ INTERFACE_TYPE InterfaceType, _In_ ULONG BusNumber)
Definition: haltypes.h:10
BOOLEAN(NTAPI * pHalResetDisplay)(VOID)
Definition: haltypes.h:183
UCHAR(NTAPI * pHalVectorToIDTEntry)(ULONG Vector)
Definition: haltypes.h:191
VOID(NTAPI * pHalHaltSystem)(VOID)
Definition: haltypes.h:180
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
_In_ ULONG _In_ PHYSICAL_ADDRESS BusAddress
Definition: iofuncs.h:2273
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG _Out_ PPHYSICAL_ADDRESS TranslatedAddress
Definition: iofuncs.h:2275
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2274
PVOID(NTAPI * pKdMapPhysicalMemory64)(_In_ PHYSICAL_ADDRESS PhysicalAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:138
PVOID(NTAPI * pKdGetAcpiTablePhase0)(_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock, _In_ ULONG Signature)
Definition: kdtypes.h:129
NTSTATUS(NTAPI * pKdReleasePciDeviceForDebugging)(_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdtypes.h:125
VOID(NTAPI * pKdUnmapVirtualAddress)(_In_ PVOID VirtualAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:144
NTSTATUS(NTAPI * pKdSetupPciDeviceForDebugging)(_In_opt_ PVOID LoaderBlock, _Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdtypes.h:120
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
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
VOID(NTAPI * pKdCheckPowerButton)(VOID)
Definition: kdtypes.h:134
unsigned char UCHAR
Definition: xmlstorage.h:181