]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPkg: Fix warnings raised by ARMGCC
authoroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 15 Jun 2011 19:53:15 +0000 (19:53 +0000)
committeroliviermartin <oliviermartin@6f19259b-4bc3-4df7-8a09-765794883524>
Wed, 15 Jun 2011 19:53:15 +0000 (19:53 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@11829 6f19259b-4bc3-4df7-8a09-765794883524

12 files changed:
ArmPkg/Drivers/PL180MciDxe/PL180Mci.c
ArmPkg/Library/BdsLib/BdsAppLoader.c
ArmPkg/Library/BdsLib/BdsFilePath.c
ArmPkg/Library/DebugPeCoffExtraActionLib/DebugPeCoffExtraActionLib.c
ArmPlatformPkg/ArmVExpressPkg/Library/ArmVExpressLibCTA9x4/CTA9x4.c
ArmPlatformPkg/Bds/Bds.c
ArmPlatformPkg/Bds/BootMenu.c
ArmPlatformPkg/MemoryInitPei/MemoryInit.c
ArmPlatformPkg/PlatformPei/PlatformPei.c
ArmPlatformPkg/PlatformPei/PlatformPei.inf
ArmPlatformPkg/Sec/Sec.c
EmbeddedPkg/Universal/MmcDxe/MmcBlockIo.c

index 0a2a02aacf29155543b8a4a753d238c0b928ab43..697e33f0d0841709dc6025c7569b985349d42c23 100644 (file)
@@ -60,6 +60,11 @@ MciIsReadOnly (
   return (MmioRead32(FixedPcdGet32(PcdPL180SysMciRegAddress)) & 2);\r
 }\r
 \r
+#if 0\r
+//Note: This function has been commented out because it is not used yet.\r
+//      This function could be used to remove the hardcoded BlockLen used\r
+//      in MciPrepareDataPath\r
+\r
 // Convert block size to 2^n\r
 STATIC\r
 UINT32\r
@@ -79,6 +84,7 @@ GetPow2BlockLen (
 \r
   return Pow2BlockLen;\r
 }\r
+#endif\r
 \r
 VOID\r
 MciPrepareDataPath (\r
index d14e3c5dcc0fd26f2341e9d6834eda88faf670c4..8b778b27f714e165f9d71db03abe3b727751006d 100644 (file)
 
 #include "BdsInternal.h"
 
-//#include <Library/PeCoffLib.h>
-#include <Library/DxeServicesLib.h>
-
-//TODO: RemoveMe
-#include <Protocol/DevicePathToText.h>
-
-/**
-  Retrieves the magic value from the PE/COFF header.
-
-  @param  Hdr             The buffer in which to return the PE32, PE32+, or TE header.
-
-  @return EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC - Image is PE32
-  @return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC - Image is PE32+
-
-**/
-UINT16
-PeCoffLoaderGetPeHeaderMagicValue (
-  IN  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Hdr
-  )
-{
-  //
-  // NOTE: Some versions of Linux ELILO for Itanium have an incorrect magic value
-  //       in the PE/COFF Header.  If the MachineType is Itanium(IA64) and the
-  //       Magic value in the OptionalHeader is  EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC
-  //       then override the returned value to EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC
-  //
-  if (Hdr.Pe32->FileHeader.Machine == IMAGE_FILE_MACHINE_IA64 && Hdr.Pe32->OptionalHeader.Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
-    return EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC;
-  }
-  //
-  // Return the magic value from the PC/COFF Optional Header
-  //
-  return Hdr.Pe32->OptionalHeader.Magic;
-}
-
-STATIC
-BOOLEAN
-IsLoadableImage (
-  VOID*   Image
-  )
-{
-  UINT16                       Magic;
-  EFI_IMAGE_DOS_HEADER        *DosHeader;
-  EFI_IMAGE_OPTIONAL_HEADER_PTR_UNION  Header;
-
-  if (Image == NULL) {
-    return FALSE;
-  }
-
-  DosHeader = (EFI_IMAGE_DOS_HEADER*)Image;
-  if (DosHeader->e_magic == EFI_IMAGE_DOS_SIGNATURE) {
-    Header.Pe32 = (EFI_IMAGE_NT_HEADERS32*)((UINT8*)Image + DosHeader->e_lfanew);
-  } else {
-    Header.Pe32 = (EFI_IMAGE_NT_HEADERS32*)(Image);
-  }
-
-  if (Header.Te->Signature == EFI_TE_IMAGE_HEADER_SIGNATURE) {
-    // It is a TE Image
-    return TRUE;
-  } else if (Header.Pe32->Signature == EFI_IMAGE_NT_SIGNATURE)  {
-    Magic = PeCoffLoaderGetPeHeaderMagicValue (Header);
-    if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR32_MAGIC) {
-      // It is a PE32 Image
-      return TRUE;
-    } else if (Magic == EFI_IMAGE_NT_OPTIONAL_HDR64_MAGIC) {
-      // It is a PE32+ Image
-      return TRUE;
-    } else {
-      DEBUG ((EFI_D_ERROR,"BdsLoadBinaryFromPath(): Fail unrecognized PE Image\n"));
-    }
-  } else {
-    DEBUG ((EFI_D_ERROR,"BdsLoadBinaryFromPath(): Fail unrecognize image\n"));
-  }
-
-  return FALSE;
-}
+//#include <Library/DxeServicesLib.h>
 
 STATIC
 EFI_STATUS
@@ -186,7 +111,6 @@ BdsLoadApplication (
   EFI_STATUS                      Status;
   UINTN                           NoHandles, HandleIndex;
   EFI_HANDLE                      *Handles;
-  EFI_DEVICE_PATH                 *FvDevicePath;
   EFI_DEVICE_PATH                 *EfiAppDevicePath;
 
   // Need to connect every drivers to ensure no dependencies are missing for the application
@@ -205,6 +129,7 @@ BdsLoadApplication (
 
   // Search in all Firmware Volume for the EFI Application
   for (HandleIndex = 0; HandleIndex < NoHandles; HandleIndex++) {
+    EfiAppDevicePath = NULL;
     Status = BdsLoadFileFromFirmwareVolume (Handles[HandleIndex], EfiApp, EFI_FV_FILETYPE_APPLICATION, &EfiAppDevicePath);
     if (!EFI_ERROR (Status)) {
       // Start the application
index f7a06e5a89f241195e8e305ea0817b8feb5db431..be1a824d50c8e7f99477339bfa997692a8ad0cec 100644 (file)
@@ -264,8 +264,11 @@ TryRemovableDevice (
   EFI_DEVICE_PATH* RemovableDevicePath;
   BOOLEAN         RemovableFound;
 
-  RemovableFound = FALSE;
-  TmpDevicePath = DevicePath;
+  RemovableDevice     = NULL;
+  RemovableDevicePath = NULL;
+  RemovableFound      = FALSE;
+  TmpDevicePath       = DevicePath;
+
   while (!IsDevicePathEnd (TmpDevicePath) && !RemovableFound) {
     for (Index = 0; Index < sizeof(RemovableDeviceSupport) / sizeof(BDS_REMOVABLE_DEVICE_SUPPORT); Index++) {
       RemovableDevice = &RemovableDeviceSupport[Index];
index 4b95bdf54c5df303383e665d9e09f66d1196df36..ad75f616eea83d5d1e3104b40ca71f6afb242a87 100755 (executable)
@@ -77,7 +77,9 @@ PeCoffLoaderRelocateImageExtraAction (
   IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   )\r
 {\r
-    CHAR8 Temp[512];\r
+#if !defined(MDEPKG_NDEBUG) \r
+  CHAR8 Temp[512];\r
+#endif\r
 \r
 #ifdef __CC_ARM\r
   // Print out the command for the RVD debugger to load symbols for this image\r
@@ -108,7 +110,9 @@ PeCoffLoaderUnloadImageExtraAction (
   IN OUT PE_COFF_LOADER_IMAGE_CONTEXT  *ImageContext\r
   )\r
 {\r
+#if !defined(MDEPKG_NDEBUG)\r
   CHAR8 Temp[512];\r
+#endif\r
   \r
 #ifdef __CC_ARM\r
   {  \r
index 8415842fb597e5a6c10217d23ee0f9b4c11b3247..c72a5a4cbab23ca5d2cdbf779e7d0ca51e0f5f0f 100644 (file)
@@ -23,7 +23,7 @@
 #include <Drivers/PL301Axi.h>
 #include <Drivers/SP804Timer.h>
 
-#define SerialPrint(txt)  SerialPortWrite (txt, AsciiStrLen(txt)+1);
+#define SerialPrint(txt)  SerialPortWrite ((UINT8*)(txt), AsciiStrLen(txt)+1);
 
 // DDR2 timings
 PL341_DMC_CONFIG DDRTimings = {
index 415f0a9cb28771a0fb1a743559e20742e76f328a..8f6e82073f9f79fe78e92317b05a6793fbc329d2 100644 (file)
@@ -117,13 +117,16 @@ InitializeConsolePipe (
         // We convert back to the text representation of the device Path
         EFI_DEVICE_PATH_TO_TEXT_PROTOCOL* DevicePathToTextProtocol;
         CHAR16* DevicePathTxt;
+        EFI_STATUS Status;
+       
+        Status = gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol);
+        if (!EFI_ERROR(Status)) {
+          DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText (DevicePath, TRUE, TRUE);
 
-        ASSERT_EFI_ERROR(gBS->LocateProtocol(&gEfiDevicePathToTextProtocolGuid, NULL, (VOID **)&DevicePathToTextProtocol));
-        DevicePathTxt = DevicePathToTextProtocol->ConvertDevicePathToText (DevicePath, TRUE, TRUE);
+          DEBUG((EFI_D_ERROR,"Fail to start the console with the Device Path '%s'. (Error '%r')\n", DevicePathTxt, Status));
 
-        DEBUG((EFI_D_ERROR,"Fail to start the console with the Device Path '%s'. (Error '%r')\n", DevicePathTxt, Status));
-
-        FreePool (DevicePathTxt);
+          FreePool (DevicePathTxt);
+        }
       }
     DEBUG_CODE_END();
 
index a2360d14f5e50c34b33d96df9afc44a04f77c975..1bcf2ad00f33a37468f19c92c3e18f1be3e6e033 100644 (file)
@@ -38,7 +38,8 @@ BootMenuAddBootOption (
   EFI_DEVICE_PATH*  DevicePath;\r
   EFI_DEVICE_PATH_PROTOCOL *DevicePathNode;\r
 \r
-  Attributes = 0;\r
+  Attributes                = 0;\r
+  SupportedBootDevice = NULL;\r
 \r
   //\r
   // List the Boot Devices supported\r
@@ -402,6 +403,7 @@ BootMenuMain (
   UINTN   Index;\r
   UINTN   BootMainEntryCount;\r
 \r
+  BootOption              = NULL;\r
   BootMainEntryCount = sizeof(BootMainEntries) / sizeof(struct BOOT_MAIN_ENTRY);\r
 
   // Get Boot#### list\r
index 4b31de96b1fafcd09d8ad07b27a3bfe36d0f2263..3c7588f8c26e21caf379f47267211ec5bb03c315 100644 (file)
@@ -122,7 +122,7 @@ InitializeMemory (
   // Ensure PcdSystemMemorySize has been set\r
   ASSERT (FixedPcdGet32 (PcdSystemMemorySize) != 0);\r
 \r
-  SystemMemoryTop = FixedPcdGet32 (PcdSystemMemoryBase) + FixedPcdGet32 (PcdSystemMemorySize);\r
+  SystemMemoryTop = (UINTN)FixedPcdGet32 (PcdSystemMemoryBase) + (UINTN)FixedPcdGet32 (PcdSystemMemorySize);\r
 \r
   //\r
   // Initialize the System Memory (DRAM)\r
index 4c0ae2141dce66d2601f2f7f3786c4b85f8bcb89..3ccbbfd2d7b6de61ca47474e9fa325da3e083f8b 100644 (file)
@@ -24,6 +24,7 @@
 //\r
 // The Library classes this module consumes\r
 //\r
+#include <Library/ArmPlatformLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/PeimEntryPoint.h>\r
 #include <Library/PcdLib.h>\r
index 92cf3aa4dc55abb5cc81edfaac7776d2875b071b..bbc5f1a0283d3618d8b41518fcb1b415c6c9d8d9 100644 (file)
@@ -32,6 +32,7 @@
 \r
 [Packages]\r
   MdePkg/MdePkg.dec\r
+  MdeModulePkg/MdeModulePkg.dec\r
   EmbeddedPkg/EmbeddedPkg.dec\r
   ArmPkg/ArmPkg.dec\r
   ArmPlatformPkg/ArmPlatformPkg.dec\r
index 64cf0f0d7ebe5aad99a564509dc5e85379aaf0be..98fe51256c6684386fdb60041e8d875bea5c7c07 100644 (file)
@@ -27,7 +27,7 @@
 
 #define ARM_PRIMARY_CORE  0
 
-#define SerialPrint(txt)  SerialPortWrite (txt, AsciiStrLen(txt)+1);
+#define SerialPrint(txt)  SerialPortWrite ((UINT8*)txt, AsciiStrLen(txt)+1);
 
 extern VOID *monitor_vector_table;
 
index 138e87e7a856e254a68b51ac9185601c6d332e86..7341d9f9b80e40d6a3ffb81d4ed2139d8793685c 100644 (file)
@@ -89,8 +89,10 @@ PrintCSD (
   )\r
 {\r
   UINTN Value;\r
+#if !defined(MDEPKG_NDEBUG)\r
   CONST CHAR8* str_unit[] = { "100kbit/s","1Mbit/s","10Mbit/s","100MBit/s","Unkbown","Unkbown","Unkbown","Unkbown" };\r
   CONST CHAR8* str_value[] = { "1.0","1.2","1.3","1.5","2.0","2.5","3.0","3.5","4.0","4.5","5.0","Unknown","Unknown","Unknown","Unknown" };\r
+#endif\r
 \r
   if (((Csd[2] >> 30) & 0x3) == 0) {\r
     DEBUG((EFI_D_ERROR, "- PrintCSD Version 1.01-1.10/Version 2.00/Standard Capacity\n"));\r