Preserve ebx register in AsmEnableAvx()
System reset occurs after returning from AsmEnableAvx() in Stage1A.c because ebx register is used for cpuid, but not restored. - Save/Restore ebx register - Move AsmEnableAvx () after init idt and serialport Signed-off-by: Aiden Park <aiden.park@intel.com>
This commit is contained in:
parent
72262b4722
commit
66b9a5191d
|
@ -57,6 +57,7 @@ FlushExit:
|
|||
;------------------------------------------------------------------------------
|
||||
global ASM_PFX(AsmEnableAvx)
|
||||
ASM_PFX(AsmEnableAvx):
|
||||
push ebx
|
||||
;
|
||||
; Check if AVX is supported
|
||||
;
|
||||
|
@ -79,4 +80,5 @@ ASM_PFX(AsmEnableAvx):
|
|||
xsetbv
|
||||
|
||||
NoAvxSupport:
|
||||
pop ebx
|
||||
ret
|
||||
|
|
|
@ -243,6 +243,9 @@ SecStartup2 (
|
|||
BoardInit (PostTempRamInit);
|
||||
AddMeasurePoint (0x1040);
|
||||
|
||||
// Enable more CPU featurs
|
||||
AsmEnableAvx ();
|
||||
|
||||
if (DebugCodeEnabled()) {
|
||||
DEBUG ((DEBUG_INFO, "\n============= %a STAGE1A =============\n",mBootloaderName));
|
||||
} else {
|
||||
|
@ -315,9 +318,6 @@ SecStartup (
|
|||
TimeStamp = ReadTimeStamp ();
|
||||
Stage1aAsmHob = (STAGE1A_ASM_HOB *)Params;
|
||||
|
||||
// Enable more CPU featurs
|
||||
AsmEnableAvx ();
|
||||
|
||||
// Init global data
|
||||
LdrGlobal = &LdrGlobalData;
|
||||
ZeroMem (LdrGlobal, sizeof (LOADER_GLOBAL_DATA));
|
||||
|
|
Loading…
Reference in New Issue