Commit graph

63 commits

Author SHA1 Message Date
Colin Finck c2c66aff7d Git conversion: Make reactos the root directory, move rosapps, rostests, wallpapers into modules, and delete rossubsys. 2017-10-03 07:45:34 +00:00
Amine Khaldi 6184b165c0 [HAL]
* Add header guards to the main header.
CORE-7716

svn path=/trunk/; revision=62101
2014-02-10 16:50:32 +00:00
Amine Khaldi a69a0b3244 [HAL]
* Remove one time inclusions from the main header and put them back where they belong.
CORE-7716

svn path=/trunk/; revision=61956
2014-02-03 10:58:33 +00:00
Timo Kreuzer f627019d71 [HAL]
- Use functions instead of macros for irq<->vector<->irql translation, this will be neccessary, once apic support is there
- Disable mp hal in rbuild for now, its broken anyway

svn path=/trunk/; revision=53600
2011-09-05 15:20:07 +00:00
Amine Khaldi 42b02afa60 * Include NDK headers on-demand.
svn path=/trunk/; revision=53284
2011-08-17 14:04:33 +00:00
Rafal Harabien 6a2050afbe [HAL]
- Use ExFreePoolWithTag instead of ExFreePool
- Add definitions of used tags

svn path=/trunk/; revision=51943
2011-05-26 22:22:37 +00:00
Sir Richard 2f23c40c67 [ACPI]: Share ACPI table structures and NT-specific registry data in a shared, internal ACPI header, instead of HAL's internal headers, because FreeLDR, the kernel's PnP Manager, the PCI Bus Driver and the ACPI Driver all need access to these types as well.
svn path=/trunk/; revision=47892
2010-06-28 04:25:38 +00:00
Sir Richard 079e15a99e [PCI]: Add PCI IRQ Routing Table structure to Shared, Internal PCI Header (based off the Microsoft Spec and the Apple SMBIOS Header).
[PCI]: Remove HAL-internal PCI definitions from the existing "Shared/Internal" PCI Header which existed in NTOS's private include directory, and move them to HAL-internal headers.
[PCI]: Remove remaining shared PCI definitions from that same header, and put them in the new Shared/Internal PCI Header.
[PCI]: Remove duplicated PCI definitions from FreeLDR, and use thw new Shared/Internal PCI Header.

svn path=/trunk/; revision=47886
2010-06-27 23:54:47 +00:00
Timo Kreuzer a8d609e19d [HAL]
Include the correct headers for amd64 vs i386

svn path=/trunk/; revision=47557
2010-06-03 23:18:20 +00:00
Sir Richard 03317815a6 [HALACPI]: Add HAL ACPI header.
svn path=/trunk/; revision=46610
2010-03-31 04:26:04 +00:00
Timo Kreuzer cbdf28bb6a [HEADERS]
Reintegrate header-work branch. Thanks to hours of boring work on the ddk headers (Most of it done by Amine Khaldi), we have now a decent set, which is still incomplete but already relatively close to latest WDK. A clean rebuild is recommended.

svn path=/trunk/; revision=46155
2010-03-12 23:16:29 +00:00
Hervé Poussineau 02f31de4d1 [hal] Add a mini-HAL static library
Mostly the same thing as the real one, except interrupts and DMA

