Commit graph

101 commits

Author SHA1 Message Date
Justin Miller
5c79900519
[HALX86] Add a way to print the ProcessorTable data on bootup 2022-04-07 22:54:32 +03:00
Justin Miller
a09f925c1c
[HALX86] Implement HalpSetupProcessorsTable
Add a helper function for getting a pointer to the PRCB of every processor
in the system and assign it to the PROCESSOR_IDENTITY struct.
2022-04-07 22:54:31 +03:00
Justin Miller
0fc21e5a9b
[HALX86] Add function prototypes needed for parsing ACPI MADT table
- Use ACPICA headers to gather the information.
- Add PROCESSOR_IDENTITY structure that will be used by all APIC HALs.
2022-04-07 22:54:13 +03:00
Hermès Bélusca-Maïto
215148267e
[HALX64] Do not claim to handle display reset if you don't. Fix bootvid display initialization in x64 as a result.
The HalpBiosDisplayReset() function is currently stub-plemented.
Returning FALSE will make bootvid take the route of fully
re-initializing the VGA display all by itself.
2022-03-28 00:32:25 +02:00
Thomas Faber
6eccbe27ec
[HAL:APIC] Ensure the interrupt gets requested immediately in ApicRequestSelfInterrupt. CORE-17663 2022-02-13 17:15:00 -05:00
Serge Gautherie
0fd3e51580
[HALX86] HalpDmaAllocateChildAdapter(): Fix memory leak, on error (#4156)
Simplify code, instead of adding 2 missing ObDereferenceObject().
(Note that ObInsertObject() always dereferences the object in case of failure.)

CORE-17904
2021-12-20 21:14:36 +01:00
Hervé Poussineau
b39ae9f32b [HALX86] Implement HalBuildScatterGatherList
Make HalGetScatterGatherList a wrapper around it.
2021-11-07 14:07:57 +01:00
Hervé Poussineau
eb283043d5 [HALX86] Partly implement HalCalculateScatterGatherListSize 2021-11-07 14:07:55 +01:00
Hervé Poussineau
88839d9726 [HALX86] Stub-implement scatter/gather DMA operations
These are required when we ask for a DMA_ADAPTER version 2.
2021-11-01 18:16:25 +01:00
Victor Perevertkin
8e1fa03456
[CMAKE] Replace custom scripts in compilerflags with standard ones
- add_target_link_flags changed to target_link_options
- add_target_property changed to set_property(... APPEND ...)
2021-09-14 17:56:22 +03:00
Hermès Bélusca-Maïto
9393fc320e
[FORMATTING] Remove trailing whitespace. Addendum to 34593d93.
Excluded: 3rd-party code (incl. wine) and most of the win32ss.
2021-09-13 03:52:22 +02:00
Serge Gautherie
6a5472a754 [HALX86:APIC] apic.c: Use new defines some more
Follow-up to b7a149f.
2021-09-03 23:20:10 +03:00
Victor Perevertkin
6ef6fabfc5
[FREELDR][NTOS][HALPPC][SDK] Remove PowerPC code
Remove PowerPC-related code from the kernel, HAL, SDK and
Freeloader.
2021-08-15 15:35:51 +03:00
Timo Kreuzer
3e1454c739 [HAL/APIC] Make the real time clock more precise
The interval time is now calculated in 0.1ns precision and a running fraction on the 100ns interval is updated on each clock interrupt.
Also adjust minimum, maximum and default clock rate to what Windows uses.
2021-07-19 23:05:03 +02:00
Timo Kreuzer
aa3ef4c632 [HAL/APIC] Fix clock initialization
Previously we enabled the timer interrupt, before the kernel was notified of our time increment, so when a clock interrupt happened, it would increment the tick count, but add 0 to the system time, resulting in an invalid state, in which timers would be inserted into the wrong timer table slot. Fixes CORE-16253
2021-07-19 23:05:03 +02:00
Timo Kreuzer
aedb97df47 [HAL/APIC] Use APIC_CLOCK_VECTOR everywhere, instead of keeping separate definitions 2021-07-19 23:05:03 +02:00
Jérôme Gardou
56d0bc31ce [HAL] Hack KeTryToAcquireQueuedSpinlock & KeTryToAcquireQueuedSpinLockRaiseToSynch into a somewhat working implementation 2021-06-29 11:49:20 +02:00
Timo Kreuzer
16e988d108 [HAL:APIC] Improve code
- Use an enum for the APIC registers
- Add support routine for SMP.
2021-06-26 21:10:43 +02:00
Timo Kreuzer
400af0cfc5 [HAL] Add smp component and build x64 smp hal
Like the up component it contains the spinlock code and now also the HalpBuildType variable.
2021-06-19 12:17:18 +02:00
Timo Kreuzer
a0fb02f7f3 [HAL] Fix build with CONFIG_SMP 2021-06-19 12:17:18 +02:00
Timo Kreuzer
5ee09256de [HAL] Add APIC hals to setup and livecd 2021-06-17 23:27:44 +02:00
Timo Kreuzer
64e52088d1 [HAL:APIC] Fix interrupt assignment
This is probably not how it is supposed to work, but the results are somewhat similar to what Windows has.
2021-06-17 23:27:44 +02:00
Timo Kreuzer
235d7472ba [HAL:APIC] Remove obsolete hacks
These hacks were used to work around broken VBox. VBox works fine without the hacks these days.
2021-06-17 23:27:44 +02:00
Timo Kreuzer
b7a149fcec [HAL:APIC] Code fixes
* Fix some broken code
* Add some ASSERTs
* Use ApicWriteIORedirectionEntry where appropriate
* Use KeQueryInterruptHandler/KeRegisterInterruptHandler to save/restore the old handler instead of saving the KIDTENTRY
* Move HalpProfileInterruptHandler to apictimer.c and implement it
* Use READ/WRITE_REGISTER macros
* Add some symbolic names
2021-06-17 23:27:44 +02:00
Timo Kreuzer
ee514e954b [MINIHAL] Compile less stuff 2021-06-17 23:27:44 +02:00
Timo Kreuzer
7243503916 [HAL] Rename apic.h to apicp.h and move it back to the apic folder 2021-06-17 23:27:44 +02:00
Victor Perevertkin
34593d933b
[FORMATTING][NTOS][HAL][DRIVERS][SDK] Fix trailing spaces 2021-06-11 15:33:08 +03:00
Stanislav Motylkov
dcc1506af5
[FREELDR][HALXBOX] Initialize PCI bridge secondary & subordinate bus values
This fixes the recursion when pci.sys attempts to get PCI bridge children
devices, which in fact are non-existing.

Note that the problem in pci.sys itself also deserves a separate fix.

CORE-16319 CORE-16216
2021-05-24 18:12:02 +03:00
Stanislav Motylkov
5caa59b31a
[HAL] HalpDebugPciDumpBus: Fix parsing bugs
- Bridge devices don't have Subsystem ID and Subsystem Vendor ID
- Also they have only two BARs, don't parse data outside of bounds

Addendum to b232efe1. CORE-16319 CORE-16216
2021-05-24 17:24:24 +03:00
Stanislav Motylkov
b232efe12a
[HAL] HalpDebugPciDumpBus: Print details about PCI bridges
CORE-16319 CORE-16216
2021-05-23 15:48:21 +03:00
Jérôme Gardou
3adf450867 [REACTOS] Addendum to 5c7ce4475e - Fix MSVC 2015 build
Put data into PAGEDATA or INITDATA sections
Keep section declaration for prototypes

CORE-17540
2021-05-12 11:04:29 +02:00
Justin Miller
0d9020634a
[HALX86] Disable Lazy IRQL in APIC HAL (#3609)
Lazy IRQL feature has issues with interrupt delivery on VirtualBox, so disable it for now.
For the feature description, see commit d28eae967a

Meanwhile, merge and clean up APIC headers a bit
2021-05-04 04:29:50 +03:00
Jérôme Gardou
617c7cc377 [HALX86] Use addressing relative to RIP 2021-04-28 13:10:23 +02:00
Victor Perevertkin
f3e1697c2b
[NDK] DATA_SEG requires an extra #pragma on MSVC 2021-04-09 04:38:35 +03:00
Victor Perevertkin
a064c5d9a0
[HALX86] Remove unused and empty files, remove halapic
halapic (a.k.a. non-ACPI APIC HAL) is not going to be supported in near
future
2021-03-15 02:51:25 +03:00
Victor Perevertkin
7601fb549c
[HALX86] Rearrange files in x86 HAL
- Rename UP -> PIC. The "up" folder in fact contains the code for
  managing the Intel 8259 PIC chip
- Move amd64/processor.c -> apic/processor.c. The code is not tied to
  amd64
- Remove platform from "halinit*" files. They already reside in the
  corresponding folder
2021-03-15 02:48:35 +03:00
Jérôme Gardou
49286a6225 [CMAKE] Get rid of add_object_library
It's not needed anymore
2021-03-03 08:34:32 +01:00
Victor Perevertkin
8248f02ff4
[HALX86] Restore Windows compatibility on reporting device IDs
And forwarding IRPs from FDO to PDO

This along with 8aff2c9de7 reverts the commit 74b889b397
2021-01-31 05:37:27 +03:00
Serge Gautherie
3e79cb8e6c
[HALX86] Update the PCI hardware IDs database.
Extracted from the pci.ids database at https://pci-ids.ucw.cz/ from 2020-11-14 03:15:02 .
Maintained by Albert Pool, Martin Mares, and other volunteers from the PCI ID Project.

Co-authored-by: Hermès BÉLUSCA - MAÏTO <hermes.belusca-maito@reactos.org>
2020-11-21 17:31:40 +01:00
Vadim Galyant
40bb3786b6
[HALX86] Implement HalQueryAMLIIllegalIOPortAddresses case in HaliQuerySystemInformation
CORE-17359

Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
Co-authored-by: Oleg Dubinskiy <oleg.dubinskij2013@yandex.ua>
2020-11-14 15:18:37 +01:00
Victor Perevertkin
f75318b606
[HALX86] Drop hacks in HalpAddDevice to work around PnP synchronization bugs
Our PnP manager handles OS boot in a synchronous manner thus we don't
need it anymore.
This effectively reverts f23e722, d974e84, 3aff101 and 4a9fcb6

CORE-5686
2020-11-09 01:28:50 +03:00
Timo Kreuzer
c5a700fd06 [HAL:X64] Fix/improve the BIOS interface
* Call HalInitializeBios both in phase 0 and 1
* In phase 0 allocate some physical memory, instead of using arbitrary hardcoded pages, that then end up as page tables and get filled with VESA tables
2020-11-07 18:46:20 +01:00
Victor Perevertkin
5c7ce4475e
[REACTOS] Cleanup INIT and some PAGE section allocations
- Change INIT_FUNCTION and INIT_SECTION to CODE_SEG("INIT") and DATA_SEG("INIT") respectively
- Remove INIT_FUNCTION from function prototypes
- Remove alloc_text pragma calls as they are not needed anymore
2020-11-02 21:45:31 +03:00
Victor Perevertkin
658f742c2d
[NDK][CMAKE] Introduce DATA_SEG and CODE_SEG macro
These are for putting code and data to non-default sections
At the same time, move INIT section attributes declaration to cmake files
2020-11-02 21:27:06 +03:00
Timo Kreuzer
0343ac4f0b [HAL] Use iretq instead of iret 2020-09-20 23:08:17 +02:00
Timo Kreuzer
3bbcc16d8e [HAL] Fix calculation of timer increment 2020-09-20 23:08:17 +02:00
Timo Kreuzer
2aca4b2795 [ASM] Fix boot with VS 16.7.3 / MSVC 19.27
See https://developercommunity.visualstudio.com/content/problem/1180800/ml-x86-assume-directive-causes-invalid-code-genera.html
2020-09-12 15:01:04 +02:00
Victor Perevertkin
8aff2c9de7
[HALX86] Report HAL root device to the stack before passing it to the driver
PnP manager now correctly delays device actions if needed, so this can
be safely done as a one operation (IoReportDetectedDevice itself creates
a PDO for us if not passed)

CORE-10456
2020-08-21 08:19:53 +03:00
Victor Perevertkin
2839c85092
[NTOS:IO] Enumerate devices only inside the PipDeviceActionWorker
Introduce the PiPerformSyncDeviceAction routine for queuing
synchronous device actions
Change all kernel code to use PiPerformSyncDeviceAction and
PiQueueDeviceAction for device enumeration

CORE-10456
2020-08-21 08:02:26 +03:00
Dmitry Borisov
b36018ff26
[HALPC98] Add Hardware Abstraction Layer for NEC PC-98 series (#3002) 2020-07-25 15:31:02 +02:00