xref: /linux/arch/arm64/include/asm/hyp_image.h (revision ab25464bdabd45f283cc1194e332040f89071106)
1*ab25464bSDavid Brazdil /* SPDX-License-Identifier: GPL-2.0 */
2*ab25464bSDavid Brazdil /*
3*ab25464bSDavid Brazdil  * Copyright (C) 2020 Google LLC.
4*ab25464bSDavid Brazdil  * Written by David Brazdil <dbrazdil@google.com>
5*ab25464bSDavid Brazdil  */
6*ab25464bSDavid Brazdil 
7*ab25464bSDavid Brazdil #ifndef __ARM64_HYP_IMAGE_H__
8*ab25464bSDavid Brazdil #define __ARM64_HYP_IMAGE_H__
9*ab25464bSDavid Brazdil 
10*ab25464bSDavid Brazdil #ifdef LINKER_SCRIPT
11*ab25464bSDavid Brazdil 
12*ab25464bSDavid Brazdil /*
13*ab25464bSDavid Brazdil  * KVM nVHE ELF section names are prefixed with .hyp, to separate them
14*ab25464bSDavid Brazdil  * from the kernel proper.
15*ab25464bSDavid Brazdil  */
16*ab25464bSDavid Brazdil #define HYP_SECTION_NAME(NAME)	.hyp##NAME
17*ab25464bSDavid Brazdil 
18*ab25464bSDavid Brazdil /* Defines an ELF hyp section from input section @NAME and its subsections. */
19*ab25464bSDavid Brazdil #define HYP_SECTION(NAME) \
20*ab25464bSDavid Brazdil 	HYP_SECTION_NAME(NAME) : { *(NAME NAME##.*) }
21*ab25464bSDavid Brazdil 
22*ab25464bSDavid Brazdil #endif /* LINKER_SCRIPT */
23*ab25464bSDavid Brazdil 
24*ab25464bSDavid Brazdil #endif /* __ARM64_HYP_IMAGE_H__ */
25