Commit Graph

145 Commits

Author SHA1 Message Date
Timo Kreuzer
8d459f2820 [NTOS:KE/x64] Clean up EnterTrap/ExitTrap
- Always save and restore all non-volatile registers, including xmm
- Remove the obsolete flags
2024-04-14 16:09:20 +02:00
Timo Kreuzer
def2fe5dc3 [HALAPIC] Rename a field for consistency 2024-03-06 19:04:41 +01:00
Timo Kreuzer
79aaee6aac [HALX86] Implement the clock IPI handler 2024-03-02 07:56:27 +01:00
Timo Kreuzer
d1c118b371 [HALX86] Move apicsmp.c to lib_hal_smp 2024-03-02 07:56:27 +01:00
Hermès Bélusca-Maïto
46831c537f
[HAL] HalInitializeBios() should not explicitly call HalpBiosDisplayReset().
While the BIOS support for INT10h emulation has been set up, any
modification of the display should wait until the kernel requests
video initialization with INBV/bootvid.
The latter will call HalResetDisplay() (that calls HalpBiosDisplayReset())
at the correct time.
This avoids an useless video mode change and reset when booting ReactOS.
2024-02-11 18:51:40 +01:00
Justin Miller
3306a16e84
[HALX86] Fix SYNCH_LEVEL differences between UP and SMP in HAL (#5874)
First step to fixing the multiprocessor kernel when booting on a single core.
2024-01-20 06:26:59 -08:00
Timo Kreuzer
10bb50b456 [HAL] Fix SMP initialization
- Don't use CONFIG_SMP, this isn't handled in (most of) hal
- Add a dummy HalpSetupProcessorsTable for UP
- Call HalpRegisterKdSupportFunctions only for processor 0
2023-12-30 12:53:18 +02:00
Ratin Gao
ffb20d3330
[REACTOS] Fix typos (#6198)
- Adress -> Address
- Currupted -> Corrupted

3rd-party files are not modified.
2023-12-23 21:37:08 +01:00
Timo Kreuzer
230f7c7f3c [HALX86] Some improvements / bugfixes for IPI support functions 2023-12-08 19:28:57 +02:00
Timo Kreuzer
d8d46a00c3 [HALX86] Use InterlockedBitTestAndSetAffinity instead of InterlockedBitTestAndSet 2023-12-08 19:28:57 +02:00
Timo Kreuzer
d87b45bee7 [NDK] Add Affinity helper inline functions 2023-12-08 19:28:57 +02:00
Timo Kreuzer
40b6b1dab3 [HAL] Implement IPI support functions 2023-12-03 00:07:53 +02:00
Hermès Bélusca-Maïto
8c3f7b1027
[HALARM] HalpActiveProcessors is a KAFFINITY (see headers) 2023-11-28 12:17:48 +01:00
Justin Miller
516ccad340
[NTOS:KE][HALX86] Implement AP startup code (#5879)
Co-authored-by: Victor Perevertkin <victor.perevertkin@reactos.org>

Introduce the initial changes needed to get other processors up and into kernel mode. 
This only supports x86 as of now but is the first real step towards using other system processors.
2023-11-19 15:51:33 -08:00
Serge Gautherie
2cc7eeb939
[HALX86] Add missing \n to DPRINT() calls (#5993)
And promote some DPRINT() to DPRINT1().
2023-11-19 19:44:46 +01:00
Justin Miller
0a951f1112
[BOOTDATA] Add SMP Entry (#5859)
[HALX86] Enable SMP Hal for x86
[BOOTDATA] add livecd and set entrys
2023-11-01 06:43:44 -07:00
Hermès Bélusca-Maïto
bd0eaa924d
[HALX86] HalHandleNMI: Re-enable debugger-entering code. 2023-08-03 13:26:24 +02:00
Adam Słaboń
ce2d4740a6
[SDK][HAL] Enable x86Bios on x86 (#5454)
This will be needed for compatibility with x86 Windows Vista/7 videoprt.sys builds.
Might be also useful in future for platforms (x86 , ...) where V86 mode is not available or buggy.

CORE-11954, CORE-18185
2023-07-20 21:44:44 +02:00
Hermès Bélusca-Maïto
18815558d1
[HALX86] Update the PCI hardware IDs database.
Extracted from the pci.ids database at https://pci-ids.ucw.cz/ from 2023-06-19 03:15:02.
Maintained by Albert Pool, Martin Mares, and other volunteers from the PCI ID Project.
2023-07-16 20:52:07 +02:00
Hermès Bélusca-Maïto
eba1244b00
[HALX86] Convert the PCI Ids files to LF ('\n') endlines, and adjust the parsing code. (#4905)
This allows to somewhat reduce their size, and the resulting size
of the generated hal.dll file.

pci_classes.ids
Before: 6,207 bytes
After : 5,968 bytes
Reduction: 239 bytes --> 4%

pci_vendors.ids
Before: 1,370,248 bytes
After : 1,334,622 bytes
Reduction: 35,626 bytes --> 2.6%

Co-authored-by: Stanislav Motylkov <x86corez@gmail.com>
2023-07-16 20:51:56 +02:00
Hermès Bélusca-Maïto
3854a5d8e9
[CODEBASE] Fix "uknown" / "unkown" etc. typos.
Only done in our own code, not in 3rd-party or in PSDK headers
(official ones also have such typos in defines...)

(NOTE: apparent "Uknown" typo in dll/cpl/sysdm/smbios.c is on-purpose:
typo by the manufacturer.)
2023-07-15 14:19:04 +02:00
Victor Perevertkin
16882dcfa4
[HALX86] Bugcheck in case the ACPI initialization failed (for ACPI HAL) (#5376)
CORE-16302
2023-07-02 02:01:11 +03:00
Hermès Bélusca-Maïto
bd5209d9f4
[HALX86] These HalpNo* functions are actually _implemented_. Document their purpose.
Remove the misleading comment in HalpNoBusData().
Update the SAL annotations.
2023-06-25 21:25:06 +02:00
Hermès Bélusca-Maïto
9ba1849a97
[HAL][MINIHAL] Minor cleanup in reboot.c files (#5359)
And remove pic/processor.c from minihal compilation.
2023-06-25 19:39:44 +02:00
Hermès Bélusca-Maïto
3fa613b9da
[MINIHAL] Remove sysinfo.c from compilation. 2023-06-20 22:40:58 +02:00
Hermès Bélusca-Maïto
d6a78d580b
[HALX86] Tabs to 4-space indentation in generic/sysinfo.c + Fix typo "ALMI" -> "AMLI" 2023-06-20 22:40:57 +02:00
Hermès Bélusca-Maïto
d03fc32e7d
[MINIHAL] Remove unneeded files from compilation. 2023-06-20 18:39:01 +02:00
Hermès Bélusca-Maïto
7e1510eb9c
[HALX86] Implement HalpcGetCmosData and HalpcSetCmosData. 2023-06-19 21:09:03 +02:00
Hermès Bélusca-Maïto
113656563a
[HALX86] Minor fixes in HaliFindBusAddressTranslation()
- Remove ContextValue variable. This variable erroneously truncated
  *Context value (that can contain a pointer value) to 32 bits.

- Gracefully fail instead of asserting.
2023-06-14 11:27:24 +02:00
Hermès Bélusca-Maïto
5871716c64
[HALX86] Update the PCI hardware IDs database.
Extracted from the pci.ids database at https://pci-ids.ucw.cz/ from 2022-11-25 03:15:01 .
Maintained by Albert Pool, Martin Mares, and other volunteers from the PCI ID Project.
2022-11-25 16:17:10 +01:00
Timo Kreuzer
3381bf39db [HAL/x64] Fix x86BiosCall
Use an INT call stub and exit on the address after the stub instead or using iret (some BIOS code uses int / iret internally). This fixes the messed up display when trying to switch modes.
2022-11-24 21:17:58 +02:00
Serge Gautherie
ba1ed89f91
[HALX86] HalpQueryInterface(): Debug log InterfaceType param (#4772)
This should help to find out which GUIDs are actually wanted.
Based on CircularTriangle06's patch.

CORE-11632
2022-11-15 02:04:04 +03:00
Timo Kreuzer
f8b6cc249e [HAL] Add missing I/O port to int 10 BIOS emulator 2022-08-04 16:15:24 +02:00
Dmitry Borisov
734cd5e842 [PCI][HALX86] Support PCI debugging devices
Also optimize the PCI bus scanning

CORE-17360
2022-06-06 01:47:21 +03:00
Dmitry Borisov
6f4be52a1c
[HALX86] Print the correct size of the BAR in HalpDebugPciDumpBus()
Reference: https://wiki.osdev.org/PCI#Address_and_size_of_the_BAR

To determine the amount of address space needed by a PCI device,
you must save the original value of the BAR, write a value
of all 1's to the register, then read it back.

Note: 64-bit BARs are not supported yet.
2022-05-26 16:40:17 +03:00
Hermès Bélusca-Maïto
94c25baf85
[HAL][HALARM] The HAL should only use KPCR.
And why the ARM HAL uses KPCR::InterruptRoutine, a field only defined
in *powerpc*/ketypes.h, is beyond me, but OK...

See Timo vs. Alex discussion, explaining that KIPCR is a ReactOS-only
thing: https://reactos.org/archives/public/ros-dev/2008-August/010549.html
2022-05-08 17:21:44 +02:00
Hermès Bélusca-Maïto
c026b5950e
[FREELDR][MINIHAL] Move KefAcquireSpinLockAtDpcLevel stub back to HAL, #ifdef'ed in _MINIHAL_ where it's only needed. 2022-05-08 17:21:43 +02:00
Hermès Bélusca-Maïto
39b8d45592
[MINIHAL] Compile with _NTSYSTEM_ since it's also part of the bootloader.
Fixes compilation because the Hal(Private)DispatchTable's, defined in
the bootloader's NTOS stub, are not external imports, as they would be
for a standard HAL.
2022-05-08 04:15:51 +02:00
Hermès Bélusca-Maïto
551d28e09f
[HALARM] Update defines in hal.h 2022-05-07 18:23:29 +02:00
Hermès Bélusca-Maïto
9ea2b803c8
[NDK][HAL][NTOS] Add missing PRCB_MINOR_VERSION / PRCB_MAJOR_VERSION and use them. 2022-05-07 18:14:38 +02:00
Victor Perevertkin
4295b007ae
[HALX86] Do not define unnamed enums 2022-04-26 03:38:37 +03:00
Dmitry Borisov
269f3a2b24 [HALXBOX] Do not claim interrupt resources for the KD COM port
The actual COM port lacks SERIRQ, IRQ 4 is hardwired to the NIC

CORE-15872 CORE-16216
2022-04-16 11:54:24 +03:00
Hermès Bélusca-Maïto
e5d17a0219
[HALX86:ACPI] Use the correct PCH file for compilation.
This also removes the following warnings, that were present because,
as the ACPICA acpi.h header was used as PCH (instead of none, or the
hal's own main header), it was "included" before any other header
-- and in particular, before hal.h -- and as a result, colliding defines
were still defined even if the #undef tricks were used for them.

rosbuilds\sdk\include\reactos\mc\bugcodes.h(1417): warning C4005: 'ACPI_BIOS_ERROR': macro redefinition
reactos\drivers\bus\acpi\acpica\include\acoutput.h(243): note: see previous definition of 'ACPI_BIOS_ERROR'
reactos\hal\halx86\include\hal.h(41): warning C4109: unexpected identifier '_read'
reactos\hal\halx86\include\hal.h(42): warning C4109: unexpected identifier '_read'
2022-04-09 20:18:03 +02:00
Justin Miller
eebe11ae0c
[HALX86] Add support for parsing ACPI MADT tables 2022-04-07 22:54:32 +03:00
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