summaryrefslogtreecommitdiff
path: root/IntelFrameworkModulePkg/Universal
diff options
context:
space:
mode:
authorJeff Fan <jeff.fan@intel.com>2014-08-08 05:52:01 +0000
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-08 05:52:01 +0000
commit1a45b15eae48d9bf498daf5b0c0771659d75faa2 (patch)
tree0e45806a5952e5993d8499ea68c92672fd91715e /IntelFrameworkModulePkg/Universal
parent31fc7b4d6a86e13687d57bd330a1e3e125ba1b94 (diff)
downloadedk2-platforms-1a45b15eae48d9bf498daf5b0c0771659d75faa2.tar.xz
Add type cast on variable before operation.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jeff Fan <jeff.fan@intel.com> Reviewed-by: Eric Dong <Eric.Dong@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15778 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'IntelFrameworkModulePkg/Universal')
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c4
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c4
-rw-r--r--IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c2
3 files changed, 5 insertions, 5 deletions
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
index 22c2eb3c7e..0d3b489e35 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
@@ -1761,12 +1761,12 @@ GetLegacyDeviceOrder (
break;
}
- WorkingVarData += sizeof (BBS_TYPE);
+ WorkingVarData = (UINT8 *)((UINTN)WorkingVarData + sizeof (BBS_TYPE));
WorkingVarData += *(UINT16 *) WorkingVarData;
DevOrder = (LEGACY_DEV_ORDER_ENTRY *) WorkingVarData;
}
for (OptionIndex = 0; OptionIndex < OptionMenu->MenuNumber; OptionIndex++) {
- VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + OptionIndex * sizeof (UINT16));
+ VarDevOrder = *(UINT16 *) ((UINTN) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + OptionIndex * sizeof (UINT16));
if (0xFF00 == (VarDevOrder & 0xFF00)) {
LegacyOrder[OptionIndex] = 0xFF;
Pos = (VarDevOrder & 0xFF) / 8;
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
index a3b9dd8928..20e17dd858 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
@@ -1303,7 +1303,7 @@ UpdateSetLegacyDeviceOrderPage (
break;
}
- VarData += sizeof (BBS_TYPE);
+ VarData = (UINT8 *)((UINTN)VarData + sizeof (BBS_TYPE));
VarData += *(UINT16 *) VarData;
DevOrder = (LEGACY_DEV_ORDER_ENTRY *) VarData;
}
@@ -1333,7 +1333,7 @@ UpdateSetLegacyDeviceOrderPage (
NULL
);
- VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));
+ VarDevOrder = *(UINT16 *) ((UINTN) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));
if (0xFF00 == (VarDevOrder & 0xFF00)) {
LegacyOrder[Index] = 0xFF;
diff --git a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
index aaada9738f..1a864bc779 100644
--- a/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
+++ b/IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c
@@ -1085,7 +1085,7 @@ PlatformBdsEnterFrontPage (
//
// Clear EFI_OS_INDICATIONS_BOOT_TO_FW_UI to acknowledge OS
//
- OsIndication &= ~EFI_OS_INDICATIONS_BOOT_TO_FW_UI;
+ OsIndication &= ~((UINT64)EFI_OS_INDICATIONS_BOOT_TO_FW_UI);
Status = gRT->SetVariable (
L"OsIndications",
&gEfiGlobalVariableGuid,