summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/assembler64.h
blob: 615b2576718015546dcb311d90d151017c42e114 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
/* SPDX-License-Identifier: GPL-2.0-only */

#ifndef __ASM_ARCH_ASSEMBLY_H
#define __ASM_ARCH_ASSEMBLY_H

#ifndef __ASSEMBLY__
#error "Only include this from assembly code"
#endif

/*
 * Branch according to exception level
 */
.macro  switch_el, xreg, el3_label, el2_label, el1_label
	mrs	\xreg, CurrentEL
	cmp	\xreg, 0xc
	b.eq	\el3_label
	cmp	\xreg, 0x8
	b.eq	\el2_label
	cmp	\xreg, 0x4
	b.eq	\el1_label
.endm

#endif /* __ASM_ARCH_ASSEMBLY_H */