]> git.proxmox.com Git - mirror_edk2.git/commitdiff
Correct ECC Error for MdePkg/Include/Protocol and Correct PeCofferLib bug to set...
authorlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 17 Jul 2008 08:45:10 +0000 (08:45 +0000)
committerlgao4 <lgao4@6f19259b-4bc3-4df7-8a09-765794883524>
Thu, 17 Jul 2008 08:45:10 +0000 (08:45 +0000)
git-svn-id: https://edk2.svn.sourceforge.net/svnroot/edk2/trunk/edk2@5514 6f19259b-4bc3-4df7-8a09-765794883524

MdePkg/Include/Protocol/BlockIo.h
MdePkg/Include/Protocol/DebugSupport.h
MdePkg/Include/Protocol/DevicePathUtilities.h
MdePkg/Include/Protocol/FirmwareVolume2.h
MdePkg/Include/Protocol/ManagedNetwork.h
MdePkg/Include/Protocol/UgaIo.h
MdePkg/Library/BasePeCoffLib/BasePeCoff.c

index 91c56e7c827d19af7698b6a322a428552d32808c..c42ecc5da01f9023412cb7885c5631e5d354c59f 100644 (file)
@@ -135,28 +135,28 @@ EFI_STATUS
 \r
 **/\r
 typedef struct {\r
-  UINT32  MediaId;    ///< The curent media Id. If the media changes, this value is changed.\r
-  BOOLEAN RemovableMedia;  ///< TRUE if the media is removable; otherwise, FALSE.\r
+  UINT32  MediaId;    /**< The curent media Id. If the media changes, this value is changed.**/\r
+  BOOLEAN RemovableMedia;  /**< TRUE if the media is removable; otherwise, FALSE.**/\r
   BOOLEAN MediaPresent;    /**< TRUE if there is a media currently present in the device;\r
-             othersise, FALSE. THis field shows the media present status\r
-             as of the most recent ReadBlocks() or WriteBlocks() call.\r
-        **/\r
+                             othersise, FALSE. THis field shows the media present status\r
+                             as of the most recent ReadBlocks() or WriteBlocks() call.\r
+                           **/\r
   BOOLEAN LogicalPartition;  /**< TRUE if LBA 0 is the first block of a partition; otherwise\r
-             FALSE. For media with only one partition this would be TRUE.\r
-        **/\r
+                               FALSE. For media with only one partition this would be TRUE.\r
+                             **/\r
   BOOLEAN ReadOnly;    /**< TRUE if the media is marked read-only otherwise, FALSE.\r
-             This field shows the read-only status as of the most recent WriteBlocks () call.\r
-        **/\r
-  BOOLEAN WriteCaching;    ///< TRUE if the WriteBlock () function caches write data.\r
+                            This field shows the read-only status as of the most recent WriteBlocks () call.\r
+                        **/\r
+  BOOLEAN WriteCaching;    /**< TRUE if the WriteBlock () function caches write data.**/\r
 \r
   UINT32  BlockSize;    /**< The intrinsic block size of the device. If the media changes, then\r
-             this field is updated.\r
-        **/\r
-  UINT32  IoAlign;    ///< Supplies the alignment requirement for any buffer to read or write block(s).\r
+                          this field is updated.\r
+                        **/\r
+  UINT32  IoAlign;      /**< Supplies the alignment requirement for any buffer to read or write block(s).**/\r
 \r
   EFI_LBA LastBlock;    /**< The last logical block address on the device.\r
-             If the media changes, then this field is updated.\r
-        **/\r
+                          If the media changes, then this field is updated.\r
+                         **/\r
 } EFI_BLOCK_IO_MEDIA;\r
 \r
 #define EFI_BLOCK_IO_PROTOCOL_REVISION  0x00010000\r
