1508514edSDave Martin /*
2508514edSDave Martin  * opcodes-virt.h: Opcode definitions for the ARM virtualization extensions
3508514edSDave Martin  * Copyright (C) 2012  Linaro Limited
4508514edSDave Martin  *
5508514edSDave Martin  * This program is free software; you can redistribute it and/or modify
6508514edSDave Martin  * it under the terms of the GNU General Public License as published by
7508514edSDave Martin  * the Free Software Foundation; either version 2 of the License, or
8508514edSDave Martin  * (at your option) any later version.
9508514edSDave Martin  *
10508514edSDave Martin  * This program is distributed in the hope that it will be useful,
11508514edSDave Martin  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12508514edSDave Martin  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13508514edSDave Martin  * GNU General Public License for more details.
14508514edSDave Martin  *
15508514edSDave Martin  * You should have received a copy of the GNU General Public License along
16508514edSDave Martin  * with this program; if not, write to the Free Software Foundation, Inc.,
17508514edSDave Martin  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
18508514edSDave Martin  */
19508514edSDave Martin #ifndef __ASM_ARM_OPCODES_VIRT_H
20508514edSDave Martin #define __ASM_ARM_OPCODES_VIRT_H
21508514edSDave Martin 
22508514edSDave Martin #include <asm/opcodes.h>
23508514edSDave Martin 
24508514edSDave Martin #define __HVC(imm16) __inst_arm_thumb32(				\
25508514edSDave Martin 	0xE1400070 | (((imm16) & 0xFFF0) << 4) | ((imm16) & 0x000F),	\
26508514edSDave Martin 	0xF7E08000 | (((imm16) & 0xF000) << 4) | ((imm16) & 0x0FFF)	\
27508514edSDave Martin )
28508514edSDave Martin 
29b9a348cbSMarc Zyngier #define __ERET	__inst_arm_thumb32(					\
30b9a348cbSMarc Zyngier 	0xE160006E,							\
31b9a348cbSMarc Zyngier 	0xF3DE8F00							\
32b9a348cbSMarc Zyngier )
33b9a348cbSMarc Zyngier 
34b9a348cbSMarc Zyngier #define __MSR_ELR_HYP(regnum)	__inst_arm_thumb32(			\
35b9a348cbSMarc Zyngier 	0xE12EF300 | regnum,						\
36b9a348cbSMarc Zyngier 	0xF3808E30 | (regnum << 16)					\
37b9a348cbSMarc Zyngier )
38b9a348cbSMarc Zyngier 
39508514edSDave Martin #endif /* ! __ASM_ARM_OPCODES_VIRT_H */
40