ReactOS  0.4.15-dev-2359-g0dedb9b
halfuncs.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  halfuncs.h
8 
9 Abstract:
10 
11  Function definitions for the HAL.
12 
13 Author:
14 
15  Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
16 
17 --*/
18 
19 #ifndef _HALFUNCS_H
20 #define _HALFUNCS_H
21 
22 //
23 // Dependencies
24 //
25 #include <umtypes.h>
26 #include <haltypes.h>
27 #include <ketypes.h>
28 #include <section_attribs.h>
29 
30 #ifndef NTOS_MODE_USER
31 
32 //
33 // Private HAL Callbacks
34 //
35 #define HalHandlerForBus HALPRIVATEDISPATCH->HalHandlerForBus
36 #define HalHandlerForConfigSpace HALPRIVATEDISPATCH->HalHandlerForConfigSpace
37 #define HalLocateHiberRanges HALPRIVATEDISPATCH->HalLocateHiberRanges
38 #define HalRegisterBusHandler HALPRIVATEDISPATCH->HalRegisterBusHandler
39 #define HalSetWakeEnable HALPRIVATEDISPATCH->HalSetWakeEnable
40 #define HalSetWakeAlarm HALPRIVATEDISPATCH->HalSetWakeAlarm
41 #define HalPciTranslateBusAddress HALPRIVATEDISPATCH->HalPciTranslateBusAddress
42 #define HalPciAssignSlotResources HALPRIVATEDISPATCH->HalPciAssignSlotResources
43 #define HalHaltSystem HALPRIVATEDISPATCH->HalHaltSystem
44 #define HalFindBusAddressTranslation HALPRIVATEDISPATCH->HalFindBusAddressTranslation
45 #define HalResetDisplay HALPRIVATEDISPATCH->HalResetDisplay
46 #define HalAllocateMapRegisters HALPRIVATEDISPATCH->HalAllocateMapRegisters
47 #define KdSetupPciDeviceForDebugging HALPRIVATEDISPATCH->KdSetupPciDeviceForDebugging
48 #define KdReleasePciDeviceforDebugging HALPRIVATEDISPATCH->KdReleasePciDeviceforDebugging
49 #define KdGetAcpiTablePhase0 HALPRIVATEDISPATCH->KdGetAcpiTablePhase0
50 #define KdCheckPowerButton HALPRIVATEDISPATCH->KdCheckPowerButton
51 #define HalVectorToIDTEntry HALPRIVATEDISPATCH->HalVectorToIDTEntry
52 #define KdMapPhysicalMemory64 HALPRIVATEDISPATCH->KdMapPhysicalMemory64
53 #define KdUnmapVirtualAddress HALPRIVATEDISPATCH->KdUnmapVirtualAddress
54 
55 //
56 // Display Functions
57 //
59 VOID
60 NTAPI
63 );
64 
65 //
66 // Initialization Functions
67 //
69 BOOLEAN
70 NTAPI
72  VOID
73 );
74 
75 #ifdef _ARC_
77 VOID
78 NTAPI
80  _In_ ULONG ProcessorNumber,
81  _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock
82 );
83 
85 BOOLEAN
86 NTAPI
88  _In_ ULONG BootPhase,
89  _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock
90 );
91 
93 BOOLEAN
94 NTAPI
96  _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
97  _In_ PKPROCESSOR_STATE ProcessorState
98 );
99 
100 #endif
101 
102 NTHALAPI
103 VOID
104 NTAPI
107 );
108 
109 //
110 // CPU Routines
111 //
112 NTHALAPI
113 VOID
114 NTAPI
116  VOID
117 );
118 
119 //
120 // Interrupt Functions
121 //
122 NTHALAPI
123 BOOLEAN
124 NTAPI
126  _In_ KIRQL Irql,
127  _In_ ULONG Vector,
129 );
130 
131 VOID
132 FASTCALL
135 );
136 
137 NTHALAPI
138 VOID
139 NTAPI
141  _In_ ULONG Vector,
142  _In_ KIRQL Irql
143 );
144 
145 NTHALAPI
146 BOOLEAN
147 NTAPI
149  _In_ ULONG Vector,
150  _In_ KIRQL Irql,
152 );
153 
154 #ifdef __REACTOS__
155 NTHALAPI
156 VOID
157 NTAPI
159  _In_ KIRQL Irql,
160  _In_ PKTRAP_FRAME TrapFrame
161 );
162 #else
163 NTHALAPI
164 VOID
165 NTAPI
167  _In_ KIRQL Irql,
169 );
170 #endif
171 
172 #ifdef _ARM_ // FIXME: ndk/arm? armddk.h?
173 ULONG
175  VOID
176 );
177 #endif
178 
179 NTHALAPI
180 VOID
181 NTAPI
183  VOID
184 );
185 
186 NTHALAPI
187 VOID
188 FASTCALL
190  _In_ KIRQL SoftwareInterruptRequested
191 );
192 
193 NTHALAPI
194 VOID
195 NTAPI
197  _In_ KAFFINITY TargetSet
198 );
199 
200 NTHALAPI
201 VOID
202 NTAPI
204  PVOID NmiInfo
205 );
206 
207 NTHALAPI
208 UCHAR
209 FASTCALL
211  _In_ ULONG Vector,
212  _Out_ PKINTERRUPT_ROUTINE **FlatDispatch,
213  _Out_ PKINTERRUPT_ROUTINE *NoConnection
214 );
215 
216 //
217 // Bus Functions
218 //
219 NTHALAPI
220 NTSTATUS
221 NTAPI
224 );
225 
226 //
227 // Environment Functions
228 //
229 #ifdef _ARC_
230 NTHALAPI
232 NTAPI
234  _In_ PCH Name,
235  _In_ PCH Value
236 );
237 
238 NTHALAPI
240 NTAPI
242  _In_ PCH Variable,
245 );
246 #endif
247 
248 //
249 // Profiling Functions
250 //
251 VOID
252 NTAPI
254  _In_ KPROFILE_SOURCE ProfileSource
255 );
256 
257 NTHALAPI
258 VOID
259 NTAPI
261  _In_ KPROFILE_SOURCE ProfileSource
262 );
263 
264 NTHALAPI
265 ULONG_PTR
266 NTAPI
269 );
270 
271 //
272 // Time Functions
273 //
274 NTHALAPI
275 BOOLEAN
276 NTAPI
278  _In_ PTIME_FIELDS RtcTime
279 );
280 
281 NTHALAPI
282 BOOLEAN
283 NTAPI
285  _In_ PTIME_FIELDS RtcTime
286 );
287 
288 NTHALAPI
289 ULONG
290 NTAPI
293 );
294 
295 
296 //
297 // BIOS call API
298 //
299 #ifdef _M_AMD64
300 
301 NTSTATUS
302 NTAPI
304  _In_ ULONG *Size,
306  _In_ USHORT *Offset);
307 
308 NTSTATUS
309 NTAPI
312  _In_ USHORT Offset);
313 
314 NTSTATUS
315 NTAPI
320  _In_ ULONG Size);
321 
322 NTSTATUS
323 NTAPI
328  _In_ ULONG Size);
329 
330 BOOLEAN
331 NTAPI
333  _In_ ULONG InterruptNumber,
334  _Inout_ PX86_BIOS_REGISTERS Registers);
335 
336 #endif // _M_AMD64
337 
338 #endif // NTOS_MODE_USER
339 #endif // _HALFUNCS_H
ULONG HalGetInterruptSource(VOID)
Definition: pic.c:108
signed char * PCHAR
Definition: retypes.h:7
NTHALAPI VOID NTAPI HalDisableSystemInterrupt(_In_ ULONG Vector, _In_ KIRQL Irql)
NTHALAPI ULONG_PTR NTAPI HalSetProfileInterval(_In_ ULONG_PTR Interval)
Definition: profil.c:58
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE InterruptMode
Definition: iofuncs.h:798
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
NTHALAPI UCHAR FASTCALL HalSystemVectorDispatchEntry(_In_ ULONG Vector, _Out_ PKINTERRUPT_ROUTINE **FlatDispatch, _Out_ PKINTERRUPT_ROUTINE *NoConnection)
#define _In_reads_bytes_(s)
Definition: no_sal2.h:170
#define NTHALAPI
Definition: ntoskrnl.h:40
NTHALAPI VOID NTAPI HalReturnToFirmware(_In_ FIRMWARE_REENTRY Action)
Definition: reboot.c:51
LONG NTSTATUS
Definition: precomp.h:26
NTHALAPI BOOLEAN NTAPI HalQueryRealTimeClock(_In_ PTIME_FIELDS RtcTime)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547
ULONG ARC_STATUS
Definition: arc.h:4
NTHALAPI VOID FASTCALL HalRequestSoftwareInterrupt(_In_ KIRQL SoftwareInterruptRequested)
NTHALAPI VOID NTAPI HalStopProfileInterrupt(_In_ KPROFILE_SOURCE ProfileSource)
Definition: profil.c:24
ARC_STATUS NTAPI HalGetEnvironmentVariable(IN PCH Name, IN USHORT ValueLength, IN PCH Value)
Definition: rtc.c:70
VOID NTAPI HalStartProfileInterrupt(_In_ KPROFILE_SOURCE ProfileSource)
Definition: profil.c:41
NTHALAPI VOID NTAPI HalProcessorIdle(VOID)
Definition: processor.c:83
#define FASTCALL
Definition: nt_native.h:50
_Out_ PKIRQL Irql
Definition: csq.h:179
uint32_t ULONG_PTR
Definition: typedefs.h:65
NTHALAPI BOOLEAN NTAPI HalEnableSystemInterrupt(_In_ ULONG Vector, _In_ KIRQL Irql, _In_ KINTERRUPT_MODE InterruptMode)
#define _Out_writes_bytes_(s)
Definition: no_sal2.h:178
BOOLEAN NTAPI HalStartNextProcessor(IN PLOADER_PARAMETER_BLOCK LoaderBlock, IN PKPROCESSOR_STATE ProcessorState)
Definition: processor.c:71
UCHAR KIRQL
Definition: env_spec_w32.h:591
NTSTATUS NTAPI x86BiosFreeBuffer(_In_ USHORT Segment, _In_ USHORT Offset)
Definition: x86bios.c:181
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2430
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
NTHALAPI BOOLEAN NTAPI HalAllProcessorsStarted(VOID)
Definition: processor.c:60
VOID FASTCALL HalClearSoftwareInterrupt(_In_ KIRQL Request)
VOID NTAPI HalInitializeProcessor(IN ULONG ProcessorNumber, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: processor.c:48
NTSTATUS NTAPI x86BiosAllocateBuffer(_In_ ULONG *Size, _In_ USHORT *Segment, _In_ USHORT *Offset)
Definition: x86bios.c:152
CHAR * PCH
Definition: ntbasedef.h:391
NTHALAPI VOID NTAPI HalDisplayString(_In_ PCHAR String)
unsigned char BOOLEAN
enum _KPROFILE_SOURCE KPROFILE_SOURCE
enum _KINTERRUPT_MODE KINTERRUPT_MODE
#define _Out_
Definition: no_sal2.h:160
Definition: bufpool.h:45
NTSTATUS NTAPI x86BiosReadMemory(_In_ USHORT Segment, _In_ USHORT Offset, _Out_writes_bytes_(Size) PVOID Buffer, _In_ ULONG Size)
Definition: x86bios.c:205
NTHALAPI BOOLEAN NTAPI HalBeginSystemInterrupt(_In_ KIRQL Irql, _In_ ULONG Vector, _Out_ PKIRQL OldIrql)
_Inout_ PVOID Segment
Definition: exfuncs.h:1101
NTHALAPI BOOLEAN NTAPI HalSetRealTimeClock(_In_ PTIME_FIELDS RtcTime)
Definition: cmos.c:288
NTHALAPI VOID NTAPI HalRequestIpi(_In_ KAFFINITY TargetSet)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _Out_opt_ PUSHORT _Inout_opt_ PUNICODE_STRING Value
Definition: wdfregistry.h:406
DWORD Interval
Definition: netstat.c:33
VOID(NTAPI * PKINTERRUPT_ROUTINE)(VOID)
Definition: ketypes.h:490
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
#define _Inout_
Definition: no_sal2.h:162
NTHALAPI VOID NTAPI HalHandleNMI(PVOID NmiInfo)
NTHALAPI VOID NTAPI HalReportResourceUsage(VOID)
Definition: usage.c:67
NTHALAPI ULONG NTAPI HalSetTimeIncrement(_In_ ULONG Increment)
unsigned char UCHAR
Definition: xmlstorage.h:181
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:790
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
#define _In_
Definition: no_sal2.h:158
ARC_STATUS NTAPI HalSetEnvironmentVariable(IN PCH Name, IN PCH Value)
Definition: rtc.c:57
NTHALAPI VOID NTAPI HalEndSystemInterrupt(_In_ KIRQL Irql, _In_ UCHAR Vector)
unsigned short USHORT
Definition: pedump.c:61
_In_ WDFIOTARGET _In_ _Strict_type_match_ WDF_IO_TARGET_SENT_IO_ACTION Action
Definition: wdfiotarget.h:506
ULONG_PTR KAFFINITY
Definition: compat.h:85
NTHALAPI NTSTATUS NTAPI HalAdjustResourceList(_Inout_ PIO_RESOURCE_REQUIREMENTS_LIST *pResourceList)
unsigned int ULONG
Definition: retypes.h:1
BOOLEAN NTAPI x86BiosCall(_In_ ULONG InterruptNumber, _Inout_ PX86_BIOS_REGISTERS Registers)
Definition: x86bios.c:405
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG Increment
Definition: CrNtStubs.h:42
BOOLEAN NTAPI HalInitSystem(IN ULONG BootPhase, IN PLOADER_PARAMETER_BLOCK LoaderBlock)
Definition: halinit.c:43
NTSTATUS NTAPI x86BiosWriteMemory(_In_ USHORT Segment, _In_ USHORT Offset, _In_reads_bytes_(Size) PVOID Buffer, _In_ ULONG Size)
Definition: x86bios.c:232