ReactOS  0.4.11-dev-765-g5e024bf
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,
67  _In_ PINSTALL_BUS_HANDLER InstallCallback,
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 {
163  pHalHandlerForConfigSpace HalHandlerForConfigSpace;
164  pHalLocateHiberRanges HalLocateHiberRanges;
165  pHalRegisterBusHandler HalRegisterBusHandler;
166  pHalSetWakeEnable HalSetWakeEnable;
167  pHalSetWakeAlarm HalSetWakeAlarm;
173  pHalAllocateMapRegisters HalAllocateMapRegisters;
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 {
231  PSUPPORTED_RANGES BusAddresses;
233  PGETSETBUSDATA GetBusData;
234  PGETSETBUSDATA SetBusData;
235  PADJUSTRESOURCELIST AdjustResourceList;
236  PASSIGNSLOTRESOURCES AssignSlotResources;
237  PGETINTERRUPTVECTOR GetInterruptVector;
238  PTRANSLATEBUSADDRESS TranslateBusAddress;
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_)
261 extern NTSYSAPI PHAL_PRIVATE_DISPATCH HalPrivateDispatchTable;
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 #endif
279 #endif
280 
281 
282 
PVOID HalGetVectorInputOverride
Definition: haltypes.h:185
DWORD *typedef PVOID
Definition: winlogon.h:61
LONGLONG SystemBase
Definition: haltypes.h:197
PSUPPORTED_RANGES BusAddresses
Definition: haltypes.h:231
NTSTATUS(NTAPI * PADJUSTRESOURCELIST)(_In_ PBUS_HANDLER BusHandler, _In_ PBUS_HANDLER RootHandler, _Inout_ PIO_RESOURCE_REQUIREMENTS_LIST *Resources)
Definition: haltypes.h:104
_In_ ULONG _In_ ULONG BusInterruptLevel
Definition: halfuncs.h:170
LONGLONG Limit
Definition: haltypes.h:199
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
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
enum _INTERFACE_TYPE INTERFACE_TYPE
SUPPORTED_RANGE IO
Definition: haltypes.h:208
BOOLEAN Enable
Definition: acefiex.h:245
UCHAR(NTAPI * pHalVectorToIDTEntry)(ULONG Vector)
Definition: haltypes.h:191
#define NTHALAPI
Definition: ntoskrnl.h:39
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:4622
pHalAllocateMapRegisters HalAllocateMapRegisters
Definition: haltypes.h:173
pKdGetPciDataByOffset KdGetPciDataByOffset
Definition: haltypes.h:182
enum _BUS_DATA_TYPE BUS_DATA_TYPE
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
_In_ ULONG _In_ PHYSICAL_ADDRESS _Inout_ PULONG AddressSpace
Definition: iofuncs.h:2268
NTSTATUS(NTAPI * pHalAllocateMapRegisters)(_In_ PADAPTER_OBJECT AdapterObject, _In_ ULONG Unknown, _In_ ULONG Unknown2, PMAP_REGISTER_ENTRY Registers)
Definition: haltypes.h:92
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
VOID(NTAPI * pHalHaltSystem)(VOID)
Definition: haltypes.h:180
struct _SUPPORTED_RANGE SUPPORTED_RANGE
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
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
_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
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
pKdUnmapVirtualAddress KdUnmapVirtualAddress
Definition: haltypes.h:180
static IBindStatusCallback InstallCallback
Definition: addons.c:350
_In_opt_ PUNICODE_STRING DriverClassName
Definition: halfuncs.h:156
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
Definition: haltypes.h:185
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
ULONG SystemAddressSpace
Definition: haltypes.h:196
struct _SUPPORTED_RANGES * PSUPPORTED_RANGES
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
KAFFINITY * PKAFFINITY
Definition: basetsd.h:197
pHalAssignSlotResources HalPciAssignSlotResources
Definition: haltypes.h:169
#define _Out_
Definition: no_sal2.h:323
static PDRIVER_OBJECT DriverObject
Definition: template.c:42
VOID(NTAPI * pHalSetWakeEnable)(_In_ BOOLEAN Enable)
Definition: haltypes.h:73
PVOID Spare1
Definition: haltypes.h:239
VOID(NTAPI * pKdUnmapVirtualAddress)(_In_ PVOID VirtualAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:62
PVOID Spare6
Definition: haltypes.h:244
PVOID Spare4
Definition: haltypes.h:242
VOID(NTAPI * pKdCheckPowerButton)(VOID)
Definition: kdtypes.h:52
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
NTSTATUS(NTAPI * pKdSetupPciDeviceForDebugging)(_In_opt_ PVOID LoaderBlock, _Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdtypes.h:38
int64_t LONGLONG
Definition: typedefs.h:66
unsigned char BOOLEAN
PBUS_HANDLER(FASTCALL * pHalHandlerForBus)(_In_ INTERFACE_TYPE InterfaceType, _In_ ULONG BusNumber)
Definition: haltypes.h:10
ACPI_EFI_GUID ACPI_EFI_INTERFACE_TYPE InterfaceType
Definition: acefiex.h:603
ULONG BusNumber
Definition: haltypes.h:226
pHalResetDisplay HalResetDisplay
Definition: haltypes.h:172
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
uint64_t ULONGLONG
Definition: typedefs.h:65
PVOID Spare7
Definition: haltypes.h:245
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
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
PVOID(NTAPI * pKdGetAcpiTablePhase0)(_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock, _In_ ULONG Signature)
Definition: kdtypes.h:47
NTSTATUS(NTAPI * pKdReleasePciDeviceForDebugging)(_Inout_ PDEBUG_DEVICE_DESCRIPTOR PciDevice)
Definition: kdtypes.h:43
ULONG PVOID Reserved
Definition: ntimage.h:533
_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
PASSIGNSLOTRESOURCES AssignSlotResources
Definition: haltypes.h:236
VOID UINTN Length
Definition: acefiex.h:744
#define NTSTATUS
Definition: precomp.h:20
pKdCheckPowerButton KdCheckPowerButton
Definition: haltypes.h:177
#define VOID
Definition: acefi.h:82
BOOLEAN(NTAPI * pHalResetDisplay)(VOID)
Definition: haltypes.h:183
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
pKdSetupPciDeviceForDebugging KdSetupPciDeviceForDebugging
Definition: haltypes.h:174
BOOLEAN Sorted
Definition: haltypes.h:205
VOID(NTAPI * pHalLocateHiberRanges)(_In_ PVOID MemoryMap)
Definition: haltypes.h:86
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
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 _HAL_PRIVATE_DISPATCH HAL_PRIVATE_DISPATCH
pHalTranslateBusAddress HalPciTranslateBusAddress
Definition: haltypes.h:168
#define _In_
Definition: no_sal2.h:204
IN PDEVICE_OBJECT DeviceObject
Definition: fatprocs.h:1560
pHalSetWakeEnable HalSetWakeEnable
Definition: haltypes.h:166
pHalSetWakeAlarm HalSetWakeAlarm
Definition: haltypes.h:167
pHalHaltSystem HalHaltSystem
Definition: haltypes.h:170
ACPI_EFI_MEMORY_DESCRIPTOR * MemoryMap
Definition: acefiex.h:544
unsigned short USHORT
Definition: pedump.c:61
PVOID(NTAPI * pKdMapPhysicalMemory64)(_In_ PHYSICAL_ADDRESS PhysicalAddress, _In_ ULONG NumberPages, _In_ BOOLEAN FlushCurrentTLB)
Definition: kdtypes.h:56
PGETSETBUSDATA SetBusData
Definition: haltypes.h:234
PGETINTERRUPTVECTOR GetInterruptVector
Definition: haltypes.h:237
struct _BUS_HANDLER BUS_HANDLER
VOID(NTAPI * pHalSetWakeAlarm)(_In_ ULONGLONG AlartTime, _In_ PTIME_FIELDS TimeFields)
Definition: haltypes.h:79
pHalVectorToIDTEntry HalVectorToIDTEntry
Definition: haltypes.h:178
unsigned int * PULONG
Definition: retypes.h:1
PBUS_HANDLER(FASTCALL * pHalHandlerForConfigSpace)(_In_ BUS_DATA_TYPE ConfigSpace, _In_ ULONG BusNumber)
Definition: haltypes.h:47
PVOID Spare8
Definition: haltypes.h:246
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
pKdSetPciDataByOffset KdSetPciDataByOffset
Definition: haltypes.h:183
SUPPORTED_RANGE Memory
Definition: haltypes.h:210
#define BOOLEAN
Definition: pedump.c:73
INTERFACE_TYPE InterfaceType
Definition: haltypes.h:224
unsigned int ULONG
Definition: retypes.h:1
_In_ PUNICODE_STRING RegistryPath
Definition: wmip.h:27
struct _BUS_HANDLER * PBUS_HANDLER
Definition: nt_native.h:37
struct _SUPPORTED_RANGE * PSUPPORTED_RANGE
PGETSETBUSDATA GetBusData
Definition: haltypes.h:233
PADJUSTRESOURCELIST AdjustResourceList
Definition: haltypes.h:235
PVOID Spare2
Definition: haltypes.h:240
ULONG DeviceControlExtensionSize
Definition: haltypes.h:230
static PTIME_FIELDS TimeFields
Definition: time.c:104
SUPPORTED_RANGE Dma
Definition: haltypes.h:214
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
enum _FIRMWARE_REENTRY * PFIRMWARE_REENTRY
NTSTATUS(NTAPI * PINSTALL_BUS_HANDLER)(_In_ PBUS_HANDLER Bus)
Definition: haltypes.h:54
PVOID BusData
Definition: haltypes.h:229
pKdReleasePciDeviceForDebugging KdReleasePciDeviceforDebugging
Definition: haltypes.h:175
pKdMapPhysicalMemory64 KdMapPhysicalMemory64
Definition: haltypes.h:179
struct _SUPPORTED_RANGE * Next
Definition: haltypes.h:195