2001-08-21 20:18:27 +00:00
|
|
|
/*
|
2005-06-18 14:30:09 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS Hardware Abstraction Layer
|
|
|
|
* FILE: hal/halx86/include/hal.h
|
|
|
|
* PURPOSE: HAL Header
|
|
|
|
* PROGRAMMER: Alex Ionescu (alex@relsoft.net)
|
2001-08-21 20:18:27 +00:00
|
|
|
*/
|
|
|
|
|
2005-06-18 14:30:09 +00:00
|
|
|
/* INCLUDES ******************************************************************/
|
|
|
|
|
2005-07-26 14:00:45 +00:00
|
|
|
/* C Headers */
|
|
|
|
#include <stdio.h>
|
|
|
|
|
2006-11-17 04:18:41 +00:00
|
|
|
/* WDK HAL Compilation hack */
|
2006-11-14 18:17:33 +00:00
|
|
|
#include <excpt.h>
|
|
|
|
#include <ntdef.h>
|
2010-03-03 21:56:52 +00:00
|
|
|
#ifndef _MINIHAL_
|
2009-08-07 10:45:59 +00:00
|
|
|
#undef NTSYSAPI
|
|
|
|
#define NTSYSAPI __declspec(dllimport)
|
2010-03-03 21:56:52 +00:00
|
|
|
#else
|
[FREELDR] Define _BLDR_ for WDK header compatibility
[HAL] Define _NTHALDLL_ for WDK header compatibility, get rif of DECLSPEC_IMPORT header hack
[NDK/RTL] Fix some Rtl prototypes (PCHAR -> PCCH)
[NDK] Fix ZwOpenEvent prototype
[NTIFS] Fix definition of NTKERNELAPI, move some types, fix PRTL_ALLOCATE_STRING_ROUTINE, PRTL_REALLOCATE_STRING_ROUTINE, PRTL_FREE_STRING_ROUTINE, define CTL_CODE, DEVICE_TYPE_FROM_CTL_CODE, FILE_ANY_ACCESS, FILE_SPECIAL_ACCESS, FILE_READ_ACCESS, FILE_WRITE_ACCESS identical to wdm.h, remove duplicate RtlGenerate8dot3Name, remove ZwOpenEvent
[NTPOAPI] Guard some types with #ifndef _PO_DDK_
[WDM] Create reactos compatible definition of NTKERNELAPI, add KDPC_WATCHDOG_INFORMATION, BATTERY_REPORTING_SCALE, fix ALIGN_UP_POINTER_BY, guard some types with #ifndef _PO_DDK_, update POWER_INFORMATION_LEVEL, make some FILE_DEVICE_ definitions identical to ntifs.h, fix HalAllocateCommonBuffer
svn path=/branches/header-work/; revision=46050
2010-03-10 04:16:52 +00:00
|
|
|
#undef NTSYSAPI
|
|
|
|
#define NTSYSAPI
|
2010-03-03 21:56:52 +00:00
|
|
|
#endif
|
2006-11-14 18:17:33 +00:00
|
|
|
|
2005-06-24 01:37:08 +00:00
|
|
|
/* IFS/DDK/NDK Headers */
|
2005-12-01 21:37:19 +00:00
|
|
|
#include <ntifs.h>
|
2006-11-27 19:26:31 +00:00
|
|
|
#include <bugcodes.h>
|
2006-11-12 22:51:06 +00:00
|
|
|
#include <ntdddisk.h>
|
2006-05-10 17:47:44 +00:00
|
|
|
#include <arc/arc.h>
|
- Stub out DbgKdWriteVirtualMemoryApi, DbgKdReadPhysicalMemoryApi, DbgKdWritePhysicalMemoryApi, DbgKdWriteBreakPointExApi, DbgKdRestoreBreakPointExApi, DbgKdSearchMemoryApi and DbgKdFillMemoryApi cases more properly.
- Fail on physical memory write like we do for read too.
- Don't handle OldVlm1/2 as they appear to be deprecated and unhandled in Windows.
- Implement HalHaltSystem to halt execution in a portable way. Default to xHalHaltSystem, a simple infinite loop, if we get called before HAL has initialized. Use this in KiBugCheckDebugBreak and the system shutdown handler instead of x86/AMD64/ARM intrinsics.
- Don't try to halt the CPU if KeBugCheck has been called 3 times or more -- if this happens, something has gone very wrong, and we shouldn't try to do anything special. Just loop infinitely.
- Fix KiBugCheckDebugBreak -- it shouldn't halt execution when called for the first chance as bugcheck callbacks have not been invoked at this point (nor has the BSOD been displayed). Use SEH to protect against a crash instead of checking KdDebuggerNotPresent as the debugger, if it is present, *could* disconnect while the trap is being handled. Also, don't halt execution if the debugger handled the breakpoint, just break again.
- Don't call MmMapIoSpace from HalpReboot! The reboot might take place at elevated IRQL (as high as HIGH_LEVEL if called from KeBugCheck), and thus can't use any Mm support routines. Use a PTE from the reserved HAL region and map it ourselves instead as done in the BIOS call code.
- Acquire the display ownership in HalReturnToFirmware in case the caller hasn't done so (as done in the KD reboot routine, for example).
- Just include ntndk.h in hal.h instead of including 6 NDK headers (which turns into more than half of the NDK anyway since those headers include other NDK headers).
- Crashing and rebooting from KD now works properly.
svn path=/trunk/; revision=43380
2009-10-11 20:16:45 +00:00
|
|
|
#include <ntndk.h>
|
2005-06-26 01:12:21 +00:00
|
|
|
|
2010-06-28 04:25:38 +00:00
|
|
|
/* Internal shared PCI and ACPI header */
|
2010-06-27 23:54:47 +00:00
|
|
|
#include <drivers/pci/pci.h>
|
2010-06-28 04:25:38 +00:00
|
|
|
#include <drivers/acpi/acpi.h>
|
2010-06-27 23:54:47 +00:00
|
|
|
|
2006-11-17 04:18:41 +00:00
|
|
|
/* Internal kernel headers */
|
2010-01-01 15:09:14 +00:00
|
|
|
#define KeGetCurrentThread _KeGetCurrentThread
|
2008-09-03 00:44:50 +00:00
|
|
|
#ifdef _M_AMD64
|
2010-06-03 23:18:20 +00:00
|
|
|
#include <internal/amd64/ke.h>
|
|
|
|
#include <internal/amd64/mm.h>
|
2008-09-03 00:44:50 +00:00
|
|
|
#include "internal/amd64/intrin_i.h"
|
|
|
|
#else
|
2010-06-03 23:18:20 +00:00
|
|
|
#include <internal/i386/ke.h>
|
|
|
|
#include <internal/i386/mm.h>
|
2006-11-17 04:18:41 +00:00
|
|
|
#include "internal/i386/intrin_i.h"
|
2008-09-03 00:44:50 +00:00
|
|
|
#endif
|
2005-06-18 14:30:09 +00:00
|
|
|
|
|
|
|
/* Internal HAL Headers */
|
|
|
|
#include "apic.h"
|
|
|
|
#include "bus.h"
|
|
|
|
#include "halirq.h"
|
2005-08-22 08:39:42 +00:00
|
|
|
#include "haldma.h"
|
2005-06-18 14:30:09 +00:00
|
|
|
#include "halp.h"
|
|
|
|
#include "mps.h"
|
|
|
|
#include "ioapic.h"
|
2010-03-31 04:26:04 +00:00
|
|
|
#include "halacpi.h"
|
2005-06-18 14:30:09 +00:00
|
|
|
|
|
|
|
/* EOF */
|