2006-05-10 17:47:44 +00:00
|
|
|
/*++ NDK Version: 0098
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
Copyright (c) Alex Ionescu. All rights reserved.
|
|
|
|
|
|
|
|
Header Name:
|
|
|
|
|
|
|
|
halfuncs.h
|
|
|
|
|
|
|
|
Abstract:
|
|
|
|
|
|
|
|
Function definitions for the HAL.
|
|
|
|
|
|
|
|
Author:
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
Alex Ionescu (alexi@tinykrnl.org) - Updated - 27-Feb-2006
|
2005-11-22 04:57:45 +00:00
|
|
|
|
|
|
|
--*/
|
|
|
|
|
2005-06-18 23:33:40 +00:00
|
|
|
#ifndef _HALFUNCS_H
|
|
|
|
#define _HALFUNCS_H
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Dependencies
|
|
|
|
//
|
2005-11-25 00:17:40 +00:00
|
|
|
#include <umtypes.h>
|
|
|
|
#include <haltypes.h>
|
2006-11-14 22:42:59 +00:00
|
|
|
#include <ketypes.h>
|
2018-12-30 11:19:11 +00:00
|
|
|
#include <section_attribs.h>
|
2005-11-22 04:57:45 +00:00
|
|
|
|
2005-11-25 00:17:40 +00:00
|
|
|
#ifndef NTOS_MODE_USER
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2006-11-14 18:17:33 +00:00
|
|
|
//
|
|
|
|
// Private HAL Callbacks
|
|
|
|
//
|
|
|
|
#define HalHandlerForBus HALPRIVATEDISPATCH->HalHandlerForBus
|
|
|
|
#define HalHandlerForConfigSpace HALPRIVATEDISPATCH->HalHandlerForConfigSpace
|
|
|
|
#define HalLocateHiberRanges HALPRIVATEDISPATCH->HalLocateHiberRanges
|
|
|
|
#define HalRegisterBusHandler HALPRIVATEDISPATCH->HalRegisterBusHandler
|
|
|
|
#define HalSetWakeEnable HALPRIVATEDISPATCH->HalSetWakeEnable
|
|
|
|
#define HalSetWakeAlarm HALPRIVATEDISPATCH->HalSetWakeAlarm
|
|
|
|
#define HalPciTranslateBusAddress HALPRIVATEDISPATCH->HalPciTranslateBusAddress
|
|
|
|
#define HalPciAssignSlotResources HALPRIVATEDISPATCH->HalPciAssignSlotResources
|
|
|
|
#define HalHaltSystem HALPRIVATEDISPATCH->HalHaltSystem
|
|
|
|
#define HalFindBusAddressTranslation HALPRIVATEDISPATCH->HalFindBusAddressTranslation
|
|
|
|
#define HalResetDisplay HALPRIVATEDISPATCH->HalResetDisplay
|
|
|
|
#define HalAllocateMapRegisters HALPRIVATEDISPATCH->HalAllocateMapRegisters
|
|
|
|
#define KdSetupPciDeviceForDebugging HALPRIVATEDISPATCH->KdSetupPciDeviceForDebugging
|
|
|
|
#define KdReleasePciDeviceforDebugging HALPRIVATEDISPATCH->KdReleasePciDeviceforDebugging
|
|
|
|
#define KdGetAcpiTablePhase0 HALPRIVATEDISPATCH->KdGetAcpiTablePhase0
|
|
|
|
#define KdCheckPowerButton HALPRIVATEDISPATCH->KdCheckPowerButton
|
|
|
|
#define HalVectorToIDTEntry HALPRIVATEDISPATCH->HalVectorToIDTEntry
|
|
|
|
#define KdMapPhysicalMemory64 HALPRIVATEDISPATCH->KdMapPhysicalMemory64
|
|
|
|
#define KdUnmapVirtualAddress HALPRIVATEDISPATCH->KdUnmapVirtualAddress
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Display Functions
|
|
|
|
//
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalDisplayString(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCHAR String
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
//
|
|
|
|
// Initialization Functions
|
|
|
|
//
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
HalAllProcessorsStarted(
|
|
|
|
VOID
|
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
#ifdef _ARC_
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalInitializeProcessor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG ProcessorNumber,
|
|
|
|
_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2021-05-11 15:13:14 +00:00
|
|
|
CODE_SEG("INIT")
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-06-26 05:52:40 +00:00
|
|
|
BOOLEAN
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
HalInitSystem(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG BootPhase,
|
|
|
|
_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
|
|
|
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2006-11-14 20:59:48 +00:00
|
|
|
BOOLEAN
|
2005-11-22 04:57:45 +00:00
|
|
|
NTAPI
|
2006-11-14 20:59:48 +00:00
|
|
|
HalStartNextProcessor(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ struct _LOADER_PARAMETER_BLOCK *LoaderBlock,
|
|
|
|
_In_ PKPROCESSOR_STATE ProcessorState
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-26 05:52:40 +00:00
|
|
|
|
2006-11-14 20:59:48 +00:00
|
|
|
#endif
|
|
|
|
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2006-11-14 20:59:48 +00:00
|
|
|
VOID
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2006-11-14 20:59:48 +00:00
|
|
|
HalReturnToFirmware(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ FIRMWARE_REENTRY Action
|
2005-11-22 04:57:45 +00:00
|
|
|
);
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2006-09-11 06:50:19 +00:00
|
|
|
//
|
|
|
|
// CPU Routines
|
|
|
|
//
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalProcessorIdle(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Interrupt Functions
|
|
|
|
//
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-06-26 01:08:55 +00:00
|
|
|
BOOLEAN
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
HalBeginSystemInterrupt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ KIRQL Irql,
|
|
|
|
_In_ ULONG Vector,
|
|
|
|
_Out_ PKIRQL OldIrql
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2008-06-15 06:14:02 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
HalClearSoftwareInterrupt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ KIRQL Request
|
2008-06-15 06:14:02 +00:00
|
|
|
);
|
|
|
|
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2009-11-10 23:00:51 +00:00
|
|
|
VOID
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
HalDisableSystemInterrupt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Vector,
|
|
|
|
_In_ KIRQL Irql
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
BOOLEAN
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
HalEnableSystemInterrupt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Vector,
|
|
|
|
_In_ KIRQL Irql,
|
|
|
|
_In_ KINTERRUPT_MODE InterruptMode
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2015-09-09 11:21:02 +00:00
|
|
|
#ifdef __REACTOS__
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
VOID
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
HalEndSystemInterrupt(
|
2015-09-09 11:21:02 +00:00
|
|
|
_In_ KIRQL Irql,
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PKTRAP_FRAME TrapFrame
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
2015-09-09 11:21:02 +00:00
|
|
|
#else
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalEndSystemInterrupt(
|
|
|
|
_In_ KIRQL Irql,
|
|
|
|
_In_ UCHAR Vector
|
|
|
|
);
|
|
|
|
#endif
|
2005-06-18 23:33:40 +00:00
|
|
|
|
2008-06-15 06:14:02 +00:00
|
|
|
#ifdef _ARM_ // FIXME: ndk/arm? armddk.h?
|
|
|
|
ULONG
|
|
|
|
HalGetInterruptSource(
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2021-05-11 15:13:14 +00:00
|
|
|
CODE_SEG("INIT")
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
VOID
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
HalReportResourceUsage(
|
|
|
|
VOID
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
VOID
|
|
|
|
FASTCALL
|
|
|
|
HalRequestSoftwareInterrupt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ KIRQL SoftwareInterruptRequested
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
VOID
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-11-22 04:57:45 +00:00
|
|
|
HalRequestIpi(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ KAFFINITY TargetSet
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2005-12-01 21:23:06 +00:00
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalHandleNMI(
|
2006-06-23 21:21:45 +00:00
|
|
|
PVOID NmiInfo
|
2005-12-01 21:23:06 +00:00
|
|
|
);
|
|
|
|
|
2009-10-29 19:58:41 +00:00
|
|
|
NTHALAPI
|
|
|
|
UCHAR
|
|
|
|
FASTCALL
|
|
|
|
HalSystemVectorDispatchEntry(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Vector,
|
|
|
|
_Out_ PKINTERRUPT_ROUTINE **FlatDispatch,
|
|
|
|
_Out_ PKINTERRUPT_ROUTINE *NoConnection
|
2009-10-29 19:58:41 +00:00
|
|
|
);
|
|
|
|
|
2010-07-19 15:14:34 +00:00
|
|
|
//
|
|
|
|
// Bus Functions
|
|
|
|
//
|
|
|
|
NTHALAPI
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
HalAdjustResourceList(
|
2013-01-13 14:49:21 +00:00
|
|
|
_Inout_ PIO_RESOURCE_REQUIREMENTS_LIST *pResourceList
|
2010-07-19 15:14:34 +00:00
|
|
|
);
|
[HAL/NDK]
- Make Vector parameter in HalEnableSystemInterrupt, HalDisableSystemInterrupt and HalBeginSystemInterrupt an ULONG, not an UCHAR
[NDK]
- 64bit fixes for HANDLE_TABLE, KPROCESS, SECTION_IMAGE_INFORMATION, MMADDRESS_LIST, MMVAD_FLAGS, MMVAD, MMVAD_LONG, MMVAD_SHORT, MEMORY_DESCRIPTOR, MEMORY_ALLOCATION_DESCRIPTOR, LdrVerifyMappedImageMatchesChecksum
- KDPC_DATA::DpcQueueDepth is signed on amd64, unsigned on x86
[NTOSKRNL]
- Fix hundreds of MSVC and amd64 warnings
- add a pragma message to FstubFixupEfiPartition, since it looks broken
- Move portable Ke constants from <arch>/cpu.c to krnlinit.c
- Fixed a bug in amd64 KiGeneralProtectionFaultHandler
svn path=/trunk/; revision=53734
2011-09-18 13:11:45 +00:00
|
|
|
|
2005-11-22 04:57:45 +00:00
|
|
|
//
|
|
|
|
// Environment Functions
|
|
|
|
//
|
2006-11-16 17:30:52 +00:00
|
|
|
#ifdef _ARC_
|
2005-11-27 20:18:33 +00:00
|
|
|
NTHALAPI
|
2006-11-16 17:30:52 +00:00
|
|
|
ARC_STATUS
|
2005-09-05 04:48:20 +00:00
|
|
|
NTAPI
|
2005-06-18 23:33:40 +00:00
|
|
|
HalSetEnvironmentVariable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCH Name,
|
|
|
|
_In_ PCH Value
|
2005-06-18 23:33:40 +00:00
|
|
|
);
|
|
|
|
|
2006-11-16 17:30:52 +00:00
|
|
|
NTHALAPI
|
|
|
|
ARC_STATUS
|
|
|
|
NTAPI
|
|
|
|
HalGetEnvironmentVariable(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PCH Variable,
|
|
|
|
_In_ USHORT Length,
|
|
|
|
_Out_ PCH Buffer
|
2006-11-16 17:30:52 +00:00
|
|
|
);
|
|
|
|
#endif
|
|
|
|
|
2009-10-29 19:58:41 +00:00
|
|
|
//
|
|
|
|
// Profiling Functions
|
|
|
|
//
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalStartProfileInterrupt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ KPROFILE_SOURCE ProfileSource
|
2009-10-29 19:58:41 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
VOID
|
|
|
|
NTAPI
|
|
|
|
HalStopProfileInterrupt(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ KPROFILE_SOURCE ProfileSource
|
2009-10-29 19:58:41 +00:00
|
|
|
);
|
|
|
|
|
|
|
|
NTHALAPI
|
|
|
|
ULONG_PTR
|
|
|
|
NTAPI
|
|
|
|
HalSetProfileInterval(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG_PTR Interval
|
2009-10-29 19:58:41 +00:00
|
|
|
);
|
|
|
|
|
2006-05-10 17:47:44 +00:00
|
|
|
//
|
|
|
|
// Time Functions
|
|
|
|
//
|
|
|
|
NTHALAPI
|
2006-06-23 21:21:45 +00:00
|
|
|
BOOLEAN
|
2006-05-10 17:47:44 +00:00
|
|
|
NTAPI
|
|
|
|
HalQueryRealTimeClock(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PTIME_FIELDS RtcTime
|
2006-05-10 17:47:44 +00:00
|
|
|
);
|
|
|
|
|
2006-10-26 01:49:51 +00:00
|
|
|
NTHALAPI
|
2006-11-16 17:30:52 +00:00
|
|
|
BOOLEAN
|
2006-10-26 01:49:51 +00:00
|
|
|
NTAPI
|
|
|
|
HalSetRealTimeClock(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ PTIME_FIELDS RtcTime
|
2006-10-26 01:49:51 +00:00
|
|
|
);
|
|
|
|
|
2010-01-03 18:17:21 +00:00
|
|
|
NTHALAPI
|
|
|
|
ULONG
|
|
|
|
NTAPI
|
|
|
|
HalSetTimeIncrement(
|
2013-01-13 14:49:21 +00:00
|
|
|
_In_ ULONG Increment
|
2010-01-03 18:17:21 +00:00
|
|
|
);
|
|
|
|
|
2018-02-11 15:43:51 +00:00
|
|
|
|
|
|
|
//
|
|
|
|
// BIOS call API
|
|
|
|
//
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
x86BiosAllocateBuffer(
|
|
|
|
_In_ ULONG *Size,
|
|
|
|
_In_ USHORT *Segment,
|
|
|
|
_In_ USHORT *Offset);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
x86BiosFreeBuffer(
|
|
|
|
_In_ USHORT Segment,
|
|
|
|
_In_ USHORT Offset);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
x86BiosReadMemory(
|
|
|
|
_In_ USHORT Segment,
|
|
|
|
_In_ USHORT Offset,
|
|
|
|
_Out_writes_bytes_(Size) PVOID Buffer,
|
|
|
|
_In_ ULONG Size);
|
|
|
|
|
|
|
|
NTSTATUS
|
|
|
|
NTAPI
|
|
|
|
x86BiosWriteMemory(
|
|
|
|
_In_ USHORT Segment,
|
|
|
|
_In_ USHORT Offset,
|
|
|
|
_In_reads_bytes_(Size) PVOID Buffer,
|
|
|
|
_In_ ULONG Size);
|
|
|
|
|
|
|
|
BOOLEAN
|
|
|
|
NTAPI
|
|
|
|
x86BiosCall(
|
|
|
|
_In_ ULONG InterruptNumber,
|
|
|
|
_Inout_ PX86_BIOS_REGISTERS Registers);
|
|
|
|
|
|
|
|
#endif // NTOS_MODE_USER
|
|
|
|
#endif // _HALFUNCS_H
|