[HAL:APIC] Remove obsolete hacks

These hacks were used to work around broken VBox. VBox works fine without the hacks these days.
This commit is contained in:
Timo Kreuzer 2021-06-03 19:29:25 +02:00
parent b7a149fcec
commit 235d7472ba
2 changed files with 1 additions and 38 deletions

View file

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

View file

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