svn path=/trunk/; revision=45809
2010-03-03 21:56:52 +00:00
Timo Kreuzer 9ea495ba33 Create a branch for header work.
svn path=/branches/header-work/; revision=45691
2010-02-26 22:57:55 +00:00
ReactOS Portable Systems Group 61df639e4a NMI Support Patch 4:
[HAL]:  Use Mm headers to support PTE/PDE address translation instead of a hardcoded, homegrown macro. WARNING: The current HAL code is not PAE compatible (as it already wasn't).
    [NTOS]: Define an inline function to set and query an interrupt handler associated with a given IDT vector. This results in much cleaner code as the uglyness of manually setting up an IDT handler isn't duplicated 10 times. Additionally, it fixes some callers which had not been using HalVectorToIDTEntry to make the initial translation.

svn path=/trunk/; revision=44855
2010-01-01 15:09:14 +00:00
Stefan Ginsberg 31c45b85d7 - 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
Timo Kreuzer f57f4193e5 Merge HAL changes 34743, 34812, 34839, 34917, 35515, 35771, 35902, 35904,
35905, 35906, 35942, 35947, 35948, 35949, 35953, 36013, 36388, 36389, 36570, 37873, 37991, 39151 from amd64 branch

svn path=/trunk/; revision=43173
2009-09-26 21:32:53 +00:00
Stefan Ginsberg ac7daf7ccf - winddk.h: Don't define NTSYSAPI and NTSYSCALLAPI -- this is defined in ntdef.h. Use NTSYSAPI for HalDispatchTable instead of DECLSPEC_IMPORT (see below).
- wdm.h: Properly define NTKERNELAPI.
- ntifs.h: Properly define NTKERNELAPI, and don't redefine NTSYSAPI.
- ntoskrnl: Apply the WDK hack for our headers (and gcc) too. Also redefine NTHALAPI for NDK so we don't auto-import KdComPortInUse -- ld complains about this.
- Apply this for cmlib, csq and rossym too.
- Use this in HAL too, and redefine NTSYSAPI so we don't auto import some structures from the kernel. Also, don't define __declspec(dllimport) to nothing -- this doesn't work with gcc, and doesn't seem to be necessary. I tried building HAL with the WDK and this wasn't an issue.

svn path=/trunk/; revision=42461
2009-08-07 10:45:59 +00:00
Stefan Ginsberg dbd86db31e - Deprecate global helper.h -- define the various 'helpful macros' per module
svn path=/trunk/; revision=39092
2009-01-25 16:13:16 +00:00
Timo Kreuzer 89f1272447 compatability fixes, so some hal code can be shared
svn path=/branches/ros-amd64-bringup/; revision=35902
2008-09-03 00:44:50 +00:00
Aleksey Bragin 3e82239919 - intrin.h should not be included. Fixes MSVC compiling.
svn path=/trunk/; revision=32571
2008-03-05 16:13:16 +00:00
Johannes Anderwald c6b29c7d8f - Fix warning(s)
- Void functions dont return values
- Include intrin.h for _enable / _disable intrinsics

svn path=/trunk/; revision=25683
2007-02-02 08:41:30 +00:00
Alex Ionescu 139ff99f50 - Cleanup HAL initialization code:
- Initailize the clock increment separately from the calibration of stall execution.
  - Raise IRQL to the current IRQL (basically a no-op) to force a standard PIC state. Will be needed for the new IRQ implementation when it'll work.
  - Scan commandline for PCILOCK and BREAK parameters during hal initalization. The former is not supported, only saved, while the latter causes a breakpoint just like the windows implemetnation.
  - Get the bus type (ISA, EISA, MCA) on startup to support bootup from NTLDR.
  - Validate HAL to match the kernel (checked kernel and UP kernel). Also make the kernel set the proper PRCB flags for this.
  - Initialize the CMOS lock.
  - Setup HAL Dispatch table and enable call to HalQuerySystemInformation in the kernel since it now works.
- Rewrite bus functions to get rid of the idea of "Bus handlers". This is a deprecated NT4 concept that ReactOS copied and only slows down performance.
  - Support custom private dispatch table PCI functions.
  - Provide default PCI functions.
  - Rewrite PCI functions using clean structures and code instead of magic macros and undocumented magic values. Use simple macros to generate PCI bus operations for write/read uchar, ushort and ulong.
  - Simplify function definitions for CMOS access.
  - Unify some dupli/tripi-cated code.
- Fix definition of HaliSetSystemInformation.
- Fix definitions of Bus Handler functions (add NTAPI).
- Add official BUS_HANDLER definition to NDK.
- Fix definition of HAL_PRIVATE_DISPATCH.
- Remove some derecated code (isa.c and mca.c).

svn path=/trunk/; revision=24872
2006-11-27 19:26:31 +00:00
Alex Ionescu 1a3b63b4c4 - Fix some more MSVC problems.
- Get rid of HAL's own intrisics and use intrin_i.h and/or MSVC intrinsics from intrin.h
- If anyone knows how to make a .DEF file that is not only understood by both compilers, but also creates a proper import library, please let me know.

svn path=/trunk/; revision=24774
2006-11-17 04:18:41 +00:00
Alex Ionescu 596c3bee62 - Reorganize HAL exports and export KeTRyToAcquireQueuedSpinlock and KeTryToAcquireQueuedSpinLockRaisetoSynch.
- Add stub for HalSetTimeIncrement.
- Cleanup CMOS-related routines (Get/Set environment value and get/set RTC). Fixup some prototypes as well. Inline HalpReadCmos/HalpWriteCmos instead of having a separate function.
- Fixup wrong protypes for various Queued Spinlock functions.
- Use __rdtsc intrinsic instead of Ke386RdTsc.
- Other MSVC compilation fixes.

svn path=/trunk/; revision=24770
2006-11-16 17:30:52 +00:00
Alex Ionescu 5a7f46becc - Implement HalSystemVectorDispatchEntry, KeFlushWriteBuffer, HalFlushCommonBuffer, HalAllocateCrashDumpRegisters.
- Add lots of missing PCI definitions to the DDK, and to the internal file pci.h
- Make HAL compilable with the WDK thanks to a nice hack/trick I found.

svn path=/trunk/; revision=24757
2006-11-14 18:17:33 +00:00
Alex Ionescu 4d578c637e - FSTUB Patch for Mount Manager Support, Part 1:
- Create new /fstub directory in the kernel tree and move iomgr's xhal functions there.
  - Delete disk.c entirely from iomgr.c and spread it across fstub.
  - Entirely reimplement from scratch IoWritePartitionTable, IoReadPartitionTable, IoSetPartitionInformation, HalExamineMbr. Lots of bug fixes in terms of wrong assumptions and compatibility with weird partition tables.
  - Fix prototype of IoAssignDriveLetters, but for now, keep the old code (xHalIoAssignDriveLetters) because this has not been rewritten yet.
  - Move some functions to fstubex.c for future implementation, and some to volume.c. Move the HAL table to halstub.c
  - Make use of the hal.h file commited earlier.
  - Move IoAssignDriveLetters from halfuncs to iofuncs.h
  - Implement missing functions in HAL (IoRead/Write/Set PartitionInfo) and make them call into the ntoskrnl exports.

svn path=/trunk/; revision=24737
2006-11-12 22:51:06 +00:00
KJK::Hyperion ae3c3041f4 Fixes to un-break trunk:
* Disabling XBox HAL for now (TEMPORARY MEASURE)
 * Port MP HAL to the new loader structures

svn path=/trunk/; revision=24325
2006-09-30 23:35:17 +00:00
Alex Ionescu c0ad9f32d3 - [AUDIT] After spending some time looking at the current HAL, I believe it to be clean and written by authors which had knowledge of system internals and have always used clean-rooming. As well, the difference in implementation, complete and utter incompatibility with NT as well as the presence of some Linux-based code confirms this.
- Fix function definitions of HalQueryRealTimeClock, HalGetEnvironmentVariable. They were defined in the NDK in one way, but implemented another way, and since the HAL didn't include its own NDK file, the compiler didn't realize this. Calls of these functions might've experienced serious problems.
- Also fix HalHandleNmi and HalInitSystem definitions.
- Add stub code to actually setup the Clock Interrupt.

svn path=/trunk/; revision=23670
2006-08-23 17:28:39 +00:00
Alex Ionescu 8481c1fa10 - NDK 0.98, now with versionned headers. Too many changes to list, see the TinyKRNL SVN Logs for more detailed information. Thanks to Andrew (Wax), Thomas and Aleksey for testing.
svn path=/trunk/; revision=21880
2006-05-10 17:47:44 +00:00
Alex Ionescu 9c52bdbe04 - Remove some public APIs from internal headers.
- Remove some internal APIs/types from public headers.
- Make PSECTION_OBJECT a PVOID unless really needed (which should only be inside \mm)
- Make hal buildable on msvc.
- Fix some other misc. various msvc/ddk incompatibilities.

svn path=/trunk/; revision=20696
2006-01-08 06:23:17 +00:00
Steven Edwards de98d55a46 stop the abuse of having the ddk directory in the path when including a ddk header
svn path=/trunk/; revision=19810
2005-12-01 21:37:19 +00:00
Filip Navara a0b8ef87a8 Complete reimplementation of HAL DMA routines.
The key changes are
* Proper support for bus-master device adapters.
* Real implementation of map registers.
* Basic support for emulating scatter/gather DMA on
  devices that don't support it in hardware.
* Support for transfers that aren't page aligned.
* Proper detection and support of EISA DMA controllers.
* Fixed prototype for HalFlushCommonBuffer.

svn path=/trunk/; revision=17470
2005-08-22 08:39:42 +00:00
Alex Ionescu b8f8df7565 - Various Microsoft DDK/PSDK compatibility fixes and some MSVC stuff too.
- Fix PSECURITY_DESCRIPTOR_RELATIVE names.c
 - Don't use rtltypes.h as a replacement for normal stdlib headers.
 - Fix a HAL header fixme.

svn path=/trunk/; revision=16744
2005-07-26 14:00:45 +00:00
Eric Kohl ae46f5aa6a Hal needs KPCR_BASE
svn path=/trunk/; revision=16273
2005-06-26 01:12:21 +00:00
Alex Ionescu 758ab5ab61 Build HAL with NDK
svn path=/trunk/; revision=16253
2005-06-24 01:37:08 +00:00
Alex Ionescu 16c356bfa1 Ditto for HAL
svn path=/trunk/; revision=16127
2005-06-19 22:53:49 +00:00
Filip Navara fbf1722197 Couple of build fixes.
svn path=/trunk/; revision=16086
2005-06-19 09:07:44 +00:00
Filip Navara 52f8761d3a Use W32API for NTOSKRNL.
svn path=/trunk/; revision=16053
2005-06-18 18:32:29 +00:00
Alex Ionescu 99cc88158b Use generic HAL header
svn path=/trunk/; revision=16040
2005-06-18 14:30:09 +00:00
KJK::Hyperion 28d278bd08 Workaround for GCC inline assembly bug, hopefully fixed for good. Builds for me in both checked and free
Bug details and status here: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10153


svn path=/trunk/; revision=15584
2005-05-28 15:41:09 +00:00
Royce Mitchell III 7b78b8092c patch by kjk::hyperion, fix syntax of gcc inline asm
svn path=/trunk/; revision=14523
2005-04-06 04:03:41 +00:00
Hartmut Birr 8399d9c123 Split some of the halmp files according its functions.
svn path=/trunk/; revision=13868
2005-03-07 16:40:32 +00:00
Filip Navara b670149976 Fix inline assembler register specification (http://gcc.gnu.org/bugzilla/show_bug.cgi?id=10153).
svn path=/trunk/; revision=13587
2005-02-15 19:43:17 +00:00
Filip Navara 6947ecd976 - Output correct length and page to the controller on DMA transfers.
- Fix the value of AdapterObject->PagePort.
- Don't modify variables we're not supposed to modify in IoMapTransfer.

svn path=/trunk/; revision=12906
2005-01-09 14:11:25 +00:00
Filip Navara 40d1739c83 - Fix HalGetAdapter for ISA adapters.
- Fix layout of EISA_CONTROL structure.

svn path=/trunk/; revision=12003
2004-12-10 19:05:33 +00:00
Gé van Geldorp b0145a85fe Probing functions 1 and 2 of device 0 on bus 0 completely freezes the Xbox,
blacklist those functions

svn path=/trunk/; revision=11932
2004-12-04 22:52:59 +00:00
Gé van Geldorp 529f4da133 Let HAL handle its own mapping of the video frame buffer
svn path=/trunk/; revision=11917
2004-12-04 17:22:47 +00:00
Gé van Geldorp 92ed2da0da Reorganise HAL so multiple HAL versions can be built in parallel
svn path=/trunk/; revision=11909
2004-12-03 20:10:45 +00:00
Alex Ionescu 1fe3441f75 Hal DMA Patch: Implemented correct AdapterObject, updated some AdapterFunctions, which are much more complete and correct now. Implemented EISA structure for port access instead of hard-coded offsets.
svn path=/trunk/; revision=11771
2004-11-21 21:53:07 +00:00
Hartmut Birr 35636e998d - Used the time stamp counter from a pentium if it is available
(in KeStallExecutionProcessor/KeQueryPerformanceCounter).

svn path=/trunk/; revision=11655
2004-11-14 19:01:31 +00:00