diff options
-rw-r--r-- | UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm | 2 | ||||
-rw-r--r-- | UefiCpuPkg/Library/MpInitLib/MpLib.c | 8 | ||||
-rw-r--r-- | UefiCpuPkg/Library/MpInitLib/MpLib.h | 4 | ||||
-rw-r--r-- | UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm | 5 |
4 files changed, 10 insertions, 9 deletions
diff --git a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm index 4bfa084c85..64e51d87ae 100644 --- a/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/Ia32/MpFuncs.nasm @@ -181,7 +181,7 @@ GetProcessorNumber: GetNextProcNumber:
cmp [edi], edx ; APIC ID match?
jz ProgramStack
- add edi, 16
+ add edi, 20
inc ebx
jmp GetNextProcNumber
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.c b/UefiCpuPkg/Library/MpInitLib/MpLib.c index 3c2e6d6b89..15dbfa1e7d 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.c +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.c @@ -433,7 +433,7 @@ InitializeApData ( IN OUT CPU_MP_DATA *CpuMpData,
IN UINTN ProcessorNumber,
IN UINT32 BistData,
- IN UINTN ApTopOfStack
+ IN UINT64 ApTopOfStack
)
{
CPU_INFO_IN_HOB *CpuInfoInHob;
@@ -442,7 +442,7 @@ InitializeApData ( CpuInfoInHob[ProcessorNumber].InitialApicId = GetInitialApicId ();
CpuInfoInHob[ProcessorNumber].ApicId = GetApicId ();
CpuInfoInHob[ProcessorNumber].Health = BistData;
- CpuInfoInHob[ProcessorNumber].ApTopOfStack = (UINT32) ApTopOfStack;
+ CpuInfoInHob[ProcessorNumber].ApTopOfStack = ApTopOfStack;
CpuMpData->CpuData[ProcessorNumber].Waiting = FALSE;
CpuMpData->CpuData[ProcessorNumber].CpuHealthy = (BistData == 0) ? TRUE : FALSE;
@@ -480,7 +480,7 @@ ApWakeupFunction ( UINT32 BistData;
volatile UINT32 *ApStartupSignalBuffer;
CPU_INFO_IN_HOB *CpuInfoInHob;
- UINTN ApTopOfStack;
+ UINT64 ApTopOfStack;
//
// AP finished assembly code and begin to execute C code
@@ -500,7 +500,7 @@ ApWakeupFunction ( // This is first time AP wakeup, get BIST information from AP stack
//
ApTopOfStack = CpuMpData->Buffer + (ProcessorNumber + 1) * CpuMpData->CpuApStackSize;
- BistData = *(UINT32 *) (ApTopOfStack - sizeof (UINTN));
+ BistData = *(UINT32 *) ((UINTN) ApTopOfStack - sizeof (UINTN));
//
// Do some AP initialize sync
//
diff --git a/UefiCpuPkg/Library/MpInitLib/MpLib.h b/UefiCpuPkg/Library/MpInitLib/MpLib.h index 0ac777a099..f73a469ae8 100644 --- a/UefiCpuPkg/Library/MpInitLib/MpLib.h +++ b/UefiCpuPkg/Library/MpInitLib/MpLib.h @@ -129,12 +129,14 @@ typedef struct { // we need to make sure the each fields offset same in different
// architecture.
//
+#pragma pack (1)
typedef struct {
UINT32 InitialApicId;
UINT32 ApicId;
UINT32 Health;
- UINT32 ApTopOfStack;
+ UINT64 ApTopOfStack;
} CPU_INFO_IN_HOB;
+#pragma pack ()
//
// AP reset code information including code address and size,
diff --git a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm index 138b97312b..aaabb50c54 100644 --- a/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm +++ b/UefiCpuPkg/Library/MpInitLib/X64/MpFuncs.nasm @@ -185,13 +185,12 @@ GetProcessorNumber: GetNextProcNumber:
cmp dword [edi], edx ; APIC ID match?
jz ProgramStack
- add edi, 16
+ add edi, 20
inc ebx
jmp GetNextProcNumber
ProgramStack:
- xor rsp, rsp
- mov esp, dword [edi + 12]
+ mov rsp, qword [edi + 12]
CProcedureInvoke:
push rbp ; Push BIST data at top of AP stack
|