Fix amd64 build

svn path=/trunk/; revision=53704
This commit is contained in:
Timo Kreuzer 2011-09-13 14:44:47 +00:00
parent ca9e3a9c67
commit a6a01dd912
5 changed files with 41 additions and 37 deletions

View file

@ -19,7 +19,7 @@ BOOLEAN HalpPciLockSettings;
/* PRIVATE FUNCTIONS *********************************************************/
/* FUNCTIONS *****************************************************************/
#if 0
VOID
NTAPI
HalpInitProcessor(
@ -49,4 +49,5 @@ HalpInitPhase1(VOID)
}
#endif

View file

@ -28,26 +28,6 @@ HaliHaltSystem(VOID)
/* FUNCTIONS *****************************************************************/
/*
* @implemented
*/
VOID
NTAPI
HalInitializeProcessor(IN ULONG ProcessorNumber,
IN PLOADER_PARAMETER_BLOCK LoaderBlock)
{
/* Set default stall count */
KeGetPcr()->StallScaleFactor = INITIAL_STALL_COUNT;
/* Update the interrupt affinity and processor mask */
InterlockedBitTestAndSet((PLONG)&HalpActiveProcessors, ProcessorNumber);
InterlockedBitTestAndSet((PLONG)&HalpDefaultInterruptAffinity,
ProcessorNumber);
/* Register routines for KDCOM */
//HalpRegisterKdSupportFunctions();
}
/*
* @implemented
*/

View file

@ -18,7 +18,9 @@
#include "apic.h"
void HackEoi(void);
#ifndef _M_AMD64
#define APIC_LAZY_IRQL
#endif
/* GLOBALS ********************************************************************/
@ -393,9 +395,10 @@ ApicInitializeLocalApic(ULONG Cpu)
/* Set the IRQL from the PCR */
ApicWrite(APIC_TPR, IrqlToTpr(KeGetPcr()->Irql));
#ifdef APIC_LAZY_IRQL
/* Save the new hard IRQL in the IRR field */
KeGetPcr()->IRR = KeGetPcr()->Irql;
#endif
}
UCHAR
@ -549,6 +552,7 @@ HalpInitializePICs(IN BOOLEAN EnableInterrupts)
/* SOFTWARE INTERRUPT TRAPS ***************************************************/
#ifndef _M_AMD64
VOID
DECLSPEC_NORETURN
FASTCALL
@ -598,7 +602,6 @@ HalpApcInterruptHandler(IN PKTRAP_FRAME TrapFrame)
KiEoiHelper(TrapFrame);
}
#ifndef _M_AMD64
VOID
DECLSPEC_NORETURN
FASTCALL

View file

@ -15,7 +15,8 @@
#define APIC_PROFILE_VECTOR 0xFD // IRQL 31
#define APIC_NMI_VECTOR 0xFF
#define IrqlToTpr(Irql) (Irql << 4)
#define TprToIrql(Tpr) (Tpr >> 4)
#define TprToIrql(Tpr) ((KIRQL)(Tpr >> 4))
#define CLOCK2_LEVEL CLOCK_LEVEL
#else
#define APIC_BASE 0xFFFE0000
#define IOAPIC_BASE 0xFFFE1000 // checkme

View file

@ -14,20 +14,46 @@
#include <ksamd64.inc>
#include <trapamd64.inc>
#define KI_PUSH_FAKE_ERROR_CODE TF_PUSH_FAKE_ERROR_CODE
.code
TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE
TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE
PUBLIC ApicSpuriousService
ApicSpuriousService:
iret
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(0FFFFFFFFFEE000B0)], 0
iretq
HackEoiReturn:
ret
#else
#include <ks386.inc>
#include <internal/i386/asmmacro.S>
PUBLIC _ApicSpuriousService
#endif
.code
#ifndef _M_AMD64
TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE
TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE
TRAP_ENTRY HalpTrap0D, 0
TRAP_ENTRY HalpApcInterrupt, KI_PUSH_FAKE_ERROR_CODE
TRAP_ENTRY HalpDispatchInterrupt, KI_PUSH_FAKE_ERROR_CODE
PUBLIC _ApicSpuriousService
_ApicSpuriousService:
iret
// VBox APIC needs an iret more or less directly following the EOI
PUBLIC _HackEoi
_HackEoi:
@ -40,16 +66,9 @@ OnlyOnePersonKnowsHowToHackAroundVBoxBugsAndThatIsNotYou:
ret
#endif
TRAP_ENTRY HalpClockInterrupt, KI_PUSH_FAKE_ERROR_CODE
TRAP_ENTRY HalpProfileInterrupt, KI_PUSH_FAKE_ERROR_CODE
FUNC ApicSpuriousService
#ifdef _M_AMD64
.ENDPROLOG
#endif
int 3
iret
ENDFUNC ApicSpuriousService
END