diff options
author | Hongbin1 Zhang <hongbin1.zhang@intel.com> | 2024-07-26 10:16:42 +0800 |
---|---|---|
committer | mergify[bot] <37929162+mergify[bot]@users.noreply.github.com> | 2024-08-28 13:40:56 +0000 |
commit | 1fd2f9ec8f16cc8efb949888db94eb42006f77c6 (patch) | |
tree | 7c9bc102518b07d101768137843228744991d4a8 /IntelFsp2Pkg | |
parent | a0ac7cf67afd382b4bd13a402bb6100a435b5b7b (diff) | |
download | edk2-1fd2f9ec8f16cc8efb949888db94eb42006f77c6.tar.gz |
IntelFsp2Pkg: Align FSP global data pointer for X64 build
When it used 32 bits for set FSP global data pointer under X64 build,
it should get FSP global data pointer with 32 bits data under X64 build.
Signed-off-by: Hongbin1 Zhang <hongbin1.zhang@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Duggapu Chinni B <chinni.b.duggapu@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Cc: Ted Kuo <ted.kuo@intel.com>
Cc: Ashraf Ali S <ashraf.ali.s@intel.com>
Diffstat (limited to 'IntelFsp2Pkg')
-rw-r--r-- | IntelFsp2Pkg/FspSecCore/SecFspApiChk.c | 12 | ||||
-rw-r--r-- | IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c | 6 |
2 files changed, 9 insertions, 9 deletions
diff --git a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c index 5f59938518..644c374bd6 100644 --- a/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c +++ b/IntelFsp2Pkg/FspSecCore/SecFspApiChk.c @@ -31,7 +31,7 @@ FspApiCallingCheck ( //
// NotifyPhase check
//
- if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS) || ((UINTN)FspData == MAX_UINT32)) {
+ if ((FspData == NULL) || ((UINT32)(UINTN)FspData == MAX_UINT32)) {
Status = EFI_UNSUPPORTED;
} else {
if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {
@@ -42,7 +42,7 @@ FspApiCallingCheck ( //
// FspMemoryInit check
//
- if (((UINTN)FspData != MAX_ADDRESS) && ((UINTN)FspData != MAX_UINT32)) {
+ if ((UINT32)(UINTN)FspData != MAX_UINT32) {
Status = EFI_UNSUPPORTED;
} else if (ApiParam == NULL) {
Status = EFI_SUCCESS;
@@ -53,7 +53,7 @@ FspApiCallingCheck ( //
// TempRamExit check
//
- if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS) || ((UINTN)FspData == MAX_UINT32)) {
+ if ((FspData == NULL) || ((UINT32)(UINTN)FspData == MAX_UINT32)) {
Status = EFI_UNSUPPORTED;
} else {
if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {
@@ -64,7 +64,7 @@ FspApiCallingCheck ( //
// FspSiliconInit check
//
- if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS) || ((UINTN)FspData == MAX_UINT32)) {
+ if ((FspData == NULL) || ((UINT32)(UINTN)FspData == MAX_UINT32)) {
Status = EFI_UNSUPPORTED;
} else {
if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {
@@ -83,14 +83,14 @@ FspApiCallingCheck ( }
}
} else if (ApiIdx == FspMultiPhaseMemInitApiIndex) {
- if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS) || ((UINTN)FspData == MAX_UINT32)) {
+ if ((FspData == NULL) || ((UINT32)(UINTN)FspData == MAX_UINT32)) {
Status = EFI_UNSUPPORTED;
}
} else if (ApiIdx == FspSmmInitApiIndex) {
//
// FspSmmInitApiIndex check
//
- if ((FspData == NULL) || ((UINTN)FspData == MAX_ADDRESS) || ((UINTN)FspData == MAX_UINT32)) {
+ if ((FspData == NULL) || ((UINT32)(UINTN)FspData == MAX_UINT32)) {
Status = EFI_UNSUPPORTED;
} else {
if (FspData->Signature != FSP_GLOBAL_DATA_SIGNATURE) {
diff --git a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c index d33d01fe22..54dbf546c3 100644 --- a/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c +++ b/IntelFsp2Pkg/Library/BaseFspCommonLib/FspCommonLib.c @@ -89,10 +89,10 @@ GetFspGlobalDataPointer ( VOID
)
{
- FSP_GLOBAL_DATA *FspData;
+ UINT32 FspDataAddress;
- FspData = *(FSP_GLOBAL_DATA **)(UINTN)PcdGet32 (PcdGlobalDataPointerAddress);
- return FspData;
+ FspDataAddress = *(UINT32 *)(UINTN)PcdGet32 (PcdGlobalDataPointerAddress);
+ return (FSP_GLOBAL_DATA *)(UINTN)FspDataAddress;
}
/**
|