https://git.reactos.org/?p=reactos.git;a=commitdiff;h=235d7472ba424351d2b1ea17a0ad7281a1f16b71

commit 235d7472ba424351d2b1ea17a0ad7281a1f16b71
Author:     Timo Kreuzer <[email protected]>
AuthorDate: Thu Jun 3 19:29:25 2021 +0200
Commit:     Timo Kreuzer <[email protected]>
CommitDate: Thu Jun 17 23:27:44 2021 +0200

    [HAL:APIC] Remove obsolete hacks
    
    These hacks were used to work around broken VBox. VBox works fine without 
the hacks these days.
---
 hal/halx86/apic/apic.c     | 11 +----------
 hal/halx86/apic/apictrap.S | 28 ----------------------------
 2 files changed, 1 insertion(+), 38 deletions(-)

diff --git a/hal/halx86/apic/apic.c b/hal/halx86/apic/apic.c
index 65a6d2e4d20..25bd4e4b4c3 100644
--- a/hal/halx86/apic/apic.c
+++ b/hal/halx86/apic/apic.c
@@ -16,8 +16,6 @@
 #define NDEBUG
 #include <debug.h>
 
-void __cdecl HackEoi(void);
-
 #ifndef _M_AMD64
 //#define APIC_LAZY_IRQL //FIXME: Disabled due to bug.
 #endif
@@ -155,8 +153,7 @@ FORCEINLINE
 VOID
 ApicSendEOI(void)
 {
-    //ApicWrite(APIC_EOI, 0);
-    HackEoi();
+    ApicWrite(APIC_EOI, 0);
 }
 
 FORCEINLINE
@@ -174,15 +171,9 @@ ApicGetCurrentIrql(VOID)
 #ifdef _M_AMD64
     return (KIRQL)__readcr8();
 #elif defined(APIC_LAZY_IRQL)
-    // HACK: some magic to Sync VBox's APIC registers
-    ApicRead(APIC_VER);
-
     /* Return the field in the PCR */
     return (KIRQL)__readfsbyte(FIELD_OFFSET(KPCR, Irql));
 #else
-    // HACK: some magic to Sync VBox's APIC registers
-    ApicRead(APIC_VER);
-
     /* Read the TPR and convert it to an IRQL */
     return TprToIrql(ApicRead(APIC_TPR));
 #endif
diff --git a/hal/halx86/apic/apictrap.S b/hal/halx86/apic/apictrap.S
index 52f1dabec0f..381f5492023 100644
--- a/hal/halx86/apic/apictrap.S
+++ b/hal/halx86/apic/apictrap.S
@@ -22,23 +22,6 @@ PUBLIC ApicSpuriousService
 ApicSpuriousService:
     iretq
 
-PUBLIC HackEoi
-HackEoi:
-    xor rax, rax
-    mov ax, ss
-    push rax
-    push rsp
-    pushfq
-    mov ax, cs
-    push rax
-    lea rax, HackEoiReturn[rip]
-    push rax
-    mov dword ptr [HEX(0FFFFFFFFFFFE00B0)], 0
-    iretq
-HackEoiReturn:
-    add rsp, 8 // esp was changed by the iret to the pushed value
-    ret
-
 #else
 #include <ks386.inc>
 #include <internal/i386/asmmacro.S>
@@ -54,17 +37,6 @@ PUBLIC _ApicSpuriousService
 _ApicSpuriousService:
     iret
 
-// VBox APIC needs an iret more or less directly following the EOI
-PUBLIC _HackEoi
-_HackEoi:
-    pushfd
-    push cs
-    push offset OnlyOnePersonKnowsHowToHackAroundVBoxBugsAndThatIsNotYou // !!
-    mov dword ptr ds:[HEX(0FFFE00B0)], 0
-    iretd
-OnlyOnePersonKnowsHowToHackAroundVBoxBugsAndThatIsNotYou:
-    ret
-
 #endif
 
 

Reply via email to