mirror of
https://github.com/acidanthera/audk.git
synced 2025-07-06 13:24:23 +02:00
IntelFsp2Pkg: TempRamInit API should preserve EBX/RBX register.
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4395 FSP specification defines the TempRamInit API preserved register list which including EBX/RBX, however current implementation unexpectedly overriding EBX/RBX register that should be fixed. Cc: Nate DeSimone <nathaniel.l.desimone@intel.com> Cc: Star Zeng <star.zeng@intel.com> Signed-off-by: Chasel Chiu <chasel.chiu@intel.com> Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>
This commit is contained in:
parent
fb89f62d27
commit
af98f1fb03
@ -157,6 +157,9 @@ NextAddress:
|
|||||||
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
|
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
|
||||||
; whether the processor supports SSE instruction.
|
; whether the processor supports SSE instruction.
|
||||||
;
|
;
|
||||||
|
; Save EBX to MM2
|
||||||
|
;
|
||||||
|
movd mm2, ebx
|
||||||
mov eax, 1
|
mov eax, 1
|
||||||
cpuid
|
cpuid
|
||||||
bt edx, 25
|
bt edx, 25
|
||||||
@ -169,6 +172,10 @@ NextAddress:
|
|||||||
bt ecx, 19
|
bt ecx, 19
|
||||||
jnc SseError
|
jnc SseError
|
||||||
%endif
|
%endif
|
||||||
|
;
|
||||||
|
; Restore EBX from MM2
|
||||||
|
;
|
||||||
|
movd ebx, mm2
|
||||||
|
|
||||||
;
|
;
|
||||||
; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit (bit #10)
|
; Set OSFXSR bit (bit #9) & OSXMMEXCPT bit (bit #10)
|
||||||
|
@ -255,6 +255,10 @@ NextAddress:
|
|||||||
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
|
; Use CpuId instruction (CPUID.01H:EDX.SSE[bit 25] = 1) to test
|
||||||
; whether the processor supports SSE instruction.
|
; whether the processor supports SSE instruction.
|
||||||
;
|
;
|
||||||
|
; Save RBX to R11
|
||||||
|
; Save RCX to R10
|
||||||
|
;
|
||||||
|
mov r11, rbx
|
||||||
mov r10, rcx
|
mov r10, rcx
|
||||||
mov rax, 1
|
mov rax, 1
|
||||||
cpuid
|
cpuid
|
||||||
@ -266,6 +270,11 @@ NextAddress:
|
|||||||
;
|
;
|
||||||
bt ecx, 19
|
bt ecx, 19
|
||||||
jnc SseError
|
jnc SseError
|
||||||
|
;
|
||||||
|
; Restore RBX from R11
|
||||||
|
; Restore RCX from R10
|
||||||
|
;
|
||||||
|
mov rbx, r11
|
||||||
mov rcx, r10
|
mov rcx, r10
|
||||||
|
|
||||||
;
|
;
|
||||||
@ -284,6 +293,11 @@ NextAddress:
|
|||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
%macro ENABLE_AVX 0
|
%macro ENABLE_AVX 0
|
||||||
|
;
|
||||||
|
; Save RBX to R11
|
||||||
|
; Save RCX to R10
|
||||||
|
;
|
||||||
|
mov r11, rbx
|
||||||
mov r10, rcx
|
mov r10, rcx
|
||||||
mov eax, 1
|
mov eax, 1
|
||||||
cpuid
|
cpuid
|
||||||
@ -307,6 +321,11 @@ EnableAvx:
|
|||||||
xgetbv ; result in edx:eax
|
xgetbv ; result in edx:eax
|
||||||
or eax, 00000006h ; Set XCR0 bit #1 and bit #2 to enable SSE state and AVX state
|
or eax, 00000006h ; Set XCR0 bit #1 and bit #2 to enable SSE state and AVX state
|
||||||
xsetbv
|
xsetbv
|
||||||
|
;
|
||||||
|
; Restore RBX from R11
|
||||||
|
; Restore RCX from R10
|
||||||
|
;
|
||||||
|
mov rbx, r11
|
||||||
mov rcx, r10
|
mov rcx, r10
|
||||||
%endmacro
|
%endmacro
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user