mirror of https://github.com/acidanthera/audk.git
EdkCompatibilityPkg MpServicesOnFrameworkMpServicesThunk: Check for x2APIC mode before accessing the APIC ID register in RendezvousFunnelProc().
Contributed by Bruce Losure. Signed-off-by: rsun3 git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@12442 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
a1f7e1e34f
commit
0dfef49a30
|
@ -90,10 +90,22 @@ ProtectedModeStart:: ; protected mode entry point
|
||||||
;
|
;
|
||||||
mov ecx, 1bh ; Read IA32_APIC_BASE MSR
|
mov ecx, 1bh ; Read IA32_APIC_BASE MSR
|
||||||
rdmsr
|
rdmsr
|
||||||
|
|
||||||
|
bt eax, 10 ; Check for x2apic mode
|
||||||
|
jnc LegacyApicMode
|
||||||
|
mov ecx, 802h ; Read APIC_ID
|
||||||
|
rdmsr
|
||||||
|
mov ebx, eax ; ebx == apicid
|
||||||
|
jmp GetCpuNumber
|
||||||
|
|
||||||
|
LegacyApicMode::
|
||||||
|
|
||||||
and eax, 0fffff000h
|
and eax, 0fffff000h
|
||||||
add eax, 20h
|
add eax, 20h
|
||||||
mov ebx, dword ptr [eax]
|
mov ebx, dword ptr [eax]
|
||||||
shr ebx, 24
|
shr ebx, 24 ; ebx == apicid
|
||||||
|
|
||||||
|
GetCpuNumber::
|
||||||
|
|
||||||
xor ecx, ecx
|
xor ecx, ecx
|
||||||
mov edi, esi
|
mov edi, esi
|
||||||
|
|
|
@ -117,10 +117,22 @@ LongModeStart::
|
||||||
;
|
;
|
||||||
mov ecx, 1bh ; Read IA32_APIC_BASE MSR
|
mov ecx, 1bh ; Read IA32_APIC_BASE MSR
|
||||||
rdmsr
|
rdmsr
|
||||||
|
|
||||||
|
bt eax, 10 ; Check for x2apic mode
|
||||||
|
jnc LegacyApicMode
|
||||||
|
mov ecx, 802h ; Read APIC_ID
|
||||||
|
rdmsr
|
||||||
|
mov ebx, eax ; ebx == apicid
|
||||||
|
jmp GetCpuNumber
|
||||||
|
|
||||||
|
LegacyApicMode::
|
||||||
|
|
||||||
and eax, 0fffff000h
|
and eax, 0fffff000h
|
||||||
add eax, 20h
|
add eax, 20h
|
||||||
mov ebx, dword ptr [eax]
|
mov ebx, dword ptr [eax]
|
||||||
shr ebx, 24
|
shr ebx, 24 ; ebx == apicid
|
||||||
|
|
||||||
|
GetCpuNumber::
|
||||||
|
|
||||||
xor rcx, rcx
|
xor rcx, rcx
|
||||||
mov edi, esi
|
mov edi, esi
|
||||||
|
|
Loading…
Reference in New Issue