ReactOS  0.4.14-dev-77-gd9e7c48
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 
84 INIT_FUNCTION
86 BOOLEAN
87 NTAPI
89  _In_ ULONG BootPhase,
90  _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock
91 );
92 
94 BOOLEAN
95 NTAPI
97  _In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
98  _In_ PKPROCESSOR_STATE ProcessorState
99 );
100 
101 #endif
102 
103 NTHALAPI
104 VOID
105 NTAPI
108 );
109 
110 //
111 // CPU Routines
112 //
113 NTHALAPI
114 VOID
115 NTAPI
117  VOID
118 );
119 
120 //
121 // Interrupt Functions
122 //
123 NTHALAPI
124 BOOLEAN
125 NTAPI
127  _In_ KIRQL Irql,
128  _In_ ULONG Vector,
130 );
131 
132 VOID
133 FASTCALL
136 );
137 
138 NTHALAPI
139 VOID
140 NTAPI
142  _In_ ULONG Vector,
143  _In_ KIRQL Irql
144 );
145 
146 NTHALAPI
147 BOOLEAN
148 NTAPI
150  _In_ ULONG Vector,
151  _In_ KIRQL Irql,
153 );
154 
155 #ifdef __REACTOS__
156 NTHALAPI
157 VOID
158 NTAPI
160  _In_ KIRQL Irql,
161  _In_ PKTRAP_FRAME TrapFrame
162 );
163 #else
164 NTHALAPI
165 VOID
166 NTAPI
168  _In_ KIRQL Irql,
170 );
171 #endif
172 
173 #ifdef _ARM_ // FIXME: ndk/arm? armddk.h?
174 ULONG
176  VOID
177 );
178 #endif
179 
180 INIT_FUNCTION
181 NTHALAPI
182 VOID
183 NTAPI
185  VOID
186 );
187 
188 NTHALAPI
189 VOID
190 FASTCALL
192  _In_ KIRQL SoftwareInterruptRequested
193 );
194 
195 NTHALAPI
196 VOID
197 NTAPI
199  _In_ KAFFINITY TargetSet
200 );
201 
202 NTHALAPI
203 VOID
204 NTAPI
206  PVOID NmiInfo
207 );
208 
209 NTHALAPI
210 UCHAR
211 FASTCALL
213  _In_ ULONG Vector,
214  _Out_ PKINTERRUPT_ROUTINE **FlatDispatch,
215  _Out_ PKINTERRUPT_ROUTINE *NoConnection
216 );
217 
218 //
219 // Bus Functions
220 //
221 NTHALAPI
222 NTSTATUS
223 NTAPI
226 );
227 
228 //
229 // Environment Functions
230 //
231 #ifdef _ARC_
232 NTHALAPI
234 NTAPI
236  _In_ PCH Name,
237  _In_ PCH Value
238 );
239 
240 NTHALAPI
242 NTAPI
244  _In_ PCH Variable,
247 );
248 #endif
249 
250 //
251 // Profiling Functions
252 //
253 VOID
254 NTAPI
256  _In_ KPROFILE_SOURCE ProfileSource
257 );
258 
259 NTHALAPI
260 VOID
261 NTAPI
263  _In_ KPROFILE_SOURCE ProfileSource
264 );
265 
266 NTHALAPI
267 ULONG_PTR
268 NTAPI
271 );
272 
273 //
274 // Time Functions
275 //
276 NTHALAPI
277 BOOLEAN
278 NTAPI
280  _In_ PTIME_FIELDS RtcTime
281 );
282 
283 NTHALAPI
284 BOOLEAN
285 NTAPI
287  _In_ PTIME_FIELDS RtcTime
288 );
289 
290 NTHALAPI
291 ULONG
292 NTAPI
295 );
296 
297 
298 //
299 // BIOS call API
300 //
301 #ifdef _M_AMD64
302 
303 NTSTATUS
304 NTAPI
306  _In_ ULONG *Size,
308  _In_ USHORT *Offset);
309 
310 NTSTATUS
311 NTAPI
314  _In_ USHORT Offset);
315 
316 NTSTATUS
317 NTAPI
322  _In_ ULONG Size);
323 
324 NTSTATUS
325 NTAPI
330  _In_ ULONG Size);
331 
332 BOOLEAN
333 NTAPI
335  _In_ ULONG InterruptNumber,
336  _Inout_ PX86_BIOS_REGISTERS Registers);
337 
338 #endif // _M_AMD64
339 
340 #endif // NTOS_MODE_USER
341 #endif // _HALFUNCS_H
ULONG HalGetInterruptSource(VOID)
Definition: pic.c:108
_In_opt_ ULONG _Out_ PULONG Value
Definition: rtlfuncs.h:2343
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)
enum _KPROFILE_SOURCE KPROFILE_SOURCE
_In_ PKSERVICE_ROUTINE _In_opt_ PVOID _In_opt_ PKSPIN_LOCK _In_ ULONG _In_ KIRQL _In_ KIRQL _In_ KINTERRUPT_MODE InterruptMode
Definition: iofuncs.h:798
NTHALAPI UCHAR FASTCALL HalSystemVectorDispatchEntry(_In_ ULONG Vector, _Out_ PKINTERRUPT_ROUTINE **FlatDispatch, _Out_ PKINTERRUPT_ROUTINE *NoConnection)
#define NTHALAPI
Definition: ntoskrnl.h:39
NTHALAPI VOID NTAPI HalReturnToFirmware(_In_ FIRMWARE_REENTRY Action)
LONG NTSTATUS
Definition: precomp.h:26
NTHALAPI BOOLEAN NTAPI HalQueryRealTimeClock(_In_ PTIME_FIELDS RtcTime)
ULONG ARC_STATUS
Definition: arc.h:4
static WCHAR String[]
Definition: stringtable.c:55
NTHALAPI VOID FASTCALL HalRequestSoftwareInterrupt(_In_ KIRQL SoftwareInterruptRequested)
NTHALAPI VOID NTAPI HalStopProfileInterrupt(_In_ KPROFILE_SOURCE ProfileSource)
ARC_STATUS NTAPI HalGetEnvironmentVariable(IN PCH Name, IN USHORT ValueLength, IN PCH Value)
Definition: rtc.c:70
VOID NTAPI HalStartProfileInterrupt(_In_ KPROFILE_SOURCE ProfileSource)
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:63
NTHALAPI BOOLEAN NTAPI HalEnableSystemInterrupt(_In_ ULONG Vector, _In_ KIRQL Irql, _In_ KINTERRUPT_MODE InterruptMode)
_In_ NDIS_HANDLE _In_ PNDIS_REQUEST Request
Definition: ndis.h:5173
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:145
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
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:116
CHAR * PCH
Definition: ntbasedef.h:398
NTHALAPI VOID NTAPI HalDisplayString(_In_ PCHAR String)
unsigned char BOOLEAN
enum _KINTERRUPT_MODE KINTERRUPT_MODE
#define _Out_writes_bytes_(size)
Definition: no_sal2.h:370
#define _Out_
Definition: no_sal2.h:323
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:169
NTHALAPI BOOLEAN NTAPI HalBeginSystemInterrupt(_In_ KIRQL Irql, _In_ ULONG Vector, _Out_ PKIRQL OldIrql)
_Inout_ PVOID Segment
Definition: exfuncs.h:893
NTHALAPI BOOLEAN NTAPI HalSetRealTimeClock(_In_ PTIME_FIELDS RtcTime)
NTHALAPI VOID NTAPI HalRequestIpi(_In_ KAFFINITY TargetSet)
DWORD Interval
Definition: netstat.c:33
VOID(NTAPI * PKINTERRUPT_ROUTINE)(VOID)
Definition: ketypes.h:490
enum _FIRMWARE_REENTRY FIRMWARE_REENTRY
_In_ PLIST_ENTRY _In_ PSTRING _In_ USHORT _In_opt_ PSTRING _In_opt_ PSTRING _In_ ULONG _In_ ULONG Action
Definition: fsrtlfuncs.h:738
#define _Inout_
Definition: no_sal2.h:244
NTHALAPI VOID NTAPI HalHandleNMI(PVOID NmiInfo)
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:101
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:803
INIT_FUNCTION NTHALAPI VOID NTAPI HalReportResourceUsage(VOID)
Definition: usage.c:67
KIRQL * PKIRQL
Definition: env_spec_w32.h:592
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:359
#define _In_reads_bytes_(size)
Definition: no_sal2.h:229
#define _In_
Definition: no_sal2.h:204
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
ULONG_PTR KAFFINITY
Definition: compat.h:75
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:367
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:196