[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v16 01/10] PE: Add LoongArch definitions
From: |
Xiaotian Wu |
Subject: |
[PATCH v16 01/10] PE: Add LoongArch definitions |
Date: |
Thu, 27 Apr 2023 15:43:00 +0800 |
Add PE machine types [1] and relocation types [2] for LoongArch to
the current in-repo definitions.
[1]:
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#machine-types
[2]:
https://learn.microsoft.com/en-us/windows/win32/debug/pe-format#base-relocation-types
Signed-off-by: Zhou Yang <zhouyang@loongson.cn>
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
---
include/grub/efi/pe32.h | 36 ++++++++++++++++++++----------------
1 file changed, 20 insertions(+), 16 deletions(-)
diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h
index 98c4ff177..101859af1 100644
--- a/include/grub/efi/pe32.h
+++ b/include/grub/efi/pe32.h
@@ -88,6 +88,8 @@ struct grub_pe32_coff_header
#define GRUB_PE32_MACHINE_X86_64 0x8664
#define GRUB_PE32_MACHINE_ARMTHUMB_MIXED 0x01c2
#define GRUB_PE32_MACHINE_ARM64 0xAA64
+#define GRUB_PE32_MACHINE_LOONGARCH32 0x6232
+#define GRUB_PE32_MACHINE_LOONGARCH64 0x6264
#define GRUB_PE32_MACHINE_RISCV32 0x5032
#define GRUB_PE32_MACHINE_RISCV64 0x5064
@@ -291,22 +293,24 @@ struct grub_pe32_fixup_block
#define GRUB_PE32_FIXUP_ENTRY(type, offset) (((type) << 12) | (offset))
-#define GRUB_PE32_REL_BASED_ABSOLUTE 0
-#define GRUB_PE32_REL_BASED_HIGH 1
-#define GRUB_PE32_REL_BASED_LOW 2
-#define GRUB_PE32_REL_BASED_HIGHLOW 3
-#define GRUB_PE32_REL_BASED_HIGHADJ 4
-#define GRUB_PE32_REL_BASED_MIPS_JMPADDR 5
-#define GRUB_PE32_REL_BASED_ARM_MOV32A 5
-#define GRUB_PE32_REL_BASED_RISCV_HI20 5
-#define GRUB_PE32_REL_BASED_SECTION 6
-#define GRUB_PE32_REL_BASED_REL 7
-#define GRUB_PE32_REL_BASED_ARM_MOV32T 7
-#define GRUB_PE32_REL_BASED_RISCV_LOW12I 7
-#define GRUB_PE32_REL_BASED_RISCV_LOW12S 8
-#define GRUB_PE32_REL_BASED_IA64_IMM64 9
-#define GRUB_PE32_REL_BASED_DIR64 10
-#define GRUB_PE32_REL_BASED_HIGH3ADJ 11
+#define GRUB_PE32_REL_BASED_ABSOLUTE 0
+#define GRUB_PE32_REL_BASED_HIGH 1
+#define GRUB_PE32_REL_BASED_LOW 2
+#define GRUB_PE32_REL_BASED_HIGHLOW 3
+#define GRUB_PE32_REL_BASED_HIGHADJ 4
+#define GRUB_PE32_REL_BASED_MIPS_JMPADDR 5
+#define GRUB_PE32_REL_BASED_ARM_MOV32A 5
+#define GRUB_PE32_REL_BASED_RISCV_HI20 5
+#define GRUB_PE32_REL_BASED_SECTION 6
+#define GRUB_PE32_REL_BASED_REL 7
+#define GRUB_PE32_REL_BASED_ARM_MOV32T 7
+#define GRUB_PE32_REL_BASED_RISCV_LOW12I 7
+#define GRUB_PE32_REL_BASED_RISCV_LOW12S 8
+#define GRUB_PE32_REL_BASED_LOONGARCH32_MARK_LA 8
+#define GRUB_PE32_REL_BASED_LOONGARCH64_MARK_LA 8
+#define GRUB_PE32_REL_BASED_IA64_IMM64 9
+#define GRUB_PE32_REL_BASED_DIR64 10
+#define GRUB_PE32_REL_BASED_HIGH3ADJ 11
struct grub_pe32_symbol
{
--
2.40.0
- [PATCH v16 00/10] Add support for LoongArch, Xiaotian Wu, 2023/04/27
- [PATCH v16 01/10] PE: Add LoongArch definitions,
Xiaotian Wu <=
- [PATCH v16 02/10] ELF: Add LoongArch definitions, Xiaotian Wu, 2023/04/27
- [PATCH v16 03/10] LoongArch: Add setjmp implementation, Xiaotian Wu, 2023/04/27
- [PATCH v16 04/10] LoongArch: Add early startup code, Xiaotian Wu, 2023/04/27
- [PATCH v16 05/10] LoongArch: Add support for ELF psABI v1.00 relocations, Xiaotian Wu, 2023/04/27
- [PATCH v16 06/10] LoongArch: Add support for ELF psABI v2.00 relocations, Xiaotian Wu, 2023/04/27
- [PATCH v16 07/10] LoongArch: Add auxiliary files, Xiaotian Wu, 2023/04/27
- [PATCH v16 08/10] LoongArch: Add to build system, Xiaotian Wu, 2023/04/27
- [PATCH v16 09/10] tests: Fix timezone inconsistency in squashfs_test, Xiaotian Wu, 2023/04/27
- [PATCH v16 10/10] tests: Add LoongArch to various test cases, Xiaotian Wu, 2023/04/27