1 /* SPDX-License-Identifier: GPL-2.0 */ 2 /* 3 * Copyright (C) 2020-2022 Loongson Technology 4 */ 5 6 #include <linux/pe.h> 7 #include <linux/sizes.h> 8 9 .macro __EFI_PE_HEADER 10 .long PE_MAGIC 11 .Lcoff_header: 12 .short IMAGE_FILE_MACHINE_LOONGARCH64 13 .short .Lsection_count 14 .long 0 15 .long 0 16 .long 0 17 .short .Lsection_table - .Loptional_h 18 .short IMAGE_FILE_DEBUG_STRIPPED | \ 19 IMAGE_FILE_EXECUTABLE_IMAGE | 20 IMAGE_FILE_LINE_NUMS_STRIPPED 21 22 .Loptional_header: 23 .short PE_OPT_MAGIC_PE32PLUS 24 .byte 0x02 25 .byte 0x14 26 .long __inittext_end - .Lefi_header_ 27 .long _kernel_vsize 28 .long 0 29 .long __efistub_efi_pe_entry - _head 30 .long .Lefi_header_end - _head 31 32 .Lextra_header_fields: 33 .quad 0 34 .long PECOFF_SEGMENT_ALIGN 35 .long PECOFF_FILE_ALIGN 36 .short 0 37 .short 0 38 .short LINUX_EFISTUB_MAJOR_VERSION 39 .short LINUX_EFISTUB_MINOR_VERSION 40 .short 0 41 .short 0 42 .long 0 43 44 .long _end - _head 45 46 /* Everything before the kernel image 47 .long .Lefi_header_end - _head 48 .long 0 49 .short IMAGE_SUBSYSTEM_EFI_APPLICATIO 50 .short 0 51 .quad 0 52 .quad 0 53 .quad 0 54 .quad 0 55 .long 0 56 .long (.Lsection_table - .) / 8 57 58 .quad 0 59 .quad 0 60 .quad 0 61 .quad 0 62 .quad 0 63 .quad 0 64 65 /* Section table */ 66 .Lsection_table: 67 .ascii ".text\0\0\0" 68 .long __inittext_end - .Lefi_header_ 69 .long .Lefi_header_end - _head 70 .long __inittext_end - .Lefi_header_ 71 .long .Lefi_header_end - _head 72 73 .long 0 74 .long 0 75 .short 0 76 .short 0 77 .long IMAGE_SCN_CNT_CODE | \ 78 IMAGE_SCN_MEM_READ | \ 79 IMAGE_SCN_MEM_EXECUTE 80 81 .ascii ".data\0\0\0" 82 .long _kernel_vsize 83 .long __initdata_begin - _head 84 .long _kernel_rsize 85 .long __initdata_begin - _head 86 87 .long 0 88 .long 0 89 .short 0 90 .short 0 91 .long IMAGE_SCN_CNT_INITIALIZED_DATA 92 IMAGE_SCN_MEM_READ | \ 93 IMAGE_SCN_MEM_WRITE 94 95 .set .Lsection_count, (. - .Lsectio 96 97 .balign 0x10000 98 .Lefi_header_end: 99 .endm
Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.