summaryrefslogtreecommitdiff
path: root/MdeModulePkg/Application
diff options
context:
space:
mode:
authorStar Zeng <star.zeng@intel.com>2017-05-23 10:51:13 +0800
committerStar Zeng <star.zeng@intel.com>2017-05-24 15:27:34 +0800
commitf248539538efd522a71c1e9bf63c622e02d443f4 (patch)
treebcbbb4560a8481a8bf633ff0c47a439f9453a864 /MdeModulePkg/Application
parent8ced192d5cf1e8ccd56fa5daed2c2ca28fb04cff (diff)
downloadedk2-f248539538efd522a71c1e9bf63c622e02d443f4.zip
edk2-f248539538efd522a71c1e9bf63c622e02d443f4.tar.gz
edk2-f248539538efd522a71c1e9bf63c622e02d443f4.tar.bz2
MdeModulePkg SmiHandlerProfile: Use fixed data type in data structure
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=568 Use fixed data type in data structure and make the structure be natural aligned. Without this update, the code must assume DXE and SMM are using same data type (same size of UINTN), but it may be not true at some case, for example, after standalone SMM feature is enabled. With this update, the data structure will be phase independent and convenient for consumer to parse the data. Cc: Jiewen Yao <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Star Zeng <star.zeng@intel.com> Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Diffstat (limited to 'MdeModulePkg/Application')
-rw-r--r--MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c
index 3386713..96e9977 100644
--- a/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c
+++ b/MdeModulePkg/Application/SmiHandlerProfileInfo/SmiHandlerProfileInfo.c
@@ -348,9 +348,9 @@ DumpSmmLoadedImage(
if (ImageStruct->Header.Signature == SMM_CORE_IMAGE_DATABASE_SIGNATURE) {
NameString = GetDriverNameString (ImageStruct);
Print(L" <Image Name=\"%a\"", NameString);
- Print(L" Base=\"0x%x\" Size=\"0x%x\"", ImageStruct->ImageBase, ImageStruct->ImageSize);
+ Print(L" Base=\"0x%lx\" Size=\"0x%lx\"", ImageStruct->ImageBase, ImageStruct->ImageSize);
if (ImageStruct->EntryPoint != 0) {
- Print(L" EntryPoint=\"0x%x\"", ImageStruct->EntryPoint);
+ Print(L" EntryPoint=\"0x%lx\"", ImageStruct->EntryPoint);
}
Print(L" FvFile=\"%g\"", &ImageStruct->FileGuid);
Print(L" RefId=\"0x%x\"", ImageStruct->ImageRef);
@@ -540,7 +540,7 @@ DumpSmiChildContext (
CHAR16 *Str;
if (CompareGuid (HandlerType, &gEfiSmmSwDispatch2ProtocolGuid)) {
- Print(L" SwSmi=\"0x%x\"", ((EFI_SMM_SW_REGISTER_CONTEXT *)Context)->SwSmiInputValue);
+ Print(L" SwSmi=\"0x%lx\"", ((SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT *)Context)->SwSmiInputValue);
} else if (CompareGuid (HandlerType, &gEfiSmmSxDispatch2ProtocolGuid)) {
Print(L" SxType=\"%a\"", SxTypeToString(((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Type));
Print(L" SxPhase=\"%a\"", SxPhaseToString(((EFI_SMM_SX_REGISTER_CONTEXT *)Context)->Phase));
@@ -609,14 +609,14 @@ DumpSmiHandler(
Print(L" <Pdb>%a</Pdb>\n", (UINT8 *)ImageStruct + ImageStruct->PdbStringOffset);
}
Print(L" </Module>\n");
- Print(L" <Handler Address=\"0x%x\">\n", SmiHandlerStruct->Handler);
+ Print(L" <Handler Address=\"0x%lx\">\n", SmiHandlerStruct->Handler);
if (ImageStruct != NULL) {
- Print(L" <RVA>0x%x</RVA>\n", SmiHandlerStruct->Handler - ImageStruct->ImageBase);
+ Print(L" <RVA>0x%x</RVA>\n", (UINTN) (SmiHandlerStruct->Handler - ImageStruct->ImageBase));
}
Print(L" </Handler>\n", SmiHandlerStruct->Handler);
- Print(L" <Caller Address=\"0x%x\">\n", SmiHandlerStruct->CallerAddr);
+ Print(L" <Caller Address=\"0x%lx\">\n", SmiHandlerStruct->CallerAddr);
if (ImageStruct != NULL) {
- Print(L" <RVA>0x%x</RVA>\n", SmiHandlerStruct->CallerAddr - ImageStruct->ImageBase);
+ Print(L" <RVA>0x%x</RVA>\n", (UINTN) (SmiHandlerStruct->CallerAddr - ImageStruct->ImageBase));
}
Print(L" </Caller>\n", SmiHandlerStruct->Handler);
SmiHandlerStruct = (VOID *)((UINTN)SmiHandlerStruct + SmiHandlerStruct->Length);