summaryrefslogtreecommitdiffstats
path: root/arch/arm/include/asm/assembler64.h
blob: 26182aa5f68766dc4755bbca253ca657370f6b02 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#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 */