hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/include/linux/pe.h
....@@ -1,18 +1,7 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * Copyright 2011 Red Hat, Inc.
34 * All rights reserved.
4
- *
5
- * This program is free software; you can redistribute it and/or modify
6
- * it under the terms of the GNU General Public License as published by
7
- * the Free Software Foundation; version 2 of the License.
8
- *
9
- * This program is distributed in the hope that it will be useful,
10
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
11
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
- * GNU General Public License for more details.
13
- *
14
- * You should have received a copy of the GNU General Public License
15
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
165 *
176 * Author(s): Peter Jones <pjones@redhat.com>
187 */
....@@ -20,6 +9,27 @@
209 #define __LINUX_PE_H
2110
2211 #include <linux/types.h>
12
+
13
+/*
14
+ * Linux EFI stub v1.0 adds the following functionality:
15
+ * - Loading initrd from the LINUX_EFI_INITRD_MEDIA_GUID device path,
16
+ * - Loading/starting the kernel from firmware that targets a different
17
+ * machine type, via the entrypoint exposed in the .compat PE/COFF section.
18
+ *
19
+ * The recommended way of loading and starting v1.0 or later kernels is to use
20
+ * the LoadImage() and StartImage() EFI boot services, and expose the initrd
21
+ * via the LINUX_EFI_INITRD_MEDIA_GUID device path.
22
+ *
23
+ * Versions older than v1.0 support initrd loading via the image load options
24
+ * (using initrd=, limited to the volume from which the kernel itself was
25
+ * loaded), or via arch specific means (bootparams, DT, etc).
26
+ *
27
+ * On x86, LoadImage() and StartImage() can be omitted if the EFI handover
28
+ * protocol is implemented, which can be inferred from the version,
29
+ * handover_offset and xloadflags fields in the bootparams structure.
30
+ */
31
+#define LINUX_EFISTUB_MAJOR_VERSION 0x1
32
+#define LINUX_EFISTUB_MINOR_VERSION 0x0
2333
2434 #define MZ_MAGIC 0x5a4d /* "MZ" */
2535
....@@ -45,6 +55,9 @@
4555 #define IMAGE_FILE_MACHINE_POWERPC 0x01f0
4656 #define IMAGE_FILE_MACHINE_POWERPCFP 0x01f1
4757 #define IMAGE_FILE_MACHINE_R4000 0x0166
58
+#define IMAGE_FILE_MACHINE_RISCV32 0x5032
59
+#define IMAGE_FILE_MACHINE_RISCV64 0x5064
60
+#define IMAGE_FILE_MACHINE_RISCV128 0x5128
4861 #define IMAGE_FILE_MACHINE_SH3 0x01a2
4962 #define IMAGE_FILE_MACHINE_SH3DSP 0x01a3
5063 #define IMAGE_FILE_MACHINE_SH3E 0x01a4
....@@ -166,7 +179,7 @@
166179 uint16_t oem_info; /* oem specific */
167180 uint16_t reserved1[10]; /* reserved */
168181 uint32_t peaddr; /* address of pe header */
169
- char message[64]; /* message to print */
182
+ char message[]; /* message to print */
170183 };
171184
172185 struct mz_reloc {