blob: 7d1944cae5f5cedd0aa43bbaa082e80bb4ac2548 [file] [log] [blame]
Soby Mathewc6820d12016-05-09 17:49:55 +01001/*
Antonio Nino Diaz128de8d2018-08-07 19:59:49 +01002 * Copyright (c) 2016-2018, ARM Limited and Contributors. All rights reserved.
Soby Mathewc6820d12016-05-09 17:49:55 +01003 *
dp-armfa3cf0b2017-05-03 09:38:09 +01004 * SPDX-License-Identifier: BSD-3-Clause
Soby Mathewc6820d12016-05-09 17:49:55 +01005 */
6
Antonio Nino Diaz864ca6f2018-10-31 15:25:35 +00007#ifndef ARCH_HELPERS_H
8#define ARCH_HELPERS_H
Soby Mathewc6820d12016-05-09 17:49:55 +01009
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +000010#include <arch.h>
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010011#include <cdefs.h>
Soby Mathewc6820d12016-05-09 17:49:55 +010012#include <stdint.h>
Antonio Nino Diaz4b32e622018-08-16 16:52:57 +010013#include <string.h>
Soby Mathewc6820d12016-05-09 17:49:55 +010014
15/**********************************************************************
16 * Macros which create inline functions to read or write CPU system
17 * registers
18 *********************************************************************/
19
20#define _DEFINE_COPROCR_WRITE_FUNC(_name, coproc, opc1, CRn, CRm, opc2) \
21static inline void write_## _name(u_register_t v) \
22{ \
23 __asm__ volatile ("mcr "#coproc","#opc1",%0,"#CRn","#CRm","#opc2 : : "r" (v));\
24}
25
26#define _DEFINE_COPROCR_READ_FUNC(_name, coproc, opc1, CRn, CRm, opc2) \
27static inline u_register_t read_ ## _name(void) \
28{ \
29 u_register_t v; \
30 __asm__ volatile ("mrc "#coproc","#opc1",%0,"#CRn","#CRm","#opc2 : "=r" (v));\
31 return v; \
32}
33
34/*
35 * The undocumented %Q and %R extended asm are used to implemented the below
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +000036 * 64 bit `mrrc` and `mcrr` instructions.
Soby Mathewc6820d12016-05-09 17:49:55 +010037 */
Soby Mathewc6820d12016-05-09 17:49:55 +010038
39#define _DEFINE_COPROCR_WRITE_FUNC_64(_name, coproc, opc1, CRm) \
40static inline void write64_## _name(uint64_t v) \
41{ \
42 __asm__ volatile ("mcrr "#coproc","#opc1", %Q0, %R0,"#CRm : : "r" (v));\
43}
44
45#define _DEFINE_COPROCR_READ_FUNC_64(_name, coproc, opc1, CRm) \
46static inline uint64_t read64_## _name(void) \
47{ uint64_t v; \
48 __asm__ volatile ("mrrc "#coproc","#opc1", %Q0, %R0,"#CRm : "=r" (v));\
49 return v; \
50}
51
52#define _DEFINE_SYSREG_READ_FUNC(_name, _reg_name) \
53static inline u_register_t read_ ## _name(void) \
54{ \
55 u_register_t v; \
56 __asm__ volatile ("mrs %0, " #_reg_name : "=r" (v)); \
57 return v; \
58}
59
60#define _DEFINE_SYSREG_WRITE_FUNC(_name, _reg_name) \
61static inline void write_ ## _name(u_register_t v) \
62{ \
63 __asm__ volatile ("msr " #_reg_name ", %0" : : "r" (v)); \
64}
65
66#define _DEFINE_SYSREG_WRITE_CONST_FUNC(_name, _reg_name) \
67static inline void write_ ## _name(const u_register_t v) \
68{ \
69 __asm__ volatile ("msr " #_reg_name ", %0" : : "i" (v)); \
70}
71
72/* Define read function for coproc register */
73#define DEFINE_COPROCR_READ_FUNC(_name, ...) \
74 _DEFINE_COPROCR_READ_FUNC(_name, __VA_ARGS__)
75
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +000076/* Define write function for coproc register */
77#define DEFINE_COPROCR_WRITE_FUNC(_name, ...) \
78 _DEFINE_COPROCR_WRITE_FUNC(_name, __VA_ARGS__)
79
Soby Mathewc6820d12016-05-09 17:49:55 +010080/* Define read & write function for coproc register */
81#define DEFINE_COPROCR_RW_FUNCS(_name, ...) \
82 _DEFINE_COPROCR_READ_FUNC(_name, __VA_ARGS__) \
83 _DEFINE_COPROCR_WRITE_FUNC(_name, __VA_ARGS__)
84
85/* Define 64 bit read function for coproc register */
86#define DEFINE_COPROCR_READ_FUNC_64(_name, ...) \
87 _DEFINE_COPROCR_READ_FUNC_64(_name, __VA_ARGS__)
88
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +000089/* Define 64 bit write function for coproc register */
90#define DEFINE_COPROCR_WRITE_FUNC_64(_name, ...) \
91 _DEFINE_COPROCR_WRITE_FUNC_64(_name, __VA_ARGS__)
92
Soby Mathewc6820d12016-05-09 17:49:55 +010093/* Define 64 bit read & write function for coproc register */
94#define DEFINE_COPROCR_RW_FUNCS_64(_name, ...) \
95 _DEFINE_COPROCR_READ_FUNC_64(_name, __VA_ARGS__) \
96 _DEFINE_COPROCR_WRITE_FUNC_64(_name, __VA_ARGS__)
97
98/* Define read & write function for system register */
99#define DEFINE_SYSREG_RW_FUNCS(_name) \
100 _DEFINE_SYSREG_READ_FUNC(_name, _name) \
101 _DEFINE_SYSREG_WRITE_FUNC(_name, _name)
102
103/**********************************************************************
104 * Macros to create inline functions for tlbi operations
105 *********************************************************************/
106
107#define _DEFINE_TLBIOP_FUNC(_op, coproc, opc1, CRn, CRm, opc2) \
108static inline void tlbi##_op(void) \
109{ \
110 u_register_t v = 0; \
111 __asm__ volatile ("mcr "#coproc","#opc1",%0,"#CRn","#CRm","#opc2 : : "r" (v));\
112}
113
Antonio Nino Diazab37d152018-11-22 15:38:05 +0000114#define _DEFINE_BPIOP_FUNC(_op, coproc, opc1, CRn, CRm, opc2) \
115static inline void bpi##_op(void) \
Antonio Nino Diazac998032017-02-27 17:23:54 +0000116{ \
117 u_register_t v = 0; \
118 __asm__ volatile ("mcr "#coproc","#opc1",%0,"#CRn","#CRm","#opc2 : : "r" (v));\
119}
120
Soby Mathewc6820d12016-05-09 17:49:55 +0100121#define _DEFINE_TLBIOP_PARAM_FUNC(_op, coproc, opc1, CRn, CRm, opc2) \
122static inline void tlbi##_op(u_register_t v) \
123{ \
124 __asm__ volatile ("mcr "#coproc","#opc1",%0,"#CRn","#CRm","#opc2 : : "r" (v));\
125}
126
127/* Define function for simple TLBI operation */
128#define DEFINE_TLBIOP_FUNC(_op, ...) \
129 _DEFINE_TLBIOP_FUNC(_op, __VA_ARGS__)
130
131/* Define function for TLBI operation with register parameter */
132#define DEFINE_TLBIOP_PARAM_FUNC(_op, ...) \
133 _DEFINE_TLBIOP_PARAM_FUNC(_op, __VA_ARGS__)
134
Antonio Nino Diazac998032017-02-27 17:23:54 +0000135/* Define function for simple BPI operation */
136#define DEFINE_BPIOP_FUNC(_op, ...) \
137 _DEFINE_BPIOP_FUNC(_op, __VA_ARGS__)
138
Soby Mathewc6820d12016-05-09 17:49:55 +0100139/**********************************************************************
140 * Macros to create inline functions for DC operations
141 *********************************************************************/
142#define _DEFINE_DCOP_PARAM_FUNC(_op, coproc, opc1, CRn, CRm, opc2) \
143static inline void dc##_op(u_register_t v) \
144{ \
145 __asm__ volatile ("mcr "#coproc","#opc1",%0,"#CRn","#CRm","#opc2 : : "r" (v));\
146}
147
148/* Define function for DC operation with register parameter */
149#define DEFINE_DCOP_PARAM_FUNC(_op, ...) \
150 _DEFINE_DCOP_PARAM_FUNC(_op, __VA_ARGS__)
151
152/**********************************************************************
153 * Macros to create inline functions for system instructions
154 *********************************************************************/
155 /* Define function for simple system instruction */
156#define DEFINE_SYSOP_FUNC(_op) \
157static inline void _op(void) \
158{ \
159 __asm__ (#_op); \
160}
161
162
163/* Define function for system instruction with type specifier */
164#define DEFINE_SYSOP_TYPE_FUNC(_op, _type) \
165static inline void _op ## _type(void) \
166{ \
167 __asm__ (#_op " " #_type); \
168}
169
170/* Define function for system instruction with register parameter */
171#define DEFINE_SYSOP_TYPE_PARAM_FUNC(_op, _type) \
172static inline void _op ## _type(u_register_t v) \
173{ \
174 __asm__ (#_op " " #_type ", %0" : : "r" (v)); \
175}
176
177void flush_dcache_range(uintptr_t addr, size_t size);
178void clean_dcache_range(uintptr_t addr, size_t size);
179void inv_dcache_range(uintptr_t addr, size_t size);
180
Antonio Nino Diaze40306b2017-01-13 15:03:07 +0000181void dcsw_op_louis(u_register_t op_type);
182void dcsw_op_all(u_register_t op_type);
183
Yatharth Kocharf528faf2016-06-28 16:58:26 +0100184void disable_mmu_secure(void);
185void disable_mmu_icache_secure(void);
186
Soby Mathewc6820d12016-05-09 17:49:55 +0100187DEFINE_SYSOP_FUNC(wfi)
188DEFINE_SYSOP_FUNC(wfe)
189DEFINE_SYSOP_FUNC(sev)
190DEFINE_SYSOP_TYPE_FUNC(dsb, sy)
191DEFINE_SYSOP_TYPE_FUNC(dmb, sy)
Yatharth Kochar2694cba2016-11-14 12:00:41 +0000192DEFINE_SYSOP_TYPE_FUNC(dmb, st)
Jeenu Viswambharan1aa2db32018-09-05 14:23:27 +0100193
194/* dmb ld is not valid for armv7/thumb machines */
195#if ARM_ARCH_MAJOR != 7
Yatharth Kochar2694cba2016-11-14 12:00:41 +0000196DEFINE_SYSOP_TYPE_FUNC(dmb, ld)
Jeenu Viswambharan1aa2db32018-09-05 14:23:27 +0100197#endif
198
Soby Mathewc6820d12016-05-09 17:49:55 +0100199DEFINE_SYSOP_TYPE_FUNC(dsb, ish)
Antonio Nino Diazac998032017-02-27 17:23:54 +0000200DEFINE_SYSOP_TYPE_FUNC(dsb, ishst)
Soby Mathewc6820d12016-05-09 17:49:55 +0100201DEFINE_SYSOP_TYPE_FUNC(dmb, ish)
Jeenu Viswambharan62505072017-09-22 08:32:09 +0100202DEFINE_SYSOP_TYPE_FUNC(dmb, ishst)
Soby Mathewc6820d12016-05-09 17:49:55 +0100203DEFINE_SYSOP_FUNC(isb)
204
Yatharth Kocharf528faf2016-06-28 16:58:26 +0100205void __dead2 smc(uint32_t r0, uint32_t r1, uint32_t r2, uint32_t r3,
206 uint32_t r4, uint32_t r5, uint32_t r6, uint32_t r7);
207
Soby Mathewc6820d12016-05-09 17:49:55 +0100208DEFINE_SYSREG_RW_FUNCS(spsr)
209DEFINE_SYSREG_RW_FUNCS(cpsr)
210
211/*******************************************************************************
212 * System register accessor prototypes
213 ******************************************************************************/
214DEFINE_COPROCR_READ_FUNC(mpidr, MPIDR)
215DEFINE_COPROCR_READ_FUNC(midr, MIDR)
Dimitris Papastamosdda48b02017-10-17 14:03:14 +0100216DEFINE_COPROCR_READ_FUNC(id_pfr0, ID_PFR0)
Soby Mathewc6820d12016-05-09 17:49:55 +0100217DEFINE_COPROCR_READ_FUNC(id_pfr1, ID_PFR1)
218DEFINE_COPROCR_READ_FUNC(isr, ISR)
219DEFINE_COPROCR_READ_FUNC(clidr, CLIDR)
220DEFINE_COPROCR_READ_FUNC_64(cntpct, CNTPCT_64)
221
222DEFINE_COPROCR_RW_FUNCS(scr, SCR)
223DEFINE_COPROCR_RW_FUNCS(ctr, CTR)
224DEFINE_COPROCR_RW_FUNCS(sctlr, SCTLR)
Etienne Carriere70a004b2017-11-05 22:56:03 +0100225DEFINE_COPROCR_RW_FUNCS(actlr, ACTLR)
Soby Mathewc6820d12016-05-09 17:49:55 +0100226DEFINE_COPROCR_RW_FUNCS(hsctlr, HSCTLR)
227DEFINE_COPROCR_RW_FUNCS(hcr, HCR)
228DEFINE_COPROCR_RW_FUNCS(hcptr, HCPTR)
229DEFINE_COPROCR_RW_FUNCS(cntfrq, CNTFRQ)
230DEFINE_COPROCR_RW_FUNCS(cnthctl, CNTHCTL)
231DEFINE_COPROCR_RW_FUNCS(mair0, MAIR0)
232DEFINE_COPROCR_RW_FUNCS(mair1, MAIR1)
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000233DEFINE_COPROCR_RW_FUNCS(hmair0, HMAIR0)
Soby Mathewc6820d12016-05-09 17:49:55 +0100234DEFINE_COPROCR_RW_FUNCS(ttbcr, TTBCR)
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000235DEFINE_COPROCR_RW_FUNCS(htcr, HTCR)
Soby Mathewc6820d12016-05-09 17:49:55 +0100236DEFINE_COPROCR_RW_FUNCS(ttbr0, TTBR0)
237DEFINE_COPROCR_RW_FUNCS_64(ttbr0, TTBR0_64)
238DEFINE_COPROCR_RW_FUNCS(ttbr1, TTBR1)
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000239DEFINE_COPROCR_RW_FUNCS_64(httbr, HTTBR_64)
Soby Mathewc6820d12016-05-09 17:49:55 +0100240DEFINE_COPROCR_RW_FUNCS(vpidr, VPIDR)
241DEFINE_COPROCR_RW_FUNCS(vmpidr, VMPIDR)
242DEFINE_COPROCR_RW_FUNCS_64(vttbr, VTTBR_64)
243DEFINE_COPROCR_RW_FUNCS_64(ttbr1, TTBR1_64)
244DEFINE_COPROCR_RW_FUNCS_64(cntvoff, CNTVOFF_64)
245DEFINE_COPROCR_RW_FUNCS(csselr, CSSELR)
David Cunadofee86532017-04-13 22:38:29 +0100246DEFINE_COPROCR_RW_FUNCS(hstr, HSTR)
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000247DEFINE_COPROCR_RW_FUNCS(cnthp_ctl_el2, CNTHP_CTL)
248DEFINE_COPROCR_RW_FUNCS(cnthp_tval_el2, CNTHP_TVAL)
249DEFINE_COPROCR_RW_FUNCS_64(cnthp_cval_el2, CNTHP_CVAL_64)
Soby Mathewc6820d12016-05-09 17:49:55 +0100250
251DEFINE_COPROCR_RW_FUNCS(icc_sre_el1, ICC_SRE)
252DEFINE_COPROCR_RW_FUNCS(icc_sre_el2, ICC_HSRE)
253DEFINE_COPROCR_RW_FUNCS(icc_sre_el3, ICC_MSRE)
254DEFINE_COPROCR_RW_FUNCS(icc_pmr_el1, ICC_PMR)
Jeenu Viswambharanb1e957e2017-09-22 08:32:09 +0100255DEFINE_COPROCR_RW_FUNCS(icc_rpr_el1, ICC_RPR)
Soby Mathewc6820d12016-05-09 17:49:55 +0100256DEFINE_COPROCR_RW_FUNCS(icc_igrpen1_el3, ICC_MGRPEN1)
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000257DEFINE_COPROCR_RW_FUNCS(icc_igrpen1_el1, ICC_IGRPEN1)
Soby Mathewc6820d12016-05-09 17:49:55 +0100258DEFINE_COPROCR_RW_FUNCS(icc_igrpen0_el1, ICC_IGRPEN0)
259DEFINE_COPROCR_RW_FUNCS(icc_hppir0_el1, ICC_HPPIR0)
260DEFINE_COPROCR_RW_FUNCS(icc_hppir1_el1, ICC_HPPIR1)
261DEFINE_COPROCR_RW_FUNCS(icc_iar0_el1, ICC_IAR0)
262DEFINE_COPROCR_RW_FUNCS(icc_iar1_el1, ICC_IAR1)
263DEFINE_COPROCR_RW_FUNCS(icc_eoir0_el1, ICC_EOIR0)
264DEFINE_COPROCR_RW_FUNCS(icc_eoir1_el1, ICC_EOIR1)
Jeenu Viswambharanab14e9b2017-09-22 08:32:09 +0100265DEFINE_COPROCR_RW_FUNCS_64(icc_sgi0r_el1, ICC_SGI0R_EL1_64)
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000266DEFINE_COPROCR_WRITE_FUNC_64(icc_sgi1r, ICC_SGI1R_EL1_64)
Soby Mathewc6820d12016-05-09 17:49:55 +0100267
David Cunado5f55e282016-10-31 17:37:34 +0000268DEFINE_COPROCR_RW_FUNCS(hdcr, HDCR)
David Cunadoc14b08e2016-11-25 00:21:59 +0000269DEFINE_COPROCR_RW_FUNCS(cnthp_ctl, CNTHP_CTL)
David Cunado5f55e282016-10-31 17:37:34 +0000270DEFINE_COPROCR_READ_FUNC(pmcr, PMCR)
271
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000272/*
273 * Address translation
274 */
275DEFINE_COPROCR_WRITE_FUNC(ats1cpr, ATS1CPR)
276DEFINE_COPROCR_WRITE_FUNC(ats1hr, ATS1HR)
Douglas Raillard77414632018-08-21 12:54:45 +0100277DEFINE_COPROCR_RW_FUNCS_64(par, PAR_64)
278
Etienne Carriere70a004b2017-11-05 22:56:03 +0100279DEFINE_COPROCR_RW_FUNCS(nsacr, NSACR)
280
281/* AArch32 coproc registers for 32bit MMU descriptor support */
282DEFINE_COPROCR_RW_FUNCS(prrr, PRRR)
283DEFINE_COPROCR_RW_FUNCS(nmrr, NMRR)
284DEFINE_COPROCR_RW_FUNCS(dacr, DACR)
285
Dimitris Papastamosdda48b02017-10-17 14:03:14 +0100286DEFINE_COPROCR_RW_FUNCS(amcntenset0, AMCNTENSET0)
287DEFINE_COPROCR_RW_FUNCS(amcntenset1, AMCNTENSET1)
288DEFINE_COPROCR_RW_FUNCS(amcntenclr0, AMCNTENCLR0)
289DEFINE_COPROCR_RW_FUNCS(amcntenclr1, AMCNTENCLR1)
290
Dimitris Papastamoseaf3e6d2017-11-28 13:47:06 +0000291DEFINE_COPROCR_RW_FUNCS_64(amevcntr00, AMEVCNTR00)
292DEFINE_COPROCR_RW_FUNCS_64(amevcntr01, AMEVCNTR01)
293DEFINE_COPROCR_RW_FUNCS_64(amevcntr02, AMEVCNTR02)
294DEFINE_COPROCR_RW_FUNCS_64(amevcntr03, AMEVCNTR03)
295
Soby Mathewc6820d12016-05-09 17:49:55 +0100296/*
297 * TLBI operation prototypes
298 */
299DEFINE_TLBIOP_FUNC(all, TLBIALL)
300DEFINE_TLBIOP_FUNC(allis, TLBIALLIS)
301DEFINE_TLBIOP_PARAM_FUNC(mva, TLBIMVA)
302DEFINE_TLBIOP_PARAM_FUNC(mvaa, TLBIMVAA)
Antonio Nino Diazac998032017-02-27 17:23:54 +0000303DEFINE_TLBIOP_PARAM_FUNC(mvaais, TLBIMVAAIS)
Antonio Nino Diaz128de8d2018-08-07 19:59:49 +0100304DEFINE_TLBIOP_PARAM_FUNC(mvahis, TLBIMVAHIS)
Antonio Nino Diazac998032017-02-27 17:23:54 +0000305
306/*
307 * BPI operation prototypes.
308 */
309DEFINE_BPIOP_FUNC(allis, BPIALLIS)
Soby Mathewc6820d12016-05-09 17:49:55 +0100310
311/*
312 * DC operation prototypes
313 */
314DEFINE_DCOP_PARAM_FUNC(civac, DCCIMVAC)
315DEFINE_DCOP_PARAM_FUNC(ivac, DCIMVAC)
316DEFINE_DCOP_PARAM_FUNC(cvac, DCCMVAC)
317
318/* Previously defined accessor functions with incomplete register names */
319#define dsb() dsbsy()
Etienne Carrierea2579862017-11-05 22:57:29 +0100320#define dmb() dmbsy()
Soby Mathewc6820d12016-05-09 17:49:55 +0100321
Jeenu Viswambharan1aa2db32018-09-05 14:23:27 +0100322/* dmb ld is not valid for armv7/thumb machines, so alias it to dmb */
323#if ARM_ARCH_MAJOR == 7
324#define dmbld() dmb()
325#endif
326
Soby Mathewc6820d12016-05-09 17:49:55 +0100327#define IS_IN_SECURE() \
328 (GET_NS_BIT(read_scr()) == 0)
329
Antonio Nino Diaz128de8d2018-08-07 19:59:49 +0100330#define IS_IN_HYP() (GET_M32(read_cpsr()) == MODE32_hyp)
331#define IS_IN_SVC() (GET_M32(read_cpsr()) == MODE32_svc)
332#define IS_IN_MON() (GET_M32(read_cpsr()) == MODE32_mon)
333#define IS_IN_EL2() IS_IN_HYP()
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000334/* If EL3 is AArch32, then secure PL1 and monitor mode correspond to EL3 */
Soby Mathewc6820d12016-05-09 17:49:55 +0100335#define IS_IN_EL3() \
336 ((GET_M32(read_cpsr()) == MODE32_mon) || \
337 (IS_IN_SECURE() && (GET_M32(read_cpsr()) != MODE32_usr)))
338
Douglas Raillard77414632018-08-21 12:54:45 +0100339static inline unsigned int get_current_el(void)
340{
341 if (IS_IN_EL3()) {
342 return 3U;
343 } else if (IS_IN_EL2()) {
344 return 2U;
345 } else {
346 return 1U;
347 }
348}
349
Soby Mathewc6820d12016-05-09 17:49:55 +0100350/* Macros for compatibility with AArch64 system registers */
351#define read_mpidr_el1() read_mpidr()
352
353#define read_scr_el3() read_scr()
354#define write_scr_el3(_v) write_scr(_v)
355
356#define read_hcr_el2() read_hcr()
357#define write_hcr_el2(_v) write_hcr(_v)
358
359#define read_cpacr_el1() read_cpacr()
360#define write_cpacr_el1(_v) write_cpacr(_v)
361
362#define read_cntfrq_el0() read_cntfrq()
363#define write_cntfrq_el0(_v) write_cntfrq(_v)
364#define read_isr_el1() read_isr()
365
366#define read_cntpct_el0() read64_cntpct()
367
Yatharth Kocharf528faf2016-06-28 16:58:26 +0100368#define read_ctr_el0() read_ctr()
369
Antonio Nino Diaz8257f5b2018-11-22 15:53:17 +0000370#define write_icc_sgi0r_el1(_v) write64_icc_sgi0r_el1(_v)
371
372#define read_daif() read_cpsr()
373#define write_daif(flags) write_cpsr(flags)
374
375#define read_cnthp_cval_el2() read64_cnthp_cval_el2()
376#define write_cnthp_cval_el2(v) write64_cnthp_cval_el2(v)
377
378#define read_amcntenset0_el0() read_amcntenset0()
379#define read_amcntenset1_el0() read_amcntenset1()
Jeenu Viswambharanab14e9b2017-09-22 08:32:09 +0100380
Antonio Nino Diaz864ca6f2018-10-31 15:25:35 +0000381#endif /* ARCH_HELPERS_H */