28 IN OUT CHAR8 **FixupData,
37 RelocType = (*Reloc) >> 12;
43 case EFI_IMAGE_REL_BASED_LOONGARCH64_MARK_LA:
45 Value = (*(UINT32 *)Fixup & 0x1ffffe0) << 7 |
46 (*((UINT32 *)Fixup + 1) & 0x3ffc00) >> 10;
47 Tmp1 = *((UINT32 *)Fixup + 2) & 0x1ffffe0;
48 Tmp2 = *((UINT32 *)Fixup + 3) & 0x3ffc00;
49 Value = Value | (Tmp1 << 27) | (Tmp2 << 42);
52 *(UINT32 *)Fixup = (*(UINT32 *)Fixup & ~0x1ffffe0) | (((Value >> 12) & 0xfffff) << 5);
53 if (*FixupData !=
NULL) {
55 *(UINT32 *)(*FixupData) = *(UINT32 *)Fixup;
56 *FixupData = *FixupData +
sizeof (UINT32);
59 Fixup +=
sizeof (UINT32);
60 *(UINT32 *)Fixup = (*(UINT32 *)Fixup & ~0x3ffc00) | ((Value & 0xfff) << 10);
61 if (*FixupData !=
NULL) {
63 *(UINT32 *)(*FixupData) = *(UINT32 *)Fixup;
64 *FixupData = *FixupData +
sizeof (UINT32);
67 Fixup +=
sizeof (UINT32);
68 *(UINT32 *)Fixup = (*(UINT32 *)Fixup & ~0x1ffffe0) | (((Value >> 32) & 0xfffff) << 5);
69 if (*FixupData !=
NULL) {
71 *(UINT32 *)(*FixupData) = *(UINT32 *)Fixup;
72 *FixupData = *FixupData +
sizeof (UINT32);
75 Fixup +=
sizeof (UINT32);
76 *(UINT32 *)Fixup = (*(UINT32 *)Fixup & ~0x3ffc00) | (((Value >> 52) & 0xfff) << 10);
77 if (*FixupData !=
NULL) {
79 *(UINT32 *)(*FixupData) = *(UINT32 *)Fixup;
80 *FixupData = *FixupData +
sizeof (UINT32);
107 if (Machine == IMAGE_FILE_MACHINE_LOONGARCH64) {
131 IN OUT CHAR8 **FixupData,
RETURN_STATUS PeHotRelocateImageEx(IN UINT16 *Reloc, IN OUT CHAR8 *Fixup, IN OUT CHAR8 **FixupData, IN UINT64 Adjust)
RETURN_STATUS PeCoffLoaderRelocateImageEx(IN UINT16 *Reloc, IN OUT CHAR8 *Fixup, IN OUT CHAR8 **FixupData, IN UINT64 Adjust)
BOOLEAN PeCoffLoaderImageFormatSupported(IN UINT16 Machine)
#define RETURN_UNSUPPORTED
#define ALIGN_POINTER(Pointer, Alignment)