RTEMS 6.1-rc2
Loading...
Searching...
No Matches
aarch32-system-registers.h
Go to the documentation of this file.
1/* SPDX-License-Identifier: BSD-2-Clause */
2
12/*
13 * Copyright (C) 2020 embedded brains GmbH & Co. KG
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 *
24 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
28 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
29 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
30 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
31 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
32 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
33 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34 * POSSIBILITY OF SUCH DAMAGE.
35 */
36
37#ifndef _RTEMS_SCORE_AARCH32_SYSTEM_REGISTERS_H
38#define _RTEMS_SCORE_AARCH32_SYSTEM_REGISTERS_H
39
40#include <stdint.h>
41
42#ifdef __cplusplus
43extern "C" {
44#endif
45
63/* ACTLR, Auxiliary Control Register */
64
65static inline uint32_t _AArch32_Read_actlr( void )
66{
67 uint32_t value;
68
69 __asm__ volatile (
70 "mrc p15, 0, %0, c1, c0, 1" : "=&r" ( value ) : : "memory"
71 );
72
73 return value;
74}
75
76static inline void _AArch32_Write_actlr( uint32_t value )
77{
78 __asm__ volatile (
79 "mcr p15, 0, %0, c1, c0, 1" : : "r" ( value ) : "memory"
80 );
81}
82
83/* ACTLR2, Auxiliary Control Register 2 */
84
85static inline uint32_t _AArch32_Read_actlr2( void )
86{
87 uint32_t value;
88
89 __asm__ volatile (
90 "mrc p15, 0, %0, c1, c0, 3" : "=&r" ( value ) : : "memory"
91 );
92
93 return value;
94}
95
96static inline void _AArch32_Write_actlr2( uint32_t value )
97{
98 __asm__ volatile (
99 "mcr p15, 0, %0, c1, c0, 3" : : "r" ( value ) : "memory"
100 );
101}
102
103/* ADFSR, Auxiliary Data Fault Status Register */
104
105static inline uint32_t _AArch32_Read_adfsr( void )
106{
107 uint32_t value;
108
109 __asm__ volatile (
110 "mrc p15, 0, %0, c5, c1, 0" : "=&r" ( value ) : : "memory"
111 );
112
113 return value;
114}
115
116static inline void _AArch32_Write_adfsr( uint32_t value )
117{
118 __asm__ volatile (
119 "mcr p15, 0, %0, c5, c1, 0" : : "r" ( value ) : "memory"
120 );
121}
122
123/* AIDR, Auxiliary ID Register */
124
125static inline uint32_t _AArch32_Read_aidr( void )
126{
127 uint32_t value;
128
129 __asm__ volatile (
130 "mrc p15, 1, %0, c0, c0, 7" : "=&r" ( value ) : : "memory"
131 );
132
133 return value;
134}
135
136/* AIFSR, Auxiliary Instruction Fault Status Register */
137
138static inline uint32_t _AArch32_Read_aifsr( void )
139{
140 uint32_t value;
141
142 __asm__ volatile (
143 "mrc p15, 0, %0, c5, c1, 1" : "=&r" ( value ) : : "memory"
144 );
145
146 return value;
147}
148
149static inline void _AArch32_Write_aifsr( uint32_t value )
150{
151 __asm__ volatile (
152 "mcr p15, 0, %0, c5, c1, 1" : : "r" ( value ) : "memory"
153 );
154}
155
156/* AMAIR0, Auxiliary Memory Attribute Indirection Register 0 */
157
158static inline uint32_t _AArch32_Read_amair0( void )
159{
160 uint32_t value;
161
162 __asm__ volatile (
163 "mrc p15, 0, %0, c10, c3, 0" : "=&r" ( value ) : : "memory"
164 );
165
166 return value;
167}
168
169static inline void _AArch32_Write_amair0( uint32_t value )
170{
171 __asm__ volatile (
172 "mcr p15, 0, %0, c10, c3, 0" : : "r" ( value ) : "memory"
173 );
174}
175
176/* AMAIR1, Auxiliary Memory Attribute Indirection Register 1 */
177
178static inline uint32_t _AArch32_Read_amair1( void )
179{
180 uint32_t value;
181
182 __asm__ volatile (
183 "mrc p15, 0, %0, c10, c3, 1" : "=&r" ( value ) : : "memory"
184 );
185
186 return value;
187}
188
189static inline void _AArch32_Write_amair1( uint32_t value )
190{
191 __asm__ volatile (
192 "mcr p15, 0, %0, c10, c3, 1" : : "r" ( value ) : "memory"
193 );
194}
195
196/* APSR, Application Program Status Register */
197
198#define AARCH32_APSR_GE( _val ) ( ( _val ) << 16 )
199#define AARCH32_APSR_GE_SHIFT 16
200#define AARCH32_APSR_GE_MASK 0xf0000U
201#define AARCH32_APSR_GE_GET( _reg ) \
202 ( ( ( _reg ) >> 16 ) & 0xfU )
203
204#define AARCH32_APSR_Q 0x8000000U
205
206#define AARCH32_APSR_V 0x10000000U
207
208#define AARCH32_APSR_C 0x20000000U
209
210#define AARCH32_APSR_Z 0x40000000U
211
212#define AARCH32_APSR_N 0x80000000U
213
214/* ATS12NSOPR, Address Translate Stages 1 and 2 Non-secure Only PL1 Read */
215
216static inline void _AArch32_Write_ats12nsopr( uint32_t value )
217{
218 __asm__ volatile (
219 "mcr p15, 0, %0, c7, c8, 4" : : "r" ( value ) : "memory"
220 );
221}
222
223/* ATS12NSOPW, Address Translate Stages 1 and 2 Non-secure Only PL1 Write */
224
225static inline void _AArch32_Write_ats12nsopw( uint32_t value )
226{
227 __asm__ volatile (
228 "mcr p15, 0, %0, c7, c8, 5" : : "r" ( value ) : "memory"
229 );
230}
231
232/* ATS12NSOUR, Address Translate Stages 1 and 2 Non-secure Only Unprivileged Read */
233
234static inline void _AArch32_Write_ats12nsour( uint32_t value )
235{
236 __asm__ volatile (
237 "mcr p15, 0, %0, c7, c8, 6" : : "r" ( value ) : "memory"
238 );
239}
240
241/* ATS12NSOUW, Address Translate Stages 1 and 2 Non-secure Only Unprivileged Write */
242
243static inline void _AArch32_Write_ats12nsouw( uint32_t value )
244{
245 __asm__ volatile (
246 "mcr p15, 0, %0, c7, c8, 7" : : "r" ( value ) : "memory"
247 );
248}
249
250/* ATS1CPR, Address Translate Stage 1 Current state PL1 Read */
251
252static inline void _AArch32_Write_ats1cpr( uint32_t value )
253{
254 __asm__ volatile (
255 "mcr p15, 0, %0, c7, c8, 0" : : "r" ( value ) : "memory"
256 );
257}
258
259/* ATS1CPRP, Address Translate Stage 1 Current state PL1 Read PAN */
260
261static inline void _AArch32_Write_ats1cprp( uint32_t value )
262{
263 __asm__ volatile (
264 "mcr p15, 0, %0, c7, c9, 0" : : "r" ( value ) : "memory"
265 );
266}
267
268/* ATS1CPW, Address Translate Stage 1 Current state PL1 Write */
269
270static inline void _AArch32_Write_ats1cpw( uint32_t value )
271{
272 __asm__ volatile (
273 "mcr p15, 0, %0, c7, c8, 1" : : "r" ( value ) : "memory"
274 );
275}
276
277/* ATS1CPWP, Address Translate Stage 1 Current state PL1 Write PAN */
278
279static inline void _AArch32_Write_ats1cpwp( uint32_t value )
280{
281 __asm__ volatile (
282 "mcr p15, 0, %0, c7, c9, 1" : : "r" ( value ) : "memory"
283 );
284}
285
286/* ATS1CUR, Address Translate Stage 1 Current state Unprivileged Read */
287
288static inline void _AArch32_Write_ats1cur( uint32_t value )
289{
290 __asm__ volatile (
291 "mcr p15, 0, %0, c7, c8, 2" : : "r" ( value ) : "memory"
292 );
293}
294
295/* ATS1CUW, Address Translate Stage 1 Current state Unprivileged Write */
296
297static inline void _AArch32_Write_ats1cuw( uint32_t value )
298{
299 __asm__ volatile (
300 "mcr p15, 0, %0, c7, c8, 3" : : "r" ( value ) : "memory"
301 );
302}
303
304/* ATS1HR, Address Translate Stage 1 Hyp mode Read */
305
306static inline void _AArch32_Write_ats1hr( uint32_t value )
307{
308 __asm__ volatile (
309 "mcr p15, 4, %0, c7, c8, 0" : : "r" ( value ) : "memory"
310 );
311}
312
313/* ATS1HW, Address Translate Stage 1 Hyp mode Write */
314
315static inline void _AArch32_Write_ats1hw( uint32_t value )
316{
317 __asm__ volatile (
318 "mcr p15, 4, %0, c7, c8, 1" : : "r" ( value ) : "memory"
319 );
320}
321
322/* BPIALL, Branch Predictor Invalidate All */
323
324static inline void _AArch32_Write_bpiall( uint32_t value )
325{
326 __asm__ volatile (
327 "mcr p15, 0, %0, c7, c5, 6" : : "r" ( value ) : "memory"
328 );
329}
330
331/* BPIALLIS, Branch Predictor Invalidate All, Inner Shareable */
332
333static inline void _AArch32_Write_bpiallis( uint32_t value )
334{
335 __asm__ volatile (
336 "mcr p15, 0, %0, c7, c1, 6" : : "r" ( value ) : "memory"
337 );
338}
339
340/* BPIMVA, Branch Predictor Invalidate by VA */
341
342static inline void _AArch32_Write_bpimva( uint32_t value )
343{
344 __asm__ volatile (
345 "mcr p15, 0, %0, c7, c5, 7" : : "r" ( value ) : "memory"
346 );
347}
348
349/* CCSIDR, Current Cache Size ID Register */
350
351#define AARCH32_CCSIDR_LINESIZE( _val ) ( ( _val ) << 0 )
352#define AARCH32_CCSIDR_LINESIZE_SHIFT 0
353#define AARCH32_CCSIDR_LINESIZE_MASK 0x7U
354#define AARCH32_CCSIDR_LINESIZE_GET( _reg ) \
355 ( ( ( _reg ) >> 0 ) & 0x7U )
356
357#define AARCH32_CCSIDR_ASSOCIATIVITY_0( _val ) ( ( _val ) << 3 )
358#define AARCH32_CCSIDR_ASSOCIATIVITY_SHIFT_0 3
359#define AARCH32_CCSIDR_ASSOCIATIVITY_MASK_0 0x1ff8U
360#define AARCH32_CCSIDR_ASSOCIATIVITY_GET_0( _reg ) \
361 ( ( ( _reg ) >> 3 ) & 0x3ffU )
362
363#define AARCH32_CCSIDR_ASSOCIATIVITY_1( _val ) ( ( _val ) << 3 )
364#define AARCH32_CCSIDR_ASSOCIATIVITY_SHIFT_1 3
365#define AARCH32_CCSIDR_ASSOCIATIVITY_MASK_1 0xfffff8U
366#define AARCH32_CCSIDR_ASSOCIATIVITY_GET_1( _reg ) \
367 ( ( ( _reg ) >> 3 ) & 0x1fffffU )
368
369#define AARCH32_CCSIDR_NUMSETS( _val ) ( ( _val ) << 13 )
370#define AARCH32_CCSIDR_NUMSETS_SHIFT 13
371#define AARCH32_CCSIDR_NUMSETS_MASK 0xfffe000U
372#define AARCH32_CCSIDR_NUMSETS_GET( _reg ) \
373 ( ( ( _reg ) >> 13 ) & 0x7fffU )
374
375static inline uint32_t _AArch32_Read_ccsidr( void )
376{
377 uint32_t value;
378
379 __asm__ volatile (
380 "mrc p15, 1, %0, c0, c0, 0" : "=&r" ( value ) : : "memory"
381 );
382
383 return value;
384}
385
386/* CCSIDR2, Current Cache Size ID Register 2 */
387
388#define AARCH32_CCSIDR2_NUMSETS( _val ) ( ( _val ) << 0 )
389#define AARCH32_CCSIDR2_NUMSETS_SHIFT 0
390#define AARCH32_CCSIDR2_NUMSETS_MASK 0xffffffU
391#define AARCH32_CCSIDR2_NUMSETS_GET( _reg ) \
392 ( ( ( _reg ) >> 0 ) & 0xffffffU )
393
394static inline uint32_t _AArch32_Read_ccsidr2( void )
395{
396 uint32_t value;
397
398 __asm__ volatile (
399 "mrc p15, 1, %0, c0, c0, 2" : "=&r" ( value ) : : "memory"
400 );
401
402 return value;
403}
404
405/* CFPRCTX, Control Flow Prediction Restriction by Context */
406
407#define AARCH32_CFPRCTX_ASID( _val ) ( ( _val ) << 0 )
408#define AARCH32_CFPRCTX_ASID_SHIFT 0
409#define AARCH32_CFPRCTX_ASID_MASK 0xffU
410#define AARCH32_CFPRCTX_ASID_GET( _reg ) \
411 ( ( ( _reg ) >> 0 ) & 0xffU )
412
413#define AARCH32_CFPRCTX_GASID 0x100U
414
415#define AARCH32_CFPRCTX_VMID( _val ) ( ( _val ) << 16 )
416#define AARCH32_CFPRCTX_VMID_SHIFT 16
417#define AARCH32_CFPRCTX_VMID_MASK 0xff0000U
418#define AARCH32_CFPRCTX_VMID_GET( _reg ) \
419 ( ( ( _reg ) >> 16 ) & 0xffU )
420
421#define AARCH32_CFPRCTX_EL( _val ) ( ( _val ) << 24 )
422#define AARCH32_CFPRCTX_EL_SHIFT 24
423#define AARCH32_CFPRCTX_EL_MASK 0x3000000U
424#define AARCH32_CFPRCTX_EL_GET( _reg ) \
425 ( ( ( _reg ) >> 24 ) & 0x3U )
426
427#define AARCH32_CFPRCTX_NS 0x4000000U
428
429#define AARCH32_CFPRCTX_GVMID 0x8000000U
430
431static inline void _AArch32_Write_cfprctx( uint32_t value )
432{
433 __asm__ volatile (
434 "mcr p15, 0, %0, c7, c3, 4" : : "r" ( value ) : "memory"
435 );
436}
437
438/* CLIDR, Cache Level ID Register */
439
440#define AARCH32_CLIDR_LOUIS( _val ) ( ( _val ) << 21 )
441#define AARCH32_CLIDR_LOUIS_SHIFT 21
442#define AARCH32_CLIDR_LOUIS_MASK 0xe00000U
443#define AARCH32_CLIDR_LOUIS_GET( _reg ) \
444 ( ( ( _reg ) >> 21 ) & 0x7U )
445
446#define AARCH32_CLIDR_LOC( _val ) ( ( _val ) << 24 )
447#define AARCH32_CLIDR_LOC_SHIFT 24
448#define AARCH32_CLIDR_LOC_MASK 0x7000000U
449#define AARCH32_CLIDR_LOC_GET( _reg ) \
450 ( ( ( _reg ) >> 24 ) & 0x7U )
451
452#define AARCH32_CLIDR_LOUU( _val ) ( ( _val ) << 27 )
453#define AARCH32_CLIDR_LOUU_SHIFT 27
454#define AARCH32_CLIDR_LOUU_MASK 0x38000000U
455#define AARCH32_CLIDR_LOUU_GET( _reg ) \
456 ( ( ( _reg ) >> 27 ) & 0x7U )
457
458#define AARCH32_CLIDR_ICB( _val ) ( ( _val ) << 30 )
459#define AARCH32_CLIDR_ICB_SHIFT 30
460#define AARCH32_CLIDR_ICB_MASK 0xc0000000U
461#define AARCH32_CLIDR_ICB_GET( _reg ) \
462 ( ( ( _reg ) >> 30 ) & 0x3U )
463
464static inline uint32_t _AArch32_Read_clidr( void )
465{
466 uint32_t value;
467
468 __asm__ volatile (
469 "mrc p15, 1, %0, c0, c0, 1" : "=&r" ( value ) : : "memory"
470 );
471
472 return value;
473}
474
475/* CONTEXTIDR, Context ID Register */
476
477#define AARCH32_CONTEXTIDR_ASID( _val ) ( ( _val ) << 0 )
478#define AARCH32_CONTEXTIDR_ASID_SHIFT 0
479#define AARCH32_CONTEXTIDR_ASID_MASK 0xffU
480#define AARCH32_CONTEXTIDR_ASID_GET( _reg ) \
481 ( ( ( _reg ) >> 0 ) & 0xffU )
482
483#define AARCH32_CONTEXTIDR_PROCID( _val ) ( ( _val ) << 8 )
484#define AARCH32_CONTEXTIDR_PROCID_SHIFT 8
485#define AARCH32_CONTEXTIDR_PROCID_MASK 0xffffff00U
486#define AARCH32_CONTEXTIDR_PROCID_GET( _reg ) \
487 ( ( ( _reg ) >> 8 ) & 0xffffffU )
488
489static inline uint32_t _AArch32_Read_contextidr( void )
490{
491 uint32_t value;
492
493 __asm__ volatile (
494 "mrc p15, 0, %0, c13, c0, 1" : "=&r" ( value ) : : "memory"
495 );
496
497 return value;
498}
499
500static inline void _AArch32_Write_contextidr( uint32_t value )
501{
502 __asm__ volatile (
503 "mcr p15, 0, %0, c13, c0, 1" : : "r" ( value ) : "memory"
504 );
505}
506
507/* CP15DMB, Data Memory Barrier System instruction */
508
509static inline void _AArch32_Write_cp15dmb( uint32_t value )
510{
511 __asm__ volatile (
512 "mcr p15, 0, %0, c7, c10, 5" : : "r" ( value ) : "memory"
513 );
514}
515
516/* CP15DSB, Data Synchronization Barrier System instruction */
517
518static inline void _AArch32_Write_cp15dsb( uint32_t value )
519{
520 __asm__ volatile (
521 "mcr p15, 0, %0, c7, c10, 4" : : "r" ( value ) : "memory"
522 );
523}
524
525/* CP15ISB, Instruction Synchronization Barrier System instruction */
526
527static inline void _AArch32_Write_cp15isb( uint32_t value )
528{
529 __asm__ volatile (
530 "mcr p15, 0, %0, c7, c5, 4" : : "r" ( value ) : "memory"
531 );
532}
533
534/* CPACR, Architectural Feature Access Control Register */
535
536#define AARCH32_CPACR_CP10( _val ) ( ( _val ) << 20 )
537#define AARCH32_CPACR_CP10_SHIFT 20
538#define AARCH32_CPACR_CP10_MASK 0x300000U
539#define AARCH32_CPACR_CP10_GET( _reg ) \
540 ( ( ( _reg ) >> 20 ) & 0x3U )
541
542#define AARCH32_CPACR_CP11( _val ) ( ( _val ) << 22 )
543#define AARCH32_CPACR_CP11_SHIFT 22
544#define AARCH32_CPACR_CP11_MASK 0xc00000U
545#define AARCH32_CPACR_CP11_GET( _reg ) \
546 ( ( ( _reg ) >> 22 ) & 0x3U )
547
548#define AARCH32_CPACR_TRCDIS 0x10000000U
549
550#define AARCH32_CPACR_ASEDIS 0x80000000U
551
552static inline uint32_t _AArch32_Read_cpacr( void )
553{
554 uint32_t value;
555
556 __asm__ volatile (
557 "mrc p15, 0, %0, c1, c0, 2" : "=&r" ( value ) : : "memory"
558 );
559
560 return value;
561}
562
563static inline void _AArch32_Write_cpacr( uint32_t value )
564{
565 __asm__ volatile (
566 "mcr p15, 0, %0, c1, c0, 2" : : "r" ( value ) : "memory"
567 );
568}
569
570/* CPSR, Current Program Status Register */
571
572#define AARCH32_CPSR_M( _val ) ( ( _val ) << 0 )
573#define AARCH32_CPSR_M_SHIFT 0
574#define AARCH32_CPSR_M_MASK 0xfU
575#define AARCH32_CPSR_M_GET( _reg ) \
576 ( ( ( _reg ) >> 0 ) & 0xfU )
577
578#define AARCH32_CPSR_F 0x40U
579
580#define AARCH32_CPSR_I 0x80U
581
582#define AARCH32_CPSR_A 0x100U
583
584#define AARCH32_CPSR_E 0x200U
585
586#define AARCH32_CPSR_GE( _val ) ( ( _val ) << 16 )
587#define AARCH32_CPSR_GE_SHIFT 16
588#define AARCH32_CPSR_GE_MASK 0xf0000U
589#define AARCH32_CPSR_GE_GET( _reg ) \
590 ( ( ( _reg ) >> 16 ) & 0xfU )
591
592#define AARCH32_CPSR_DIT 0x200000U
593
594#define AARCH32_CPSR_PAN 0x400000U
595
596#define AARCH32_CPSR_SSBS 0x800000U
597
598#define AARCH32_CPSR_Q 0x8000000U
599
600#define AARCH32_CPSR_V 0x10000000U
601
602#define AARCH32_CPSR_C 0x20000000U
603
604#define AARCH32_CPSR_Z 0x40000000U
605
606#define AARCH32_CPSR_N 0x80000000U
607
608/* CPPRCTX, Cache Prefetch Prediction Restriction by Context */
609
610#define AARCH32_CPPRCTX_ASID( _val ) ( ( _val ) << 0 )
611#define AARCH32_CPPRCTX_ASID_SHIFT 0
612#define AARCH32_CPPRCTX_ASID_MASK 0xffU
613#define AARCH32_CPPRCTX_ASID_GET( _reg ) \
614 ( ( ( _reg ) >> 0 ) & 0xffU )
615
616#define AARCH32_CPPRCTX_GASID 0x100U
617
618#define AARCH32_CPPRCTX_VMID( _val ) ( ( _val ) << 16 )
619#define AARCH32_CPPRCTX_VMID_SHIFT 16
620#define AARCH32_CPPRCTX_VMID_MASK 0xff0000U
621#define AARCH32_CPPRCTX_VMID_GET( _reg ) \
622 ( ( ( _reg ) >> 16 ) & 0xffU )
623
624#define AARCH32_CPPRCTX_EL( _val ) ( ( _val ) << 24 )
625#define AARCH32_CPPRCTX_EL_SHIFT 24
626#define AARCH32_CPPRCTX_EL_MASK 0x3000000U
627#define AARCH32_CPPRCTX_EL_GET( _reg ) \
628 ( ( ( _reg ) >> 24 ) & 0x3U )
629
630#define AARCH32_CPPRCTX_NS 0x4000000U
631
632#define AARCH32_CPPRCTX_GVMID 0x8000000U
633
634static inline void _AArch32_Write_cpprctx( uint32_t value )
635{
636 __asm__ volatile (
637 "mcr p15, 0, %0, c7, c3, 7" : : "r" ( value ) : "memory"
638 );
639}
640
641/* CSSELR, Cache Size Selection Register */
642
643#define AARCH32_CSSELR_IND 0x1U
644
645#define AARCH32_CSSELR_LEVEL( _val ) ( ( _val ) << 1 )
646#define AARCH32_CSSELR_LEVEL_SHIFT 1
647#define AARCH32_CSSELR_LEVEL_MASK 0xeU
648#define AARCH32_CSSELR_LEVEL_GET( _reg ) \
649 ( ( ( _reg ) >> 1 ) & 0x7U )
650
651static inline uint32_t _AArch32_Read_csselr( void )
652{
653 uint32_t value;
654
655 __asm__ volatile (
656 "mrc p15, 2, %0, c0, c0, 0" : "=&r" ( value ) : : "memory"
657 );
658
659 return value;
660}
661
662static inline void _AArch32_Write_csselr( uint32_t value )
663{
664 __asm__ volatile (
665 "mcr p15, 2, %0, c0, c0, 0" : : "r" ( value ) : "memory"
666 );
667}
668
669/* CTR, Cache Type Register */
670
671#define AARCH32_CTR_IMINLINE( _val ) ( ( _val ) << 0 )
672#define AARCH32_CTR_IMINLINE_SHIFT 0
673#define AARCH32_CTR_IMINLINE_MASK 0xfU
674#define AARCH32_CTR_IMINLINE_GET( _reg ) \
675 ( ( ( _reg ) >> 0 ) & 0xfU )
676
677#define AARCH32_CTR_L1IP( _val ) ( ( _val ) << 14 )
678#define AARCH32_CTR_L1IP_SHIFT 14
679#define AARCH32_CTR_L1IP_MASK 0xc000U
680#define AARCH32_CTR_L1IP_GET( _reg ) \
681 ( ( ( _reg ) >> 14 ) & 0x3U )
682
683#define AARCH32_CTR_DMINLINE( _val ) ( ( _val ) << 16 )
684#define AARCH32_CTR_DMINLINE_SHIFT 16
685#define AARCH32_CTR_DMINLINE_MASK 0xf0000U
686#define AARCH32_CTR_DMINLINE_GET( _reg ) \
687 ( ( ( _reg ) >> 16 ) & 0xfU )
688
689#define AARCH32_CTR_ERG( _val ) ( ( _val ) << 20 )
690#define AARCH32_CTR_ERG_SHIFT 20
691#define AARCH32_CTR_ERG_MASK 0xf00000U
692#define AARCH32_CTR_ERG_GET( _reg ) \
693 ( ( ( _reg ) >> 20 ) & 0xfU )
694
695#define AARCH32_CTR_CWG( _val ) ( ( _val ) << 24 )
696#define AARCH32_CTR_CWG_SHIFT 24
697#define AARCH32_CTR_CWG_MASK 0xf000000U
698#define AARCH32_CTR_CWG_GET( _reg ) \
699 ( ( ( _reg ) >> 24 ) & 0xfU )
700
701#define AARCH32_CTR_IDC 0x10000000U
702
703#define AARCH32_CTR_DIC 0x20000000U
704
705static inline uint32_t _AArch32_Read_ctr( void )
706{
707 uint32_t value;
708
709 __asm__ volatile (
710 "mrc p15, 0, %0, c0, c0, 1" : "=&r" ( value ) : : "memory"
711 );
712
713 return value;
714}
715
716/* DACR, Domain Access Control Register */
717
718static inline uint32_t _AArch32_Read_dacr( void )
719{
720 uint32_t value;
721
722 __asm__ volatile (
723 "mrc p15, 0, %0, c3, c0, 0" : "=&r" ( value ) : : "memory"
724 );
725
726 return value;
727}
728
729static inline void _AArch32_Write_dacr( uint32_t value )
730{
731 __asm__ volatile (
732 "mcr p15, 0, %0, c3, c0, 0" : : "r" ( value ) : "memory"
733 );
734}
735
736/* DCCIMVAC, Data Cache line Clean and Invalidate by VA to PoC */
737
738static inline void _AArch32_Write_dccimvac( uint32_t value )
739{
740 __asm__ volatile (
741 "mcr p15, 0, %0, c7, c14, 1" : : "r" ( value ) : "memory"
742 );
743}
744
745/* DCCISW, Data Cache line Clean and Invalidate by Set/Way */
746
747#define AARCH32_DCCISW_LEVEL( _val ) ( ( _val ) << 1 )
748#define AARCH32_DCCISW_LEVEL_SHIFT 1
749#define AARCH32_DCCISW_LEVEL_MASK 0xeU
750#define AARCH32_DCCISW_LEVEL_GET( _reg ) \
751 ( ( ( _reg ) >> 1 ) & 0x7U )
752
753#define AARCH32_DCCISW_SETWAY( _val ) ( ( _val ) << 4 )
754#define AARCH32_DCCISW_SETWAY_SHIFT 4
755#define AARCH32_DCCISW_SETWAY_MASK 0xfffffff0U
756#define AARCH32_DCCISW_SETWAY_GET( _reg ) \
757 ( ( ( _reg ) >> 4 ) & 0xfffffffU )
758
759static inline void _AArch32_Write_dccisw( uint32_t value )
760{
761 __asm__ volatile (
762 "mcr p15, 0, %0, c7, c14, 2" : : "r" ( value ) : "memory"
763 );
764}
765
766/* DCCMVAC, Data Cache line Clean by VA to PoC */
767
768static inline void _AArch32_Write_dccmvac( uint32_t value )
769{
770 __asm__ volatile (
771 "mcr p15, 0, %0, c7, c10, 1" : : "r" ( value ) : "memory"
772 );
773}
774
775/* DCCMVAU, Data Cache line Clean by VA to PoU */
776
777static inline void _AArch32_Write_dccmvau( uint32_t value )
778{
779 __asm__ volatile (
780 "mcr p15, 0, %0, c7, c11, 1" : : "r" ( value ) : "memory"
781 );
782}
783
784/* DCCSW, Data Cache line Clean by Set/Way */
785
786#define AARCH32_DCCSW_LEVEL( _val ) ( ( _val ) << 1 )
787#define AARCH32_DCCSW_LEVEL_SHIFT 1
788#define AARCH32_DCCSW_LEVEL_MASK 0xeU
789#define AARCH32_DCCSW_LEVEL_GET( _reg ) \
790 ( ( ( _reg ) >> 1 ) & 0x7U )
791
792#define AARCH32_DCCSW_SETWAY( _val ) ( ( _val ) << 4 )
793#define AARCH32_DCCSW_SETWAY_SHIFT 4
794#define AARCH32_DCCSW_SETWAY_MASK 0xfffffff0U
795#define AARCH32_DCCSW_SETWAY_GET( _reg ) \
796 ( ( ( _reg ) >> 4 ) & 0xfffffffU )
797
798static inline void _AArch32_Write_dccsw( uint32_t value )
799{
800 __asm__ volatile (
801 "mcr p15, 0, %0, c7, c10, 2" : : "r" ( value ) : "memory"
802 );
803}
804
805/* DCIMVAC, Data Cache line Invalidate by VA to PoC */
806
807static inline void _AArch32_Write_dcimvac( uint32_t value )
808{
809 __asm__ volatile (
810 "mcr p15, 0, %0, c7, c6, 1" : : "r" ( value ) : "memory"
811 );
812}
813
814/* DCISW, Data Cache line Invalidate by Set/Way */
815
816#define AARCH32_DCISW_LEVEL( _val ) ( ( _val ) << 1 )
817#define AARCH32_DCISW_LEVEL_SHIFT 1
818#define AARCH32_DCISW_LEVEL_MASK 0xeU
819#define AARCH32_DCISW_LEVEL_GET( _reg ) \
820 ( ( ( _reg ) >> 1 ) & 0x7U )
821
822#define AARCH32_DCISW_SETWAY( _val ) ( ( _val ) << 4 )
823#define AARCH32_DCISW_SETWAY_SHIFT 4
824#define AARCH32_DCISW_SETWAY_MASK 0xfffffff0U
825#define AARCH32_DCISW_SETWAY_GET( _reg ) \
826 ( ( ( _reg ) >> 4 ) & 0xfffffffU )
827
828static inline void _AArch32_Write_dcisw( uint32_t value )
829{
830 __asm__ volatile (
831 "mcr p15, 0, %0, c7, c6, 2" : : "r" ( value ) : "memory"
832 );
833}
834
835/* DFAR, Data Fault Address Register */
836
837static inline uint32_t _AArch32_Read_dfar( void )
838{
839 uint32_t value;
840
841 __asm__ volatile (
842 "mrc p15, 0, %0, c6, c0, 0" : "=&r" ( value ) : : "memory"
843 );
844
845 return value;
846}
847
848static inline void _AArch32_Write_dfar( uint32_t value )
849{
850 __asm__ volatile (
851 "mcr p15, 0, %0, c6, c0, 0" : : "r" ( value ) : "memory"
852 );
853}
854
855/* DFSR, Data Fault Status Register */
856
857#define AARCH32_DFSR_FS_3_0( _val ) ( ( _val ) << 0 )
858#define AARCH32_DFSR_FS_3_0_SHIFT 0
859#define AARCH32_DFSR_FS_3_0_MASK 0xfU
860#define AARCH32_DFSR_FS_3_0_GET( _reg ) \
861 ( ( ( _reg ) >> 0 ) & 0xfU )
862
863#define AARCH32_DFSR_STATUS( _val ) ( ( _val ) << 0 )
864#define AARCH32_DFSR_STATUS_SHIFT 0
865#define AARCH32_DFSR_STATUS_MASK 0x3fU
866#define AARCH32_DFSR_STATUS_GET( _reg ) \
867 ( ( ( _reg ) >> 0 ) & 0x3fU )
868
869#define AARCH32_DFSR_DOMAIN( _val ) ( ( _val ) << 4 )
870#define AARCH32_DFSR_DOMAIN_SHIFT 4
871#define AARCH32_DFSR_DOMAIN_MASK 0xf0U
872#define AARCH32_DFSR_DOMAIN_GET( _reg ) \
873 ( ( ( _reg ) >> 4 ) & 0xfU )
874
875#define AARCH32_DFSR_LPAE 0x200U
876
877#define AARCH32_DFSR_FS_4 0x400U
878
879#define AARCH32_DFSR_WNR 0x800U
880
881#define AARCH32_DFSR_EXT 0x1000U
882
883#define AARCH32_DFSR_CM 0x2000U
884
885#define AARCH32_DFSR_AET( _val ) ( ( _val ) << 14 )
886#define AARCH32_DFSR_AET_SHIFT 14
887#define AARCH32_DFSR_AET_MASK 0xc000U
888#define AARCH32_DFSR_AET_GET( _reg ) \
889 ( ( ( _reg ) >> 14 ) & 0x3U )
890
891#define AARCH32_DFSR_FNV 0x10000U
892
893static inline uint32_t _AArch32_Read_dfsr( void )
894{
895 uint32_t value;
896
897 __asm__ volatile (
898 "mrc p15, 0, %0, c5, c0, 0" : "=&r" ( value ) : : "memory"
899 );
900
901 return value;
902}
903
904static inline void _AArch32_Write_dfsr( uint32_t value )
905{
906 __asm__ volatile (
907 "mcr p15, 0, %0, c5, c0, 0" : : "r" ( value ) : "memory"
908 );
909}
910
911/* DTLBIALL, Data TLB Invalidate All */
912
913static inline void _AArch32_Write_dtlbiall( uint32_t value )
914{
915 __asm__ volatile (
916 "mcr p15, 0, %0, c8, c6, 0" : : "r" ( value ) : "memory"
917 );
918}
919
920/* DTLBIASID, Data TLB Invalidate by ASID match */
921
922#define AARCH32_DTLBIASID_ASID( _val ) ( ( _val ) << 0 )
923#define AARCH32_DTLBIASID_ASID_SHIFT 0
924#define AARCH32_DTLBIASID_ASID_MASK 0xffU
925#define AARCH32_DTLBIASID_ASID_GET( _reg ) \
926 ( ( ( _reg ) >> 0 ) & 0xffU )
927
928static inline void _AArch32_Write_dtlbiasid( uint32_t value )
929{
930 __asm__ volatile (
931 "mcr p15, 0, %0, c8, c6, 2" : : "r" ( value ) : "memory"
932 );
933}
934
935/* DTLBIMVA, Data TLB Invalidate by VA */
936
937#define AARCH32_DTLBIMVA_ASID( _val ) ( ( _val ) << 0 )
938#define AARCH32_DTLBIMVA_ASID_SHIFT 0
939#define AARCH32_DTLBIMVA_ASID_MASK 0xffU
940#define AARCH32_DTLBIMVA_ASID_GET( _reg ) \
941 ( ( ( _reg ) >> 0 ) & 0xffU )
942
943#define AARCH32_DTLBIMVA_VA( _val ) ( ( _val ) << 12 )
944#define AARCH32_DTLBIMVA_VA_SHIFT 12
945#define AARCH32_DTLBIMVA_VA_MASK 0xfffff000U
946#define AARCH32_DTLBIMVA_VA_GET( _reg ) \
947 ( ( ( _reg ) >> 12 ) & 0xfffffU )
948
949static inline void _AArch32_Write_dtlbimva( uint32_t value )
950{
951 __asm__ volatile (
952 "mcr p15, 0, %0, c8, c6, 1" : : "r" ( value ) : "memory"
953 );
954}
955
956/* DVPRCTX, Data Value Prediction Restriction by Context */
957
958#define AARCH32_DVPRCTX_ASID( _val ) ( ( _val ) << 0 )
959#define AARCH32_DVPRCTX_ASID_SHIFT 0
960#define AARCH32_DVPRCTX_ASID_MASK 0xffU
961#define AARCH32_DVPRCTX_ASID_GET( _reg ) \
962 ( ( ( _reg ) >> 0 ) & 0xffU )
963
964#define AARCH32_DVPRCTX_GASID 0x100U
965
966#define AARCH32_DVPRCTX_VMID( _val ) ( ( _val ) << 16 )
967#define AARCH32_DVPRCTX_VMID_SHIFT 16
968#define AARCH32_DVPRCTX_VMID_MASK 0xff0000U
969#define AARCH32_DVPRCTX_VMID_GET( _reg ) \
970 ( ( ( _reg ) >> 16 ) & 0xffU )
971
972#define AARCH32_DVPRCTX_EL( _val ) ( ( _val ) << 24 )
973#define AARCH32_DVPRCTX_EL_SHIFT 24
974#define AARCH32_DVPRCTX_EL_MASK 0x3000000U
975#define AARCH32_DVPRCTX_EL_GET( _reg ) \
976 ( ( ( _reg ) >> 24 ) & 0x3U )
977
978#define AARCH32_DVPRCTX_NS 0x4000000U
979
980#define AARCH32_DVPRCTX_GVMID 0x8000000U
981
982static inline void _AArch32_Write_dvprctx( uint32_t value )
983{
984 __asm__ volatile (
985 "mcr p15, 0, %0, c7, c3, 5" : : "r" ( value ) : "memory"
986 );
987}
988
989/* FCSEIDR, FCSE Process ID Register */
990
991static inline uint32_t _AArch32_Read_fcseidr( void )
992{
993 uint32_t value;
994
995 __asm__ volatile (
996 "mrc p15, 0, %0, c13, c0, 0" : "=&r" ( value ) : : "memory"
997 );
998
999 return value;
1000}
1001
1002static inline void _AArch32_Write_fcseidr( uint32_t value )
1003{
1004 __asm__ volatile (
1005 "mcr p15, 0, %0, c13, c0, 0" : : "r" ( value ) : "memory"
1006 );
1007}
1008
1009/* FPEXC, Floating-Point Exception Control Register */
1010
1011#define AARCH32_FPEXC_IOF 0x1U
1012
1013#define AARCH32_FPEXC_DZF 0x2U
1014
1015#define AARCH32_FPEXC_OFF 0x4U
1016
1017#define AARCH32_FPEXC_UFF 0x8U
1018
1019#define AARCH32_FPEXC_IXF 0x10U
1020
1021#define AARCH32_FPEXC_IDF 0x80U
1022
1023#define AARCH32_FPEXC_VECITR( _val ) ( ( _val ) << 8 )
1024#define AARCH32_FPEXC_VECITR_SHIFT 8
1025#define AARCH32_FPEXC_VECITR_MASK 0x700U
1026#define AARCH32_FPEXC_VECITR_GET( _reg ) \
1027 ( ( ( _reg ) >> 8 ) & 0x7U )
1028
1029#define AARCH32_FPEXC_TFV 0x4000000U
1030
1031#define AARCH32_FPEXC_VV 0x8000000U
1032
1033#define AARCH32_FPEXC_FP2V 0x10000000U
1034
1035#define AARCH32_FPEXC_DEX 0x20000000U
1036
1037#define AARCH32_FPEXC_EN 0x40000000U
1038
1039#define AARCH32_FPEXC_EX 0x80000000U
1040
1041/* FPSCR, Floating-Point Status and Control Register */
1042
1043#define AARCH32_FPSCR_IOC 0x1U
1044
1045#define AARCH32_FPSCR_DZC 0x2U
1046
1047#define AARCH32_FPSCR_OFC 0x4U
1048
1049#define AARCH32_FPSCR_UFC 0x8U
1050
1051#define AARCH32_FPSCR_IXC 0x10U
1052
1053#define AARCH32_FPSCR_IDC 0x80U
1054
1055#define AARCH32_FPSCR_IOE 0x100U
1056
1057#define AARCH32_FPSCR_DZE 0x200U
1058
1059#define AARCH32_FPSCR_OFE 0x400U
1060
1061#define AARCH32_FPSCR_UFE 0x800U
1062
1063#define AARCH32_FPSCR_IXE 0x1000U
1064
1065#define AARCH32_FPSCR_IDE 0x8000U
1066
1067#define AARCH32_FPSCR_LEN( _val ) ( ( _val ) << 16 )
1068#define AARCH32_FPSCR_LEN_SHIFT 16
1069#define AARCH32_FPSCR_LEN_MASK 0x70000U
1070#define AARCH32_FPSCR_LEN_GET( _reg ) \
1071 ( ( ( _reg ) >> 16 ) & 0x7U )
1072
1073#define AARCH32_FPSCR_FZ16 0x80000U
1074
1075#define AARCH32_FPSCR_STRIDE( _val ) ( ( _val ) << 20 )
1076#define AARCH32_FPSCR_STRIDE_SHIFT 20
1077#define AARCH32_FPSCR_STRIDE_MASK 0x300000U
1078#define AARCH32_FPSCR_STRIDE_GET( _reg ) \
1079 ( ( ( _reg ) >> 20 ) & 0x3U )
1080
1081#define AARCH32_FPSCR_RMODE( _val ) ( ( _val ) << 22 )
1082#define AARCH32_FPSCR_RMODE_SHIFT 22
1083#define AARCH32_FPSCR_RMODE_MASK 0xc00000U
1084#define AARCH32_FPSCR_RMODE_GET( _reg ) \
1085 ( ( ( _reg ) >> 22 ) & 0x3U )
1086
1087#define AARCH32_FPSCR_FZ 0x1000000U
1088
1089#define AARCH32_FPSCR_DN 0x2000000U
1090
1091#define AARCH32_FPSCR_AHP 0x4000000U
1092
1093#define AARCH32_FPSCR_QC 0x8000000U
1094
1095#define AARCH32_FPSCR_V 0x10000000U
1096
1097#define AARCH32_FPSCR_C 0x20000000U
1098
1099#define AARCH32_FPSCR_Z 0x40000000U
1100
1101#define AARCH32_FPSCR_N 0x80000000U
1102
1103/* FPSID, Floating-Point System ID Register */
1104
1105#define AARCH32_FPSID_REVISION( _val ) ( ( _val ) << 0 )
1106#define AARCH32_FPSID_REVISION_SHIFT 0
1107#define AARCH32_FPSID_REVISION_MASK 0xfU
1108#define AARCH32_FPSID_REVISION_GET( _reg ) \
1109 ( ( ( _reg ) >> 0 ) & 0xfU )
1110
1111#define AARCH32_FPSID_VARIANT( _val ) ( ( _val ) << 4 )
1112#define AARCH32_FPSID_VARIANT_SHIFT 4
1113#define AARCH32_FPSID_VARIANT_MASK 0xf0U
1114#define AARCH32_FPSID_VARIANT_GET( _reg ) \
1115 ( ( ( _reg ) >> 4 ) & 0xfU )
1116
1117#define AARCH32_FPSID_PARTNUM( _val ) ( ( _val ) << 8 )
1118#define AARCH32_FPSID_PARTNUM_SHIFT 8
1119#define AARCH32_FPSID_PARTNUM_MASK 0xff00U
1120#define AARCH32_FPSID_PARTNUM_GET( _reg ) \
1121 ( ( ( _reg ) >> 8 ) & 0xffU )
1122
1123#define AARCH32_FPSID_SUBARCHITECTURE( _val ) ( ( _val ) << 16 )
1124#define AARCH32_FPSID_SUBARCHITECTURE_SHIFT 16
1125#define AARCH32_FPSID_SUBARCHITECTURE_MASK 0x7f0000U
1126#define AARCH32_FPSID_SUBARCHITECTURE_GET( _reg ) \
1127 ( ( ( _reg ) >> 16 ) & 0x7fU )
1128
1129#define AARCH32_FPSID_SW 0x800000U
1130
1131#define AARCH32_FPSID_IMPLEMENTER( _val ) ( ( _val ) << 24 )
1132#define AARCH32_FPSID_IMPLEMENTER_SHIFT 24
1133#define AARCH32_FPSID_IMPLEMENTER_MASK 0xff000000U
1134#define AARCH32_FPSID_IMPLEMENTER_GET( _reg ) \
1135 ( ( ( _reg ) >> 24 ) & 0xffU )
1136
1137/* HACR, Hyp Auxiliary Configuration Register */
1138
1139static inline uint32_t _AArch32_Read_hacr( void )
1140{
1141 uint32_t value;
1142
1143 __asm__ volatile (
1144 "mrc p15, 4, %0, c1, c1, 7" : "=&r" ( value ) : : "memory"
1145 );
1146
1147 return value;
1148}
1149
1150static inline void _AArch32_Write_hacr( uint32_t value )
1151{
1152 __asm__ volatile (
1153 "mcr p15, 4, %0, c1, c1, 7" : : "r" ( value ) : "memory"
1154 );
1155}
1156
1157/* HACTLR, Hyp Auxiliary Control Register */
1158
1159static inline uint32_t _AArch32_Read_hactlr( void )
1160{
1161 uint32_t value;
1162
1163 __asm__ volatile (
1164 "mrc p15, 4, %0, c1, c0, 1" : "=&r" ( value ) : : "memory"
1165 );
1166
1167 return value;
1168}
1169
1170static inline void _AArch32_Write_hactlr( uint32_t value )
1171{
1172 __asm__ volatile (
1173 "mcr p15, 4, %0, c1, c0, 1" : : "r" ( value ) : "memory"
1174 );
1175}
1176
1177/* HACTLR2, Hyp Auxiliary Control Register 2 */
1178
1179static inline uint32_t _AArch32_Read_hactlr2( void )
1180{
1181 uint32_t value;
1182
1183 __asm__ volatile (
1184 "mrc p15, 4, %0, c1, c0, 3" : "=&r" ( value ) : : "memory"
1185 );
1186
1187 return value;
1188}
1189
1190static inline void _AArch32_Write_hactlr2( uint32_t value )
1191{
1192 __asm__ volatile (
1193 "mcr p15, 4, %0, c1, c0, 3" : : "r" ( value ) : "memory"
1194 );
1195}
1196
1197/* HADFSR, Hyp Auxiliary Data Fault Status Register */
1198
1199static inline uint32_t _AArch32_Read_hadfsr( void )
1200{
1201 uint32_t value;
1202
1203 __asm__ volatile (
1204 "mrc p15, 4, %0, c5, c1, 0" : "=&r" ( value ) : : "memory"
1205 );
1206
1207 return value;
1208}
1209
1210static inline void _AArch32_Write_hadfsr( uint32_t value )
1211{
1212 __asm__ volatile (
1213 "mcr p15, 4, %0, c5, c1, 0" : : "r" ( value ) : "memory"
1214 );
1215}
1216
1217/* HAIFSR, Hyp Auxiliary Instruction Fault Status Register */
1218
1219static inline uint32_t _AArch32_Read_haifsr( void )
1220{
1221 uint32_t value;
1222
1223 __asm__ volatile (
1224 "mrc p15, 4, %0, c5, c1, 1" : "=&r" ( value ) : : "memory"
1225 );
1226
1227 return value;
1228}
1229
1230static inline void _AArch32_Write_haifsr( uint32_t value )
1231{
1232 __asm__ volatile (
1233 "mcr p15, 4, %0, c5, c1, 1" : : "r" ( value ) : "memory"
1234 );
1235}
1236
1237/* HAMAIR0, Hyp Auxiliary Memory Attribute Indirection Register 0 */
1238
1239static inline uint32_t _AArch32_Read_hamair0( void )
1240{
1241 uint32_t value;
1242
1243 __asm__ volatile (
1244 "mrc p15, 4, %0, c10, c3, 0" : "=&r" ( value ) : : "memory"
1245 );
1246
1247 return value;
1248}
1249
1250static inline void _AArch32_Write_hamair0( uint32_t value )
1251{
1252 __asm__ volatile (
1253 "mcr p15, 4, %0, c10, c3, 0" : : "r" ( value ) : "memory"
1254 );
1255}
1256
1257/* HAMAIR1, Hyp Auxiliary Memory Attribute Indirection Register 1 */
1258
1259static inline uint32_t _AArch32_Read_hamair1( void )
1260{
1261 uint32_t value;
1262
1263 __asm__ volatile (
1264 "mrc p15, 4, %0, c10, c3, 1" : "=&r" ( value ) : : "memory"
1265 );
1266
1267 return value;
1268}
1269
1270static inline void _AArch32_Write_hamair1( uint32_t value )
1271{
1272 __asm__ volatile (
1273 "mcr p15, 4, %0, c10, c3, 1" : : "r" ( value ) : "memory"
1274 );
1275}
1276
1277/* HCPTR, Hyp Architectural Feature Trap Register */
1278
1279#define AARCH32_HCPTR_TCP10 0x400U
1280
1281#define AARCH32_HCPTR_TCP11 0x800U
1282
1283#define AARCH32_HCPTR_TASE 0x8000U
1284
1285#define AARCH32_HCPTR_TTA 0x100000U
1286
1287#define AARCH32_HCPTR_TAM 0x40000000U
1288
1289#define AARCH32_HCPTR_TCPAC 0x80000000U
1290
1291static inline uint32_t _AArch32_Read_hcptr( void )
1292{
1293 uint32_t value;
1294
1295 __asm__ volatile (
1296 "mrc p15, 4, %0, c1, c1, 2" : "=&r" ( value ) : : "memory"
1297 );
1298
1299 return value;
1300}
1301
1302static inline void _AArch32_Write_hcptr( uint32_t value )
1303{
1304 __asm__ volatile (
1305 "mcr p15, 4, %0, c1, c1, 2" : : "r" ( value ) : "memory"
1306 );
1307}
1308
1309/* HCR, Hyp Configuration Register */
1310
1311#define AARCH32_HCR_VM 0x1U
1312
1313#define AARCH32_HCR_SWIO 0x2U
1314
1315#define AARCH32_HCR_PTW 0x4U
1316
1317#define AARCH32_HCR_FMO 0x8U
1318
1319#define AARCH32_HCR_IMO 0x10U
1320
1321#define AARCH32_HCR_AMO 0x20U
1322
1323#define AARCH32_HCR_VF 0x40U
1324
1325#define AARCH32_HCR_VI 0x80U
1326
1327#define AARCH32_HCR_VA 0x100U
1328
1329#define AARCH32_HCR_FB 0x200U
1330
1331#define AARCH32_HCR_BSU( _val ) ( ( _val ) << 10 )
1332#define AARCH32_HCR_BSU_SHIFT 10
1333#define AARCH32_HCR_BSU_MASK 0xc00U
1334#define AARCH32_HCR_BSU_GET( _reg ) \
1335 ( ( ( _reg ) >> 10 ) & 0x3U )
1336
1337#define AARCH32_HCR_DC 0x1000U
1338
1339#define AARCH32_HCR_TWI 0x2000U
1340
1341#define AARCH32_HCR_TWE 0x4000U
1342
1343#define AARCH32_HCR_TID0 0x8000U
1344
1345#define AARCH32_HCR_TID1 0x10000U
1346
1347#define AARCH32_HCR_TID2 0x20000U
1348
1349#define AARCH32_HCR_TID3 0x40000U
1350
1351#define AARCH32_HCR_TSC 0x80000U
1352
1353#define AARCH32_HCR_TIDCP 0x100000U
1354
1355#define AARCH32_HCR_TAC 0x200000U
1356
1357#define AARCH32_HCR_TSW 0x400000U
1358
1359#define AARCH32_HCR_TPC 0x800000U
1360
1361#define AARCH32_HCR_TPU 0x1000000U
1362
1363#define AARCH32_HCR_TTLB 0x2000000U
1364
1365#define AARCH32_HCR_TVM 0x4000000U
1366
1367#define AARCH32_HCR_TGE 0x8000000U
1368
1369#define AARCH32_HCR_HCD 0x20000000U
1370
1371#define AARCH32_HCR_TRVM 0x40000000U
1372
1373static inline uint32_t _AArch32_Read_hcr( void )
1374{
1375 uint32_t value;
1376
1377 __asm__ volatile (
1378 "mrc p15, 4, %0, c1, c1, 0" : "=&r" ( value ) : : "memory"
1379 );
1380
1381 return value;
1382}
1383
1384static inline void _AArch32_Write_hcr( uint32_t value )
1385{
1386 __asm__ volatile (
1387 "mcr p15, 4, %0, c1, c1, 0" : : "r" ( value ) : "memory"
1388 );
1389}
1390
1391/* HCR2, Hyp Configuration Register 2 */
1392
1393#define AARCH32_HCR2_CD 0x1U
1394
1395#define AARCH32_HCR2_ID 0x2U
1396
1397#define AARCH32_HCR2_TERR 0x10U
1398
1399#define AARCH32_HCR2_TEA 0x20U
1400
1401#define AARCH32_HCR2_MIOCNCE 0x40U
1402
1403#define AARCH32_HCR2_TID4 0x20000U
1404
1405#define AARCH32_HCR2_TICAB 0x40000U
1406
1407#define AARCH32_HCR2_TOCU 0x100000U
1408
1409#define AARCH32_HCR2_TTLBIS 0x400000U
1410
1411static inline uint32_t _AArch32_Read_hcr2( void )
1412{
1413 uint32_t value;
1414
1415 __asm__ volatile (
1416 "mrc p15, 4, %0, c1, c1, 4" : "=&r" ( value ) : : "memory"
1417 );
1418
1419 return value;
1420}
1421
1422static inline void _AArch32_Write_hcr2( uint32_t value )
1423{
1424 __asm__ volatile (
1425 "mcr p15, 4, %0, c1, c1, 4" : : "r" ( value ) : "memory"
1426 );
1427}
1428
1429/* HDFAR, Hyp Data Fault Address Register */
1430
1431static inline uint32_t _AArch32_Read_hdfar( void )
1432{
1433 uint32_t value;
1434
1435 __asm__ volatile (
1436 "mrc p15, 4, %0, c6, c0, 0" : "=&r" ( value ) : : "memory"
1437 );
1438
1439 return value;
1440}
1441
1442static inline void _AArch32_Write_hdfar( uint32_t value )
1443{
1444 __asm__ volatile (
1445 "mcr p15, 4, %0, c6, c0, 0" : : "r" ( value ) : "memory"
1446 );
1447}
1448
1449/* HIFAR, Hyp Instruction Fault Address Register */
1450
1451static inline uint32_t _AArch32_Read_hifar( void )
1452{
1453 uint32_t value;
1454
1455 __asm__ volatile (
1456 "mrc p15, 4, %0, c6, c0, 2" : "=&r" ( value ) : : "memory"
1457 );
1458
1459 return value;
1460}
1461
1462static inline void _AArch32_Write_hifar( uint32_t value )
1463{
1464 __asm__ volatile (
1465 "mcr p15, 4, %0, c6, c0, 2" : : "r" ( value ) : "memory"
1466 );
1467}
1468
1469/* HMAIR0, Hyp Memory Attribute Indirection Register 0 */
1470
1471static inline uint32_t _AArch32_Read_hmair0( void )
1472{
1473 uint32_t value;
1474
1475 __asm__ volatile (
1476 "mrc p15, 4, %0, c10, c2, 0" : "=&r" ( value ) : : "memory"
1477 );
1478
1479 return value;
1480}
1481
1482static inline void _AArch32_Write_hmair0( uint32_t value )
1483{
1484 __asm__ volatile (
1485 "mcr p15, 4, %0, c10, c2, 0" : : "r" ( value ) : "memory"
1486 );
1487}
1488
1489/* HMAIR1, Hyp Memory Attribute Indirection Register 1 */
1490
1491static inline uint32_t _AArch32_Read_hmair1( void )
1492{
1493 uint32_t value;
1494
1495 __asm__ volatile (
1496 "mrc p15, 4, %0, c10, c2, 1" : "=&r" ( value ) : : "memory"
1497 );
1498
1499 return value;
1500}
1501
1502static inline void _AArch32_Write_hmair1( uint32_t value )
1503{
1504 __asm__ volatile (
1505 "mcr p15, 4, %0, c10, c2, 1" : : "r" ( value ) : "memory"
1506 );
1507}
1508
1509/* HPFAR, Hyp IPA Fault Address Register */
1510
1511#define AARCH32_HPFAR_FIPA_39_12( _val ) ( ( _val ) << 4 )
1512#define AARCH32_HPFAR_FIPA_39_12_SHIFT 4
1513#define AARCH32_HPFAR_FIPA_39_12_MASK 0xfffffff0U
1514#define AARCH32_HPFAR_FIPA_39_12_GET( _reg ) \
1515 ( ( ( _reg ) >> 4 ) & 0xfffffffU )
1516
1517static inline uint32_t _AArch32_Read_hpfar( void )
1518{
1519 uint32_t value;
1520
1521 __asm__ volatile (
1522 "mrc p15, 4, %0, c6, c0, 4" : "=&r" ( value ) : : "memory"
1523 );
1524
1525 return value;
1526}
1527
1528static inline void _AArch32_Write_hpfar( uint32_t value )
1529{
1530 __asm__ volatile (
1531 "mcr p15, 4, %0, c6, c0, 4" : : "r" ( value ) : "memory"
1532 );
1533}
1534
1535/* HRMR, Hyp Reset Management Register */
1536
1537#define AARCH32_HRMR_AA64 0x1U
1538
1539#define AARCH32_HRMR_RR 0x2U
1540
1541static inline uint32_t _AArch32_Read_hrmr( void )
1542{
1543 uint32_t value;
1544
1545 __asm__ volatile (
1546 "mrc p15, 4, %0, c12, c0, 2" : "=&r" ( value ) : : "memory"
1547 );
1548
1549 return value;
1550}
1551
1552static inline void _AArch32_Write_hrmr( uint32_t value )
1553{
1554 __asm__ volatile (
1555 "mcr p15, 4, %0, c12, c0, 2" : : "r" ( value ) : "memory"
1556 );
1557}
1558
1559/* HSCTLR, Hyp System Control Register */
1560
1561#define AARCH32_HSCTLR_M 0x1U
1562
1563#define AARCH32_HSCTLR_A 0x2U
1564
1565#define AARCH32_HSCTLR_C 0x4U
1566
1567#define AARCH32_HSCTLR_NTLSMD 0x8U
1568
1569#define AARCH32_HSCTLR_LSMAOE 0x10U
1570
1571#define AARCH32_HSCTLR_CP15BEN 0x20U
1572
1573#define AARCH32_HSCTLR_ITD 0x80U
1574
1575#define AARCH32_HSCTLR_SED 0x100U
1576
1577#define AARCH32_HSCTLR_I 0x1000U
1578
1579#define AARCH32_HSCTLR_BR 0x20000U
1580
1581#define AARCH32_HSCTLR_WXN 0x80000U
1582
1583#define AARCH32_HSCTLR_FI 0x200000U
1584
1585#define AARCH32_HSCTLR_EE 0x2000000U
1586
1587#define AARCH32_HSCTLR_TE 0x40000000U
1588
1589#define AARCH32_HSCTLR_DSSBS 0x80000000U
1590
1591static inline uint32_t _AArch32_Read_hsctlr( void )
1592{
1593 uint32_t value;
1594
1595 __asm__ volatile (
1596 "mrc p15, 4, %0, c1, c0, 0" : "=&r" ( value ) : : "memory"
1597 );
1598
1599 return value;
1600}
1601
1602static inline void _AArch32_Write_hsctlr( uint32_t value )
1603{
1604 __asm__ volatile (
1605 "mcr p15, 4, %0, c1, c0, 0" : : "r" ( value ) : "memory"
1606 );
1607}
1608
1609/* HSR, Hyp Syndrome Register */
1610
1611#define AARCH32_HSR_DIRECTION 0x1U
1612
1613#define AARCH32_HSR_TI 0x1U
1614
1615#define AARCH32_HSR_COPROC( _val ) ( ( _val ) << 0 )
1616#define AARCH32_HSR_COPROC_SHIFT 0
1617#define AARCH32_HSR_COPROC_MASK 0xfU
1618#define AARCH32_HSR_COPROC_GET( _reg ) \
1619 ( ( ( _reg ) >> 0 ) & 0xfU )
1620
1621#define AARCH32_HSR_DFSC( _val ) ( ( _val ) << 0 )
1622#define AARCH32_HSR_DFSC_SHIFT 0
1623#define AARCH32_HSR_DFSC_MASK 0x3fU
1624#define AARCH32_HSR_DFSC_GET( _reg ) \
1625 ( ( ( _reg ) >> 0 ) & 0x3fU )
1626
1627#define AARCH32_HSR_IFSC( _val ) ( ( _val ) << 0 )
1628#define AARCH32_HSR_IFSC_SHIFT 0
1629#define AARCH32_HSR_IFSC_MASK 0x3fU
1630#define AARCH32_HSR_IFSC_GET( _reg ) \
1631 ( ( ( _reg ) >> 0 ) & 0x3fU )
1632
1633#define AARCH32_HSR_IMM16( _val ) ( ( _val ) << 0 )
1634#define AARCH32_HSR_IMM16_SHIFT 0
1635#define AARCH32_HSR_IMM16_MASK 0xffffU
1636#define AARCH32_HSR_IMM16_GET( _reg ) \
1637 ( ( ( _reg ) >> 0 ) & 0xffffU )
1638
1639#define AARCH32_HSR_ISS( _val ) ( ( _val ) << 0 )
1640#define AARCH32_HSR_ISS_SHIFT 0
1641#define AARCH32_HSR_ISS_MASK 0x1ffffffU
1642#define AARCH32_HSR_ISS_GET( _reg ) \
1643 ( ( ( _reg ) >> 0 ) & 0x1ffffffU )
1644
1645#define AARCH32_HSR_AM( _val ) ( ( _val ) << 1 )
1646#define AARCH32_HSR_AM_SHIFT 1
1647#define AARCH32_HSR_AM_MASK 0xeU
1648#define AARCH32_HSR_AM_GET( _reg ) \
1649 ( ( ( _reg ) >> 1 ) & 0x7U )
1650
1651#define AARCH32_HSR_CRM( _val ) ( ( _val ) << 1 )
1652#define AARCH32_HSR_CRM_SHIFT 1
1653#define AARCH32_HSR_CRM_MASK 0x1eU
1654#define AARCH32_HSR_CRM_GET( _reg ) \
1655 ( ( ( _reg ) >> 1 ) & 0xfU )
1656
1657#define AARCH32_HSR_OFFSET 0x10U
1658
1659#define AARCH32_HSR_TA 0x20U
1660
1661#define AARCH32_HSR_RN( _val ) ( ( _val ) << 5 )
1662#define AARCH32_HSR_RN_SHIFT 5
1663#define AARCH32_HSR_RN_MASK 0x1e0U
1664#define AARCH32_HSR_RN_GET( _reg ) \
1665 ( ( ( _reg ) >> 5 ) & 0xfU )
1666
1667#define AARCH32_HSR_RT( _val ) ( ( _val ) << 5 )
1668#define AARCH32_HSR_RT_SHIFT 5
1669#define AARCH32_HSR_RT_MASK 0x1e0U
1670#define AARCH32_HSR_RT_GET( _reg ) \
1671 ( ( ( _reg ) >> 5 ) & 0xfU )
1672
1673#define AARCH32_HSR_WNR 0x40U
1674
1675#define AARCH32_HSR_S1PTW 0x80U
1676
1677#define AARCH32_HSR_CM 0x100U
1678
1679#define AARCH32_HSR_EA 0x200U
1680
1681#define AARCH32_HSR_FNV 0x400U
1682
1683#define AARCH32_HSR_AET( _val ) ( ( _val ) << 10 )
1684#define AARCH32_HSR_AET_SHIFT 10
1685#define AARCH32_HSR_AET_MASK 0xc00U
1686#define AARCH32_HSR_AET_GET( _reg ) \
1687 ( ( ( _reg ) >> 10 ) & 0x3U )
1688
1689#define AARCH32_HSR_CRN( _val ) ( ( _val ) << 10 )
1690#define AARCH32_HSR_CRN_SHIFT 10
1691#define AARCH32_HSR_CRN_MASK 0x3c00U
1692#define AARCH32_HSR_CRN_GET( _reg ) \
1693 ( ( ( _reg ) >> 10 ) & 0xfU )
1694
1695#define AARCH32_HSR_RT2( _val ) ( ( _val ) << 10 )
1696#define AARCH32_HSR_RT2_SHIFT 10
1697#define AARCH32_HSR_RT2_MASK 0x3c00U
1698#define AARCH32_HSR_RT2_GET( _reg ) \
1699 ( ( ( _reg ) >> 10 ) & 0xfU )
1700
1701#define AARCH32_HSR_IMM8( _val ) ( ( _val ) << 12 )
1702#define AARCH32_HSR_IMM8_SHIFT 12
1703#define AARCH32_HSR_IMM8_MASK 0xff000U
1704#define AARCH32_HSR_IMM8_GET( _reg ) \
1705 ( ( ( _reg ) >> 12 ) & 0xffU )
1706
1707#define AARCH32_HSR_AR 0x4000U
1708
1709#define AARCH32_HSR_OPC1_0( _val ) ( ( _val ) << 14 )
1710#define AARCH32_HSR_OPC1_SHIFT_0 14
1711#define AARCH32_HSR_OPC1_MASK_0 0x1c000U
1712#define AARCH32_HSR_OPC1_GET_0( _reg ) \
1713 ( ( ( _reg ) >> 14 ) & 0x7U )
1714
1715#define AARCH32_HSR_OPC1_1( _val ) ( ( _val ) << 16 )
1716#define AARCH32_HSR_OPC1_SHIFT_1 16
1717#define AARCH32_HSR_OPC1_MASK_1 0xf0000U
1718#define AARCH32_HSR_OPC1_GET_1( _reg ) \
1719 ( ( ( _reg ) >> 16 ) & 0xfU )
1720
1721#define AARCH32_HSR_SRT( _val ) ( ( _val ) << 16 )
1722#define AARCH32_HSR_SRT_SHIFT 16
1723#define AARCH32_HSR_SRT_MASK 0xf0000U
1724#define AARCH32_HSR_SRT_GET( _reg ) \
1725 ( ( ( _reg ) >> 16 ) & 0xfU )
1726
1727#define AARCH32_HSR_OPC2( _val ) ( ( _val ) << 17 )
1728#define AARCH32_HSR_OPC2_SHIFT 17
1729#define AARCH32_HSR_OPC2_MASK 0xe0000U
1730#define AARCH32_HSR_OPC2_GET( _reg ) \
1731 ( ( ( _reg ) >> 17 ) & 0x7U )
1732
1733#define AARCH32_HSR_CCKNOWNPASS 0x80000U
1734
1735#define AARCH32_HSR_COND( _val ) ( ( _val ) << 20 )
1736#define AARCH32_HSR_COND_SHIFT 20
1737#define AARCH32_HSR_COND_MASK 0xf00000U
1738#define AARCH32_HSR_COND_GET( _reg ) \
1739 ( ( ( _reg ) >> 20 ) & 0xfU )
1740
1741#define AARCH32_HSR_SSE 0x200000U
1742
1743#define AARCH32_HSR_SAS( _val ) ( ( _val ) << 22 )
1744#define AARCH32_HSR_SAS_SHIFT 22
1745#define AARCH32_HSR_SAS_MASK 0xc00000U
1746#define AARCH32_HSR_SAS_GET( _reg ) \
1747 ( ( ( _reg ) >> 22 ) & 0x3U )
1748
1749#define AARCH32_HSR_CV 0x1000000U
1750
1751#define AARCH32_HSR_ISV 0x1000000U
1752
1753#define AARCH32_HSR_IL 0x2000000U
1754
1755#define AARCH32_HSR_EC( _val ) ( ( _val ) << 26 )
1756#define AARCH32_HSR_EC_SHIFT 26
1757#define AARCH32_HSR_EC_MASK 0xfc000000U
1758#define AARCH32_HSR_EC_GET( _reg ) \
1759 ( ( ( _reg ) >> 26 ) & 0x3fU )
1760
1761static inline uint32_t _AArch32_Read_hsr( void )
1762{
1763 uint32_t value;
1764
1765 __asm__ volatile (
1766 "mrc p15, 4, %0, c5, c2, 0" : "=&r" ( value ) : : "memory"
1767 );
1768
1769 return value;
1770}
1771
1772static inline void _AArch32_Write_hsr( uint32_t value )
1773{
1774 __asm__ volatile (
1775 "mcr p15, 4, %0, c5, c2, 0" : : "r" ( value ) : "memory"
1776 );
1777}
1778
1779/* HSTR, Hyp System Trap Register */
1780
1781static inline uint32_t _AArch32_Read_hstr( void )
1782{
1783 uint32_t value;
1784
1785 __asm__ volatile (
1786 "mrc p15, 4, %0, c1, c1, 3" : "=&r" ( value ) : : "memory"
1787 );
1788
1789 return value;
1790}
1791
1792static inline void _AArch32_Write_hstr( uint32_t value )
1793{
1794 __asm__ volatile (
1795 "mcr p15, 4, %0, c1, c1, 3" : : "r" ( value ) : "memory"
1796 );
1797}
1798
1799/* HTCR, Hyp Translation Control Register */
1800
1801#define AARCH32_HTCR_T0SZ( _val ) ( ( _val ) << 0 )
1802#define AARCH32_HTCR_T0SZ_SHIFT 0
1803#define AARCH32_HTCR_T0SZ_MASK 0x7U
1804#define AARCH32_HTCR_T0SZ_GET( _reg ) \
1805 ( ( ( _reg ) >> 0 ) & 0x7U )
1806
1807#define AARCH32_HTCR_IRGN0( _val ) ( ( _val ) << 8 )
1808#define AARCH32_HTCR_IRGN0_SHIFT 8
1809#define AARCH32_HTCR_IRGN0_MASK 0x300U
1810#define AARCH32_HTCR_IRGN0_GET( _reg ) \
1811 ( ( ( _reg ) >> 8 ) & 0x3U )
1812
1813#define AARCH32_HTCR_ORGN0( _val ) ( ( _val ) << 10 )
1814#define AARCH32_HTCR_ORGN0_SHIFT 10
1815#define AARCH32_HTCR_ORGN0_MASK 0xc00U
1816#define AARCH32_HTCR_ORGN0_GET( _reg ) \
1817 ( ( ( _reg ) >> 10 ) & 0x3U )
1818
1819#define AARCH32_HTCR_SH0( _val ) ( ( _val ) << 12 )
1820#define AARCH32_HTCR_SH0_SHIFT 12
1821#define AARCH32_HTCR_SH0_MASK 0x3000U
1822#define AARCH32_HTCR_SH0_GET( _reg ) \
1823 ( ( ( _reg ) >> 12 ) & 0x3U )
1824
1825#define AARCH32_HTCR_HPD 0x1000000U
1826
1827#define AARCH32_HTCR_HWU59 0x2000000U
1828
1829#define AARCH32_HTCR_HWU60 0x4000000U
1830
1831#define AARCH32_HTCR_HWU61 0x8000000U
1832
1833#define AARCH32_HTCR_HWU62 0x10000000U
1834
1835static inline uint32_t _AArch32_Read_htcr( void )
1836{
1837 uint32_t value;
1838
1839 __asm__ volatile (
1840 "mrc p15, 4, %0, c2, c0, 2" : "=&r" ( value ) : : "memory"
1841 );
1842
1843 return value;
1844}
1845
1846static inline void _AArch32_Write_htcr( uint32_t value )
1847{
1848 __asm__ volatile (
1849 "mcr p15, 4, %0, c2, c0, 2" : : "r" ( value ) : "memory"
1850 );
1851}
1852
1853/* HTPIDR, Hyp Software Thread ID Register */
1854
1855static inline uint32_t _AArch32_Read_htpidr( void )
1856{
1857 uint32_t value;
1858
1859 __asm__ volatile (
1860 "mrc p15, 4, %0, c13, c0, 2" : "=&r" ( value ) : : "memory"
1861 );
1862
1863 return value;
1864}
1865
1866static inline void _AArch32_Write_htpidr( uint32_t value )
1867{
1868 __asm__ volatile (
1869 "mcr p15, 4, %0, c13, c0, 2" : : "r" ( value ) : "memory"
1870 );
1871}
1872
1873/* HTTBR, Hyp Translation Table Base Register */
1874
1875#define AARCH32_HTTBR_CNP 0x1U
1876
1877#define AARCH32_HTTBR_BADDR( _val ) ( ( _val ) << 1 )
1878#define AARCH32_HTTBR_BADDR_SHIFT 1
1879#define AARCH32_HTTBR_BADDR_MASK 0xfffffffffffeULL
1880#define AARCH32_HTTBR_BADDR_GET( _reg ) \
1881 ( ( ( _reg ) >> 1 ) & 0x7fffffffffffULL )
1882
1883static inline uint64_t _AArch32_Read_httbr( void )
1884{
1885 uint64_t value;
1886
1887 __asm__ volatile (
1888 "mrrc p15, 4, %Q0, %R0, c2" : "=&r" ( value ) : : "memory"
1889 );
1890
1891 return value;
1892}
1893
1894static inline void _AArch32_Write_httbr( uint64_t value )
1895{
1896 __asm__ volatile (
1897 "mcrr p15, 4, %Q0, %R0, c2" : : "r" ( value ) : "memory"
1898 );
1899}
1900
1901/* HVBAR, Hyp Vector Base Address Register */
1902
1903static inline uint32_t _AArch32_Read_hvbar( void )
1904{
1905 uint32_t value;
1906
1907 __asm__ volatile (
1908 "mrc p15, 4, %0, c12, c0, 0" : "=&r" ( value ) : : "memory"
1909 );
1910
1911 return value;
1912}
1913
1914static inline void _AArch32_Write_hvbar( uint32_t value )
1915{
1916 __asm__ volatile (
1917 "mcr p15, 4, %0, c12, c0, 0" : : "r" ( value ) : "memory"
1918 );
1919}
1920
1921/* ICIALLU, Instruction Cache Invalidate All to PoU */
1922
1923static inline void _AArch32_Write_iciallu( uint32_t value )
1924{
1925 __asm__ volatile (
1926 "mcr p15, 0, %0, c7, c5, 0" : : "r" ( value ) : "memory"
1927 );
1928}
1929
1930/* ICIALLUIS, Instruction Cache Invalidate All to PoU, Inner Shareable */
1931
1932static inline void _AArch32_Write_icialluis( uint32_t value )
1933{
1934 __asm__ volatile (
1935 "mcr p15, 0, %0, c7, c1, 0" : : "r" ( value ) : "memory"
1936 );
1937}
1938
1939/* ICIMVAU, Instruction Cache line Invalidate by VA to PoU */
1940
1941static inline void _AArch32_Write_icimvau( uint32_t value )
1942{
1943 __asm__ volatile (
1944 "mcr p15, 0, %0, c7, c5, 1" : : "r" ( value ) : "memory"
1945 );
1946}
1947
1948/* ID_AFR0, Auxiliary Feature Register 0 */
1949
1950static inline uint32_t _AArch32_Read_id_afr0( void )
1951{
1952 uint32_t value;
1953
1954 __asm__ volatile (
1955 "mrc p15, 0, %0, c0, c1, 3" : "=&r" ( value ) : : "memory"
1956 );
1957
1958 return value;
1959}
1960
1961/* ID_DFR0, Debug Feature Register 0 */
1962
1963#define AARCH32_ID_DFR0_COPDBG( _val ) ( ( _val ) << 0 )
1964#define AARCH32_ID_DFR0_COPDBG_SHIFT 0
1965#define AARCH32_ID_DFR0_COPDBG_MASK 0xfU
1966#define AARCH32_ID_DFR0_COPDBG_GET( _reg ) \
1967 ( ( ( _reg ) >> 0 ) & 0xfU )
1968
1969#define AARCH32_ID_DFR0_COPSDBG( _val ) ( ( _val ) << 4 )
1970#define AARCH32_ID_DFR0_COPSDBG_SHIFT 4
1971#define AARCH32_ID_DFR0_COPSDBG_MASK 0xf0U
1972#define AARCH32_ID_DFR0_COPSDBG_GET( _reg ) \
1973 ( ( ( _reg ) >> 4 ) & 0xfU )
1974
1975#define AARCH32_ID_DFR0_MMAPDBG( _val ) ( ( _val ) << 8 )
1976#define AARCH32_ID_DFR0_MMAPDBG_SHIFT 8
1977#define AARCH32_ID_DFR0_MMAPDBG_MASK 0xf00U
1978#define AARCH32_ID_DFR0_MMAPDBG_GET( _reg ) \
1979 ( ( ( _reg ) >> 8 ) & 0xfU )
1980
1981#define AARCH32_ID_DFR0_COPTRC( _val ) ( ( _val ) << 12 )
1982#define AARCH32_ID_DFR0_COPTRC_SHIFT 12
1983#define AARCH32_ID_DFR0_COPTRC_MASK 0xf000U
1984#define AARCH32_ID_DFR0_COPTRC_GET( _reg ) \
1985 ( ( ( _reg ) >> 12 ) & 0xfU )
1986
1987#define AARCH32_ID_DFR0_MMAPTRC( _val ) ( ( _val ) << 16 )
1988#define AARCH32_ID_DFR0_MMAPTRC_SHIFT 16
1989#define AARCH32_ID_DFR0_MMAPTRC_MASK 0xf0000U
1990#define AARCH32_ID_DFR0_MMAPTRC_GET( _reg ) \
1991 ( ( ( _reg ) >> 16 ) & 0xfU )
1992
1993#define AARCH32_ID_DFR0_MPROFDBG( _val ) ( ( _val ) << 20 )
1994#define AARCH32_ID_DFR0_MPROFDBG_SHIFT 20
1995#define AARCH32_ID_DFR0_MPROFDBG_MASK 0xf00000U
1996#define AARCH32_ID_DFR0_MPROFDBG_GET( _reg ) \
1997 ( ( ( _reg ) >> 20 ) & 0xfU )
1998
1999#define AARCH32_ID_DFR0_PERFMON( _val ) ( ( _val ) << 24 )
2000#define AARCH32_ID_DFR0_PERFMON_SHIFT 24
2001#define AARCH32_ID_DFR0_PERFMON_MASK 0xf000000U
2002#define AARCH32_ID_DFR0_PERFMON_GET( _reg ) \
2003 ( ( ( _reg ) >> 24 ) & 0xfU )
2004
2005#define AARCH32_ID_DFR0_TRACEFILT( _val ) ( ( _val ) << 28 )
2006#define AARCH32_ID_DFR0_TRACEFILT_SHIFT 28
2007#define AARCH32_ID_DFR0_TRACEFILT_MASK 0xf0000000U
2008#define AARCH32_ID_DFR0_TRACEFILT_GET( _reg ) \
2009 ( ( ( _reg ) >> 28 ) & 0xfU )
2010
2011static inline uint32_t _AArch32_Read_id_dfr0( void )
2012{
2013 uint32_t value;
2014
2015 __asm__ volatile (
2016 "mrc p15, 0, %0, c0, c1, 2" : "=&r" ( value ) : : "memory"
2017 );
2018
2019 return value;
2020}
2021
2022/* ID_DFR1, Debug Feature Register 1 */
2023
2024#define AARCH32_ID_DFR1_MTPMU( _val ) ( ( _val ) << 0 )
2025#define AARCH32_ID_DFR1_MTPMU_SHIFT 0
2026#define AARCH32_ID_DFR1_MTPMU_MASK 0xfU
2027#define AARCH32_ID_DFR1_MTPMU_GET( _reg ) \
2028 ( ( ( _reg ) >> 0 ) & 0xfU )
2029
2030static inline uint32_t _AArch32_Read_id_dfr1( void )
2031{
2032 uint32_t value;
2033
2034 __asm__ volatile (
2035 "mrc p15, 0, %0, c0, c3, 5" : "=&r" ( value ) : : "memory"
2036 );
2037
2038 return value;
2039}
2040
2041/* ID_ISAR0, Instruction Set Attribute Register 0 */
2042
2043#define AARCH32_ID_ISAR0_SWAP( _val ) ( ( _val ) << 0 )
2044#define AARCH32_ID_ISAR0_SWAP_SHIFT 0
2045#define AARCH32_ID_ISAR0_SWAP_MASK 0xfU
2046#define AARCH32_ID_ISAR0_SWAP_GET( _reg ) \
2047 ( ( ( _reg ) >> 0 ) & 0xfU )
2048
2049#define AARCH32_ID_ISAR0_BITCOUNT( _val ) ( ( _val ) << 4 )
2050#define AARCH32_ID_ISAR0_BITCOUNT_SHIFT 4
2051#define AARCH32_ID_ISAR0_BITCOUNT_MASK 0xf0U
2052#define AARCH32_ID_ISAR0_BITCOUNT_GET( _reg ) \
2053 ( ( ( _reg ) >> 4 ) & 0xfU )
2054
2055#define AARCH32_ID_ISAR0_BITFIELD( _val ) ( ( _val ) << 8 )
2056#define AARCH32_ID_ISAR0_BITFIELD_SHIFT 8
2057#define AARCH32_ID_ISAR0_BITFIELD_MASK 0xf00U
2058#define AARCH32_ID_ISAR0_BITFIELD_GET( _reg ) \
2059 ( ( ( _reg ) >> 8 ) & 0xfU )
2060
2061#define AARCH32_ID_ISAR0_CMPBRANCH( _val ) ( ( _val ) << 12 )
2062#define AARCH32_ID_ISAR0_CMPBRANCH_SHIFT 12
2063#define AARCH32_ID_ISAR0_CMPBRANCH_MASK 0xf000U
2064#define AARCH32_ID_ISAR0_CMPBRANCH_GET( _reg ) \
2065 ( ( ( _reg ) >> 12 ) & 0xfU )
2066
2067#define AARCH32_ID_ISAR0_COPROC( _val ) ( ( _val ) << 16 )
2068#define AARCH32_ID_ISAR0_COPROC_SHIFT 16
2069#define AARCH32_ID_ISAR0_COPROC_MASK 0xf0000U
2070#define AARCH32_ID_ISAR0_COPROC_GET( _reg ) \
2071 ( ( ( _reg ) >> 16 ) & 0xfU )
2072
2073#define AARCH32_ID_ISAR0_DEBUG( _val ) ( ( _val ) << 20 )
2074#define AARCH32_ID_ISAR0_DEBUG_SHIFT 20
2075#define AARCH32_ID_ISAR0_DEBUG_MASK 0xf00000U
2076#define AARCH32_ID_ISAR0_DEBUG_GET( _reg ) \
2077 ( ( ( _reg ) >> 20 ) & 0xfU )
2078
2079#define AARCH32_ID_ISAR0_DIVIDE( _val ) ( ( _val ) << 24 )
2080#define AARCH32_ID_ISAR0_DIVIDE_SHIFT 24
2081#define AARCH32_ID_ISAR0_DIVIDE_MASK 0xf000000U
2082#define AARCH32_ID_ISAR0_DIVIDE_GET( _reg ) \
2083 ( ( ( _reg ) >> 24 ) & 0xfU )
2084
2085static inline uint32_t _AArch32_Read_id_isar0( void )
2086{
2087 uint32_t value;
2088
2089 __asm__ volatile (
2090 "mrc p15, 0, %0, c0, c2, 0" : "=&r" ( value ) : : "memory"
2091 );
2092
2093 return value;
2094}
2095
2096/* ID_ISAR1, Instruction Set Attribute Register 1 */
2097
2098#define AARCH32_ID_ISAR1_ENDIAN( _val ) ( ( _val ) << 0 )
2099#define AARCH32_ID_ISAR1_ENDIAN_SHIFT 0
2100#define AARCH32_ID_ISAR1_ENDIAN_MASK 0xfU
2101#define AARCH32_ID_ISAR1_ENDIAN_GET( _reg ) \
2102 ( ( ( _reg ) >> 0 ) & 0xfU )
2103
2104#define AARCH32_ID_ISAR1_EXCEPT( _val ) ( ( _val ) << 4 )
2105#define AARCH32_ID_ISAR1_EXCEPT_SHIFT 4
2106#define AARCH32_ID_ISAR1_EXCEPT_MASK 0xf0U
2107#define AARCH32_ID_ISAR1_EXCEPT_GET( _reg ) \
2108 ( ( ( _reg ) >> 4 ) & 0xfU )
2109
2110#define AARCH32_ID_ISAR1_EXCEPT_AR( _val ) ( ( _val ) << 8 )
2111#define AARCH32_ID_ISAR1_EXCEPT_AR_SHIFT 8
2112#define AARCH32_ID_ISAR1_EXCEPT_AR_MASK 0xf00U
2113#define AARCH32_ID_ISAR1_EXCEPT_AR_GET( _reg ) \
2114 ( ( ( _reg ) >> 8 ) & 0xfU )
2115
2116#define AARCH32_ID_ISAR1_EXTEND( _val ) ( ( _val ) << 12 )
2117#define AARCH32_ID_ISAR1_EXTEND_SHIFT 12
2118#define AARCH32_ID_ISAR1_EXTEND_MASK 0xf000U
2119#define AARCH32_ID_ISAR1_EXTEND_GET( _reg ) \
2120 ( ( ( _reg ) >> 12 ) & 0xfU )
2121
2122#define AARCH32_ID_ISAR1_IFTHEN( _val ) ( ( _val ) << 16 )
2123#define AARCH32_ID_ISAR1_IFTHEN_SHIFT 16
2124#define AARCH32_ID_ISAR1_IFTHEN_MASK 0xf0000U
2125#define AARCH32_ID_ISAR1_IFTHEN_GET( _reg ) \
2126 ( ( ( _reg ) >> 16 ) & 0xfU )
2127
2128#define AARCH32_ID_ISAR1_IMMEDIATE( _val ) ( ( _val ) << 20 )
2129#define AARCH32_ID_ISAR1_IMMEDIATE_SHIFT 20
2130#define AARCH32_ID_ISAR1_IMMEDIATE_MASK 0xf00000U
2131#define AARCH32_ID_ISAR1_IMMEDIATE_GET( _reg ) \
2132 ( ( ( _reg ) >> 20 ) & 0xfU )
2133
2134#define AARCH32_ID_ISAR1_INTERWORK( _val ) ( ( _val ) << 24 )
2135#define AARCH32_ID_ISAR1_INTERWORK_SHIFT 24
2136#define AARCH32_ID_ISAR1_INTERWORK_MASK 0xf000000U
2137#define AARCH32_ID_ISAR1_INTERWORK_GET( _reg ) \
2138 ( ( ( _reg ) >> 24 ) & 0xfU )
2139
2140#define AARCH32_ID_ISAR1_JAZELLE( _val ) ( ( _val ) << 28 )
2141#define AARCH32_ID_ISAR1_JAZELLE_SHIFT 28
2142#define AARCH32_ID_ISAR1_JAZELLE_MASK 0xf0000000U
2143#define AARCH32_ID_ISAR1_JAZELLE_GET( _reg ) \
2144 ( ( ( _reg ) >> 28 ) & 0xfU )
2145
2146static inline uint32_t _AArch32_Read_id_isar1( void )
2147{
2148 uint32_t value;
2149
2150 __asm__ volatile (
2151 "mrc p15, 0, %0, c0, c2, 1" : "=&r" ( value ) : : "memory"
2152 );
2153
2154 return value;
2155}
2156
2157/* ID_ISAR2, Instruction Set Attribute Register 2 */
2158
2159#define AARCH32_ID_ISAR2_LOADSTORE( _val ) ( ( _val ) << 0 )
2160#define AARCH32_ID_ISAR2_LOADSTORE_SHIFT 0
2161#define AARCH32_ID_ISAR2_LOADSTORE_MASK 0xfU
2162#define AARCH32_ID_ISAR2_LOADSTORE_GET( _reg ) \
2163 ( ( ( _reg ) >> 0 ) & 0xfU )
2164
2165#define AARCH32_ID_ISAR2_MEMHINT( _val ) ( ( _val ) << 4 )
2166#define AARCH32_ID_ISAR2_MEMHINT_SHIFT 4
2167#define AARCH32_ID_ISAR2_MEMHINT_MASK 0xf0U
2168#define AARCH32_ID_ISAR2_MEMHINT_GET( _reg ) \
2169 ( ( ( _reg ) >> 4 ) & 0xfU )
2170
2171#define AARCH32_ID_ISAR2_MULTIACCESSINT( _val ) ( ( _val ) << 8 )
2172#define AARCH32_ID_ISAR2_MULTIACCESSINT_SHIFT 8
2173#define AARCH32_ID_ISAR2_MULTIACCESSINT_MASK 0xf00U
2174#define AARCH32_ID_ISAR2_MULTIACCESSINT_GET( _reg ) \
2175 ( ( ( _reg ) >> 8 ) & 0xfU )
2176
2177#define AARCH32_ID_ISAR2_MULT( _val ) ( ( _val ) << 12 )
2178#define AARCH32_ID_ISAR2_MULT_SHIFT 12
2179#define AARCH32_ID_ISAR2_MULT_MASK 0xf000U
2180#define AARCH32_ID_ISAR2_MULT_GET( _reg ) \
2181 ( ( ( _reg ) >> 12 ) & 0xfU )
2182
2183#define AARCH32_ID_ISAR2_MULTS( _val ) ( ( _val ) << 16 )
2184#define AARCH32_ID_ISAR2_MULTS_SHIFT 16
2185#define AARCH32_ID_ISAR2_MULTS_MASK 0xf0000U
2186#define AARCH32_ID_ISAR2_MULTS_GET( _reg ) \
2187 ( ( ( _reg ) >> 16 ) & 0xfU )
2188
2189#define AARCH32_ID_ISAR2_MULTU( _val ) ( ( _val ) << 20 )
2190#define AARCH32_ID_ISAR2_MULTU_SHIFT 20
2191#define AARCH32_ID_ISAR2_MULTU_MASK 0xf00000U
2192#define AARCH32_ID_ISAR2_MULTU_GET( _reg ) \
2193 ( ( ( _reg ) >> 20 ) & 0xfU )
2194
2195#define AARCH32_ID_ISAR2_PSR_AR( _val ) ( ( _val ) << 24 )
2196#define AARCH32_ID_ISAR2_PSR_AR_SHIFT 24
2197#define AARCH32_ID_ISAR2_PSR_AR_MASK 0xf000000U
2198#define AARCH32_ID_ISAR2_PSR_AR_GET( _reg ) \
2199 ( ( ( _reg ) >> 24 ) & 0xfU )
2200
2201#define AARCH32_ID_ISAR2_REVERSAL( _val ) ( ( _val ) << 28 )
2202#define AARCH32_ID_ISAR2_REVERSAL_SHIFT 28
2203#define AARCH32_ID_ISAR2_REVERSAL_MASK 0xf0000000U
2204#define AARCH32_ID_ISAR2_REVERSAL_GET( _reg ) \
2205 ( ( ( _reg ) >> 28 ) & 0xfU )
2206
2207static inline uint32_t _AArch32_Read_id_isar2( void )
2208{
2209 uint32_t value;
2210
2211 __asm__ volatile (
2212 "mrc p15, 0, %0, c0, c2, 2" : "=&r" ( value ) : : "memory"
2213 );
2214
2215 return value;
2216}
2217
2218/* ID_ISAR3, Instruction Set Attribute Register 3 */
2219
2220#define AARCH32_ID_ISAR3_SATURATE( _val ) ( ( _val ) << 0 )
2221#define AARCH32_ID_ISAR3_SATURATE_SHIFT 0
2222#define AARCH32_ID_ISAR3_SATURATE_MASK 0xfU
2223#define AARCH32_ID_ISAR3_SATURATE_GET( _reg ) \
2224 ( ( ( _reg ) >> 0 ) & 0xfU )
2225
2226#define AARCH32_ID_ISAR3_SIMD( _val ) ( ( _val ) << 4 )
2227#define AARCH32_ID_ISAR3_SIMD_SHIFT 4
2228#define AARCH32_ID_ISAR3_SIMD_MASK 0xf0U
2229#define AARCH32_ID_ISAR3_SIMD_GET( _reg ) \
2230 ( ( ( _reg ) >> 4 ) & 0xfU )
2231
2232#define AARCH32_ID_ISAR3_SVC( _val ) ( ( _val ) << 8 )
2233#define AARCH32_ID_ISAR3_SVC_SHIFT 8
2234#define AARCH32_ID_ISAR3_SVC_MASK 0xf00U
2235#define AARCH32_ID_ISAR3_SVC_GET( _reg ) \
2236 ( ( ( _reg ) >> 8 ) & 0xfU )
2237
2238#define AARCH32_ID_ISAR3_SYNCHPRIM( _val ) ( ( _val ) << 12 )
2239#define AARCH32_ID_ISAR3_SYNCHPRIM_SHIFT 12
2240#define AARCH32_ID_ISAR3_SYNCHPRIM_MASK 0xf000U
2241#define AARCH32_ID_ISAR3_SYNCHPRIM_GET( _reg ) \
2242 ( ( ( _reg ) >> 12 ) & 0xfU )
2243
2244#define AARCH32_ID_ISAR3_TABBRANCH( _val ) ( ( _val ) << 16 )
2245#define AARCH32_ID_ISAR3_TABBRANCH_SHIFT 16
2246#define AARCH32_ID_ISAR3_TABBRANCH_MASK 0xf0000U
2247#define AARCH32_ID_ISAR3_TABBRANCH_GET( _reg ) \
2248 ( ( ( _reg ) >> 16 ) & 0xfU )
2249
2250#define AARCH32_ID_ISAR3_T32COPY( _val ) ( ( _val ) << 20 )
2251#define AARCH32_ID_ISAR3_T32COPY_SHIFT 20
2252#define AARCH32_ID_ISAR3_T32COPY_MASK 0xf00000U
2253#define AARCH32_ID_ISAR3_T32COPY_GET( _reg ) \
2254 ( ( ( _reg ) >> 20 ) & 0xfU )
2255
2256#define AARCH32_ID_ISAR3_TRUENOP( _val ) ( ( _val ) << 24 )
2257#define AARCH32_ID_ISAR3_TRUENOP_SHIFT 24
2258#define AARCH32_ID_ISAR3_TRUENOP_MASK 0xf000000U
2259#define AARCH32_ID_ISAR3_TRUENOP_GET( _reg ) \
2260 ( ( ( _reg ) >> 24 ) & 0xfU )
2261
2262#define AARCH32_ID_ISAR3_T32EE( _val ) ( ( _val ) << 28 )
2263#define AARCH32_ID_ISAR3_T32EE_SHIFT 28
2264#define AARCH32_ID_ISAR3_T32EE_MASK 0xf0000000U
2265#define AARCH32_ID_ISAR3_T32EE_GET( _reg ) \
2266 ( ( ( _reg ) >> 28 ) & 0xfU )
2267
2268static inline uint32_t _AArch32_Read_id_isar3( void )
2269{
2270 uint32_t value;
2271
2272 __asm__ volatile (
2273 "mrc p15, 0, %0, c0, c2, 3" : "=&r" ( value ) : : "memory"
2274 );
2275
2276 return value;
2277}
2278
2279/* ID_ISAR4, Instruction Set Attribute Register 4 */
2280
2281#define AARCH32_ID_ISAR4_UNPRIV( _val ) ( ( _val ) << 0 )
2282#define AARCH32_ID_ISAR4_UNPRIV_SHIFT 0
2283#define AARCH32_ID_ISAR4_UNPRIV_MASK 0xfU
2284#define AARCH32_ID_ISAR4_UNPRIV_GET( _reg ) \
2285 ( ( ( _reg ) >> 0 ) & 0xfU )
2286
2287#define AARCH32_ID_ISAR4_WITHSHIFTS( _val ) ( ( _val ) << 4 )
2288#define AARCH32_ID_ISAR4_WITHSHIFTS_SHIFT 4
2289#define AARCH32_ID_ISAR4_WITHSHIFTS_MASK 0xf0U
2290#define AARCH32_ID_ISAR4_WITHSHIFTS_GET( _reg ) \
2291 ( ( ( _reg ) >> 4 ) & 0xfU )
2292
2293#define AARCH32_ID_ISAR4_WRITEBACK( _val ) ( ( _val ) << 8 )
2294#define AARCH32_ID_ISAR4_WRITEBACK_SHIFT 8
2295#define AARCH32_ID_ISAR4_WRITEBACK_MASK 0xf00U
2296#define AARCH32_ID_ISAR4_WRITEBACK_GET( _reg ) \
2297 ( ( ( _reg ) >> 8 ) & 0xfU )
2298
2299#define AARCH32_ID_ISAR4_SMC( _val ) ( ( _val ) << 12 )
2300#define AARCH32_ID_ISAR4_SMC_SHIFT 12
2301#define AARCH32_ID_ISAR4_SMC_MASK 0xf000U
2302#define AARCH32_ID_ISAR4_SMC_GET( _reg ) \
2303 ( ( ( _reg ) >> 12 ) & 0xfU )
2304
2305#define AARCH32_ID_ISAR4_BARRIER( _val ) ( ( _val ) << 16 )
2306#define AARCH32_ID_ISAR4_BARRIER_SHIFT 16
2307#define AARCH32_ID_ISAR4_BARRIER_MASK 0xf0000U
2308#define AARCH32_ID_ISAR4_BARRIER_GET( _reg ) \
2309 ( ( ( _reg ) >> 16 ) & 0xfU )
2310
2311#define AARCH32_ID_ISAR4_SYNCHPRIM_FRAC( _val ) ( ( _val ) << 20 )
2312#define AARCH32_ID_ISAR4_SYNCHPRIM_FRAC_SHIFT 20
2313#define AARCH32_ID_ISAR4_SYNCHPRIM_FRAC_MASK 0xf00000U
2314#define AARCH32_ID_ISAR4_SYNCHPRIM_FRAC_GET( _reg ) \
2315 ( ( ( _reg ) >> 20 ) & 0xfU )
2316
2317#define AARCH32_ID_ISAR4_PSR_M( _val ) ( ( _val ) << 24 )
2318#define AARCH32_ID_ISAR4_PSR_M_SHIFT 24
2319#define AARCH32_ID_ISAR4_PSR_M_MASK 0xf000000U
2320#define AARCH32_ID_ISAR4_PSR_M_GET( _reg ) \
2321 ( ( ( _reg ) >> 24 ) & 0xfU )
2322
2323#define AARCH32_ID_ISAR4_SWP_FRAC( _val ) ( ( _val ) << 28 )
2324#define AARCH32_ID_ISAR4_SWP_FRAC_SHIFT 28
2325#define AARCH32_ID_ISAR4_SWP_FRAC_MASK 0xf0000000U
2326#define AARCH32_ID_ISAR4_SWP_FRAC_GET( _reg ) \
2327 ( ( ( _reg ) >> 28 ) & 0xfU )
2328
2329static inline uint32_t _AArch32_Read_id_isar4( void )
2330{
2331 uint32_t value;
2332
2333 __asm__ volatile (
2334 "mrc p15, 0, %0, c0, c2, 4" : "=&r" ( value ) : : "memory"
2335 );
2336
2337 return value;
2338}
2339
2340/* ID_ISAR5, Instruction Set Attribute Register 5 */
2341
2342#define AARCH32_ID_ISAR5_SEVL( _val ) ( ( _val ) << 0 )
2343#define AARCH32_ID_ISAR5_SEVL_SHIFT 0
2344#define AARCH32_ID_ISAR5_SEVL_MASK 0xfU
2345#define AARCH32_ID_ISAR5_SEVL_GET( _reg ) \
2346 ( ( ( _reg ) >> 0 ) & 0xfU )
2347
2348#define AARCH32_ID_ISAR5_AES( _val ) ( ( _val ) << 4 )
2349#define AARCH32_ID_ISAR5_AES_SHIFT 4
2350#define AARCH32_ID_ISAR5_AES_MASK 0xf0U
2351#define AARCH32_ID_ISAR5_AES_GET( _reg ) \
2352 ( ( ( _reg ) >> 4 ) & 0xfU )
2353
2354#define AARCH32_ID_ISAR5_SHA1( _val ) ( ( _val ) << 8 )
2355#define AARCH32_ID_ISAR5_SHA1_SHIFT 8
2356#define AARCH32_ID_ISAR5_SHA1_MASK 0xf00U
2357#define AARCH32_ID_ISAR5_SHA1_GET( _reg ) \
2358 ( ( ( _reg ) >> 8 ) & 0xfU )
2359
2360#define AARCH32_ID_ISAR5_SHA2( _val ) ( ( _val ) << 12 )
2361#define AARCH32_ID_ISAR5_SHA2_SHIFT 12
2362#define AARCH32_ID_ISAR5_SHA2_MASK 0xf000U
2363#define AARCH32_ID_ISAR5_SHA2_GET( _reg ) \
2364 ( ( ( _reg ) >> 12 ) & 0xfU )
2365
2366#define AARCH32_ID_ISAR5_CRC32( _val ) ( ( _val ) << 16 )
2367#define AARCH32_ID_ISAR5_CRC32_SHIFT 16
2368#define AARCH32_ID_ISAR5_CRC32_MASK 0xf0000U
2369#define AARCH32_ID_ISAR5_CRC32_GET( _reg ) \
2370 ( ( ( _reg ) >> 16 ) & 0xfU )
2371
2372#define AARCH32_ID_ISAR5_RDM( _val ) ( ( _val ) << 24 )
2373#define AARCH32_ID_ISAR5_RDM_SHIFT 24
2374#define AARCH32_ID_ISAR5_RDM_MASK 0xf000000U
2375#define AARCH32_ID_ISAR5_RDM_GET( _reg ) \
2376 ( ( ( _reg ) >> 24 ) & 0xfU )
2377
2378#define AARCH32_ID_ISAR5_VCMA( _val ) ( ( _val ) << 28 )
2379#define AARCH32_ID_ISAR5_VCMA_SHIFT 28
2380#define AARCH32_ID_ISAR5_VCMA_MASK 0xf0000000U
2381#define AARCH32_ID_ISAR5_VCMA_GET( _reg ) \
2382 ( ( ( _reg ) >> 28 ) & 0xfU )
2383
2384static inline uint32_t _AArch32_Read_id_isar5( void )
2385{
2386 uint32_t value;
2387
2388 __asm__ volatile (
2389 "mrc p15, 0, %0, c0, c2, 5" : "=&r" ( value ) : : "memory"
2390 );
2391
2392 return value;
2393}
2394
2395/* ID_ISAR6, Instruction Set Attribute Register 6 */
2396
2397#define AARCH32_ID_ISAR6_JSCVT( _val ) ( ( _val ) << 0 )
2398#define AARCH32_ID_ISAR6_JSCVT_SHIFT 0
2399#define AARCH32_ID_ISAR6_JSCVT_MASK 0xfU
2400#define AARCH32_ID_ISAR6_JSCVT_GET( _reg ) \
2401 ( ( ( _reg ) >> 0 ) & 0xfU )
2402
2403#define AARCH32_ID_ISAR6_DP( _val ) ( ( _val ) << 4 )
2404#define AARCH32_ID_ISAR6_DP_SHIFT 4
2405#define AARCH32_ID_ISAR6_DP_MASK 0xf0U
2406#define AARCH32_ID_ISAR6_DP_GET( _reg ) \
2407 ( ( ( _reg ) >> 4 ) & 0xfU )
2408
2409#define AARCH32_ID_ISAR6_FHM( _val ) ( ( _val ) << 8 )
2410#define AARCH32_ID_ISAR6_FHM_SHIFT 8
2411#define AARCH32_ID_ISAR6_FHM_MASK 0xf00U
2412#define AARCH32_ID_ISAR6_FHM_GET( _reg ) \
2413 ( ( ( _reg ) >> 8 ) & 0xfU )
2414
2415#define AARCH32_ID_ISAR6_SB( _val ) ( ( _val ) << 12 )
2416#define AARCH32_ID_ISAR6_SB_SHIFT 12
2417#define AARCH32_ID_ISAR6_SB_MASK 0xf000U
2418#define AARCH32_ID_ISAR6_SB_GET( _reg ) \
2419 ( ( ( _reg ) >> 12 ) & 0xfU )
2420
2421#define AARCH32_ID_ISAR6_SPECRES( _val ) ( ( _val ) << 16 )
2422#define AARCH32_ID_ISAR6_SPECRES_SHIFT 16
2423#define AARCH32_ID_ISAR6_SPECRES_MASK 0xf0000U
2424#define AARCH32_ID_ISAR6_SPECRES_GET( _reg ) \
2425 ( ( ( _reg ) >> 16 ) & 0xfU )
2426
2427#define AARCH32_ID_ISAR6_BF16( _val ) ( ( _val ) << 20 )
2428#define AARCH32_ID_ISAR6_BF16_SHIFT 20
2429#define AARCH32_ID_ISAR6_BF16_MASK 0xf00000U
2430#define AARCH32_ID_ISAR6_BF16_GET( _reg ) \
2431 ( ( ( _reg ) >> 20 ) & 0xfU )
2432
2433#define AARCH32_ID_ISAR6_I8MM( _val ) ( ( _val ) << 24 )
2434#define AARCH32_ID_ISAR6_I8MM_SHIFT 24
2435#define AARCH32_ID_ISAR6_I8MM_MASK 0xf000000U
2436#define AARCH32_ID_ISAR6_I8MM_GET( _reg ) \
2437 ( ( ( _reg ) >> 24 ) & 0xfU )
2438
2439static inline uint32_t _AArch32_Read_id_isar6( void )
2440{
2441 uint32_t value;
2442
2443 __asm__ volatile (
2444 "mrc p15, 0, %0, c0, c2, 7" : "=&r" ( value ) : : "memory"
2445 );
2446
2447 return value;
2448}
2449
2450/* ID_MMFR0, Memory Model Feature Register 0 */
2451
2452#define AARCH32_ID_MMFR0_VMSA( _val ) ( ( _val ) << 0 )
2453#define AARCH32_ID_MMFR0_VMSA_SHIFT 0
2454#define AARCH32_ID_MMFR0_VMSA_MASK 0xfU
2455#define AARCH32_ID_MMFR0_VMSA_GET( _reg ) \
2456 ( ( ( _reg ) >> 0 ) & 0xfU )
2457
2458#define AARCH32_ID_MMFR0_PMSA( _val ) ( ( _val ) << 4 )
2459#define AARCH32_ID_MMFR0_PMSA_SHIFT 4
2460#define AARCH32_ID_MMFR0_PMSA_MASK 0xf0U
2461#define AARCH32_ID_MMFR0_PMSA_GET( _reg ) \
2462 ( ( ( _reg ) >> 4 ) & 0xfU )
2463
2464#define AARCH32_ID_MMFR0_OUTERSHR( _val ) ( ( _val ) << 8 )
2465#define AARCH32_ID_MMFR0_OUTERSHR_SHIFT 8
2466#define AARCH32_ID_MMFR0_OUTERSHR_MASK 0xf00U
2467#define AARCH32_ID_MMFR0_OUTERSHR_GET( _reg ) \
2468 ( ( ( _reg ) >> 8 ) & 0xfU )
2469
2470#define AARCH32_ID_MMFR0_SHARELVL( _val ) ( ( _val ) << 12 )
2471#define AARCH32_ID_MMFR0_SHARELVL_SHIFT 12
2472#define AARCH32_ID_MMFR0_SHARELVL_MASK 0xf000U
2473#define AARCH32_ID_MMFR0_SHARELVL_GET( _reg ) \
2474 ( ( ( _reg ) >> 12 ) & 0xfU )
2475
2476#define AARCH32_ID_MMFR0_TCM( _val ) ( ( _val ) << 16 )
2477#define AARCH32_ID_MMFR0_TCM_SHIFT 16
2478#define AARCH32_ID_MMFR0_TCM_MASK 0xf0000U
2479#define AARCH32_ID_MMFR0_TCM_GET( _reg ) \
2480 ( ( ( _reg ) >> 16 ) & 0xfU )
2481
2482#define AARCH32_ID_MMFR0_AUXREG( _val ) ( ( _val ) << 20 )
2483#define AARCH32_ID_MMFR0_AUXREG_SHIFT 20
2484#define AARCH32_ID_MMFR0_AUXREG_MASK 0xf00000U
2485#define AARCH32_ID_MMFR0_AUXREG_GET( _reg ) \
2486 ( ( ( _reg ) >> 20 ) & 0xfU )
2487
2488#define AARCH32_ID_MMFR0_FCSE( _val ) ( ( _val ) << 24 )
2489#define AARCH32_ID_MMFR0_FCSE_SHIFT 24
2490#define AARCH32_ID_MMFR0_FCSE_MASK 0xf000000U
2491#define AARCH32_ID_MMFR0_FCSE_GET( _reg ) \
2492 ( ( ( _reg ) >> 24 ) & 0xfU )
2493
2494#define AARCH32_ID_MMFR0_INNERSHR( _val ) ( ( _val ) << 28 )
2495#define AARCH32_ID_MMFR0_INNERSHR_SHIFT 28
2496#define AARCH32_ID_MMFR0_INNERSHR_MASK 0xf0000000U
2497#define AARCH32_ID_MMFR0_INNERSHR_GET( _reg ) \
2498 ( ( ( _reg ) >> 28 ) & 0xfU )
2499
2500static inline uint32_t _AArch32_Read_id_mmfr0( void )
2501{
2502 uint32_t value;
2503
2504 __asm__ volatile (
2505 "mrc p15, 0, %0, c0, c1, 4" : "=&r" ( value ) : : "memory"
2506 );
2507
2508 return value;
2509}
2510
2511/* ID_MMFR1, Memory Model Feature Register 1 */
2512
2513#define AARCH32_ID_MMFR1_L1HVDVA( _val ) ( ( _val ) << 0 )
2514#define AARCH32_ID_MMFR1_L1HVDVA_SHIFT 0
2515#define AARCH32_ID_MMFR1_L1HVDVA_MASK 0xfU
2516#define AARCH32_ID_MMFR1_L1HVDVA_GET( _reg ) \
2517 ( ( ( _reg ) >> 0 ) & 0xfU )
2518
2519#define AARCH32_ID_MMFR1_L1UNIVA( _val ) ( ( _val ) << 4 )
2520#define AARCH32_ID_MMFR1_L1UNIVA_SHIFT 4
2521#define AARCH32_ID_MMFR1_L1UNIVA_MASK 0xf0U
2522#define AARCH32_ID_MMFR1_L1UNIVA_GET( _reg ) \
2523 ( ( ( _reg ) >> 4 ) & 0xfU )
2524
2525#define AARCH32_ID_MMFR1_L1HVDSW( _val ) ( ( _val ) << 8 )
2526#define AARCH32_ID_MMFR1_L1HVDSW_SHIFT 8
2527#define AARCH32_ID_MMFR1_L1HVDSW_MASK 0xf00U
2528#define AARCH32_ID_MMFR1_L1HVDSW_GET( _reg ) \
2529 ( ( ( _reg ) >> 8 ) & 0xfU )
2530
2531#define AARCH32_ID_MMFR1_L1UNISW( _val ) ( ( _val ) << 12 )
2532#define AARCH32_ID_MMFR1_L1UNISW_SHIFT 12
2533#define AARCH32_ID_MMFR1_L1UNISW_MASK 0xf000U
2534#define AARCH32_ID_MMFR1_L1UNISW_GET( _reg ) \
2535 ( ( ( _reg ) >> 12 ) & 0xfU )
2536
2537#define AARCH32_ID_MMFR1_L1HVD( _val ) ( ( _val ) << 16 )
2538#define AARCH32_ID_MMFR1_L1HVD_SHIFT 16
2539#define AARCH32_ID_MMFR1_L1HVD_MASK 0xf0000U
2540#define AARCH32_ID_MMFR1_L1HVD_GET( _reg ) \
2541 ( ( ( _reg ) >> 16 ) & 0xfU )
2542
2543#define AARCH32_ID_MMFR1_L1UNI( _val ) ( ( _val ) << 20 )
2544#define AARCH32_ID_MMFR1_L1UNI_SHIFT 20
2545#define AARCH32_ID_MMFR1_L1UNI_MASK 0xf00000U
2546#define AARCH32_ID_MMFR1_L1UNI_GET( _reg ) \
2547 ( ( ( _reg ) >> 20 ) & 0xfU )
2548
2549#define AARCH32_ID_MMFR1_L1TSTCLN( _val ) ( ( _val ) << 24 )
2550#define AARCH32_ID_MMFR1_L1TSTCLN_SHIFT 24
2551#define AARCH32_ID_MMFR1_L1TSTCLN_MASK 0xf000000U
2552#define AARCH32_ID_MMFR1_L1TSTCLN_GET( _reg ) \
2553 ( ( ( _reg ) >> 24 ) & 0xfU )
2554
2555#define AARCH32_ID_MMFR1_BPRED( _val ) ( ( _val ) << 28 )
2556#define AARCH32_ID_MMFR1_BPRED_SHIFT 28
2557#define AARCH32_ID_MMFR1_BPRED_MASK 0xf0000000U
2558#define AARCH32_ID_MMFR1_BPRED_GET( _reg ) \
2559 ( ( ( _reg ) >> 28 ) & 0xfU )
2560
2561static inline uint32_t _AArch32_Read_id_mmfr1( void )
2562{
2563 uint32_t value;
2564
2565 __asm__ volatile (
2566 "mrc p15, 0, %0, c0, c1, 5" : "=&r" ( value ) : : "memory"
2567 );
2568
2569 return value;
2570}
2571
2572/* ID_MMFR2, Memory Model Feature Register 2 */
2573
2574#define AARCH32_ID_MMFR2_L1HVDFG( _val ) ( ( _val ) << 0 )
2575#define AARCH32_ID_MMFR2_L1HVDFG_SHIFT 0
2576#define AARCH32_ID_MMFR2_L1HVDFG_MASK 0xfU
2577#define AARCH32_ID_MMFR2_L1HVDFG_GET( _reg ) \
2578 ( ( ( _reg ) >> 0 ) & 0xfU )
2579
2580#define AARCH32_ID_MMFR2_L1HVDBG( _val ) ( ( _val ) << 4 )
2581#define AARCH32_ID_MMFR2_L1HVDBG_SHIFT 4
2582#define AARCH32_ID_MMFR2_L1HVDBG_MASK 0xf0U
2583#define AARCH32_ID_MMFR2_L1HVDBG_GET( _reg ) \
2584 ( ( ( _reg ) >> 4 ) & 0xfU )
2585
2586#define AARCH32_ID_MMFR2_L1HVDRNG( _val ) ( ( _val ) << 8 )
2587#define AARCH32_ID_MMFR2_L1HVDRNG_SHIFT 8
2588#define AARCH32_ID_MMFR2_L1HVDRNG_MASK 0xf00U
2589#define AARCH32_ID_MMFR2_L1HVDRNG_GET( _reg ) \
2590 ( ( ( _reg ) >> 8 ) & 0xfU )
2591
2592#define AARCH32_ID_MMFR2_HVDTLB( _val ) ( ( _val ) << 12 )
2593#define AARCH32_ID_MMFR2_HVDTLB_SHIFT 12
2594#define AARCH32_ID_MMFR2_HVDTLB_MASK 0xf000U
2595#define AARCH32_ID_MMFR2_HVDTLB_GET( _reg ) \
2596 ( ( ( _reg ) >> 12 ) & 0xfU )
2597
2598#define AARCH32_ID_MMFR2_UNITLB( _val ) ( ( _val ) << 16 )
2599#define AARCH32_ID_MMFR2_UNITLB_SHIFT 16
2600#define AARCH32_ID_MMFR2_UNITLB_MASK 0xf0000U
2601#define AARCH32_ID_MMFR2_UNITLB_GET( _reg ) \
2602 ( ( ( _reg ) >> 16 ) & 0xfU )
2603
2604#define AARCH32_ID_MMFR2_MEMBARR( _val ) ( ( _val ) << 20 )
2605#define AARCH32_ID_MMFR2_MEMBARR_SHIFT 20
2606#define AARCH32_ID_MMFR2_MEMBARR_MASK 0xf00000U
2607#define AARCH32_ID_MMFR2_MEMBARR_GET( _reg ) \
2608 ( ( ( _reg ) >> 20 ) & 0xfU )
2609
2610#define AARCH32_ID_MMFR2_WFISTALL( _val ) ( ( _val ) << 24 )
2611#define AARCH32_ID_MMFR2_WFISTALL_SHIFT 24
2612#define AARCH32_ID_MMFR2_WFISTALL_MASK 0xf000000U
2613#define AARCH32_ID_MMFR2_WFISTALL_GET( _reg ) \
2614 ( ( ( _reg ) >> 24 ) & 0xfU )
2615
2616#define AARCH32_ID_MMFR2_HWACCFLG( _val ) ( ( _val ) << 28 )
2617#define AARCH32_ID_MMFR2_HWACCFLG_SHIFT 28
2618#define AARCH32_ID_MMFR2_HWACCFLG_MASK 0xf0000000U
2619#define AARCH32_ID_MMFR2_HWACCFLG_GET( _reg ) \
2620 ( ( ( _reg ) >> 28 ) & 0xfU )
2621
2622static inline uint32_t _AArch32_Read_id_mmfr2( void )
2623{
2624 uint32_t value;
2625
2626 __asm__ volatile (
2627 "mrc p15, 0, %0, c0, c1, 6" : "=&r" ( value ) : : "memory"
2628 );
2629
2630 return value;
2631}
2632
2633/* ID_MMFR3, Memory Model Feature Register 3 */
2634
2635#define AARCH32_ID_MMFR3_CMAINTVA( _val ) ( ( _val ) << 0 )
2636#define AARCH32_ID_MMFR3_CMAINTVA_SHIFT 0
2637#define AARCH32_ID_MMFR3_CMAINTVA_MASK 0xfU
2638#define AARCH32_ID_MMFR3_CMAINTVA_GET( _reg ) \
2639 ( ( ( _reg ) >> 0 ) & 0xfU )
2640
2641#define AARCH32_ID_MMFR3_CMAINTSW( _val ) ( ( _val ) << 4 )
2642#define AARCH32_ID_MMFR3_CMAINTSW_SHIFT 4
2643#define AARCH32_ID_MMFR3_CMAINTSW_MASK 0xf0U
2644#define AARCH32_ID_MMFR3_CMAINTSW_GET( _reg ) \
2645 ( ( ( _reg ) >> 4 ) & 0xfU )
2646
2647#define AARCH32_ID_MMFR3_BPMAINT( _val ) ( ( _val ) << 8 )
2648#define AARCH32_ID_MMFR3_BPMAINT_SHIFT 8
2649#define AARCH32_ID_MMFR3_BPMAINT_MASK 0xf00U
2650#define AARCH32_ID_MMFR3_BPMAINT_GET( _reg ) \
2651 ( ( ( _reg ) >> 8 ) & 0xfU )
2652
2653#define AARCH32_ID_MMFR3_MAINTBCST( _val ) ( ( _val ) << 12 )
2654#define AARCH32_ID_MMFR3_MAINTBCST_SHIFT 12
2655#define AARCH32_ID_MMFR3_MAINTBCST_MASK 0xf000U
2656#define AARCH32_ID_MMFR3_MAINTBCST_GET( _reg ) \
2657 ( ( ( _reg ) >> 12 ) & 0xfU )
2658
2659#define AARCH32_ID_MMFR3_PAN( _val ) ( ( _val ) << 16 )
2660#define AARCH32_ID_MMFR3_PAN_SHIFT 16
2661#define AARCH32_ID_MMFR3_PAN_MASK 0xf0000U
2662#define AARCH32_ID_MMFR3_PAN_GET( _reg ) \
2663 ( ( ( _reg ) >> 16 ) & 0xfU )
2664
2665#define AARCH32_ID_MMFR3_COHWALK( _val ) ( ( _val ) << 20 )
2666#define AARCH32_ID_MMFR3_COHWALK_SHIFT 20
2667#define AARCH32_ID_MMFR3_COHWALK_MASK 0xf00000U
2668#define AARCH32_ID_MMFR3_COHWALK_GET( _reg ) \
2669 ( ( ( _reg ) >> 20 ) & 0xfU )
2670
2671#define AARCH32_ID_MMFR3_CMEMSZ( _val ) ( ( _val ) << 24 )
2672#define AARCH32_ID_MMFR3_CMEMSZ_SHIFT 24
2673#define AARCH32_ID_MMFR3_CMEMSZ_MASK 0xf000000U
2674#define AARCH32_ID_MMFR3_CMEMSZ_GET( _reg ) \
2675 ( ( ( _reg ) >> 24 ) & 0xfU )
2676
2677#define AARCH32_ID_MMFR3_SUPERSEC( _val ) ( ( _val ) << 28 )
2678#define AARCH32_ID_MMFR3_SUPERSEC_SHIFT 28
2679#define AARCH32_ID_MMFR3_SUPERSEC_MASK 0xf0000000U
2680#define AARCH32_ID_MMFR3_SUPERSEC_GET( _reg ) \
2681 ( ( ( _reg ) >> 28 ) & 0xfU )
2682
2683static inline uint32_t _AArch32_Read_id_mmfr3( void )
2684{
2685 uint32_t value;
2686
2687 __asm__ volatile (
2688 "mrc p15, 0, %0, c0, c1, 7" : "=&r" ( value ) : : "memory"
2689 );
2690
2691 return value;
2692}
2693
2694/* ID_MMFR4, Memory Model Feature Register 4 */
2695
2696#define AARCH32_ID_MMFR4_SPECSEI( _val ) ( ( _val ) << 0 )
2697#define AARCH32_ID_MMFR4_SPECSEI_SHIFT 0
2698#define AARCH32_ID_MMFR4_SPECSEI_MASK 0xfU
2699#define AARCH32_ID_MMFR4_SPECSEI_GET( _reg ) \
2700 ( ( ( _reg ) >> 0 ) & 0xfU )
2701
2702#define AARCH32_ID_MMFR4_AC2( _val ) ( ( _val ) << 4 )
2703#define AARCH32_ID_MMFR4_AC2_SHIFT 4
2704#define AARCH32_ID_MMFR4_AC2_MASK 0xf0U
2705#define AARCH32_ID_MMFR4_AC2_GET( _reg ) \
2706 ( ( ( _reg ) >> 4 ) & 0xfU )
2707
2708#define AARCH32_ID_MMFR4_XNX( _val ) ( ( _val ) << 8 )
2709#define AARCH32_ID_MMFR4_XNX_SHIFT 8
2710#define AARCH32_ID_MMFR4_XNX_MASK 0xf00U
2711#define AARCH32_ID_MMFR4_XNX_GET( _reg ) \
2712 ( ( ( _reg ) >> 8 ) & 0xfU )
2713
2714#define AARCH32_ID_MMFR4_CNP( _val ) ( ( _val ) << 12 )
2715#define AARCH32_ID_MMFR4_CNP_SHIFT 12
2716#define AARCH32_ID_MMFR4_CNP_MASK 0xf000U
2717#define AARCH32_ID_MMFR4_CNP_GET( _reg ) \
2718 ( ( ( _reg ) >> 12 ) & 0xfU )
2719
2720#define AARCH32_ID_MMFR4_HPDS( _val ) ( ( _val ) << 16 )
2721#define AARCH32_ID_MMFR4_HPDS_SHIFT 16
2722#define AARCH32_ID_MMFR4_HPDS_MASK 0xf0000U
2723#define AARCH32_ID_MMFR4_HPDS_GET( _reg ) \
2724 ( ( ( _reg ) >> 16 ) & 0xfU )
2725
2726#define AARCH32_ID_MMFR4_LSM( _val ) ( ( _val ) << 20 )
2727#define AARCH32_ID_MMFR4_LSM_SHIFT 20
2728#define AARCH32_ID_MMFR4_LSM_MASK 0xf00000U
2729#define AARCH32_ID_MMFR4_LSM_GET( _reg ) \
2730 ( ( ( _reg ) >> 20 ) & 0xfU )
2731
2732#define AARCH32_ID_MMFR4_CCIDX( _val ) ( ( _val ) << 24 )
2733#define AARCH32_ID_MMFR4_CCIDX_SHIFT 24
2734#define AARCH32_ID_MMFR4_CCIDX_MASK 0xf000000U
2735#define AARCH32_ID_MMFR4_CCIDX_GET( _reg ) \
2736 ( ( ( _reg ) >> 24 ) & 0xfU )
2737
2738#define AARCH32_ID_MMFR4_EVT( _val ) ( ( _val ) << 28 )
2739#define AARCH32_ID_MMFR4_EVT_SHIFT 28
2740#define AARCH32_ID_MMFR4_EVT_MASK 0xf0000000U
2741#define AARCH32_ID_MMFR4_EVT_GET( _reg ) \
2742 ( ( ( _reg ) >> 28 ) & 0xfU )
2743
2744static inline uint32_t _AArch32_Read_id_mmfr4( void )
2745{
2746 uint32_t value;
2747
2748 __asm__ volatile (
2749 "mrc p15, 0, %0, c0, c2, 6" : "=&r" ( value ) : : "memory"
2750 );
2751
2752 return value;
2753}
2754
2755/* ID_MMFR5, Memory Model Feature Register 5 */
2756
2757#define AARCH32_ID_MMFR5_ETS( _val ) ( ( _val ) << 0 )
2758#define AARCH32_ID_MMFR5_ETS_SHIFT 0
2759#define AARCH32_ID_MMFR5_ETS_MASK 0xfU
2760#define AARCH32_ID_MMFR5_ETS_GET( _reg ) \
2761 ( ( ( _reg ) >> 0 ) & 0xfU )
2762
2763static inline uint32_t _AArch32_Read_id_mmfr5( void )
2764{
2765 uint32_t value;
2766
2767 __asm__ volatile (
2768 "mrc p15, 0, %0, c0, c3, 6" : "=&r" ( value ) : : "memory"
2769 );
2770
2771 return value;
2772}
2773
2774/* ID_PFR0, Processor Feature Register 0 */
2775
2776#define AARCH32_ID_PFR0_STATE0( _val ) ( ( _val ) << 0 )
2777#define AARCH32_ID_PFR0_STATE0_SHIFT 0
2778#define AARCH32_ID_PFR0_STATE0_MASK 0xfU
2779#define AARCH32_ID_PFR0_STATE0_GET( _reg ) \
2780 ( ( ( _reg ) >> 0 ) & 0xfU )
2781
2782#define AARCH32_ID_PFR0_STATE1( _val ) ( ( _val ) << 4 )
2783#define AARCH32_ID_PFR0_STATE1_SHIFT 4
2784#define AARCH32_ID_PFR0_STATE1_MASK 0xf0U
2785#define AARCH32_ID_PFR0_STATE1_GET( _reg ) \
2786 ( ( ( _reg ) >> 4 ) & 0xfU )
2787
2788#define AARCH32_ID_PFR0_STATE2( _val ) ( ( _val ) << 8 )
2789#define AARCH32_ID_PFR0_STATE2_SHIFT 8
2790#define AARCH32_ID_PFR0_STATE2_MASK 0xf00U
2791#define AARCH32_ID_PFR0_STATE2_GET( _reg ) \
2792 ( ( ( _reg ) >> 8 ) & 0xfU )
2793
2794#define AARCH32_ID_PFR0_STATE3( _val ) ( ( _val ) << 12 )
2795#define AARCH32_ID_PFR0_STATE3_SHIFT 12
2796#define AARCH32_ID_PFR0_STATE3_MASK 0xf000U
2797#define AARCH32_ID_PFR0_STATE3_GET( _reg ) \
2798 ( ( ( _reg ) >> 12 ) & 0xfU )
2799
2800#define AARCH32_ID_PFR0_CSV2( _val ) ( ( _val ) << 16 )
2801#define AARCH32_ID_PFR0_CSV2_SHIFT 16
2802#define AARCH32_ID_PFR0_CSV2_MASK 0xf0000U
2803#define AARCH32_ID_PFR0_CSV2_GET( _reg ) \
2804 ( ( ( _reg ) >> 16 ) & 0xfU )
2805
2806#define AARCH32_ID_PFR0_AMU( _val ) ( ( _val ) << 20 )
2807#define AARCH32_ID_PFR0_AMU_SHIFT 20
2808#define AARCH32_ID_PFR0_AMU_MASK 0xf00000U
2809#define AARCH32_ID_PFR0_AMU_GET( _reg ) \
2810 ( ( ( _reg ) >> 20 ) & 0xfU )
2811
2812#define AARCH32_ID_PFR0_DIT( _val ) ( ( _val ) << 24 )
2813#define AARCH32_ID_PFR0_DIT_SHIFT 24
2814#define AARCH32_ID_PFR0_DIT_MASK 0xf000000U
2815#define AARCH32_ID_PFR0_DIT_GET( _reg ) \
2816 ( ( ( _reg ) >> 24 ) & 0xfU )
2817
2818#define AARCH32_ID_PFR0_RAS( _val ) ( ( _val ) << 28 )
2819#define AARCH32_ID_PFR0_RAS_SHIFT 28
2820#define AARCH32_ID_PFR0_RAS_MASK 0xf0000000U
2821#define AARCH32_ID_PFR0_RAS_GET( _reg ) \
2822 ( ( ( _reg ) >> 28 ) & 0xfU )
2823
2824static inline uint32_t _AArch32_Read_id_pfr0( void )
2825{
2826 uint32_t value;
2827
2828 __asm__ volatile (
2829 "mrc p15, 0, %0, c0, c1, 0" : "=&r" ( value ) : : "memory"
2830 );
2831
2832 return value;
2833}
2834
2835/* ID_PFR1, Processor Feature Register 1 */
2836
2837#define AARCH32_ID_PFR1_PROGMOD( _val ) ( ( _val ) << 0 )
2838#define AARCH32_ID_PFR1_PROGMOD_SHIFT 0
2839#define AARCH32_ID_PFR1_PROGMOD_MASK 0xfU
2840#define AARCH32_ID_PFR1_PROGMOD_GET( _reg ) \
2841 ( ( ( _reg ) >> 0 ) & 0xfU )
2842
2843#define AARCH32_ID_PFR1_SECURITY( _val ) ( ( _val ) << 4 )
2844#define AARCH32_ID_PFR1_SECURITY_SHIFT 4
2845#define AARCH32_ID_PFR1_SECURITY_MASK 0xf0U
2846#define AARCH32_ID_PFR1_SECURITY_GET( _reg ) \
2847 ( ( ( _reg ) >> 4 ) & 0xfU )
2848
2849#define AARCH32_ID_PFR1_MPROGMOD( _val ) ( ( _val ) << 8 )
2850#define AARCH32_ID_PFR1_MPROGMOD_SHIFT 8
2851#define AARCH32_ID_PFR1_MPROGMOD_MASK 0xf00U
2852#define AARCH32_ID_PFR1_MPROGMOD_GET( _reg ) \
2853 ( ( ( _reg ) >> 8 ) & 0xfU )
2854
2855#define AARCH32_ID_PFR1_VIRTUALIZATION( _val ) ( ( _val ) << 12 )
2856#define AARCH32_ID_PFR1_VIRTUALIZATION_SHIFT 12
2857#define AARCH32_ID_PFR1_VIRTUALIZATION_MASK 0xf000U
2858#define AARCH32_ID_PFR1_VIRTUALIZATION_GET( _reg ) \
2859 ( ( ( _reg ) >> 12 ) & 0xfU )
2860
2861#define AARCH32_ID_PFR1_GENTIMER( _val ) ( ( _val ) << 16 )
2862#define AARCH32_ID_PFR1_GENTIMER_SHIFT 16
2863#define AARCH32_ID_PFR1_GENTIMER_MASK 0xf0000U
2864#define AARCH32_ID_PFR1_GENTIMER_GET( _reg ) \
2865 ( ( ( _reg ) >> 16 ) & 0xfU )
2866
2867#define AARCH32_ID_PFR1_SEC_FRAC( _val ) ( ( _val ) << 20 )
2868#define AARCH32_ID_PFR1_SEC_FRAC_SHIFT 20
2869#define AARCH32_ID_PFR1_SEC_FRAC_MASK 0xf00000U
2870#define AARCH32_ID_PFR1_SEC_FRAC_GET( _reg ) \
2871 ( ( ( _reg ) >> 20 ) & 0xfU )
2872
2873#define AARCH32_ID_PFR1_VIRT_FRAC( _val ) ( ( _val ) << 24 )
2874#define AARCH32_ID_PFR1_VIRT_FRAC_SHIFT 24
2875#define AARCH32_ID_PFR1_VIRT_FRAC_MASK 0xf000000U
2876#define AARCH32_ID_PFR1_VIRT_FRAC_GET( _reg ) \
2877 ( ( ( _reg ) >> 24 ) & 0xfU )
2878
2879#define AARCH32_ID_PFR1_GIC( _val ) ( ( _val ) << 28 )
2880#define AARCH32_ID_PFR1_GIC_SHIFT 28
2881#define AARCH32_ID_PFR1_GIC_MASK 0xf0000000U
2882#define AARCH32_ID_PFR1_GIC_GET( _reg ) \
2883 ( ( ( _reg ) >> 28 ) & 0xfU )
2884
2885static inline uint32_t _AArch32_Read_id_pfr1( void )
2886{
2887 uint32_t value;
2888
2889 __asm__ volatile (
2890 "mrc p15, 0, %0, c0, c1, 1" : "=&r" ( value ) : : "memory"
2891 );
2892
2893 return value;
2894}
2895
2896/* ID_PFR2, Processor Feature Register 2 */
2897
2898#define AARCH32_ID_PFR2_CSV3( _val ) ( ( _val ) << 0 )
2899#define AARCH32_ID_PFR2_CSV3_SHIFT 0
2900#define AARCH32_ID_PFR2_CSV3_MASK 0xfU
2901#define AARCH32_ID_PFR2_CSV3_GET( _reg ) \
2902 ( ( ( _reg ) >> 0 ) & 0xfU )
2903
2904#define AARCH32_ID_PFR2_SSBS( _val ) ( ( _val ) << 4 )
2905#define AARCH32_ID_PFR2_SSBS_SHIFT 4
2906#define AARCH32_ID_PFR2_SSBS_MASK 0xf0U
2907#define AARCH32_ID_PFR2_SSBS_GET( _reg ) \
2908 ( ( ( _reg ) >> 4 ) & 0xfU )
2909
2910#define AARCH32_ID_PFR2_RAS_FRAC( _val ) ( ( _val ) << 8 )
2911#define AARCH32_ID_PFR2_RAS_FRAC_SHIFT 8
2912#define AARCH32_ID_PFR2_RAS_FRAC_MASK 0xf00U
2913#define AARCH32_ID_PFR2_RAS_FRAC_GET( _reg ) \
2914 ( ( ( _reg ) >> 8 ) & 0xfU )
2915
2916static inline uint32_t _AArch32_Read_id_pfr2( void )
2917{
2918 uint32_t value;
2919
2920 __asm__ volatile (
2921 "mrc p15, 0, %0, c0, c3, 4" : "=&r" ( value ) : : "memory"
2922 );
2923
2924 return value;
2925}
2926
2927/* IFAR, Instruction Fault Address Register */
2928
2929static inline uint32_t _AArch32_Read_ifar( void )
2930{
2931 uint32_t value;
2932
2933 __asm__ volatile (
2934 "mrc p15, 0, %0, c6, c0, 2" : "=&r" ( value ) : : "memory"
2935 );
2936
2937 return value;
2938}
2939
2940static inline void _AArch32_Write_ifar( uint32_t value )
2941{
2942 __asm__ volatile (
2943 "mcr p15, 0, %0, c6, c0, 2" : : "r" ( value ) : "memory"
2944 );
2945}
2946
2947/* IFSR, Instruction Fault Status Register */
2948
2949#define AARCH32_IFSR_FS_3_0( _val ) ( ( _val ) << 0 )
2950#define AARCH32_IFSR_FS_3_0_SHIFT 0
2951#define AARCH32_IFSR_FS_3_0_MASK 0xfU
2952#define AARCH32_IFSR_FS_3_0_GET( _reg ) \
2953 ( ( ( _reg ) >> 0 ) & 0xfU )
2954
2955#define AARCH32_IFSR_STATUS( _val ) ( ( _val ) << 0 )
2956#define AARCH32_IFSR_STATUS_SHIFT 0
2957#define AARCH32_IFSR_STATUS_MASK 0x3fU
2958#define AARCH32_IFSR_STATUS_GET( _reg ) \
2959 ( ( ( _reg ) >> 0 ) & 0x3fU )
2960
2961#define AARCH32_IFSR_LPAE 0x200U
2962
2963#define AARCH32_IFSR_FS_4 0x400U
2964
2965#define AARCH32_IFSR_EXT 0x1000U
2966
2967#define AARCH32_IFSR_FNV 0x10000U
2968
2969static inline uint32_t _AArch32_Read_ifsr( void )
2970{
2971 uint32_t value;
2972
2973 __asm__ volatile (
2974 "mrc p15, 0, %0, c5, c0, 1" : "=&r" ( value ) : : "memory"
2975 );
2976
2977 return value;
2978}
2979
2980static inline void _AArch32_Write_ifsr( uint32_t value )
2981{
2982 __asm__ volatile (
2983 "mcr p15, 0, %0, c5, c0, 1" : : "r" ( value ) : "memory"
2984 );
2985}
2986
2987/* ISR, Interrupt Status Register */
2988
2989#define AARCH32_ISR_F 0x40U
2990
2991#define AARCH32_ISR_I 0x80U
2992
2993#define AARCH32_ISR_A 0x100U
2994
2995static inline uint32_t _AArch32_Read_isr( void )
2996{
2997 uint32_t value;
2998
2999 __asm__ volatile (
3000 "mrc p15, 0, %0, c12, c1, 0" : "=&r" ( value ) : : "memory"
3001 );
3002
3003 return value;
3004}
3005
3006/* ITLBIALL, Instruction TLB Invalidate All */
3007
3008static inline void _AArch32_Write_itlbiall( uint32_t value )
3009{
3010 __asm__ volatile (
3011 "mcr p15, 0, %0, c8, c5, 0" : : "r" ( value ) : "memory"
3012 );
3013}
3014
3015/* ITLBIASID, Instruction TLB Invalidate by ASID match */
3016
3017#define AARCH32_ITLBIASID_ASID( _val ) ( ( _val ) << 0 )
3018#define AARCH32_ITLBIASID_ASID_SHIFT 0
3019#define AARCH32_ITLBIASID_ASID_MASK 0xffU
3020#define AARCH32_ITLBIASID_ASID_GET( _reg ) \
3021 ( ( ( _reg ) >> 0 ) & 0xffU )
3022
3023static inline void _AArch32_Write_itlbiasid( uint32_t value )
3024{
3025 __asm__ volatile (
3026 "mcr p15, 0, %0, c8, c5, 2" : : "r" ( value ) : "memory"
3027 );
3028}
3029
3030/* ITLBIMVA, Instruction TLB Invalidate by VA */
3031
3032#define AARCH32_ITLBIMVA_ASID( _val ) ( ( _val ) << 0 )
3033#define AARCH32_ITLBIMVA_ASID_SHIFT 0
3034#define AARCH32_ITLBIMVA_ASID_MASK 0xffU
3035#define AARCH32_ITLBIMVA_ASID_GET( _reg ) \
3036 ( ( ( _reg ) >> 0 ) & 0xffU )
3037
3038#define AARCH32_ITLBIMVA_VA( _val ) ( ( _val ) << 12 )
3039#define AARCH32_ITLBIMVA_VA_SHIFT 12
3040#define AARCH32_ITLBIMVA_VA_MASK 0xfffff000U
3041#define AARCH32_ITLBIMVA_VA_GET( _reg ) \
3042 ( ( ( _reg ) >> 12 ) & 0xfffffU )
3043
3044static inline void _AArch32_Write_itlbimva( uint32_t value )
3045{
3046 __asm__ volatile (
3047 "mcr p15, 0, %0, c8, c5, 1" : : "r" ( value ) : "memory"
3048 );
3049}
3050
3051/* JIDR, Jazelle ID Register */
3052
3053static inline uint32_t _AArch32_Read_jidr( void )
3054{
3055 uint32_t value;
3056
3057 __asm__ volatile (
3058 "mrc p14, 7, %0, c0, c0, 0" : "=&r" ( value ) : : "memory"
3059 );
3060
3061 return value;
3062}
3063
3064/* JMCR, Jazelle Main Configuration Register */
3065
3066static inline uint32_t _AArch32_Read_jmcr( void )
3067{
3068 uint32_t value;
3069
3070 __asm__ volatile (
3071 "mrc p14, 7, %0, c2, c0, 0" : "=&r" ( value ) : : "memory"
3072 );
3073
3074 return value;
3075}
3076
3077static inline void _AArch32_Write_jmcr( uint32_t value )
3078{
3079 __asm__ volatile (
3080 "mcr p14, 7, %0, c2, c0, 0" : : "r" ( value ) : "memory"
3081 );
3082}
3083
3084/* JOSCR, Jazelle OS Control Register */
3085
3086static inline uint32_t _AArch32_Read_joscr( void )
3087{
3088 uint32_t value;
3089
3090 __asm__ volatile (
3091 "mrc p14, 7, %0, c1, c0, 0" : "=&r" ( value ) : : "memory"
3092 );
3093
3094 return value;
3095}
3096
3097static inline void _AArch32_Write_joscr( uint32_t value )
3098{
3099 __asm__ volatile (
3100 "mcr p14, 7, %0, c1, c0, 0" : : "r" ( value ) : "memory"
3101 );
3102}
3103
3104/* MAIR0, Memory Attribute Indirection Register 0 */
3105
3106static inline uint32_t _AArch32_Read_mair0( void )
3107{
3108 uint32_t value;
3109
3110 __asm__ volatile (
3111 "mrc p15, 0, %0, c10, c2, 0" : "=&r" ( value ) : : "memory"
3112 );
3113
3114 return value;
3115}
3116
3117static inline void _AArch32_Write_mair0( uint32_t value )
3118{
3119 __asm__ volatile (
3120 "mcr p15, 0, %0, c10, c2, 0" : : "r" ( value ) : "memory"
3121 );
3122}
3123
3124/* MAIR1, Memory Attribute Indirection Register 1 */
3125
3126static inline uint32_t _AArch32_Read_mair1( void )
3127{
3128 uint32_t value;
3129
3130 __asm__ volatile (
3131 "mrc p15, 0, %0, c10, c2, 1" : "=&r" ( value ) : : "memory"
3132 );
3133
3134 return value;
3135}
3136
3137static inline void _AArch32_Write_mair1( uint32_t value )
3138{
3139 __asm__ volatile (
3140 "mcr p15, 0, %0, c10, c2, 1" : : "r" ( value ) : "memory"
3141 );
3142}
3143
3144/* MIDR, Main ID Register */
3145
3146#define AARCH32_MIDR_REVISION( _val ) ( ( _val ) << 0 )
3147#define AARCH32_MIDR_REVISION_SHIFT 0
3148#define AARCH32_MIDR_REVISION_MASK 0xfU
3149#define AARCH32_MIDR_REVISION_GET( _reg ) \
3150 ( ( ( _reg ) >> 0 ) & 0xfU )
3151
3152#define AARCH32_MIDR_PARTNUM( _val ) ( ( _val ) << 4 )
3153#define AARCH32_MIDR_PARTNUM_SHIFT 4
3154#define AARCH32_MIDR_PARTNUM_MASK 0xfff0U
3155#define AARCH32_MIDR_PARTNUM_GET( _reg ) \
3156 ( ( ( _reg ) >> 4 ) & 0xfffU )
3157
3158#define AARCH32_MIDR_ARCHITECTURE( _val ) ( ( _val ) << 16 )
3159#define AARCH32_MIDR_ARCHITECTURE_SHIFT 16
3160#define AARCH32_MIDR_ARCHITECTURE_MASK 0xf0000U
3161#define AARCH32_MIDR_ARCHITECTURE_GET( _reg ) \
3162 ( ( ( _reg ) >> 16 ) & 0xfU )
3163
3164#define AARCH32_MIDR_VARIANT( _val ) ( ( _val ) << 20 )
3165#define AARCH32_MIDR_VARIANT_SHIFT 20
3166#define AARCH32_MIDR_VARIANT_MASK 0xf00000U
3167#define AARCH32_MIDR_VARIANT_GET( _reg ) \
3168 ( ( ( _reg ) >> 20 ) & 0xfU )
3169
3170#define AARCH32_MIDR_IMPLEMENTER( _val ) ( ( _val ) << 24 )
3171#define AARCH32_MIDR_IMPLEMENTER_SHIFT 24
3172#define AARCH32_MIDR_IMPLEMENTER_MASK 0xff000000U
3173#define AARCH32_MIDR_IMPLEMENTER_GET( _reg ) \
3174 ( ( ( _reg ) >> 24 ) & 0xffU )
3175
3176static inline uint32_t _AArch32_Read_midr( void )
3177{
3178 uint32_t value;
3179
3180 __asm__ volatile (
3181 "mrc p15, 0, %0, c0, c0, 0" : "=&r" ( value ) : : "memory"
3182 );
3183
3184 return value;
3185}
3186
3187/* MPIDR, Multiprocessor Affinity Register */
3188
3189#define AARCH32_MPIDR_AFF0( _val ) ( ( _val ) << 0 )
3190#define AARCH32_MPIDR_AFF0_SHIFT 0
3191#define AARCH32_MPIDR_AFF0_MASK 0xffU
3192#define AARCH32_MPIDR_AFF0_GET( _reg ) \
3193 ( ( ( _reg ) >> 0 ) & 0xffU )
3194
3195#define AARCH32_MPIDR_AFF1( _val ) ( ( _val ) << 8 )
3196#define AARCH32_MPIDR_AFF1_SHIFT 8
3197#define AARCH32_MPIDR_AFF1_MASK 0xff00U
3198#define AARCH32_MPIDR_AFF1_GET( _reg ) \
3199 ( ( ( _reg ) >> 8 ) & 0xffU )
3200
3201#define AARCH32_MPIDR_AFF2( _val ) ( ( _val ) << 16 )
3202#define AARCH32_MPIDR_AFF2_SHIFT 16
3203#define AARCH32_MPIDR_AFF2_MASK 0xff0000U
3204#define AARCH32_MPIDR_AFF2_GET( _reg ) \
3205 ( ( ( _reg ) >> 16 ) & 0xffU )
3206
3207#define AARCH32_MPIDR_MT 0x1000000U
3208
3209#define AARCH32_MPIDR_U 0x40000000U
3210
3211#define AARCH32_MPIDR_M 0x80000000U
3212
3213static inline uint32_t _AArch32_Read_mpidr( void )
3214{
3215 uint32_t value;
3216
3217 __asm__ volatile (
3218 "mrc p15, 0, %0, c0, c0, 5" : "=&r" ( value ) : : "memory"
3219 );
3220
3221 return value;
3222}
3223
3224/* MVBAR, Monitor Vector Base Address Register */
3225
3226#define AARCH32_MVBAR_RESERVED( _val ) ( ( _val ) << 0 )
3227#define AARCH32_MVBAR_RESERVED_SHIFT 0
3228#define AARCH32_MVBAR_RESERVED_MASK 0x1fU
3229#define AARCH32_MVBAR_RESERVED_GET( _reg ) \
3230 ( ( ( _reg ) >> 0 ) & 0x1fU )
3231
3232static inline uint32_t _AArch32_Read_mvbar( void )
3233{
3234 uint32_t value;
3235
3236 __asm__ volatile (
3237 "mrc p15, 0, %0, c12, c0, 1" : "=&r" ( value ) : : "memory"
3238 );
3239
3240 return value;
3241}
3242
3243static inline void _AArch32_Write_mvbar( uint32_t value )
3244{
3245 __asm__ volatile (
3246 "mcr p15, 0, %0, c12, c0, 1" : : "r" ( value ) : "memory"
3247 );
3248}
3249
3250/* MVFR0, Media and VFP Feature Register 0 */
3251
3252#define AARCH32_MVFR0_SIMDREG( _val ) ( ( _val ) << 0 )
3253#define AARCH32_MVFR0_SIMDREG_SHIFT 0
3254#define AARCH32_MVFR0_SIMDREG_MASK 0xfU
3255#define AARCH32_MVFR0_SIMDREG_GET( _reg ) \
3256 ( ( ( _reg ) >> 0 ) & 0xfU )
3257
3258#define AARCH32_MVFR0_FPSP( _val ) ( ( _val ) << 4 )
3259#define AARCH32_MVFR0_FPSP_SHIFT 4
3260#define AARCH32_MVFR0_FPSP_MASK 0xf0U
3261#define AARCH32_MVFR0_FPSP_GET( _reg ) \
3262 ( ( ( _reg ) >> 4 ) & 0xfU )
3263
3264#define AARCH32_MVFR0_FPDP( _val ) ( ( _val ) << 8 )
3265#define AARCH32_MVFR0_FPDP_SHIFT 8
3266#define AARCH32_MVFR0_FPDP_MASK 0xf00U
3267#define AARCH32_MVFR0_FPDP_GET( _reg ) \
3268 ( ( ( _reg ) >> 8 ) & 0xfU )
3269
3270#define AARCH32_MVFR0_FPTRAP( _val ) ( ( _val ) << 12 )
3271#define AARCH32_MVFR0_FPTRAP_SHIFT 12
3272#define AARCH32_MVFR0_FPTRAP_MASK 0xf000U
3273#define AARCH32_MVFR0_FPTRAP_GET( _reg ) \
3274 ( ( ( _reg ) >> 12 ) & 0xfU )
3275
3276#define AARCH32_MVFR0_FPDIVIDE( _val ) ( ( _val ) << 16 )
3277#define AARCH32_MVFR0_FPDIVIDE_SHIFT 16
3278#define AARCH32_MVFR0_FPDIVIDE_MASK 0xf0000U
3279#define AARCH32_MVFR0_FPDIVIDE_GET( _reg ) \
3280 ( ( ( _reg ) >> 16 ) & 0xfU )
3281
3282#define AARCH32_MVFR0_FPSQRT( _val ) ( ( _val ) << 20 )
3283#define AARCH32_MVFR0_FPSQRT_SHIFT 20
3284#define AARCH32_MVFR0_FPSQRT_MASK 0xf00000U
3285#define AARCH32_MVFR0_FPSQRT_GET( _reg ) \
3286 ( ( ( _reg ) >> 20 ) & 0xfU )
3287
3288#define AARCH32_MVFR0_FPSHVEC( _val ) ( ( _val ) << 24 )
3289#define AARCH32_MVFR0_FPSHVEC_SHIFT 24
3290#define AARCH32_MVFR0_FPSHVEC_MASK 0xf000000U
3291#define AARCH32_MVFR0_FPSHVEC_GET( _reg ) \
3292 ( ( ( _reg ) >> 24 ) & 0xfU )
3293
3294#define AARCH32_MVFR0_FPROUND( _val ) ( ( _val ) << 28 )
3295#define AARCH32_MVFR0_FPROUND_SHIFT 28
3296#define AARCH32_MVFR0_FPROUND_MASK 0xf0000000U
3297#define AARCH32_MVFR0_FPROUND_GET( _reg ) \
3298 ( ( ( _reg ) >> 28 ) & 0xfU )
3299
3300/* MVFR1, Media and VFP Feature Register 1 */
3301
3302#define AARCH32_MVFR1_FPFTZ( _val ) ( ( _val ) << 0 )
3303#define AARCH32_MVFR1_FPFTZ_SHIFT 0
3304#define AARCH32_MVFR1_FPFTZ_MASK 0xfU
3305#define AARCH32_MVFR1_FPFTZ_GET( _reg ) \
3306 ( ( ( _reg ) >> 0 ) & 0xfU )
3307
3308#define AARCH32_MVFR1_FPDNAN( _val ) ( ( _val ) << 4 )
3309#define AARCH32_MVFR1_FPDNAN_SHIFT 4
3310#define AARCH32_MVFR1_FPDNAN_MASK 0xf0U
3311#define AARCH32_MVFR1_FPDNAN_GET( _reg ) \
3312 ( ( ( _reg ) >> 4 ) & 0xfU )
3313
3314#define AARCH32_MVFR1_SIMDLS( _val ) ( ( _val ) << 8 )
3315#define AARCH32_MVFR1_SIMDLS_SHIFT 8
3316#define AARCH32_MVFR1_SIMDLS_MASK 0xf00U
3317#define AARCH32_MVFR1_SIMDLS_GET( _reg ) \
3318 ( ( ( _reg ) >> 8 ) & 0xfU )
3319
3320#define AARCH32_MVFR1_SIMDINT( _val ) ( ( _val ) << 12 )
3321#define AARCH32_MVFR1_SIMDINT_SHIFT 12
3322#define AARCH32_MVFR1_SIMDINT_MASK 0xf000U
3323#define AARCH32_MVFR1_SIMDINT_GET( _reg ) \
3324 ( ( ( _reg ) >> 12 ) & 0xfU )
3325
3326#define AARCH32_MVFR1_SIMDSP( _val ) ( ( _val ) << 16 )
3327#define AARCH32_MVFR1_SIMDSP_SHIFT 16
3328#define AARCH32_MVFR1_SIMDSP_MASK 0xf0000U
3329#define AARCH32_MVFR1_SIMDSP_GET( _reg ) \
3330 ( ( ( _reg ) >> 16 ) & 0xfU )
3331
3332#define AARCH32_MVFR1_SIMDHP( _val ) ( ( _val ) << 20 )
3333#define AARCH32_MVFR1_SIMDHP_SHIFT 20
3334#define AARCH32_MVFR1_SIMDHP_MASK 0xf00000U
3335#define AARCH32_MVFR1_SIMDHP_GET( _reg ) \
3336 ( ( ( _reg ) >> 20 ) & 0xfU )
3337
3338#define AARCH32_MVFR1_FPHP( _val ) ( ( _val ) << 24 )
3339#define AARCH32_MVFR1_FPHP_SHIFT 24
3340#define AARCH32_MVFR1_FPHP_MASK 0xf000000U
3341#define AARCH32_MVFR1_FPHP_GET( _reg ) \
3342 ( ( ( _reg ) >> 24 ) & 0xfU )
3343
3344#define AARCH32_MVFR1_SIMDFMAC( _val ) ( ( _val ) << 28 )
3345#define AARCH32_MVFR1_SIMDFMAC_SHIFT 28
3346#define AARCH32_MVFR1_SIMDFMAC_MASK 0xf0000000U
3347#define AARCH32_MVFR1_SIMDFMAC_GET( _reg ) \
3348 ( ( ( _reg ) >> 28 ) & 0xfU )
3349
3350/* MVFR2, Media and VFP Feature Register 2 */
3351
3352#define AARCH32_MVFR2_SIMDMISC( _val ) ( ( _val ) << 0 )
3353#define AARCH32_MVFR2_SIMDMISC_SHIFT 0
3354#define AARCH32_MVFR2_SIMDMISC_MASK 0xfU
3355#define AARCH32_MVFR2_SIMDMISC_GET( _reg ) \
3356 ( ( ( _reg ) >> 0 ) & 0xfU )
3357
3358#define AARCH32_MVFR2_FPMISC( _val ) ( ( _val ) << 4 )
3359#define AARCH32_MVFR2_FPMISC_SHIFT 4
3360#define AARCH32_MVFR2_FPMISC_MASK 0xf0U
3361#define AARCH32_MVFR2_FPMISC_GET( _reg ) \
3362 ( ( ( _reg ) >> 4 ) & 0xfU )
3363
3364/* NMRR, Normal Memory Remap Register */
3365
3366static inline uint32_t _AArch32_Read_nmrr( void )
3367{
3368 uint32_t value;
3369
3370 __asm__ volatile (
3371 "mrc p15, 0, %0, c10, c2, 1" : "=&r" ( value ) : : "memory"
3372 );
3373
3374 return value;
3375}
3376
3377static inline void _AArch32_Write_nmrr( uint32_t value )
3378{
3379 __asm__ volatile (
3380 "mcr p15, 0, %0, c10, c2, 1" : : "r" ( value ) : "memory"
3381 );
3382}
3383
3384/* NSACR, Non-Secure Access Control Register */
3385
3386#define AARCH32_NSACR_CP10 0x400U
3387
3388#define AARCH32_NSACR_CP11 0x800U
3389
3390#define AARCH32_NSACR_NSASEDIS 0x8000U
3391
3392#define AARCH32_NSACR_NSTRCDIS 0x100000U
3393
3394static inline uint32_t _AArch32_Read_nsacr( void )
3395{
3396 uint32_t value;
3397
3398 __asm__ volatile (
3399 "mrc p15, 0, %0, c1, c1, 2" : "=&r" ( value ) : : "memory"
3400 );
3401
3402 return value;
3403}
3404
3405static inline void _AArch32_Write_nsacr( uint32_t value )
3406{
3407 __asm__ volatile (
3408 "mcr p15, 0, %0, c1, c1, 2" : : "r" ( value ) : "memory"
3409 );
3410}
3411
3412/* PAR, Physical Address Register */
3413
3414#define AARCH32_PAR_F 0x1U
3415
3416#define AARCH32_PAR_SS 0x2U
3417
3418#define AARCH32_PAR_FS_4_0( _val ) ( ( _val ) << 1 )
3419#define AARCH32_PAR_FS_4_0_SHIFT 1
3420#define AARCH32_PAR_FS_4_0_MASK 0x3eU
3421#define AARCH32_PAR_FS_4_0_GET( _reg ) \
3422 ( ( ( _reg ) >> 1 ) & 0x1fU )
3423
3424#define AARCH32_PAR_FST( _val ) ( ( _val ) << 1 )
3425#define AARCH32_PAR_FST_SHIFT 1
3426#define AARCH32_PAR_FST_MASK 0x7eU
3427#define AARCH32_PAR_FST_GET( _reg ) \
3428 ( ( ( _reg ) >> 1 ) & 0x3fU )
3429
3430#define AARCH32_PAR_OUTER_1_0( _val ) ( ( _val ) << 2 )
3431#define AARCH32_PAR_OUTER_1_0_SHIFT 2
3432#define AARCH32_PAR_OUTER_1_0_MASK 0xcU
3433#define AARCH32_PAR_OUTER_1_0_GET( _reg ) \
3434 ( ( ( _reg ) >> 2 ) & 0x3U )
3435
3436#define AARCH32_PAR_INNER_2_0( _val ) ( ( _val ) << 4 )
3437#define AARCH32_PAR_INNER_2_0_SHIFT 4
3438#define AARCH32_PAR_INNER_2_0_MASK 0x70U
3439#define AARCH32_PAR_INNER_2_0_GET( _reg ) \
3440 ( ( ( _reg ) >> 4 ) & 0x7U )
3441
3442#define AARCH32_PAR_FS_5 0x40U
3443
3444#define AARCH32_PAR_SH_0 0x80U
3445
3446#define AARCH32_PAR_SH_1( _val ) ( ( _val ) << 7 )
3447#define AARCH32_PAR_SH_SHIFT_1 7
3448#define AARCH32_PAR_SH_MASK_1 0x180U
3449#define AARCH32_PAR_SH_GET_1( _reg ) \
3450 ( ( ( _reg ) >> 7 ) & 0x3U )
3451
3452#define AARCH32_PAR_S2WLK 0x100U
3453
3454#define AARCH32_PAR_FSTAGE 0x200U
3455
3456#define AARCH32_PAR_NS 0x200U
3457
3458#define AARCH32_PAR_NOS 0x400U
3459
3460#define AARCH32_PAR_LPAE 0x800U
3461
3462#define AARCH32_PAR_PA_0( _val ) ( ( _val ) << 12 )
3463#define AARCH32_PAR_PA_SHIFT_0 12
3464#define AARCH32_PAR_PA_MASK_0 0xfffff000U
3465#define AARCH32_PAR_PA_GET_0( _reg ) \
3466 ( ( ( _reg ) >> 12 ) & 0xfffffU )
3467
3468#define AARCH32_PAR_PA_1( _val ) ( ( _val ) << 12 )
3469#define AARCH32_PAR_PA_SHIFT_1 12
3470#define AARCH32_PAR_PA_MASK_1 0xfffffff000ULL
3471#define AARCH32_PAR_PA_GET_1( _reg ) \
3472 ( ( ( _reg ) >> 12 ) & 0xfffffffULL )
3473
3474#define AARCH32_PAR_ATTR( _val ) ( ( _val ) << 56 )
3475#define AARCH32_PAR_ATTR_SHIFT 56
3476#define AARCH32_PAR_ATTR_MASK 0xff00000000000000ULL
3477#define AARCH32_PAR_ATTR_GET( _reg ) \
3478 ( ( ( _reg ) >> 56 ) & 0xffULL )
3479
3480static inline uint32_t _AArch32_Read_32_par( void )
3481{
3482 uint32_t value;
3483
3484 __asm__ volatile (
3485 "mrc p15, 0, %0, c7, c4, 0" : "=&r" ( value ) : : "memory"
3486 );
3487
3488 return value;
3489}
3490
3491static inline void _AArch32_Write_32_par( uint32_t value )
3492{
3493 __asm__ volatile (
3494 "mcr p15, 0, %0, c7, c4, 0" : : "r" ( value ) : "memory"
3495 );
3496}
3497
3498/* PAR, Physical Address Register */
3499
3500static inline uint64_t _AArch32_Read_64_par( void )
3501{
3502 uint64_t value;
3503
3504 __asm__ volatile (
3505 "mrrc p15, 0, %Q0, %R0, c7" : "=&r" ( value ) : : "memory"
3506 );
3507
3508 return value;
3509}
3510
3511static inline void _AArch32_Write_64_par( uint64_t value )
3512{
3513 __asm__ volatile (
3514 "mcrr p15, 0, %Q0, %R0, c7" : : "r" ( value ) : "memory"
3515 );
3516}
3517
3518/* PRRR, Primary Region Remap Register */
3519
3520#define AARCH32_PRRR_DS0 0x10000U
3521
3522#define AARCH32_PRRR_DS1 0x20000U
3523
3524#define AARCH32_PRRR_NS0 0x40000U
3525
3526#define AARCH32_PRRR_NS1 0x80000U
3527
3528static inline uint32_t _AArch32_Read_prrr( void )
3529{
3530 uint32_t value;
3531
3532 __asm__ volatile (
3533 "mrc p15, 0, %0, c10, c2, 0" : "=&r" ( value ) : : "memory"
3534 );
3535
3536 return value;
3537}
3538
3539static inline void _AArch32_Write_prrr( uint32_t value )
3540{
3541 __asm__ volatile (
3542 "mcr p15, 0, %0, c10, c2, 0" : : "r" ( value ) : "memory"
3543 );
3544}
3545
3546/* REVIDR, Revision ID Register */
3547
3548static inline uint32_t _AArch32_Read_revidr( void )
3549{
3550 uint32_t value;
3551
3552 __asm__ volatile (
3553 "mrc p15, 0, %0, c0, c0, 6" : "=&r" ( value ) : : "memory"
3554 );
3555
3556 return value;
3557}
3558
3559/* RMR, Reset Management Register */
3560
3561#define AARCH32_RMR_AA64 0x1U
3562
3563#define AARCH32_RMR_RR 0x2U
3564
3565static inline uint32_t _AArch32_Read_rmr( void )
3566{
3567 uint32_t value;
3568
3569 __asm__ volatile (
3570 "mrc p15, 0, %0, c12, c0, 2" : "=&r" ( value ) : : "memory"
3571 );
3572
3573 return value;
3574}
3575
3576static inline void _AArch32_Write_rmr( uint32_t value )
3577{
3578 __asm__ volatile (
3579 "mcr p15, 0, %0, c12, c0, 2" : : "r" ( value ) : "memory"
3580 );
3581}
3582
3583/* RVBAR, Reset Vector Base Address Register */
3584
3585static inline uint32_t _AArch32_Read_rvbar( void )
3586{
3587 uint32_t value;
3588
3589 __asm__ volatile (
3590 "mrc p15, 0, %0, c12, c0, 1" : "=&r" ( value ) : : "memory"
3591 );
3592
3593 return value;
3594}
3595
3596/* SCR, Secure Configuration Register */
3597
3598#define AARCH32_SCR_NS 0x1U
3599
3600#define AARCH32_SCR_IRQ 0x2U
3601
3602#define AARCH32_SCR_FIQ 0x4U
3603
3604#define AARCH32_SCR_EA 0x8U
3605
3606#define AARCH32_SCR_FW 0x10U
3607
3608#define AARCH32_SCR_AW 0x20U
3609
3610#define AARCH32_SCR_NET 0x40U
3611
3612#define AARCH32_SCR_SCD 0x80U
3613
3614#define AARCH32_SCR_HCE 0x100U
3615
3616#define AARCH32_SCR_SIF 0x200U
3617
3618#define AARCH32_SCR_TWI 0x1000U
3619
3620#define AARCH32_SCR_TWE 0x2000U
3621
3622#define AARCH32_SCR_TERR 0x8000U
3623
3624static inline uint32_t _AArch32_Read_scr( void )
3625{
3626 uint32_t value;
3627
3628 __asm__ volatile (
3629 "mrc p15, 0, %0, c1, c1, 0" : "=&r" ( value ) : : "memory"
3630 );
3631
3632 return value;
3633}
3634
3635static inline void _AArch32_Write_scr( uint32_t value )
3636{
3637 __asm__ volatile (
3638 "mcr p15, 0, %0, c1, c1, 0" : : "r" ( value ) : "memory"
3639 );
3640}
3641
3642/* SCTLR, System Control Register */
3643
3644#define AARCH32_SCTLR_M 0x1U
3645
3646#define AARCH32_SCTLR_A 0x2U
3647
3648#define AARCH32_SCTLR_C 0x4U
3649
3650#define AARCH32_SCTLR_NTLSMD 0x8U
3651
3652#define AARCH32_SCTLR_LSMAOE 0x10U
3653
3654#define AARCH32_SCTLR_CP15BEN 0x20U
3655
3656#define AARCH32_SCTLR_UNK 0x40U
3657
3658#define AARCH32_SCTLR_ITD 0x80U
3659
3660#define AARCH32_SCTLR_SED 0x100U
3661
3662#define AARCH32_SCTLR_ENRCTX 0x400U
3663
3664#define AARCH32_SCTLR_I 0x1000U
3665
3666#define AARCH32_SCTLR_V 0x2000U
3667
3668#define AARCH32_SCTLR_NTWI 0x10000U
3669
3670#define AARCH32_SCTLR_BR 0x20000U
3671
3672#define AARCH32_SCTLR_NTWE 0x40000U
3673
3674#define AARCH32_SCTLR_WXN 0x80000U
3675
3676#define AARCH32_SCTLR_UWXN 0x100000U
3677
3678#define AARCH32_SCTLR_FI 0x200000U
3679
3680#define AARCH32_SCTLR_SPAN 0x800000U
3681
3682#define AARCH32_SCTLR_EE 0x2000000U
3683
3684#define AARCH32_SCTLR_TRE 0x10000000U
3685
3686#define AARCH32_SCTLR_AFE 0x20000000U
3687
3688#define AARCH32_SCTLR_TE 0x40000000U
3689
3690#define AARCH32_SCTLR_DSSBS 0x80000000U
3691
3692static inline uint32_t _AArch32_Read_sctlr( void )
3693{
3694 uint32_t value;
3695
3696 __asm__ volatile (
3697 "mrc p15, 0, %0, c1, c0, 0" : "=&r" ( value ) : : "memory"
3698 );
3699
3700 return value;
3701}
3702
3703static inline void _AArch32_Write_sctlr( uint32_t value )
3704{
3705 __asm__ volatile (
3706 "mcr p15, 0, %0, c1, c0, 0" : : "r" ( value ) : "memory"
3707 );
3708}
3709
3710/* SPSR, Saved Program Status Register */
3711
3712#define AARCH32_SPSR_M_4_0( _val ) ( ( _val ) << 0 )
3713#define AARCH32_SPSR_M_4_0_SHIFT 0
3714#define AARCH32_SPSR_M_4_0_MASK 0x1fU
3715#define AARCH32_SPSR_M_4_0_GET( _reg ) \
3716 ( ( ( _reg ) >> 0 ) & 0x1fU )
3717
3718#define AARCH32_SPSR_T 0x20U
3719
3720#define AARCH32_SPSR_F 0x40U
3721
3722#define AARCH32_SPSR_I 0x80U
3723
3724#define AARCH32_SPSR_A 0x100U
3725
3726#define AARCH32_SPSR_E 0x200U
3727
3728#define AARCH32_SPSR_IT_7_2( _val ) ( ( _val ) << 10 )
3729#define AARCH32_SPSR_IT_7_2_SHIFT 10
3730#define AARCH32_SPSR_IT_7_2_MASK 0xfc00U
3731#define AARCH32_SPSR_IT_7_2_GET( _reg ) \
3732 ( ( ( _reg ) >> 10 ) & 0x3fU )
3733
3734#define AARCH32_SPSR_GE( _val ) ( ( _val ) << 16 )
3735#define AARCH32_SPSR_GE_SHIFT 16
3736#define AARCH32_SPSR_GE_MASK 0xf0000U
3737#define AARCH32_SPSR_GE_GET( _reg ) \
3738 ( ( ( _reg ) >> 16 ) & 0xfU )
3739
3740#define AARCH32_SPSR_IL 0x100000U
3741
3742#define AARCH32_SPSR_DIT 0x200000U
3743
3744#define AARCH32_SPSR_PAN 0x400000U
3745
3746#define AARCH32_SPSR_SSBS 0x800000U
3747
3748#define AARCH32_SPSR_J 0x1000000U
3749
3750#define AARCH32_SPSR_IT_1_0( _val ) ( ( _val ) << 25 )
3751#define AARCH32_SPSR_IT_1_0_SHIFT 25
3752#define AARCH32_SPSR_IT_1_0_MASK 0x6000000U
3753#define AARCH32_SPSR_IT_1_0_GET( _reg ) \
3754 ( ( ( _reg ) >> 25 ) & 0x3U )
3755
3756#define AARCH32_SPSR_Q 0x8000000U
3757
3758#define AARCH32_SPSR_V 0x10000000U
3759
3760#define AARCH32_SPSR_C 0x20000000U
3761
3762#define AARCH32_SPSR_Z 0x40000000U
3763
3764#define AARCH32_SPSR_N 0x80000000U
3765
3766/* SPSR_ABT, Saved Program Status Register (Abort mode) */
3767
3768#define AARCH32_SPSR_ABT_M_4_0( _val ) ( ( _val ) << 0 )
3769#define AARCH32_SPSR_ABT_M_4_0_SHIFT 0
3770#define AARCH32_SPSR_ABT_M_4_0_MASK 0x1fU
3771#define AARCH32_SPSR_ABT_M_4_0_GET( _reg ) \
3772 ( ( ( _reg ) >> 0 ) & 0x1fU )
3773
3774#define AARCH32_SPSR_ABT_T 0x20U
3775
3776#define AARCH32_SPSR_ABT_F 0x40U
3777
3778#define AARCH32_SPSR_ABT_I 0x80U
3779
3780#define AARCH32_SPSR_ABT_A 0x100U
3781
3782#define AARCH32_SPSR_ABT_E 0x200U
3783
3784#define AARCH32_SPSR_ABT_IT_7_2( _val ) ( ( _val ) << 10 )
3785#define AARCH32_SPSR_ABT_IT_7_2_SHIFT 10
3786#define AARCH32_SPSR_ABT_IT_7_2_MASK 0xfc00U
3787#define AARCH32_SPSR_ABT_IT_7_2_GET( _reg ) \
3788 ( ( ( _reg ) >> 10 ) & 0x3fU )
3789
3790#define AARCH32_SPSR_ABT_GE( _val ) ( ( _val ) << 16 )
3791#define AARCH32_SPSR_ABT_GE_SHIFT 16
3792#define AARCH32_SPSR_ABT_GE_MASK 0xf0000U
3793#define AARCH32_SPSR_ABT_GE_GET( _reg ) \
3794 ( ( ( _reg ) >> 16 ) & 0xfU )
3795
3796#define AARCH32_SPSR_ABT_IL 0x100000U
3797
3798#define AARCH32_SPSR_ABT_DIT 0x200000U
3799
3800#define AARCH32_SPSR_ABT_PAN 0x400000U
3801
3802#define AARCH32_SPSR_ABT_SSBS 0x800000U
3803
3804#define AARCH32_SPSR_ABT_J 0x1000000U
3805
3806#define AARCH32_SPSR_ABT_IT_1_0( _val ) ( ( _val ) << 25 )
3807#define AARCH32_SPSR_ABT_IT_1_0_SHIFT 25
3808#define AARCH32_SPSR_ABT_IT_1_0_MASK 0x6000000U
3809#define AARCH32_SPSR_ABT_IT_1_0_GET( _reg ) \
3810 ( ( ( _reg ) >> 25 ) & 0x3U )
3811
3812#define AARCH32_SPSR_ABT_Q 0x8000000U
3813
3814#define AARCH32_SPSR_ABT_V 0x10000000U
3815
3816#define AARCH32_SPSR_ABT_C 0x20000000U
3817
3818#define AARCH32_SPSR_ABT_Z 0x40000000U
3819
3820#define AARCH32_SPSR_ABT_N 0x80000000U
3821
3822/* SPSR_FIQ, Saved Program Status Register (FIQ mode) */
3823
3824#define AARCH32_SPSR_FIQ_M_4_0( _val ) ( ( _val ) << 0 )
3825#define AARCH32_SPSR_FIQ_M_4_0_SHIFT 0
3826#define AARCH32_SPSR_FIQ_M_4_0_MASK 0x1fU
3827#define AARCH32_SPSR_FIQ_M_4_0_GET( _reg ) \
3828 ( ( ( _reg ) >> 0 ) & 0x1fU )
3829
3830#define AARCH32_SPSR_FIQ_T 0x20U
3831
3832#define AARCH32_SPSR_FIQ_F 0x40U
3833
3834#define AARCH32_SPSR_FIQ_I 0x80U
3835
3836#define AARCH32_SPSR_FIQ_A 0x100U
3837
3838#define AARCH32_SPSR_FIQ_E 0x200U
3839
3840#define AARCH32_SPSR_FIQ_IT_7_2( _val ) ( ( _val ) << 10 )
3841#define AARCH32_SPSR_FIQ_IT_7_2_SHIFT 10
3842#define AARCH32_SPSR_FIQ_IT_7_2_MASK 0xfc00U
3843#define AARCH32_SPSR_FIQ_IT_7_2_GET( _reg ) \
3844 ( ( ( _reg ) >> 10 ) & 0x3fU )
3845
3846#define AARCH32_SPSR_FIQ_GE( _val ) ( ( _val ) << 16 )
3847#define AARCH32_SPSR_FIQ_GE_SHIFT 16
3848#define AARCH32_SPSR_FIQ_GE_MASK 0xf0000U
3849#define AARCH32_SPSR_FIQ_GE_GET( _reg ) \
3850 ( ( ( _reg ) >> 16 ) & 0xfU )
3851
3852#define AARCH32_SPSR_FIQ_IL 0x100000U
3853
3854#define AARCH32_SPSR_FIQ_DIT 0x200000U
3855
3856#define AARCH32_SPSR_FIQ_PAN 0x400000U
3857
3858#define AARCH32_SPSR_FIQ_SSBS 0x800000U
3859
3860#define AARCH32_SPSR_FIQ_J 0x1000000U
3861
3862#define AARCH32_SPSR_FIQ_IT_1_0( _val ) ( ( _val ) << 25 )
3863#define AARCH32_SPSR_FIQ_IT_1_0_SHIFT 25
3864#define AARCH32_SPSR_FIQ_IT_1_0_MASK 0x6000000U
3865#define AARCH32_SPSR_FIQ_IT_1_0_GET( _reg ) \
3866 ( ( ( _reg ) >> 25 ) & 0x3U )
3867
3868#define AARCH32_SPSR_FIQ_Q 0x8000000U
3869
3870#define AARCH32_SPSR_FIQ_V 0x10000000U
3871
3872#define AARCH32_SPSR_FIQ_C 0x20000000U
3873
3874#define AARCH32_SPSR_FIQ_Z 0x40000000U
3875
3876#define AARCH32_SPSR_FIQ_N 0x80000000U
3877
3878/* SPSR_HYP, Saved Program Status Register (Hyp mode) */
3879
3880#define AARCH32_SPSR_HYP_M_4_0( _val ) ( ( _val ) << 0 )
3881#define AARCH32_SPSR_HYP_M_4_0_SHIFT 0
3882#define AARCH32_SPSR_HYP_M_4_0_MASK 0x1fU
3883#define AARCH32_SPSR_HYP_M_4_0_GET( _reg ) \
3884 ( ( ( _reg ) >> 0 ) & 0x1fU )
3885
3886#define AARCH32_SPSR_HYP_T 0x20U
3887
3888#define AARCH32_SPSR_HYP_F 0x40U
3889
3890#define AARCH32_SPSR_HYP_I 0x80U
3891
3892#define AARCH32_SPSR_HYP_A 0x100U
3893
3894#define AARCH32_SPSR_HYP_E 0x200U
3895
3896#define AARCH32_SPSR_HYP_IT_7_2( _val ) ( ( _val ) << 10 )
3897#define AARCH32_SPSR_HYP_IT_7_2_SHIFT 10
3898#define AARCH32_SPSR_HYP_IT_7_2_MASK 0xfc00U
3899#define AARCH32_SPSR_HYP_IT_7_2_GET( _reg ) \
3900 ( ( ( _reg ) >> 10 ) & 0x3fU )
3901
3902#define AARCH32_SPSR_HYP_GE( _val ) ( ( _val ) << 16 )
3903#define AARCH32_SPSR_HYP_GE_SHIFT 16
3904#define AARCH32_SPSR_HYP_GE_MASK 0xf0000U
3905#define AARCH32_SPSR_HYP_GE_GET( _reg ) \
3906 ( ( ( _reg ) >> 16 ) & 0xfU )
3907
3908#define AARCH32_SPSR_HYP_IL 0x100000U
3909
3910#define AARCH32_SPSR_HYP_DIT 0x200000U
3911
3912#define AARCH32_SPSR_HYP_PAN 0x400000U
3913
3914#define AARCH32_SPSR_HYP_SSBS 0x800000U
3915
3916#define AARCH32_SPSR_HYP_J 0x1000000U
3917
3918#define AARCH32_SPSR_HYP_IT_1_0( _val ) ( ( _val ) << 25 )
3919#define AARCH32_SPSR_HYP_IT_1_0_SHIFT 25
3920#define AARCH32_SPSR_HYP_IT_1_0_MASK 0x6000000U
3921#define AARCH32_SPSR_HYP_IT_1_0_GET( _reg ) \
3922 ( ( ( _reg ) >> 25 ) & 0x3U )
3923
3924#define AARCH32_SPSR_HYP_Q 0x8000000U
3925
3926#define AARCH32_SPSR_HYP_V 0x10000000U
3927
3928#define AARCH32_SPSR_HYP_C 0x20000000U
3929
3930#define AARCH32_SPSR_HYP_Z 0x40000000U
3931
3932#define AARCH32_SPSR_HYP_N 0x80000000U
3933
3934/* SPSR_IRQ, Saved Program Status Register (IRQ mode) */
3935
3936#define AARCH32_SPSR_IRQ_M_4_0( _val ) ( ( _val ) << 0 )
3937#define AARCH32_SPSR_IRQ_M_4_0_SHIFT 0
3938#define AARCH32_SPSR_IRQ_M_4_0_MASK 0x1fU
3939#define AARCH32_SPSR_IRQ_M_4_0_GET( _reg ) \
3940 ( ( ( _reg ) >> 0 ) & 0x1fU )
3941
3942#define AARCH32_SPSR_IRQ_T 0x20U
3943
3944#define AARCH32_SPSR_IRQ_F 0x40U
3945
3946#define AARCH32_SPSR_IRQ_I 0x80U
3947
3948#define AARCH32_SPSR_IRQ_A 0x100U
3949
3950#define AARCH32_SPSR_IRQ_E 0x200U
3951
3952#define AARCH32_SPSR_IRQ_IT_7_2( _val ) ( ( _val ) << 10 )
3953#define AARCH32_SPSR_IRQ_IT_7_2_SHIFT 10
3954#define AARCH32_SPSR_IRQ_IT_7_2_MASK 0xfc00U
3955#define AARCH32_SPSR_IRQ_IT_7_2_GET( _reg ) \
3956 ( ( ( _reg ) >> 10 ) & 0x3fU )
3957
3958#define AARCH32_SPSR_IRQ_GE( _val ) ( ( _val ) << 16 )
3959#define AARCH32_SPSR_IRQ_GE_SHIFT 16
3960#define AARCH32_SPSR_IRQ_GE_MASK 0xf0000U
3961#define AARCH32_SPSR_IRQ_GE_GET( _reg ) \
3962 ( ( ( _reg ) >> 16 ) & 0xfU )
3963
3964#define AARCH32_SPSR_IRQ_IL 0x100000U
3965
3966#define AARCH32_SPSR_IRQ_DIT 0x200000U
3967
3968#define AARCH32_SPSR_IRQ_PAN 0x400000U
3969
3970#define AARCH32_SPSR_IRQ_SSBS 0x800000U
3971
3972#define AARCH32_SPSR_IRQ_J 0x1000000U
3973
3974#define AARCH32_SPSR_IRQ_IT_1_0( _val ) ( ( _val ) << 25 )
3975#define AARCH32_SPSR_IRQ_IT_1_0_SHIFT 25
3976#define AARCH32_SPSR_IRQ_IT_1_0_MASK 0x6000000U
3977#define AARCH32_SPSR_IRQ_IT_1_0_GET( _reg ) \
3978 ( ( ( _reg ) >> 25 ) & 0x3U )
3979
3980#define AARCH32_SPSR_IRQ_Q 0x8000000U
3981
3982#define AARCH32_SPSR_IRQ_V 0x10000000U
3983
3984#define AARCH32_SPSR_IRQ_C 0x20000000U
3985
3986#define AARCH32_SPSR_IRQ_Z 0x40000000U
3987
3988#define AARCH32_SPSR_IRQ_N 0x80000000U
3989
3990/* SPSR_MON, Saved Program Status Register (Monitor mode) */
3991
3992#define AARCH32_SPSR_MON_M_4_0( _val ) ( ( _val ) << 0 )
3993#define AARCH32_SPSR_MON_M_4_0_SHIFT 0
3994#define AARCH32_SPSR_MON_M_4_0_MASK 0x1fU
3995#define AARCH32_SPSR_MON_M_4_0_GET( _reg ) \
3996 ( ( ( _reg ) >> 0 ) & 0x1fU )
3997
3998#define AARCH32_SPSR_MON_T 0x20U
3999
4000#define AARCH32_SPSR_MON_F 0x40U
4001
4002#define AARCH32_SPSR_MON_I 0x80U
4003
4004#define AARCH32_SPSR_MON_A 0x100U
4005
4006#define AARCH32_SPSR_MON_E 0x200U
4007
4008#define AARCH32_SPSR_MON_IT_7_2( _val ) ( ( _val ) << 10 )
4009#define AARCH32_SPSR_MON_IT_7_2_SHIFT 10
4010#define AARCH32_SPSR_MON_IT_7_2_MASK 0xfc00U
4011#define AARCH32_SPSR_MON_IT_7_2_GET( _reg ) \
4012 ( ( ( _reg ) >> 10 ) & 0x3fU )
4013
4014#define AARCH32_SPSR_MON_GE( _val ) ( ( _val ) << 16 )
4015#define AARCH32_SPSR_MON_GE_SHIFT 16
4016#define AARCH32_SPSR_MON_GE_MASK 0xf0000U
4017#define AARCH32_SPSR_MON_GE_GET( _reg ) \
4018 ( ( ( _reg ) >> 16 ) & 0xfU )
4019
4020#define AARCH32_SPSR_MON_IL 0x100000U
4021
4022#define AARCH32_SPSR_MON_DIT 0x200000U
4023
4024#define AARCH32_SPSR_MON_PAN 0x400000U
4025
4026#define AARCH32_SPSR_MON_SSBS 0x800000U
4027
4028#define AARCH32_SPSR_MON_J 0x1000000U
4029
4030#define AARCH32_SPSR_MON_IT_1_0( _val ) ( ( _val ) << 25 )
4031#define AARCH32_SPSR_MON_IT_1_0_SHIFT 25
4032#define AARCH32_SPSR_MON_IT_1_0_MASK 0x6000000U
4033#define AARCH32_SPSR_MON_IT_1_0_GET( _reg ) \
4034 ( ( ( _reg ) >> 25 ) & 0x3U )
4035
4036#define AARCH32_SPSR_MON_Q 0x8000000U
4037
4038#define AARCH32_SPSR_MON_V 0x10000000U
4039
4040#define AARCH32_SPSR_MON_C 0x20000000U
4041
4042#define AARCH32_SPSR_MON_Z 0x40000000U
4043
4044#define AARCH32_SPSR_MON_N 0x80000000U
4045
4046/* SPSR_SVC, Saved Program Status Register (Supervisor mode) */
4047
4048#define AARCH32_SPSR_SVC_M_4_0( _val ) ( ( _val ) << 0 )
4049#define AARCH32_SPSR_SVC_M_4_0_SHIFT 0
4050#define AARCH32_SPSR_SVC_M_4_0_MASK 0x1fU
4051#define AARCH32_SPSR_SVC_M_4_0_GET( _reg ) \
4052 ( ( ( _reg ) >> 0 ) & 0x1fU )
4053
4054#define AARCH32_SPSR_SVC_T 0x20U
4055
4056#define AARCH32_SPSR_SVC_F 0x40U
4057
4058#define AARCH32_SPSR_SVC_I 0x80U
4059
4060#define AARCH32_SPSR_SVC_A 0x100U
4061
4062#define AARCH32_SPSR_SVC_E 0x200U
4063
4064#define AARCH32_SPSR_SVC_IT_7_2( _val ) ( ( _val ) << 10 )
4065#define AARCH32_SPSR_SVC_IT_7_2_SHIFT 10
4066#define AARCH32_SPSR_SVC_IT_7_2_MASK 0xfc00U
4067#define AARCH32_SPSR_SVC_IT_7_2_GET( _reg ) \
4068 ( ( ( _reg ) >> 10 ) & 0x3fU )
4069
4070#define AARCH32_SPSR_SVC_GE( _val ) ( ( _val ) << 16 )
4071#define AARCH32_SPSR_SVC_GE_SHIFT 16
4072#define AARCH32_SPSR_SVC_GE_MASK 0xf0000U
4073#define AARCH32_SPSR_SVC_GE_GET( _reg ) \
4074 ( ( ( _reg ) >> 16 ) & 0xfU )
4075
4076#define AARCH32_SPSR_SVC_IL 0x100000U
4077
4078#define AARCH32_SPSR_SVC_DIT 0x200000U
4079
4080#define AARCH32_SPSR_SVC_PAN 0x400000U
4081
4082#define AARCH32_SPSR_SVC_SSBS 0x800000U
4083
4084#define AARCH32_SPSR_SVC_J 0x1000000U
4085
4086#define AARCH32_SPSR_SVC_IT_1_0( _val ) ( ( _val ) << 25 )
4087#define AARCH32_SPSR_SVC_IT_1_0_SHIFT 25
4088#define AARCH32_SPSR_SVC_IT_1_0_MASK 0x6000000U
4089#define AARCH32_SPSR_SVC_IT_1_0_GET( _reg ) \
4090 ( ( ( _reg ) >> 25 ) & 0x3U )
4091
4092#define AARCH32_SPSR_SVC_Q 0x8000000U
4093
4094#define AARCH32_SPSR_SVC_V 0x10000000U
4095
4096#define AARCH32_SPSR_SVC_C 0x20000000U
4097
4098#define AARCH32_SPSR_SVC_Z 0x40000000U
4099
4100#define AARCH32_SPSR_SVC_N 0x80000000U
4101
4102/* SPSR_UND, Saved Program Status Register (Undefined mode) */
4103
4104#define AARCH32_SPSR_UND_M_4_0( _val ) ( ( _val ) << 0 )
4105#define AARCH32_SPSR_UND_M_4_0_SHIFT 0
4106#define AARCH32_SPSR_UND_M_4_0_MASK 0x1fU
4107#define AARCH32_SPSR_UND_M_4_0_GET( _reg ) \
4108 ( ( ( _reg ) >> 0 ) & 0x1fU )
4109
4110#define AARCH32_SPSR_UND_T 0x20U
4111
4112#define AARCH32_SPSR_UND_F 0x40U
4113
4114#define AARCH32_SPSR_UND_I 0x80U
4115
4116#define AARCH32_SPSR_UND_A 0x100U
4117
4118#define AARCH32_SPSR_UND_E 0x200U
4119
4120#define AARCH32_SPSR_UND_IT_7_2( _val ) ( ( _val ) << 10 )
4121#define AARCH32_SPSR_UND_IT_7_2_SHIFT 10
4122#define AARCH32_SPSR_UND_IT_7_2_MASK 0xfc00U
4123#define AARCH32_SPSR_UND_IT_7_2_GET( _reg ) \
4124 ( ( ( _reg ) >> 10 ) & 0x3fU )
4125
4126#define AARCH32_SPSR_UND_GE( _val ) ( ( _val ) << 16 )
4127#define AARCH32_SPSR_UND_GE_SHIFT 16
4128#define AARCH32_SPSR_UND_GE_MASK 0xf0000U
4129#define AARCH32_SPSR_UND_GE_GET( _reg ) \
4130 ( ( ( _reg ) >> 16 ) & 0xfU )
4131
4132#define AARCH32_SPSR_UND_IL 0x100000U
4133
4134#define AARCH32_SPSR_UND_DIT 0x200000U
4135
4136#define AARCH32_SPSR_UND_PAN 0x400000U
4137
4138#define AARCH32_SPSR_UND_SSBS 0x800000U
4139
4140#define AARCH32_SPSR_UND_J 0x1000000U
4141
4142#define AARCH32_SPSR_UND_IT_1_0( _val ) ( ( _val ) << 25 )
4143#define AARCH32_SPSR_UND_IT_1_0_SHIFT 25
4144#define AARCH32_SPSR_UND_IT_1_0_MASK 0x6000000U
4145#define AARCH32_SPSR_UND_IT_1_0_GET( _reg ) \
4146 ( ( ( _reg ) >> 25 ) & 0x3U )
4147
4148#define AARCH32_SPSR_UND_Q 0x8000000U
4149
4150#define AARCH32_SPSR_UND_V 0x10000000U
4151
4152#define AARCH32_SPSR_UND_C 0x20000000U
4153
4154#define AARCH32_SPSR_UND_Z 0x40000000U
4155
4156#define AARCH32_SPSR_UND_N 0x80000000U
4157
4158/* TCMTR, TCM Type Register */
4159
4160static inline uint32_t _AArch32_Read_tcmtr( void )
4161{
4162 uint32_t value;
4163
4164 __asm__ volatile (
4165 "mrc p15, 0, %0, c0, c0, 2" : "=&r" ( value ) : : "memory"
4166 );
4167
4168 return value;
4169}
4170
4171/* TLBIALL, TLB Invalidate All */
4172
4173static inline void _AArch32_Write_tlbiall( uint32_t value )
4174{
4175 __asm__ volatile (
4176 "mcr p15, 0, %0, c8, c7, 0" : : "r" ( value ) : "memory"
4177 );
4178}
4179
4180/* TLBIALLH, TLB Invalidate All, Hyp mode */
4181
4182static inline void _AArch32_Write_tlbiallh( uint32_t value )
4183{
4184 __asm__ volatile (
4185 "mcr p15, 4, %0, c8, c7, 0" : : "r" ( value ) : "memory"
4186 );
4187}
4188
4189/* TLBIALLHIS, TLB Invalidate All, Hyp mode, Inner Shareable */
4190
4191static inline void _AArch32_Write_tlbiallhis( uint32_t value )
4192{
4193 __asm__ volatile (
4194 "mcr p15, 4, %0, c8, c3, 0" : : "r" ( value ) : "memory"
4195 );
4196}
4197
4198/* TLBIALLIS, TLB Invalidate All, Inner Shareable */
4199
4200static inline void _AArch32_Write_tlbiallis( uint32_t value )
4201{
4202 __asm__ volatile (
4203 "mcr p15, 0, %0, c8, c3, 0" : : "r" ( value ) : "memory"
4204 );
4205}
4206
4207/* TLBIALLNSNH, TLB Invalidate All, Non-Secure Non-Hyp */
4208
4209static inline void _AArch32_Write_tlbiallnsnh( uint32_t value )
4210{
4211 __asm__ volatile (
4212 "mcr p15, 4, %0, c8, c7, 4" : : "r" ( value ) : "memory"
4213 );
4214}
4215
4216/* TLBIALLNSNHIS, TLB Invalidate All, Non-Secure Non-Hyp, Inner Shareable */
4217
4218static inline void _AArch32_Write_tlbiallnsnhis( uint32_t value )
4219{
4220 __asm__ volatile (
4221 "mcr p15, 4, %0, c8, c3, 4" : : "r" ( value ) : "memory"
4222 );
4223}
4224
4225/* TLBIASID, TLB Invalidate by ASID match */
4226
4227#define AARCH32_TLBIASID_ASID( _val ) ( ( _val ) << 0 )
4228#define AARCH32_TLBIASID_ASID_SHIFT 0
4229#define AARCH32_TLBIASID_ASID_MASK 0xffU
4230#define AARCH32_TLBIASID_ASID_GET( _reg ) \
4231 ( ( ( _reg ) >> 0 ) & 0xffU )
4232
4233static inline void _AArch32_Write_tlbiasid( uint32_t value )
4234{
4235 __asm__ volatile (
4236 "mcr p15, 0, %0, c8, c7, 2" : : "r" ( value ) : "memory"
4237 );
4238}
4239
4240/* TLBIASIDIS, TLB Invalidate by ASID match, Inner Shareable */
4241
4242#define AARCH32_TLBIASIDIS_ASID( _val ) ( ( _val ) << 0 )
4243#define AARCH32_TLBIASIDIS_ASID_SHIFT 0
4244#define AARCH32_TLBIASIDIS_ASID_MASK 0xffU
4245#define AARCH32_TLBIASIDIS_ASID_GET( _reg ) \
4246 ( ( ( _reg ) >> 0 ) & 0xffU )
4247
4248static inline void _AArch32_Write_tlbiasidis( uint32_t value )
4249{
4250 __asm__ volatile (
4251 "mcr p15, 0, %0, c8, c3, 2" : : "r" ( value ) : "memory"
4252 );
4253}
4254
4255/* TLBIIPAS2, TLB Invalidate by Intermediate Physical Address, Stage 2 */
4256
4257#define AARCH32_TLBIIPAS2_IPA_39_12( _val ) ( ( _val ) << 0 )
4258#define AARCH32_TLBIIPAS2_IPA_39_12_SHIFT 0
4259#define AARCH32_TLBIIPAS2_IPA_39_12_MASK 0xfffffffU
4260#define AARCH32_TLBIIPAS2_IPA_39_12_GET( _reg ) \
4261 ( ( ( _reg ) >> 0 ) & 0xfffffffU )
4262
4263static inline void _AArch32_Write_tlbiipas2( uint32_t value )
4264{
4265 __asm__ volatile (
4266 "mcr p15, 4, %0, c8, c4, 1" : : "r" ( value ) : "memory"
4267 );
4268}
4269
4270/* TLBIIPAS2IS, TLB Invalidate by Intermediate Physical Address, Stage 2, Inner Shareable */
4271
4272#define AARCH32_TLBIIPAS2IS_IPA_39_12( _val ) ( ( _val ) << 0 )
4273#define AARCH32_TLBIIPAS2IS_IPA_39_12_SHIFT 0
4274#define AARCH32_TLBIIPAS2IS_IPA_39_12_MASK 0xfffffffU
4275#define AARCH32_TLBIIPAS2IS_IPA_39_12_GET( _reg ) \
4276 ( ( ( _reg ) >> 0 ) & 0xfffffffU )
4277
4278static inline void _AArch32_Write_tlbiipas2is( uint32_t value )
4279{
4280 __asm__ volatile (
4281 "mcr p15, 4, %0, c8, c0, 1" : : "r" ( value ) : "memory"
4282 );
4283}
4284
4285/* TLBIIPAS2L, TLB Invalidate by Intermediate Physical Address, Stage 2, Last level */
4286
4287#define AARCH32_TLBIIPAS2L_IPA_39_12( _val ) ( ( _val ) << 0 )
4288#define AARCH32_TLBIIPAS2L_IPA_39_12_SHIFT 0
4289#define AARCH32_TLBIIPAS2L_IPA_39_12_MASK 0xfffffffU
4290#define AARCH32_TLBIIPAS2L_IPA_39_12_GET( _reg ) \
4291 ( ( ( _reg ) >> 0 ) & 0xfffffffU )
4292
4293static inline void _AArch32_Write_tlbiipas2l( uint32_t value )
4294{
4295 __asm__ volatile (
4296 "mcr p15, 4, %0, c8, c4, 5" : : "r" ( value ) : "memory"
4297 );
4298}
4299
4300/* TLBIIPAS2LIS, TLB Invalidate by Intermediate Physical Address, Stage 2, Last level, Inner */
4301
4302#define AARCH32_TLBIIPAS2LIS_IPA_39_12( _val ) ( ( _val ) << 0 )
4303#define AARCH32_TLBIIPAS2LIS_IPA_39_12_SHIFT 0
4304#define AARCH32_TLBIIPAS2LIS_IPA_39_12_MASK 0xfffffffU
4305#define AARCH32_TLBIIPAS2LIS_IPA_39_12_GET( _reg ) \
4306 ( ( ( _reg ) >> 0 ) & 0xfffffffU )
4307
4308static inline void _AArch32_Write_tlbiipas2lis( uint32_t value )
4309{
4310 __asm__ volatile (
4311 "mcr p15, 4, %0, c8, c0, 5" : : "r" ( value ) : "memory"
4312 );
4313}
4314
4315/* TLBIMVA, TLB Invalidate by VA */
4316
4317#define AARCH32_TLBIMVA_ASID( _val ) ( ( _val ) << 0 )
4318#define AARCH32_TLBIMVA_ASID_SHIFT 0
4319#define AARCH32_TLBIMVA_ASID_MASK 0xffU
4320#define AARCH32_TLBIMVA_ASID_GET( _reg ) \
4321 ( ( ( _reg ) >> 0 ) & 0xffU )
4322
4323#define AARCH32_TLBIMVA_VA( _val ) ( ( _val ) << 12 )
4324#define AARCH32_TLBIMVA_VA_SHIFT 12
4325#define AARCH32_TLBIMVA_VA_MASK 0xfffff000U
4326#define AARCH32_TLBIMVA_VA_GET( _reg ) \
4327 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4328
4329static inline void _AArch32_Write_tlbimva( uint32_t value )
4330{
4331 __asm__ volatile (
4332 "mcr p15, 0, %0, c8, c7, 1" : : "r" ( value ) : "memory"
4333 );
4334}
4335
4336/* TLBIMVAA, TLB Invalidate by VA, All ASID */
4337
4338#define AARCH32_TLBIMVAA_VA( _val ) ( ( _val ) << 12 )
4339#define AARCH32_TLBIMVAA_VA_SHIFT 12
4340#define AARCH32_TLBIMVAA_VA_MASK 0xfffff000U
4341#define AARCH32_TLBIMVAA_VA_GET( _reg ) \
4342 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4343
4344static inline void _AArch32_Write_tlbimvaa( uint32_t value )
4345{
4346 __asm__ volatile (
4347 "mcr p15, 0, %0, c8, c7, 3" : : "r" ( value ) : "memory"
4348 );
4349}
4350
4351/* TLBIMVAAIS, TLB Invalidate by VA, All ASID, Inner Shareable */
4352
4353#define AARCH32_TLBIMVAAIS_VA( _val ) ( ( _val ) << 12 )
4354#define AARCH32_TLBIMVAAIS_VA_SHIFT 12
4355#define AARCH32_TLBIMVAAIS_VA_MASK 0xfffff000U
4356#define AARCH32_TLBIMVAAIS_VA_GET( _reg ) \
4357 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4358
4359static inline void _AArch32_Write_tlbimvaais( uint32_t value )
4360{
4361 __asm__ volatile (
4362 "mcr p15, 0, %0, c8, c3, 3" : : "r" ( value ) : "memory"
4363 );
4364}
4365
4366/* TLBIMVAAL, TLB Invalidate by VA, All ASID, Last level */
4367
4368#define AARCH32_TLBIMVAAL_VA( _val ) ( ( _val ) << 12 )
4369#define AARCH32_TLBIMVAAL_VA_SHIFT 12
4370#define AARCH32_TLBIMVAAL_VA_MASK 0xfffff000U
4371#define AARCH32_TLBIMVAAL_VA_GET( _reg ) \
4372 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4373
4374static inline void _AArch32_Write_tlbimvaal( uint32_t value )
4375{
4376 __asm__ volatile (
4377 "mcr p15, 0, %0, c8, c7, 7" : : "r" ( value ) : "memory"
4378 );
4379}
4380
4381/* TLBIMVAALIS, TLB Invalidate by VA, All ASID, Last level, Inner Shareable */
4382
4383#define AARCH32_TLBIMVAALIS_VA( _val ) ( ( _val ) << 12 )
4384#define AARCH32_TLBIMVAALIS_VA_SHIFT 12
4385#define AARCH32_TLBIMVAALIS_VA_MASK 0xfffff000U
4386#define AARCH32_TLBIMVAALIS_VA_GET( _reg ) \
4387 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4388
4389static inline void _AArch32_Write_tlbimvaalis( uint32_t value )
4390{
4391 __asm__ volatile (
4392 "mcr p15, 0, %0, c8, c3, 7" : : "r" ( value ) : "memory"
4393 );
4394}
4395
4396/* TLBIMVAH, TLB Invalidate by VA, Hyp mode */
4397
4398#define AARCH32_TLBIMVAH_VA( _val ) ( ( _val ) << 12 )
4399#define AARCH32_TLBIMVAH_VA_SHIFT 12
4400#define AARCH32_TLBIMVAH_VA_MASK 0xfffff000U
4401#define AARCH32_TLBIMVAH_VA_GET( _reg ) \
4402 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4403
4404static inline void _AArch32_Write_tlbimvah( uint32_t value )
4405{
4406 __asm__ volatile (
4407 "mcr p15, 4, %0, c8, c7, 1" : : "r" ( value ) : "memory"
4408 );
4409}
4410
4411/* TLBIMVAHIS, TLB Invalidate by VA, Hyp mode, Inner Shareable */
4412
4413#define AARCH32_TLBIMVAHIS_VA( _val ) ( ( _val ) << 12 )
4414#define AARCH32_TLBIMVAHIS_VA_SHIFT 12
4415#define AARCH32_TLBIMVAHIS_VA_MASK 0xfffff000U
4416#define AARCH32_TLBIMVAHIS_VA_GET( _reg ) \
4417 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4418
4419static inline void _AArch32_Write_tlbimvahis( uint32_t value )
4420{
4421 __asm__ volatile (
4422 "mcr p15, 4, %0, c8, c3, 1" : : "r" ( value ) : "memory"
4423 );
4424}
4425
4426/* TLBIMVAIS, TLB Invalidate by VA, Inner Shareable */
4427
4428#define AARCH32_TLBIMVAIS_ASID( _val ) ( ( _val ) << 0 )
4429#define AARCH32_TLBIMVAIS_ASID_SHIFT 0
4430#define AARCH32_TLBIMVAIS_ASID_MASK 0xffU
4431#define AARCH32_TLBIMVAIS_ASID_GET( _reg ) \
4432 ( ( ( _reg ) >> 0 ) & 0xffU )
4433
4434#define AARCH32_TLBIMVAIS_VA( _val ) ( ( _val ) << 12 )
4435#define AARCH32_TLBIMVAIS_VA_SHIFT 12
4436#define AARCH32_TLBIMVAIS_VA_MASK 0xfffff000U
4437#define AARCH32_TLBIMVAIS_VA_GET( _reg ) \
4438 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4439
4440static inline void _AArch32_Write_tlbimvais( uint32_t value )
4441{
4442 __asm__ volatile (
4443 "mcr p15, 0, %0, c8, c3, 1" : : "r" ( value ) : "memory"
4444 );
4445}
4446
4447/* TLBIMVAL, TLB Invalidate by VA, Last level */
4448
4449#define AARCH32_TLBIMVAL_ASID( _val ) ( ( _val ) << 0 )
4450#define AARCH32_TLBIMVAL_ASID_SHIFT 0
4451#define AARCH32_TLBIMVAL_ASID_MASK 0xffU
4452#define AARCH32_TLBIMVAL_ASID_GET( _reg ) \
4453 ( ( ( _reg ) >> 0 ) & 0xffU )
4454
4455#define AARCH32_TLBIMVAL_VA( _val ) ( ( _val ) << 12 )
4456#define AARCH32_TLBIMVAL_VA_SHIFT 12
4457#define AARCH32_TLBIMVAL_VA_MASK 0xfffff000U
4458#define AARCH32_TLBIMVAL_VA_GET( _reg ) \
4459 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4460
4461static inline void _AArch32_Write_tlbimval( uint32_t value )
4462{
4463 __asm__ volatile (
4464 "mcr p15, 0, %0, c8, c7, 5" : : "r" ( value ) : "memory"
4465 );
4466}
4467
4468/* TLBIMVALH, TLB Invalidate by VA, Last level, Hyp mode */
4469
4470#define AARCH32_TLBIMVALH_VA( _val ) ( ( _val ) << 12 )
4471#define AARCH32_TLBIMVALH_VA_SHIFT 12
4472#define AARCH32_TLBIMVALH_VA_MASK 0xfffff000U
4473#define AARCH32_TLBIMVALH_VA_GET( _reg ) \
4474 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4475
4476static inline void _AArch32_Write_tlbimvalh( uint32_t value )
4477{
4478 __asm__ volatile (
4479 "mcr p15, 4, %0, c8, c7, 5" : : "r" ( value ) : "memory"
4480 );
4481}
4482
4483/* TLBIMVALHIS, TLB Invalidate by VA, Last level, Hyp mode, Inner Shareable */
4484
4485#define AARCH32_TLBIMVALHIS_VA( _val ) ( ( _val ) << 12 )
4486#define AARCH32_TLBIMVALHIS_VA_SHIFT 12
4487#define AARCH32_TLBIMVALHIS_VA_MASK 0xfffff000U
4488#define AARCH32_TLBIMVALHIS_VA_GET( _reg ) \
4489 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4490
4491static inline void _AArch32_Write_tlbimvalhis( uint32_t value )
4492{
4493 __asm__ volatile (
4494 "mcr p15, 4, %0, c8, c3, 5" : : "r" ( value ) : "memory"
4495 );
4496}
4497
4498/* TLBIMVALIS, TLB Invalidate by VA, Last level, Inner Shareable */
4499
4500#define AARCH32_TLBIMVALIS_ASID( _val ) ( ( _val ) << 0 )
4501#define AARCH32_TLBIMVALIS_ASID_SHIFT 0
4502#define AARCH32_TLBIMVALIS_ASID_MASK 0xffU
4503#define AARCH32_TLBIMVALIS_ASID_GET( _reg ) \
4504 ( ( ( _reg ) >> 0 ) & 0xffU )
4505
4506#define AARCH32_TLBIMVALIS_VA( _val ) ( ( _val ) << 12 )
4507#define AARCH32_TLBIMVALIS_VA_SHIFT 12
4508#define AARCH32_TLBIMVALIS_VA_MASK 0xfffff000U
4509#define AARCH32_TLBIMVALIS_VA_GET( _reg ) \
4510 ( ( ( _reg ) >> 12 ) & 0xfffffU )
4511
4512static inline void _AArch32_Write_tlbimvalis( uint32_t value )
4513{
4514 __asm__ volatile (
4515 "mcr p15, 0, %0, c8, c3, 5" : : "r" ( value ) : "memory"
4516 );
4517}
4518
4519/* TLBTR, TLB Type Register */
4520
4521#define AARCH32_TLBTR_NU 0x1U
4522
4523static inline uint32_t _AArch32_Read_tlbtr( void )
4524{
4525 uint32_t value;
4526
4527 __asm__ volatile (
4528 "mrc p15, 0, %0, c0, c0, 3" : "=&r" ( value ) : : "memory"
4529 );
4530
4531 return value;
4532}
4533
4534/* TPIDRPRW, PL1 Software Thread ID Register */
4535
4536static inline uint32_t _AArch32_Read_tpidrprw( void )
4537{
4538 uint32_t value;
4539
4540 __asm__ volatile (
4541 "mrc p15, 0, %0, c13, c0, 4" : "=&r" ( value ) : : "memory"
4542 );
4543
4544 return value;
4545}
4546
4547static inline void _AArch32_Write_tpidrprw( uint32_t value )
4548{
4549 __asm__ volatile (
4550 "mcr p15, 0, %0, c13, c0, 4" : : "r" ( value ) : "memory"
4551 );
4552}
4553
4554/* TPIDRURO, PL0 Read-Only Software Thread ID Register */
4555
4556static inline uint32_t _AArch32_Read_tpidruro( void )
4557{
4558 uint32_t value;
4559
4560 __asm__ volatile (
4561 "mrc p15, 0, %0, c13, c0, 3" : "=&r" ( value ) : : "memory"
4562 );
4563
4564 return value;
4565}
4566
4567static inline void _AArch32_Write_tpidruro( uint32_t value )
4568{
4569 __asm__ volatile (
4570 "mcr p15, 0, %0, c13, c0, 3" : : "r" ( value ) : "memory"
4571 );
4572}
4573
4574/* TPIDRURW, PL0 Read/Write Software Thread ID Register */
4575
4576static inline uint32_t _AArch32_Read_tpidrurw( void )
4577{
4578 uint32_t value;
4579
4580 __asm__ volatile (
4581 "mrc p15, 0, %0, c13, c0, 2" : "=&r" ( value ) : : "memory"
4582 );
4583
4584 return value;
4585}
4586
4587static inline void _AArch32_Write_tpidrurw( uint32_t value )
4588{
4589 __asm__ volatile (
4590 "mcr p15, 0, %0, c13, c0, 2" : : "r" ( value ) : "memory"
4591 );
4592}
4593
4594/* TTBCR, Translation Table Base Control Register */
4595
4596#define AARCH32_TTBCR_N( _val ) ( ( _val ) << 0 )
4597#define AARCH32_TTBCR_N_SHIFT 0
4598#define AARCH32_TTBCR_N_MASK 0x7U
4599#define AARCH32_TTBCR_N_GET( _reg ) \
4600 ( ( ( _reg ) >> 0 ) & 0x7U )
4601
4602#define AARCH32_TTBCR_T0SZ( _val ) ( ( _val ) << 0 )
4603#define AARCH32_TTBCR_T0SZ_SHIFT 0
4604#define AARCH32_TTBCR_T0SZ_MASK 0x7U
4605#define AARCH32_TTBCR_T0SZ_GET( _reg ) \
4606 ( ( ( _reg ) >> 0 ) & 0x7U )
4607
4608#define AARCH32_TTBCR_PD0 0x10U
4609
4610#define AARCH32_TTBCR_PD1 0x20U
4611
4612#define AARCH32_TTBCR_T2E 0x40U
4613
4614#define AARCH32_TTBCR_EPD0 0x80U
4615
4616#define AARCH32_TTBCR_IRGN0( _val ) ( ( _val ) << 8 )
4617#define AARCH32_TTBCR_IRGN0_SHIFT 8
4618#define AARCH32_TTBCR_IRGN0_MASK 0x300U
4619#define AARCH32_TTBCR_IRGN0_GET( _reg ) \
4620 ( ( ( _reg ) >> 8 ) & 0x3U )
4621
4622#define AARCH32_TTBCR_ORGN0( _val ) ( ( _val ) << 10 )
4623#define AARCH32_TTBCR_ORGN0_SHIFT 10
4624#define AARCH32_TTBCR_ORGN0_MASK 0xc00U
4625#define AARCH32_TTBCR_ORGN0_GET( _reg ) \
4626 ( ( ( _reg ) >> 10 ) & 0x3U )
4627
4628#define AARCH32_TTBCR_SH0( _val ) ( ( _val ) << 12 )
4629#define AARCH32_TTBCR_SH0_SHIFT 12
4630#define AARCH32_TTBCR_SH0_MASK 0x3000U
4631#define AARCH32_TTBCR_SH0_GET( _reg ) \
4632 ( ( ( _reg ) >> 12 ) & 0x3U )
4633
4634#define AARCH32_TTBCR_T1SZ( _val ) ( ( _val ) << 16 )
4635#define AARCH32_TTBCR_T1SZ_SHIFT 16
4636#define AARCH32_TTBCR_T1SZ_MASK 0x70000U
4637#define AARCH32_TTBCR_T1SZ_GET( _reg ) \
4638 ( ( ( _reg ) >> 16 ) & 0x7U )
4639
4640#define AARCH32_TTBCR_A1 0x400000U
4641
4642#define AARCH32_TTBCR_EPD1 0x800000U
4643
4644#define AARCH32_TTBCR_IRGN1( _val ) ( ( _val ) << 24 )
4645#define AARCH32_TTBCR_IRGN1_SHIFT 24
4646#define AARCH32_TTBCR_IRGN1_MASK 0x3000000U
4647#define AARCH32_TTBCR_IRGN1_GET( _reg ) \
4648 ( ( ( _reg ) >> 24 ) & 0x3U )
4649
4650#define AARCH32_TTBCR_ORGN1( _val ) ( ( _val ) << 26 )
4651#define AARCH32_TTBCR_ORGN1_SHIFT 26
4652#define AARCH32_TTBCR_ORGN1_MASK 0xc000000U
4653#define AARCH32_TTBCR_ORGN1_GET( _reg ) \
4654 ( ( ( _reg ) >> 26 ) & 0x3U )
4655
4656#define AARCH32_TTBCR_SH1( _val ) ( ( _val ) << 28 )
4657#define AARCH32_TTBCR_SH1_SHIFT 28
4658#define AARCH32_TTBCR_SH1_MASK 0x30000000U
4659#define AARCH32_TTBCR_SH1_GET( _reg ) \
4660 ( ( ( _reg ) >> 28 ) & 0x3U )
4661
4662#define AARCH32_TTBCR_EAE 0x80000000U
4663
4664static inline uint32_t _AArch32_Read_ttbcr( void )
4665{
4666 uint32_t value;
4667
4668 __asm__ volatile (
4669 "mrc p15, 0, %0, c2, c0, 2" : "=&r" ( value ) : : "memory"
4670 );
4671
4672 return value;
4673}
4674
4675static inline void _AArch32_Write_ttbcr( uint32_t value )
4676{
4677 __asm__ volatile (
4678 "mcr p15, 0, %0, c2, c0, 2" : : "r" ( value ) : "memory"
4679 );
4680}
4681
4682/* TTBCR2, Translation Table Base Control Register 2 */
4683
4684#define AARCH32_TTBCR2_HPD0 0x200U
4685
4686#define AARCH32_TTBCR2_HPD1 0x400U
4687
4688#define AARCH32_TTBCR2_HWU059 0x800U
4689
4690#define AARCH32_TTBCR2_HWU060 0x1000U
4691
4692#define AARCH32_TTBCR2_HWU061 0x2000U
4693
4694#define AARCH32_TTBCR2_HWU062 0x4000U
4695
4696#define AARCH32_TTBCR2_HWU159 0x8000U
4697
4698#define AARCH32_TTBCR2_HWU160 0x10000U
4699
4700#define AARCH32_TTBCR2_HWU161 0x20000U
4701
4702#define AARCH32_TTBCR2_HWU162 0x40000U
4703
4704static inline uint32_t _AArch32_Read_ttbcr2( void )
4705{
4706 uint32_t value;
4707
4708 __asm__ volatile (
4709 "mrc p15, 0, %0, c2, c0, 3" : "=&r" ( value ) : : "memory"
4710 );
4711
4712 return value;
4713}
4714
4715static inline void _AArch32_Write_ttbcr2( uint32_t value )
4716{
4717 __asm__ volatile (
4718 "mcr p15, 0, %0, c2, c0, 3" : : "r" ( value ) : "memory"
4719 );
4720}
4721
4722/* TTBR0, Translation Table Base Register 0 */
4723
4724#define AARCH32_TTBR0_CNP 0x1U
4725
4726#define AARCH32_TTBR0_IRGN_1 0x1U
4727
4728#define AARCH32_TTBR0_S 0x2U
4729
4730#define AARCH32_TTBR0_BADDR( _val ) ( ( _val ) << 1 )
4731#define AARCH32_TTBR0_BADDR_SHIFT 1
4732#define AARCH32_TTBR0_BADDR_MASK 0xfffffffffffeULL
4733#define AARCH32_TTBR0_BADDR_GET( _reg ) \
4734 ( ( ( _reg ) >> 1 ) & 0x7fffffffffffULL )
4735
4736#define AARCH32_TTBR0_IMP 0x4U
4737
4738#define AARCH32_TTBR0_RGN( _val ) ( ( _val ) << 3 )
4739#define AARCH32_TTBR0_RGN_SHIFT 3
4740#define AARCH32_TTBR0_RGN_MASK 0x18U
4741#define AARCH32_TTBR0_RGN_GET( _reg ) \
4742 ( ( ( _reg ) >> 3 ) & 0x3U )
4743
4744#define AARCH32_TTBR0_NOS 0x20U
4745
4746#define AARCH32_TTBR0_IRGN_0 0x40U
4747
4748#define AARCH32_TTBR0_TTB0( _val ) ( ( _val ) << 7 )
4749#define AARCH32_TTBR0_TTB0_SHIFT 7
4750#define AARCH32_TTBR0_TTB0_MASK 0xffffff80U
4751#define AARCH32_TTBR0_TTB0_GET( _reg ) \
4752 ( ( ( _reg ) >> 7 ) & 0x1ffffffU )
4753
4754#define AARCH32_TTBR0_ASID( _val ) ( ( _val ) << 48 )
4755#define AARCH32_TTBR0_ASID_SHIFT 48
4756#define AARCH32_TTBR0_ASID_MASK 0xff000000000000ULL
4757#define AARCH32_TTBR0_ASID_GET( _reg ) \
4758 ( ( ( _reg ) >> 48 ) & 0xffULL )
4759
4760static inline uint32_t _AArch32_Read_32_ttbr0( void )
4761{
4762 uint32_t value;
4763
4764 __asm__ volatile (
4765 "mrc p15, 0, %0, c2, c0, 0" : "=&r" ( value ) : : "memory"
4766 );
4767
4768 return value;
4769}
4770
4771static inline void _AArch32_Write_32_ttbr0( uint32_t value )
4772{
4773 __asm__ volatile (
4774 "mcr p15, 0, %0, c2, c0, 0" : : "r" ( value ) : "memory"
4775 );
4776}
4777
4778/* TTBR0, Translation Table Base Register 0 */
4779
4780static inline uint64_t _AArch32_Read_64_ttbr0( void )
4781{
4782 uint64_t value;
4783
4784 __asm__ volatile (
4785 "mrrc p15, 0, %Q0, %R0, c2" : "=&r" ( value ) : : "memory"
4786 );
4787
4788 return value;
4789}
4790
4791static inline void _AArch32_Write_64_ttbr0( uint64_t value )
4792{
4793 __asm__ volatile (
4794 "mcrr p15, 0, %Q0, %R0, c2" : : "r" ( value ) : "memory"
4795 );
4796}
4797
4798/* TTBR1, Translation Table Base Register 1 */
4799
4800#define AARCH32_TTBR1_CNP 0x1U
4801
4802#define AARCH32_TTBR1_IRGN_0 0x1U
4803
4804#define AARCH32_TTBR1_S 0x2U
4805
4806#define AARCH32_TTBR1_BADDR( _val ) ( ( _val ) << 1 )
4807#define AARCH32_TTBR1_BADDR_SHIFT 1
4808#define AARCH32_TTBR1_BADDR_MASK 0xfffffffffffeULL
4809#define AARCH32_TTBR1_BADDR_GET( _reg ) \
4810 ( ( ( _reg ) >> 1 ) & 0x7fffffffffffULL )
4811
4812#define AARCH32_TTBR1_IMP 0x4U
4813
4814#define AARCH32_TTBR1_RGN( _val ) ( ( _val ) << 3 )
4815#define AARCH32_TTBR1_RGN_SHIFT 3
4816#define AARCH32_TTBR1_RGN_MASK 0x18U
4817#define AARCH32_TTBR1_RGN_GET( _reg ) \
4818 ( ( ( _reg ) >> 3 ) & 0x3U )
4819
4820#define AARCH32_TTBR1_NOS 0x20U
4821
4822#define AARCH32_TTBR1_IRGN_1 0x40U
4823
4824#define AARCH32_TTBR1_TTB1( _val ) ( ( _val ) << 7 )
4825#define AARCH32_TTBR1_TTB1_SHIFT 7
4826#define AARCH32_TTBR1_TTB1_MASK 0xffffff80U
4827#define AARCH32_TTBR1_TTB1_GET( _reg ) \
4828 ( ( ( _reg ) >> 7 ) & 0x1ffffffU )
4829
4830#define AARCH32_TTBR1_ASID( _val ) ( ( _val ) << 48 )
4831#define AARCH32_TTBR1_ASID_SHIFT 48
4832#define AARCH32_TTBR1_ASID_MASK 0xff000000000000ULL
4833#define AARCH32_TTBR1_ASID_GET( _reg ) \
4834 ( ( ( _reg ) >> 48 ) & 0xffULL )
4835
4836static inline uint32_t _AArch32_Read_32_ttbr1( void )
4837{
4838 uint32_t value;
4839
4840 __asm__ volatile (
4841 "mrc p15, 0, %0, c2, c0, 1" : "=&r" ( value ) : : "memory"
4842 );
4843
4844 return value;
4845}
4846
4847static inline void _AArch32_Write_32_ttbr1( uint32_t value )
4848{
4849 __asm__ volatile (
4850 "mcr p15, 0, %0, c2, c0, 1" : : "r" ( value ) : "memory"
4851 );
4852}
4853
4854/* TTBR1, Translation Table Base Register 1 */
4855
4856static inline uint64_t _AArch32_Read_64_ttbr1( void )
4857{
4858 uint64_t value;
4859
4860 __asm__ volatile (
4861 "mrrc p15, 1, %Q0, %R0, c2" : "=&r" ( value ) : : "memory"
4862 );
4863
4864 return value;
4865}
4866
4867static inline void _AArch32_Write_64_ttbr1( uint64_t value )
4868{
4869 __asm__ volatile (
4870 "mcrr p15, 1, %Q0, %R0, c2" : : "r" ( value ) : "memory"
4871 );
4872}
4873
4874/* VBAR, Vector Base Address Register */
4875
4876static inline uint32_t _AArch32_Read_vbar( void )
4877{
4878 uint32_t value;
4879
4880 __asm__ volatile (
4881 "mrc p15, 0, %0, c12, c0, 0" : "=&r" ( value ) : : "memory"
4882 );
4883
4884 return value;
4885}
4886
4887static inline void _AArch32_Write_vbar( uint32_t value )
4888{
4889 __asm__ volatile (
4890 "mcr p15, 0, %0, c12, c0, 0" : : "r" ( value ) : "memory"
4891 );
4892}
4893
4894/* VMPIDR, Virtualization Multiprocessor ID Register */
4895
4896#define AARCH32_VMPIDR_AFF0( _val ) ( ( _val ) << 0 )
4897#define AARCH32_VMPIDR_AFF0_SHIFT 0
4898#define AARCH32_VMPIDR_AFF0_MASK 0xffU
4899#define AARCH32_VMPIDR_AFF0_GET( _reg ) \
4900 ( ( ( _reg ) >> 0 ) & 0xffU )
4901
4902#define AARCH32_VMPIDR_AFF1( _val ) ( ( _val ) << 8 )
4903#define AARCH32_VMPIDR_AFF1_SHIFT 8
4904#define AARCH32_VMPIDR_AFF1_MASK 0xff00U
4905#define AARCH32_VMPIDR_AFF1_GET( _reg ) \
4906 ( ( ( _reg ) >> 8 ) & 0xffU )
4907
4908#define AARCH32_VMPIDR_AFF2( _val ) ( ( _val ) << 16 )
4909#define AARCH32_VMPIDR_AFF2_SHIFT 16
4910#define AARCH32_VMPIDR_AFF2_MASK 0xff0000U
4911#define AARCH32_VMPIDR_AFF2_GET( _reg ) \
4912 ( ( ( _reg ) >> 16 ) & 0xffU )
4913
4914#define AARCH32_VMPIDR_MT 0x1000000U
4915
4916#define AARCH32_VMPIDR_U 0x40000000U
4917
4918#define AARCH32_VMPIDR_M 0x80000000U
4919
4920static inline uint32_t _AArch32_Read_vmpidr( void )
4921{
4922 uint32_t value;
4923
4924 __asm__ volatile (
4925 "mrc p15, 4, %0, c0, c0, 5" : "=&r" ( value ) : : "memory"
4926 );
4927
4928 return value;
4929}
4930
4931static inline void _AArch32_Write_vmpidr( uint32_t value )
4932{
4933 __asm__ volatile (
4934 "mcr p15, 4, %0, c0, c0, 5" : : "r" ( value ) : "memory"
4935 );
4936}
4937
4938/* VPIDR, Virtualization Processor ID Register */
4939
4940#define AARCH32_VPIDR_REVISION( _val ) ( ( _val ) << 0 )
4941#define AARCH32_VPIDR_REVISION_SHIFT 0
4942#define AARCH32_VPIDR_REVISION_MASK 0xfU
4943#define AARCH32_VPIDR_REVISION_GET( _reg ) \
4944 ( ( ( _reg ) >> 0 ) & 0xfU )
4945
4946#define AARCH32_VPIDR_PARTNUM( _val ) ( ( _val ) << 4 )
4947#define AARCH32_VPIDR_PARTNUM_SHIFT 4
4948#define AARCH32_VPIDR_PARTNUM_MASK 0xfff0U
4949#define AARCH32_VPIDR_PARTNUM_GET( _reg ) \
4950 ( ( ( _reg ) >> 4 ) & 0xfffU )
4951
4952#define AARCH32_VPIDR_ARCHITECTURE( _val ) ( ( _val ) << 16 )
4953#define AARCH32_VPIDR_ARCHITECTURE_SHIFT 16
4954#define AARCH32_VPIDR_ARCHITECTURE_MASK 0xf0000U
4955#define AARCH32_VPIDR_ARCHITECTURE_GET( _reg ) \
4956 ( ( ( _reg ) >> 16 ) & 0xfU )
4957
4958#define AARCH32_VPIDR_VARIANT( _val ) ( ( _val ) << 20 )
4959#define AARCH32_VPIDR_VARIANT_SHIFT 20
4960#define AARCH32_VPIDR_VARIANT_MASK 0xf00000U
4961#define AARCH32_VPIDR_VARIANT_GET( _reg ) \
4962 ( ( ( _reg ) >> 20 ) & 0xfU )
4963
4964#define AARCH32_VPIDR_IMPLEMENTER( _val ) ( ( _val ) << 24 )
4965#define AARCH32_VPIDR_IMPLEMENTER_SHIFT 24
4966#define AARCH32_VPIDR_IMPLEMENTER_MASK 0xff000000U
4967#define AARCH32_VPIDR_IMPLEMENTER_GET( _reg ) \
4968 ( ( ( _reg ) >> 24 ) & 0xffU )
4969
4970static inline uint32_t _AArch32_Read_vpidr( void )
4971{
4972 uint32_t value;
4973
4974 __asm__ volatile (
4975 "mrc p15, 4, %0, c0, c0, 0" : "=&r" ( value ) : : "memory"
4976 );
4977
4978 return value;
4979}
4980
4981static inline void _AArch32_Write_vpidr( uint32_t value )
4982{
4983 __asm__ volatile (
4984 "mcr p15, 4, %0, c0, c0, 0" : : "r" ( value ) : "memory"
4985 );
4986}
4987
4988/* VTCR, Virtualization Translation Control Register */
4989
4990#define AARCH32_VTCR_T0SZ( _val ) ( ( _val ) << 0 )
4991#define AARCH32_VTCR_T0SZ_SHIFT 0
4992#define AARCH32_VTCR_T0SZ_MASK 0xfU
4993#define AARCH32_VTCR_T0SZ_GET( _reg ) \
4994 ( ( ( _reg ) >> 0 ) & 0xfU )
4995
4996#define AARCH32_VTCR_S 0x10U
4997
4998#define AARCH32_VTCR_SL0( _val ) ( ( _val ) << 6 )
4999#define AARCH32_VTCR_SL0_SHIFT 6
5000#define AARCH32_VTCR_SL0_MASK 0xc0U
5001#define AARCH32_VTCR_SL0_GET( _reg ) \
5002 ( ( ( _reg ) >> 6 ) & 0x3U )
5003
5004#define AARCH32_VTCR_IRGN0( _val ) ( ( _val ) << 8 )
5005#define AARCH32_VTCR_IRGN0_SHIFT 8
5006#define AARCH32_VTCR_IRGN0_MASK 0x300U
5007#define AARCH32_VTCR_IRGN0_GET( _reg ) \
5008 ( ( ( _reg ) >> 8 ) & 0x3U )
5009
5010#define AARCH32_VTCR_ORGN0( _val ) ( ( _val ) << 10 )
5011#define AARCH32_VTCR_ORGN0_SHIFT 10
5012#define AARCH32_VTCR_ORGN0_MASK 0xc00U
5013#define AARCH32_VTCR_ORGN0_GET( _reg ) \
5014 ( ( ( _reg ) >> 10 ) & 0x3U )
5015
5016#define AARCH32_VTCR_SH0( _val ) ( ( _val ) << 12 )
5017#define AARCH32_VTCR_SH0_SHIFT 12
5018#define AARCH32_VTCR_SH0_MASK 0x3000U
5019#define AARCH32_VTCR_SH0_GET( _reg ) \
5020 ( ( ( _reg ) >> 12 ) & 0x3U )
5021
5022#define AARCH32_VTCR_HWU59 0x2000000U
5023
5024#define AARCH32_VTCR_HWU60 0x4000000U
5025
5026#define AARCH32_VTCR_HWU61 0x8000000U
5027
5028#define AARCH32_VTCR_HWU62 0x10000000U
5029
5030static inline uint32_t _AArch32_Read_vtcr( void )
5031{
5032 uint32_t value;
5033
5034 __asm__ volatile (
5035 "mrc p15, 4, %0, c2, c1, 2" : "=&r" ( value ) : : "memory"
5036 );
5037
5038 return value;
5039}
5040
5041static inline void _AArch32_Write_vtcr( uint32_t value )
5042{
5043 __asm__ volatile (
5044 "mcr p15, 4, %0, c2, c1, 2" : : "r" ( value ) : "memory"
5045 );
5046}
5047
5048/* VTTBR, Virtualization Translation Table Base Register */
5049
5050#define AARCH32_VTTBR_CNP 0x1U
5051
5052#define AARCH32_VTTBR_BADDR( _val ) ( ( _val ) << 1 )
5053#define AARCH32_VTTBR_BADDR_SHIFT 1
5054#define AARCH32_VTTBR_BADDR_MASK 0xfffffffffffeULL
5055#define AARCH32_VTTBR_BADDR_GET( _reg ) \
5056 ( ( ( _reg ) >> 1 ) & 0x7fffffffffffULL )
5057
5058#define AARCH32_VTTBR_VMID( _val ) ( ( _val ) << 48 )
5059#define AARCH32_VTTBR_VMID_SHIFT 48
5060#define AARCH32_VTTBR_VMID_MASK 0xff000000000000ULL
5061#define AARCH32_VTTBR_VMID_GET( _reg ) \
5062 ( ( ( _reg ) >> 48 ) & 0xffULL )
5063
5064static inline uint64_t _AArch32_Read_vttbr( void )
5065{
5066 uint64_t value;
5067
5068 __asm__ volatile (
5069 "mrrc p15, 6, %Q0, %R0, c2" : "=&r" ( value ) : : "memory"
5070 );
5071
5072 return value;
5073}
5074
5075static inline void _AArch32_Write_vttbr( uint64_t value )
5076{
5077 __asm__ volatile (
5078 "mcrr p15, 6, %Q0, %R0, c2" : : "r" ( value ) : "memory"
5079 );
5080}
5081
5082/* DBGAUTHSTATUS, Debug Authentication Status Register */
5083
5084#define AARCH32_DBGAUTHSTATUS_NSID( _val ) ( ( _val ) << 0 )
5085#define AARCH32_DBGAUTHSTATUS_NSID_SHIFT 0
5086#define AARCH32_DBGAUTHSTATUS_NSID_MASK 0x3U
5087#define AARCH32_DBGAUTHSTATUS_NSID_GET( _reg ) \
5088 ( ( ( _reg ) >> 0 ) & 0x3U )
5089
5090#define AARCH32_DBGAUTHSTATUS_NSNID( _val ) ( ( _val ) << 2 )
5091#define AARCH32_DBGAUTHSTATUS_NSNID_SHIFT 2
5092#define AARCH32_DBGAUTHSTATUS_NSNID_MASK 0xcU
5093#define AARCH32_DBGAUTHSTATUS_NSNID_GET( _reg ) \
5094 ( ( ( _reg ) >> 2 ) & 0x3U )
5095
5096#define AARCH32_DBGAUTHSTATUS_SID( _val ) ( ( _val ) << 4 )
5097#define AARCH32_DBGAUTHSTATUS_SID_SHIFT 4
5098#define AARCH32_DBGAUTHSTATUS_SID_MASK 0x30U
5099#define AARCH32_DBGAUTHSTATUS_SID_GET( _reg ) \
5100 ( ( ( _reg ) >> 4 ) & 0x3U )
5101
5102#define AARCH32_DBGAUTHSTATUS_SNID( _val ) ( ( _val ) << 6 )
5103#define AARCH32_DBGAUTHSTATUS_SNID_SHIFT 6
5104#define AARCH32_DBGAUTHSTATUS_SNID_MASK 0xc0U
5105#define AARCH32_DBGAUTHSTATUS_SNID_GET( _reg ) \
5106 ( ( ( _reg ) >> 6 ) & 0x3U )
5107
5108static inline uint32_t _AArch32_Read_dbgauthstatus( void )
5109{
5110 uint32_t value;
5111
5112 __asm__ volatile (
5113 "mrc p14, 0, %0, c7, c14, 6" : "=&r" ( value ) : : "memory"
5114 );
5115
5116 return value;
5117}
5118
5119/* DBGBCR, Debug Breakpoint Control Registers */
5120
5121#define AARCH32_DBGBCR_E 0x1U
5122
5123#define AARCH32_DBGBCR_PMC( _val ) ( ( _val ) << 1 )
5124#define AARCH32_DBGBCR_PMC_SHIFT 1
5125#define AARCH32_DBGBCR_PMC_MASK 0x6U
5126#define AARCH32_DBGBCR_PMC_GET( _reg ) \
5127 ( ( ( _reg ) >> 1 ) & 0x3U )
5128
5129#define AARCH32_DBGBCR_BAS( _val ) ( ( _val ) << 5 )
5130#define AARCH32_DBGBCR_BAS_SHIFT 5
5131#define AARCH32_DBGBCR_BAS_MASK 0x1e0U
5132#define AARCH32_DBGBCR_BAS_GET( _reg ) \
5133 ( ( ( _reg ) >> 5 ) & 0xfU )
5134
5135#define AARCH32_DBGBCR_HMC 0x2000U
5136
5137#define AARCH32_DBGBCR_SSC( _val ) ( ( _val ) << 14 )
5138#define AARCH32_DBGBCR_SSC_SHIFT 14
5139#define AARCH32_DBGBCR_SSC_MASK 0xc000U
5140#define AARCH32_DBGBCR_SSC_GET( _reg ) \
5141 ( ( ( _reg ) >> 14 ) & 0x3U )
5142
5143#define AARCH32_DBGBCR_LBN( _val ) ( ( _val ) << 16 )
5144#define AARCH32_DBGBCR_LBN_SHIFT 16
5145#define AARCH32_DBGBCR_LBN_MASK 0xf0000U
5146#define AARCH32_DBGBCR_LBN_GET( _reg ) \
5147 ( ( ( _reg ) >> 16 ) & 0xfU )
5148
5149#define AARCH32_DBGBCR_BT( _val ) ( ( _val ) << 20 )
5150#define AARCH32_DBGBCR_BT_SHIFT 20
5151#define AARCH32_DBGBCR_BT_MASK 0xf00000U
5152#define AARCH32_DBGBCR_BT_GET( _reg ) \
5153 ( ( ( _reg ) >> 20 ) & 0xfU )
5154
5155/* DBGBCR_0, Debug Breakpoint Control Registers */
5156
5157static inline uint32_t _AArch32_Read_dbgbcr_0( void )
5158{
5159 uint32_t value;
5160
5161 __asm__ volatile (
5162 "mrc p14, 0, %0, c0, c0, 5" : "=&r" ( value ) : : "memory"
5163 );
5164
5165 return value;
5166}
5167
5168static inline void _AArch32_Write_dbgbcr_0( uint32_t value )
5169{
5170 __asm__ volatile (
5171 "mcr p14, 0, %0, c0, c0, 5" : : "r" ( value ) : "memory"
5172 );
5173}
5174
5175/* DBGBCR_1, Debug Breakpoint Control Registers */
5176
5177static inline uint32_t _AArch32_Read_dbgbcr_1( void )
5178{
5179 uint32_t value;
5180
5181 __asm__ volatile (
5182 "mrc p14, 0, %0, c0, c1, 5" : "=&r" ( value ) : : "memory"
5183 );
5184
5185 return value;
5186}
5187
5188static inline void _AArch32_Write_dbgbcr_1( uint32_t value )
5189{
5190 __asm__ volatile (
5191 "mcr p14, 0, %0, c0, c1, 5" : : "r" ( value ) : "memory"
5192 );
5193}
5194
5195/* DBGBCR_2, Debug Breakpoint Control Registers */
5196
5197static inline uint32_t _AArch32_Read_dbgbcr_2( void )
5198{
5199 uint32_t value;
5200
5201 __asm__ volatile (
5202 "mrc p14, 0, %0, c0, c2, 5" : "=&r" ( value ) : : "memory"
5203 );
5204
5205 return value;
5206}
5207
5208static inline void _AArch32_Write_dbgbcr_2( uint32_t value )
5209{
5210 __asm__ volatile (
5211 "mcr p14, 0, %0, c0, c2, 5" : : "r" ( value ) : "memory"
5212 );
5213}
5214
5215/* DBGBCR_3, Debug Breakpoint Control Registers */
5216
5217static inline uint32_t _AArch32_Read_dbgbcr_3( void )
5218{
5219 uint32_t value;
5220
5221 __asm__ volatile (
5222 "mrc p14, 0, %0, c0, c3, 5" : "=&r" ( value ) : : "memory"
5223 );
5224
5225 return value;
5226}
5227
5228static inline void _AArch32_Write_dbgbcr_3( uint32_t value )
5229{
5230 __asm__ volatile (
5231 "mcr p14, 0, %0, c0, c3, 5" : : "r" ( value ) : "memory"
5232 );
5233}
5234
5235/* DBGBCR_4, Debug Breakpoint Control Registers */
5236
5237static inline uint32_t _AArch32_Read_dbgbcr_4( void )
5238{
5239 uint32_t value;
5240
5241 __asm__ volatile (
5242 "mrc p14, 0, %0, c0, c4, 5" : "=&r" ( value ) : : "memory"
5243 );
5244
5245 return value;
5246}
5247
5248static inline void _AArch32_Write_dbgbcr_4( uint32_t value )
5249{
5250 __asm__ volatile (
5251 "mcr p14, 0, %0, c0, c4, 5" : : "r" ( value ) : "memory"
5252 );
5253}
5254
5255/* DBGBCR_5, Debug Breakpoint Control Registers */
5256
5257static inline uint32_t _AArch32_Read_dbgbcr_5( void )
5258{
5259 uint32_t value;
5260
5261 __asm__ volatile (
5262 "mrc p14, 0, %0, c0, c5, 5" : "=&r" ( value ) : : "memory"
5263 );
5264
5265 return value;
5266}
5267
5268static inline void _AArch32_Write_dbgbcr_5( uint32_t value )
5269{
5270 __asm__ volatile (
5271 "mcr p14, 0, %0, c0, c5, 5" : : "r" ( value ) : "memory"
5272 );
5273}
5274
5275/* DBGBCR_6, Debug Breakpoint Control Registers */
5276
5277static inline uint32_t _AArch32_Read_dbgbcr_6( void )
5278{
5279 uint32_t value;
5280
5281 __asm__ volatile (
5282 "mrc p14, 0, %0, c0, c6, 5" : "=&r" ( value ) : : "memory"
5283 );
5284
5285 return value;
5286}
5287
5288static inline void _AArch32_Write_dbgbcr_6( uint32_t value )
5289{
5290 __asm__ volatile (
5291 "mcr p14, 0, %0, c0, c6, 5" : : "r" ( value ) : "memory"
5292 );
5293}
5294
5295/* DBGBCR_7, Debug Breakpoint Control Registers */
5296
5297static inline uint32_t _AArch32_Read_dbgbcr_7( void )
5298{
5299 uint32_t value;
5300
5301 __asm__ volatile (
5302 "mrc p14, 0, %0, c0, c7, 5" : "=&r" ( value ) : : "memory"
5303 );
5304
5305 return value;
5306}
5307
5308static inline void _AArch32_Write_dbgbcr_7( uint32_t value )
5309{
5310 __asm__ volatile (
5311 "mcr p14, 0, %0, c0, c7, 5" : : "r" ( value ) : "memory"
5312 );
5313}
5314
5315/* DBGBCR_8, Debug Breakpoint Control Registers */
5316
5317static inline uint32_t _AArch32_Read_dbgbcr_8( void )
5318{
5319 uint32_t value;
5320
5321 __asm__ volatile (
5322 "mrc p14, 0, %0, c0, c8, 5" : "=&r" ( value ) : : "memory"
5323 );
5324
5325 return value;
5326}
5327
5328static inline void _AArch32_Write_dbgbcr_8( uint32_t value )
5329{
5330 __asm__ volatile (
5331 "mcr p14, 0, %0, c0, c8, 5" : : "r" ( value ) : "memory"
5332 );
5333}
5334
5335/* DBGBCR_9, Debug Breakpoint Control Registers */
5336
5337static inline uint32_t _AArch32_Read_dbgbcr_9( void )
5338{
5339 uint32_t value;
5340
5341 __asm__ volatile (
5342 "mrc p14, 0, %0, c0, c9, 5" : "=&r" ( value ) : : "memory"
5343 );
5344
5345 return value;
5346}
5347
5348static inline void _AArch32_Write_dbgbcr_9( uint32_t value )
5349{
5350 __asm__ volatile (
5351 "mcr p14, 0, %0, c0, c9, 5" : : "r" ( value ) : "memory"
5352 );
5353}
5354
5355/* DBGBCR_10, Debug Breakpoint Control Registers */
5356
5357static inline uint32_t _AArch32_Read_dbgbcr_10( void )
5358{
5359 uint32_t value;
5360
5361 __asm__ volatile (
5362 "mrc p14, 0, %0, c0, c10, 5" : "=&r" ( value ) : : "memory"
5363 );
5364
5365 return value;
5366}
5367
5368static inline void _AArch32_Write_dbgbcr_10( uint32_t value )
5369{
5370 __asm__ volatile (
5371 "mcr p14, 0, %0, c0, c10, 5" : : "r" ( value ) : "memory"
5372 );
5373}
5374
5375/* DBGBCR_11, Debug Breakpoint Control Registers */
5376
5377static inline uint32_t _AArch32_Read_dbgbcr_11( void )
5378{
5379 uint32_t value;
5380
5381 __asm__ volatile (
5382 "mrc p14, 0, %0, c0, c11, 5" : "=&r" ( value ) : : "memory"
5383 );
5384
5385 return value;
5386}
5387
5388static inline void _AArch32_Write_dbgbcr_11( uint32_t value )
5389{
5390 __asm__ volatile (
5391 "mcr p14, 0, %0, c0, c11, 5" : : "r" ( value ) : "memory"
5392 );
5393}
5394
5395/* DBGBCR_12, Debug Breakpoint Control Registers */
5396
5397static inline uint32_t _AArch32_Read_dbgbcr_12( void )
5398{
5399 uint32_t value;
5400
5401 __asm__ volatile (
5402 "mrc p14, 0, %0, c0, c12, 5" : "=&r" ( value ) : : "memory"
5403 );
5404
5405 return value;
5406}
5407
5408static inline void _AArch32_Write_dbgbcr_12( uint32_t value )
5409{
5410 __asm__ volatile (
5411 "mcr p14, 0, %0, c0, c12, 5" : : "r" ( value ) : "memory"
5412 );
5413}
5414
5415/* DBGBCR_13, Debug Breakpoint Control Registers */
5416
5417static inline uint32_t _AArch32_Read_dbgbcr_13( void )
5418{
5419 uint32_t value;
5420
5421 __asm__ volatile (
5422 "mrc p14, 0, %0, c0, c13, 5" : "=&r" ( value ) : : "memory"
5423 );
5424
5425 return value;
5426}
5427
5428static inline void _AArch32_Write_dbgbcr_13( uint32_t value )
5429{
5430 __asm__ volatile (
5431 "mcr p14, 0, %0, c0, c13, 5" : : "r" ( value ) : "memory"
5432 );
5433}
5434
5435/* DBGBCR_14, Debug Breakpoint Control Registers */
5436
5437static inline uint32_t _AArch32_Read_dbgbcr_14( void )
5438{
5439 uint32_t value;
5440
5441 __asm__ volatile (
5442 "mrc p14, 0, %0, c0, c14, 5" : "=&r" ( value ) : : "memory"
5443 );
5444
5445 return value;
5446}
5447
5448static inline void _AArch32_Write_dbgbcr_14( uint32_t value )
5449{
5450 __asm__ volatile (
5451 "mcr p14, 0, %0, c0, c14, 5" : : "r" ( value ) : "memory"
5452 );
5453}
5454
5455/* DBGBCR_15, Debug Breakpoint Control Registers */
5456
5457static inline uint32_t _AArch32_Read_dbgbcr_15( void )
5458{
5459 uint32_t value;
5460
5461 __asm__ volatile (
5462 "mrc p14, 0, %0, c0, c15, 5" : "=&r" ( value ) : : "memory"
5463 );
5464
5465 return value;
5466}
5467
5468static inline void _AArch32_Write_dbgbcr_15( uint32_t value )
5469{
5470 __asm__ volatile (
5471 "mcr p14, 0, %0, c0, c15, 5" : : "r" ( value ) : "memory"
5472 );
5473}
5474
5475/* DBGBVR, Debug Breakpoint Value Registers */
5476
5477#define AARCH32_DBGBVR_CONTEXTID( _val ) ( ( _val ) << 0 )
5478#define AARCH32_DBGBVR_CONTEXTID_SHIFT 0
5479#define AARCH32_DBGBVR_CONTEXTID_MASK 0xffffffffU
5480#define AARCH32_DBGBVR_CONTEXTID_GET( _reg ) \
5481 ( ( ( _reg ) >> 0 ) & 0xffffffffU )
5482
5483#define AARCH32_DBGBVR_VA_31_2( _val ) ( ( _val ) << 2 )
5484#define AARCH32_DBGBVR_VA_31_2_SHIFT 2
5485#define AARCH32_DBGBVR_VA_31_2_MASK 0xfffffffcU
5486#define AARCH32_DBGBVR_VA_31_2_GET( _reg ) \
5487 ( ( ( _reg ) >> 2 ) & 0x3fffffffU )
5488
5489/* DBGBVR_0, Debug Breakpoint Value Registers */
5490
5491static inline uint32_t _AArch32_Read_dbgbvr_0( void )
5492{
5493 uint32_t value;
5494
5495 __asm__ volatile (
5496 "mrc p14, 0, %0, c0, c0, 4" : "=&r" ( value ) : : "memory"
5497 );
5498
5499 return value;
5500}
5501
5502static inline void _AArch32_Write_dbgbvr_0( uint32_t value )
5503{
5504 __asm__ volatile (
5505 "mcr p14, 0, %0, c0, c0, 4" : : "r" ( value ) : "memory"
5506 );
5507}
5508
5509/* DBGBVR_1, Debug Breakpoint Value Registers */
5510
5511static inline uint32_t _AArch32_Read_dbgbvr_1( void )
5512{
5513 uint32_t value;
5514
5515 __asm__ volatile (
5516 "mrc p14, 0, %0, c0, c1, 4" : "=&r" ( value ) : : "memory"
5517 );
5518
5519 return value;
5520}
5521
5522static inline void _AArch32_Write_dbgbvr_1( uint32_t value )
5523{
5524 __asm__ volatile (
5525 "mcr p14, 0, %0, c0, c1, 4" : : "r" ( value ) : "memory"
5526 );
5527}
5528
5529/* DBGBVR_2, Debug Breakpoint Value Registers */
5530
5531static inline uint32_t _AArch32_Read_dbgbvr_2( void )
5532{
5533 uint32_t value;
5534
5535 __asm__ volatile (
5536 "mrc p14, 0, %0, c0, c2, 4" : "=&r" ( value ) : : "memory"
5537 );
5538
5539 return value;
5540}
5541
5542static inline void _AArch32_Write_dbgbvr_2( uint32_t value )
5543{
5544 __asm__ volatile (
5545 "mcr p14, 0, %0, c0, c2, 4" : : "r" ( value ) : "memory"
5546 );
5547}
5548
5549/* DBGBVR_3, Debug Breakpoint Value Registers */
5550
5551static inline uint32_t _AArch32_Read_dbgbvr_3( void )
5552{
5553 uint32_t value;
5554
5555 __asm__ volatile (
5556 "mrc p14, 0, %0, c0, c3, 4" : "=&r" ( value ) : : "memory"
5557 );
5558
5559 return value;
5560}
5561
5562static inline void _AArch32_Write_dbgbvr_3( uint32_t value )
5563{
5564 __asm__ volatile (
5565 "mcr p14, 0, %0, c0, c3, 4" : : "r" ( value ) : "memory"
5566 );
5567}
5568
5569/* DBGBVR_4, Debug Breakpoint Value Registers */
5570
5571static inline uint32_t _AArch32_Read_dbgbvr_4( void )
5572{
5573 uint32_t value;
5574
5575 __asm__ volatile (
5576 "mrc p14, 0, %0, c0, c4, 4" : "=&r" ( value ) : : "memory"
5577 );
5578
5579 return value;
5580}
5581
5582static inline void _AArch32_Write_dbgbvr_4( uint32_t value )
5583{
5584 __asm__ volatile (
5585 "mcr p14, 0, %0, c0, c4, 4" : : "r" ( value ) : "memory"
5586 );
5587}
5588
5589/* DBGBVR_5, Debug Breakpoint Value Registers */
5590
5591static inline uint32_t _AArch32_Read_dbgbvr_5( void )
5592{
5593 uint32_t value;
5594
5595 __asm__ volatile (
5596 "mrc p14, 0, %0, c0, c5, 4" : "=&r" ( value ) : : "memory"
5597 );
5598
5599 return value;
5600}
5601
5602static inline void _AArch32_Write_dbgbvr_5( uint32_t value )
5603{
5604 __asm__ volatile (
5605 "mcr p14, 0, %0, c0, c5, 4" : : "r" ( value ) : "memory"
5606 );
5607}
5608
5609/* DBGBVR_6, Debug Breakpoint Value Registers */
5610
5611static inline uint32_t _AArch32_Read_dbgbvr_6( void )
5612{
5613 uint32_t value;
5614
5615 __asm__ volatile (
5616 "mrc p14, 0, %0, c0, c6, 4" : "=&r" ( value ) : : "memory"
5617 );
5618
5619 return value;
5620}
5621
5622static inline void _AArch32_Write_dbgbvr_6( uint32_t value )
5623{
5624 __asm__ volatile (
5625 "mcr p14, 0, %0, c0, c6, 4" : : "r" ( value ) : "memory"
5626 );
5627}
5628
5629/* DBGBVR_7, Debug Breakpoint Value Registers */
5630
5631static inline uint32_t _AArch32_Read_dbgbvr_7( void )
5632{
5633 uint32_t value;
5634
5635 __asm__ volatile (
5636 "mrc p14, 0, %0, c0, c7, 4" : "=&r" ( value ) : : "memory"
5637 );
5638
5639 return value;
5640}
5641
5642static inline void _AArch32_Write_dbgbvr_7( uint32_t value )
5643{
5644 __asm__ volatile (
5645 "mcr p14, 0, %0, c0, c7, 4" : : "r" ( value ) : "memory"
5646 );
5647}
5648
5649/* DBGBVR_8, Debug Breakpoint Value Registers */
5650
5651static inline uint32_t _AArch32_Read_dbgbvr_8( void )
5652{
5653 uint32_t value;
5654
5655 __asm__ volatile (
5656 "mrc p14, 0, %0, c0, c8, 4" : "=&r" ( value ) : : "memory"
5657 );
5658
5659 return value;
5660}
5661
5662static inline void _AArch32_Write_dbgbvr_8( uint32_t value )
5663{
5664 __asm__ volatile (
5665 "mcr p14, 0, %0, c0, c8, 4" : : "r" ( value ) : "memory"
5666 );
5667}
5668
5669/* DBGBVR_9, Debug Breakpoint Value Registers */
5670
5671static inline uint32_t _AArch32_Read_dbgbvr_9( void )
5672{
5673 uint32_t value;
5674
5675 __asm__ volatile (
5676 "mrc p14, 0, %0, c0, c9, 4" : "=&r" ( value ) : : "memory"
5677 );
5678
5679 return value;
5680}
5681
5682static inline void _AArch32_Write_dbgbvr_9( uint32_t value )
5683{
5684 __asm__ volatile (
5685 "mcr p14, 0, %0, c0, c9, 4" : : "r" ( value ) : "memory"
5686 );
5687}
5688
5689/* DBGBVR_10, Debug Breakpoint Value Registers */
5690
5691static inline uint32_t _AArch32_Read_dbgbvr_10( void )
5692{
5693 uint32_t value;
5694
5695 __asm__ volatile (
5696 "mrc p14, 0, %0, c0, c10, 4" : "=&r" ( value ) : : "memory"
5697 );
5698
5699 return value;
5700}
5701
5702static inline void _AArch32_Write_dbgbvr_10( uint32_t value )
5703{
5704 __asm__ volatile (
5705 "mcr p14, 0, %0, c0, c10, 4" : : "r" ( value ) : "memory"
5706 );
5707}
5708
5709/* DBGBVR_11, Debug Breakpoint Value Registers */
5710
5711static inline uint32_t _AArch32_Read_dbgbvr_11( void )
5712{
5713 uint32_t value;
5714
5715 __asm__ volatile (
5716 "mrc p14, 0, %0, c0, c11, 4" : "=&r" ( value ) : : "memory"
5717 );
5718
5719 return value;
5720}
5721
5722static inline void _AArch32_Write_dbgbvr_11( uint32_t value )
5723{
5724 __asm__ volatile (
5725 "mcr p14, 0, %0, c0, c11, 4" : : "r" ( value ) : "memory"
5726 );
5727}
5728
5729/* DBGBVR_12, Debug Breakpoint Value Registers */
5730
5731static inline uint32_t _AArch32_Read_dbgbvr_12( void )
5732{
5733 uint32_t value;
5734
5735 __asm__ volatile (
5736 "mrc p14, 0, %0, c0, c12, 4" : "=&r" ( value ) : : "memory"
5737 );
5738
5739 return value;
5740}
5741
5742static inline void _AArch32_Write_dbgbvr_12( uint32_t value )
5743{
5744 __asm__ volatile (
5745 "mcr p14, 0, %0, c0, c12, 4" : : "r" ( value ) : "memory"
5746 );
5747}
5748
5749/* DBGBVR_13, Debug Breakpoint Value Registers */
5750
5751static inline uint32_t _AArch32_Read_dbgbvr_13( void )
5752{
5753 uint32_t value;
5754
5755 __asm__ volatile (
5756 "mrc p14, 0, %0, c0, c13, 4" : "=&r" ( value ) : : "memory"
5757 );
5758
5759 return value;
5760}
5761
5762static inline void _AArch32_Write_dbgbvr_13( uint32_t value )
5763{
5764 __asm__ volatile (
5765 "mcr p14, 0, %0, c0, c13, 4" : : "r" ( value ) : "memory"
5766 );
5767}
5768
5769/* DBGBVR_14, Debug Breakpoint Value Registers */
5770
5771static inline uint32_t _AArch32_Read_dbgbvr_14( void )
5772{
5773 uint32_t value;
5774
5775 __asm__ volatile (
5776 "mrc p14, 0, %0, c0, c14, 4" : "=&r" ( value ) : : "memory"
5777 );
5778
5779 return value;
5780}
5781
5782static inline void _AArch32_Write_dbgbvr_14( uint32_t value )
5783{
5784 __asm__ volatile (
5785 "mcr p14, 0, %0, c0, c14, 4" : : "r" ( value ) : "memory"
5786 );
5787}
5788
5789/* DBGBVR_15, Debug Breakpoint Value Registers */
5790
5791static inline uint32_t _AArch32_Read_dbgbvr_15( void )
5792{
5793 uint32_t value;
5794
5795 __asm__ volatile (
5796 "mrc p14, 0, %0, c0, c15, 4" : "=&r" ( value ) : : "memory"
5797 );
5798
5799 return value;
5800}
5801
5802static inline void _AArch32_Write_dbgbvr_15( uint32_t value )
5803{
5804 __asm__ volatile (
5805 "mcr p14, 0, %0, c0, c15, 4" : : "r" ( value ) : "memory"
5806 );
5807}
5808
5809/* DBGBXVR, Debug Breakpoint Extended Value Registers */
5810
5811#define AARCH32_DBGBXVR_VMID_7_0( _val ) ( ( _val ) << 0 )
5812#define AARCH32_DBGBXVR_VMID_7_0_SHIFT 0
5813#define AARCH32_DBGBXVR_VMID_7_0_MASK 0xffU
5814#define AARCH32_DBGBXVR_VMID_7_0_GET( _reg ) \
5815 ( ( ( _reg ) >> 0 ) & 0xffU )
5816
5817#define AARCH32_DBGBXVR_CONTEXTID2( _val ) ( ( _val ) << 0 )
5818#define AARCH32_DBGBXVR_CONTEXTID2_SHIFT 0
5819#define AARCH32_DBGBXVR_CONTEXTID2_MASK 0xffffffffU
5820#define AARCH32_DBGBXVR_CONTEXTID2_GET( _reg ) \
5821 ( ( ( _reg ) >> 0 ) & 0xffffffffU )
5822
5823#define AARCH32_DBGBXVR_VMID_15_8( _val ) ( ( _val ) << 8 )
5824#define AARCH32_DBGBXVR_VMID_15_8_SHIFT 8
5825#define AARCH32_DBGBXVR_VMID_15_8_MASK 0xff00U
5826#define AARCH32_DBGBXVR_VMID_15_8_GET( _reg ) \
5827 ( ( ( _reg ) >> 8 ) & 0xffU )
5828
5829/* DBGBXVR_0, Debug Breakpoint Extended Value Registers */
5830
5831static inline uint32_t _AArch32_Read_dbgbxvr_0( void )
5832{
5833 uint32_t value;
5834
5835 __asm__ volatile (
5836 "mrc p14, 0, %0, c1, c0, 1" : "=&r" ( value ) : : "memory"
5837 );
5838
5839 return value;
5840}
5841
5842static inline void _AArch32_Write_dbgbxvr_0( uint32_t value )
5843{
5844 __asm__ volatile (
5845 "mcr p14, 0, %0, c1, c0, 1" : : "r" ( value ) : "memory"
5846 );
5847}
5848
5849/* DBGBXVR_1, Debug Breakpoint Extended Value Registers */
5850
5851static inline uint32_t _AArch32_Read_dbgbxvr_1( void )
5852{
5853 uint32_t value;
5854
5855 __asm__ volatile (
5856 "mrc p14, 0, %0, c1, c1, 1" : "=&r" ( value ) : : "memory"
5857 );
5858
5859 return value;
5860}
5861
5862static inline void _AArch32_Write_dbgbxvr_1( uint32_t value )
5863{
5864 __asm__ volatile (
5865 "mcr p14, 0, %0, c1, c1, 1" : : "r" ( value ) : "memory"
5866 );
5867}
5868
5869/* DBGBXVR_2, Debug Breakpoint Extended Value Registers */
5870
5871static inline uint32_t _AArch32_Read_dbgbxvr_2( void )
5872{
5873 uint32_t value;
5874
5875 __asm__ volatile (
5876 "mrc p14, 0, %0, c1, c2, 1" : "=&r" ( value ) : : "memory"
5877 );
5878
5879 return value;
5880}
5881
5882static inline void _AArch32_Write_dbgbxvr_2( uint32_t value )
5883{
5884 __asm__ volatile (
5885 "mcr p14, 0, %0, c1, c2, 1" : : "r" ( value ) : "memory"
5886 );
5887}
5888
5889/* DBGBXVR_3, Debug Breakpoint Extended Value Registers */
5890
5891static inline uint32_t _AArch32_Read_dbgbxvr_3( void )
5892{
5893 uint32_t value;
5894
5895 __asm__ volatile (
5896 "mrc p14, 0, %0, c1, c3, 1" : "=&r" ( value ) : : "memory"
5897 );
5898
5899 return value;
5900}
5901
5902static inline void _AArch32_Write_dbgbxvr_3( uint32_t value )
5903{
5904 __asm__ volatile (
5905 "mcr p14, 0, %0, c1, c3, 1" : : "r" ( value ) : "memory"
5906 );
5907}
5908
5909/* DBGBXVR_4, Debug Breakpoint Extended Value Registers */
5910
5911static inline uint32_t _AArch32_Read_dbgbxvr_4( void )
5912{
5913 uint32_t value;
5914
5915 __asm__ volatile (
5916 "mrc p14, 0, %0, c1, c4, 1" : "=&r" ( value ) : : "memory"
5917 );
5918
5919 return value;
5920}
5921
5922static inline void _AArch32_Write_dbgbxvr_4( uint32_t value )
5923{
5924 __asm__ volatile (
5925 "mcr p14, 0, %0, c1, c4, 1" : : "r" ( value ) : "memory"
5926 );
5927}
5928
5929/* DBGBXVR_5, Debug Breakpoint Extended Value Registers */
5930
5931static inline uint32_t _AArch32_Read_dbgbxvr_5( void )
5932{
5933 uint32_t value;
5934
5935 __asm__ volatile (
5936 "mrc p14, 0, %0, c1, c5, 1" : "=&r" ( value ) : : "memory"
5937 );
5938
5939 return value;
5940}
5941
5942static inline void _AArch32_Write_dbgbxvr_5( uint32_t value )
5943{
5944 __asm__ volatile (
5945 "mcr p14, 0, %0, c1, c5, 1" : : "r" ( value ) : "memory"
5946 );
5947}
5948
5949/* DBGBXVR_6, Debug Breakpoint Extended Value Registers */
5950
5951static inline uint32_t _AArch32_Read_dbgbxvr_6( void )
5952{
5953 uint32_t value;
5954
5955 __asm__ volatile (
5956 "mrc p14, 0, %0, c1, c6, 1" : "=&r" ( value ) : : "memory"
5957 );
5958
5959 return value;
5960}
5961
5962static inline void _AArch32_Write_dbgbxvr_6( uint32_t value )
5963{
5964 __asm__ volatile (
5965 "mcr p14, 0, %0, c1, c6, 1" : : "r" ( value ) : "memory"
5966 );
5967}
5968
5969/* DBGBXVR_7, Debug Breakpoint Extended Value Registers */
5970
5971static inline uint32_t _AArch32_Read_dbgbxvr_7( void )
5972{
5973 uint32_t value;
5974
5975 __asm__ volatile (
5976 "mrc p14, 0, %0, c1, c7, 1" : "=&r" ( value ) : : "memory"
5977 );
5978
5979 return value;
5980}
5981
5982static inline void _AArch32_Write_dbgbxvr_7( uint32_t value )
5983{
5984 __asm__ volatile (
5985 "mcr p14, 0, %0, c1, c7, 1" : : "r" ( value ) : "memory"
5986 );
5987}
5988
5989/* DBGBXVR_8, Debug Breakpoint Extended Value Registers */
5990
5991static inline uint32_t _AArch32_Read_dbgbxvr_8( void )
5992{
5993 uint32_t value;
5994
5995 __asm__ volatile (
5996 "mrc p14, 0, %0, c1, c8, 1" : "=&r" ( value ) : : "memory"
5997 );
5998
5999 return value;
6000}
6001
6002static inline void _AArch32_Write_dbgbxvr_8( uint32_t value )
6003{
6004 __asm__ volatile (
6005 "mcr p14, 0, %0, c1, c8, 1" : : "r" ( value ) : "memory"
6006 );
6007}
6008
6009/* DBGBXVR_9, Debug Breakpoint Extended Value Registers */
6010
6011static inline uint32_t _AArch32_Read_dbgbxvr_9( void )
6012{
6013 uint32_t value;
6014
6015 __asm__ volatile (
6016 "mrc p14, 0, %0, c1, c9, 1" : "=&r" ( value ) : : "memory"
6017 );
6018
6019 return value;
6020}
6021
6022static inline void _AArch32_Write_dbgbxvr_9( uint32_t value )
6023{
6024 __asm__ volatile (
6025 "mcr p14, 0, %0, c1, c9, 1" : : "r" ( value ) : "memory"
6026 );
6027}
6028
6029/* DBGBXVR_10, Debug Breakpoint Extended Value Registers */
6030
6031static inline uint32_t _AArch32_Read_dbgbxvr_10( void )
6032{
6033 uint32_t value;
6034
6035 __asm__ volatile (
6036 "mrc p14, 0, %0, c1, c10, 1" : "=&r" ( value ) : : "memory"
6037 );
6038
6039 return value;
6040}
6041
6042static inline void _AArch32_Write_dbgbxvr_10( uint32_t value )
6043{
6044 __asm__ volatile (
6045 "mcr p14, 0, %0, c1, c10, 1" : : "r" ( value ) : "memory"
6046 );
6047}
6048
6049/* DBGBXVR_11, Debug Breakpoint Extended Value Registers */
6050
6051static inline uint32_t _AArch32_Read_dbgbxvr_11( void )
6052{
6053 uint32_t value;
6054
6055 __asm__ volatile (
6056 "mrc p14, 0, %0, c1, c11, 1" : "=&r" ( value ) : : "memory"
6057 );
6058
6059 return value;
6060}
6061
6062static inline void _AArch32_Write_dbgbxvr_11( uint32_t value )
6063{
6064 __asm__ volatile (
6065 "mcr p14, 0, %0, c1, c11, 1" : : "r" ( value ) : "memory"
6066 );
6067}
6068
6069/* DBGBXVR_12, Debug Breakpoint Extended Value Registers */
6070
6071static inline uint32_t _AArch32_Read_dbgbxvr_12( void )
6072{
6073 uint32_t value;
6074
6075 __asm__ volatile (
6076 "mrc p14, 0, %0, c1, c12, 1" : "=&r" ( value ) : : "memory"
6077 );
6078
6079 return value;
6080}
6081
6082static inline void _AArch32_Write_dbgbxvr_12( uint32_t value )
6083{
6084 __asm__ volatile (
6085 "mcr p14, 0, %0, c1, c12, 1" : : "r" ( value ) : "memory"
6086 );
6087}
6088
6089/* DBGBXVR_13, Debug Breakpoint Extended Value Registers */
6090
6091static inline uint32_t _AArch32_Read_dbgbxvr_13( void )
6092{
6093 uint32_t value;
6094
6095 __asm__ volatile (
6096 "mrc p14, 0, %0, c1, c13, 1" : "=&r" ( value ) : : "memory"
6097 );
6098
6099 return value;
6100}
6101
6102static inline void _AArch32_Write_dbgbxvr_13( uint32_t value )
6103{
6104 __asm__ volatile (
6105 "mcr p14, 0, %0, c1, c13, 1" : : "r" ( value ) : "memory"
6106 );
6107}
6108
6109/* DBGBXVR_14, Debug Breakpoint Extended Value Registers */
6110
6111static inline uint32_t _AArch32_Read_dbgbxvr_14( void )
6112{
6113 uint32_t value;
6114
6115 __asm__ volatile (
6116 "mrc p14, 0, %0, c1, c14, 1" : "=&r" ( value ) : : "memory"
6117 );
6118
6119 return value;
6120}
6121
6122static inline void _AArch32_Write_dbgbxvr_14( uint32_t value )
6123{
6124 __asm__ volatile (
6125 "mcr p14, 0, %0, c1, c14, 1" : : "r" ( value ) : "memory"
6126 );
6127}
6128
6129/* DBGBXVR_15, Debug Breakpoint Extended Value Registers */
6130
6131static inline uint32_t _AArch32_Read_dbgbxvr_15( void )
6132{
6133 uint32_t value;
6134
6135 __asm__ volatile (
6136 "mrc p14, 0, %0, c1, c15, 1" : "=&r" ( value ) : : "memory"
6137 );
6138
6139 return value;
6140}
6141
6142static inline void _AArch32_Write_dbgbxvr_15( uint32_t value )
6143{
6144 __asm__ volatile (
6145 "mcr p14, 0, %0, c1, c15, 1" : : "r" ( value ) : "memory"
6146 );
6147}
6148
6149/* DBGCLAIMCLR, Debug CLAIM Tag Clear Register */
6150
6151#define AARCH32_DBGCLAIMCLR_CLAIM( _val ) ( ( _val ) << 0 )
6152#define AARCH32_DBGCLAIMCLR_CLAIM_SHIFT 0
6153#define AARCH32_DBGCLAIMCLR_CLAIM_MASK 0xffU
6154#define AARCH32_DBGCLAIMCLR_CLAIM_GET( _reg ) \
6155 ( ( ( _reg ) >> 0 ) & 0xffU )
6156
6157static inline uint32_t _AArch32_Read_dbgclaimclr( void )
6158{
6159 uint32_t value;
6160
6161 __asm__ volatile (
6162 "mrc p14, 0, %0, c7, c9, 6" : "=&r" ( value ) : : "memory"
6163 );
6164
6165 return value;
6166}
6167
6168static inline void _AArch32_Write_dbgclaimclr( uint32_t value )
6169{
6170 __asm__ volatile (
6171 "mcr p14, 0, %0, c7, c9, 6" : : "r" ( value ) : "memory"
6172 );
6173}
6174
6175/* DBGCLAIMSET, Debug CLAIM Tag Set Register */
6176
6177#define AARCH32_DBGCLAIMSET_CLAIM( _val ) ( ( _val ) << 0 )
6178#define AARCH32_DBGCLAIMSET_CLAIM_SHIFT 0
6179#define AARCH32_DBGCLAIMSET_CLAIM_MASK 0xffU
6180#define AARCH32_DBGCLAIMSET_CLAIM_GET( _reg ) \
6181 ( ( ( _reg ) >> 0 ) & 0xffU )
6182
6183static inline uint32_t _AArch32_Read_dbgclaimset( void )
6184{
6185 uint32_t value;
6186
6187 __asm__ volatile (
6188 "mrc p14, 0, %0, c7, c8, 6" : "=&r" ( value ) : : "memory"
6189 );
6190
6191 return value;
6192}
6193
6194static inline void _AArch32_Write_dbgclaimset( uint32_t value )
6195{
6196 __asm__ volatile (
6197 "mcr p14, 0, %0, c7, c8, 6" : : "r" ( value ) : "memory"
6198 );
6199}
6200
6201/* DBGDCCINT, DCC Interrupt Enable Register */
6202
6203#define AARCH32_DBGDCCINT_TX 0x20000000U
6204
6205#define AARCH32_DBGDCCINT_RX 0x40000000U
6206
6207static inline uint32_t _AArch32_Read_dbgdccint( void )
6208{
6209 uint32_t value;
6210
6211 __asm__ volatile (
6212 "mrc p14, 0, %0, c0, c2, 0" : "=&r" ( value ) : : "memory"
6213 );
6214
6215 return value;
6216}
6217
6218static inline void _AArch32_Write_dbgdccint( uint32_t value )
6219{
6220 __asm__ volatile (
6221 "mcr p14, 0, %0, c0, c2, 0" : : "r" ( value ) : "memory"
6222 );
6223}
6224
6225/* DBGDEVID, Debug Device ID Register 0 */
6226
6227#define AARCH32_DBGDEVID_PCSAMPLE( _val ) ( ( _val ) << 0 )
6228#define AARCH32_DBGDEVID_PCSAMPLE_SHIFT 0
6229#define AARCH32_DBGDEVID_PCSAMPLE_MASK 0xfU
6230#define AARCH32_DBGDEVID_PCSAMPLE_GET( _reg ) \
6231 ( ( ( _reg ) >> 0 ) & 0xfU )
6232
6233#define AARCH32_DBGDEVID_WPADDRMASK( _val ) ( ( _val ) << 4 )
6234#define AARCH32_DBGDEVID_WPADDRMASK_SHIFT 4
6235#define AARCH32_DBGDEVID_WPADDRMASK_MASK 0xf0U
6236#define AARCH32_DBGDEVID_WPADDRMASK_GET( _reg ) \
6237 ( ( ( _reg ) >> 4 ) & 0xfU )
6238
6239#define AARCH32_DBGDEVID_BPADDRMASK( _val ) ( ( _val ) << 8 )
6240#define AARCH32_DBGDEVID_BPADDRMASK_SHIFT 8
6241#define AARCH32_DBGDEVID_BPADDRMASK_MASK 0xf00U
6242#define AARCH32_DBGDEVID_BPADDRMASK_GET( _reg ) \
6243 ( ( ( _reg ) >> 8 ) & 0xfU )
6244
6245#define AARCH32_DBGDEVID_VECTORCATCH( _val ) ( ( _val ) << 12 )
6246#define AARCH32_DBGDEVID_VECTORCATCH_SHIFT 12
6247#define AARCH32_DBGDEVID_VECTORCATCH_MASK 0xf000U
6248#define AARCH32_DBGDEVID_VECTORCATCH_GET( _reg ) \
6249 ( ( ( _reg ) >> 12 ) & 0xfU )
6250
6251#define AARCH32_DBGDEVID_VIRTEXTNS( _val ) ( ( _val ) << 16 )
6252#define AARCH32_DBGDEVID_VIRTEXTNS_SHIFT 16
6253#define AARCH32_DBGDEVID_VIRTEXTNS_MASK 0xf0000U
6254#define AARCH32_DBGDEVID_VIRTEXTNS_GET( _reg ) \
6255 ( ( ( _reg ) >> 16 ) & 0xfU )
6256
6257#define AARCH32_DBGDEVID_DOUBLELOCK( _val ) ( ( _val ) << 20 )
6258#define AARCH32_DBGDEVID_DOUBLELOCK_SHIFT 20
6259#define AARCH32_DBGDEVID_DOUBLELOCK_MASK 0xf00000U
6260#define AARCH32_DBGDEVID_DOUBLELOCK_GET( _reg ) \
6261 ( ( ( _reg ) >> 20 ) & 0xfU )
6262
6263#define AARCH32_DBGDEVID_AUXREGS( _val ) ( ( _val ) << 24 )
6264#define AARCH32_DBGDEVID_AUXREGS_SHIFT 24
6265#define AARCH32_DBGDEVID_AUXREGS_MASK 0xf000000U
6266#define AARCH32_DBGDEVID_AUXREGS_GET( _reg ) \
6267 ( ( ( _reg ) >> 24 ) & 0xfU )
6268
6269#define AARCH32_DBGDEVID_CIDMASK( _val ) ( ( _val ) << 28 )
6270#define AARCH32_DBGDEVID_CIDMASK_SHIFT 28
6271#define AARCH32_DBGDEVID_CIDMASK_MASK 0xf0000000U
6272#define AARCH32_DBGDEVID_CIDMASK_GET( _reg ) \
6273 ( ( ( _reg ) >> 28 ) & 0xfU )
6274
6275static inline uint32_t _AArch32_Read_dbgdevid( void )
6276{
6277 uint32_t value;
6278
6279 __asm__ volatile (
6280 "mrc p14, 0, %0, c7, c2, 7" : "=&r" ( value ) : : "memory"
6281 );
6282
6283 return value;
6284}
6285
6286/* DBGDEVID1, Debug Device ID Register 1 */
6287
6288#define AARCH32_DBGDEVID1_PCSROFFSET( _val ) ( ( _val ) << 0 )
6289#define AARCH32_DBGDEVID1_PCSROFFSET_SHIFT 0
6290#define AARCH32_DBGDEVID1_PCSROFFSET_MASK 0xfU
6291#define AARCH32_DBGDEVID1_PCSROFFSET_GET( _reg ) \
6292 ( ( ( _reg ) >> 0 ) & 0xfU )
6293
6294static inline uint32_t _AArch32_Read_dbgdevid1( void )
6295{
6296 uint32_t value;
6297
6298 __asm__ volatile (
6299 "mrc p14, 0, %0, c7, c1, 7" : "=&r" ( value ) : : "memory"
6300 );
6301
6302 return value;
6303}
6304
6305/* DBGDEVID2, Debug Device ID Register 2 */
6306
6307static inline uint32_t _AArch32_Read_dbgdevid2( void )
6308{
6309 uint32_t value;
6310
6311 __asm__ volatile (
6312 "mrc p14, 0, %0, c7, c0, 7" : "=&r" ( value ) : : "memory"
6313 );
6314
6315 return value;
6316}
6317
6318/* DBGDIDR, Debug ID Register */
6319
6320#define AARCH32_DBGDIDR_SE_IMP 0x1000U
6321
6322#define AARCH32_DBGDIDR_NSUHD_IMP 0x4000U
6323
6324#define AARCH32_DBGDIDR_VERSION( _val ) ( ( _val ) << 16 )
6325#define AARCH32_DBGDIDR_VERSION_SHIFT 16
6326#define AARCH32_DBGDIDR_VERSION_MASK 0xf0000U
6327#define AARCH32_DBGDIDR_VERSION_GET( _reg ) \
6328 ( ( ( _reg ) >> 16 ) & 0xfU )
6329
6330#define AARCH32_DBGDIDR_CTX_CMPS( _val ) ( ( _val ) << 20 )
6331#define AARCH32_DBGDIDR_CTX_CMPS_SHIFT 20
6332#define AARCH32_DBGDIDR_CTX_CMPS_MASK 0xf00000U
6333#define AARCH32_DBGDIDR_CTX_CMPS_GET( _reg ) \
6334 ( ( ( _reg ) >> 20 ) & 0xfU )
6335
6336#define AARCH32_DBGDIDR_BRPS( _val ) ( ( _val ) << 24 )
6337#define AARCH32_DBGDIDR_BRPS_SHIFT 24
6338#define AARCH32_DBGDIDR_BRPS_MASK 0xf000000U
6339#define AARCH32_DBGDIDR_BRPS_GET( _reg ) \
6340 ( ( ( _reg ) >> 24 ) & 0xfU )
6341
6342#define AARCH32_DBGDIDR_WRPS( _val ) ( ( _val ) << 28 )
6343#define AARCH32_DBGDIDR_WRPS_SHIFT 28
6344#define AARCH32_DBGDIDR_WRPS_MASK 0xf0000000U
6345#define AARCH32_DBGDIDR_WRPS_GET( _reg ) \
6346 ( ( ( _reg ) >> 28 ) & 0xfU )
6347
6348static inline uint32_t _AArch32_Read_dbgdidr( void )
6349{
6350 uint32_t value;
6351
6352 __asm__ volatile (
6353 "mrc p14, 0, %0, c0, c0, 0" : "=&r" ( value ) : : "memory"
6354 );
6355
6356 return value;
6357}
6358
6359/* DBGDRAR, Debug ROM Address Register */
6360
6361#define AARCH32_DBGDRAR_VALID( _val ) ( ( _val ) << 0 )
6362#define AARCH32_DBGDRAR_VALID_SHIFT 0
6363#define AARCH32_DBGDRAR_VALID_MASK 0x3U
6364#define AARCH32_DBGDRAR_VALID_GET( _reg ) \
6365 ( ( ( _reg ) >> 0 ) & 0x3U )
6366
6367#define AARCH32_DBGDRAR_ROMADDR_47_12( _val ) ( ( _val ) << 12 )
6368#define AARCH32_DBGDRAR_ROMADDR_47_12_SHIFT 12
6369#define AARCH32_DBGDRAR_ROMADDR_47_12_MASK 0xfffffffff000ULL
6370#define AARCH32_DBGDRAR_ROMADDR_47_12_GET( _reg ) \
6371 ( ( ( _reg ) >> 12 ) & 0xfffffffffULL )
6372
6373static inline uint32_t _AArch32_Read_32_dbgdrar( void )
6374{
6375 uint32_t value;
6376
6377 __asm__ volatile (
6378 "mrc p14, 0, %0, c1, c0, 0" : "=&r" ( value ) : : "memory"
6379 );
6380
6381 return value;
6382}
6383
6384/* DBGDRAR, Debug ROM Address Register */
6385
6386static inline uint64_t _AArch32_Read_64_dbgdrar( void )
6387{
6388 uint64_t value;
6389
6390 __asm__ volatile (
6391 "mrrc p14, 0, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
6392 );
6393
6394 return value;
6395}
6396
6397/* DBGDSAR, Debug Self Address Register */
6398
6399static inline uint32_t _AArch32_Read_32_dbgdsar( void )
6400{
6401 uint32_t value;
6402
6403 __asm__ volatile (
6404 "mrc p14, 0, %0, c2, c0, 0" : "=&r" ( value ) : : "memory"
6405 );
6406
6407 return value;
6408}
6409
6410/* DBGDSAR, Debug Self Address Register */
6411
6412static inline uint64_t _AArch32_Read_64_dbgdsar( void )
6413{
6414 uint64_t value;
6415
6416 __asm__ volatile (
6417 "mrrc p14, 0, %Q0, %R0, c2" : "=&r" ( value ) : : "memory"
6418 );
6419
6420 return value;
6421}
6422
6423/* DBGDSCREXT, Debug Status and Control Register, External View */
6424
6425#define AARCH32_DBGDSCREXT_MOE( _val ) ( ( _val ) << 2 )
6426#define AARCH32_DBGDSCREXT_MOE_SHIFT 2
6427#define AARCH32_DBGDSCREXT_MOE_MASK 0x3cU
6428#define AARCH32_DBGDSCREXT_MOE_GET( _reg ) \
6429 ( ( ( _reg ) >> 2 ) & 0xfU )
6430
6431#define AARCH32_DBGDSCREXT_ERR 0x40U
6432
6433#define AARCH32_DBGDSCREXT_UDCCDIS 0x1000U
6434
6435#define AARCH32_DBGDSCREXT_HDE 0x4000U
6436
6437#define AARCH32_DBGDSCREXT_MDBGEN 0x8000U
6438
6439#define AARCH32_DBGDSCREXT_SPIDDIS 0x10000U
6440
6441#define AARCH32_DBGDSCREXT_SPNIDDIS 0x20000U
6442
6443#define AARCH32_DBGDSCREXT_NS 0x40000U
6444
6445#define AARCH32_DBGDSCREXT_SC2 0x80000U
6446
6447#define AARCH32_DBGDSCREXT_TDA 0x200000U
6448
6449#define AARCH32_DBGDSCREXT_INTDIS( _val ) ( ( _val ) << 22 )
6450#define AARCH32_DBGDSCREXT_INTDIS_SHIFT 22
6451#define AARCH32_DBGDSCREXT_INTDIS_MASK 0xc00000U
6452#define AARCH32_DBGDSCREXT_INTDIS_GET( _reg ) \
6453 ( ( ( _reg ) >> 22 ) & 0x3U )
6454
6455#define AARCH32_DBGDSCREXT_TXU 0x4000000U
6456
6457#define AARCH32_DBGDSCREXT_RXO 0x8000000U
6458
6459#define AARCH32_DBGDSCREXT_TXFULL 0x20000000U
6460
6461#define AARCH32_DBGDSCREXT_RXFULL 0x40000000U
6462
6463#define AARCH32_DBGDSCREXT_TFO 0x80000000U
6464
6465static inline uint32_t _AArch32_Read_dbgdscrext( void )
6466{
6467 uint32_t value;
6468
6469 __asm__ volatile (
6470 "mrc p14, 0, %0, c0, c2, 2" : "=&r" ( value ) : : "memory"
6471 );
6472
6473 return value;
6474}
6475
6476static inline void _AArch32_Write_dbgdscrext( uint32_t value )
6477{
6478 __asm__ volatile (
6479 "mcr p14, 0, %0, c0, c2, 2" : : "r" ( value ) : "memory"
6480 );
6481}
6482
6483/* DBGDSCRINT, Debug Status and Control Register, Internal View */
6484
6485#define AARCH32_DBGDSCRINT_MOE( _val ) ( ( _val ) << 2 )
6486#define AARCH32_DBGDSCRINT_MOE_SHIFT 2
6487#define AARCH32_DBGDSCRINT_MOE_MASK 0x3cU
6488#define AARCH32_DBGDSCRINT_MOE_GET( _reg ) \
6489 ( ( ( _reg ) >> 2 ) & 0xfU )
6490
6491#define AARCH32_DBGDSCRINT_UDCCDIS 0x1000U
6492
6493#define AARCH32_DBGDSCRINT_MDBGEN 0x8000U
6494
6495#define AARCH32_DBGDSCRINT_SPIDDIS 0x10000U
6496
6497#define AARCH32_DBGDSCRINT_SPNIDDIS 0x20000U
6498
6499#define AARCH32_DBGDSCRINT_NS 0x40000U
6500
6501#define AARCH32_DBGDSCRINT_TXFULL 0x20000000U
6502
6503#define AARCH32_DBGDSCRINT_RXFULL 0x40000000U
6504
6505static inline uint32_t _AArch32_Read_dbgdscrint( void )
6506{
6507 uint32_t value;
6508
6509 __asm__ volatile (
6510 "mrc p14, 0, %0, c0, c1, 0" : "=&r" ( value ) : : "memory"
6511 );
6512
6513 return value;
6514}
6515
6516/* DBGDTRRXEXT, Debug OS Lock Data Transfer Register, Receive, External View */
6517
6518static inline uint32_t _AArch32_Read_dbgdtrrxext( void )
6519{
6520 uint32_t value;
6521
6522 __asm__ volatile (
6523 "mrc p14, 0, %0, c0, c0, 2" : "=&r" ( value ) : : "memory"
6524 );
6525
6526 return value;
6527}
6528
6529static inline void _AArch32_Write_dbgdtrrxext( uint32_t value )
6530{
6531 __asm__ volatile (
6532 "mcr p14, 0, %0, c0, c0, 2" : : "r" ( value ) : "memory"
6533 );
6534}
6535
6536/* DBGDTRRXINT, Debug Data Transfer Register, Receive */
6537
6538static inline uint32_t _AArch32_Read_dbgdtrrxint( void )
6539{
6540 uint32_t value;
6541
6542 __asm__ volatile (
6543 "mrc p14, 0, %0, c0, c5, 0" : "=&r" ( value ) : : "memory"
6544 );
6545
6546 return value;
6547}
6548
6549/* DBGDTRTXEXT, Debug OS Lock Data Transfer Register, Transmit */
6550
6551static inline uint32_t _AArch32_Read_dbgdtrtxext( void )
6552{
6553 uint32_t value;
6554
6555 __asm__ volatile (
6556 "mrc p14, 0, %0, c0, c3, 2" : "=&r" ( value ) : : "memory"
6557 );
6558
6559 return value;
6560}
6561
6562static inline void _AArch32_Write_dbgdtrtxext( uint32_t value )
6563{
6564 __asm__ volatile (
6565 "mcr p14, 0, %0, c0, c3, 2" : : "r" ( value ) : "memory"
6566 );
6567}
6568
6569/* DBGDTRTXINT, Debug Data Transfer Register, Transmit */
6570
6571static inline void _AArch32_Write_dbgdtrtxint( uint32_t value )
6572{
6573 __asm__ volatile (
6574 "mcr p14, 0, %0, c0, c5, 0" : : "r" ( value ) : "memory"
6575 );
6576}
6577
6578/* DBGOSDLR, Debug OS Double Lock Register */
6579
6580#define AARCH32_DBGOSDLR_DLK 0x1U
6581
6582static inline uint32_t _AArch32_Read_dbgosdlr( void )
6583{
6584 uint32_t value;
6585
6586 __asm__ volatile (
6587 "mrc p14, 0, %0, c1, c3, 4" : "=&r" ( value ) : : "memory"
6588 );
6589
6590 return value;
6591}
6592
6593static inline void _AArch32_Write_dbgosdlr( uint32_t value )
6594{
6595 __asm__ volatile (
6596 "mcr p14, 0, %0, c1, c3, 4" : : "r" ( value ) : "memory"
6597 );
6598}
6599
6600/* DBGOSECCR, Debug OS Lock Exception Catch Control Register */
6601
6602static inline uint32_t _AArch32_Read_dbgoseccr( void )
6603{
6604 uint32_t value;
6605
6606 __asm__ volatile (
6607 "mrc p14, 0, %0, c0, c6, 2" : "=&r" ( value ) : : "memory"
6608 );
6609
6610 return value;
6611}
6612
6613static inline void _AArch32_Write_dbgoseccr( uint32_t value )
6614{
6615 __asm__ volatile (
6616 "mcr p14, 0, %0, c0, c6, 2" : : "r" ( value ) : "memory"
6617 );
6618}
6619
6620/* DBGOSLAR, Debug OS Lock Access Register */
6621
6622static inline void _AArch32_Write_dbgoslar( uint32_t value )
6623{
6624 __asm__ volatile (
6625 "mcr p14, 0, %0, c1, c0, 4" : : "r" ( value ) : "memory"
6626 );
6627}
6628
6629/* DBGOSLSR, Debug OS Lock Status Register */
6630
6631#define AARCH32_DBGOSLSR_OSLM_0 0x1U
6632
6633#define AARCH32_DBGOSLSR_OSLK 0x2U
6634
6635#define AARCH32_DBGOSLSR_NTT 0x4U
6636
6637#define AARCH32_DBGOSLSR_OSLM_1 0x8U
6638
6639static inline uint32_t _AArch32_Read_dbgoslsr( void )
6640{
6641 uint32_t value;
6642
6643 __asm__ volatile (
6644 "mrc p14, 0, %0, c1, c1, 4" : "=&r" ( value ) : : "memory"
6645 );
6646
6647 return value;
6648}
6649
6650/* DBGPRCR, Debug Power Control Register */
6651
6652#define AARCH32_DBGPRCR_CORENPDRQ 0x1U
6653
6654static inline uint32_t _AArch32_Read_dbgprcr( void )
6655{
6656 uint32_t value;
6657
6658 __asm__ volatile (
6659 "mrc p14, 0, %0, c1, c4, 4" : "=&r" ( value ) : : "memory"
6660 );
6661
6662 return value;
6663}
6664
6665static inline void _AArch32_Write_dbgprcr( uint32_t value )
6666{
6667 __asm__ volatile (
6668 "mcr p14, 0, %0, c1, c4, 4" : : "r" ( value ) : "memory"
6669 );
6670}
6671
6672/* DBGVCR, Debug Vector Catch Register */
6673
6674#define AARCH32_DBGVCR_SU 0x2U
6675
6676#define AARCH32_DBGVCR_U 0x2U
6677
6678#define AARCH32_DBGVCR_S 0x4U
6679
6680#define AARCH32_DBGVCR_SS 0x4U
6681
6682#define AARCH32_DBGVCR_P 0x8U
6683
6684#define AARCH32_DBGVCR_SP 0x8U
6685
6686#define AARCH32_DBGVCR_D 0x10U
6687
6688#define AARCH32_DBGVCR_SD 0x10U
6689
6690#define AARCH32_DBGVCR_I 0x40U
6691
6692#define AARCH32_DBGVCR_SI 0x40U
6693
6694#define AARCH32_DBGVCR_F 0x80U
6695
6696#define AARCH32_DBGVCR_SF 0x80U
6697
6698#define AARCH32_DBGVCR_MS 0x400U
6699
6700#define AARCH32_DBGVCR_MP 0x800U
6701
6702#define AARCH32_DBGVCR_MD 0x1000U
6703
6704#define AARCH32_DBGVCR_MI 0x4000U
6705
6706#define AARCH32_DBGVCR_MF 0x8000U
6707
6708#define AARCH32_DBGVCR_NSU 0x2000000U
6709
6710#define AARCH32_DBGVCR_NSS 0x4000000U
6711
6712#define AARCH32_DBGVCR_NSP 0x8000000U
6713
6714#define AARCH32_DBGVCR_NSD 0x10000000U
6715
6716#define AARCH32_DBGVCR_NSI 0x40000000U
6717
6718#define AARCH32_DBGVCR_NSF 0x80000000U
6719
6720static inline uint32_t _AArch32_Read_dbgvcr( void )
6721{
6722 uint32_t value;
6723
6724 __asm__ volatile (
6725 "mrc p14, 0, %0, c0, c7, 0" : "=&r" ( value ) : : "memory"
6726 );
6727
6728 return value;
6729}
6730
6731static inline void _AArch32_Write_dbgvcr( uint32_t value )
6732{
6733 __asm__ volatile (
6734 "mcr p14, 0, %0, c0, c7, 0" : : "r" ( value ) : "memory"
6735 );
6736}
6737
6738/* DBGWCR, Debug Watchpoint Control Registers */
6739
6740#define AARCH32_DBGWCR_E 0x1U
6741
6742#define AARCH32_DBGWCR_PAC( _val ) ( ( _val ) << 1 )
6743#define AARCH32_DBGWCR_PAC_SHIFT 1
6744#define AARCH32_DBGWCR_PAC_MASK 0x6U
6745#define AARCH32_DBGWCR_PAC_GET( _reg ) \
6746 ( ( ( _reg ) >> 1 ) & 0x3U )
6747
6748#define AARCH32_DBGWCR_LSC( _val ) ( ( _val ) << 3 )
6749#define AARCH32_DBGWCR_LSC_SHIFT 3
6750#define AARCH32_DBGWCR_LSC_MASK 0x18U
6751#define AARCH32_DBGWCR_LSC_GET( _reg ) \
6752 ( ( ( _reg ) >> 3 ) & 0x3U )
6753
6754#define AARCH32_DBGWCR_BAS( _val ) ( ( _val ) << 5 )
6755#define AARCH32_DBGWCR_BAS_SHIFT 5
6756#define AARCH32_DBGWCR_BAS_MASK 0x1fe0U
6757#define AARCH32_DBGWCR_BAS_GET( _reg ) \
6758 ( ( ( _reg ) >> 5 ) & 0xffU )
6759
6760#define AARCH32_DBGWCR_HMC 0x2000U
6761
6762#define AARCH32_DBGWCR_SSC( _val ) ( ( _val ) << 14 )
6763#define AARCH32_DBGWCR_SSC_SHIFT 14
6764#define AARCH32_DBGWCR_SSC_MASK 0xc000U
6765#define AARCH32_DBGWCR_SSC_GET( _reg ) \
6766 ( ( ( _reg ) >> 14 ) & 0x3U )
6767
6768#define AARCH32_DBGWCR_LBN( _val ) ( ( _val ) << 16 )
6769#define AARCH32_DBGWCR_LBN_SHIFT 16
6770#define AARCH32_DBGWCR_LBN_MASK 0xf0000U
6771#define AARCH32_DBGWCR_LBN_GET( _reg ) \
6772 ( ( ( _reg ) >> 16 ) & 0xfU )
6773
6774#define AARCH32_DBGWCR_WT 0x100000U
6775
6776#define AARCH32_DBGWCR_MASK( _val ) ( ( _val ) << 24 )
6777#define AARCH32_DBGWCR_MASK_SHIFT 24
6778#define AARCH32_DBGWCR_MASK_MASK 0x1f000000U
6779#define AARCH32_DBGWCR_MASK_GET( _reg ) \
6780 ( ( ( _reg ) >> 24 ) & 0x1fU )
6781
6782/* DBGWCR_0, Debug Watchpoint Control Registers */
6783
6784static inline uint32_t _AArch32_Read_dbgwcr_0( void )
6785{
6786 uint32_t value;
6787
6788 __asm__ volatile (
6789 "mrc p14, 0, %0, c0, c0, 7" : "=&r" ( value ) : : "memory"
6790 );
6791
6792 return value;
6793}
6794
6795static inline void _AArch32_Write_dbgwcr_0( uint32_t value )
6796{
6797 __asm__ volatile (
6798 "mcr p14, 0, %0, c0, c0, 7" : : "r" ( value ) : "memory"
6799 );
6800}
6801
6802/* DBGWCR_1, Debug Watchpoint Control Registers */
6803
6804static inline uint32_t _AArch32_Read_dbgwcr_1( void )
6805{
6806 uint32_t value;
6807
6808 __asm__ volatile (
6809 "mrc p14, 0, %0, c0, c1, 7" : "=&r" ( value ) : : "memory"
6810 );
6811
6812 return value;
6813}
6814
6815static inline void _AArch32_Write_dbgwcr_1( uint32_t value )
6816{
6817 __asm__ volatile (
6818 "mcr p14, 0, %0, c0, c1, 7" : : "r" ( value ) : "memory"
6819 );
6820}
6821
6822/* DBGWCR_2, Debug Watchpoint Control Registers */
6823
6824static inline uint32_t _AArch32_Read_dbgwcr_2( void )
6825{
6826 uint32_t value;
6827
6828 __asm__ volatile (
6829 "mrc p14, 0, %0, c0, c2, 7" : "=&r" ( value ) : : "memory"
6830 );
6831
6832 return value;
6833}
6834
6835static inline void _AArch32_Write_dbgwcr_2( uint32_t value )
6836{
6837 __asm__ volatile (
6838 "mcr p14, 0, %0, c0, c2, 7" : : "r" ( value ) : "memory"
6839 );
6840}
6841
6842/* DBGWCR_3, Debug Watchpoint Control Registers */
6843
6844static inline uint32_t _AArch32_Read_dbgwcr_3( void )
6845{
6846 uint32_t value;
6847
6848 __asm__ volatile (
6849 "mrc p14, 0, %0, c0, c3, 7" : "=&r" ( value ) : : "memory"
6850 );
6851
6852 return value;
6853}
6854
6855static inline void _AArch32_Write_dbgwcr_3( uint32_t value )
6856{
6857 __asm__ volatile (
6858 "mcr p14, 0, %0, c0, c3, 7" : : "r" ( value ) : "memory"
6859 );
6860}
6861
6862/* DBGWCR_4, Debug Watchpoint Control Registers */
6863
6864static inline uint32_t _AArch32_Read_dbgwcr_4( void )
6865{
6866 uint32_t value;
6867
6868 __asm__ volatile (
6869 "mrc p14, 0, %0, c0, c4, 7" : "=&r" ( value ) : : "memory"
6870 );
6871
6872 return value;
6873}
6874
6875static inline void _AArch32_Write_dbgwcr_4( uint32_t value )
6876{
6877 __asm__ volatile (
6878 "mcr p14, 0, %0, c0, c4, 7" : : "r" ( value ) : "memory"
6879 );
6880}
6881
6882/* DBGWCR_5, Debug Watchpoint Control Registers */
6883
6884static inline uint32_t _AArch32_Read_dbgwcr_5( void )
6885{
6886 uint32_t value;
6887
6888 __asm__ volatile (
6889 "mrc p14, 0, %0, c0, c5, 7" : "=&r" ( value ) : : "memory"
6890 );
6891
6892 return value;
6893}
6894
6895static inline void _AArch32_Write_dbgwcr_5( uint32_t value )
6896{
6897 __asm__ volatile (
6898 "mcr p14, 0, %0, c0, c5, 7" : : "r" ( value ) : "memory"
6899 );
6900}
6901
6902/* DBGWCR_6, Debug Watchpoint Control Registers */
6903
6904static inline uint32_t _AArch32_Read_dbgwcr_6( void )
6905{
6906 uint32_t value;
6907
6908 __asm__ volatile (
6909 "mrc p14, 0, %0, c0, c6, 7" : "=&r" ( value ) : : "memory"
6910 );
6911
6912 return value;
6913}
6914
6915static inline void _AArch32_Write_dbgwcr_6( uint32_t value )
6916{
6917 __asm__ volatile (
6918 "mcr p14, 0, %0, c0, c6, 7" : : "r" ( value ) : "memory"
6919 );
6920}
6921
6922/* DBGWCR_7, Debug Watchpoint Control Registers */
6923
6924static inline uint32_t _AArch32_Read_dbgwcr_7( void )
6925{
6926 uint32_t value;
6927
6928 __asm__ volatile (
6929 "mrc p14, 0, %0, c0, c7, 7" : "=&r" ( value ) : : "memory"
6930 );
6931
6932 return value;
6933}
6934
6935static inline void _AArch32_Write_dbgwcr_7( uint32_t value )
6936{
6937 __asm__ volatile (
6938 "mcr p14, 0, %0, c0, c7, 7" : : "r" ( value ) : "memory"
6939 );
6940}
6941
6942/* DBGWCR_8, Debug Watchpoint Control Registers */
6943
6944static inline uint32_t _AArch32_Read_dbgwcr_8( void )
6945{
6946 uint32_t value;
6947
6948 __asm__ volatile (
6949 "mrc p14, 0, %0, c0, c8, 7" : "=&r" ( value ) : : "memory"
6950 );
6951
6952 return value;
6953}
6954
6955static inline void _AArch32_Write_dbgwcr_8( uint32_t value )
6956{
6957 __asm__ volatile (
6958 "mcr p14, 0, %0, c0, c8, 7" : : "r" ( value ) : "memory"
6959 );
6960}
6961
6962/* DBGWCR_9, Debug Watchpoint Control Registers */
6963
6964static inline uint32_t _AArch32_Read_dbgwcr_9( void )
6965{
6966 uint32_t value;
6967
6968 __asm__ volatile (
6969 "mrc p14, 0, %0, c0, c9, 7" : "=&r" ( value ) : : "memory"
6970 );
6971
6972 return value;
6973}
6974
6975static inline void _AArch32_Write_dbgwcr_9( uint32_t value )
6976{
6977 __asm__ volatile (
6978 "mcr p14, 0, %0, c0, c9, 7" : : "r" ( value ) : "memory"
6979 );
6980}
6981
6982/* DBGWCR_10, Debug Watchpoint Control Registers */
6983
6984static inline uint32_t _AArch32_Read_dbgwcr_10( void )
6985{
6986 uint32_t value;
6987
6988 __asm__ volatile (
6989 "mrc p14, 0, %0, c0, c10, 7" : "=&r" ( value ) : : "memory"
6990 );
6991
6992 return value;
6993}
6994
6995static inline void _AArch32_Write_dbgwcr_10( uint32_t value )
6996{
6997 __asm__ volatile (
6998 "mcr p14, 0, %0, c0, c10, 7" : : "r" ( value ) : "memory"
6999 );
7000}
7001
7002/* DBGWCR_11, Debug Watchpoint Control Registers */
7003
7004static inline uint32_t _AArch32_Read_dbgwcr_11( void )
7005{
7006 uint32_t value;
7007
7008 __asm__ volatile (
7009 "mrc p14, 0, %0, c0, c11, 7" : "=&r" ( value ) : : "memory"
7010 );
7011
7012 return value;
7013}
7014
7015static inline void _AArch32_Write_dbgwcr_11( uint32_t value )
7016{
7017 __asm__ volatile (
7018 "mcr p14, 0, %0, c0, c11, 7" : : "r" ( value ) : "memory"
7019 );
7020}
7021
7022/* DBGWCR_12, Debug Watchpoint Control Registers */
7023
7024static inline uint32_t _AArch32_Read_dbgwcr_12( void )
7025{
7026 uint32_t value;
7027
7028 __asm__ volatile (
7029 "mrc p14, 0, %0, c0, c12, 7" : "=&r" ( value ) : : "memory"
7030 );
7031
7032 return value;
7033}
7034
7035static inline void _AArch32_Write_dbgwcr_12( uint32_t value )
7036{
7037 __asm__ volatile (
7038 "mcr p14, 0, %0, c0, c12, 7" : : "r" ( value ) : "memory"
7039 );
7040}
7041
7042/* DBGWCR_13, Debug Watchpoint Control Registers */
7043
7044static inline uint32_t _AArch32_Read_dbgwcr_13( void )
7045{
7046 uint32_t value;
7047
7048 __asm__ volatile (
7049 "mrc p14, 0, %0, c0, c13, 7" : "=&r" ( value ) : : "memory"
7050 );
7051
7052 return value;
7053}
7054
7055static inline void _AArch32_Write_dbgwcr_13( uint32_t value )
7056{
7057 __asm__ volatile (
7058 "mcr p14, 0, %0, c0, c13, 7" : : "r" ( value ) : "memory"
7059 );
7060}
7061
7062/* DBGWCR_14, Debug Watchpoint Control Registers */
7063
7064static inline uint32_t _AArch32_Read_dbgwcr_14( void )
7065{
7066 uint32_t value;
7067
7068 __asm__ volatile (
7069 "mrc p14, 0, %0, c0, c14, 7" : "=&r" ( value ) : : "memory"
7070 );
7071
7072 return value;
7073}
7074
7075static inline void _AArch32_Write_dbgwcr_14( uint32_t value )
7076{
7077 __asm__ volatile (
7078 "mcr p14, 0, %0, c0, c14, 7" : : "r" ( value ) : "memory"
7079 );
7080}
7081
7082/* DBGWCR_15, Debug Watchpoint Control Registers */
7083
7084static inline uint32_t _AArch32_Read_dbgwcr_15( void )
7085{
7086 uint32_t value;
7087
7088 __asm__ volatile (
7089 "mrc p14, 0, %0, c0, c15, 7" : "=&r" ( value ) : : "memory"
7090 );
7091
7092 return value;
7093}
7094
7095static inline void _AArch32_Write_dbgwcr_15( uint32_t value )
7096{
7097 __asm__ volatile (
7098 "mcr p14, 0, %0, c0, c15, 7" : : "r" ( value ) : "memory"
7099 );
7100}
7101
7102/* DBGWFAR, Debug Watchpoint Fault Address Register */
7103
7104static inline uint32_t _AArch32_Read_dbgwfar( void )
7105{
7106 uint32_t value;
7107
7108 __asm__ volatile (
7109 "mrc p14, 0, %0, c0, c6, 0" : "=&r" ( value ) : : "memory"
7110 );
7111
7112 return value;
7113}
7114
7115static inline void _AArch32_Write_dbgwfar( uint32_t value )
7116{
7117 __asm__ volatile (
7118 "mcr p14, 0, %0, c0, c6, 0" : : "r" ( value ) : "memory"
7119 );
7120}
7121
7122/* DBGWVR, Debug Watchpoint Value Registers */
7123
7124#define AARCH32_DBGWVR_VA( _val ) ( ( _val ) << 2 )
7125#define AARCH32_DBGWVR_VA_SHIFT 2
7126#define AARCH32_DBGWVR_VA_MASK 0xfffffffcU
7127#define AARCH32_DBGWVR_VA_GET( _reg ) \
7128 ( ( ( _reg ) >> 2 ) & 0x3fffffffU )
7129
7130/* DBGWVR_0, Debug Watchpoint Value Registers */
7131
7132static inline uint32_t _AArch32_Read_dbgwvr_0( void )
7133{
7134 uint32_t value;
7135
7136 __asm__ volatile (
7137 "mrc p14, 0, %0, c0, c0, 6" : "=&r" ( value ) : : "memory"
7138 );
7139
7140 return value;
7141}
7142
7143static inline void _AArch32_Write_dbgwvr_0( uint32_t value )
7144{
7145 __asm__ volatile (
7146 "mcr p14, 0, %0, c0, c0, 6" : : "r" ( value ) : "memory"
7147 );
7148}
7149
7150/* DBGWVR_1, Debug Watchpoint Value Registers */
7151
7152static inline uint32_t _AArch32_Read_dbgwvr_1( void )
7153{
7154 uint32_t value;
7155
7156 __asm__ volatile (
7157 "mrc p14, 0, %0, c0, c1, 6" : "=&r" ( value ) : : "memory"
7158 );
7159
7160 return value;
7161}
7162
7163static inline void _AArch32_Write_dbgwvr_1( uint32_t value )
7164{
7165 __asm__ volatile (
7166 "mcr p14, 0, %0, c0, c1, 6" : : "r" ( value ) : "memory"
7167 );
7168}
7169
7170/* DBGWVR_2, Debug Watchpoint Value Registers */
7171
7172static inline uint32_t _AArch32_Read_dbgwvr_2( void )
7173{
7174 uint32_t value;
7175
7176 __asm__ volatile (
7177 "mrc p14, 0, %0, c0, c2, 6" : "=&r" ( value ) : : "memory"
7178 );
7179
7180 return value;
7181}
7182
7183static inline void _AArch32_Write_dbgwvr_2( uint32_t value )
7184{
7185 __asm__ volatile (
7186 "mcr p14, 0, %0, c0, c2, 6" : : "r" ( value ) : "memory"
7187 );
7188}
7189
7190/* DBGWVR_3, Debug Watchpoint Value Registers */
7191
7192static inline uint32_t _AArch32_Read_dbgwvr_3( void )
7193{
7194 uint32_t value;
7195
7196 __asm__ volatile (
7197 "mrc p14, 0, %0, c0, c3, 6" : "=&r" ( value ) : : "memory"
7198 );
7199
7200 return value;
7201}
7202
7203static inline void _AArch32_Write_dbgwvr_3( uint32_t value )
7204{
7205 __asm__ volatile (
7206 "mcr p14, 0, %0, c0, c3, 6" : : "r" ( value ) : "memory"
7207 );
7208}
7209
7210/* DBGWVR_4, Debug Watchpoint Value Registers */
7211
7212static inline uint32_t _AArch32_Read_dbgwvr_4( void )
7213{
7214 uint32_t value;
7215
7216 __asm__ volatile (
7217 "mrc p14, 0, %0, c0, c4, 6" : "=&r" ( value ) : : "memory"
7218 );
7219
7220 return value;
7221}
7222
7223static inline void _AArch32_Write_dbgwvr_4( uint32_t value )
7224{
7225 __asm__ volatile (
7226 "mcr p14, 0, %0, c0, c4, 6" : : "r" ( value ) : "memory"
7227 );
7228}
7229
7230/* DBGWVR_5, Debug Watchpoint Value Registers */
7231
7232static inline uint32_t _AArch32_Read_dbgwvr_5( void )
7233{
7234 uint32_t value;
7235
7236 __asm__ volatile (
7237 "mrc p14, 0, %0, c0, c5, 6" : "=&r" ( value ) : : "memory"
7238 );
7239
7240 return value;
7241}
7242
7243static inline void _AArch32_Write_dbgwvr_5( uint32_t value )
7244{
7245 __asm__ volatile (
7246 "mcr p14, 0, %0, c0, c5, 6" : : "r" ( value ) : "memory"
7247 );
7248}
7249
7250/* DBGWVR_6, Debug Watchpoint Value Registers */
7251
7252static inline uint32_t _AArch32_Read_dbgwvr_6( void )
7253{
7254 uint32_t value;
7255
7256 __asm__ volatile (
7257 "mrc p14, 0, %0, c0, c6, 6" : "=&r" ( value ) : : "memory"
7258 );
7259
7260 return value;
7261}
7262
7263static inline void _AArch32_Write_dbgwvr_6( uint32_t value )
7264{
7265 __asm__ volatile (
7266 "mcr p14, 0, %0, c0, c6, 6" : : "r" ( value ) : "memory"
7267 );
7268}
7269
7270/* DBGWVR_7, Debug Watchpoint Value Registers */
7271
7272static inline uint32_t _AArch32_Read_dbgwvr_7( void )
7273{
7274 uint32_t value;
7275
7276 __asm__ volatile (
7277 "mrc p14, 0, %0, c0, c7, 6" : "=&r" ( value ) : : "memory"
7278 );
7279
7280 return value;
7281}
7282
7283static inline void _AArch32_Write_dbgwvr_7( uint32_t value )
7284{
7285 __asm__ volatile (
7286 "mcr p14, 0, %0, c0, c7, 6" : : "r" ( value ) : "memory"
7287 );
7288}
7289
7290/* DBGWVR_8, Debug Watchpoint Value Registers */
7291
7292static inline uint32_t _AArch32_Read_dbgwvr_8( void )
7293{
7294 uint32_t value;
7295
7296 __asm__ volatile (
7297 "mrc p14, 0, %0, c0, c8, 6" : "=&r" ( value ) : : "memory"
7298 );
7299
7300 return value;
7301}
7302
7303static inline void _AArch32_Write_dbgwvr_8( uint32_t value )
7304{
7305 __asm__ volatile (
7306 "mcr p14, 0, %0, c0, c8, 6" : : "r" ( value ) : "memory"
7307 );
7308}
7309
7310/* DBGWVR_9, Debug Watchpoint Value Registers */
7311
7312static inline uint32_t _AArch32_Read_dbgwvr_9( void )
7313{
7314 uint32_t value;
7315
7316 __asm__ volatile (
7317 "mrc p14, 0, %0, c0, c9, 6" : "=&r" ( value ) : : "memory"
7318 );
7319
7320 return value;
7321}
7322
7323static inline void _AArch32_Write_dbgwvr_9( uint32_t value )
7324{
7325 __asm__ volatile (
7326 "mcr p14, 0, %0, c0, c9, 6" : : "r" ( value ) : "memory"
7327 );
7328}
7329
7330/* DBGWVR_10, Debug Watchpoint Value Registers */
7331
7332static inline uint32_t _AArch32_Read_dbgwvr_10( void )
7333{
7334 uint32_t value;
7335
7336 __asm__ volatile (
7337 "mrc p14, 0, %0, c0, c10, 6" : "=&r" ( value ) : : "memory"
7338 );
7339
7340 return value;
7341}
7342
7343static inline void _AArch32_Write_dbgwvr_10( uint32_t value )
7344{
7345 __asm__ volatile (
7346 "mcr p14, 0, %0, c0, c10, 6" : : "r" ( value ) : "memory"
7347 );
7348}
7349
7350/* DBGWVR_11, Debug Watchpoint Value Registers */
7351
7352static inline uint32_t _AArch32_Read_dbgwvr_11( void )
7353{
7354 uint32_t value;
7355
7356 __asm__ volatile (
7357 "mrc p14, 0, %0, c0, c11, 6" : "=&r" ( value ) : : "memory"
7358 );
7359
7360 return value;
7361}
7362
7363static inline void _AArch32_Write_dbgwvr_11( uint32_t value )
7364{
7365 __asm__ volatile (
7366 "mcr p14, 0, %0, c0, c11, 6" : : "r" ( value ) : "memory"
7367 );
7368}
7369
7370/* DBGWVR_12, Debug Watchpoint Value Registers */
7371
7372static inline uint32_t _AArch32_Read_dbgwvr_12( void )
7373{
7374 uint32_t value;
7375
7376 __asm__ volatile (
7377 "mrc p14, 0, %0, c0, c12, 6" : "=&r" ( value ) : : "memory"
7378 );
7379
7380 return value;
7381}
7382
7383static inline void _AArch32_Write_dbgwvr_12( uint32_t value )
7384{
7385 __asm__ volatile (
7386 "mcr p14, 0, %0, c0, c12, 6" : : "r" ( value ) : "memory"
7387 );
7388}
7389
7390/* DBGWVR_13, Debug Watchpoint Value Registers */
7391
7392static inline uint32_t _AArch32_Read_dbgwvr_13( void )
7393{
7394 uint32_t value;
7395
7396 __asm__ volatile (
7397 "mrc p14, 0, %0, c0, c13, 6" : "=&r" ( value ) : : "memory"
7398 );
7399
7400 return value;
7401}
7402
7403static inline void _AArch32_Write_dbgwvr_13( uint32_t value )
7404{
7405 __asm__ volatile (
7406 "mcr p14, 0, %0, c0, c13, 6" : : "r" ( value ) : "memory"
7407 );
7408}
7409
7410/* DBGWVR_14, Debug Watchpoint Value Registers */
7411
7412static inline uint32_t _AArch32_Read_dbgwvr_14( void )
7413{
7414 uint32_t value;
7415
7416 __asm__ volatile (
7417 "mrc p14, 0, %0, c0, c14, 6" : "=&r" ( value ) : : "memory"
7418 );
7419
7420 return value;
7421}
7422
7423static inline void _AArch32_Write_dbgwvr_14( uint32_t value )
7424{
7425 __asm__ volatile (
7426 "mcr p14, 0, %0, c0, c14, 6" : : "r" ( value ) : "memory"
7427 );
7428}
7429
7430/* DBGWVR_15, Debug Watchpoint Value Registers */
7431
7432static inline uint32_t _AArch32_Read_dbgwvr_15( void )
7433{
7434 uint32_t value;
7435
7436 __asm__ volatile (
7437 "mrc p14, 0, %0, c0, c15, 6" : "=&r" ( value ) : : "memory"
7438 );
7439
7440 return value;
7441}
7442
7443static inline void _AArch32_Write_dbgwvr_15( uint32_t value )
7444{
7445 __asm__ volatile (
7446 "mcr p14, 0, %0, c0, c15, 6" : : "r" ( value ) : "memory"
7447 );
7448}
7449
7450/* DLR, Debug Link Register */
7451
7452static inline uint32_t _AArch32_Read_dlr( void )
7453{
7454 uint32_t value;
7455
7456 __asm__ volatile (
7457 "mrc p15, 3, %0, c4, c5, 1" : "=&r" ( value ) : : "memory"
7458 );
7459
7460 return value;
7461}
7462
7463static inline void _AArch32_Write_dlr( uint32_t value )
7464{
7465 __asm__ volatile (
7466 "mcr p15, 3, %0, c4, c5, 1" : : "r" ( value ) : "memory"
7467 );
7468}
7469
7470/* DSPSR, Debug Saved Program Status Register */
7471
7472#define AARCH32_DSPSR_M_4_0( _val ) ( ( _val ) << 0 )
7473#define AARCH32_DSPSR_M_4_0_SHIFT 0
7474#define AARCH32_DSPSR_M_4_0_MASK 0x1fU
7475#define AARCH32_DSPSR_M_4_0_GET( _reg ) \
7476 ( ( ( _reg ) >> 0 ) & 0x1fU )
7477
7478#define AARCH32_DSPSR_T 0x20U
7479
7480#define AARCH32_DSPSR_F 0x40U
7481
7482#define AARCH32_DSPSR_I 0x80U
7483
7484#define AARCH32_DSPSR_A 0x100U
7485
7486#define AARCH32_DSPSR_E 0x200U
7487
7488#define AARCH32_DSPSR_IT_7_2( _val ) ( ( _val ) << 10 )
7489#define AARCH32_DSPSR_IT_7_2_SHIFT 10
7490#define AARCH32_DSPSR_IT_7_2_MASK 0xfc00U
7491#define AARCH32_DSPSR_IT_7_2_GET( _reg ) \
7492 ( ( ( _reg ) >> 10 ) & 0x3fU )
7493
7494#define AARCH32_DSPSR_GE( _val ) ( ( _val ) << 16 )
7495#define AARCH32_DSPSR_GE_SHIFT 16
7496#define AARCH32_DSPSR_GE_MASK 0xf0000U
7497#define AARCH32_DSPSR_GE_GET( _reg ) \
7498 ( ( ( _reg ) >> 16 ) & 0xfU )
7499
7500#define AARCH32_DSPSR_IL 0x100000U
7501
7502#define AARCH32_DSPSR_SS 0x200000U
7503
7504#define AARCH32_DSPSR_PAN 0x400000U
7505
7506#define AARCH32_DSPSR_SSBS 0x800000U
7507
7508#define AARCH32_DSPSR_DIT 0x1000000U
7509
7510#define AARCH32_DSPSR_IT_1_0( _val ) ( ( _val ) << 25 )
7511#define AARCH32_DSPSR_IT_1_0_SHIFT 25
7512#define AARCH32_DSPSR_IT_1_0_MASK 0x6000000U
7513#define AARCH32_DSPSR_IT_1_0_GET( _reg ) \
7514 ( ( ( _reg ) >> 25 ) & 0x3U )
7515
7516#define AARCH32_DSPSR_Q 0x8000000U
7517
7518#define AARCH32_DSPSR_V 0x10000000U
7519
7520#define AARCH32_DSPSR_C 0x20000000U
7521
7522#define AARCH32_DSPSR_Z 0x40000000U
7523
7524#define AARCH32_DSPSR_N 0x80000000U
7525
7526static inline uint32_t _AArch32_Read_dspsr( void )
7527{
7528 uint32_t value;
7529
7530 __asm__ volatile (
7531 "mrc p15, 3, %0, c4, c5, 0" : "=&r" ( value ) : : "memory"
7532 );
7533
7534 return value;
7535}
7536
7537static inline void _AArch32_Write_dspsr( uint32_t value )
7538{
7539 __asm__ volatile (
7540 "mcr p15, 3, %0, c4, c5, 0" : : "r" ( value ) : "memory"
7541 );
7542}
7543
7544/* HDCR, Hyp Debug Control Register */
7545
7546#define AARCH32_HDCR_HPMN( _val ) ( ( _val ) << 0 )
7547#define AARCH32_HDCR_HPMN_SHIFT 0
7548#define AARCH32_HDCR_HPMN_MASK 0x1fU
7549#define AARCH32_HDCR_HPMN_GET( _reg ) \
7550 ( ( ( _reg ) >> 0 ) & 0x1fU )
7551
7552#define AARCH32_HDCR_TPMCR 0x20U
7553
7554#define AARCH32_HDCR_TPM 0x40U
7555
7556#define AARCH32_HDCR_HPME 0x80U
7557
7558#define AARCH32_HDCR_TDE 0x100U
7559
7560#define AARCH32_HDCR_TDA 0x200U
7561
7562#define AARCH32_HDCR_TDOSA 0x400U
7563
7564#define AARCH32_HDCR_TDRA 0x800U
7565
7566#define AARCH32_HDCR_HPMD 0x20000U
7567
7568#define AARCH32_HDCR_TTRF 0x80000U
7569
7570#define AARCH32_HDCR_HCCD 0x800000U
7571
7572#define AARCH32_HDCR_HLP 0x4000000U
7573
7574#define AARCH32_HDCR_TDCC 0x8000000U
7575
7576#define AARCH32_HDCR_MTPME 0x10000000U
7577
7578static inline uint32_t _AArch32_Read_hdcr( void )
7579{
7580 uint32_t value;
7581
7582 __asm__ volatile (
7583 "mrc p15, 4, %0, c1, c1, 1" : "=&r" ( value ) : : "memory"
7584 );
7585
7586 return value;
7587}
7588
7589static inline void _AArch32_Write_hdcr( uint32_t value )
7590{
7591 __asm__ volatile (
7592 "mcr p15, 4, %0, c1, c1, 1" : : "r" ( value ) : "memory"
7593 );
7594}
7595
7596/* HTRFCR, Hyp Trace Filter Control Register */
7597
7598#define AARCH32_HTRFCR_E0HTRE 0x1U
7599
7600#define AARCH32_HTRFCR_E2TRE 0x2U
7601
7602#define AARCH32_HTRFCR_CX 0x8U
7603
7604#define AARCH32_HTRFCR_TS( _val ) ( ( _val ) << 5 )
7605#define AARCH32_HTRFCR_TS_SHIFT 5
7606#define AARCH32_HTRFCR_TS_MASK 0x60U
7607#define AARCH32_HTRFCR_TS_GET( _reg ) \
7608 ( ( ( _reg ) >> 5 ) & 0x3U )
7609
7610static inline uint32_t _AArch32_Read_htrfcr( void )
7611{
7612 uint32_t value;
7613
7614 __asm__ volatile (
7615 "mrc p15, 4, %0, c1, c2, 1" : "=&r" ( value ) : : "memory"
7616 );
7617
7618 return value;
7619}
7620
7621static inline void _AArch32_Write_htrfcr( uint32_t value )
7622{
7623 __asm__ volatile (
7624 "mcr p15, 4, %0, c1, c2, 1" : : "r" ( value ) : "memory"
7625 );
7626}
7627
7628/* PMMIR, Performance Monitors Machine Identification Register */
7629
7630#define AARCH32_PMMIR_SLOTS( _val ) ( ( _val ) << 0 )
7631#define AARCH32_PMMIR_SLOTS_SHIFT 0
7632#define AARCH32_PMMIR_SLOTS_MASK 0xffU
7633#define AARCH32_PMMIR_SLOTS_GET( _reg ) \
7634 ( ( ( _reg ) >> 0 ) & 0xffU )
7635
7636static inline uint32_t _AArch32_Read_pmmir( void )
7637{
7638 uint32_t value;
7639
7640 __asm__ volatile (
7641 "mrc p15, 0, %0, c9, c14, 6" : "=&r" ( value ) : : "memory"
7642 );
7643
7644 return value;
7645}
7646
7647/* SDCR, Secure Debug Control Register */
7648
7649#define AARCH32_SDCR_SPD( _val ) ( ( _val ) << 14 )
7650#define AARCH32_SDCR_SPD_SHIFT 14
7651#define AARCH32_SDCR_SPD_MASK 0xc000U
7652#define AARCH32_SDCR_SPD_GET( _reg ) \
7653 ( ( ( _reg ) >> 14 ) & 0x3U )
7654
7655#define AARCH32_SDCR_SPME 0x20000U
7656
7657#define AARCH32_SDCR_STE 0x40000U
7658
7659#define AARCH32_SDCR_TTRF 0x80000U
7660
7661#define AARCH32_SDCR_EDAD 0x100000U
7662
7663#define AARCH32_SDCR_EPMAD 0x200000U
7664
7665#define AARCH32_SDCR_SCCD 0x800000U
7666
7667#define AARCH32_SDCR_TDCC 0x8000000U
7668
7669#define AARCH32_SDCR_MTPME 0x10000000U
7670
7671static inline uint32_t _AArch32_Read_sdcr( void )
7672{
7673 uint32_t value;
7674
7675 __asm__ volatile (
7676 "mrc p15, 0, %0, c1, c3, 1" : "=&r" ( value ) : : "memory"
7677 );
7678
7679 return value;
7680}
7681
7682static inline void _AArch32_Write_sdcr( uint32_t value )
7683{
7684 __asm__ volatile (
7685 "mcr p15, 0, %0, c1, c3, 1" : : "r" ( value ) : "memory"
7686 );
7687}
7688
7689/* SDER, Secure Debug Enable Register */
7690
7691#define AARCH32_SDER_SUIDEN 0x1U
7692
7693#define AARCH32_SDER_SUNIDEN 0x2U
7694
7695static inline uint32_t _AArch32_Read_sder( void )
7696{
7697 uint32_t value;
7698
7699 __asm__ volatile (
7700 "mrc p15, 0, %0, c1, c1, 1" : "=&r" ( value ) : : "memory"
7701 );
7702
7703 return value;
7704}
7705
7706static inline void _AArch32_Write_sder( uint32_t value )
7707{
7708 __asm__ volatile (
7709 "mcr p15, 0, %0, c1, c1, 1" : : "r" ( value ) : "memory"
7710 );
7711}
7712
7713/* TRFCR, Trace Filter Control Register */
7714
7715#define AARCH32_TRFCR_E0TRE 0x1U
7716
7717#define AARCH32_TRFCR_E1TRE 0x2U
7718
7719#define AARCH32_TRFCR_TS( _val ) ( ( _val ) << 5 )
7720#define AARCH32_TRFCR_TS_SHIFT 5
7721#define AARCH32_TRFCR_TS_MASK 0x60U
7722#define AARCH32_TRFCR_TS_GET( _reg ) \
7723 ( ( ( _reg ) >> 5 ) & 0x3U )
7724
7725static inline uint32_t _AArch32_Read_trfcr( void )
7726{
7727 uint32_t value;
7728
7729 __asm__ volatile (
7730 "mrc p15, 0, %0, c1, c2, 1" : "=&r" ( value ) : : "memory"
7731 );
7732
7733 return value;
7734}
7735
7736static inline void _AArch32_Write_trfcr( uint32_t value )
7737{
7738 __asm__ volatile (
7739 "mcr p15, 0, %0, c1, c2, 1" : : "r" ( value ) : "memory"
7740 );
7741}
7742
7743/* PMCCFILTR, Performance Monitors Cycle Count Filter Register */
7744
7745#define AARCH32_PMCCFILTR_NSH 0x8000000U
7746
7747#define AARCH32_PMCCFILTR_NSU 0x10000000U
7748
7749#define AARCH32_PMCCFILTR_NSK 0x20000000U
7750
7751#define AARCH32_PMCCFILTR_U 0x40000000U
7752
7753#define AARCH32_PMCCFILTR_P 0x80000000U
7754
7755static inline uint32_t _AArch32_Read_pmccfiltr( void )
7756{
7757 uint32_t value;
7758
7759 __asm__ volatile (
7760 "mrc p15, 0, %0, c14, c15, 7" : "=&r" ( value ) : : "memory"
7761 );
7762
7763 return value;
7764}
7765
7766static inline void _AArch32_Write_pmccfiltr( uint32_t value )
7767{
7768 __asm__ volatile (
7769 "mcr p15, 0, %0, c14, c15, 7" : : "r" ( value ) : "memory"
7770 );
7771}
7772
7773/* PMCCNTR, Performance Monitors Cycle Count Register */
7774
7775#define AARCH32_PMCCNTR_CCNT( _val ) ( ( _val ) << 0 )
7776#define AARCH32_PMCCNTR_CCNT_SHIFT 0
7777#define AARCH32_PMCCNTR_CCNT_MASK 0xffffffffffffffffULL
7778#define AARCH32_PMCCNTR_CCNT_GET( _reg ) \
7779 ( ( ( _reg ) >> 0 ) & 0xffffffffffffffffULL )
7780
7781static inline uint32_t _AArch32_Read_32_pmccntr( void )
7782{
7783 uint32_t value;
7784
7785 __asm__ volatile (
7786 "mrc p15, 0, %0, c9, c13, 0" : "=&r" ( value ) : : "memory"
7787 );
7788
7789 return value;
7790}
7791
7792static inline void _AArch32_Write_32_pmccntr( uint32_t value )
7793{
7794 __asm__ volatile (
7795 "mcr p15, 0, %0, c9, c13, 0" : : "r" ( value ) : "memory"
7796 );
7797}
7798
7799/* PMCCNTR, Performance Monitors Cycle Count Register */
7800
7801static inline uint64_t _AArch32_Read_64_pmccntr( void )
7802{
7803 uint64_t value;
7804
7805 __asm__ volatile (
7806 "mrrc p15, 0, %Q0, %R0, c9" : "=&r" ( value ) : : "memory"
7807 );
7808
7809 return value;
7810}
7811
7812static inline void _AArch32_Write_64_pmccntr( uint64_t value )
7813{
7814 __asm__ volatile (
7815 "mcrr p15, 0, %Q0, %R0, c9" : : "r" ( value ) : "memory"
7816 );
7817}
7818
7819/* PMCEID0, Performance Monitors Common Event Identification Register 0 */
7820
7821static inline uint32_t _AArch32_Read_pmceid0( void )
7822{
7823 uint32_t value;
7824
7825 __asm__ volatile (
7826 "mrc p15, 0, %0, c9, c12, 6" : "=&r" ( value ) : : "memory"
7827 );
7828
7829 return value;
7830}
7831
7832/* PMCEID1, Performance Monitors Common Event Identification Register 1 */
7833
7834static inline uint32_t _AArch32_Read_pmceid1( void )
7835{
7836 uint32_t value;
7837
7838 __asm__ volatile (
7839 "mrc p15, 0, %0, c9, c12, 7" : "=&r" ( value ) : : "memory"
7840 );
7841
7842 return value;
7843}
7844
7845/* PMCEID2, Performance Monitors Common Event Identification Register 2 */
7846
7847static inline uint32_t _AArch32_Read_pmceid2( void )
7848{
7849 uint32_t value;
7850
7851 __asm__ volatile (
7852 "mrc p15, 0, %0, c9, c14, 4" : "=&r" ( value ) : : "memory"
7853 );
7854
7855 return value;
7856}
7857
7858/* PMCEID3, Performance Monitors Common Event Identification Register 3 */
7859
7860static inline uint32_t _AArch32_Read_pmceid3( void )
7861{
7862 uint32_t value;
7863
7864 __asm__ volatile (
7865 "mrc p15, 0, %0, c9, c14, 5" : "=&r" ( value ) : : "memory"
7866 );
7867
7868 return value;
7869}
7870
7871/* PMCNTENCLR, Performance Monitors Count Enable Clear Register */
7872
7873#define AARCH32_PMCNTENCLR_C 0x80000000U
7874
7875static inline uint32_t _AArch32_Read_pmcntenclr( void )
7876{
7877 uint32_t value;
7878
7879 __asm__ volatile (
7880 "mrc p15, 0, %0, c9, c12, 2" : "=&r" ( value ) : : "memory"
7881 );
7882
7883 return value;
7884}
7885
7886static inline void _AArch32_Write_pmcntenclr( uint32_t value )
7887{
7888 __asm__ volatile (
7889 "mcr p15, 0, %0, c9, c12, 2" : : "r" ( value ) : "memory"
7890 );
7891}
7892
7893/* PMCNTENSET, Performance Monitors Count Enable Set Register */
7894
7895#define AARCH32_PMCNTENSET_C 0x80000000U
7896
7897static inline uint32_t _AArch32_Read_pmcntenset( void )
7898{
7899 uint32_t value;
7900
7901 __asm__ volatile (
7902 "mrc p15, 0, %0, c9, c12, 1" : "=&r" ( value ) : : "memory"
7903 );
7904
7905 return value;
7906}
7907
7908static inline void _AArch32_Write_pmcntenset( uint32_t value )
7909{
7910 __asm__ volatile (
7911 "mcr p15, 0, %0, c9, c12, 1" : : "r" ( value ) : "memory"
7912 );
7913}
7914
7915/* PMCR, Performance Monitors Control Register */
7916
7917#define AARCH32_PMCR_E 0x1U
7918
7919#define AARCH32_PMCR_P 0x2U
7920
7921#define AARCH32_PMCR_C 0x4U
7922
7923#define AARCH32_PMCR_D 0x8U
7924
7925#define AARCH32_PMCR_X 0x10U
7926
7927#define AARCH32_PMCR_DP 0x20U
7928
7929#define AARCH32_PMCR_LC 0x40U
7930
7931#define AARCH32_PMCR_LP 0x80U
7932
7933#define AARCH32_PMCR_N( _val ) ( ( _val ) << 11 )
7934#define AARCH32_PMCR_N_SHIFT 11
7935#define AARCH32_PMCR_N_MASK 0xf800U
7936#define AARCH32_PMCR_N_GET( _reg ) \
7937 ( ( ( _reg ) >> 11 ) & 0x1fU )
7938
7939#define AARCH32_PMCR_IDCODE( _val ) ( ( _val ) << 16 )
7940#define AARCH32_PMCR_IDCODE_SHIFT 16
7941#define AARCH32_PMCR_IDCODE_MASK 0xff0000U
7942#define AARCH32_PMCR_IDCODE_GET( _reg ) \
7943 ( ( ( _reg ) >> 16 ) & 0xffU )
7944
7945#define AARCH32_PMCR_IMP( _val ) ( ( _val ) << 24 )
7946#define AARCH32_PMCR_IMP_SHIFT 24
7947#define AARCH32_PMCR_IMP_MASK 0xff000000U
7948#define AARCH32_PMCR_IMP_GET( _reg ) \
7949 ( ( ( _reg ) >> 24 ) & 0xffU )
7950
7951static inline uint32_t _AArch32_Read_pmcr( void )
7952{
7953 uint32_t value;
7954
7955 __asm__ volatile (
7956 "mrc p15, 0, %0, c9, c12, 0" : "=&r" ( value ) : : "memory"
7957 );
7958
7959 return value;
7960}
7961
7962static inline void _AArch32_Write_pmcr( uint32_t value )
7963{
7964 __asm__ volatile (
7965 "mcr p15, 0, %0, c9, c12, 0" : : "r" ( value ) : "memory"
7966 );
7967}
7968
7969/* PMEVCNTR_0, Performance Monitors Event Count Registers */
7970
7971static inline uint32_t _AArch32_Read_pmevcntr_0( void )
7972{
7973 uint32_t value;
7974
7975 __asm__ volatile (
7976 "mrc p15, 0, %0, c14, c8, 0" : "=&r" ( value ) : : "memory"
7977 );
7978
7979 return value;
7980}
7981
7982static inline void _AArch32_Write_pmevcntr_0( uint32_t value )
7983{
7984 __asm__ volatile (
7985 "mcr p15, 0, %0, c14, c8, 0" : : "r" ( value ) : "memory"
7986 );
7987}
7988
7989/* PMEVCNTR_1, Performance Monitors Event Count Registers */
7990
7991static inline uint32_t _AArch32_Read_pmevcntr_1( void )
7992{
7993 uint32_t value;
7994
7995 __asm__ volatile (
7996 "mrc p15, 0, %0, c14, c8, 1" : "=&r" ( value ) : : "memory"
7997 );
7998
7999 return value;
8000}
8001
8002static inline void _AArch32_Write_pmevcntr_1( uint32_t value )
8003{
8004 __asm__ volatile (
8005 "mcr p15, 0, %0, c14, c8, 1" : : "r" ( value ) : "memory"
8006 );
8007}
8008
8009/* PMEVCNTR_2, Performance Monitors Event Count Registers */
8010
8011static inline uint32_t _AArch32_Read_pmevcntr_2( void )
8012{
8013 uint32_t value;
8014
8015 __asm__ volatile (
8016 "mrc p15, 0, %0, c14, c8, 2" : "=&r" ( value ) : : "memory"
8017 );
8018
8019 return value;
8020}
8021
8022static inline void _AArch32_Write_pmevcntr_2( uint32_t value )
8023{
8024 __asm__ volatile (
8025 "mcr p15, 0, %0, c14, c8, 2" : : "r" ( value ) : "memory"
8026 );
8027}
8028
8029/* PMEVCNTR_3, Performance Monitors Event Count Registers */
8030
8031static inline uint32_t _AArch32_Read_pmevcntr_3( void )
8032{
8033 uint32_t value;
8034
8035 __asm__ volatile (
8036 "mrc p15, 0, %0, c14, c8, 3" : "=&r" ( value ) : : "memory"
8037 );
8038
8039 return value;
8040}
8041
8042static inline void _AArch32_Write_pmevcntr_3( uint32_t value )
8043{
8044 __asm__ volatile (
8045 "mcr p15, 0, %0, c14, c8, 3" : : "r" ( value ) : "memory"
8046 );
8047}
8048
8049/* PMEVCNTR_4, Performance Monitors Event Count Registers */
8050
8051static inline uint32_t _AArch32_Read_pmevcntr_4( void )
8052{
8053 uint32_t value;
8054
8055 __asm__ volatile (
8056 "mrc p15, 0, %0, c14, c8, 4" : "=&r" ( value ) : : "memory"
8057 );
8058
8059 return value;
8060}
8061
8062static inline void _AArch32_Write_pmevcntr_4( uint32_t value )
8063{
8064 __asm__ volatile (
8065 "mcr p15, 0, %0, c14, c8, 4" : : "r" ( value ) : "memory"
8066 );
8067}
8068
8069/* PMEVCNTR_5, Performance Monitors Event Count Registers */
8070
8071static inline uint32_t _AArch32_Read_pmevcntr_5( void )
8072{
8073 uint32_t value;
8074
8075 __asm__ volatile (
8076 "mrc p15, 0, %0, c14, c8, 5" : "=&r" ( value ) : : "memory"
8077 );
8078
8079 return value;
8080}
8081
8082static inline void _AArch32_Write_pmevcntr_5( uint32_t value )
8083{
8084 __asm__ volatile (
8085 "mcr p15, 0, %0, c14, c8, 5" : : "r" ( value ) : "memory"
8086 );
8087}
8088
8089/* PMEVCNTR_6, Performance Monitors Event Count Registers */
8090
8091static inline uint32_t _AArch32_Read_pmevcntr_6( void )
8092{
8093 uint32_t value;
8094
8095 __asm__ volatile (
8096 "mrc p15, 0, %0, c14, c8, 6" : "=&r" ( value ) : : "memory"
8097 );
8098
8099 return value;
8100}
8101
8102static inline void _AArch32_Write_pmevcntr_6( uint32_t value )
8103{
8104 __asm__ volatile (
8105 "mcr p15, 0, %0, c14, c8, 6" : : "r" ( value ) : "memory"
8106 );
8107}
8108
8109/* PMEVCNTR_7, Performance Monitors Event Count Registers */
8110
8111static inline uint32_t _AArch32_Read_pmevcntr_7( void )
8112{
8113 uint32_t value;
8114
8115 __asm__ volatile (
8116 "mrc p15, 0, %0, c14, c8, 7" : "=&r" ( value ) : : "memory"
8117 );
8118
8119 return value;
8120}
8121
8122static inline void _AArch32_Write_pmevcntr_7( uint32_t value )
8123{
8124 __asm__ volatile (
8125 "mcr p15, 0, %0, c14, c8, 7" : : "r" ( value ) : "memory"
8126 );
8127}
8128
8129/* PMEVCNTR_8, Performance Monitors Event Count Registers */
8130
8131static inline uint32_t _AArch32_Read_pmevcntr_8( void )
8132{
8133 uint32_t value;
8134
8135 __asm__ volatile (
8136 "mrc p15, 0, %0, c14, c9, 0" : "=&r" ( value ) : : "memory"
8137 );
8138
8139 return value;
8140}
8141
8142static inline void _AArch32_Write_pmevcntr_8( uint32_t value )
8143{
8144 __asm__ volatile (
8145 "mcr p15, 0, %0, c14, c9, 0" : : "r" ( value ) : "memory"
8146 );
8147}
8148
8149/* PMEVCNTR_9, Performance Monitors Event Count Registers */
8150
8151static inline uint32_t _AArch32_Read_pmevcntr_9( void )
8152{
8153 uint32_t value;
8154
8155 __asm__ volatile (
8156 "mrc p15, 0, %0, c14, c9, 1" : "=&r" ( value ) : : "memory"
8157 );
8158
8159 return value;
8160}
8161
8162static inline void _AArch32_Write_pmevcntr_9( uint32_t value )
8163{
8164 __asm__ volatile (
8165 "mcr p15, 0, %0, c14, c9, 1" : : "r" ( value ) : "memory"
8166 );
8167}
8168
8169/* PMEVCNTR_10, Performance Monitors Event Count Registers */
8170
8171static inline uint32_t _AArch32_Read_pmevcntr_10( void )
8172{
8173 uint32_t value;
8174
8175 __asm__ volatile (
8176 "mrc p15, 0, %0, c14, c9, 2" : "=&r" ( value ) : : "memory"
8177 );
8178
8179 return value;
8180}
8181
8182static inline void _AArch32_Write_pmevcntr_10( uint32_t value )
8183{
8184 __asm__ volatile (
8185 "mcr p15, 0, %0, c14, c9, 2" : : "r" ( value ) : "memory"
8186 );
8187}
8188
8189/* PMEVCNTR_11, Performance Monitors Event Count Registers */
8190
8191static inline uint32_t _AArch32_Read_pmevcntr_11( void )
8192{
8193 uint32_t value;
8194
8195 __asm__ volatile (
8196 "mrc p15, 0, %0, c14, c9, 3" : "=&r" ( value ) : : "memory"
8197 );
8198
8199 return value;
8200}
8201
8202static inline void _AArch32_Write_pmevcntr_11( uint32_t value )
8203{
8204 __asm__ volatile (
8205 "mcr p15, 0, %0, c14, c9, 3" : : "r" ( value ) : "memory"
8206 );
8207}
8208
8209/* PMEVCNTR_12, Performance Monitors Event Count Registers */
8210
8211static inline uint32_t _AArch32_Read_pmevcntr_12( void )
8212{
8213 uint32_t value;
8214
8215 __asm__ volatile (
8216 "mrc p15, 0, %0, c14, c9, 4" : "=&r" ( value ) : : "memory"
8217 );
8218
8219 return value;
8220}
8221
8222static inline void _AArch32_Write_pmevcntr_12( uint32_t value )
8223{
8224 __asm__ volatile (
8225 "mcr p15, 0, %0, c14, c9, 4" : : "r" ( value ) : "memory"
8226 );
8227}
8228
8229/* PMEVCNTR_13, Performance Monitors Event Count Registers */
8230
8231static inline uint32_t _AArch32_Read_pmevcntr_13( void )
8232{
8233 uint32_t value;
8234
8235 __asm__ volatile (
8236 "mrc p15, 0, %0, c14, c9, 5" : "=&r" ( value ) : : "memory"
8237 );
8238
8239 return value;
8240}
8241
8242static inline void _AArch32_Write_pmevcntr_13( uint32_t value )
8243{
8244 __asm__ volatile (
8245 "mcr p15, 0, %0, c14, c9, 5" : : "r" ( value ) : "memory"
8246 );
8247}
8248
8249/* PMEVCNTR_14, Performance Monitors Event Count Registers */
8250
8251static inline uint32_t _AArch32_Read_pmevcntr_14( void )
8252{
8253 uint32_t value;
8254
8255 __asm__ volatile (
8256 "mrc p15, 0, %0, c14, c9, 6" : "=&r" ( value ) : : "memory"
8257 );
8258
8259 return value;
8260}
8261
8262static inline void _AArch32_Write_pmevcntr_14( uint32_t value )
8263{
8264 __asm__ volatile (
8265 "mcr p15, 0, %0, c14, c9, 6" : : "r" ( value ) : "memory"
8266 );
8267}
8268
8269/* PMEVCNTR_15, Performance Monitors Event Count Registers */
8270
8271static inline uint32_t _AArch32_Read_pmevcntr_15( void )
8272{
8273 uint32_t value;
8274
8275 __asm__ volatile (
8276 "mrc p15, 0, %0, c14, c9, 7" : "=&r" ( value ) : : "memory"
8277 );
8278
8279 return value;
8280}
8281
8282static inline void _AArch32_Write_pmevcntr_15( uint32_t value )
8283{
8284 __asm__ volatile (
8285 "mcr p15, 0, %0, c14, c9, 7" : : "r" ( value ) : "memory"
8286 );
8287}
8288
8289/* PMEVCNTR_16, Performance Monitors Event Count Registers */
8290
8291static inline uint32_t _AArch32_Read_pmevcntr_16( void )
8292{
8293 uint32_t value;
8294
8295 __asm__ volatile (
8296 "mrc p15, 0, %0, c14, c10, 0" : "=&r" ( value ) : : "memory"
8297 );
8298
8299 return value;
8300}
8301
8302static inline void _AArch32_Write_pmevcntr_16( uint32_t value )
8303{
8304 __asm__ volatile (
8305 "mcr p15, 0, %0, c14, c10, 0" : : "r" ( value ) : "memory"
8306 );
8307}
8308
8309/* PMEVCNTR_17, Performance Monitors Event Count Registers */
8310
8311static inline uint32_t _AArch32_Read_pmevcntr_17( void )
8312{
8313 uint32_t value;
8314
8315 __asm__ volatile (
8316 "mrc p15, 0, %0, c14, c10, 1" : "=&r" ( value ) : : "memory"
8317 );
8318
8319 return value;
8320}
8321
8322static inline void _AArch32_Write_pmevcntr_17( uint32_t value )
8323{
8324 __asm__ volatile (
8325 "mcr p15, 0, %0, c14, c10, 1" : : "r" ( value ) : "memory"
8326 );
8327}
8328
8329/* PMEVCNTR_18, Performance Monitors Event Count Registers */
8330
8331static inline uint32_t _AArch32_Read_pmevcntr_18( void )
8332{
8333 uint32_t value;
8334
8335 __asm__ volatile (
8336 "mrc p15, 0, %0, c14, c10, 2" : "=&r" ( value ) : : "memory"
8337 );
8338
8339 return value;
8340}
8341
8342static inline void _AArch32_Write_pmevcntr_18( uint32_t value )
8343{
8344 __asm__ volatile (
8345 "mcr p15, 0, %0, c14, c10, 2" : : "r" ( value ) : "memory"
8346 );
8347}
8348
8349/* PMEVCNTR_19, Performance Monitors Event Count Registers */
8350
8351static inline uint32_t _AArch32_Read_pmevcntr_19( void )
8352{
8353 uint32_t value;
8354
8355 __asm__ volatile (
8356 "mrc p15, 0, %0, c14, c10, 3" : "=&r" ( value ) : : "memory"
8357 );
8358
8359 return value;
8360}
8361
8362static inline void _AArch32_Write_pmevcntr_19( uint32_t value )
8363{
8364 __asm__ volatile (
8365 "mcr p15, 0, %0, c14, c10, 3" : : "r" ( value ) : "memory"
8366 );
8367}
8368
8369/* PMEVCNTR_20, Performance Monitors Event Count Registers */
8370
8371static inline uint32_t _AArch32_Read_pmevcntr_20( void )
8372{
8373 uint32_t value;
8374
8375 __asm__ volatile (
8376 "mrc p15, 0, %0, c14, c10, 4" : "=&r" ( value ) : : "memory"
8377 );
8378
8379 return value;
8380}
8381
8382static inline void _AArch32_Write_pmevcntr_20( uint32_t value )
8383{
8384 __asm__ volatile (
8385 "mcr p15, 0, %0, c14, c10, 4" : : "r" ( value ) : "memory"
8386 );
8387}
8388
8389/* PMEVCNTR_21, Performance Monitors Event Count Registers */
8390
8391static inline uint32_t _AArch32_Read_pmevcntr_21( void )
8392{
8393 uint32_t value;
8394
8395 __asm__ volatile (
8396 "mrc p15, 0, %0, c14, c10, 5" : "=&r" ( value ) : : "memory"
8397 );
8398
8399 return value;
8400}
8401
8402static inline void _AArch32_Write_pmevcntr_21( uint32_t value )
8403{
8404 __asm__ volatile (
8405 "mcr p15, 0, %0, c14, c10, 5" : : "r" ( value ) : "memory"
8406 );
8407}
8408
8409/* PMEVCNTR_22, Performance Monitors Event Count Registers */
8410
8411static inline uint32_t _AArch32_Read_pmevcntr_22( void )
8412{
8413 uint32_t value;
8414
8415 __asm__ volatile (
8416 "mrc p15, 0, %0, c14, c10, 6" : "=&r" ( value ) : : "memory"
8417 );
8418
8419 return value;
8420}
8421
8422static inline void _AArch32_Write_pmevcntr_22( uint32_t value )
8423{
8424 __asm__ volatile (
8425 "mcr p15, 0, %0, c14, c10, 6" : : "r" ( value ) : "memory"
8426 );
8427}
8428
8429/* PMEVCNTR_23, Performance Monitors Event Count Registers */
8430
8431static inline uint32_t _AArch32_Read_pmevcntr_23( void )
8432{
8433 uint32_t value;
8434
8435 __asm__ volatile (
8436 "mrc p15, 0, %0, c14, c10, 7" : "=&r" ( value ) : : "memory"
8437 );
8438
8439 return value;
8440}
8441
8442static inline void _AArch32_Write_pmevcntr_23( uint32_t value )
8443{
8444 __asm__ volatile (
8445 "mcr p15, 0, %0, c14, c10, 7" : : "r" ( value ) : "memory"
8446 );
8447}
8448
8449/* PMEVCNTR_24, Performance Monitors Event Count Registers */
8450
8451static inline uint32_t _AArch32_Read_pmevcntr_24( void )
8452{
8453 uint32_t value;
8454
8455 __asm__ volatile (
8456 "mrc p15, 0, %0, c14, c11, 0" : "=&r" ( value ) : : "memory"
8457 );
8458
8459 return value;
8460}
8461
8462static inline void _AArch32_Write_pmevcntr_24( uint32_t value )
8463{
8464 __asm__ volatile (
8465 "mcr p15, 0, %0, c14, c11, 0" : : "r" ( value ) : "memory"
8466 );
8467}
8468
8469/* PMEVCNTR_25, Performance Monitors Event Count Registers */
8470
8471static inline uint32_t _AArch32_Read_pmevcntr_25( void )
8472{
8473 uint32_t value;
8474
8475 __asm__ volatile (
8476 "mrc p15, 0, %0, c14, c11, 1" : "=&r" ( value ) : : "memory"
8477 );
8478
8479 return value;
8480}
8481
8482static inline void _AArch32_Write_pmevcntr_25( uint32_t value )
8483{
8484 __asm__ volatile (
8485 "mcr p15, 0, %0, c14, c11, 1" : : "r" ( value ) : "memory"
8486 );
8487}
8488
8489/* PMEVCNTR_26, Performance Monitors Event Count Registers */
8490
8491static inline uint32_t _AArch32_Read_pmevcntr_26( void )
8492{
8493 uint32_t value;
8494
8495 __asm__ volatile (
8496 "mrc p15, 0, %0, c14, c11, 2" : "=&r" ( value ) : : "memory"
8497 );
8498
8499 return value;
8500}
8501
8502static inline void _AArch32_Write_pmevcntr_26( uint32_t value )
8503{
8504 __asm__ volatile (
8505 "mcr p15, 0, %0, c14, c11, 2" : : "r" ( value ) : "memory"
8506 );
8507}
8508
8509/* PMEVCNTR_27, Performance Monitors Event Count Registers */
8510
8511static inline uint32_t _AArch32_Read_pmevcntr_27( void )
8512{
8513 uint32_t value;
8514
8515 __asm__ volatile (
8516 "mrc p15, 0, %0, c14, c11, 3" : "=&r" ( value ) : : "memory"
8517 );
8518
8519 return value;
8520}
8521
8522static inline void _AArch32_Write_pmevcntr_27( uint32_t value )
8523{
8524 __asm__ volatile (
8525 "mcr p15, 0, %0, c14, c11, 3" : : "r" ( value ) : "memory"
8526 );
8527}
8528
8529/* PMEVCNTR_28, Performance Monitors Event Count Registers */
8530
8531static inline uint32_t _AArch32_Read_pmevcntr_28( void )
8532{
8533 uint32_t value;
8534
8535 __asm__ volatile (
8536 "mrc p15, 0, %0, c14, c11, 4" : "=&r" ( value ) : : "memory"
8537 );
8538
8539 return value;
8540}
8541
8542static inline void _AArch32_Write_pmevcntr_28( uint32_t value )
8543{
8544 __asm__ volatile (
8545 "mcr p15, 0, %0, c14, c11, 4" : : "r" ( value ) : "memory"
8546 );
8547}
8548
8549/* PMEVCNTR_29, Performance Monitors Event Count Registers */
8550
8551static inline uint32_t _AArch32_Read_pmevcntr_29( void )
8552{
8553 uint32_t value;
8554
8555 __asm__ volatile (
8556 "mrc p15, 0, %0, c14, c11, 5" : "=&r" ( value ) : : "memory"
8557 );
8558
8559 return value;
8560}
8561
8562static inline void _AArch32_Write_pmevcntr_29( uint32_t value )
8563{
8564 __asm__ volatile (
8565 "mcr p15, 0, %0, c14, c11, 5" : : "r" ( value ) : "memory"
8566 );
8567}
8568
8569/* PMEVCNTR_30, Performance Monitors Event Count Registers */
8570
8571static inline uint32_t _AArch32_Read_pmevcntr_30( void )
8572{
8573 uint32_t value;
8574
8575 __asm__ volatile (
8576 "mrc p15, 0, %0, c14, c11, 6" : "=&r" ( value ) : : "memory"
8577 );
8578
8579 return value;
8580}
8581
8582static inline void _AArch32_Write_pmevcntr_30( uint32_t value )
8583{
8584 __asm__ volatile (
8585 "mcr p15, 0, %0, c14, c11, 6" : : "r" ( value ) : "memory"
8586 );
8587}
8588
8589/* PMEVTYPER, Performance Monitors Event Type Registers */
8590
8591#define AARCH32_PMEVTYPER_EVTCOUNT_9_0( _val ) ( ( _val ) << 0 )
8592#define AARCH32_PMEVTYPER_EVTCOUNT_9_0_SHIFT 0
8593#define AARCH32_PMEVTYPER_EVTCOUNT_9_0_MASK 0x3ffU
8594#define AARCH32_PMEVTYPER_EVTCOUNT_9_0_GET( _reg ) \
8595 ( ( ( _reg ) >> 0 ) & 0x3ffU )
8596
8597#define AARCH32_PMEVTYPER_EVTCOUNT_15_10( _val ) ( ( _val ) << 10 )
8598#define AARCH32_PMEVTYPER_EVTCOUNT_15_10_SHIFT 10
8599#define AARCH32_PMEVTYPER_EVTCOUNT_15_10_MASK 0xfc00U
8600#define AARCH32_PMEVTYPER_EVTCOUNT_15_10_GET( _reg ) \
8601 ( ( ( _reg ) >> 10 ) & 0x3fU )
8602
8603#define AARCH32_PMEVTYPER_MT 0x2000000U
8604
8605#define AARCH32_PMEVTYPER_NSH 0x8000000U
8606
8607#define AARCH32_PMEVTYPER_NSU 0x10000000U
8608
8609#define AARCH32_PMEVTYPER_NSK 0x20000000U
8610
8611#define AARCH32_PMEVTYPER_U 0x40000000U
8612
8613#define AARCH32_PMEVTYPER_P 0x80000000U
8614
8615/* PMEVTYPER_0, Performance Monitors Event Type Registers */
8616
8617static inline uint32_t _AArch32_Read_pmevtyper_0( void )
8618{
8619 uint32_t value;
8620
8621 __asm__ volatile (
8622 "mrc p15, 0, %0, c14, c12, 0" : "=&r" ( value ) : : "memory"
8623 );
8624
8625 return value;
8626}
8627
8628static inline void _AArch32_Write_pmevtyper_0( uint32_t value )
8629{
8630 __asm__ volatile (
8631 "mcr p15, 0, %0, c14, c12, 0" : : "r" ( value ) : "memory"
8632 );
8633}
8634
8635/* PMEVTYPER_1, Performance Monitors Event Type Registers */
8636
8637static inline uint32_t _AArch32_Read_pmevtyper_1( void )
8638{
8639 uint32_t value;
8640
8641 __asm__ volatile (
8642 "mrc p15, 0, %0, c14, c12, 1" : "=&r" ( value ) : : "memory"
8643 );
8644
8645 return value;
8646}
8647
8648static inline void _AArch32_Write_pmevtyper_1( uint32_t value )
8649{
8650 __asm__ volatile (
8651 "mcr p15, 0, %0, c14, c12, 1" : : "r" ( value ) : "memory"
8652 );
8653}
8654
8655/* PMEVTYPER_2, Performance Monitors Event Type Registers */
8656
8657static inline uint32_t _AArch32_Read_pmevtyper_2( void )
8658{
8659 uint32_t value;
8660
8661 __asm__ volatile (
8662 "mrc p15, 0, %0, c14, c12, 2" : "=&r" ( value ) : : "memory"
8663 );
8664
8665 return value;
8666}
8667
8668static inline void _AArch32_Write_pmevtyper_2( uint32_t value )
8669{
8670 __asm__ volatile (
8671 "mcr p15, 0, %0, c14, c12, 2" : : "r" ( value ) : "memory"
8672 );
8673}
8674
8675/* PMEVTYPER_3, Performance Monitors Event Type Registers */
8676
8677static inline uint32_t _AArch32_Read_pmevtyper_3( void )
8678{
8679 uint32_t value;
8680
8681 __asm__ volatile (
8682 "mrc p15, 0, %0, c14, c12, 3" : "=&r" ( value ) : : "memory"
8683 );
8684
8685 return value;
8686}
8687
8688static inline void _AArch32_Write_pmevtyper_3( uint32_t value )
8689{
8690 __asm__ volatile (
8691 "mcr p15, 0, %0, c14, c12, 3" : : "r" ( value ) : "memory"
8692 );
8693}
8694
8695/* PMEVTYPER_4, Performance Monitors Event Type Registers */
8696
8697static inline uint32_t _AArch32_Read_pmevtyper_4( void )
8698{
8699 uint32_t value;
8700
8701 __asm__ volatile (
8702 "mrc p15, 0, %0, c14, c12, 4" : "=&r" ( value ) : : "memory"
8703 );
8704
8705 return value;
8706}
8707
8708static inline void _AArch32_Write_pmevtyper_4( uint32_t value )
8709{
8710 __asm__ volatile (
8711 "mcr p15, 0, %0, c14, c12, 4" : : "r" ( value ) : "memory"
8712 );
8713}
8714
8715/* PMEVTYPER_5, Performance Monitors Event Type Registers */
8716
8717static inline uint32_t _AArch32_Read_pmevtyper_5( void )
8718{
8719 uint32_t value;
8720
8721 __asm__ volatile (
8722 "mrc p15, 0, %0, c14, c12, 5" : "=&r" ( value ) : : "memory"
8723 );
8724
8725 return value;
8726}
8727
8728static inline void _AArch32_Write_pmevtyper_5( uint32_t value )
8729{
8730 __asm__ volatile (
8731 "mcr p15, 0, %0, c14, c12, 5" : : "r" ( value ) : "memory"
8732 );
8733}
8734
8735/* PMEVTYPER_6, Performance Monitors Event Type Registers */
8736
8737static inline uint32_t _AArch32_Read_pmevtyper_6( void )
8738{
8739 uint32_t value;
8740
8741 __asm__ volatile (
8742 "mrc p15, 0, %0, c14, c12, 6" : "=&r" ( value ) : : "memory"
8743 );
8744
8745 return value;
8746}
8747
8748static inline void _AArch32_Write_pmevtyper_6( uint32_t value )
8749{
8750 __asm__ volatile (
8751 "mcr p15, 0, %0, c14, c12, 6" : : "r" ( value ) : "memory"
8752 );
8753}
8754
8755/* PMEVTYPER_7, Performance Monitors Event Type Registers */
8756
8757static inline uint32_t _AArch32_Read_pmevtyper_7( void )
8758{
8759 uint32_t value;
8760
8761 __asm__ volatile (
8762 "mrc p15, 0, %0, c14, c12, 7" : "=&r" ( value ) : : "memory"
8763 );
8764
8765 return value;
8766}
8767
8768static inline void _AArch32_Write_pmevtyper_7( uint32_t value )
8769{
8770 __asm__ volatile (
8771 "mcr p15, 0, %0, c14, c12, 7" : : "r" ( value ) : "memory"
8772 );
8773}
8774
8775/* PMEVTYPER_8, Performance Monitors Event Type Registers */
8776
8777static inline uint32_t _AArch32_Read_pmevtyper_8( void )
8778{
8779 uint32_t value;
8780
8781 __asm__ volatile (
8782 "mrc p15, 0, %0, c14, c13, 0" : "=&r" ( value ) : : "memory"
8783 );
8784
8785 return value;
8786}
8787
8788static inline void _AArch32_Write_pmevtyper_8( uint32_t value )
8789{
8790 __asm__ volatile (
8791 "mcr p15, 0, %0, c14, c13, 0" : : "r" ( value ) : "memory"
8792 );
8793}
8794
8795/* PMEVTYPER_9, Performance Monitors Event Type Registers */
8796
8797static inline uint32_t _AArch32_Read_pmevtyper_9( void )
8798{
8799 uint32_t value;
8800
8801 __asm__ volatile (
8802 "mrc p15, 0, %0, c14, c13, 1" : "=&r" ( value ) : : "memory"
8803 );
8804
8805 return value;
8806}
8807
8808static inline void _AArch32_Write_pmevtyper_9( uint32_t value )
8809{
8810 __asm__ volatile (
8811 "mcr p15, 0, %0, c14, c13, 1" : : "r" ( value ) : "memory"
8812 );
8813}
8814
8815/* PMEVTYPER_10, Performance Monitors Event Type Registers */
8816
8817static inline uint32_t _AArch32_Read_pmevtyper_10( void )
8818{
8819 uint32_t value;
8820
8821 __asm__ volatile (
8822 "mrc p15, 0, %0, c14, c13, 2" : "=&r" ( value ) : : "memory"
8823 );
8824
8825 return value;
8826}
8827
8828static inline void _AArch32_Write_pmevtyper_10( uint32_t value )
8829{
8830 __asm__ volatile (
8831 "mcr p15, 0, %0, c14, c13, 2" : : "r" ( value ) : "memory"
8832 );
8833}
8834
8835/* PMEVTYPER_11, Performance Monitors Event Type Registers */
8836
8837static inline uint32_t _AArch32_Read_pmevtyper_11( void )
8838{
8839 uint32_t value;
8840
8841 __asm__ volatile (
8842 "mrc p15, 0, %0, c14, c13, 3" : "=&r" ( value ) : : "memory"
8843 );
8844
8845 return value;
8846}
8847
8848static inline void _AArch32_Write_pmevtyper_11( uint32_t value )
8849{
8850 __asm__ volatile (
8851 "mcr p15, 0, %0, c14, c13, 3" : : "r" ( value ) : "memory"
8852 );
8853}
8854
8855/* PMEVTYPER_12, Performance Monitors Event Type Registers */
8856
8857static inline uint32_t _AArch32_Read_pmevtyper_12( void )
8858{
8859 uint32_t value;
8860
8861 __asm__ volatile (
8862 "mrc p15, 0, %0, c14, c13, 4" : "=&r" ( value ) : : "memory"
8863 );
8864
8865 return value;
8866}
8867
8868static inline void _AArch32_Write_pmevtyper_12( uint32_t value )
8869{
8870 __asm__ volatile (
8871 "mcr p15, 0, %0, c14, c13, 4" : : "r" ( value ) : "memory"
8872 );
8873}
8874
8875/* PMEVTYPER_13, Performance Monitors Event Type Registers */
8876
8877static inline uint32_t _AArch32_Read_pmevtyper_13( void )
8878{
8879 uint32_t value;
8880
8881 __asm__ volatile (
8882 "mrc p15, 0, %0, c14, c13, 5" : "=&r" ( value ) : : "memory"
8883 );
8884
8885 return value;
8886}
8887
8888static inline void _AArch32_Write_pmevtyper_13( uint32_t value )
8889{
8890 __asm__ volatile (
8891 "mcr p15, 0, %0, c14, c13, 5" : : "r" ( value ) : "memory"
8892 );
8893}
8894
8895/* PMEVTYPER_14, Performance Monitors Event Type Registers */
8896
8897static inline uint32_t _AArch32_Read_pmevtyper_14( void )
8898{
8899 uint32_t value;
8900
8901 __asm__ volatile (
8902 "mrc p15, 0, %0, c14, c13, 6" : "=&r" ( value ) : : "memory"
8903 );
8904
8905 return value;
8906}
8907
8908static inline void _AArch32_Write_pmevtyper_14( uint32_t value )
8909{
8910 __asm__ volatile (
8911 "mcr p15, 0, %0, c14, c13, 6" : : "r" ( value ) : "memory"
8912 );
8913}
8914
8915/* PMEVTYPER_15, Performance Monitors Event Type Registers */
8916
8917static inline uint32_t _AArch32_Read_pmevtyper_15( void )
8918{
8919 uint32_t value;
8920
8921 __asm__ volatile (
8922 "mrc p15, 0, %0, c14, c13, 7" : "=&r" ( value ) : : "memory"
8923 );
8924
8925 return value;
8926}
8927
8928static inline void _AArch32_Write_pmevtyper_15( uint32_t value )
8929{
8930 __asm__ volatile (
8931 "mcr p15, 0, %0, c14, c13, 7" : : "r" ( value ) : "memory"
8932 );
8933}
8934
8935/* PMEVTYPER_16, Performance Monitors Event Type Registers */
8936
8937static inline uint32_t _AArch32_Read_pmevtyper_16( void )
8938{
8939 uint32_t value;
8940
8941 __asm__ volatile (
8942 "mrc p15, 0, %0, c14, c14, 0" : "=&r" ( value ) : : "memory"
8943 );
8944
8945 return value;
8946}
8947
8948static inline void _AArch32_Write_pmevtyper_16( uint32_t value )
8949{
8950 __asm__ volatile (
8951 "mcr p15, 0, %0, c14, c14, 0" : : "r" ( value ) : "memory"
8952 );
8953}
8954
8955/* PMEVTYPER_17, Performance Monitors Event Type Registers */
8956
8957static inline uint32_t _AArch32_Read_pmevtyper_17( void )
8958{
8959 uint32_t value;
8960
8961 __asm__ volatile (
8962 "mrc p15, 0, %0, c14, c14, 1" : "=&r" ( value ) : : "memory"
8963 );
8964
8965 return value;
8966}
8967
8968static inline void _AArch32_Write_pmevtyper_17( uint32_t value )
8969{
8970 __asm__ volatile (
8971 "mcr p15, 0, %0, c14, c14, 1" : : "r" ( value ) : "memory"
8972 );
8973}
8974
8975/* PMEVTYPER_18, Performance Monitors Event Type Registers */
8976
8977static inline uint32_t _AArch32_Read_pmevtyper_18( void )
8978{
8979 uint32_t value;
8980
8981 __asm__ volatile (
8982 "mrc p15, 0, %0, c14, c14, 2" : "=&r" ( value ) : : "memory"
8983 );
8984
8985 return value;
8986}
8987
8988static inline void _AArch32_Write_pmevtyper_18( uint32_t value )
8989{
8990 __asm__ volatile (
8991 "mcr p15, 0, %0, c14, c14, 2" : : "r" ( value ) : "memory"
8992 );
8993}
8994
8995/* PMEVTYPER_19, Performance Monitors Event Type Registers */
8996
8997static inline uint32_t _AArch32_Read_pmevtyper_19( void )
8998{
8999 uint32_t value;
9000
9001 __asm__ volatile (
9002 "mrc p15, 0, %0, c14, c14, 3" : "=&r" ( value ) : : "memory"
9003 );
9004
9005 return value;
9006}
9007
9008static inline void _AArch32_Write_pmevtyper_19( uint32_t value )
9009{
9010 __asm__ volatile (
9011 "mcr p15, 0, %0, c14, c14, 3" : : "r" ( value ) : "memory"
9012 );
9013}
9014
9015/* PMEVTYPER_20, Performance Monitors Event Type Registers */
9016
9017static inline uint32_t _AArch32_Read_pmevtyper_20( void )
9018{
9019 uint32_t value;
9020
9021 __asm__ volatile (
9022 "mrc p15, 0, %0, c14, c14, 4" : "=&r" ( value ) : : "memory"
9023 );
9024
9025 return value;
9026}
9027
9028static inline void _AArch32_Write_pmevtyper_20( uint32_t value )
9029{
9030 __asm__ volatile (
9031 "mcr p15, 0, %0, c14, c14, 4" : : "r" ( value ) : "memory"
9032 );
9033}
9034
9035/* PMEVTYPER_21, Performance Monitors Event Type Registers */
9036
9037static inline uint32_t _AArch32_Read_pmevtyper_21( void )
9038{
9039 uint32_t value;
9040
9041 __asm__ volatile (
9042 "mrc p15, 0, %0, c14, c14, 5" : "=&r" ( value ) : : "memory"
9043 );
9044
9045 return value;
9046}
9047
9048static inline void _AArch32_Write_pmevtyper_21( uint32_t value )
9049{
9050 __asm__ volatile (
9051 "mcr p15, 0, %0, c14, c14, 5" : : "r" ( value ) : "memory"
9052 );
9053}
9054
9055/* PMEVTYPER_22, Performance Monitors Event Type Registers */
9056
9057static inline uint32_t _AArch32_Read_pmevtyper_22( void )
9058{
9059 uint32_t value;
9060
9061 __asm__ volatile (
9062 "mrc p15, 0, %0, c14, c14, 6" : "=&r" ( value ) : : "memory"
9063 );
9064
9065 return value;
9066}
9067
9068static inline void _AArch32_Write_pmevtyper_22( uint32_t value )
9069{
9070 __asm__ volatile (
9071 "mcr p15, 0, %0, c14, c14, 6" : : "r" ( value ) : "memory"
9072 );
9073}
9074
9075/* PMEVTYPER_23, Performance Monitors Event Type Registers */
9076
9077static inline uint32_t _AArch32_Read_pmevtyper_23( void )
9078{
9079 uint32_t value;
9080
9081 __asm__ volatile (
9082 "mrc p15, 0, %0, c14, c14, 7" : "=&r" ( value ) : : "memory"
9083 );
9084
9085 return value;
9086}
9087
9088static inline void _AArch32_Write_pmevtyper_23( uint32_t value )
9089{
9090 __asm__ volatile (
9091 "mcr p15, 0, %0, c14, c14, 7" : : "r" ( value ) : "memory"
9092 );
9093}
9094
9095/* PMEVTYPER_24, Performance Monitors Event Type Registers */
9096
9097static inline uint32_t _AArch32_Read_pmevtyper_24( void )
9098{
9099 uint32_t value;
9100
9101 __asm__ volatile (
9102 "mrc p15, 0, %0, c14, c15, 0" : "=&r" ( value ) : : "memory"
9103 );
9104
9105 return value;
9106}
9107
9108static inline void _AArch32_Write_pmevtyper_24( uint32_t value )
9109{
9110 __asm__ volatile (
9111 "mcr p15, 0, %0, c14, c15, 0" : : "r" ( value ) : "memory"
9112 );
9113}
9114
9115/* PMEVTYPER_25, Performance Monitors Event Type Registers */
9116
9117static inline uint32_t _AArch32_Read_pmevtyper_25( void )
9118{
9119 uint32_t value;
9120
9121 __asm__ volatile (
9122 "mrc p15, 0, %0, c14, c15, 1" : "=&r" ( value ) : : "memory"
9123 );
9124
9125 return value;
9126}
9127
9128static inline void _AArch32_Write_pmevtyper_25( uint32_t value )
9129{
9130 __asm__ volatile (
9131 "mcr p15, 0, %0, c14, c15, 1" : : "r" ( value ) : "memory"
9132 );
9133}
9134
9135/* PMEVTYPER_26, Performance Monitors Event Type Registers */
9136
9137static inline uint32_t _AArch32_Read_pmevtyper_26( void )
9138{
9139 uint32_t value;
9140
9141 __asm__ volatile (
9142 "mrc p15, 0, %0, c14, c15, 2" : "=&r" ( value ) : : "memory"
9143 );
9144
9145 return value;
9146}
9147
9148static inline void _AArch32_Write_pmevtyper_26( uint32_t value )
9149{
9150 __asm__ volatile (
9151 "mcr p15, 0, %0, c14, c15, 2" : : "r" ( value ) : "memory"
9152 );
9153}
9154
9155/* PMEVTYPER_27, Performance Monitors Event Type Registers */
9156
9157static inline uint32_t _AArch32_Read_pmevtyper_27( void )
9158{
9159 uint32_t value;
9160
9161 __asm__ volatile (
9162 "mrc p15, 0, %0, c14, c15, 3" : "=&r" ( value ) : : "memory"
9163 );
9164
9165 return value;
9166}
9167
9168static inline void _AArch32_Write_pmevtyper_27( uint32_t value )
9169{
9170 __asm__ volatile (
9171 "mcr p15, 0, %0, c14, c15, 3" : : "r" ( value ) : "memory"
9172 );
9173}
9174
9175/* PMEVTYPER_28, Performance Monitors Event Type Registers */
9176
9177static inline uint32_t _AArch32_Read_pmevtyper_28( void )
9178{
9179 uint32_t value;
9180
9181 __asm__ volatile (
9182 "mrc p15, 0, %0, c14, c15, 4" : "=&r" ( value ) : : "memory"
9183 );
9184
9185 return value;
9186}
9187
9188static inline void _AArch32_Write_pmevtyper_28( uint32_t value )
9189{
9190 __asm__ volatile (
9191 "mcr p15, 0, %0, c14, c15, 4" : : "r" ( value ) : "memory"
9192 );
9193}
9194
9195/* PMEVTYPER_29, Performance Monitors Event Type Registers */
9196
9197static inline uint32_t _AArch32_Read_pmevtyper_29( void )
9198{
9199 uint32_t value;
9200
9201 __asm__ volatile (
9202 "mrc p15, 0, %0, c14, c15, 5" : "=&r" ( value ) : : "memory"
9203 );
9204
9205 return value;
9206}
9207
9208static inline void _AArch32_Write_pmevtyper_29( uint32_t value )
9209{
9210 __asm__ volatile (
9211 "mcr p15, 0, %0, c14, c15, 5" : : "r" ( value ) : "memory"
9212 );
9213}
9214
9215/* PMEVTYPER_30, Performance Monitors Event Type Registers */
9216
9217static inline uint32_t _AArch32_Read_pmevtyper_30( void )
9218{
9219 uint32_t value;
9220
9221 __asm__ volatile (
9222 "mrc p15, 0, %0, c14, c15, 6" : "=&r" ( value ) : : "memory"
9223 );
9224
9225 return value;
9226}
9227
9228static inline void _AArch32_Write_pmevtyper_30( uint32_t value )
9229{
9230 __asm__ volatile (
9231 "mcr p15, 0, %0, c14, c15, 6" : : "r" ( value ) : "memory"
9232 );
9233}
9234
9235/* PMINTENCLR, Performance Monitors Interrupt Enable Clear Register */
9236
9237#define AARCH32_PMINTENCLR_C 0x80000000U
9238
9239static inline uint32_t _AArch32_Read_pmintenclr( void )
9240{
9241 uint32_t value;
9242
9243 __asm__ volatile (
9244 "mrc p15, 0, %0, c9, c14, 2" : "=&r" ( value ) : : "memory"
9245 );
9246
9247 return value;
9248}
9249
9250static inline void _AArch32_Write_pmintenclr( uint32_t value )
9251{
9252 __asm__ volatile (
9253 "mcr p15, 0, %0, c9, c14, 2" : : "r" ( value ) : "memory"
9254 );
9255}
9256
9257/* PMINTENSET, Performance Monitors Interrupt Enable Set Register */
9258
9259#define AARCH32_PMINTENSET_C 0x80000000U
9260
9261static inline uint32_t _AArch32_Read_pmintenset( void )
9262{
9263 uint32_t value;
9264
9265 __asm__ volatile (
9266 "mrc p15, 0, %0, c9, c14, 1" : "=&r" ( value ) : : "memory"
9267 );
9268
9269 return value;
9270}
9271
9272static inline void _AArch32_Write_pmintenset( uint32_t value )
9273{
9274 __asm__ volatile (
9275 "mcr p15, 0, %0, c9, c14, 1" : : "r" ( value ) : "memory"
9276 );
9277}
9278
9279/* PMOVSR, Performance Monitors Overflow Flag Status Register */
9280
9281#define AARCH32_PMOVSR_C 0x80000000U
9282
9283static inline uint32_t _AArch32_Read_pmovsr( void )
9284{
9285 uint32_t value;
9286
9287 __asm__ volatile (
9288 "mrc p15, 0, %0, c9, c12, 3" : "=&r" ( value ) : : "memory"
9289 );
9290
9291 return value;
9292}
9293
9294static inline void _AArch32_Write_pmovsr( uint32_t value )
9295{
9296 __asm__ volatile (
9297 "mcr p15, 0, %0, c9, c12, 3" : : "r" ( value ) : "memory"
9298 );
9299}
9300
9301/* PMOVSSET, Performance Monitors Overflow Flag Status Set Register */
9302
9303#define AARCH32_PMOVSSET_C 0x80000000U
9304
9305static inline uint32_t _AArch32_Read_pmovsset( void )
9306{
9307 uint32_t value;
9308
9309 __asm__ volatile (
9310 "mrc p15, 0, %0, c9, c14, 3" : "=&r" ( value ) : : "memory"
9311 );
9312
9313 return value;
9314}
9315
9316static inline void _AArch32_Write_pmovsset( uint32_t value )
9317{
9318 __asm__ volatile (
9319 "mcr p15, 0, %0, c9, c14, 3" : : "r" ( value ) : "memory"
9320 );
9321}
9322
9323/* PMSELR, Performance Monitors Event Counter Selection Register */
9324
9325#define AARCH32_PMSELR_SEL( _val ) ( ( _val ) << 0 )
9326#define AARCH32_PMSELR_SEL_SHIFT 0
9327#define AARCH32_PMSELR_SEL_MASK 0x1fU
9328#define AARCH32_PMSELR_SEL_GET( _reg ) \
9329 ( ( ( _reg ) >> 0 ) & 0x1fU )
9330
9331static inline uint32_t _AArch32_Read_pmselr( void )
9332{
9333 uint32_t value;
9334
9335 __asm__ volatile (
9336 "mrc p15, 0, %0, c9, c12, 5" : "=&r" ( value ) : : "memory"
9337 );
9338
9339 return value;
9340}
9341
9342static inline void _AArch32_Write_pmselr( uint32_t value )
9343{
9344 __asm__ volatile (
9345 "mcr p15, 0, %0, c9, c12, 5" : : "r" ( value ) : "memory"
9346 );
9347}
9348
9349/* PMSWINC, Performance Monitors Software Increment Register */
9350
9351static inline void _AArch32_Write_pmswinc( uint32_t value )
9352{
9353 __asm__ volatile (
9354 "mcr p15, 0, %0, c9, c12, 4" : : "r" ( value ) : "memory"
9355 );
9356}
9357
9358/* PMUSERENR, Performance Monitors User Enable Register */
9359
9360#define AARCH32_PMUSERENR_EN 0x1U
9361
9362#define AARCH32_PMUSERENR_SW 0x2U
9363
9364#define AARCH32_PMUSERENR_CR 0x4U
9365
9366#define AARCH32_PMUSERENR_ER 0x8U
9367
9368static inline uint32_t _AArch32_Read_pmuserenr( void )
9369{
9370 uint32_t value;
9371
9372 __asm__ volatile (
9373 "mrc p15, 0, %0, c9, c14, 0" : "=&r" ( value ) : : "memory"
9374 );
9375
9376 return value;
9377}
9378
9379static inline void _AArch32_Write_pmuserenr( uint32_t value )
9380{
9381 __asm__ volatile (
9382 "mcr p15, 0, %0, c9, c14, 0" : : "r" ( value ) : "memory"
9383 );
9384}
9385
9386/* PMXEVCNTR, Performance Monitors Selected Event Count Register */
9387
9388static inline uint32_t _AArch32_Read_pmxevcntr( void )
9389{
9390 uint32_t value;
9391
9392 __asm__ volatile (
9393 "mrc p15, 0, %0, c9, c13, 2" : "=&r" ( value ) : : "memory"
9394 );
9395
9396 return value;
9397}
9398
9399static inline void _AArch32_Write_pmxevcntr( uint32_t value )
9400{
9401 __asm__ volatile (
9402 "mcr p15, 0, %0, c9, c13, 2" : : "r" ( value ) : "memory"
9403 );
9404}
9405
9406/* PMXEVTYPER, Performance Monitors Selected Event Type Register */
9407
9408static inline uint32_t _AArch32_Read_pmxevtyper( void )
9409{
9410 uint32_t value;
9411
9412 __asm__ volatile (
9413 "mrc p15, 0, %0, c9, c13, 1" : "=&r" ( value ) : : "memory"
9414 );
9415
9416 return value;
9417}
9418
9419static inline void _AArch32_Write_pmxevtyper( uint32_t value )
9420{
9421 __asm__ volatile (
9422 "mcr p15, 0, %0, c9, c13, 1" : : "r" ( value ) : "memory"
9423 );
9424}
9425
9426/* AMCFGR, Activity Monitors Configuration Register */
9427
9428#define AARCH32_AMCFGR_N( _val ) ( ( _val ) << 0 )
9429#define AARCH32_AMCFGR_N_SHIFT 0
9430#define AARCH32_AMCFGR_N_MASK 0xffU
9431#define AARCH32_AMCFGR_N_GET( _reg ) \
9432 ( ( ( _reg ) >> 0 ) & 0xffU )
9433
9434#define AARCH32_AMCFGR_SIZE( _val ) ( ( _val ) << 8 )
9435#define AARCH32_AMCFGR_SIZE_SHIFT 8
9436#define AARCH32_AMCFGR_SIZE_MASK 0x3f00U
9437#define AARCH32_AMCFGR_SIZE_GET( _reg ) \
9438 ( ( ( _reg ) >> 8 ) & 0x3fU )
9439
9440#define AARCH32_AMCFGR_HDBG 0x1000000U
9441
9442#define AARCH32_AMCFGR_NCG( _val ) ( ( _val ) << 28 )
9443#define AARCH32_AMCFGR_NCG_SHIFT 28
9444#define AARCH32_AMCFGR_NCG_MASK 0xf0000000U
9445#define AARCH32_AMCFGR_NCG_GET( _reg ) \
9446 ( ( ( _reg ) >> 28 ) & 0xfU )
9447
9448static inline uint32_t _AArch32_Read_amcfgr( void )
9449{
9450 uint32_t value;
9451
9452 __asm__ volatile (
9453 "mrc p15, 0, %0, c13, c2, 1" : "=&r" ( value ) : : "memory"
9454 );
9455
9456 return value;
9457}
9458
9459/* AMCGCR, Activity Monitors Counter Group Configuration Register */
9460
9461#define AARCH32_AMCGCR_CG0NC( _val ) ( ( _val ) << 0 )
9462#define AARCH32_AMCGCR_CG0NC_SHIFT 0
9463#define AARCH32_AMCGCR_CG0NC_MASK 0xffU
9464#define AARCH32_AMCGCR_CG0NC_GET( _reg ) \
9465 ( ( ( _reg ) >> 0 ) & 0xffU )
9466
9467#define AARCH32_AMCGCR_CG1NC( _val ) ( ( _val ) << 8 )
9468#define AARCH32_AMCGCR_CG1NC_SHIFT 8
9469#define AARCH32_AMCGCR_CG1NC_MASK 0xff00U
9470#define AARCH32_AMCGCR_CG1NC_GET( _reg ) \
9471 ( ( ( _reg ) >> 8 ) & 0xffU )
9472
9473static inline uint32_t _AArch32_Read_amcgcr( void )
9474{
9475 uint32_t value;
9476
9477 __asm__ volatile (
9478 "mrc p15, 0, %0, c13, c2, 2" : "=&r" ( value ) : : "memory"
9479 );
9480
9481 return value;
9482}
9483
9484/* AMCNTENCLR0, Activity Monitors Count Enable Clear Register 0 */
9485
9486static inline uint32_t _AArch32_Read_amcntenclr0( void )
9487{
9488 uint32_t value;
9489
9490 __asm__ volatile (
9491 "mrc p15, 0, %0, c13, c2, 4" : "=&r" ( value ) : : "memory"
9492 );
9493
9494 return value;
9495}
9496
9497static inline void _AArch32_Write_amcntenclr0( uint32_t value )
9498{
9499 __asm__ volatile (
9500 "mcr p15, 0, %0, c13, c2, 4" : : "r" ( value ) : "memory"
9501 );
9502}
9503
9504/* AMCNTENCLR1, Activity Monitors Count Enable Clear Register 1 */
9505
9506static inline uint32_t _AArch32_Read_amcntenclr1( void )
9507{
9508 uint32_t value;
9509
9510 __asm__ volatile (
9511 "mrc p15, 0, %0, c13, c3, 0" : "=&r" ( value ) : : "memory"
9512 );
9513
9514 return value;
9515}
9516
9517static inline void _AArch32_Write_amcntenclr1( uint32_t value )
9518{
9519 __asm__ volatile (
9520 "mcr p15, 0, %0, c13, c3, 0" : : "r" ( value ) : "memory"
9521 );
9522}
9523
9524/* AMCNTENSET0, Activity Monitors Count Enable Set Register 0 */
9525
9526static inline uint32_t _AArch32_Read_amcntenset0( void )
9527{
9528 uint32_t value;
9529
9530 __asm__ volatile (
9531 "mrc p15, 0, %0, c13, c2, 5" : "=&r" ( value ) : : "memory"
9532 );
9533
9534 return value;
9535}
9536
9537static inline void _AArch32_Write_amcntenset0( uint32_t value )
9538{
9539 __asm__ volatile (
9540 "mcr p15, 0, %0, c13, c2, 5" : : "r" ( value ) : "memory"
9541 );
9542}
9543
9544/* AMCNTENSET1, Activity Monitors Count Enable Set Register 1 */
9545
9546static inline uint32_t _AArch32_Read_amcntenset1( void )
9547{
9548 uint32_t value;
9549
9550 __asm__ volatile (
9551 "mrc p15, 0, %0, c13, c3, 1" : "=&r" ( value ) : : "memory"
9552 );
9553
9554 return value;
9555}
9556
9557static inline void _AArch32_Write_amcntenset1( uint32_t value )
9558{
9559 __asm__ volatile (
9560 "mcr p15, 0, %0, c13, c3, 1" : : "r" ( value ) : "memory"
9561 );
9562}
9563
9564/* AMCR, Activity Monitors Control Register */
9565
9566#define AARCH32_AMCR_HDBG 0x400U
9567
9568#define AARCH32_AMCR_CG1RZ 0x20000U
9569
9570static inline uint32_t _AArch32_Read_amcr( void )
9571{
9572 uint32_t value;
9573
9574 __asm__ volatile (
9575 "mrc p15, 0, %0, c13, c2, 0" : "=&r" ( value ) : : "memory"
9576 );
9577
9578 return value;
9579}
9580
9581static inline void _AArch32_Write_amcr( uint32_t value )
9582{
9583 __asm__ volatile (
9584 "mcr p15, 0, %0, c13, c2, 0" : : "r" ( value ) : "memory"
9585 );
9586}
9587
9588/* AMEVCNTR0, Activity Monitors Event Counter Registers 0 */
9589
9590#define AARCH32_AMEVCNTR0_ACNT( _val ) ( ( _val ) << 0 )
9591#define AARCH32_AMEVCNTR0_ACNT_SHIFT 0
9592#define AARCH32_AMEVCNTR0_ACNT_MASK 0xffffffffffffffffULL
9593#define AARCH32_AMEVCNTR0_ACNT_GET( _reg ) \
9594 ( ( ( _reg ) >> 0 ) & 0xffffffffffffffffULL )
9595
9596/* AMEVCNTR0_0, Activity Monitors Event Counter Registers 0 */
9597
9598static inline uint64_t _AArch32_Read_amevcntr0_0( void )
9599{
9600 uint64_t value;
9601
9602 __asm__ volatile (
9603 "mrrc p15, 0, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9604 );
9605
9606 return value;
9607}
9608
9609static inline void _AArch32_Write_amevcntr0_0( uint64_t value )
9610{
9611 __asm__ volatile (
9612 "mcrr p15, 0, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9613 );
9614}
9615
9616/* AMEVCNTR0_1, Activity Monitors Event Counter Registers 0 */
9617
9618static inline uint64_t _AArch32_Read_amevcntr0_1( void )
9619{
9620 uint64_t value;
9621
9622 __asm__ volatile (
9623 "mrrc p15, 1, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9624 );
9625
9626 return value;
9627}
9628
9629static inline void _AArch32_Write_amevcntr0_1( uint64_t value )
9630{
9631 __asm__ volatile (
9632 "mcrr p15, 1, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9633 );
9634}
9635
9636/* AMEVCNTR0_2, Activity Monitors Event Counter Registers 0 */
9637
9638static inline uint64_t _AArch32_Read_amevcntr0_2( void )
9639{
9640 uint64_t value;
9641
9642 __asm__ volatile (
9643 "mrrc p15, 2, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9644 );
9645
9646 return value;
9647}
9648
9649static inline void _AArch32_Write_amevcntr0_2( uint64_t value )
9650{
9651 __asm__ volatile (
9652 "mcrr p15, 2, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9653 );
9654}
9655
9656/* AMEVCNTR0_3, Activity Monitors Event Counter Registers 0 */
9657
9658static inline uint64_t _AArch32_Read_amevcntr0_3( void )
9659{
9660 uint64_t value;
9661
9662 __asm__ volatile (
9663 "mrrc p15, 3, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9664 );
9665
9666 return value;
9667}
9668
9669static inline void _AArch32_Write_amevcntr0_3( uint64_t value )
9670{
9671 __asm__ volatile (
9672 "mcrr p15, 3, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9673 );
9674}
9675
9676/* AMEVCNTR0_4, Activity Monitors Event Counter Registers 0 */
9677
9678static inline uint64_t _AArch32_Read_amevcntr0_4( void )
9679{
9680 uint64_t value;
9681
9682 __asm__ volatile (
9683 "mrrc p15, 4, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9684 );
9685
9686 return value;
9687}
9688
9689static inline void _AArch32_Write_amevcntr0_4( uint64_t value )
9690{
9691 __asm__ volatile (
9692 "mcrr p15, 4, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9693 );
9694}
9695
9696/* AMEVCNTR0_5, Activity Monitors Event Counter Registers 0 */
9697
9698static inline uint64_t _AArch32_Read_amevcntr0_5( void )
9699{
9700 uint64_t value;
9701
9702 __asm__ volatile (
9703 "mrrc p15, 5, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9704 );
9705
9706 return value;
9707}
9708
9709static inline void _AArch32_Write_amevcntr0_5( uint64_t value )
9710{
9711 __asm__ volatile (
9712 "mcrr p15, 5, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9713 );
9714}
9715
9716/* AMEVCNTR0_6, Activity Monitors Event Counter Registers 0 */
9717
9718static inline uint64_t _AArch32_Read_amevcntr0_6( void )
9719{
9720 uint64_t value;
9721
9722 __asm__ volatile (
9723 "mrrc p15, 6, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9724 );
9725
9726 return value;
9727}
9728
9729static inline void _AArch32_Write_amevcntr0_6( uint64_t value )
9730{
9731 __asm__ volatile (
9732 "mcrr p15, 6, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9733 );
9734}
9735
9736/* AMEVCNTR0_7, Activity Monitors Event Counter Registers 0 */
9737
9738static inline uint64_t _AArch32_Read_amevcntr0_7( void )
9739{
9740 uint64_t value;
9741
9742 __asm__ volatile (
9743 "mrrc p15, 7, %Q0, %R0, c0" : "=&r" ( value ) : : "memory"
9744 );
9745
9746 return value;
9747}
9748
9749static inline void _AArch32_Write_amevcntr0_7( uint64_t value )
9750{
9751 __asm__ volatile (
9752 "mcrr p15, 7, %Q0, %R0, c0" : : "r" ( value ) : "memory"
9753 );
9754}
9755
9756/* AMEVCNTR0_8, Activity Monitors Event Counter Registers 0 */
9757
9758static inline uint64_t _AArch32_Read_amevcntr0_8( void )
9759{
9760 uint64_t value;
9761
9762 __asm__ volatile (
9763 "mrrc p15, 0, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9764 );
9765
9766 return value;
9767}
9768
9769static inline void _AArch32_Write_amevcntr0_8( uint64_t value )
9770{
9771 __asm__ volatile (
9772 "mcrr p15, 0, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9773 );
9774}
9775
9776/* AMEVCNTR0_9, Activity Monitors Event Counter Registers 0 */
9777
9778static inline uint64_t _AArch32_Read_amevcntr0_9( void )
9779{
9780 uint64_t value;
9781
9782 __asm__ volatile (
9783 "mrrc p15, 1, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9784 );
9785
9786 return value;
9787}
9788
9789static inline void _AArch32_Write_amevcntr0_9( uint64_t value )
9790{
9791 __asm__ volatile (
9792 "mcrr p15, 1, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9793 );
9794}
9795
9796/* AMEVCNTR0_10, Activity Monitors Event Counter Registers 0 */
9797
9798static inline uint64_t _AArch32_Read_amevcntr0_10( void )
9799{
9800 uint64_t value;
9801
9802 __asm__ volatile (
9803 "mrrc p15, 2, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9804 );
9805
9806 return value;
9807}
9808
9809static inline void _AArch32_Write_amevcntr0_10( uint64_t value )
9810{
9811 __asm__ volatile (
9812 "mcrr p15, 2, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9813 );
9814}
9815
9816/* AMEVCNTR0_11, Activity Monitors Event Counter Registers 0 */
9817
9818static inline uint64_t _AArch32_Read_amevcntr0_11( void )
9819{
9820 uint64_t value;
9821
9822 __asm__ volatile (
9823 "mrrc p15, 3, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9824 );
9825
9826 return value;
9827}
9828
9829static inline void _AArch32_Write_amevcntr0_11( uint64_t value )
9830{
9831 __asm__ volatile (
9832 "mcrr p15, 3, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9833 );
9834}
9835
9836/* AMEVCNTR0_12, Activity Monitors Event Counter Registers 0 */
9837
9838static inline uint64_t _AArch32_Read_amevcntr0_12( void )
9839{
9840 uint64_t value;
9841
9842 __asm__ volatile (
9843 "mrrc p15, 4, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9844 );
9845
9846 return value;
9847}
9848
9849static inline void _AArch32_Write_amevcntr0_12( uint64_t value )
9850{
9851 __asm__ volatile (
9852 "mcrr p15, 4, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9853 );
9854}
9855
9856/* AMEVCNTR0_13, Activity Monitors Event Counter Registers 0 */
9857
9858static inline uint64_t _AArch32_Read_amevcntr0_13( void )
9859{
9860 uint64_t value;
9861
9862 __asm__ volatile (
9863 "mrrc p15, 5, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9864 );
9865
9866 return value;
9867}
9868
9869static inline void _AArch32_Write_amevcntr0_13( uint64_t value )
9870{
9871 __asm__ volatile (
9872 "mcrr p15, 5, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9873 );
9874}
9875
9876/* AMEVCNTR0_14, Activity Monitors Event Counter Registers 0 */
9877
9878static inline uint64_t _AArch32_Read_amevcntr0_14( void )
9879{
9880 uint64_t value;
9881
9882 __asm__ volatile (
9883 "mrrc p15, 6, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9884 );
9885
9886 return value;
9887}
9888
9889static inline void _AArch32_Write_amevcntr0_14( uint64_t value )
9890{
9891 __asm__ volatile (
9892 "mcrr p15, 6, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9893 );
9894}
9895
9896/* AMEVCNTR0_15, Activity Monitors Event Counter Registers 0 */
9897
9898static inline uint64_t _AArch32_Read_amevcntr0_15( void )
9899{
9900 uint64_t value;
9901
9902 __asm__ volatile (
9903 "mrrc p15, 7, %Q0, %R0, c1" : "=&r" ( value ) : : "memory"
9904 );
9905
9906 return value;
9907}
9908
9909static inline void _AArch32_Write_amevcntr0_15( uint64_t value )
9910{
9911 __asm__ volatile (
9912 "mcrr p15, 7, %Q0, %R0, c1" : : "r" ( value ) : "memory"
9913 );
9914}
9915
9916/* AMEVCNTR1, Activity Monitors Event Counter Registers 1 */
9917
9918#define AARCH32_AMEVCNTR1_ACNT( _val ) ( ( _val ) << 0 )
9919#define AARCH32_AMEVCNTR1_ACNT_SHIFT 0
9920#define AARCH32_AMEVCNTR1_ACNT_MASK 0xffffffffffffffffULL
9921#define AARCH32_AMEVCNTR1_ACNT_GET( _reg ) \
9922 ( ( ( _reg ) >> 0 ) & 0xffffffffffffffffULL )
9923
9924/* AMEVCNTR1_0, Activity Monitors Event Counter Registers 1 */
9925
9926static inline uint64_t _AArch32_Read_amevcntr1_0( void )
9927{
9928 uint64_t value;
9929
9930 __asm__ volatile (
9931 "mrrc p15, 0, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
9932 );
9933
9934 return value;
9935}
9936
9937static inline void _AArch32_Write_amevcntr1_0( uint64_t value )
9938{
9939 __asm__ volatile (
9940 "mcrr p15, 0, %Q0, %R0, c4" : : "r" ( value ) : "memory"
9941 );
9942}
9943
9944/* AMEVCNTR1_1, Activity Monitors Event Counter Registers 1 */
9945
9946static inline uint64_t _AArch32_Read_amevcntr1_1( void )
9947{
9948 uint64_t value;
9949
9950 __asm__ volatile (
9951 "mrrc p15, 1, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
9952 );
9953
9954 return value;
9955}
9956
9957static inline void _AArch32_Write_amevcntr1_1( uint64_t value )
9958{
9959 __asm__ volatile (
9960 "mcrr p15, 1, %Q0, %R0, c4" : : "r" ( value ) : "memory"
9961 );
9962}
9963
9964/* AMEVCNTR1_2, Activity Monitors Event Counter Registers 1 */
9965
9966static inline uint64_t _AArch32_Read_amevcntr1_2( void )
9967{
9968 uint64_t value;
9969
9970 __asm__ volatile (
9971 "mrrc p15, 2, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
9972 );
9973
9974 return value;
9975}
9976
9977static inline void _AArch32_Write_amevcntr1_2( uint64_t value )
9978{
9979 __asm__ volatile (
9980 "mcrr p15, 2, %Q0, %R0, c4" : : "r" ( value ) : "memory"
9981 );
9982}
9983
9984/* AMEVCNTR1_3, Activity Monitors Event Counter Registers 1 */
9985
9986static inline uint64_t _AArch32_Read_amevcntr1_3( void )
9987{
9988 uint64_t value;
9989
9990 __asm__ volatile (
9991 "mrrc p15, 3, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
9992 );
9993
9994 return value;
9995}
9996
9997static inline void _AArch32_Write_amevcntr1_3( uint64_t value )
9998{
9999 __asm__ volatile (
10000 "mcrr p15, 3, %Q0, %R0, c4" : : "r" ( value ) : "memory"
10001 );
10002}
10003
10004/* AMEVCNTR1_4, Activity Monitors Event Counter Registers 1 */
10005
10006static inline uint64_t _AArch32_Read_amevcntr1_4( void )
10007{
10008 uint64_t value;
10009
10010 __asm__ volatile (
10011 "mrrc p15, 4, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
10012 );
10013
10014 return value;
10015}
10016
10017static inline void _AArch32_Write_amevcntr1_4( uint64_t value )
10018{
10019 __asm__ volatile (
10020 "mcrr p15, 4, %Q0, %R0, c4" : : "r" ( value ) : "memory"
10021 );
10022}
10023
10024/* AMEVCNTR1_5, Activity Monitors Event Counter Registers 1 */
10025
10026static inline uint64_t _AArch32_Read_amevcntr1_5( void )
10027{
10028 uint64_t value;
10029
10030 __asm__ volatile (
10031 "mrrc p15, 5, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
10032 );
10033
10034 return value;
10035}
10036
10037static inline void _AArch32_Write_amevcntr1_5( uint64_t value )
10038{
10039 __asm__ volatile (
10040 "mcrr p15, 5, %Q0, %R0, c4" : : "r" ( value ) : "memory"
10041 );
10042}
10043
10044/* AMEVCNTR1_6, Activity Monitors Event Counter Registers 1 */
10045
10046static inline uint64_t _AArch32_Read_amevcntr1_6( void )
10047{
10048 uint64_t value;
10049
10050 __asm__ volatile (
10051 "mrrc p15, 6, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
10052 );
10053
10054 return value;
10055}
10056
10057static inline void _AArch32_Write_amevcntr1_6( uint64_t value )
10058{
10059 __asm__ volatile (
10060 "mcrr p15, 6, %Q0, %R0, c4" : : "r" ( value ) : "memory"
10061 );
10062}
10063
10064/* AMEVCNTR1_7, Activity Monitors Event Counter Registers 1 */
10065
10066static inline uint64_t _AArch32_Read_amevcntr1_7( void )
10067{
10068 uint64_t value;
10069
10070 __asm__ volatile (
10071 "mrrc p15, 7, %Q0, %R0, c4" : "=&r" ( value ) : : "memory"
10072 );
10073
10074 return value;
10075}
10076
10077static inline void _AArch32_Write_amevcntr1_7( uint64_t value )
10078{
10079 __asm__ volatile (
10080 "mcrr p15, 7, %Q0, %R0, c4" : : "r" ( value ) : "memory"
10081 );
10082}
10083
10084/* AMEVCNTR1_8, Activity Monitors Event Counter Registers 1 */
10085
10086static inline uint64_t _AArch32_Read_amevcntr1_8( void )
10087{
10088 uint64_t value;
10089
10090 __asm__ volatile (
10091 "mrrc p15, 0, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10092 );
10093
10094 return value;
10095}
10096
10097static inline void _AArch32_Write_amevcntr1_8( uint64_t value )
10098{
10099 __asm__ volatile (
10100 "mcrr p15, 0, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10101 );
10102}
10103
10104/* AMEVCNTR1_9, Activity Monitors Event Counter Registers 1 */
10105
10106static inline uint64_t _AArch32_Read_amevcntr1_9( void )
10107{
10108 uint64_t value;
10109
10110 __asm__ volatile (
10111 "mrrc p15, 1, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10112 );
10113
10114 return value;
10115}
10116
10117static inline void _AArch32_Write_amevcntr1_9( uint64_t value )
10118{
10119 __asm__ volatile (
10120 "mcrr p15, 1, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10121 );
10122}
10123
10124/* AMEVCNTR1_10, Activity Monitors Event Counter Registers 1 */
10125
10126static inline uint64_t _AArch32_Read_amevcntr1_10( void )
10127{
10128 uint64_t value;
10129
10130 __asm__ volatile (
10131 "mrrc p15, 2, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10132 );
10133
10134 return value;
10135}
10136
10137static inline void _AArch32_Write_amevcntr1_10( uint64_t value )
10138{
10139 __asm__ volatile (
10140 "mcrr p15, 2, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10141 );
10142}
10143
10144/* AMEVCNTR1_11, Activity Monitors Event Counter Registers 1 */
10145
10146static inline uint64_t _AArch32_Read_amevcntr1_11( void )
10147{
10148 uint64_t value;
10149
10150 __asm__ volatile (
10151 "mrrc p15, 3, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10152 );
10153
10154 return value;
10155}
10156
10157static inline void _AArch32_Write_amevcntr1_11( uint64_t value )
10158{
10159 __asm__ volatile (
10160 "mcrr p15, 3, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10161 );
10162}
10163
10164/* AMEVCNTR1_12, Activity Monitors Event Counter Registers 1 */
10165
10166static inline uint64_t _AArch32_Read_amevcntr1_12( void )
10167{
10168 uint64_t value;
10169
10170 __asm__ volatile (
10171 "mrrc p15, 4, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10172 );
10173
10174 return value;
10175}
10176
10177static inline void _AArch32_Write_amevcntr1_12( uint64_t value )
10178{
10179 __asm__ volatile (
10180 "mcrr p15, 4, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10181 );
10182}
10183
10184/* AMEVCNTR1_13, Activity Monitors Event Counter Registers 1 */
10185
10186static inline uint64_t _AArch32_Read_amevcntr1_13( void )
10187{
10188 uint64_t value;
10189
10190 __asm__ volatile (
10191 "mrrc p15, 5, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10192 );
10193
10194 return value;
10195}
10196
10197static inline void _AArch32_Write_amevcntr1_13( uint64_t value )
10198{
10199 __asm__ volatile (
10200 "mcrr p15, 5, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10201 );
10202}
10203
10204/* AMEVCNTR1_14, Activity Monitors Event Counter Registers 1 */
10205
10206static inline uint64_t _AArch32_Read_amevcntr1_14( void )
10207{
10208 uint64_t value;
10209
10210 __asm__ volatile (
10211 "mrrc p15, 6, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10212 );
10213
10214 return value;
10215}
10216
10217static inline void _AArch32_Write_amevcntr1_14( uint64_t value )
10218{
10219 __asm__ volatile (
10220 "mcrr p15, 6, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10221 );
10222}
10223
10224/* AMEVCNTR1_15, Activity Monitors Event Counter Registers 1 */
10225
10226static inline uint64_t _AArch32_Read_amevcntr1_15( void )
10227{
10228 uint64_t value;
10229
10230 __asm__ volatile (
10231 "mrrc p15, 7, %Q0, %R0, c5" : "=&r" ( value ) : : "memory"
10232 );
10233
10234 return value;
10235}
10236
10237static inline void _AArch32_Write_amevcntr1_15( uint64_t value )
10238{
10239 __asm__ volatile (
10240 "mcrr p15, 7, %Q0, %R0, c5" : : "r" ( value ) : "memory"
10241 );
10242}
10243
10244/* AMEVTYPER0, Activity Monitors Event Type Registers 0 */
10245
10246#define AARCH32_AMEVTYPER0_EVTCOUNT( _val ) ( ( _val ) << 0 )
10247#define AARCH32_AMEVTYPER0_EVTCOUNT_SHIFT 0
10248#define AARCH32_AMEVTYPER0_EVTCOUNT_MASK 0xffffU
10249#define AARCH32_AMEVTYPER0_EVTCOUNT_GET( _reg ) \
10250 ( ( ( _reg ) >> 0 ) & 0xffffU )
10251
10252/* AMEVTYPER0_0, Activity Monitors Event Type Registers 0 */
10253
10254static inline uint32_t _AArch32_Read_amevtyper0_0( void )
10255{
10256 uint32_t value;
10257
10258 __asm__ volatile (
10259 "mrc p15, 0, %0, c13, c6, 0" : "=&r" ( value ) : : "memory"
10260 );
10261
10262 return value;
10263}
10264
10265/* AMEVTYPER0_1, Activity Monitors Event Type Registers 0 */
10266
10267static inline uint32_t _AArch32_Read_amevtyper0_1( void )
10268{
10269 uint32_t value;
10270
10271 __asm__ volatile (
10272 "mrc p15, 0, %0, c13, c6, 1" : "=&r" ( value ) : : "memory"
10273 );
10274
10275 return value;
10276}
10277
10278/* AMEVTYPER0_2, Activity Monitors Event Type Registers 0 */
10279
10280static inline uint32_t _AArch32_Read_amevtyper0_2( void )
10281{
10282 uint32_t value;
10283
10284 __asm__ volatile (
10285 "mrc p15, 0, %0, c13, c6, 2" : "=&r" ( value ) : : "memory"
10286 );
10287
10288 return value;
10289}
10290
10291/* AMEVTYPER0_3, Activity Monitors Event Type Registers 0 */
10292
10293static inline uint32_t _AArch32_Read_amevtyper0_3( void )
10294{
10295 uint32_t value;
10296
10297 __asm__ volatile (
10298 "mrc p15, 0, %0, c13, c6, 3" : "=&r" ( value ) : : "memory"
10299 );
10300
10301 return value;
10302}
10303
10304/* AMEVTYPER0_4, Activity Monitors Event Type Registers 0 */
10305
10306static inline uint32_t _AArch32_Read_amevtyper0_4( void )
10307{
10308 uint32_t value;
10309
10310 __asm__ volatile (
10311 "mrc p15, 0, %0, c13, c6, 4" : "=&r" ( value ) : : "memory"
10312 );
10313
10314 return value;
10315}
10316
10317/* AMEVTYPER0_5, Activity Monitors Event Type Registers 0 */
10318
10319static inline uint32_t _AArch32_Read_amevtyper0_5( void )
10320{
10321 uint32_t value;
10322
10323 __asm__ volatile (
10324 "mrc p15, 0, %0, c13, c6, 5" : "=&r" ( value ) : : "memory"
10325 );
10326
10327 return value;
10328}
10329
10330/* AMEVTYPER0_6, Activity Monitors Event Type Registers 0 */
10331
10332static inline uint32_t _AArch32_Read_amevtyper0_6( void )
10333{
10334 uint32_t value;
10335
10336 __asm__ volatile (
10337 "mrc p15, 0, %0, c13, c6, 6" : "=&r" ( value ) : : "memory"
10338 );
10339
10340 return value;
10341}
10342
10343/* AMEVTYPER0_7, Activity Monitors Event Type Registers 0 */
10344
10345static inline uint32_t _AArch32_Read_amevtyper0_7( void )
10346{
10347 uint32_t value;
10348
10349 __asm__ volatile (
10350 "mrc p15, 0, %0, c13, c6, 7" : "=&r" ( value ) : : "memory"
10351 );
10352
10353 return value;
10354}
10355
10356/* AMEVTYPER0_8, Activity Monitors Event Type Registers 0 */
10357
10358static inline uint32_t _AArch32_Read_amevtyper0_8( void )
10359{
10360 uint32_t value;
10361
10362 __asm__ volatile (
10363 "mrc p15, 0, %0, c13, c7, 0" : "=&r" ( value ) : : "memory"
10364 );
10365
10366 return value;
10367}
10368
10369/* AMEVTYPER0_9, Activity Monitors Event Type Registers 0 */
10370
10371static inline uint32_t _AArch32_Read_amevtyper0_9( void )
10372{
10373 uint32_t value;
10374
10375 __asm__ volatile (
10376 "mrc p15, 0, %0, c13, c7, 1" : "=&r" ( value ) : : "memory"
10377 );
10378
10379 return value;
10380}
10381
10382/* AMEVTYPER0_10, Activity Monitors Event Type Registers 0 */
10383
10384static inline uint32_t _AArch32_Read_amevtyper0_10( void )
10385{
10386 uint32_t value;
10387
10388 __asm__ volatile (
10389 "mrc p15, 0, %0, c13, c7, 2" : "=&r" ( value ) : : "memory"
10390 );
10391
10392 return value;
10393}
10394
10395/* AMEVTYPER0_11, Activity Monitors Event Type Registers 0 */
10396
10397static inline uint32_t _AArch32_Read_amevtyper0_11( void )
10398{
10399 uint32_t value;
10400
10401 __asm__ volatile (
10402 "mrc p15, 0, %0, c13, c7, 3" : "=&r" ( value ) : : "memory"
10403 );
10404
10405 return value;
10406}
10407
10408/* AMEVTYPER0_12, Activity Monitors Event Type Registers 0 */
10409
10410static inline uint32_t _AArch32_Read_amevtyper0_12( void )
10411{
10412 uint32_t value;
10413
10414 __asm__ volatile (
10415 "mrc p15, 0, %0, c13, c7, 4" : "=&r" ( value ) : : "memory"
10416 );
10417
10418 return value;
10419}
10420
10421/* AMEVTYPER0_13, Activity Monitors Event Type Registers 0 */
10422
10423static inline uint32_t _AArch32_Read_amevtyper0_13( void )
10424{
10425 uint32_t value;
10426
10427 __asm__ volatile (
10428 "mrc p15, 0, %0, c13, c7, 5" : "=&r" ( value ) : : "memory"
10429 );
10430
10431 return value;
10432}
10433
10434/* AMEVTYPER0_14, Activity Monitors Event Type Registers 0 */
10435
10436static inline uint32_t _AArch32_Read_amevtyper0_14( void )
10437{
10438 uint32_t value;
10439
10440 __asm__ volatile (
10441 "mrc p15, 0, %0, c13, c7, 6" : "=&r" ( value ) : : "memory"
10442 );
10443
10444 return value;
10445}
10446
10447/* AMEVTYPER0_15, Activity Monitors Event Type Registers 0 */
10448
10449static inline uint32_t _AArch32_Read_amevtyper0_15( void )
10450{
10451 uint32_t value;
10452
10453 __asm__ volatile (
10454 "mrc p15, 0, %0, c13, c7, 7" : "=&r" ( value ) : : "memory"
10455 );
10456
10457 return value;
10458}
10459
10460/* AMEVTYPER1, Activity Monitors Event Type Registers 1 */
10461
10462#define AARCH32_AMEVTYPER1_EVTCOUNT( _val ) ( ( _val ) << 0 )
10463#define AARCH32_AMEVTYPER1_EVTCOUNT_SHIFT 0
10464#define AARCH32_AMEVTYPER1_EVTCOUNT_MASK 0xffffU
10465#define AARCH32_AMEVTYPER1_EVTCOUNT_GET( _reg ) \
10466 ( ( ( _reg ) >> 0 ) & 0xffffU )
10467
10468/* AMEVTYPER1_0, Activity Monitors Event Type Registers 1 */
10469
10470static inline uint32_t _AArch32_Read_amevtyper1_0( void )
10471{
10472 uint32_t value;
10473
10474 __asm__ volatile (
10475 "mrc p15, 0, %0, c13, c14, 0" : "=&r" ( value ) : : "memory"
10476 );
10477
10478 return value;
10479}
10480
10481static inline void _AArch32_Write_amevtyper1_0( uint32_t value )
10482{
10483 __asm__ volatile (
10484 "mcr p15, 0, %0, c13, c14, 0" : : "r" ( value ) : "memory"
10485 );
10486}
10487
10488/* AMEVTYPER1_1, Activity Monitors Event Type Registers 1 */
10489
10490static inline uint32_t _AArch32_Read_amevtyper1_1( void )
10491{
10492 uint32_t value;
10493
10494 __asm__ volatile (
10495 "mrc p15, 0, %0, c13, c14, 1" : "=&r" ( value ) : : "memory"
10496 );
10497
10498 return value;
10499}
10500
10501static inline void _AArch32_Write_amevtyper1_1( uint32_t value )
10502{
10503 __asm__ volatile (
10504 "mcr p15, 0, %0, c13, c14, 1" : : "r" ( value ) : "memory"
10505 );
10506}
10507
10508/* AMEVTYPER1_2, Activity Monitors Event Type Registers 1 */
10509
10510static inline uint32_t _AArch32_Read_amevtyper1_2( void )
10511{
10512 uint32_t value;
10513
10514 __asm__ volatile (
10515 "mrc p15, 0, %0, c13, c14, 2" : "=&r" ( value ) : : "memory"
10516 );
10517
10518 return value;
10519}
10520
10521static inline void _AArch32_Write_amevtyper1_2( uint32_t value )
10522{
10523 __asm__ volatile (
10524 "mcr p15, 0, %0, c13, c14, 2" : : "r" ( value ) : "memory"
10525 );
10526}
10527
10528/* AMEVTYPER1_3, Activity Monitors Event Type Registers 1 */
10529
10530static inline uint32_t _AArch32_Read_amevtyper1_3( void )
10531{
10532 uint32_t value;
10533
10534 __asm__ volatile (
10535 "mrc p15, 0, %0, c13, c14, 3" : "=&r" ( value ) : : "memory"
10536 );
10537
10538 return value;
10539}
10540
10541static inline void _AArch32_Write_amevtyper1_3( uint32_t value )
10542{
10543 __asm__ volatile (
10544 "mcr p15, 0, %0, c13, c14, 3" : : "r" ( value ) : "memory"
10545 );
10546}
10547
10548/* AMEVTYPER1_4, Activity Monitors Event Type Registers 1 */
10549
10550static inline uint32_t _AArch32_Read_amevtyper1_4( void )
10551{
10552 uint32_t value;
10553
10554 __asm__ volatile (
10555 "mrc p15, 0, %0, c13, c14, 4" : "=&r" ( value ) : : "memory"
10556 );
10557
10558 return value;
10559}
10560
10561static inline void _AArch32_Write_amevtyper1_4( uint32_t value )
10562{
10563 __asm__ volatile (
10564 "mcr p15, 0, %0, c13, c14, 4" : : "r" ( value ) : "memory"
10565 );
10566}
10567
10568/* AMEVTYPER1_5, Activity Monitors Event Type Registers 1 */
10569
10570static inline uint32_t _AArch32_Read_amevtyper1_5( void )
10571{
10572 uint32_t value;
10573
10574 __asm__ volatile (
10575 "mrc p15, 0, %0, c13, c14, 5" : "=&r" ( value ) : : "memory"
10576 );
10577
10578 return value;
10579}
10580
10581static inline void _AArch32_Write_amevtyper1_5( uint32_t value )
10582{
10583 __asm__ volatile (
10584 "mcr p15, 0, %0, c13, c14, 5" : : "r" ( value ) : "memory"
10585 );
10586}
10587
10588/* AMEVTYPER1_6, Activity Monitors Event Type Registers 1 */
10589
10590static inline uint32_t _AArch32_Read_amevtyper1_6( void )
10591{
10592 uint32_t value;
10593
10594 __asm__ volatile (
10595 "mrc p15, 0, %0, c13, c14, 6" : "=&r" ( value ) : : "memory"
10596 );
10597
10598 return value;
10599}
10600
10601static inline void _AArch32_Write_amevtyper1_6( uint32_t value )
10602{
10603 __asm__ volatile (
10604 "mcr p15, 0, %0, c13, c14, 6" : : "r" ( value ) : "memory"
10605 );
10606}
10607
10608/* AMEVTYPER1_7, Activity Monitors Event Type Registers 1 */
10609
10610static inline uint32_t _AArch32_Read_amevtyper1_7( void )
10611{
10612 uint32_t value;
10613
10614 __asm__ volatile (
10615 "mrc p15, 0, %0, c13, c14, 7" : "=&r" ( value ) : : "memory"
10616 );
10617
10618 return value;
10619}
10620
10621static inline void _AArch32_Write_amevtyper1_7( uint32_t value )
10622{
10623 __asm__ volatile (
10624 "mcr p15, 0, %0, c13, c14, 7" : : "r" ( value ) : "memory"
10625 );
10626}
10627
10628/* AMEVTYPER1_8, Activity Monitors Event Type Registers 1 */
10629
10630static inline uint32_t _AArch32_Read_amevtyper1_8( void )
10631{
10632 uint32_t value;
10633
10634 __asm__ volatile (
10635 "mrc p15, 0, %0, c13, c15, 0" : "=&r" ( value ) : : "memory"
10636 );
10637
10638 return value;
10639}
10640
10641static inline void _AArch32_Write_amevtyper1_8( uint32_t value )
10642{
10643 __asm__ volatile (
10644 "mcr p15, 0, %0, c13, c15, 0" : : "r" ( value ) : "memory"
10645 );
10646}
10647
10648/* AMEVTYPER1_9, Activity Monitors Event Type Registers 1 */
10649
10650static inline uint32_t _AArch32_Read_amevtyper1_9( void )
10651{
10652 uint32_t value;
10653
10654 __asm__ volatile (
10655 "mrc p15, 0, %0, c13, c15, 1" : "=&r" ( value ) : : "memory"
10656 );
10657
10658 return value;
10659}
10660
10661static inline void _AArch32_Write_amevtyper1_9( uint32_t value )
10662{
10663 __asm__ volatile (
10664 "mcr p15, 0, %0, c13, c15, 1" : : "r" ( value ) : "memory"
10665 );
10666}
10667
10668/* AMEVTYPER1_10, Activity Monitors Event Type Registers 1 */
10669
10670static inline uint32_t _AArch32_Read_amevtyper1_10( void )
10671{
10672 uint32_t value;
10673
10674 __asm__ volatile (
10675 "mrc p15, 0, %0, c13, c15, 2" : "=&r" ( value ) : : "memory"
10676 );
10677
10678 return value;
10679}
10680
10681static inline void _AArch32_Write_amevtyper1_10( uint32_t value )
10682{
10683 __asm__ volatile (
10684 "mcr p15, 0, %0, c13, c15, 2" : : "r" ( value ) : "memory"
10685 );
10686}
10687
10688/* AMEVTYPER1_11, Activity Monitors Event Type Registers 1 */
10689
10690static inline uint32_t _AArch32_Read_amevtyper1_11( void )
10691{
10692 uint32_t value;
10693
10694 __asm__ volatile (
10695 "mrc p15, 0, %0, c13, c15, 3" : "=&r" ( value ) : : "memory"
10696 );
10697
10698 return value;
10699}
10700
10701static inline void _AArch32_Write_amevtyper1_11( uint32_t value )
10702{
10703 __asm__ volatile (
10704 "mcr p15, 0, %0, c13, c15, 3" : : "r" ( value ) : "memory"
10705 );
10706}
10707
10708/* AMEVTYPER1_12, Activity Monitors Event Type Registers 1 */
10709
10710static inline uint32_t _AArch32_Read_amevtyper1_12( void )
10711{
10712 uint32_t value;
10713
10714 __asm__ volatile (
10715 "mrc p15, 0, %0, c13, c15, 4" : "=&r" ( value ) : : "memory"
10716 );
10717
10718 return value;
10719}
10720
10721static inline void _AArch32_Write_amevtyper1_12( uint32_t value )
10722{
10723 __asm__ volatile (
10724 "mcr p15, 0, %0, c13, c15, 4" : : "r" ( value ) : "memory"
10725 );
10726}
10727
10728/* AMEVTYPER1_13, Activity Monitors Event Type Registers 1 */
10729
10730static inline uint32_t _AArch32_Read_amevtyper1_13( void )
10731{
10732 uint32_t value;
10733
10734 __asm__ volatile (
10735 "mrc p15, 0, %0, c13, c15, 5" : "=&r" ( value ) : : "memory"
10736 );
10737
10738 return value;
10739}
10740
10741static inline void _AArch32_Write_amevtyper1_13( uint32_t value )
10742{
10743 __asm__ volatile (
10744 "mcr p15, 0, %0, c13, c15, 5" : : "r" ( value ) : "memory"
10745 );
10746}
10747
10748/* AMEVTYPER1_14, Activity Monitors Event Type Registers 1 */
10749
10750static inline uint32_t _AArch32_Read_amevtyper1_14( void )
10751{
10752 uint32_t value;
10753
10754 __asm__ volatile (
10755 "mrc p15, 0, %0, c13, c15, 6" : "=&r" ( value ) : : "memory"
10756 );
10757
10758 return value;
10759}
10760
10761static inline void _AArch32_Write_amevtyper1_14( uint32_t value )
10762{
10763 __asm__ volatile (
10764 "mcr p15, 0, %0, c13, c15, 6" : : "r" ( value ) : "memory"
10765 );
10766}
10767
10768/* AMEVTYPER1_15, Activity Monitors Event Type Registers 1 */
10769
10770static inline uint32_t _AArch32_Read_amevtyper1_15( void )
10771{
10772 uint32_t value;
10773
10774 __asm__ volatile (
10775 "mrc p15, 0, %0, c13, c15, 7" : "=&r" ( value ) : : "memory"
10776 );
10777
10778 return value;
10779}
10780
10781static inline void _AArch32_Write_amevtyper1_15( uint32_t value )
10782{
10783 __asm__ volatile (
10784 "mcr p15, 0, %0, c13, c15, 7" : : "r" ( value ) : "memory"
10785 );
10786}
10787
10788/* AMUSERENR, Activity Monitors User Enable Register */
10789
10790#define AARCH32_AMUSERENR_EN 0x1U
10791
10792static inline uint32_t _AArch32_Read_amuserenr( void )
10793{
10794 uint32_t value;
10795
10796 __asm__ volatile (
10797 "mrc p15, 0, %0, c13, c2, 3" : "=&r" ( value ) : : "memory"
10798 );
10799
10800 return value;
10801}
10802
10803static inline void _AArch32_Write_amuserenr( uint32_t value )
10804{
10805 __asm__ volatile (
10806 "mcr p15, 0, %0, c13, c2, 3" : : "r" ( value ) : "memory"
10807 );
10808}
10809
10810/* DISR, Deferred Interrupt Status Register */
10811
10812#define AARCH32_DISR_FS_3_0( _val ) ( ( _val ) << 0 )
10813#define AARCH32_DISR_FS_3_0_SHIFT 0
10814#define AARCH32_DISR_FS_3_0_MASK 0xfU
10815#define AARCH32_DISR_FS_3_0_GET( _reg ) \
10816 ( ( ( _reg ) >> 0 ) & 0xfU )
10817
10818#define AARCH32_DISR_DFSC( _val ) ( ( _val ) << 0 )
10819#define AARCH32_DISR_DFSC_SHIFT 0
10820#define AARCH32_DISR_DFSC_MASK 0x3fU
10821#define AARCH32_DISR_DFSC_GET( _reg ) \
10822 ( ( ( _reg ) >> 0 ) & 0x3fU )
10823
10824#define AARCH32_DISR_STATUS( _val ) ( ( _val ) << 0 )
10825#define AARCH32_DISR_STATUS_SHIFT 0
10826#define AARCH32_DISR_STATUS_MASK 0x3fU
10827#define AARCH32_DISR_STATUS_GET( _reg ) \
10828 ( ( ( _reg ) >> 0 ) & 0x3fU )
10829
10830#define AARCH32_DISR_EA 0x200U
10831
10832#define AARCH32_DISR_LPAE 0x200U
10833
10834#define AARCH32_DISR_FS_4 0x400U
10835
10836#define AARCH32_DISR_AET_0( _val ) ( ( _val ) << 10 )
10837#define AARCH32_DISR_AET_SHIFT_0 10
10838#define AARCH32_DISR_AET_MASK_0 0xc00U
10839#define AARCH32_DISR_AET_GET_0( _reg ) \
10840 ( ( ( _reg ) >> 10 ) & 0x3U )
10841
10842#define AARCH32_DISR_EXT 0x1000U
10843
10844#define AARCH32_DISR_AET_1( _val ) ( ( _val ) << 14 )
10845#define AARCH32_DISR_AET_SHIFT_1 14
10846#define AARCH32_DISR_AET_MASK_1 0xc000U
10847#define AARCH32_DISR_AET_GET_1( _reg ) \
10848 ( ( ( _reg ) >> 14 ) & 0x3U )
10849
10850#define AARCH32_DISR_A 0x80000000U
10851
10852static inline uint32_t _AArch32_Read_disr( void )
10853{
10854 uint32_t value;
10855
10856 __asm__ volatile (
10857 "mrc p15, 0, %0, c12, c1, 1" : "=&r" ( value ) : : "memory"
10858 );
10859
10860 return value;
10861}
10862
10863static inline void _AArch32_Write_disr( uint32_t value )
10864{
10865 __asm__ volatile (
10866 "mcr p15, 0, %0, c12, c1, 1" : : "r" ( value ) : "memory"
10867 );
10868}
10869
10870/* ERRIDR, Error Record ID Register */
10871
10872#define AARCH32_ERRIDR_NUM( _val ) ( ( _val ) << 0 )
10873#define AARCH32_ERRIDR_NUM_SHIFT 0
10874#define AARCH32_ERRIDR_NUM_MASK 0xffffU
10875#define AARCH32_ERRIDR_NUM_GET( _reg ) \
10876 ( ( ( _reg ) >> 0 ) & 0xffffU )
10877
10878static inline uint32_t _AArch32_Read_erridr( void )
10879{
10880 uint32_t value;
10881
10882 __asm__ volatile (
10883 "mrc p15, 0, %0, c5, c3, 0" : "=&r" ( value ) : : "memory"
10884 );
10885
10886 return value;
10887}
10888
10889/* ERRSELR, Error Record Select Register */
10890
10891#define AARCH32_ERRSELR_SEL( _val ) ( ( _val ) << 0 )
10892#define AARCH32_ERRSELR_SEL_SHIFT 0
10893#define AARCH32_ERRSELR_SEL_MASK 0xffffU
10894#define AARCH32_ERRSELR_SEL_GET( _reg ) \
10895 ( ( ( _reg ) >> 0 ) & 0xffffU )
10896
10897static inline uint32_t _AArch32_Read_errselr( void )
10898{
10899 uint32_t value;
10900
10901 __asm__ volatile (
10902 "mrc p15, 0, %0, c5, c3, 1" : "=&r" ( value ) : : "memory"
10903 );
10904
10905 return value;
10906}
10907
10908static inline void _AArch32_Write_errselr( uint32_t value )
10909{
10910 __asm__ volatile (
10911 "mcr p15, 0, %0, c5, c3, 1" : : "r" ( value ) : "memory"
10912 );
10913}
10914
10915/* ERXADDR, Selected Error Record Address Register */
10916
10917static inline uint32_t _AArch32_Read_erxaddr( void )
10918{
10919 uint32_t value;
10920
10921 __asm__ volatile (
10922 "mrc p15, 0, %0, c5, c4, 3" : "=&r" ( value ) : : "memory"
10923 );
10924
10925 return value;
10926}
10927
10928static inline void _AArch32_Write_erxaddr( uint32_t value )
10929{
10930 __asm__ volatile (
10931 "mcr p15, 0, %0, c5, c4, 3" : : "r" ( value ) : "memory"
10932 );
10933}
10934
10935/* ERXADDR2, Selected Error Record Address Register 2 */
10936
10937static inline uint32_t _AArch32_Read_erxaddr2( void )
10938{
10939 uint32_t value;
10940
10941 __asm__ volatile (
10942 "mrc p15, 0, %0, c5, c4, 7" : "=&r" ( value ) : : "memory"
10943 );
10944
10945 return value;
10946}
10947
10948static inline void _AArch32_Write_erxaddr2( uint32_t value )
10949{
10950 __asm__ volatile (
10951 "mcr p15, 0, %0, c5, c4, 7" : : "r" ( value ) : "memory"
10952 );
10953}
10954
10955/* ERXCTLR, Selected Error Record Control Register */
10956
10957static inline uint32_t _AArch32_Read_erxctlr( void )
10958{
10959 uint32_t value;
10960
10961 __asm__ volatile (
10962 "mrc p15, 0, %0, c5, c4, 1" : "=&r" ( value ) : : "memory"
10963 );
10964
10965 return value;
10966}
10967
10968static inline void _AArch32_Write_erxctlr( uint32_t value )
10969{
10970 __asm__ volatile (
10971 "mcr p15, 0, %0, c5, c4, 1" : : "r" ( value ) : "memory"
10972 );
10973}
10974
10975/* ERXCTLR2, Selected Error Record Control Register 2 */
10976
10977static inline uint32_t _AArch32_Read_erxctlr2( void )
10978{
10979 uint32_t value;
10980
10981 __asm__ volatile (
10982 "mrc p15, 0, %0, c5, c4, 5" : "=&r" ( value ) : : "memory"
10983 );
10984
10985 return value;
10986}
10987
10988static inline void _AArch32_Write_erxctlr2( uint32_t value )
10989{
10990 __asm__ volatile (
10991 "mcr p15, 0, %0, c5, c4, 5" : : "r" ( value ) : "memory"
10992 );
10993}
10994
10995/* ERXFR, Selected Error Record Feature Register */
10996
10997static inline uint32_t _AArch32_Read_erxfr( void )
10998{
10999 uint32_t value;
11000
11001 __asm__ volatile (
11002 "mrc p15, 0, %0, c5, c4, 0" : "=&r" ( value ) : : "memory"
11003 );
11004
11005 return value;
11006}
11007
11008/* ERXFR2, Selected Error Record Feature Register 2 */
11009
11010static inline uint32_t _AArch32_Read_erxfr2( void )
11011{
11012 uint32_t value;
11013
11014 __asm__ volatile (
11015 "mrc p15, 0, %0, c5, c4, 4" : "=&r" ( value ) : : "memory"
11016 );
11017
11018 return value;
11019}
11020
11021/* ERXMISC0, Selected Error Record Miscellaneous Register 0 */
11022
11023static inline uint32_t _AArch32_Read_erxmisc0( void )
11024{
11025 uint32_t value;
11026
11027 __asm__ volatile (
11028 "mrc p15, 0, %0, c5, c5, 0" : "=&r" ( value ) : : "memory"
11029 );
11030
11031 return value;
11032}
11033
11034static inline void _AArch32_Write_erxmisc0( uint32_t value )
11035{
11036 __asm__ volatile (
11037 "mcr p15, 0, %0, c5, c5, 0" : : "r" ( value ) : "memory"
11038 );
11039}
11040
11041/* ERXMISC1, Selected Error Record Miscellaneous Register 1 */
11042
11043static inline uint32_t _AArch32_Read_erxmisc1( void )
11044{
11045 uint32_t value;
11046
11047 __asm__ volatile (
11048 "mrc p15, 0, %0, c5, c5, 1" : "=&r" ( value ) : : "memory"
11049 );
11050
11051 return value;
11052}
11053
11054static inline void _AArch32_Write_erxmisc1( uint32_t value )
11055{
11056 __asm__ volatile (
11057 "mcr p15, 0, %0, c5, c5, 1" : : "r" ( value ) : "memory"
11058 );
11059}
11060
11061/* ERXMISC2, Selected Error Record Miscellaneous Register 2 */
11062
11063static inline uint32_t _AArch32_Read_erxmisc2( void )
11064{
11065 uint32_t value;
11066
11067 __asm__ volatile (
11068 "mrc p15, 0, %0, c5, c5, 4" : "=&r" ( value ) : : "memory"
11069 );
11070
11071 return value;
11072}
11073
11074static inline void _AArch32_Write_erxmisc2( uint32_t value )
11075{
11076 __asm__ volatile (
11077 "mcr p15, 0, %0, c5, c5, 4" : : "r" ( value ) : "memory"
11078 );
11079}
11080
11081/* ERXMISC3, Selected Error Record Miscellaneous Register 3 */
11082
11083static inline uint32_t _AArch32_Read_erxmisc3( void )
11084{
11085 uint32_t value;
11086
11087 __asm__ volatile (
11088 "mrc p15, 0, %0, c5, c5, 5" : "=&r" ( value ) : : "memory"
11089 );
11090
11091 return value;
11092}
11093
11094static inline void _AArch32_Write_erxmisc3( uint32_t value )
11095{
11096 __asm__ volatile (
11097 "mcr p15, 0, %0, c5, c5, 5" : : "r" ( value ) : "memory"
11098 );
11099}
11100
11101/* ERXMISC4, Selected Error Record Miscellaneous Register 4 */
11102
11103static inline uint32_t _AArch32_Read_erxmisc4( void )
11104{
11105 uint32_t value;
11106
11107 __asm__ volatile (
11108 "mrc p15, 0, %0, c5, c5, 2" : "=&r" ( value ) : : "memory"
11109 );
11110
11111 return value;
11112}
11113
11114static inline void _AArch32_Write_erxmisc4( uint32_t value )
11115{
11116 __asm__ volatile (
11117 "mcr p15, 0, %0, c5, c5, 2" : : "r" ( value ) : "memory"
11118 );
11119}
11120
11121/* ERXMISC5, Selected Error Record Miscellaneous Register 5 */
11122
11123static inline uint32_t _AArch32_Read_erxmisc5( void )
11124{
11125 uint32_t value;
11126
11127 __asm__ volatile (
11128 "mrc p15, 0, %0, c5, c5, 3" : "=&r" ( value ) : : "memory"
11129 );
11130
11131 return value;
11132}
11133
11134static inline void _AArch32_Write_erxmisc5( uint32_t value )
11135{
11136 __asm__ volatile (
11137 "mcr p15, 0, %0, c5, c5, 3" : : "r" ( value ) : "memory"
11138 );
11139}
11140
11141/* ERXMISC6, Selected Error Record Miscellaneous Register 6 */
11142
11143static inline uint32_t _AArch32_Read_erxmisc6( void )
11144{
11145 uint32_t value;
11146
11147 __asm__ volatile (
11148 "mrc p15, 0, %0, c5, c5, 6" : "=&r" ( value ) : : "memory"
11149 );
11150
11151 return value;
11152}
11153
11154static inline void _AArch32_Write_erxmisc6( uint32_t value )
11155{
11156 __asm__ volatile (
11157 "mcr p15, 0, %0, c5, c5, 6" : : "r" ( value ) : "memory"
11158 );
11159}
11160
11161/* ERXMISC7, Selected Error Record Miscellaneous Register 7 */
11162
11163static inline uint32_t _AArch32_Read_erxmisc7( void )
11164{
11165 uint32_t value;
11166
11167 __asm__ volatile (
11168 "mrc p15, 0, %0, c5, c5, 7" : "=&r" ( value ) : : "memory"
11169 );
11170
11171 return value;
11172}
11173
11174static inline void _AArch32_Write_erxmisc7( uint32_t value )
11175{
11176 __asm__ volatile (
11177 "mcr p15, 0, %0, c5, c5, 7" : : "r" ( value ) : "memory"
11178 );
11179}
11180
11181/* ERXSTATUS, Selected Error Record Primary Status Register */
11182
11183static inline uint32_t _AArch32_Read_erxstatus( void )
11184{
11185 uint32_t value;
11186
11187 __asm__ volatile (
11188 "mrc p15, 0, %0, c5, c4, 2" : "=&r" ( value ) : : "memory"
11189 );
11190
11191 return value;
11192}
11193
11194static inline void _AArch32_Write_erxstatus( uint32_t value )
11195{
11196 __asm__ volatile (
11197 "mcr p15, 0, %0, c5, c4, 2" : : "r" ( value ) : "memory"
11198 );
11199}
11200
11201/* VDFSR, Virtual SError Exception Syndrome Register */
11202
11203#define AARCH32_VDFSR_EXT 0x1000U
11204
11205#define AARCH32_VDFSR_AET( _val ) ( ( _val ) << 14 )
11206#define AARCH32_VDFSR_AET_SHIFT 14
11207#define AARCH32_VDFSR_AET_MASK 0xc000U
11208#define AARCH32_VDFSR_AET_GET( _reg ) \
11209 ( ( ( _reg ) >> 14 ) & 0x3U )
11210
11211static inline uint32_t _AArch32_Read_vdfsr( void )
11212{
11213 uint32_t value;
11214
11215 __asm__ volatile (
11216 "mrc p15, 4, %0, c5, c2, 3" : "=&r" ( value ) : : "memory"
11217 );
11218
11219 return value;
11220}
11221
11222static inline void _AArch32_Write_vdfsr( uint32_t value )
11223{
11224 __asm__ volatile (
11225 "mcr p15, 4, %0, c5, c2, 3" : : "r" ( value ) : "memory"
11226 );
11227}
11228
11229/* VDISR, Virtual Deferred Interrupt Status Register */
11230
11231#define AARCH32_VDISR_FS_3_0( _val ) ( ( _val ) << 0 )
11232#define AARCH32_VDISR_FS_3_0_SHIFT 0
11233#define AARCH32_VDISR_FS_3_0_MASK 0xfU
11234#define AARCH32_VDISR_FS_3_0_GET( _reg ) \
11235 ( ( ( _reg ) >> 0 ) & 0xfU )
11236
11237#define AARCH32_VDISR_STATUS( _val ) ( ( _val ) << 0 )
11238#define AARCH32_VDISR_STATUS_SHIFT 0
11239#define AARCH32_VDISR_STATUS_MASK 0x3fU
11240#define AARCH32_VDISR_STATUS_GET( _reg ) \
11241 ( ( ( _reg ) >> 0 ) & 0x3fU )
11242
11243#define AARCH32_VDISR_LPAE 0x200U
11244
11245#define AARCH32_VDISR_FS_4 0x400U
11246
11247#define AARCH32_VDISR_EXT 0x1000U
11248
11249#define AARCH32_VDISR_AET( _val ) ( ( _val ) << 14 )
11250#define AARCH32_VDISR_AET_SHIFT 14
11251#define AARCH32_VDISR_AET_MASK 0xc000U
11252#define AARCH32_VDISR_AET_GET( _reg ) \
11253 ( ( ( _reg ) >> 14 ) & 0x3U )
11254
11255#define AARCH32_VDISR_A 0x80000000U
11256
11257static inline uint32_t _AArch32_Read_vdisr( void )
11258{
11259 uint32_t value;
11260
11261 __asm__ volatile (
11262 "mrc p15, 4, %0, c12, c1, 1" : "=&r" ( value ) : : "memory"
11263 );
11264
11265 return value;
11266}
11267
11268static inline void _AArch32_Write_vdisr( uint32_t value )
11269{
11270 __asm__ volatile (
11271 "mcr p15, 4, %0, c12, c1, 1" : : "r" ( value ) : "memory"
11272 );
11273}
11274
11275/* CNTFRQ, Counter-timer Frequency Register */
11276
11277static inline uint32_t _AArch32_Read_cntfrq( void )
11278{
11279 uint32_t value;
11280
11281 __asm__ volatile (
11282 "mrc p15, 0, %0, c14, c0, 0" : "=&r" ( value ) : : "memory"
11283 );
11284
11285 return value;
11286}
11287
11288static inline void _AArch32_Write_cntfrq( uint32_t value )
11289{
11290 __asm__ volatile (
11291 "mcr p15, 0, %0, c14, c0, 0" : : "r" ( value ) : "memory"
11292 );
11293}
11294
11295/* CNTHCTL, Counter-timer Hyp Control Register */
11296
11297#define AARCH32_CNTHCTL_PL1PCTEN 0x1U
11298
11299#define AARCH32_CNTHCTL_PL1PCEN 0x2U
11300
11301#define AARCH32_CNTHCTL_EVNTEN 0x4U
11302
11303#define AARCH32_CNTHCTL_EVNTDIR 0x8U
11304
11305#define AARCH32_CNTHCTL_EVNTI( _val ) ( ( _val ) << 4 )
11306#define AARCH32_CNTHCTL_EVNTI_SHIFT 4
11307#define AARCH32_CNTHCTL_EVNTI_MASK 0xf0U
11308#define AARCH32_CNTHCTL_EVNTI_GET( _reg ) \
11309 ( ( ( _reg ) >> 4 ) & 0xfU )
11310
11311#define AARCH32_CNTHCTL_EVNTIS 0x20000U
11312
11313static inline uint32_t _AArch32_Read_cnthctl( void )
11314{
11315 uint32_t value;
11316
11317 __asm__ volatile (
11318 "mrc p15, 4, %0, c14, c1, 0" : "=&r" ( value ) : : "memory"
11319 );
11320
11321 return value;
11322}
11323
11324static inline void _AArch32_Write_cnthctl( uint32_t value )
11325{
11326 __asm__ volatile (
11327 "mcr p15, 4, %0, c14, c1, 0" : : "r" ( value ) : "memory"
11328 );
11329}
11330
11331/* CNTHP_CTL, Counter-timer Hyp Physical Timer Control Register */
11332
11333#define AARCH32_CNTHP_CTL_ENABLE 0x1U
11334
11335#define AARCH32_CNTHP_CTL_IMASK 0x2U
11336
11337#define AARCH32_CNTHP_CTL_ISTATUS 0x4U
11338
11339static inline uint32_t _AArch32_Read_cnthp_ctl( void )
11340{
11341 uint32_t value;
11342
11343 __asm__ volatile (
11344 "mrc p15, 4, %0, c14, c2, 1" : "=&r" ( value ) : : "memory"
11345 );
11346
11347 return value;
11348}
11349
11350static inline void _AArch32_Write_cnthp_ctl( uint32_t value )
11351{
11352 __asm__ volatile (
11353 "mcr p15, 4, %0, c14, c2, 1" : : "r" ( value ) : "memory"
11354 );
11355}
11356
11357/* CNTHP_CVAL, Counter-timer Hyp Physical CompareValue Register */
11358
11359static inline uint64_t _AArch32_Read_cnthp_cval( void )
11360{
11361 uint64_t value;
11362
11363 __asm__ volatile (
11364 "mrrc p15, 6, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11365 );
11366
11367 return value;
11368}
11369
11370static inline void _AArch32_Write_cnthp_cval( uint64_t value )
11371{
11372 __asm__ volatile (
11373 "mcrr p15, 6, %Q0, %R0, c14" : : "r" ( value ) : "memory"
11374 );
11375}
11376
11377/* CNTHP_TVAL, Counter-timer Hyp Physical Timer TimerValue Register */
11378
11379static inline uint32_t _AArch32_Read_cnthp_tval( void )
11380{
11381 uint32_t value;
11382
11383 __asm__ volatile (
11384 "mrc p15, 4, %0, c14, c2, 0" : "=&r" ( value ) : : "memory"
11385 );
11386
11387 return value;
11388}
11389
11390static inline void _AArch32_Write_cnthp_tval( uint32_t value )
11391{
11392 __asm__ volatile (
11393 "mcr p15, 4, %0, c14, c2, 0" : : "r" ( value ) : "memory"
11394 );
11395}
11396
11397/* CNTHPS_CTL, Counter-timer Secure Physical Timer Control Register (EL2) */
11398
11399#define AARCH32_CNTHPS_CTL_ENABLE 0x1U
11400
11401#define AARCH32_CNTHPS_CTL_IMASK 0x2U
11402
11403#define AARCH32_CNTHPS_CTL_ISTATUS 0x4U
11404
11405static inline uint32_t _AArch32_Read_cnthps_ctl( void )
11406{
11407 uint32_t value;
11408
11409 __asm__ volatile (
11410 "mrc p15, 0, %0, c14, c2, 1" : "=&r" ( value ) : : "memory"
11411 );
11412
11413 return value;
11414}
11415
11416static inline void _AArch32_Write_cnthps_ctl( uint32_t value )
11417{
11418 __asm__ volatile (
11419 "mcr p15, 0, %0, c14, c2, 1" : : "r" ( value ) : "memory"
11420 );
11421}
11422
11423/* CNTHPS_CVAL, Counter-timer Secure Physical Timer CompareValue Register (EL2) */
11424
11425static inline uint64_t _AArch32_Read_cnthps_cval( void )
11426{
11427 uint64_t value;
11428
11429 __asm__ volatile (
11430 "mrrc p15, 2, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11431 );
11432
11433 return value;
11434}
11435
11436static inline void _AArch32_Write_cnthps_cval( uint64_t value )
11437{
11438 __asm__ volatile (
11439 "mcrr p15, 2, %Q0, %R0, c14" : : "r" ( value ) : "memory"
11440 );
11441}
11442
11443/* CNTHPS_TVAL, Counter-timer Secure Physical Timer TimerValue Register (EL2) */
11444
11445static inline uint32_t _AArch32_Read_cnthps_tval( void )
11446{
11447 uint32_t value;
11448
11449 __asm__ volatile (
11450 "mrc p15, 0, %0, c14, c2, 0" : "=&r" ( value ) : : "memory"
11451 );
11452
11453 return value;
11454}
11455
11456static inline void _AArch32_Write_cnthps_tval( uint32_t value )
11457{
11458 __asm__ volatile (
11459 "mcr p15, 0, %0, c14, c2, 0" : : "r" ( value ) : "memory"
11460 );
11461}
11462
11463/* CNTHV_CTL, Counter-timer Virtual Timer Control Register (EL2) */
11464
11465#define AARCH32_CNTHV_CTL_ENABLE 0x1U
11466
11467#define AARCH32_CNTHV_CTL_IMASK 0x2U
11468
11469#define AARCH32_CNTHV_CTL_ISTATUS 0x4U
11470
11471static inline uint32_t _AArch32_Read_cnthv_ctl( void )
11472{
11473 uint32_t value;
11474
11475 __asm__ volatile (
11476 "mrc p15, 0, %0, c14, c3, 1" : "=&r" ( value ) : : "memory"
11477 );
11478
11479 return value;
11480}
11481
11482static inline void _AArch32_Write_cnthv_ctl( uint32_t value )
11483{
11484 __asm__ volatile (
11485 "mcr p15, 0, %0, c14, c3, 1" : : "r" ( value ) : "memory"
11486 );
11487}
11488
11489/* CNTHV_CVAL, Counter-timer Virtual Timer CompareValue Register (EL2) */
11490
11491static inline uint64_t _AArch32_Read_cnthv_cval( void )
11492{
11493 uint64_t value;
11494
11495 __asm__ volatile (
11496 "mrrc p15, 3, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11497 );
11498
11499 return value;
11500}
11501
11502static inline void _AArch32_Write_cnthv_cval( uint64_t value )
11503{
11504 __asm__ volatile (
11505 "mcrr p15, 3, %Q0, %R0, c14" : : "r" ( value ) : "memory"
11506 );
11507}
11508
11509/* CNTHV_TVAL, Counter-timer Virtual Timer TimerValue Register (EL2) */
11510
11511static inline uint32_t _AArch32_Read_cnthv_tval( void )
11512{
11513 uint32_t value;
11514
11515 __asm__ volatile (
11516 "mrc p15, 0, %0, c14, c3, 0" : "=&r" ( value ) : : "memory"
11517 );
11518
11519 return value;
11520}
11521
11522static inline void _AArch32_Write_cnthv_tval( uint32_t value )
11523{
11524 __asm__ volatile (
11525 "mcr p15, 0, %0, c14, c3, 0" : : "r" ( value ) : "memory"
11526 );
11527}
11528
11529/* CNTHVS_CTL, Counter-timer Secure Virtual Timer Control Register (EL2) */
11530
11531#define AARCH32_CNTHVS_CTL_ENABLE 0x1U
11532
11533#define AARCH32_CNTHVS_CTL_IMASK 0x2U
11534
11535#define AARCH32_CNTHVS_CTL_ISTATUS 0x4U
11536
11537static inline uint32_t _AArch32_Read_cnthvs_ctl( void )
11538{
11539 uint32_t value;
11540
11541 __asm__ volatile (
11542 "mrc p15, 0, %0, c14, c3, 1" : "=&r" ( value ) : : "memory"
11543 );
11544
11545 return value;
11546}
11547
11548static inline void _AArch32_Write_cnthvs_ctl( uint32_t value )
11549{
11550 __asm__ volatile (
11551 "mcr p15, 0, %0, c14, c3, 1" : : "r" ( value ) : "memory"
11552 );
11553}
11554
11555/* CNTHVS_CVAL, Counter-timer Secure Virtual Timer CompareValue Register (EL2) */
11556
11557static inline uint64_t _AArch32_Read_cnthvs_cval( void )
11558{
11559 uint64_t value;
11560
11561 __asm__ volatile (
11562 "mrrc p15, 3, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11563 );
11564
11565 return value;
11566}
11567
11568static inline void _AArch32_Write_cnthvs_cval( uint64_t value )
11569{
11570 __asm__ volatile (
11571 "mcrr p15, 3, %Q0, %R0, c14" : : "r" ( value ) : "memory"
11572 );
11573}
11574
11575/* CNTHVS_TVAL, Counter-timer Secure Virtual Timer TimerValue Register (EL2) */
11576
11577static inline uint32_t _AArch32_Read_cnthvs_tval( void )
11578{
11579 uint32_t value;
11580
11581 __asm__ volatile (
11582 "mrc p15, 0, %0, c14, c3, 0" : "=&r" ( value ) : : "memory"
11583 );
11584
11585 return value;
11586}
11587
11588static inline void _AArch32_Write_cnthvs_tval( uint32_t value )
11589{
11590 __asm__ volatile (
11591 "mcr p15, 0, %0, c14, c3, 0" : : "r" ( value ) : "memory"
11592 );
11593}
11594
11595/* CNTKCTL, Counter-timer Kernel Control Register */
11596
11597#define AARCH32_CNTKCTL_PL0PCTEN 0x1U
11598
11599#define AARCH32_CNTKCTL_PL0VCTEN 0x2U
11600
11601#define AARCH32_CNTKCTL_EVNTEN 0x4U
11602
11603#define AARCH32_CNTKCTL_EVNTDIR 0x8U
11604
11605#define AARCH32_CNTKCTL_EVNTI( _val ) ( ( _val ) << 4 )
11606#define AARCH32_CNTKCTL_EVNTI_SHIFT 4
11607#define AARCH32_CNTKCTL_EVNTI_MASK 0xf0U
11608#define AARCH32_CNTKCTL_EVNTI_GET( _reg ) \
11609 ( ( ( _reg ) >> 4 ) & 0xfU )
11610
11611#define AARCH32_CNTKCTL_PL0VTEN 0x100U
11612
11613#define AARCH32_CNTKCTL_PL0PTEN 0x200U
11614
11615#define AARCH32_CNTKCTL_EVNTIS 0x20000U
11616
11617static inline uint32_t _AArch32_Read_cntkctl( void )
11618{
11619 uint32_t value;
11620
11621 __asm__ volatile (
11622 "mrc p15, 0, %0, c14, c1, 0" : "=&r" ( value ) : : "memory"
11623 );
11624
11625 return value;
11626}
11627
11628static inline void _AArch32_Write_cntkctl( uint32_t value )
11629{
11630 __asm__ volatile (
11631 "mcr p15, 0, %0, c14, c1, 0" : : "r" ( value ) : "memory"
11632 );
11633}
11634
11635/* CNTP_CTL, Counter-timer Physical Timer Control Register */
11636
11637#define AARCH32_CNTP_CTL_ENABLE 0x1U
11638
11639#define AARCH32_CNTP_CTL_IMASK 0x2U
11640
11641#define AARCH32_CNTP_CTL_ISTATUS 0x4U
11642
11643static inline uint32_t _AArch32_Read_cntp_ctl( void )
11644{
11645 uint32_t value;
11646
11647 __asm__ volatile (
11648 "mrc p15, 0, %0, c14, c2, 1" : "=&r" ( value ) : : "memory"
11649 );
11650
11651 return value;
11652}
11653
11654static inline void _AArch32_Write_cntp_ctl( uint32_t value )
11655{
11656 __asm__ volatile (
11657 "mcr p15, 0, %0, c14, c2, 1" : : "r" ( value ) : "memory"
11658 );
11659}
11660
11661/* CNTP_CVAL, Counter-timer Physical Timer CompareValue Register */
11662
11663static inline uint64_t _AArch32_Read_cntp_cval( void )
11664{
11665 uint64_t value;
11666
11667 __asm__ volatile (
11668 "mrrc p15, 2, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11669 );
11670
11671 return value;
11672}
11673
11674static inline void _AArch32_Write_cntp_cval( uint64_t value )
11675{
11676 __asm__ volatile (
11677 "mcrr p15, 2, %Q0, %R0, c14" : : "r" ( value ) : "memory"
11678 );
11679}
11680
11681/* CNTP_TVAL, Counter-timer Physical Timer TimerValue Register */
11682
11683static inline uint32_t _AArch32_Read_cntp_tval( void )
11684{
11685 uint32_t value;
11686
11687 __asm__ volatile (
11688 "mrc p15, 0, %0, c14, c2, 0" : "=&r" ( value ) : : "memory"
11689 );
11690
11691 return value;
11692}
11693
11694static inline void _AArch32_Write_cntp_tval( uint32_t value )
11695{
11696 __asm__ volatile (
11697 "mcr p15, 0, %0, c14, c2, 0" : : "r" ( value ) : "memory"
11698 );
11699}
11700
11701/* CNTPCT, Counter-timer Physical Count Register */
11702
11703static inline uint64_t _AArch32_Read_cntpct( void )
11704{
11705 uint64_t value;
11706
11707 __asm__ volatile (
11708 "mrrc p15, 0, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11709 );
11710
11711 return value;
11712}
11713
11714/* CNTPCTSS, Counter-timer Self-Synchronized Physical Count Register */
11715
11716static inline uint64_t _AArch32_Read_cntpctss( void )
11717{
11718 uint64_t value;
11719
11720 __asm__ volatile (
11721 "mrrc p15, 8, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11722 );
11723
11724 return value;
11725}
11726
11727/* CNTV_CTL, Counter-timer Virtual Timer Control Register */
11728
11729#define AARCH32_CNTV_CTL_ENABLE 0x1U
11730
11731#define AARCH32_CNTV_CTL_IMASK 0x2U
11732
11733#define AARCH32_CNTV_CTL_ISTATUS 0x4U
11734
11735static inline uint32_t _AArch32_Read_cntv_ctl( void )
11736{
11737 uint32_t value;
11738
11739 __asm__ volatile (
11740 "mrc p15, 0, %0, c14, c3, 1" : "=&r" ( value ) : : "memory"
11741 );
11742
11743 return value;
11744}
11745
11746static inline void _AArch32_Write_cntv_ctl( uint32_t value )
11747{
11748 __asm__ volatile (
11749 "mcr p15, 0, %0, c14, c3, 1" : : "r" ( value ) : "memory"
11750 );
11751}
11752
11753/* CNTV_CVAL, Counter-timer Virtual Timer CompareValue Register */
11754
11755static inline uint64_t _AArch32_Read_cntv_cval( void )
11756{
11757 uint64_t value;
11758
11759 __asm__ volatile (
11760 "mrrc p15, 3, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11761 );
11762
11763 return value;
11764}
11765
11766static inline void _AArch32_Write_cntv_cval( uint64_t value )
11767{
11768 __asm__ volatile (
11769 "mcrr p15, 3, %Q0, %R0, c14" : : "r" ( value ) : "memory"
11770 );
11771}
11772
11773/* CNTV_TVAL, Counter-timer Virtual Timer TimerValue Register */
11774
11775static inline uint32_t _AArch32_Read_cntv_tval( void )
11776{
11777 uint32_t value;
11778
11779 __asm__ volatile (
11780 "mrc p15, 0, %0, c14, c3, 0" : "=&r" ( value ) : : "memory"
11781 );
11782
11783 return value;
11784}
11785
11786static inline void _AArch32_Write_cntv_tval( uint32_t value )
11787{
11788 __asm__ volatile (
11789 "mcr p15, 0, %0, c14, c3, 0" : : "r" ( value ) : "memory"
11790 );
11791}
11792
11793/* CNTVCT, Counter-timer Virtual Count Register */
11794
11795static inline uint64_t _AArch32_Read_cntvct( void )
11796{
11797 uint64_t value;
11798
11799 __asm__ volatile (
11800 "mrrc p15, 1, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11801 );
11802
11803 return value;
11804}
11805
11806/* CNTVCTSS, Counter-timer Self-Synchronized Virtual Count Register */
11807
11808static inline uint64_t _AArch32_Read_cntvctss( void )
11809{
11810 uint64_t value;
11811
11812 __asm__ volatile (
11813 "mrrc p15, 9, %Q0, %R0, c14" : "=&r" ( value ) : : "memory"
11814 );
11815
11816 return value;
11817}
11818
11819/* HMPUIR, Hypervisor MPU Type Register */
11820
11821#define AARCH32_HMPUIR_REGION( _val ) ( ( _val ) << 0 )
11822#define AARCH32_HMPUIR_REGION_SHIFT 0
11823#define AARCH32_HMPUIR_REGION_MASK 0xffU
11824#define AARCH32_HMPUIR_REGION_GET( _reg ) \
11825 ( ( ( _reg ) >> 0 ) & 0xffU )
11826
11827static inline uint32_t _AArch32_Read_hmpuir( void )
11828{
11829 uint32_t value;
11830
11831 __asm__ volatile (
11832 "mrc p15, 4, %0, c0, c0, 4" : "=&r" ( value ) : : "memory"
11833 );
11834
11835 return value;
11836}
11837
11838static inline void _AArch32_Write_hmpuir( uint32_t value )
11839{
11840 __asm__ volatile (
11841 "mcr p15, 4, %0, c0, c0, 4" : : "r" ( value ) : "memory"
11842 );
11843}
11844
11845/* HPRBAR, Hypervisor Protection Region Base Address Register */
11846
11847#define AARCH32_HPRBAR_XN 0x1U
11848
11849#define AARCH32_HPRBAR_AP_2_1( _val ) ( ( _val ) << 1 )
11850#define AARCH32_HPRBAR_AP_2_1_SHIFT 1
11851#define AARCH32_HPRBAR_AP_2_1_MASK 0x6U
11852#define AARCH32_HPRBAR_AP_2_1_GET( _reg ) \
11853 ( ( ( _reg ) >> 1 ) & 0x3U )
11854
11855#define AARCH32_HPRBAR_SH_1_0( _val ) ( ( _val ) << 3 )
11856#define AARCH32_HPRBAR_SH_1_0_SHIFT 3
11857#define AARCH32_HPRBAR_SH_1_0_MASK 0x18U
11858#define AARCH32_HPRBAR_SH_1_0_GET( _reg ) \
11859 ( ( ( _reg ) >> 3 ) & 0x3U )
11860
11861#define AARCH32_HPRBAR_BASE( _val ) ( ( _val ) << 6 )
11862#define AARCH32_HPRBAR_BASE_SHIFT 6
11863#define AARCH32_HPRBAR_BASE_MASK 0xffffffc0U
11864#define AARCH32_HPRBAR_BASE_GET( _reg ) \
11865 ( ( ( _reg ) >> 6 ) & 0x3ffffffU )
11866
11867static inline uint32_t _AArch32_Read_hprbar( void )
11868{
11869 uint32_t value;
11870
11871 __asm__ volatile (
11872 "mrc p15, 4, %0, c6, c3, 0" : "=&r" ( value ) : : "memory"
11873 );
11874
11875 return value;
11876}
11877
11878static inline void _AArch32_Write_hprbar( uint32_t value )
11879{
11880 __asm__ volatile (
11881 "mcr p15, 4, %0, c6, c3, 0" : : "r" ( value ) : "memory"
11882 );
11883}
11884
11885/* HPRBAR_0, Hypervisor Protection Region Base Address Registers */
11886
11887static inline uint32_t _AArch32_Read_hprbar_0( void )
11888{
11889 uint32_t value;
11890
11891 __asm__ volatile (
11892 "mrc p15, 4, %0, c6, c8, 0" : "=&r" ( value ) : : "memory"
11893 );
11894
11895 return value;
11896}
11897
11898static inline void _AArch32_Write_hprbar_0( uint32_t value )
11899{
11900 __asm__ volatile (
11901 "mcr p15, 4, %0, c6, c8, 0" : : "r" ( value ) : "memory"
11902 );
11903}
11904
11905/* HPRBAR_1, Hypervisor Protection Region Base Address Registers */
11906
11907static inline uint32_t _AArch32_Read_hprbar_1( void )
11908{
11909 uint32_t value;
11910
11911 __asm__ volatile (
11912 "mrc p15, 4, %0, c6, c8, 4" : "=&r" ( value ) : : "memory"
11913 );
11914
11915 return value;
11916}
11917
11918static inline void _AArch32_Write_hprbar_1( uint32_t value )
11919{
11920 __asm__ volatile (
11921 "mcr p15, 4, %0, c6, c8, 4" : : "r" ( value ) : "memory"
11922 );
11923}
11924
11925/* HPRBAR_2, Hypervisor Protection Region Base Address Registers */
11926
11927static inline uint32_t _AArch32_Read_hprbar_2( void )
11928{
11929 uint32_t value;
11930
11931 __asm__ volatile (
11932 "mrc p15, 4, %0, c6, c9, 0" : "=&r" ( value ) : : "memory"
11933 );
11934
11935 return value;
11936}
11937
11938static inline void _AArch32_Write_hprbar_2( uint32_t value )
11939{
11940 __asm__ volatile (
11941 "mcr p15, 4, %0, c6, c9, 0" : : "r" ( value ) : "memory"
11942 );
11943}
11944
11945/* HPRBAR_3, Hypervisor Protection Region Base Address Registers */
11946
11947static inline uint32_t _AArch32_Read_hprbar_3( void )
11948{
11949 uint32_t value;
11950
11951 __asm__ volatile (
11952 "mrc p15, 4, %0, c6, c9, 4" : "=&r" ( value ) : : "memory"
11953 );
11954
11955 return value;
11956}
11957
11958static inline void _AArch32_Write_hprbar_3( uint32_t value )
11959{
11960 __asm__ volatile (
11961 "mcr p15, 4, %0, c6, c9, 4" : : "r" ( value ) : "memory"
11962 );
11963}
11964
11965/* HPRBAR_4, Hypervisor Protection Region Base Address Registers */
11966
11967static inline uint32_t _AArch32_Read_hprbar_4( void )
11968{
11969 uint32_t value;
11970
11971 __asm__ volatile (
11972 "mrc p15, 4, %0, c6, c10, 0" : "=&r" ( value ) : : "memory"
11973 );
11974
11975 return value;
11976}
11977
11978static inline void _AArch32_Write_hprbar_4( uint32_t value )
11979{
11980 __asm__ volatile (
11981 "mcr p15, 4, %0, c6, c10, 0" : : "r" ( value ) : "memory"
11982 );
11983}
11984
11985/* HPRBAR_5, Hypervisor Protection Region Base Address Registers */
11986
11987static inline uint32_t _AArch32_Read_hprbar_5( void )
11988{
11989 uint32_t value;
11990
11991 __asm__ volatile (
11992 "mrc p15, 4, %0, c6, c10, 4" : "=&r" ( value ) : : "memory"
11993 );
11994
11995 return value;
11996}
11997
11998static inline void _AArch32_Write_hprbar_5( uint32_t value )
11999{
12000 __asm__ volatile (
12001 "mcr p15, 4, %0, c6, c10, 4" : : "r" ( value ) : "memory"
12002 );
12003}
12004
12005/* HPRBAR_6, Hypervisor Protection Region Base Address Registers */
12006
12007static inline uint32_t _AArch32_Read_hprbar_6( void )
12008{
12009 uint32_t value;
12010
12011 __asm__ volatile (
12012 "mrc p15, 4, %0, c6, c11, 0" : "=&r" ( value ) : : "memory"
12013 );
12014
12015 return value;
12016}
12017
12018static inline void _AArch32_Write_hprbar_6( uint32_t value )
12019{
12020 __asm__ volatile (
12021 "mcr p15, 4, %0, c6, c11, 0" : : "r" ( value ) : "memory"
12022 );
12023}
12024
12025/* HPRBAR_7, Hypervisor Protection Region Base Address Registers */
12026
12027static inline uint32_t _AArch32_Read_hprbar_7( void )
12028{
12029 uint32_t value;
12030
12031 __asm__ volatile (
12032 "mrc p15, 4, %0, c6, c11, 4" : "=&r" ( value ) : : "memory"
12033 );
12034
12035 return value;
12036}
12037
12038static inline void _AArch32_Write_hprbar_7( uint32_t value )
12039{
12040 __asm__ volatile (
12041 "mcr p15, 4, %0, c6, c11, 4" : : "r" ( value ) : "memory"
12042 );
12043}
12044
12045/* HPRBAR_8, Hypervisor Protection Region Base Address Registers */
12046
12047static inline uint32_t _AArch32_Read_hprbar_8( void )
12048{
12049 uint32_t value;
12050
12051 __asm__ volatile (
12052 "mrc p15, 4, %0, c6, c12, 0" : "=&r" ( value ) : : "memory"
12053 );
12054
12055 return value;
12056}
12057
12058static inline void _AArch32_Write_hprbar_8( uint32_t value )
12059{
12060 __asm__ volatile (
12061 "mcr p15, 4, %0, c6, c12, 0" : : "r" ( value ) : "memory"
12062 );
12063}
12064
12065/* HPRBAR_9, Hypervisor Protection Region Base Address Registers */
12066
12067static inline uint32_t _AArch32_Read_hprbar_9( void )
12068{
12069 uint32_t value;
12070
12071 __asm__ volatile (
12072 "mrc p15, 4, %0, c6, c12, 4" : "=&r" ( value ) : : "memory"
12073 );
12074
12075 return value;
12076}
12077
12078static inline void _AArch32_Write_hprbar_9( uint32_t value )
12079{
12080 __asm__ volatile (
12081 "mcr p15, 4, %0, c6, c12, 4" : : "r" ( value ) : "memory"
12082 );
12083}
12084
12085/* HPRBAR_10, Hypervisor Protection Region Base Address Registers */
12086
12087static inline uint32_t _AArch32_Read_hprbar_10( void )
12088{
12089 uint32_t value;
12090
12091 __asm__ volatile (
12092 "mrc p15, 4, %0, c6, c13, 0" : "=&r" ( value ) : : "memory"
12093 );
12094
12095 return value;
12096}
12097
12098static inline void _AArch32_Write_hprbar_10( uint32_t value )
12099{
12100 __asm__ volatile (
12101 "mcr p15, 4, %0, c6, c13, 0" : : "r" ( value ) : "memory"
12102 );
12103}
12104
12105/* HPRBAR_11, Hypervisor Protection Region Base Address Registers */
12106
12107static inline uint32_t _AArch32_Read_hprbar_11( void )
12108{
12109 uint32_t value;
12110
12111 __asm__ volatile (
12112 "mrc p15, 4, %0, c6, c13, 4" : "=&r" ( value ) : : "memory"
12113 );
12114
12115 return value;
12116}
12117
12118static inline void _AArch32_Write_hprbar_11( uint32_t value )
12119{
12120 __asm__ volatile (
12121 "mcr p15, 4, %0, c6, c13, 4" : : "r" ( value ) : "memory"
12122 );
12123}
12124
12125/* HPRBAR_12, Hypervisor Protection Region Base Address Registers */
12126
12127static inline uint32_t _AArch32_Read_hprbar_12( void )
12128{
12129 uint32_t value;
12130
12131 __asm__ volatile (
12132 "mrc p15, 4, %0, c6, c14, 0" : "=&r" ( value ) : : "memory"
12133 );
12134
12135 return value;
12136}
12137
12138static inline void _AArch32_Write_hprbar_12( uint32_t value )
12139{
12140 __asm__ volatile (
12141 "mcr p15, 4, %0, c6, c14, 0" : : "r" ( value ) : "memory"
12142 );
12143}
12144
12145/* HPRBAR_13, Hypervisor Protection Region Base Address Registers */
12146
12147static inline uint32_t _AArch32_Read_hprbar_13( void )
12148{
12149 uint32_t value;
12150
12151 __asm__ volatile (
12152 "mrc p15, 4, %0, c6, c14, 4" : "=&r" ( value ) : : "memory"
12153 );
12154
12155 return value;
12156}
12157
12158static inline void _AArch32_Write_hprbar_13( uint32_t value )
12159{
12160 __asm__ volatile (
12161 "mcr p15, 4, %0, c6, c14, 4" : : "r" ( value ) : "memory"
12162 );
12163}
12164
12165/* HPRBAR_14, Hypervisor Protection Region Base Address Registers */
12166
12167static inline uint32_t _AArch32_Read_hprbar_14( void )
12168{
12169 uint32_t value;
12170
12171 __asm__ volatile (
12172 "mrc p15, 4, %0, c6, c15, 0" : "=&r" ( value ) : : "memory"
12173 );
12174
12175 return value;
12176}
12177
12178static inline void _AArch32_Write_hprbar_14( uint32_t value )
12179{
12180 __asm__ volatile (
12181 "mcr p15, 4, %0, c6, c15, 0" : : "r" ( value ) : "memory"
12182 );
12183}
12184
12185/* HPRBAR_15, Hypervisor Protection Region Base Address Registers */
12186
12187static inline uint32_t _AArch32_Read_hprbar_15( void )
12188{
12189 uint32_t value;
12190
12191 __asm__ volatile (
12192 "mrc p15, 4, %0, c6, c15, 4" : "=&r" ( value ) : : "memory"
12193 );
12194
12195 return value;
12196}
12197
12198static inline void _AArch32_Write_hprbar_15( uint32_t value )
12199{
12200 __asm__ volatile (
12201 "mcr p15, 4, %0, c6, c15, 4" : : "r" ( value ) : "memory"
12202 );
12203}
12204
12205/* HPRBAR_16, Hypervisor Protection Region Base Address Registers */
12206
12207static inline uint32_t _AArch32_Read_hprbar_16( void )
12208{
12209 uint32_t value;
12210
12211 __asm__ volatile (
12212 "mrc p15, 5, %0, c6, c8, 0" : "=&r" ( value ) : : "memory"
12213 );
12214
12215 return value;
12216}
12217
12218static inline void _AArch32_Write_hprbar_16( uint32_t value )
12219{
12220 __asm__ volatile (
12221 "mcr p15, 5, %0, c6, c8, 0" : : "r" ( value ) : "memory"
12222 );
12223}
12224
12225/* HPRBAR_17, Hypervisor Protection Region Base Address Registers */
12226
12227static inline uint32_t _AArch32_Read_hprbar_17( void )
12228{
12229 uint32_t value;
12230
12231 __asm__ volatile (
12232 "mrc p15, 5, %0, c6, c8, 4" : "=&r" ( value ) : : "memory"
12233 );
12234
12235 return value;
12236}
12237
12238static inline void _AArch32_Write_hprbar_17( uint32_t value )
12239{
12240 __asm__ volatile (
12241 "mcr p15, 5, %0, c6, c8, 4" : : "r" ( value ) : "memory"
12242 );
12243}
12244
12245/* HPRBAR_18, Hypervisor Protection Region Base Address Registers */
12246
12247static inline uint32_t _AArch32_Read_hprbar_18( void )
12248{
12249 uint32_t value;
12250
12251 __asm__ volatile (
12252 "mrc p15, 5, %0, c6, c9, 0" : "=&r" ( value ) : : "memory"
12253 );
12254
12255 return value;
12256}
12257
12258static inline void _AArch32_Write_hprbar_18( uint32_t value )
12259{
12260 __asm__ volatile (
12261 "mcr p15, 5, %0, c6, c9, 0" : : "r" ( value ) : "memory"
12262 );
12263}
12264
12265/* HPRBAR_19, Hypervisor Protection Region Base Address Registers */
12266
12267static inline uint32_t _AArch32_Read_hprbar_19( void )
12268{
12269 uint32_t value;
12270
12271 __asm__ volatile (
12272 "mrc p15, 5, %0, c6, c9, 4" : "=&r" ( value ) : : "memory"
12273 );
12274
12275 return value;
12276}
12277
12278static inline void _AArch32_Write_hprbar_19( uint32_t value )
12279{
12280 __asm__ volatile (
12281 "mcr p15, 5, %0, c6, c9, 4" : : "r" ( value ) : "memory"
12282 );
12283}
12284
12285/* HPRBAR_20, Hypervisor Protection Region Base Address Registers */
12286
12287static inline uint32_t _AArch32_Read_hprbar_20( void )
12288{
12289 uint32_t value;
12290
12291 __asm__ volatile (
12292 "mrc p15, 5, %0, c6, c10, 0" : "=&r" ( value ) : : "memory"
12293 );
12294
12295 return value;
12296}
12297
12298static inline void _AArch32_Write_hprbar_20( uint32_t value )
12299{
12300 __asm__ volatile (
12301 "mcr p15, 5, %0, c6, c10, 0" : : "r" ( value ) : "memory"
12302 );
12303}
12304
12305/* HPRBAR_21, Hypervisor Protection Region Base Address Registers */
12306
12307static inline uint32_t _AArch32_Read_hprbar_21( void )
12308{
12309 uint32_t value;
12310
12311 __asm__ volatile (
12312 "mrc p15, 5, %0, c6, c10, 4" : "=&r" ( value ) : : "memory"
12313 );
12314
12315 return value;
12316}
12317
12318static inline void _AArch32_Write_hprbar_21( uint32_t value )
12319{
12320 __asm__ volatile (
12321 "mcr p15, 5, %0, c6, c10, 4" : : "r" ( value ) : "memory"
12322 );
12323}
12324
12325/* HPRBAR_22, Hypervisor Protection Region Base Address Registers */
12326
12327static inline uint32_t _AArch32_Read_hprbar_22( void )
12328{
12329 uint32_t value;
12330
12331 __asm__ volatile (
12332 "mrc p15, 5, %0, c6, c11, 0" : "=&r" ( value ) : : "memory"
12333 );
12334
12335 return value;
12336}
12337
12338static inline void _AArch32_Write_hprbar_22( uint32_t value )
12339{
12340 __asm__ volatile (
12341 "mcr p15, 5, %0, c6, c11, 0" : : "r" ( value ) : "memory"
12342 );
12343}
12344
12345/* HPRBAR_23, Hypervisor Protection Region Base Address Registers */
12346
12347static inline uint32_t _AArch32_Read_hprbar_23( void )
12348{
12349 uint32_t value;
12350
12351 __asm__ volatile (
12352 "mrc p15, 5, %0, c6, c11, 4" : "=&r" ( value ) : : "memory"
12353 );
12354
12355 return value;
12356}
12357
12358static inline void _AArch32_Write_hprbar_23( uint32_t value )
12359{
12360 __asm__ volatile (
12361 "mcr p15, 5, %0, c6, c11, 4" : : "r" ( value ) : "memory"
12362 );
12363}
12364
12365/* HPRBAR_24, Hypervisor Protection Region Base Address Registers */
12366
12367static inline uint32_t _AArch32_Read_hprbar_24( void )
12368{
12369 uint32_t value;
12370
12371 __asm__ volatile (
12372 "mrc p15, 5, %0, c6, c12, 0" : "=&r" ( value ) : : "memory"
12373 );
12374
12375 return value;
12376}
12377
12378static inline void _AArch32_Write_hprbar_24( uint32_t value )
12379{
12380 __asm__ volatile (
12381 "mcr p15, 5, %0, c6, c12, 0" : : "r" ( value ) : "memory"
12382 );
12383}
12384
12385/* HPRBAR_25, Hypervisor Protection Region Base Address Registers */
12386
12387static inline uint32_t _AArch32_Read_hprbar_25( void )
12388{
12389 uint32_t value;
12390
12391 __asm__ volatile (
12392 "mrc p15, 5, %0, c6, c12, 4" : "=&r" ( value ) : : "memory"
12393 );
12394
12395 return value;
12396}
12397
12398static inline void _AArch32_Write_hprbar_25( uint32_t value )
12399{
12400 __asm__ volatile (
12401 "mcr p15, 5, %0, c6, c12, 4" : : "r" ( value ) : "memory"
12402 );
12403}
12404
12405/* HPRBAR_26, Hypervisor Protection Region Base Address Registers */
12406
12407static inline uint32_t _AArch32_Read_hprbar_26( void )
12408{
12409 uint32_t value;
12410
12411 __asm__ volatile (
12412 "mrc p15, 5, %0, c6, c13, 0" : "=&r" ( value ) : : "memory"
12413 );
12414
12415 return value;
12416}
12417
12418static inline void _AArch32_Write_hprbar_26( uint32_t value )
12419{
12420 __asm__ volatile (
12421 "mcr p15, 5, %0, c6, c13, 0" : : "r" ( value ) : "memory"
12422 );
12423}
12424
12425/* HPRBAR_27, Hypervisor Protection Region Base Address Registers */
12426
12427static inline uint32_t _AArch32_Read_hprbar_27( void )
12428{
12429 uint32_t value;
12430
12431 __asm__ volatile (
12432 "mrc p15, 5, %0, c6, c13, 4" : "=&r" ( value ) : : "memory"
12433 );
12434
12435 return value;
12436}
12437
12438static inline void _AArch32_Write_hprbar_27( uint32_t value )
12439{
12440 __asm__ volatile (
12441 "mcr p15, 5, %0, c6, c13, 4" : : "r" ( value ) : "memory"
12442 );
12443}
12444
12445/* HPRBAR_28, Hypervisor Protection Region Base Address Registers */
12446
12447static inline uint32_t _AArch32_Read_hprbar_28( void )
12448{
12449 uint32_t value;
12450
12451 __asm__ volatile (
12452 "mrc p15, 5, %0, c6, c14, 0" : "=&r" ( value ) : : "memory"
12453 );
12454
12455 return value;
12456}
12457
12458static inline void _AArch32_Write_hprbar_28( uint32_t value )
12459{
12460 __asm__ volatile (
12461 "mcr p15, 5, %0, c6, c14, 0" : : "r" ( value ) : "memory"
12462 );
12463}
12464
12465/* HPRBAR_29, Hypervisor Protection Region Base Address Registers */
12466
12467static inline uint32_t _AArch32_Read_hprbar_29( void )
12468{
12469 uint32_t value;
12470
12471 __asm__ volatile (
12472 "mrc p15, 5, %0, c6, c14, 4" : "=&r" ( value ) : : "memory"
12473 );
12474
12475 return value;
12476}
12477
12478static inline void _AArch32_Write_hprbar_29( uint32_t value )
12479{
12480 __asm__ volatile (
12481 "mcr p15, 5, %0, c6, c14, 4" : : "r" ( value ) : "memory"
12482 );
12483}
12484
12485/* HPRBAR_30, Hypervisor Protection Region Base Address Registers */
12486
12487static inline uint32_t _AArch32_Read_hprbar_30( void )
12488{
12489 uint32_t value;
12490
12491 __asm__ volatile (
12492 "mrc p15, 5, %0, c6, c15, 0" : "=&r" ( value ) : : "memory"
12493 );
12494
12495 return value;
12496}
12497
12498static inline void _AArch32_Write_hprbar_30( uint32_t value )
12499{
12500 __asm__ volatile (
12501 "mcr p15, 5, %0, c6, c15, 0" : : "r" ( value ) : "memory"
12502 );
12503}
12504
12505/* HPRBAR_31, Hypervisor Protection Region Base Address Registers */
12506
12507static inline uint32_t _AArch32_Read_hprbar_31( void )
12508{
12509 uint32_t value;
12510
12511 __asm__ volatile (
12512 "mrc p15, 5, %0, c6, c15, 4" : "=&r" ( value ) : : "memory"
12513 );
12514
12515 return value;
12516}
12517
12518static inline void _AArch32_Write_hprbar_31( uint32_t value )
12519{
12520 __asm__ volatile (
12521 "mcr p15, 5, %0, c6, c15, 4" : : "r" ( value ) : "memory"
12522 );
12523}
12524
12525/* HPRENR, Hypervisor Protection Region Enable Register */
12526
12527static inline uint32_t _AArch32_Read_hprenr( void )
12528{
12529 uint32_t value;
12530
12531 __asm__ volatile (
12532 "mrc p15, 4, %0, c6, c1, 1" : "=&r" ( value ) : : "memory"
12533 );
12534
12535 return value;
12536}
12537
12538static inline void _AArch32_Write_hprenr( uint32_t value )
12539{
12540 __asm__ volatile (
12541 "mcr p15, 4, %0, c6, c1, 1" : : "r" ( value ) : "memory"
12542 );
12543}
12544
12545/* HPRLAR, Hypervisor Protection Region Limit Address Register */
12546
12547#define AARCH32_HPRLAR_EN 0x1U
12548
12549#define AARCH32_HPRLAR_ATTRINDX_2_0( _val ) ( ( _val ) << 1 )
12550#define AARCH32_HPRLAR_ATTRINDX_2_0_SHIFT 1
12551#define AARCH32_HPRLAR_ATTRINDX_2_0_MASK 0xeU
12552#define AARCH32_HPRLAR_ATTRINDX_2_0_GET( _reg ) \
12553 ( ( ( _reg ) >> 1 ) & 0x7U )
12554
12555#define AARCH32_HPRLAR_LIMIT( _val ) ( ( _val ) << 6 )
12556#define AARCH32_HPRLAR_LIMIT_SHIFT 6
12557#define AARCH32_HPRLAR_LIMIT_MASK 0xffffffc0U
12558#define AARCH32_HPRLAR_LIMIT_GET( _reg ) \
12559 ( ( ( _reg ) >> 6 ) & 0x3ffffffU )
12560
12561static inline uint32_t _AArch32_Read_hprlar( void )
12562{
12563 uint32_t value;
12564
12565 __asm__ volatile (
12566 "mrc p15, 4, %0, c6, c3, 1" : "=&r" ( value ) : : "memory"
12567 );
12568
12569 return value;
12570}
12571
12572static inline void _AArch32_Write_hprlar( uint32_t value )
12573{
12574 __asm__ volatile (
12575 "mcr p15, 4, %0, c6, c3, 1" : : "r" ( value ) : "memory"
12576 );
12577}
12578
12579/* HPRLAR_0, Hypervisor Protection Region Limit Address Registers */
12580
12581static inline uint32_t _AArch32_Read_hprlar_0( void )
12582{
12583 uint32_t value;
12584
12585 __asm__ volatile (
12586 "mrc p15, 4, %0, c6, c8, 1" : "=&r" ( value ) : : "memory"
12587 );
12588
12589 return value;
12590}
12591
12592static inline void _AArch32_Write_hprlar_0( uint32_t value )
12593{
12594 __asm__ volatile (
12595 "mcr p15, 4, %0, c6, c8, 1" : : "r" ( value ) : "memory"
12596 );
12597}
12598
12599/* HPRLAR_1, Hypervisor Protection Region Limit Address Registers */
12600
12601static inline uint32_t _AArch32_Read_hprlar_1( void )
12602{
12603 uint32_t value;
12604
12605 __asm__ volatile (
12606 "mrc p15, 4, %0, c6, c8, 5" : "=&r" ( value ) : : "memory"
12607 );
12608
12609 return value;
12610}
12611
12612static inline void _AArch32_Write_hprlar_1( uint32_t value )
12613{
12614 __asm__ volatile (
12615 "mcr p15, 4, %0, c6, c8, 5" : : "r" ( value ) : "memory"
12616 );
12617}
12618
12619/* HPRLAR_2, Hypervisor Protection Region Limit Address Registers */
12620
12621static inline uint32_t _AArch32_Read_hprlar_2( void )
12622{
12623 uint32_t value;
12624
12625 __asm__ volatile (
12626 "mrc p15, 4, %0, c6, c9, 1" : "=&r" ( value ) : : "memory"
12627 );
12628
12629 return value;
12630}
12631
12632static inline void _AArch32_Write_hprlar_2( uint32_t value )
12633{
12634 __asm__ volatile (
12635 "mcr p15, 4, %0, c6, c9, 1" : : "r" ( value ) : "memory"
12636 );
12637}
12638
12639/* HPRLAR_3, Hypervisor Protection Region Limit Address Registers */
12640
12641static inline uint32_t _AArch32_Read_hprlar_3( void )
12642{
12643 uint32_t value;
12644
12645 __asm__ volatile (
12646 "mrc p15, 4, %0, c6, c9, 5" : "=&r" ( value ) : : "memory"
12647 );
12648
12649 return value;
12650}
12651
12652static inline void _AArch32_Write_hprlar_3( uint32_t value )
12653{
12654 __asm__ volatile (
12655 "mcr p15, 4, %0, c6, c9, 5" : : "r" ( value ) : "memory"
12656 );
12657}
12658
12659/* HPRLAR_4, Hypervisor Protection Region Limit Address Registers */
12660
12661static inline uint32_t _AArch32_Read_hprlar_4( void )
12662{
12663 uint32_t value;
12664
12665 __asm__ volatile (
12666 "mrc p15, 4, %0, c6, c10, 1" : "=&r" ( value ) : : "memory"
12667 );
12668
12669 return value;
12670}
12671
12672static inline void _AArch32_Write_hprlar_4( uint32_t value )
12673{
12674 __asm__ volatile (
12675 "mcr p15, 4, %0, c6, c10, 1" : : "r" ( value ) : "memory"
12676 );
12677}
12678
12679/* HPRLAR_5, Hypervisor Protection Region Limit Address Registers */
12680
12681static inline uint32_t _AArch32_Read_hprlar_5( void )
12682{
12683 uint32_t value;
12684
12685 __asm__ volatile (
12686 "mrc p15, 4, %0, c6, c10, 5" : "=&r" ( value ) : : "memory"
12687 );
12688
12689 return value;
12690}
12691
12692static inline void _AArch32_Write_hprlar_5( uint32_t value )
12693{
12694 __asm__ volatile (
12695 "mcr p15, 4, %0, c6, c10, 5" : : "r" ( value ) : "memory"
12696 );
12697}
12698
12699/* HPRLAR_6, Hypervisor Protection Region Limit Address Registers */
12700
12701static inline uint32_t _AArch32_Read_hprlar_6( void )
12702{
12703 uint32_t value;
12704
12705 __asm__ volatile (
12706 "mrc p15, 4, %0, c6, c11, 1" : "=&r" ( value ) : : "memory"
12707 );
12708
12709 return value;
12710}
12711
12712static inline void _AArch32_Write_hprlar_6( uint32_t value )
12713{
12714 __asm__ volatile (
12715 "mcr p15, 4, %0, c6, c11, 1" : : "r" ( value ) : "memory"
12716 );
12717}
12718
12719/* HPRLAR_7, Hypervisor Protection Region Limit Address Registers */
12720
12721static inline uint32_t _AArch32_Read_hprlar_7( void )
12722{
12723 uint32_t value;
12724
12725 __asm__ volatile (
12726 "mrc p15, 4, %0, c6, c11, 5" : "=&r" ( value ) : : "memory"
12727 );
12728
12729 return value;
12730}
12731
12732static inline void _AArch32_Write_hprlar_7( uint32_t value )
12733{
12734 __asm__ volatile (
12735 "mcr p15, 4, %0, c6, c11, 5" : : "r" ( value ) : "memory"
12736 );
12737}
12738
12739/* HPRLAR_8, Hypervisor Protection Region Limit Address Registers */
12740
12741static inline uint32_t _AArch32_Read_hprlar_8( void )
12742{
12743 uint32_t value;
12744
12745 __asm__ volatile (
12746 "mrc p15, 4, %0, c6, c12, 1" : "=&r" ( value ) : : "memory"
12747 );
12748
12749 return value;
12750}
12751
12752static inline void _AArch32_Write_hprlar_8( uint32_t value )
12753{
12754 __asm__ volatile (
12755 "mcr p15, 4, %0, c6, c12, 1" : : "r" ( value ) : "memory"
12756 );
12757}
12758
12759/* HPRLAR_9, Hypervisor Protection Region Limit Address Registers */
12760
12761static inline uint32_t _AArch32_Read_hprlar_9( void )
12762{
12763 uint32_t value;
12764
12765 __asm__ volatile (
12766 "mrc p15, 4, %0, c6, c12, 5" : "=&r" ( value ) : : "memory"
12767 );
12768
12769 return value;
12770}
12771
12772static inline void _AArch32_Write_hprlar_9( uint32_t value )
12773{
12774 __asm__ volatile (
12775 "mcr p15, 4, %0, c6, c12, 5" : : "r" ( value ) : "memory"
12776 );
12777}
12778
12779/* HPRLAR_10, Hypervisor Protection Region Limit Address Registers */
12780
12781static inline uint32_t _AArch32_Read_hprlar_10( void )
12782{
12783 uint32_t value;
12784
12785 __asm__ volatile (
12786 "mrc p15, 4, %0, c6, c13, 1" : "=&r" ( value ) : : "memory"
12787 );
12788
12789 return value;
12790}
12791
12792static inline void _AArch32_Write_hprlar_10( uint32_t value )
12793{
12794 __asm__ volatile (
12795 "mcr p15, 4, %0, c6, c13, 1" : : "r" ( value ) : "memory"
12796 );
12797}
12798
12799/* HPRLAR_11, Hypervisor Protection Region Limit Address Registers */
12800
12801static inline uint32_t _AArch32_Read_hprlar_11( void )
12802{
12803 uint32_t value;
12804
12805 __asm__ volatile (
12806 "mrc p15, 4, %0, c6, c13, 5" : "=&r" ( value ) : : "memory"
12807 );
12808
12809 return value;
12810}
12811
12812static inline void _AArch32_Write_hprlar_11( uint32_t value )
12813{
12814 __asm__ volatile (
12815 "mcr p15, 4, %0, c6, c13, 5" : : "r" ( value ) : "memory"
12816 );
12817}
12818
12819/* HPRLAR_12, Hypervisor Protection Region Limit Address Registers */
12820
12821static inline uint32_t _AArch32_Read_hprlar_12( void )
12822{
12823 uint32_t value;
12824
12825 __asm__ volatile (
12826 "mrc p15, 4, %0, c6, c14, 1" : "=&r" ( value ) : : "memory"
12827 );
12828
12829 return value;
12830}
12831
12832static inline void _AArch32_Write_hprlar_12( uint32_t value )
12833{
12834 __asm__ volatile (
12835 "mcr p15, 4, %0, c6, c14, 1" : : "r" ( value ) : "memory"
12836 );
12837}
12838
12839/* HPRLAR_13, Hypervisor Protection Region Limit Address Registers */
12840
12841static inline uint32_t _AArch32_Read_hprlar_13( void )
12842{
12843 uint32_t value;
12844
12845 __asm__ volatile (
12846 "mrc p15, 4, %0, c6, c14, 5" : "=&r" ( value ) : : "memory"
12847 );
12848
12849 return value;
12850}
12851
12852static inline void _AArch32_Write_hprlar_13( uint32_t value )
12853{
12854 __asm__ volatile (
12855 "mcr p15, 4, %0, c6, c14, 5" : : "r" ( value ) : "memory"
12856 );
12857}
12858
12859/* HPRLAR_14, Hypervisor Protection Region Limit Address Registers */
12860
12861static inline uint32_t _AArch32_Read_hprlar_14( void )
12862{
12863 uint32_t value;
12864
12865 __asm__ volatile (
12866 "mrc p15, 4, %0, c6, c15, 1" : "=&r" ( value ) : : "memory"
12867 );
12868
12869 return value;
12870}
12871
12872static inline void _AArch32_Write_hprlar_14( uint32_t value )
12873{
12874 __asm__ volatile (
12875 "mcr p15, 4, %0, c6, c15, 1" : : "r" ( value ) : "memory"
12876 );
12877}
12878
12879/* HPRLAR_15, Hypervisor Protection Region Limit Address Registers */
12880
12881static inline uint32_t _AArch32_Read_hprlar_15( void )
12882{
12883 uint32_t value;
12884
12885 __asm__ volatile (
12886 "mrc p15, 4, %0, c6, c15, 5" : "=&r" ( value ) : : "memory"
12887 );
12888
12889 return value;
12890}
12891
12892static inline void _AArch32_Write_hprlar_15( uint32_t value )
12893{
12894 __asm__ volatile (
12895 "mcr p15, 4, %0, c6, c15, 5" : : "r" ( value ) : "memory"
12896 );
12897}
12898
12899/* HPRLAR_16, Hypervisor Protection Region Limit Address Registers */
12900
12901static inline uint32_t _AArch32_Read_hprlar_16( void )
12902{
12903 uint32_t value;
12904
12905 __asm__ volatile (
12906 "mrc p15, 5, %0, c6, c8, 1" : "=&r" ( value ) : : "memory"
12907 );
12908
12909 return value;
12910}
12911
12912static inline void _AArch32_Write_hprlar_16( uint32_t value )
12913{
12914 __asm__ volatile (
12915 "mcr p15, 5, %0, c6, c8, 1" : : "r" ( value ) : "memory"
12916 );
12917}
12918
12919/* HPRLAR_17, Hypervisor Protection Region Limit Address Registers */
12920
12921static inline uint32_t _AArch32_Read_hprlar_17( void )
12922{
12923 uint32_t value;
12924
12925 __asm__ volatile (
12926 "mrc p15, 5, %0, c6, c8, 5" : "=&r" ( value ) : : "memory"
12927 );
12928
12929 return value;
12930}
12931
12932static inline void _AArch32_Write_hprlar_17( uint32_t value )
12933{
12934 __asm__ volatile (
12935 "mcr p15, 5, %0, c6, c8, 5" : : "r" ( value ) : "memory"
12936 );
12937}
12938
12939/* HPRLAR_18, Hypervisor Protection Region Limit Address Registers */
12940
12941static inline uint32_t _AArch32_Read_hprlar_18( void )
12942{
12943 uint32_t value;
12944
12945 __asm__ volatile (
12946 "mrc p15, 5, %0, c6, c9, 1" : "=&r" ( value ) : : "memory"
12947 );
12948
12949 return value;
12950}
12951
12952static inline void _AArch32_Write_hprlar_18( uint32_t value )
12953{
12954 __asm__ volatile (
12955 "mcr p15, 5, %0, c6, c9, 1" : : "r" ( value ) : "memory"
12956 );
12957}
12958
12959/* HPRLAR_19, Hypervisor Protection Region Limit Address Registers */
12960
12961static inline uint32_t _AArch32_Read_hprlar_19( void )
12962{
12963 uint32_t value;
12964
12965 __asm__ volatile (
12966 "mrc p15, 5, %0, c6, c9, 5" : "=&r" ( value ) : : "memory"
12967 );
12968
12969 return value;
12970}
12971
12972static inline void _AArch32_Write_hprlar_19( uint32_t value )
12973{
12974 __asm__ volatile (
12975 "mcr p15, 5, %0, c6, c9, 5" : : "r" ( value ) : "memory"
12976 );
12977}
12978
12979/* HPRLAR_20, Hypervisor Protection Region Limit Address Registers */
12980
12981static inline uint32_t _AArch32_Read_hprlar_20( void )
12982{
12983 uint32_t value;
12984
12985 __asm__ volatile (
12986 "mrc p15, 5, %0, c6, c10, 1" : "=&r" ( value ) : : "memory"
12987 );
12988
12989 return value;
12990}
12991
12992static inline void _AArch32_Write_hprlar_20( uint32_t value )
12993{
12994 __asm__ volatile (
12995 "mcr p15, 5, %0, c6, c10, 1" : : "r" ( value ) : "memory"
12996 );
12997}
12998
12999/* HPRLAR_21, Hypervisor Protection Region Limit Address Registers */
13000
13001static inline uint32_t _AArch32_Read_hprlar_21( void )
13002{
13003 uint32_t value;
13004
13005 __asm__ volatile (
13006 "mrc p15, 5, %0, c6, c10, 5" : "=&r" ( value ) : : "memory"
13007 );
13008
13009 return value;
13010}
13011
13012static inline void _AArch32_Write_hprlar_21( uint32_t value )
13013{
13014 __asm__ volatile (
13015 "mcr p15, 5, %0, c6, c10, 5" : : "r" ( value ) : "memory"
13016 );
13017}
13018
13019/* HPRLAR_22, Hypervisor Protection Region Limit Address Registers */
13020
13021static inline uint32_t _AArch32_Read_hprlar_22( void )
13022{
13023 uint32_t value;
13024
13025 __asm__ volatile (
13026 "mrc p15, 5, %0, c6, c11, 1" : "=&r" ( value ) : : "memory"
13027 );
13028
13029 return value;
13030}
13031
13032static inline void _AArch32_Write_hprlar_22( uint32_t value )
13033{
13034 __asm__ volatile (
13035 "mcr p15, 5, %0, c6, c11, 1" : : "r" ( value ) : "memory"
13036 );
13037}
13038
13039/* HPRLAR_23, Hypervisor Protection Region Limit Address Registers */
13040
13041static inline uint32_t _AArch32_Read_hprlar_23( void )
13042{
13043 uint32_t value;
13044
13045 __asm__ volatile (
13046 "mrc p15, 5, %0, c6, c11, 5" : "=&r" ( value ) : : "memory"
13047 );
13048
13049 return value;
13050}
13051
13052static inline void _AArch32_Write_hprlar_23( uint32_t value )
13053{
13054 __asm__ volatile (
13055 "mcr p15, 5, %0, c6, c11, 5" : : "r" ( value ) : "memory"
13056 );
13057}
13058
13059/* HPRLAR_24, Hypervisor Protection Region Limit Address Registers */
13060
13061static inline uint32_t _AArch32_Read_hprlar_24( void )
13062{
13063 uint32_t value;
13064
13065 __asm__ volatile (
13066 "mrc p15, 5, %0, c6, c12, 1" : "=&r" ( value ) : : "memory"
13067 );
13068
13069 return value;
13070}
13071
13072static inline void _AArch32_Write_hprlar_24( uint32_t value )
13073{
13074 __asm__ volatile (
13075 "mcr p15, 5, %0, c6, c12, 1" : : "r" ( value ) : "memory"
13076 );
13077}
13078
13079/* HPRLAR_25, Hypervisor Protection Region Limit Address Registers */
13080
13081static inline uint32_t _AArch32_Read_hprlar_25( void )
13082{
13083 uint32_t value;
13084
13085 __asm__ volatile (
13086 "mrc p15, 5, %0, c6, c12, 5" : "=&r" ( value ) : : "memory"
13087 );
13088
13089 return value;
13090}
13091
13092static inline void _AArch32_Write_hprlar_25( uint32_t value )
13093{
13094 __asm__ volatile (
13095 "mcr p15, 5, %0, c6, c12, 5" : : "r" ( value ) : "memory"
13096 );
13097}
13098
13099/* HPRLAR_26, Hypervisor Protection Region Limit Address Registers */
13100
13101static inline uint32_t _AArch32_Read_hprlar_26( void )
13102{
13103 uint32_t value;
13104
13105 __asm__ volatile (
13106 "mrc p15, 5, %0, c6, c13, 1" : "=&r" ( value ) : : "memory"
13107 );
13108
13109 return value;
13110}
13111
13112static inline void _AArch32_Write_hprlar_26( uint32_t value )
13113{
13114 __asm__ volatile (
13115 "mcr p15, 5, %0, c6, c13, 1" : : "r" ( value ) : "memory"
13116 );
13117}
13118
13119/* HPRLAR_27, Hypervisor Protection Region Limit Address Registers */
13120
13121static inline uint32_t _AArch32_Read_hprlar_27( void )
13122{
13123 uint32_t value;
13124
13125 __asm__ volatile (
13126 "mrc p15, 5, %0, c6, c13, 5" : "=&r" ( value ) : : "memory"
13127 );
13128
13129 return value;
13130}
13131
13132static inline void _AArch32_Write_hprlar_27( uint32_t value )
13133{
13134 __asm__ volatile (
13135 "mcr p15, 5, %0, c6, c13, 5" : : "r" ( value ) : "memory"
13136 );
13137}
13138
13139/* HPRLAR_28, Hypervisor Protection Region Limit Address Registers */
13140
13141static inline uint32_t _AArch32_Read_hprlar_28( void )
13142{
13143 uint32_t value;
13144
13145 __asm__ volatile (
13146 "mrc p15, 5, %0, c6, c14, 1" : "=&r" ( value ) : : "memory"
13147 );
13148
13149 return value;
13150}
13151
13152static inline void _AArch32_Write_hprlar_28( uint32_t value )
13153{
13154 __asm__ volatile (
13155 "mcr p15, 5, %0, c6, c14, 1" : : "r" ( value ) : "memory"
13156 );
13157}
13158
13159/* HPRLAR_29, Hypervisor Protection Region Limit Address Registers */
13160
13161static inline uint32_t _AArch32_Read_hprlar_29( void )
13162{
13163 uint32_t value;
13164
13165 __asm__ volatile (
13166 "mrc p15, 5, %0, c6, c14, 5" : "=&r" ( value ) : : "memory"
13167 );
13168
13169 return value;
13170}
13171
13172static inline void _AArch32_Write_hprlar_29( uint32_t value )
13173{
13174 __asm__ volatile (
13175 "mcr p15, 5, %0, c6, c14, 5" : : "r" ( value ) : "memory"
13176 );
13177}
13178
13179/* HPRLAR_30, Hypervisor Protection Region Limit Address Registers */
13180
13181static inline uint32_t _AArch32_Read_hprlar_30( void )
13182{
13183 uint32_t value;
13184
13185 __asm__ volatile (
13186 "mrc p15, 5, %0, c6, c15, 1" : "=&r" ( value ) : : "memory"
13187 );
13188
13189 return value;
13190}
13191
13192static inline void _AArch32_Write_hprlar_30( uint32_t value )
13193{
13194 __asm__ volatile (
13195 "mcr p15, 5, %0, c6, c15, 1" : : "r" ( value ) : "memory"
13196 );
13197}
13198
13199/* HPRLAR_31, Hypervisor Protection Region Limit Address Registers */
13200
13201static inline uint32_t _AArch32_Read_hprlar_31( void )
13202{
13203 uint32_t value;
13204
13205 __asm__ volatile (
13206 "mrc p15, 5, %0, c6, c15, 5" : "=&r" ( value ) : : "memory"
13207 );
13208
13209 return value;
13210}
13211
13212static inline void _AArch32_Write_hprlar_31( uint32_t value )
13213{
13214 __asm__ volatile (
13215 "mcr p15, 5, %0, c6, c15, 5" : : "r" ( value ) : "memory"
13216 );
13217}
13218
13219/* HPRSELR, Hypervisor Protection Region Selector Register */
13220
13221#define AARCH32_HPRSELR_REGION( _val ) ( ( _val ) << 0 )
13222#define AARCH32_HPRSELR_REGION_SHIFT 0
13223#define AARCH32_HPRSELR_REGION_MASK 0xffU
13224#define AARCH32_HPRSELR_REGION_GET( _reg ) \
13225 ( ( ( _reg ) >> 0 ) & 0xffU )
13226
13227static inline uint32_t _AArch32_Read_hprselr( void )
13228{
13229 uint32_t value;
13230
13231 __asm__ volatile (
13232 "mrc p15, 4, %0, c6, c2, 1" : "=&r" ( value ) : : "memory"
13233 );
13234
13235 return value;
13236}
13237
13238static inline void _AArch32_Write_hprselr( uint32_t value )
13239{
13240 __asm__ volatile (
13241 "mcr p15, 4, %0, c6, c2, 1" : : "r" ( value ) : "memory"
13242 );
13243}
13244
13245/* MPUIR, MPU Type Register */
13246
13247#define AARCH32_MPUIR_REGION( _val ) ( ( _val ) << 8 )
13248#define AARCH32_MPUIR_REGION_SHIFT 8
13249#define AARCH32_MPUIR_REGION_MASK 0xff00U
13250#define AARCH32_MPUIR_REGION_GET( _reg ) \
13251 ( ( ( _reg ) >> 8 ) & 0xffU )
13252
13253static inline uint32_t _AArch32_Read_mpuir( void )
13254{
13255 uint32_t value;
13256
13257 __asm__ volatile (
13258 "mrc p15, 0, %0, c0, c0, 4" : "=&r" ( value ) : : "memory"
13259 );
13260
13261 return value;
13262}
13263
13264static inline void _AArch32_Write_mpuir( uint32_t value )
13265{
13266 __asm__ volatile (
13267 "mcr p15, 0, %0, c0, c0, 4" : : "r" ( value ) : "memory"
13268 );
13269}
13270
13271/* PRBAR, Protection Region Base Address Register */
13272
13273#define AARCH32_PRBAR_XN 0x1U
13274
13275#define AARCH32_PRBAR_AP_2_1( _val ) ( ( _val ) << 1 )
13276#define AARCH32_PRBAR_AP_2_1_SHIFT 1
13277#define AARCH32_PRBAR_AP_2_1_MASK 0x6U
13278#define AARCH32_PRBAR_AP_2_1_GET( _reg ) \
13279 ( ( ( _reg ) >> 1 ) & 0x3U )
13280
13281#define AARCH32_PRBAR_SH_1_0( _val ) ( ( _val ) << 3 )
13282#define AARCH32_PRBAR_SH_1_0_SHIFT 3
13283#define AARCH32_PRBAR_SH_1_0_MASK 0x18U
13284#define AARCH32_PRBAR_SH_1_0_GET( _reg ) \
13285 ( ( ( _reg ) >> 3 ) & 0x3U )
13286
13287#define AARCH32_PRBAR_BASE( _val ) ( ( _val ) << 6 )
13288#define AARCH32_PRBAR_BASE_SHIFT 6
13289#define AARCH32_PRBAR_BASE_MASK 0xffffffc0U
13290#define AARCH32_PRBAR_BASE_GET( _reg ) \
13291 ( ( ( _reg ) >> 6 ) & 0x3ffffffU )
13292
13293static inline uint32_t _AArch32_Read_prbar( void )
13294{
13295 uint32_t value;
13296
13297 __asm__ volatile (
13298 "mrc p15, 0, %0, c6, c3, 0" : "=&r" ( value ) : : "memory"
13299 );
13300
13301 return value;
13302}
13303
13304static inline void _AArch32_Write_prbar( uint32_t value )
13305{
13306 __asm__ volatile (
13307 "mcr p15, 0, %0, c6, c3, 0" : : "r" ( value ) : "memory"
13308 );
13309}
13310
13311/* PRBAR_0, Protection Region Base Address Registers */
13312
13313static inline uint32_t _AArch32_Read_prbar_0( void )
13314{
13315 uint32_t value;
13316
13317 __asm__ volatile (
13318 "mrc p15, 0, %0, c6, c8, 0" : "=&r" ( value ) : : "memory"
13319 );
13320
13321 return value;
13322}
13323
13324static inline void _AArch32_Write_prbar_0( uint32_t value )
13325{
13326 __asm__ volatile (
13327 "mcr p15, 0, %0, c6, c8, 0" : : "r" ( value ) : "memory"
13328 );
13329}
13330
13331/* PRBAR_1, Protection Region Base Address Registers */
13332
13333static inline uint32_t _AArch32_Read_prbar_1( void )
13334{
13335 uint32_t value;
13336
13337 __asm__ volatile (
13338 "mrc p15, 0, %0, c6, c8, 4" : "=&r" ( value ) : : "memory"
13339 );
13340
13341 return value;
13342}
13343
13344static inline void _AArch32_Write_prbar_1( uint32_t value )
13345{
13346 __asm__ volatile (
13347 "mcr p15, 0, %0, c6, c8, 4" : : "r" ( value ) : "memory"
13348 );
13349}
13350
13351/* PRBAR_2, Protection Region Base Address Registers */
13352
13353static inline uint32_t _AArch32_Read_prbar_2( void )
13354{
13355 uint32_t value;
13356
13357 __asm__ volatile (
13358 "mrc p15, 0, %0, c6, c9, 0" : "=&r" ( value ) : : "memory"
13359 );
13360
13361 return value;
13362}
13363
13364static inline void _AArch32_Write_prbar_2( uint32_t value )
13365{
13366 __asm__ volatile (
13367 "mcr p15, 0, %0, c6, c9, 0" : : "r" ( value ) : "memory"
13368 );
13369}
13370
13371/* PRBAR_3, Protection Region Base Address Registers */
13372
13373static inline uint32_t _AArch32_Read_prbar_3( void )
13374{
13375 uint32_t value;
13376
13377 __asm__ volatile (
13378 "mrc p15, 0, %0, c6, c9, 4" : "=&r" ( value ) : : "memory"
13379 );
13380
13381 return value;
13382}
13383
13384static inline void _AArch32_Write_prbar_3( uint32_t value )
13385{
13386 __asm__ volatile (
13387 "mcr p15, 0, %0, c6, c9, 4" : : "r" ( value ) : "memory"
13388 );
13389}
13390
13391/* PRBAR_4, Protection Region Base Address Registers */
13392
13393static inline uint32_t _AArch32_Read_prbar_4( void )
13394{
13395 uint32_t value;
13396
13397 __asm__ volatile (
13398 "mrc p15, 0, %0, c6, c10, 0" : "=&r" ( value ) : : "memory"
13399 );
13400
13401 return value;
13402}
13403
13404static inline void _AArch32_Write_prbar_4( uint32_t value )
13405{
13406 __asm__ volatile (
13407 "mcr p15, 0, %0, c6, c10, 0" : : "r" ( value ) : "memory"
13408 );
13409}
13410
13411/* PRBAR_5, Protection Region Base Address Registers */
13412
13413static inline uint32_t _AArch32_Read_prbar_5( void )
13414{
13415 uint32_t value;
13416
13417 __asm__ volatile (
13418 "mrc p15, 0, %0, c6, c10, 4" : "=&r" ( value ) : : "memory"
13419 );
13420
13421 return value;
13422}
13423
13424static inline void _AArch32_Write_prbar_5( uint32_t value )
13425{
13426 __asm__ volatile (
13427 "mcr p15, 0, %0, c6, c10, 4" : : "r" ( value ) : "memory"
13428 );
13429}
13430
13431/* PRBAR_6, Protection Region Base Address Registers */
13432
13433static inline uint32_t _AArch32_Read_prbar_6( void )
13434{
13435 uint32_t value;
13436
13437 __asm__ volatile (
13438 "mrc p15, 0, %0, c6, c11, 0" : "=&r" ( value ) : : "memory"
13439 );
13440
13441 return value;
13442}
13443
13444static inline void _AArch32_Write_prbar_6( uint32_t value )
13445{
13446 __asm__ volatile (
13447 "mcr p15, 0, %0, c6, c11, 0" : : "r" ( value ) : "memory"
13448 );
13449}
13450
13451/* PRBAR_7, Protection Region Base Address Registers */
13452
13453static inline uint32_t _AArch32_Read_prbar_7( void )
13454{
13455 uint32_t value;
13456
13457 __asm__ volatile (
13458 "mrc p15, 0, %0, c6, c11, 4" : "=&r" ( value ) : : "memory"
13459 );
13460
13461 return value;
13462}
13463
13464static inline void _AArch32_Write_prbar_7( uint32_t value )
13465{
13466 __asm__ volatile (
13467 "mcr p15, 0, %0, c6, c11, 4" : : "r" ( value ) : "memory"
13468 );
13469}
13470
13471/* PRBAR_8, Protection Region Base Address Registers */
13472
13473static inline uint32_t _AArch32_Read_prbar_8( void )
13474{
13475 uint32_t value;
13476
13477 __asm__ volatile (
13478 "mrc p15, 0, %0, c6, c12, 0" : "=&r" ( value ) : : "memory"
13479 );
13480
13481 return value;
13482}
13483
13484static inline void _AArch32_Write_prbar_8( uint32_t value )
13485{
13486 __asm__ volatile (
13487 "mcr p15, 0, %0, c6, c12, 0" : : "r" ( value ) : "memory"
13488 );
13489}
13490
13491/* PRBAR_9, Protection Region Base Address Registers */
13492
13493static inline uint32_t _AArch32_Read_prbar_9( void )
13494{
13495 uint32_t value;
13496
13497 __asm__ volatile (
13498 "mrc p15, 0, %0, c6, c12, 4" : "=&r" ( value ) : : "memory"
13499 );
13500
13501 return value;
13502}
13503
13504static inline void _AArch32_Write_prbar_9( uint32_t value )
13505{
13506 __asm__ volatile (
13507 "mcr p15, 0, %0, c6, c12, 4" : : "r" ( value ) : "memory"
13508 );
13509}
13510
13511/* PRBAR_10, Protection Region Base Address Registers */
13512
13513static inline uint32_t _AArch32_Read_prbar_10( void )
13514{
13515 uint32_t value;
13516
13517 __asm__ volatile (
13518 "mrc p15, 0, %0, c6, c13, 0" : "=&r" ( value ) : : "memory"
13519 );
13520
13521 return value;
13522}
13523
13524static inline void _AArch32_Write_prbar_10( uint32_t value )
13525{
13526 __asm__ volatile (
13527 "mcr p15, 0, %0, c6, c13, 0" : : "r" ( value ) : "memory"
13528 );
13529}
13530
13531/* PRBAR_11, Protection Region Base Address Registers */
13532
13533static inline uint32_t _AArch32_Read_prbar_11( void )
13534{
13535 uint32_t value;
13536
13537 __asm__ volatile (
13538 "mrc p15, 0, %0, c6, c13, 4" : "=&r" ( value ) : : "memory"
13539 );
13540
13541 return value;
13542}
13543
13544static inline void _AArch32_Write_prbar_11( uint32_t value )
13545{
13546 __asm__ volatile (
13547 "mcr p15, 0, %0, c6, c13, 4" : : "r" ( value ) : "memory"
13548 );
13549}
13550
13551/* PRBAR_12, Protection Region Base Address Registers */
13552
13553static inline uint32_t _AArch32_Read_prbar_12( void )
13554{
13555 uint32_t value;
13556
13557 __asm__ volatile (
13558 "mrc p15, 0, %0, c6, c14, 0" : "=&r" ( value ) : : "memory"
13559 );
13560
13561 return value;
13562}
13563
13564static inline void _AArch32_Write_prbar_12( uint32_t value )
13565{
13566 __asm__ volatile (
13567 "mcr p15, 0, %0, c6, c14, 0" : : "r" ( value ) : "memory"
13568 );
13569}
13570
13571/* PRBAR_13, Protection Region Base Address Registers */
13572
13573static inline uint32_t _AArch32_Read_prbar_13( void )
13574{
13575 uint32_t value;
13576
13577 __asm__ volatile (
13578 "mrc p15, 0, %0, c6, c14, 4" : "=&r" ( value ) : : "memory"
13579 );
13580
13581 return value;
13582}
13583
13584static inline void _AArch32_Write_prbar_13( uint32_t value )
13585{
13586 __asm__ volatile (
13587 "mcr p15, 0, %0, c6, c14, 4" : : "r" ( value ) : "memory"
13588 );
13589}
13590
13591/* PRBAR_14, Protection Region Base Address Registers */
13592
13593static inline uint32_t _AArch32_Read_prbar_14( void )
13594{
13595 uint32_t value;
13596
13597 __asm__ volatile (
13598 "mrc p15, 0, %0, c6, c15, 0" : "=&r" ( value ) : : "memory"
13599 );
13600
13601 return value;
13602}
13603
13604static inline void _AArch32_Write_prbar_14( uint32_t value )
13605{
13606 __asm__ volatile (
13607 "mcr p15, 0, %0, c6, c15, 0" : : "r" ( value ) : "memory"
13608 );
13609}
13610
13611/* PRBAR_15, Protection Region Base Address Registers */
13612
13613static inline uint32_t _AArch32_Read_prbar_15( void )
13614{
13615 uint32_t value;
13616
13617 __asm__ volatile (
13618 "mrc p15, 0, %0, c6, c15, 4" : "=&r" ( value ) : : "memory"
13619 );
13620
13621 return value;
13622}
13623
13624static inline void _AArch32_Write_prbar_15( uint32_t value )
13625{
13626 __asm__ volatile (
13627 "mcr p15, 0, %0, c6, c15, 4" : : "r" ( value ) : "memory"
13628 );
13629}
13630
13631/* PRBAR_16, Protection Region Base Address Registers */
13632
13633static inline uint32_t _AArch32_Read_prbar_16( void )
13634{
13635 uint32_t value;
13636
13637 __asm__ volatile (
13638 "mrc p15, 1, %0, c6, c8, 0" : "=&r" ( value ) : : "memory"
13639 );
13640
13641 return value;
13642}
13643
13644static inline void _AArch32_Write_prbar_16( uint32_t value )
13645{
13646 __asm__ volatile (
13647 "mcr p15, 1, %0, c6, c8, 0" : : "r" ( value ) : "memory"
13648 );
13649}
13650
13651/* PRBAR_17, Protection Region Base Address Registers */
13652
13653static inline uint32_t _AArch32_Read_prbar_17( void )
13654{
13655 uint32_t value;
13656
13657 __asm__ volatile (
13658 "mrc p15, 1, %0, c6, c8, 4" : "=&r" ( value ) : : "memory"
13659 );
13660
13661 return value;
13662}
13663
13664static inline void _AArch32_Write_prbar_17( uint32_t value )
13665{
13666 __asm__ volatile (
13667 "mcr p15, 1, %0, c6, c8, 4" : : "r" ( value ) : "memory"
13668 );
13669}
13670
13671/* PRBAR_18, Protection Region Base Address Registers */
13672
13673static inline uint32_t _AArch32_Read_prbar_18( void )
13674{
13675 uint32_t value;
13676
13677 __asm__ volatile (
13678 "mrc p15, 1, %0, c6, c9, 0" : "=&r" ( value ) : : "memory"
13679 );
13680
13681 return value;
13682}
13683
13684static inline void _AArch32_Write_prbar_18( uint32_t value )
13685{
13686 __asm__ volatile (
13687 "mcr p15, 1, %0, c6, c9, 0" : : "r" ( value ) : "memory"
13688 );
13689}
13690
13691/* PRBAR_19, Protection Region Base Address Registers */
13692
13693static inline uint32_t _AArch32_Read_prbar_19( void )
13694{
13695 uint32_t value;
13696
13697 __asm__ volatile (
13698 "mrc p15, 1, %0, c6, c9, 4" : "=&r" ( value ) : : "memory"
13699 );
13700
13701 return value;
13702}
13703
13704static inline void _AArch32_Write_prbar_19( uint32_t value )
13705{
13706 __asm__ volatile (
13707 "mcr p15, 1, %0, c6, c9, 4" : : "r" ( value ) : "memory"
13708 );
13709}
13710
13711/* PRBAR_20, Protection Region Base Address Registers */
13712
13713static inline uint32_t _AArch32_Read_prbar_20( void )
13714{
13715 uint32_t value;
13716
13717 __asm__ volatile (
13718 "mrc p15, 1, %0, c6, c10, 0" : "=&r" ( value ) : : "memory"
13719 );
13720
13721 return value;
13722}
13723
13724static inline void _AArch32_Write_prbar_20( uint32_t value )
13725{
13726 __asm__ volatile (
13727 "mcr p15, 1, %0, c6, c10, 0" : : "r" ( value ) : "memory"
13728 );
13729}
13730
13731/* PRBAR_21, Protection Region Base Address Registers */
13732
13733static inline uint32_t _AArch32_Read_prbar_21( void )
13734{
13735 uint32_t value;
13736
13737 __asm__ volatile (
13738 "mrc p15, 1, %0, c6, c10, 4" : "=&r" ( value ) : : "memory"
13739 );
13740
13741 return value;
13742}
13743
13744static inline void _AArch32_Write_prbar_21( uint32_t value )
13745{
13746 __asm__ volatile (
13747 "mcr p15, 1, %0, c6, c10, 4" : : "r" ( value ) : "memory"
13748 );
13749}
13750
13751/* PRBAR_22, Protection Region Base Address Registers */
13752
13753static inline uint32_t _AArch32_Read_prbar_22( void )
13754{
13755 uint32_t value;
13756
13757 __asm__ volatile (
13758 "mrc p15, 1, %0, c6, c11, 0" : "=&r" ( value ) : : "memory"
13759 );
13760
13761 return value;
13762}
13763
13764static inline void _AArch32_Write_prbar_22( uint32_t value )
13765{
13766 __asm__ volatile (
13767 "mcr p15, 1, %0, c6, c11, 0" : : "r" ( value ) : "memory"
13768 );
13769}
13770
13771/* PRBAR_23, Protection Region Base Address Registers */
13772
13773static inline uint32_t _AArch32_Read_prbar_23( void )
13774{
13775 uint32_t value;
13776
13777 __asm__ volatile (
13778 "mrc p15, 1, %0, c6, c11, 4" : "=&r" ( value ) : : "memory"
13779 );
13780
13781 return value;
13782}
13783
13784static inline void _AArch32_Write_prbar_23( uint32_t value )
13785{
13786 __asm__ volatile (
13787 "mcr p15, 1, %0, c6, c11, 4" : : "r" ( value ) : "memory"
13788 );
13789}
13790
13791/* PRBAR_24, Protection Region Base Address Registers */
13792
13793static inline uint32_t _AArch32_Read_prbar_24( void )
13794{
13795 uint32_t value;
13796
13797 __asm__ volatile (
13798 "mrc p15, 1, %0, c6, c12, 0" : "=&r" ( value ) : : "memory"
13799 );
13800
13801 return value;
13802}
13803
13804static inline void _AArch32_Write_prbar_24( uint32_t value )
13805{
13806 __asm__ volatile (
13807 "mcr p15, 1, %0, c6, c12, 0" : : "r" ( value ) : "memory"
13808 );
13809}
13810
13811/* PRBAR_25, Protection Region Base Address Registers */
13812
13813static inline uint32_t _AArch32_Read_prbar_25( void )
13814{
13815 uint32_t value;
13816
13817 __asm__ volatile (
13818 "mrc p15, 1, %0, c6, c12, 4" : "=&r" ( value ) : : "memory"
13819 );
13820
13821 return value;
13822}
13823
13824static inline void _AArch32_Write_prbar_25( uint32_t value )
13825{
13826 __asm__ volatile (
13827 "mcr p15, 1, %0, c6, c12, 4" : : "r" ( value ) : "memory"
13828 );
13829}
13830
13831/* PRBAR_26, Protection Region Base Address Registers */
13832
13833static inline uint32_t _AArch32_Read_prbar_26( void )
13834{
13835 uint32_t value;
13836
13837 __asm__ volatile (
13838 "mrc p15, 1, %0, c6, c13, 0" : "=&r" ( value ) : : "memory"
13839 );
13840
13841 return value;
13842}
13843
13844static inline void _AArch32_Write_prbar_26( uint32_t value )
13845{
13846 __asm__ volatile (
13847 "mcr p15, 1, %0, c6, c13, 0" : : "r" ( value ) : "memory"
13848 );
13849}
13850
13851/* PRBAR_27, Protection Region Base Address Registers */
13852
13853static inline uint32_t _AArch32_Read_prbar_27( void )
13854{
13855 uint32_t value;
13856
13857 __asm__ volatile (
13858 "mrc p15, 1, %0, c6, c13, 4" : "=&r" ( value ) : : "memory"
13859 );
13860
13861 return value;
13862}
13863
13864static inline void _AArch32_Write_prbar_27( uint32_t value )
13865{
13866 __asm__ volatile (
13867 "mcr p15, 1, %0, c6, c13, 4" : : "r" ( value ) : "memory"
13868 );
13869}
13870
13871/* PRBAR_28, Protection Region Base Address Registers */
13872
13873static inline uint32_t _AArch32_Read_prbar_28( void )
13874{
13875 uint32_t value;
13876
13877 __asm__ volatile (
13878 "mrc p15, 1, %0, c6, c14, 0" : "=&r" ( value ) : : "memory"
13879 );
13880
13881 return value;
13882}
13883
13884static inline void _AArch32_Write_prbar_28( uint32_t value )
13885{
13886 __asm__ volatile (
13887 "mcr p15, 1, %0, c6, c14, 0" : : "r" ( value ) : "memory"
13888 );
13889}
13890
13891/* PRBAR_29, Protection Region Base Address Registers */
13892
13893static inline uint32_t _AArch32_Read_prbar_29( void )
13894{
13895 uint32_t value;
13896
13897 __asm__ volatile (
13898 "mrc p15, 1, %0, c6, c14, 4" : "=&r" ( value ) : : "memory"
13899 );
13900
13901 return value;
13902}
13903
13904static inline void _AArch32_Write_prbar_29( uint32_t value )
13905{
13906 __asm__ volatile (
13907 "mcr p15, 1, %0, c6, c14, 4" : : "r" ( value ) : "memory"
13908 );
13909}
13910
13911/* PRBAR_30, Protection Region Base Address Registers */
13912
13913static inline uint32_t _AArch32_Read_prbar_30( void )
13914{
13915 uint32_t value;
13916
13917 __asm__ volatile (
13918 "mrc p15, 1, %0, c6, c15, 0" : "=&r" ( value ) : : "memory"
13919 );
13920
13921 return value;
13922}
13923
13924static inline void _AArch32_Write_prbar_30( uint32_t value )
13925{
13926 __asm__ volatile (
13927 "mcr p15, 1, %0, c6, c15, 0" : : "r" ( value ) : "memory"
13928 );
13929}
13930
13931/* PRBAR_31, Protection Region Base Address Registers */
13932
13933static inline uint32_t _AArch32_Read_prbar_31( void )
13934{
13935 uint32_t value;
13936
13937 __asm__ volatile (
13938 "mrc p15, 1, %0, c6, c15, 4" : "=&r" ( value ) : : "memory"
13939 );
13940
13941 return value;
13942}
13943
13944static inline void _AArch32_Write_prbar_31( uint32_t value )
13945{
13946 __asm__ volatile (
13947 "mcr p15, 1, %0, c6, c15, 4" : : "r" ( value ) : "memory"
13948 );
13949}
13950
13951/* PRLAR, Protection Region Limit Address Register */
13952
13953#define AARCH32_PRLAR_EN 0x1U
13954
13955#define AARCH32_PRLAR_ATTRINDX_2_0( _val ) ( ( _val ) << 1 )
13956#define AARCH32_PRLAR_ATTRINDX_2_0_SHIFT 1
13957#define AARCH32_PRLAR_ATTRINDX_2_0_MASK 0xeU
13958#define AARCH32_PRLAR_ATTRINDX_2_0_GET( _reg ) \
13959 ( ( ( _reg ) >> 1 ) & 0x7U )
13960
13961#define AARCH32_PRLAR_LIMIT( _val ) ( ( _val ) << 6 )
13962#define AARCH32_PRLAR_LIMIT_SHIFT 6
13963#define AARCH32_PRLAR_LIMIT_MASK 0xffffffc0U
13964#define AARCH32_PRLAR_LIMIT_GET( _reg ) \
13965 ( ( ( _reg ) >> 6 ) & 0x3ffffffU )
13966
13967static inline uint32_t _AArch32_Read_prlar( void )
13968{
13969 uint32_t value;
13970
13971 __asm__ volatile (
13972 "mrc p15, 0, %0, c6, c3, 1" : "=&r" ( value ) : : "memory"
13973 );
13974
13975 return value;
13976}
13977
13978static inline void _AArch32_Write_prlar( uint32_t value )
13979{
13980 __asm__ volatile (
13981 "mcr p15, 0, %0, c6, c3, 1" : : "r" ( value ) : "memory"
13982 );
13983}
13984
13985/* PRLAR_0, Protection Region Limit Address Registers */
13986
13987static inline uint32_t _AArch32_Read_prlar_0( void )
13988{
13989 uint32_t value;
13990
13991 __asm__ volatile (
13992 "mrc p15, 0, %0, c6, c8, 1" : "=&r" ( value ) : : "memory"
13993 );
13994
13995 return value;
13996}
13997
13998static inline void _AArch32_Write_prlar_0( uint32_t value )
13999{
14000 __asm__ volatile (
14001 "mcr p15, 0, %0, c6, c8, 1" : : "r" ( value ) : "memory"
14002 );
14003}
14004
14005/* PRLAR_1, Protection Region Limit Address Registers */
14006
14007static inline uint32_t _AArch32_Read_prlar_1( void )
14008{
14009 uint32_t value;
14010
14011 __asm__ volatile (
14012 "mrc p15, 0, %0, c6, c8, 5" : "=&r" ( value ) : : "memory"
14013 );
14014
14015 return value;
14016}
14017
14018static inline void _AArch32_Write_prlar_1( uint32_t value )
14019{
14020 __asm__ volatile (
14021 "mcr p15, 0, %0, c6, c8, 5" : : "r" ( value ) : "memory"
14022 );
14023}
14024
14025/* PRLAR_2, Protection Region Limit Address Registers */
14026
14027static inline uint32_t _AArch32_Read_prlar_2( void )
14028{
14029 uint32_t value;
14030
14031 __asm__ volatile (
14032 "mrc p15, 0, %0, c6, c9, 1" : "=&r" ( value ) : : "memory"
14033 );
14034
14035 return value;
14036}
14037
14038static inline void _AArch32_Write_prlar_2( uint32_t value )
14039{
14040 __asm__ volatile (
14041 "mcr p15, 0, %0, c6, c9, 1" : : "r" ( value ) : "memory"
14042 );
14043}
14044
14045/* PRLAR_3, Protection Region Limit Address Registers */
14046
14047static inline uint32_t _AArch32_Read_prlar_3( void )
14048{
14049 uint32_t value;
14050
14051 __asm__ volatile (
14052 "mrc p15, 0, %0, c6, c9, 5" : "=&r" ( value ) : : "memory"
14053 );
14054
14055 return value;
14056}
14057
14058static inline void _AArch32_Write_prlar_3( uint32_t value )
14059{
14060 __asm__ volatile (
14061 "mcr p15, 0, %0, c6, c9, 5" : : "r" ( value ) : "memory"
14062 );
14063}
14064
14065/* PRLAR_4, Protection Region Limit Address Registers */
14066
14067static inline uint32_t _AArch32_Read_prlar_4( void )
14068{
14069 uint32_t value;
14070
14071 __asm__ volatile (
14072 "mrc p15, 0, %0, c6, c10, 1" : "=&r" ( value ) : : "memory"
14073 );
14074
14075 return value;
14076}
14077
14078static inline void _AArch32_Write_prlar_4( uint32_t value )
14079{
14080 __asm__ volatile (
14081 "mcr p15, 0, %0, c6, c10, 1" : : "r" ( value ) : "memory"
14082 );
14083}
14084
14085/* PRLAR_5, Protection Region Limit Address Registers */
14086
14087static inline uint32_t _AArch32_Read_prlar_5( void )
14088{
14089 uint32_t value;
14090
14091 __asm__ volatile (
14092 "mrc p15, 0, %0, c6, c10, 5" : "=&r" ( value ) : : "memory"
14093 );
14094
14095 return value;
14096}
14097
14098static inline void _AArch32_Write_prlar_5( uint32_t value )
14099{
14100 __asm__ volatile (
14101 "mcr p15, 0, %0, c6, c10, 5" : : "r" ( value ) : "memory"
14102 );
14103}
14104
14105/* PRLAR_6, Protection Region Limit Address Registers */
14106
14107static inline uint32_t _AArch32_Read_prlar_6( void )
14108{
14109 uint32_t value;
14110
14111 __asm__ volatile (
14112 "mrc p15, 0, %0, c6, c11, 1" : "=&r" ( value ) : : "memory"
14113 );
14114
14115 return value;
14116}
14117
14118static inline void _AArch32_Write_prlar_6( uint32_t value )
14119{
14120 __asm__ volatile (
14121 "mcr p15, 0, %0, c6, c11, 1" : : "r" ( value ) : "memory"
14122 );
14123}
14124
14125/* PRLAR_7, Protection Region Limit Address Registers */
14126
14127static inline uint32_t _AArch32_Read_prlar_7( void )
14128{
14129 uint32_t value;
14130
14131 __asm__ volatile (
14132 "mrc p15, 0, %0, c6, c11, 5" : "=&r" ( value ) : : "memory"
14133 );
14134
14135 return value;
14136}
14137
14138static inline void _AArch32_Write_prlar_7( uint32_t value )
14139{
14140 __asm__ volatile (
14141 "mcr p15, 0, %0, c6, c11, 5" : : "r" ( value ) : "memory"
14142 );
14143}
14144
14145/* PRLAR_8, Protection Region Limit Address Registers */
14146
14147static inline uint32_t _AArch32_Read_prlar_8( void )
14148{
14149 uint32_t value;
14150
14151 __asm__ volatile (
14152 "mrc p15, 0, %0, c6, c12, 1" : "=&r" ( value ) : : "memory"
14153 );
14154
14155 return value;
14156}
14157
14158static inline void _AArch32_Write_prlar_8( uint32_t value )
14159{
14160 __asm__ volatile (
14161 "mcr p15, 0, %0, c6, c12, 1" : : "r" ( value ) : "memory"
14162 );
14163}
14164
14165/* PRLAR_9, Protection Region Limit Address Registers */
14166
14167static inline uint32_t _AArch32_Read_prlar_9( void )
14168{
14169 uint32_t value;
14170
14171 __asm__ volatile (
14172 "mrc p15, 0, %0, c6, c12, 5" : "=&r" ( value ) : : "memory"
14173 );
14174
14175 return value;
14176}
14177
14178static inline void _AArch32_Write_prlar_9( uint32_t value )
14179{
14180 __asm__ volatile (
14181 "mcr p15, 0, %0, c6, c12, 5" : : "r" ( value ) : "memory"
14182 );
14183}
14184
14185/* PRLAR_10, Protection Region Limit Address Registers */
14186
14187static inline uint32_t _AArch32_Read_prlar_10( void )
14188{
14189 uint32_t value;
14190
14191 __asm__ volatile (
14192 "mrc p15, 0, %0, c6, c13, 1" : "=&r" ( value ) : : "memory"
14193 );
14194
14195 return value;
14196}
14197
14198static inline void _AArch32_Write_prlar_10( uint32_t value )
14199{
14200 __asm__ volatile (
14201 "mcr p15, 0, %0, c6, c13, 1" : : "r" ( value ) : "memory"
14202 );
14203}
14204
14205/* PRLAR_11, Protection Region Limit Address Registers */
14206
14207static inline uint32_t _AArch32_Read_prlar_11( void )
14208{
14209 uint32_t value;
14210
14211 __asm__ volatile (
14212 "mrc p15, 0, %0, c6, c13, 5" : "=&r" ( value ) : : "memory"
14213 );
14214
14215 return value;
14216}
14217
14218static inline void _AArch32_Write_prlar_11( uint32_t value )
14219{
14220 __asm__ volatile (
14221 "mcr p15, 0, %0, c6, c13, 5" : : "r" ( value ) : "memory"
14222 );
14223}
14224
14225/* PRLAR_12, Protection Region Limit Address Registers */
14226
14227static inline uint32_t _AArch32_Read_prlar_12( void )
14228{
14229 uint32_t value;
14230
14231 __asm__ volatile (
14232 "mrc p15, 0, %0, c6, c14, 1" : "=&r" ( value ) : : "memory"
14233 );
14234
14235 return value;
14236}
14237
14238static inline void _AArch32_Write_prlar_12( uint32_t value )
14239{
14240 __asm__ volatile (
14241 "mcr p15, 0, %0, c6, c14, 1" : : "r" ( value ) : "memory"
14242 );
14243}
14244
14245/* PRLAR_13, Protection Region Limit Address Registers */
14246
14247static inline uint32_t _AArch32_Read_prlar_13( void )
14248{
14249 uint32_t value;
14250
14251 __asm__ volatile (
14252 "mrc p15, 0, %0, c6, c14, 5" : "=&r" ( value ) : : "memory"
14253 );
14254
14255 return value;
14256}
14257
14258static inline void _AArch32_Write_prlar_13( uint32_t value )
14259{
14260 __asm__ volatile (
14261 "mcr p15, 0, %0, c6, c14, 5" : : "r" ( value ) : "memory"
14262 );
14263}
14264
14265/* PRLAR_14, Protection Region Limit Address Registers */
14266
14267static inline uint32_t _AArch32_Read_prlar_14( void )
14268{
14269 uint32_t value;
14270
14271 __asm__ volatile (
14272 "mrc p15, 0, %0, c6, c15, 1" : "=&r" ( value ) : : "memory"
14273 );
14274
14275 return value;
14276}
14277
14278static inline void _AArch32_Write_prlar_14( uint32_t value )
14279{
14280 __asm__ volatile (
14281 "mcr p15, 0, %0, c6, c15, 1" : : "r" ( value ) : "memory"
14282 );
14283}
14284
14285/* PRLAR_15, Protection Region Limit Address Registers */
14286
14287static inline uint32_t _AArch32_Read_prlar_15( void )
14288{
14289 uint32_t value;
14290
14291 __asm__ volatile (
14292 "mrc p15, 0, %0, c6, c15, 5" : "=&r" ( value ) : : "memory"
14293 );
14294
14295 return value;
14296}
14297
14298static inline void _AArch32_Write_prlar_15( uint32_t value )
14299{
14300 __asm__ volatile (
14301 "mcr p15, 0, %0, c6, c15, 5" : : "r" ( value ) : "memory"
14302 );
14303}
14304
14305/* PRLAR_16, Protection Region Limit Address Registers */
14306
14307static inline uint32_t _AArch32_Read_prlar_16( void )
14308{
14309 uint32_t value;
14310
14311 __asm__ volatile (
14312 "mrc p15, 1, %0, c6, c8, 1" : "=&r" ( value ) : : "memory"
14313 );
14314
14315 return value;
14316}
14317
14318static inline void _AArch32_Write_prlar_16( uint32_t value )
14319{
14320 __asm__ volatile (
14321 "mcr p15, 1, %0, c6, c8, 1" : : "r" ( value ) : "memory"
14322 );
14323}
14324
14325/* PRLAR_17, Protection Region Limit Address Registers */
14326
14327static inline uint32_t _AArch32_Read_prlar_17( void )
14328{
14329 uint32_t value;
14330
14331 __asm__ volatile (
14332 "mrc p15, 1, %0, c6, c8, 5" : "=&r" ( value ) : : "memory"
14333 );
14334
14335 return value;
14336}
14337
14338static inline void _AArch32_Write_prlar_17( uint32_t value )
14339{
14340 __asm__ volatile (
14341 "mcr p15, 1, %0, c6, c8, 5" : : "r" ( value ) : "memory"
14342 );
14343}
14344
14345/* PRLAR_18, Protection Region Limit Address Registers */
14346
14347static inline uint32_t _AArch32_Read_prlar_18( void )
14348{
14349 uint32_t value;
14350
14351 __asm__ volatile (
14352 "mrc p15, 1, %0, c6, c9, 1" : "=&r" ( value ) : : "memory"
14353 );
14354
14355 return value;
14356}
14357
14358static inline void _AArch32_Write_prlar_18( uint32_t value )
14359{
14360 __asm__ volatile (
14361 "mcr p15, 1, %0, c6, c9, 1" : : "r" ( value ) : "memory"
14362 );
14363}
14364
14365/* PRLAR_19, Protection Region Limit Address Registers */
14366
14367static inline uint32_t _AArch32_Read_prlar_19( void )
14368{
14369 uint32_t value;
14370
14371 __asm__ volatile (
14372 "mrc p15, 1, %0, c6, c9, 5" : "=&r" ( value ) : : "memory"
14373 );
14374
14375 return value;
14376}
14377
14378static inline void _AArch32_Write_prlar_19( uint32_t value )
14379{
14380 __asm__ volatile (
14381 "mcr p15, 1, %0, c6, c9, 5" : : "r" ( value ) : "memory"
14382 );
14383}
14384
14385/* PRLAR_20, Protection Region Limit Address Registers */
14386
14387static inline uint32_t _AArch32_Read_prlar_20( void )
14388{
14389 uint32_t value;
14390
14391 __asm__ volatile (
14392 "mrc p15, 1, %0, c6, c10, 1" : "=&r" ( value ) : : "memory"
14393 );
14394
14395 return value;
14396}
14397
14398static inline void _AArch32_Write_prlar_20( uint32_t value )
14399{
14400 __asm__ volatile (
14401 "mcr p15, 1, %0, c6, c10, 1" : : "r" ( value ) : "memory"
14402 );
14403}
14404
14405/* PRLAR_21, Protection Region Limit Address Registers */
14406
14407static inline uint32_t _AArch32_Read_prlar_21( void )
14408{
14409 uint32_t value;
14410
14411 __asm__ volatile (
14412 "mrc p15, 1, %0, c6, c10, 5" : "=&r" ( value ) : : "memory"
14413 );
14414
14415 return value;
14416}
14417
14418static inline void _AArch32_Write_prlar_21( uint32_t value )
14419{
14420 __asm__ volatile (
14421 "mcr p15, 1, %0, c6, c10, 5" : : "r" ( value ) : "memory"
14422 );
14423}
14424
14425/* PRLAR_22, Protection Region Limit Address Registers */
14426
14427static inline uint32_t _AArch32_Read_prlar_22( void )
14428{
14429 uint32_t value;
14430
14431 __asm__ volatile (
14432 "mrc p15, 1, %0, c6, c11, 1" : "=&r" ( value ) : : "memory"
14433 );
14434
14435 return value;
14436}
14437
14438static inline void _AArch32_Write_prlar_22( uint32_t value )
14439{
14440 __asm__ volatile (
14441 "mcr p15, 1, %0, c6, c11, 1" : : "r" ( value ) : "memory"
14442 );
14443}
14444
14445/* PRLAR_23, Protection Region Limit Address Registers */
14446
14447static inline uint32_t _AArch32_Read_prlar_23( void )
14448{
14449 uint32_t value;
14450
14451 __asm__ volatile (
14452 "mrc p15, 1, %0, c6, c11, 5" : "=&r" ( value ) : : "memory"
14453 );
14454
14455 return value;
14456}
14457
14458static inline void _AArch32_Write_prlar_23( uint32_t value )
14459{
14460 __asm__ volatile (
14461 "mcr p15, 1, %0, c6, c11, 5" : : "r" ( value ) : "memory"
14462 );
14463}
14464
14465/* PRLAR_24, Protection Region Limit Address Registers */
14466
14467static inline uint32_t _AArch32_Read_prlar_24( void )
14468{
14469 uint32_t value;
14470
14471 __asm__ volatile (
14472 "mrc p15, 1, %0, c6, c12, 1" : "=&r" ( value ) : : "memory"
14473 );
14474
14475 return value;
14476}
14477
14478static inline void _AArch32_Write_prlar_24( uint32_t value )
14479{
14480 __asm__ volatile (
14481 "mcr p15, 1, %0, c6, c12, 1" : : "r" ( value ) : "memory"
14482 );
14483}
14484
14485/* PRLAR_25, Protection Region Limit Address Registers */
14486
14487static inline uint32_t _AArch32_Read_prlar_25( void )
14488{
14489 uint32_t value;
14490
14491 __asm__ volatile (
14492 "mrc p15, 1, %0, c6, c12, 5" : "=&r" ( value ) : : "memory"
14493 );
14494
14495 return value;
14496}
14497
14498static inline void _AArch32_Write_prlar_25( uint32_t value )
14499{
14500 __asm__ volatile (
14501 "mcr p15, 1, %0, c6, c12, 5" : : "r" ( value ) : "memory"
14502 );
14503}
14504
14505/* PRLAR_26, Protection Region Limit Address Registers */
14506
14507static inline uint32_t _AArch32_Read_prlar_26( void )
14508{
14509 uint32_t value;
14510
14511 __asm__ volatile (
14512 "mrc p15, 1, %0, c6, c13, 1" : "=&r" ( value ) : : "memory"
14513 );
14514
14515 return value;
14516}
14517
14518static inline void _AArch32_Write_prlar_26( uint32_t value )
14519{
14520 __asm__ volatile (
14521 "mcr p15, 1, %0, c6, c13, 1" : : "r" ( value ) : "memory"
14522 );
14523}
14524
14525/* PRLAR_27, Protection Region Limit Address Registers */
14526
14527static inline uint32_t _AArch32_Read_prlar_27( void )
14528{
14529 uint32_t value;
14530
14531 __asm__ volatile (
14532 "mrc p15, 1, %0, c6, c13, 5" : "=&r" ( value ) : : "memory"
14533 );
14534
14535 return value;
14536}
14537
14538static inline void _AArch32_Write_prlar_27( uint32_t value )
14539{
14540 __asm__ volatile (
14541 "mcr p15, 1, %0, c6, c13, 5" : : "r" ( value ) : "memory"
14542 );
14543}
14544
14545/* PRLAR_28, Protection Region Limit Address Registers */
14546
14547static inline uint32_t _AArch32_Read_prlar_28( void )
14548{
14549 uint32_t value;
14550
14551 __asm__ volatile (
14552 "mrc p15, 1, %0, c6, c14, 1" : "=&r" ( value ) : : "memory"
14553 );
14554
14555 return value;
14556}
14557
14558static inline void _AArch32_Write_prlar_28( uint32_t value )
14559{
14560 __asm__ volatile (
14561 "mcr p15, 1, %0, c6, c14, 1" : : "r" ( value ) : "memory"
14562 );
14563}
14564
14565/* PRLAR_29, Protection Region Limit Address Registers */
14566
14567static inline uint32_t _AArch32_Read_prlar_29( void )
14568{
14569 uint32_t value;
14570
14571 __asm__ volatile (
14572 "mrc p15, 1, %0, c6, c14, 5" : "=&r" ( value ) : : "memory"
14573 );
14574
14575 return value;
14576}
14577
14578static inline void _AArch32_Write_prlar_29( uint32_t value )
14579{
14580 __asm__ volatile (
14581 "mcr p15, 1, %0, c6, c14, 5" : : "r" ( value ) : "memory"
14582 );
14583}
14584
14585/* PRLAR_30, Protection Region Limit Address Registers */
14586
14587static inline uint32_t _AArch32_Read_prlar_30( void )
14588{
14589 uint32_t value;
14590
14591 __asm__ volatile (
14592 "mrc p15, 1, %0, c6, c15, 1" : "=&r" ( value ) : : "memory"
14593 );
14594
14595 return value;
14596}
14597
14598static inline void _AArch32_Write_prlar_30( uint32_t value )
14599{
14600 __asm__ volatile (
14601 "mcr p15, 1, %0, c6, c15, 1" : : "r" ( value ) : "memory"
14602 );
14603}
14604
14605/* PRLAR_31, Protection Region Limit Address Registers */
14606
14607static inline uint32_t _AArch32_Read_prlar_31( void )
14608{
14609 uint32_t value;
14610
14611 __asm__ volatile (
14612 "mrc p15, 1, %0, c6, c15, 5" : "=&r" ( value ) : : "memory"
14613 );
14614
14615 return value;
14616}
14617
14618static inline void _AArch32_Write_prlar_31( uint32_t value )
14619{
14620 __asm__ volatile (
14621 "mcr p15, 1, %0, c6, c15, 5" : : "r" ( value ) : "memory"
14622 );
14623}
14624
14625/* PRSELR, Protection Region Selector Register */
14626
14627#define AARCH32_PRSELR_REGION( _val ) ( ( _val ) << 0 )
14628#define AARCH32_PRSELR_REGION_SHIFT 0
14629#define AARCH32_PRSELR_REGION_MASK 0xffU
14630#define AARCH32_PRSELR_REGION_GET( _reg ) \
14631 ( ( ( _reg ) >> 0 ) & 0xffU )
14632
14633static inline uint32_t _AArch32_Read_prselr( void )
14634{
14635 uint32_t value;
14636
14637 __asm__ volatile (
14638 "mrc p15, 0, %0, c6, c2, 1" : "=&r" ( value ) : : "memory"
14639 );
14640
14641 return value;
14642}
14643
14644static inline void _AArch32_Write_prselr( uint32_t value )
14645{
14646 __asm__ volatile (
14647 "mcr p15, 0, %0, c6, c2, 1" : : "r" ( value ) : "memory"
14648 );
14649}
14650
14653#ifdef __cplusplus
14654}
14655#endif
14656
14657#endif /* _RTEMS_SCORE_AARCH32_SYSTEM_REGISTERS_H */