]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Add type cast on variable before operation.
authorJeff Fan <jeff.fan@intel.com>
Fri, 8 Aug 2014 05:52:01 +0000 (05:52 +0000)
committervanjeff <vanjeff@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 8 Aug 2014 05:52:01 +0000 (05:52 +0000)
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

IntelFrameworkModulePkg/Bus/Pci/IdeBusDxe/IdeBus.c
IntelFrameworkModulePkg/Csm/BiosThunk/Snp16Dxe/BiosSnp16.c
IntelFrameworkModulePkg/Csm/BiosThunk/VideoDxe/BiosVideo.c
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Ipf/IpfBootSupport.c
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/Ipf/Thunk.c
IntelFrameworkModulePkg/Csm/LegacyBiosDxe/LegacyPci.c
IntelFrameworkModulePkg/Library/GenericBdsLib/BdsBoot.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/BootOption.c
IntelFrameworkModulePkg/Universal/BdsDxe/BootMaint/UpdatePage.c
IntelFrameworkModulePkg/Universal/BdsDxe/FrontPage.c

index 140816d292c91b9542e4d931cae870038559e59d..82fd44f17dab7d1f82c02503b0a7cda380b699c6 100644 (file)
@@ -3,7 +3,7 @@
   Child device(Disk, CDROM, etc) enumeration and child handler installation, and \r
   driver stop.\r
     \r
