mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[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:
parent
b7a149fcec
commit
235d7472ba
2 changed files with 1 additions and 38 deletions
|
@ -16,8 +16,6 @@
|
||||||
#define NDEBUG
|
#define NDEBUG
|
||||||
#include <debug.h>
|
#include <debug.h>
|
||||||
|
|
||||||
void __cdecl HackEoi(void);
|
|
||||||
|
|
||||||
#ifndef _M_AMD64
|
#ifndef _M_AMD64
|
||||||
//#define APIC_LAZY_IRQL //FIXME: Disabled due to bug.
|
//#define APIC_LAZY_IRQL //FIXME: Disabled due to bug.
|
||||||
#endif
|
#endif
|
||||||
|
@ -155,8 +153,7 @@ FORCEINLINE
|
||||||
VOID
|
VOID
|
||||||
ApicSendEOI(void)
|
ApicSendEOI(void)
|
||||||
{
|
{
|
||||||
//ApicWrite(APIC_EOI, 0);
|
ApicWrite(APIC_EOI, 0);
|
||||||
HackEoi();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
FORCEINLINE
|
FORCEINLINE
|
||||||
|
@ -174,15 +171,9 @@ ApicGetCurrentIrql(VOID)
|
||||||
#ifdef _M_AMD64
|
#ifdef _M_AMD64
|
||||||
return (KIRQL)__readcr8();
|
return (KIRQL)__readcr8();
|
||||||
#elif defined(APIC_LAZY_IRQL)
|
#elif defined(APIC_LAZY_IRQL)
|
||||||
// HACK: some magic to Sync VBox's APIC registers
|
|
||||||
ApicRead(APIC_VER);
|
|
||||||
|
|
||||||
/* Return the field in the PCR */
|
/* Return the field in the PCR */
|
||||||
return (KIRQL)__readfsbyte(FIELD_OFFSET(KPCR, Irql));
|
return (KIRQL)__readfsbyte(FIELD_OFFSET(KPCR, Irql));
|
||||||
#else
|
#else
|
||||||
// HACK: some magic to Sync VBox's APIC registers
|
|
||||||
ApicRead(APIC_VER);
|
|
||||||
|
|
||||||
/* Read the TPR and convert it to an IRQL */
|
/* Read the TPR and convert it to an IRQL */
|
||||||
return TprToIrql(ApicRead(APIC_TPR));
|
return TprToIrql(ApicRead(APIC_TPR));
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -22,23 +22,6 @@ PUBLIC ApicSpuriousService
|
||||||
ApicSpuriousService:
|
ApicSpuriousService:
|
||||||
iretq
|
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
|
#else
|
||||||
#include <ks386.inc>
|
#include <ks386.inc>
|
||||||
#include <internal/i386/asmmacro.S>
|
#include <internal/i386/asmmacro.S>
|
||||||
|
@ -54,17 +37,6 @@ PUBLIC _ApicSpuriousService
|
||||||
_ApicSpuriousService:
|
_ApicSpuriousService:
|
||||||
iret
|
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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue