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