diff options
author | Star Zeng <star.zeng@intel.com> | 2017-05-23 10:51:13 +0800 |
---|---|---|
committer | Guo Mang <mang.guo@intel.com> | 2017-07-12 11:24:46 +0800 |
commit | a3a1f310ad0cbd7171d566cfff32b624243a97a1 (patch) | |
tree | 86cfae39ac66340431892e0d7c936d03df96eddf /Core/MdeModulePkg/Include/Guid/SmiHandlerProfile.h | |
parent | 4ba1fc4b7c091368e9d80b98f5866fbd6c12b3c4 (diff) | |
download | edk2-platforms-a3a1f310ad0cbd7171d566cfff32b624243a97a1.tar.xz |
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>
(cherry picked from commit f248539538efd522a71c1e9bf63c622e02d443f4)
Diffstat (limited to 'Core/MdeModulePkg/Include/Guid/SmiHandlerProfile.h')
-rw-r--r-- | Core/MdeModulePkg/Include/Guid/SmiHandlerProfile.h | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/Core/MdeModulePkg/Include/Guid/SmiHandlerProfile.h b/Core/MdeModulePkg/Include/Guid/SmiHandlerProfile.h index c5d29e8892..ba41393cf2 100644 --- a/Core/MdeModulePkg/Include/Guid/SmiHandlerProfile.h +++ b/Core/MdeModulePkg/Include/Guid/SmiHandlerProfile.h @@ -25,12 +25,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #include <Protocol/SmmSxDispatch2.h>
#include <Protocol/SmmUsbDispatch2.h>
-#pragma pack(1)
-
typedef struct {
UINT32 Signature;
UINT32 Length;
UINT32 Revision;
+ UINT8 Reserved[4];
} SMM_CORE_DATABASE_COMMON_HEADER;
#define SMM_CORE_IMAGE_DATABASE_SIGNATURE SIGNATURE_32 ('S','C','I','D')
@@ -39,12 +38,12 @@ typedef struct { typedef struct {
SMM_CORE_DATABASE_COMMON_HEADER Header;
EFI_GUID FileGuid;
- UINTN ImageRef;
- UINTN EntryPoint;
- UINTN ImageBase;
- UINTN ImageSize;
+ PHYSICAL_ADDRESS EntryPoint;
+ PHYSICAL_ADDRESS ImageBase;
+ UINT64 ImageSize;
+ UINT32 ImageRef;
UINT16 PdbStringOffset;
- UINT8 Reserved2[6];
+ UINT8 Reserved[2];
//CHAR8 PdbString[];
} SMM_CORE_IMAGE_DATABASE_STRUCTURE;
@@ -64,7 +63,7 @@ typedef enum { // NULL
// Context for SmmCoreSmiHandlerCategoryHardwareHandler:
// (NOTE: The context field should NOT include any data pointer.)
-// gEfiSmmSwDispatch2ProtocolGuid: EFI_SMM_SW_REGISTER_CONTEXT
+// gEfiSmmSwDispatch2ProtocolGuid: (EFI_SMM_SW_REGISTER_CONTEXT => SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT)
// gEfiSmmSxDispatch2ProtocolGuid: EFI_SMM_SX_REGISTER_CONTEXT
// gEfiSmmPowerButtonDispatch2ProtocolGuid: EFI_SMM_POWER_BUTTON_REGISTER_CONTEXT
// gEfiSmmStandbyButtonDispatch2ProtocolGuid: EFI_SMM_STANDBY_BUTTON_REGISTER_CONTEXT
@@ -81,21 +80,25 @@ typedef struct { } SMI_HANDLER_PROFILE_USB_REGISTER_CONTEXT;
typedef struct {
- UINT32 Length;
- UINTN CallerAddr;
- UINTN Handler;
- UINTN ImageRef;
- UINT16 ContextBufferOffset;
- UINT8 Reserved2[2];
- UINT32 ContextBufferSize;
-//UINT8 ContextBuffer[];
+ UINT64 SwSmiInputValue;
+} SMI_HANDLER_PROFILE_SW_REGISTER_CONTEXT;
+
+typedef struct {
+ UINT32 Length;
+ UINT32 ImageRef;
+ PHYSICAL_ADDRESS CallerAddr;
+ PHYSICAL_ADDRESS Handler;
+ UINT16 ContextBufferOffset;
+ UINT8 Reserved[2];
+ UINT32 ContextBufferSize;
+//UINT8 ContextBuffer[];
} SMM_CORE_SMI_HANDLER_STRUCTURE;
typedef struct {
SMM_CORE_DATABASE_COMMON_HEADER Header;
- UINT32 HandlerCategory;
EFI_GUID HandlerType;
- UINTN HandlerCount;
+ UINT32 HandlerCategory;
+ UINT32 HandlerCount;
//SMM_CORE_SMI_HANDLER_STRUCTURE Handler[HandlerCount];
} SMM_CORE_SMI_DATABASE_STRUCTURE;
@@ -144,8 +147,6 @@ typedef struct { #define SMI_HANDLER_PROFILE_GUID {0x49174342, 0x7108, 0x409b, {0x8b, 0xbe, 0x65, 0xfd, 0xa8, 0x53, 0x89, 0xf5}}
-#pragma pack()
-
extern EFI_GUID gSmiHandlerProfileGuid;
typedef struct _SMI_HANDLER_PROFILE_PROTOCOL SMI_HANDLER_PROFILE_PROTOCOL;
|