index b3d431ddc8a9fcaa64f952f5c7e811b7f64036e4..c16cf4412032ef3cfd90a2160858c353da83194e 100644 (file)
@@ -76,7 +76,6 @@ typedef struct {
   UINT32  DataOffset;\r
   UINT16  Ds;\r
   UINT8   Reserved2[10];\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   UINT8   St0Mm0[10], Reserved3[6];\r
   UINT8   St1Mm1[10], Reserved4[6];\r
   UINT8   St2Mm2[10], Reserved5[6];\r
@@ -95,26 +94,10 @@ typedef struct {
   UINT8   Xmm7[16];\r
   UINT8   Reserved11[14 * 16];\r
 } EFI_FX_SAVE_STATE_IA32;\r
-#else\r
-  UINT8   St0Mm0[10], Reserved3[6];\r
-  UINT8   St0Mm1[10], Reserved4[6];\r
-  UINT8   St0Mm2[10], Reserved5[6];\r
-  UINT8   St0Mm3[10], Reserved6[6];\r
-  UINT8   St0Mm4[10], Reserved7[6];\r
-  UINT8   St0Mm5[10], Reserved8[6];\r
-  UINT8   St0Mm6[10], Reserved9[6];\r
-  UINT8   St0Mm7[10], Reserved10[6];\r
-  UINT8   Reserved11[22 * 16];\r
-} EFI_FX_SAVE_STATE;\r
-#endif\r
 \r
 typedef struct {\r
   UINT32                 ExceptionData;\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   EFI_FX_SAVE_STATE_IA32 FxSaveState;\r
-#else\r
-  EFI_FX_SAVE_STATE      FxSaveState;\r
-#endif\r
   UINT32                 Dr0;\r
   UINT32                 Dr1;\r
   UINT32                 Dr2;\r
@@ -199,23 +182,10 @@ typedef struct {
   UINT8   Xmm5[16];\r
   UINT8   Xmm6[16];\r
   UINT8   Xmm7[16];\r
-#if (EFI_SPECIFICATION_VERSION >= 0x00020000)\r
   //\r
-  // NOTE: UEFI 2.0 spec definition as follows. It should be updated \r
-  // after spec update.\r
+  // NOTE: UEFI 2.0 spec definition as follows. \r
   //\r
   UINT8   Reserved11[14 * 16];\r
-#else\r
-  UINT8   Xmm8[16];\r
-  UINT8   Xmm9[16];\r
-  UINT8   Xmm10[16];\r
-  UINT8   Xmm11[16];\r
-  UINT8   Xmm12[16];\r
-  UINT8   Xmm13[16];\r
-  UINT8   Xmm14[16];\r
-  UINT8   Xmm15[16];\r
-  UINT8   Reserved10[6 * 16];\r
-#endif\r
 } EFI_FX_SAVE_STATE_X64;\r
 \r
 typedef struct {\r
index 96b8368a32e02ae70a9efb35a846b3cde71c104f..3874d63491dbf8a120ce16f6689ed454714ac460 100644 (file)
@@ -32,7 +32,7 @@
 \r
   @param  DevicePath Points to the start of the EFI device path.\r
 \r
-  @revtal Size       Size of the specified device path, in bytes, including the end-of-path tag.\r
+  @retval Size       Size of the specified device path, in bytes, including the end-of-path tag.\r
 \r
 **/\r
 typedef\r
index cb76d9b079bc5a8fb4b613a226cac8acd16834f8..66fa1e4a39c499df1b9289fc7efb08ac46a2c70c 100644 (file)
@@ -291,7 +291,7 @@ EFI_STATUS
 \r
   @retval EFI_OUT_OF_RESOURCES  An allocation failure occurred.\r
 \r
-  @retavl EFI_NOT_FOUND   Name was not found in the firmware\r
+  @retval EFI_NOT_FOUND   Name was not found in the firmware\r
                           volume.\r
 \r
   @retval EFI_DEVICE_ERROR  A hardware error occurred when\r
index fb6b43b1cd1c850b154865a5e0344a3a3974ec40..45ff98270ba1f924bf910098f3398dcd76c3198d 100644 (file)
@@ -13,8 +13,8 @@
 \r
 **/\r
 \r
-#ifndef _EFI_MANAGED_NETWORK_PROTOCOL_H\r
-#define _EFI_MANAGED_NETWORK_PROTOCOL_H\r
+#ifndef __EFI_MANAGED_NETWORK_PROTOCOL_H__\r
+#define __EFI_MANAGED_NETWORK_PROTOCOL_H__\r
 \r
 #include <Protocol/SimpleNetwork.h>\r
 \r
index 5457920aecbb0db830a55d66e1ffa133be5c2a85..19dee485f6952b50a646061f19768a9142a81a95 100644 (file)
@@ -54,10 +54,6 @@ typedef struct _UGA_DEVICE {
 }\r
 UGA_DEVICE, *PUGA_DEVICE;\r
 \r
-#ifndef UGA_IO_REQUEST_CODE\r
-//\r
-// Prevent conflicts with UGA typedefs.\r
-//\r
 typedef enum {\r
   UgaIoGetVersion             = 1,\r
   UgaIoGetChildDevice,\r
@@ -85,8 +81,6 @@ typedef enum {
 }\r
 UGA_IO_REQUEST_CODE, *PUGA_IO_REQUEST_CODE;\r
 \r
-#endif\r
-\r
 typedef struct {\r
   IN UGA_IO_REQUEST_CODE  ioRequestCode;\r
   IN VOID                 *pvInBuffer;\r
@@ -146,32 +140,30 @@ EFI_STATUS
   IN UGA_DEVICE           * Device\r
   );\r
 \r
-\r
-typedef UGA_STATUS (EFIAPI *PUGA_FW_SERVICE_DISPATCH)(IN PUGA_DEVICE pDevice, IN OUT PUGA_IO_REQUEST pIoRequest);\r
-\r
 /**\r
+  This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r
 \r
-  Routine Description:\r
-\r
-    This is the main UGA service dispatch routine for all UGA_IO_REQUEST s.\r
-\r
-  Arguments:\r
-\r
-    pDevice    - pDevice specifies a pointer to a device object associated with a \r
+  @param pDevice pDevice specifies a pointer to a device object associated with a \r
                  device enumerated by a pIoRequest->ioRequestCode of type \r
                  UgaIoGetChildDevice. The root device for the EFI_UGA_IO_PROTOCOL \r
                  is represented by pDevice being set to NULL.\r
 \r
-    pIoRequest - pIoRequest points to a caller allocated buffer that contains data\r
+  @param pIoRequest \r
+                 pIoRequest points to a caller allocated buffer that contains data\r
                  defined by pIoRequest->ioRequestCode. See Related Definitions for\r
                  a definition of UGA_IO_REQUEST_CODE s and their associated data \r
                  structures.\r
 \r
-  Returns:\r
-\r
-  Varies depending on pIoRequest.\r
+  @return UGA_STATUS\r
 \r
 **/\r
+typedef UGA_STATUS \r
+(EFIAPI *PUGA_FW_SERVICE_DISPATCH)(\r
+  IN PUGA_DEVICE pDevice, \r
+  IN OUT PUGA_IO_REQUEST pIoRequest\r
+  );\r
+\r
+\r
 struct _EFI_UGA_IO_PROTOCOL {\r
   EFI_UGA_IO_PROTOCOL_CREATE_DEVICE CreateDevice;\r
   EFI_UGA_IO_PROTOCOL_DELETE_DEVICE DeleteDevice;\r
index 6d06c7e2a6848a7f19264da90d67a4d6519fdda5..d46178dd25272de97ac3c8edbcd70ab375b645f5 100644 (file)
@@ -544,11 +544,8 @@ PeCoffLoaderRelocateImage (
   //\r
   if (ImageContext->DestinationAddress != 0) {\r
     BaseAddress = ImageContext->DestinationAddress;\r
-  } else if (!(ImageContext->IsTeImage)) {\r
-    BaseAddress = ImageContext->ImageAddress;\r
   } else {\r
-    Hdr.Te      = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);\r
-    BaseAddress = ImageContext->ImageAddress + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->StrippedSize; \r
+    BaseAddress = ImageContext->ImageAddress;\r
   }\r
 \r
   if (!(ImageContext->IsTeImage)) {\r
@@ -597,8 +594,8 @@ PeCoffLoaderRelocateImage (
     }\r
   } else {\r
     Hdr.Te             = (EFI_TE_IMAGE_HEADER *)(UINTN)(ImageContext->ImageAddress);\r
-    Adjust             = (UINT64) (BaseAddress - Hdr.Te->ImageBase);\r
-    Hdr.Te->ImageBase  = (UINT64) (BaseAddress);\r
+    Adjust             = (UINT64) (BaseAddress - Hdr.Te->StrippedSize + sizeof (EFI_TE_IMAGE_HEADER) - Hdr.Te->ImageBase);\r
+    Hdr.Te->ImageBase  = (UINT64) (BaseAddress - Hdr.Te->StrippedSize + sizeof (EFI_TE_IMAGE_HEADER));\r
 \r
     //\r
     // Find the relocation block\r
@@ -711,6 +708,13 @@ PeCoffLoaderRelocateImage (
     RelocBase = (EFI_IMAGE_BASE_RELOCATION *) RelocEnd;\r
   }\r
 \r
+  //\r
+  // Adjust the EntryPoint to match the linked-to address\r
+  //\r
+  if (ImageContext->DestinationAddress != 0) {\r
+     ImageContext->EntryPoint -= (UINT64) ImageContext->ImageAddress;\r
+     ImageContext->EntryPoint += (UINT64) ImageContext->DestinationAddress;\r
+  }\r
   return RETURN_SUCCESS;\r
 }\r
 \r