Commit graph

38 commits

Author SHA1 Message Date
Timo Kreuzer
5ebd478325 [NTOS][HAL:APIC] Call HalBegin/EndSystemInterrupt from clock handler 2024-12-16 16:21:44 +02:00
Timo Kreuzer
1f647e4479 [HAL] Remove KiEoiHelper hack 2024-12-16 16:21:44 +02:00
Timo Kreuzer
365c2c1ce3 [HAL:APIC] Fix HalSetTimeIncrement
Fix calculation of clock rate. Previously it would go above the maximum, causing issues with KeUpdateSystemTime.
2024-06-15 14:22:20 +02:00
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
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
40b6b1dab3 [HAL] Implement IPI support functions 2023-12-03 00:07:53 +02: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
Victor Perevertkin
4295b007ae
[HALX86] Do not define unnamed enums 2022-04-26 03:38:37 +03: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
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
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
6a5472a754 [HALX86:APIC] apic.c: Use new defines some more
Follow-up to b7a149f.
2021-09-03 23:20:10 +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
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
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
7243503916 [HAL] Rename apic.h to apicp.h and move it back to the apic folder 2021-06-17 23:27:44 +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
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
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
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
71fefa32db
[NDK][NTOS] Add global definition of INIT_FUNCTION/INIT_SECTION (#779)
* Add an NDK header to define INIT_FUNCTION/INIT_SECTION globally
* Use _declspec(allocate(x)) and _declspec(code_seg(x)) on MSVC versions that support it
* Use INIT_FUNCTION on functions only and INIT_SECTION on data only (required by MSVC)
* Place INIT_FUNCTION before the return type (required by MSVC)
* Make sure declarations and implementations share the same modifiers (required by MSVC)
* Add a global linker option to suppress warnings about defined but unused INIT section
* Merge INIT section into .text in freeldr
2018-12-30 12:19:11 +01:00
Ivan Labutin
5ae2750467
[HAL] Implement APIC-based profiling for x64. 2018-02-15 12:45:29 +01:00
Colin Finck
361b6e39e3
[HALX86] Deduplicate initialization of legacy PICs and remove EOI in I/O APIC initialization, which causes an unexpected interrupt 2017-12-17 09:51:37 +01:00
Amine Khaldi
0bae06fa5f [HAL] Add some header guards. 2017-12-09 13:20:22 +01:00
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