mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-12-27 13:30:45 -05:00
While the GCC and Clang compilers already define __ASSEMBLER__ automatically when compiling assembly code, __ASSEMBLY__ is a macro that only gets defined by the Makefiles in the kernel. This can be very confusing when switching between userspace and kernelspace coding, or when dealing with uapi headers that rather should use __ASSEMBLER__ instead. So let's standardize now on the __ASSEMBLER__ macro that is provided by the compilers. This is a mostly mechanical patch (done with a simple "sed -i" statement), except for the following files where comments with mis-spelled macros were tweaked manually: arch/arm64/include/asm/stacktrace/frame.h arch/arm64/include/asm/kvm_ptrauth.h arch/arm64/include/asm/debug-monitors.h arch/arm64/include/asm/esr.h arch/arm64/include/asm/scs.h arch/arm64/include/asm/memory.h Signed-off-by: Thomas Huth <thuth@redhat.com> Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
60 lines
1.5 KiB
C
60 lines
1.5 KiB
C
/* SPDX-License-Identifier: GPL-2.0 */
|
|
|
|
#ifndef __ASM_IMAGE_H
|
|
#define __ASM_IMAGE_H
|
|
|
|
#define ARM64_IMAGE_MAGIC "ARM\x64"
|
|
|
|
#define ARM64_IMAGE_FLAG_BE_SHIFT 0
|
|
#define ARM64_IMAGE_FLAG_PAGE_SIZE_SHIFT (ARM64_IMAGE_FLAG_BE_SHIFT + 1)
|
|
#define ARM64_IMAGE_FLAG_PHYS_BASE_SHIFT \
|
|
(ARM64_IMAGE_FLAG_PAGE_SIZE_SHIFT + 2)
|
|
#define ARM64_IMAGE_FLAG_BE_MASK 0x1
|
|
#define ARM64_IMAGE_FLAG_PAGE_SIZE_MASK 0x3
|
|
#define ARM64_IMAGE_FLAG_PHYS_BASE_MASK 0x1
|
|
|
|
#define ARM64_IMAGE_FLAG_LE 0
|
|
#define ARM64_IMAGE_FLAG_BE 1
|
|
#define ARM64_IMAGE_FLAG_PAGE_SIZE_4K 1
|
|
#define ARM64_IMAGE_FLAG_PAGE_SIZE_16K 2
|
|
#define ARM64_IMAGE_FLAG_PAGE_SIZE_64K 3
|
|
#define ARM64_IMAGE_FLAG_PHYS_BASE 1
|
|
|
|
#ifndef __ASSEMBLER__
|
|
|
|
#define arm64_image_flag_field(flags, field) \
|
|
(((flags) >> field##_SHIFT) & field##_MASK)
|
|
|
|
/*
|
|
* struct arm64_image_header - arm64 kernel image header
|
|
* See Documentation/arch/arm64/booting.rst for details
|
|
*
|
|
* @code0: Executable code, or
|
|
* @mz_header alternatively used for part of MZ header
|
|
* @code1: Executable code
|
|
* @text_offset: Image load offset
|
|
* @image_size: Effective Image size
|
|
* @flags: kernel flags
|
|
* @reserved: reserved
|
|
* @magic: Magic number
|
|
* @reserved5: reserved, or
|
|
* @pe_header: alternatively used for PE COFF offset
|
|
*/
|
|
|
|
struct arm64_image_header {
|
|
__le32 code0;
|
|
__le32 code1;
|
|
__le64 text_offset;
|
|
__le64 image_size;
|
|
__le64 flags;
|
|
__le64 res2;
|
|
__le64 res3;
|
|
__le64 res4;
|
|
__le32 magic;
|
|
__le32 res5;
|
|
};
|
|
|
|
#endif /* __ASSEMBLER__ */
|
|
|
|
#endif /* __ASM_IMAGE_H */
|