- 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
[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
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
[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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
- 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
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
- 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