\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
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
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
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
\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
\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
\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
}\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
}\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
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
//\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
}\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
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