-  Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -433,7 +433,7 @@ IDEBusDriverBindingStart (
                     &Supports\r
                     );\r
   if (!EFI_ERROR (Status)) {\r
-    Supports &= EFI_PCI_DEVICE_ENABLE;\r
+    Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
     Status = PciIo->Attributes (\r
                       PciIo,\r
                       EfiPciIoAttributeOperationEnable,\r
@@ -1004,7 +1004,7 @@ IDEBusDriverBindingStop (
                         &Supports\r
                         );\r
       if (!EFI_ERROR (Status)) {\r
-        Supports &= EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO | EFI_PCI_DEVICE_ENABLE;\r
+        Supports &= (UINT64)(EFI_PCI_IO_ATTRIBUTE_IDE_PRIMARY_IO | EFI_PCI_IO_ATTRIBUTE_IDE_SECONDARY_IO | EFI_PCI_DEVICE_ENABLE);\r
         PciIo->Attributes (\r
                 PciIo,\r
                 EfiPciIoAttributeOperationDisable,\r
index 05254100f1d465df494e3a75430854d82f3d78d2..7af2dedd5d6f62222186e4bd910341d2824a009a 100644 (file)
@@ -358,7 +358,7 @@ BiosSnp16DriverBindingStart (
                     &Supports\r
                     );\r
   if (!EFI_ERROR (Status)) {\r
-    Supports &= EFI_PCI_DEVICE_ENABLE;\r
+    Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
     Status = PciIo->Attributes (\r
                       PciIo,\r
                       EfiPciIoAttributeOperationEnable,\r
@@ -793,7 +793,7 @@ Done:
                         &Supports\r
                         );\r
       if (!EFI_ERROR (Status)) {\r
-        Supports &= EFI_PCI_DEVICE_ENABLE;\r
+        Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
         Status = PciIo->Attributes (\r
                           PciIo,\r
                           EfiPciIoAttributeOperationDisable,\r
@@ -876,7 +876,7 @@ BiosSnp16DriverBindingStop (
                         &Supports\r
                         );\r
       if (!EFI_ERROR (Status)) {\r
-        Supports &= EFI_PCI_DEVICE_ENABLE;\r
+        Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
         Status = PciIo->Attributes (\r
                           PciIo,\r
                           EfiPciIoAttributeOperationDisable,\r
index 7c718ba423d750031989c6f659c98c39d6cb9f80..9f7f72a3f2a019aed47a8d52295cef45b5acebb2 100644 (file)
@@ -1,7 +1,7 @@
 /** @file\r
   ConsoleOut Routines that speak VGA.\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -315,7 +315,7 @@ BiosVideoDriverBindingStart (
     goto Done;\r
   }\r
 \r
-  Supports &= (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16);\r
+  Supports &= (UINT64)(EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16);\r
   if (Supports == 0 || Supports == (EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16)) {\r
     Status = EFI_UNSUPPORTED;\r
     goto Done;\r
index b6787ae0e7bfe114760c8558c8e285a54517abbe..8c8f6d321b57b0fbfb356ac22fcd82f51344ecaa 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -226,7 +226,7 @@ RelocateImageUnder4GIfNeeded (
       // Align buffer on section boundry\r
       //\r
       ImageContext.ImageAddress += ImageContext.SectionAlignment - 1;\r
-      ImageContext.ImageAddress &= ~(ImageContext.SectionAlignment - 1);\r
+     ImageContext.ImageAddress &= ~((PHYSICAL_ADDRESS)ImageContext.SectionAlignment - 1);\r
 \r
       //\r
       // Load the image to our new buffer\r
index ca59b97ec4aca82d5c1121672d4f1808f448925a..e601bbd63bf295751fd096a2b50f5147945d97b7 100644 (file)
@@ -4,7 +4,7 @@
   BugBug: Thunker does A20 gate. Can we get rid of this code or\r
           put it into Legacy16 code.\r
 \r
-Copyright (c) 1999 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
 \r
 This program and the accompanying materials\r
 are licensed and made available under the terms and conditions\r
@@ -67,7 +67,7 @@ BiosIntCall (
   UINT64          IntTypeVariable;\r
 \r
   IntTypeVariable = 0x8000000000000000;\r
-  IntTypeVariable |= BiosInt;\r
+  IntTypeVariable |= (UINT64)BiosInt;\r
 \r
   DwordRegs.Cs    = Segment;\r
   DwordRegs.Eip   = Offset;\r
index 661bef57445a681a9e61780f8c6a6c6cc3300715..7299fc0e6be45c0cfe5f0fa7906c5e8aa1e12919 100644 (file)
@@ -1198,7 +1198,7 @@ PciProgramAllInterruptLineRegisters (
                       &Supports\r
                       );\r
     if (!EFI_ERROR (Status)) {\r
-      Supports &= EFI_PCI_DEVICE_ENABLE;\r
+      Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
       Status = PciIo->Attributes (\r
                         PciIo,\r
                         EfiPciIoAttributeOperationEnable,\r
@@ -1772,7 +1772,7 @@ PciShadowRoms (
                           &Supports\r
                           );\r
         if (!EFI_ERROR (Status)) {\r
-          Supports &= EFI_PCI_DEVICE_ENABLE;\r
+          Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;\r
           Status = PciIo->Attributes (\r
                             PciIo,\r
                             EfiPciIoAttributeOperationEnable,\r
@@ -1895,7 +1895,7 @@ LegacyBiosCheckPciRomEx (
   //\r
   Status = IsLegacyRom (PciHandle);\r
   if (!EFI_ERROR (Status)) {\r
-    *Flags |= (ROM_FOUND | VALID_LEGACY_ROM);\r
+    *Flags |= (UINTN)(ROM_FOUND | VALID_LEGACY_ROM);\r
     return EFI_SUCCESS;\r
   }\r
   //\r
@@ -2187,8 +2187,8 @@ LegacyBiosInstallVgaRom (
                     &Supports\r
                     );\r
   if (!EFI_ERROR (Status)) {\r
-    Supports &= EFI_PCI_DEVICE_ENABLE | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | \\r
-                EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16;\r
+    Supports &= (UINT64)(EFI_PCI_DEVICE_ENABLE | EFI_PCI_IO_ATTRIBUTE_VGA_MEMORY | \\r
+                         EFI_PCI_IO_ATTRIBUTE_VGA_IO | EFI_PCI_IO_ATTRIBUTE_VGA_IO_16);\r
     Status = PciIo->Attributes (\r
                       PciIo,\r
                       EfiPciIoAttributeOperationEnable,\r
index 8acdad8f532113eee8369aaee51ac09dac401b18..3a74d246137b12cf8400a6e2a51bb8a84f943bd2 100644 (file)
@@ -1413,7 +1413,7 @@ BdsSetBootPriority4SameTypeDev (
       break;\r
     }\r
 \r
-    DevOrderPtr = (LEGACY_DEV_ORDER_ENTRY *) ((UINT8 *) DevOrderPtr + sizeof (BBS_TYPE) + DevOrderPtr->Length);\r
+    DevOrderPtr = (LEGACY_DEV_ORDER_ENTRY *) ((UINTN) DevOrderPtr + sizeof (BBS_TYPE) + DevOrderPtr->Length);\r
   }\r
 \r
   if ((UINT8 *) DevOrderPtr >= (UINT8 *) DevOrder + DevOrderSize) {\r
index 22c2eb3c7ec9ae05cf0e1ce844e946cb89646bc0..0d3b489e35f62287d7a89e553be1ec7f6591a997 100644 (file)
@@ -1761,12 +1761,12 @@ GetLegacyDeviceOrder (
           break;\r
         }\r
     \r
-        WorkingVarData += sizeof (BBS_TYPE);\r
+        WorkingVarData  = (UINT8 *)((UINTN)WorkingVarData + sizeof (BBS_TYPE));\r
         WorkingVarData += *(UINT16 *) WorkingVarData;\r
         DevOrder = (LEGACY_DEV_ORDER_ENTRY *) WorkingVarData;\r
       } \r
       for (OptionIndex = 0; OptionIndex < OptionMenu->MenuNumber; OptionIndex++) {\r
-        VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + OptionIndex * sizeof (UINT16));\r
+        VarDevOrder = *(UINT16 *) ((UINTN) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + OptionIndex * sizeof (UINT16));\r
          if (0xFF00 == (VarDevOrder & 0xFF00)) {\r
           LegacyOrder[OptionIndex]  = 0xFF;\r
           Pos                       = (VarDevOrder & 0xFF) / 8;\r
index a3b9dd8928265975d87c79bafa52b183800a1a0f..20e17dd8581fc7af5cf8c41920652122328cb4d6 100644 (file)
@@ -1303,7 +1303,7 @@ UpdateSetLegacyDeviceOrderPage (
         break;\r
       }\r
 \r
-      VarData += sizeof (BBS_TYPE);\r
+      VarData  = (UINT8 *)((UINTN)VarData + sizeof (BBS_TYPE));\r
       VarData += *(UINT16 *) VarData;\r
       DevOrder = (LEGACY_DEV_ORDER_ENTRY *) VarData;\r
     }\r
@@ -1333,7 +1333,7 @@ UpdateSetLegacyDeviceOrderPage (
         NULL\r
         );\r
 \r
-      VarDevOrder = *(UINT16 *) ((UINT8 *) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));\r
+      VarDevOrder = *(UINT16 *) ((UINTN) DevOrder + sizeof (BBS_TYPE) + sizeof (UINT16) + Index * sizeof (UINT16));\r
 \r
       if (0xFF00 == (VarDevOrder & 0xFF00)) {\r
         LegacyOrder[Index]  = 0xFF;\r
index aaada9738fb69edcef6213bf0716156f75dae152..1a864bc7791bdb5045744d604fc909d913e741da 100644 (file)
@@ -1085,7 +1085,7 @@ PlatformBdsEnterFrontPage (
     //\r
     // Clear EFI_OS_INDICATIONS_BOOT_TO_FW_UI to acknowledge OS\r
     // \r
-    OsIndication &= ~EFI_OS_INDICATIONS_BOOT_TO_FW_UI;\r
+    OsIndication &= ~((UINT64)EFI_OS_INDICATIONS_BOOT_TO_FW_UI);\r
     Status = gRT->SetVariable (\r
                     L"OsIndications",\r
                     &gEfiGlobalVariableGuid,\r