arm_sysregs/
lib.rs

1// SPDX-FileCopyrightText: Copyright The arm-sysregs Contributors.
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! Access to Arm CPU system registers.
5
6#![cfg_attr(not(any(test, feature = "fakes")), no_std)]
7#![cfg_attr(docsrs, feature(doc_cfg))]
8
9#[cfg(all(not(any(test, feature = "fakes")), target_arch = "arm"))]
10mod aarch32;
11#[cfg(all(not(any(test, feature = "fakes")), target_arch = "aarch64"))]
12mod aarch64;
13#[cfg(any(test, feature = "fakes"))]
14pub mod fake;
15mod macros;
16mod manual;
17
18use bitflags::bitflags;
19pub use manual::*;
20#[doc(hidden)]
21pub use paste as _paste;
22
23bitflags! {
24    /// `AMCFGR` system register value.
25    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
26    #[repr(transparent)]
27    pub struct Amcfgr: u32 {
28        /// `HDBG` bit.
29        const HDBG = 1 << 24;
30    }
31}
32
33impl Amcfgr {
34    /// Offset of the `N` field.
35    pub const N_SHIFT: u32 = 0;
36    /// Mask for the `N` field.
37    pub const N_MASK: u32 = 0b11111111;
38    /// Offset of the `SIZE` field.
39    pub const SIZE_SHIFT: u32 = 8;
40    /// Mask for the `SIZE` field.
41    pub const SIZE_MASK: u32 = 0b111111;
42    /// Offset of the `HDBG` field.
43    pub const HDBG_SHIFT: u32 = 24;
44    /// Offset of the `NCG` field.
45    pub const NCG_SHIFT: u32 = 28;
46    /// Mask for the `NCG` field.
47    pub const NCG_MASK: u32 = 0b1111;
48
49    /// Returns the value of the `N` field.
50    pub const fn n(self) -> u8 {
51        ((self.bits() >> Self::N_SHIFT) & 0b11111111) as u8
52    }
53
54    /// Returns the value of the `SIZE` field.
55    pub const fn size(self) -> u8 {
56        ((self.bits() >> Self::SIZE_SHIFT) & 0b111111) as u8
57    }
58
59    /// Returns the value of the `NCG` field.
60    pub const fn ncg(self) -> u8 {
61        ((self.bits() >> Self::NCG_SHIFT) & 0b1111) as u8
62    }
63}
64
65bitflags! {
66    /// `AMCGCR` system register value.
67    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
68    #[repr(transparent)]
69    pub struct Amcgcr: u32 {
70    }
71}
72
73impl Amcgcr {
74    /// Offset of the `CG0NC` field.
75    pub const CG0NC_SHIFT: u32 = 0;
76    /// Mask for the `CG0NC` field.
77    pub const CG0NC_MASK: u32 = 0b11111111;
78    /// Offset of the `CG1NC` field.
79    pub const CG1NC_SHIFT: u32 = 8;
80    /// Mask for the `CG1NC` field.
81    pub const CG1NC_MASK: u32 = 0b11111111;
82
83    /// Returns the value of the `CG0NC` field.
84    pub const fn cg0nc(self) -> u8 {
85        ((self.bits() >> Self::CG0NC_SHIFT) & 0b11111111) as u8
86    }
87
88    /// Returns the value of the `CG1NC` field.
89    pub const fn cg1nc(self) -> u8 {
90        ((self.bits() >> Self::CG1NC_SHIFT) & 0b11111111) as u8
91    }
92}
93
94bitflags! {
95    /// `AMCNTENCLR0` system register value.
96    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
97    #[repr(transparent)]
98    pub struct Amcntenclr0: u32 {
99        /// `P<n>` bit 0.
100        const P0 = 1 << 0;
101        /// `P<n>` bit 1.
102        const P1 = 1 << 1;
103        /// `P<n>` bit 2.
104        const P2 = 1 << 2;
105        /// `P<n>` bit 3.
106        const P3 = 1 << 3;
107    }
108}
109
110impl Amcntenclr0 {
111    /// Offset of the `P<n>` field.
112    pub const P_SHIFT: u32 = 0;
113}
114
115bitflags! {
116    /// `AMCNTENCLR1` system register value.
117    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
118    #[repr(transparent)]
119    pub struct Amcntenclr1: u32 {
120        /// `P<n>` bit 0.
121        const P0 = 1 << 0;
122        /// `P<n>` bit 1.
123        const P1 = 1 << 1;
124        /// `P<n>` bit 2.
125        const P2 = 1 << 2;
126        /// `P<n>` bit 3.
127        const P3 = 1 << 3;
128        /// `P<n>` bit 4.
129        const P4 = 1 << 4;
130        /// `P<n>` bit 5.
131        const P5 = 1 << 5;
132        /// `P<n>` bit 6.
133        const P6 = 1 << 6;
134        /// `P<n>` bit 7.
135        const P7 = 1 << 7;
136        /// `P<n>` bit 8.
137        const P8 = 1 << 8;
138        /// `P<n>` bit 9.
139        const P9 = 1 << 9;
140        /// `P<n>` bit 10.
141        const P10 = 1 << 10;
142        /// `P<n>` bit 11.
143        const P11 = 1 << 11;
144        /// `P<n>` bit 12.
145        const P12 = 1 << 12;
146        /// `P<n>` bit 13.
147        const P13 = 1 << 13;
148        /// `P<n>` bit 14.
149        const P14 = 1 << 14;
150        /// `P<n>` bit 15.
151        const P15 = 1 << 15;
152    }
153}
154
155impl Amcntenclr1 {
156    /// Offset of the `P<n>` field.
157    pub const P_SHIFT: u32 = 0;
158}
159
160bitflags! {
161    /// `AMCNTENSET0` system register value.
162    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
163    #[repr(transparent)]
164    pub struct Amcntenset0: u32 {
165        /// `P<n>` bit 0.
166        const P0 = 1 << 0;
167        /// `P<n>` bit 1.
168        const P1 = 1 << 1;
169        /// `P<n>` bit 2.
170        const P2 = 1 << 2;
171        /// `P<n>` bit 3.
172        const P3 = 1 << 3;
173    }
174}
175
176impl Amcntenset0 {
177    /// Offset of the `P<n>` field.
178    pub const P_SHIFT: u32 = 0;
179}
180
181bitflags! {
182    /// `AMCNTENSET1` system register value.
183    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
184    #[repr(transparent)]
185    pub struct Amcntenset1: u32 {
186        /// `P<n>` bit 0.
187        const P0 = 1 << 0;
188        /// `P<n>` bit 1.
189        const P1 = 1 << 1;
190        /// `P<n>` bit 2.
191        const P2 = 1 << 2;
192        /// `P<n>` bit 3.
193        const P3 = 1 << 3;
194        /// `P<n>` bit 4.
195        const P4 = 1 << 4;
196        /// `P<n>` bit 5.
197        const P5 = 1 << 5;
198        /// `P<n>` bit 6.
199        const P6 = 1 << 6;
200        /// `P<n>` bit 7.
201        const P7 = 1 << 7;
202        /// `P<n>` bit 8.
203        const P8 = 1 << 8;
204        /// `P<n>` bit 9.
205        const P9 = 1 << 9;
206        /// `P<n>` bit 10.
207        const P10 = 1 << 10;
208        /// `P<n>` bit 11.
209        const P11 = 1 << 11;
210        /// `P<n>` bit 12.
211        const P12 = 1 << 12;
212        /// `P<n>` bit 13.
213        const P13 = 1 << 13;
214        /// `P<n>` bit 14.
215        const P14 = 1 << 14;
216        /// `P<n>` bit 15.
217        const P15 = 1 << 15;
218    }
219}
220
221impl Amcntenset1 {
222    /// Offset of the `P<n>` field.
223    pub const P_SHIFT: u32 = 0;
224}
225
226bitflags! {
227    /// `AMCR` system register value.
228    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
229    #[repr(transparent)]
230    pub struct Amcr: u32 {
231        /// `HDBG` bit.
232        const HDBG = 1 << 10;
233        /// `CG1RZ` bit.
234        const CG1RZ = 1 << 17;
235    }
236}
237
238impl Amcr {
239    /// Offset of the `HDBG` field.
240    pub const HDBG_SHIFT: u32 = 10;
241    /// Offset of the `CG1RZ` field.
242    pub const CG1RZ_SHIFT: u32 = 17;
243}
244
245bitflags! {
246    /// `AMUSERENR` system register value.
247    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
248    #[repr(transparent)]
249    pub struct Amuserenr: u32 {
250        /// `EN` bit.
251        const EN = 1 << 0;
252    }
253}
254
255impl Amuserenr {
256    /// Offset of the `EN` field.
257    pub const EN_SHIFT: u32 = 0;
258}
259
260#[cfg(feature = "el1")]
261bitflags! {
262    /// `APIAKeyHi_EL1` system register value.
263    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
264    #[repr(transparent)]
265    pub struct ApiakeyhiEl1: u64 {
266    }
267}
268
269#[cfg(feature = "el1")]
270impl ApiakeyhiEl1 {
271    /// Offset of the `APIAKeyHi` field.
272    pub const APIAKEYHI_SHIFT: u32 = 0;
273    /// Mask for the `APIAKeyHi` field.
274    pub const APIAKEYHI_MASK: u64 =
275        0b1111111111111111111111111111111111111111111111111111111111111111;
276
277    /// Returns the value of the `APIAKeyHi` field.
278    pub const fn apiakeyhi(self) -> u64 {
279        ((self.bits() >> Self::APIAKEYHI_SHIFT)
280            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
281    }
282}
283
284#[cfg(feature = "el1")]
285bitflags! {
286    /// `APIAKeyLo_EL1` system register value.
287    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
288    #[repr(transparent)]
289    pub struct ApiakeyloEl1: u64 {
290    }
291}
292
293#[cfg(feature = "el1")]
294impl ApiakeyloEl1 {
295    /// Offset of the `APIAKeyLo` field.
296    pub const APIAKEYLO_SHIFT: u32 = 0;
297    /// Mask for the `APIAKeyLo` field.
298    pub const APIAKEYLO_MASK: u64 =
299        0b1111111111111111111111111111111111111111111111111111111111111111;
300
301    /// Returns the value of the `APIAKeyLo` field.
302    pub const fn apiakeylo(self) -> u64 {
303        ((self.bits() >> Self::APIAKEYLO_SHIFT)
304            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
305    }
306}
307
308bitflags! {
309    /// `CCSIDR` system register value.
310    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
311    #[repr(transparent)]
312    pub struct Ccsidr: u32 {
313    }
314}
315
316impl Ccsidr {
317    /// Offset of the `LineSize` field.
318    pub const LINESIZE_SHIFT: u32 = 0;
319    /// Mask for the `LineSize` field.
320    pub const LINESIZE_MASK: u32 = 0b111;
321    /// Offset of the `NumSets` field.
322    pub const NUMSETS_SHIFT: u32 = 13;
323    /// Mask for the `NumSets` field.
324    pub const NUMSETS_MASK: u32 = 0b111111111111111;
325
326    /// Returns the value of the `LineSize` field.
327    pub const fn linesize(self) -> u8 {
328        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
329    }
330
331    /// Returns the value of the `NumSets` field.
332    pub const fn numsets(self) -> u16 {
333        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111) as u16
334    }
335}
336
337bitflags! {
338    /// `CCSIDR2` system register value.
339    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
340    #[repr(transparent)]
341    pub struct Ccsidr2: u32 {
342    }
343}
344
345impl Ccsidr2 {
346    /// Offset of the `NumSets` field.
347    pub const NUMSETS_SHIFT: u32 = 0;
348    /// Mask for the `NumSets` field.
349    pub const NUMSETS_MASK: u32 = 0b111111111111111111111111;
350
351    /// Returns the value of the `NumSets` field.
352    pub const fn numsets(self) -> u32 {
353        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111111111111) as u32
354    }
355}
356
357#[cfg(feature = "el1")]
358bitflags! {
359    /// `CCSIDR_EL1` system register value.
360    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
361    #[repr(transparent)]
362    pub struct CcsidrEl1: u64 {
363    }
364}
365
366#[cfg(feature = "el1")]
367impl CcsidrEl1 {
368    /// Offset of the `LineSize` field.
369    pub const LINESIZE_SHIFT: u32 = 0;
370    /// Mask for the `LineSize` field.
371    pub const LINESIZE_MASK: u64 = 0b111;
372
373    /// Returns the value of the `LineSize` field.
374    pub const fn linesize(self) -> u8 {
375        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
376    }
377}
378
379bitflags! {
380    /// `CLIDR` system register value.
381    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
382    #[repr(transparent)]
383    pub struct Clidr: u32 {
384    }
385}
386
387impl Clidr {
388    /// Offset of the `Ctype<n>` field.
389    pub const CTYPE_SHIFT: u32 = 0;
390    /// Mask for the `Ctype<n>` field.
391    pub const CTYPE_MASK: u32 = 0b111;
392    /// Offset of the `LoUIS` field.
393    pub const LOUIS_SHIFT: u32 = 21;
394    /// Mask for the `LoUIS` field.
395    pub const LOUIS_MASK: u32 = 0b111;
396    /// Offset of the `LoC` field.
397    pub const LOC_SHIFT: u32 = 24;
398    /// Mask for the `LoC` field.
399    pub const LOC_MASK: u32 = 0b111;
400    /// Offset of the `LoUU` field.
401    pub const LOUU_SHIFT: u32 = 27;
402    /// Mask for the `LoUU` field.
403    pub const LOUU_MASK: u32 = 0b111;
404    /// Offset of the `ICB` field.
405    pub const ICB_SHIFT: u32 = 30;
406    /// Mask for the `ICB` field.
407    pub const ICB_MASK: u32 = 0b11;
408
409    /// Returns the value of the given `Ctype<n>` field.
410    pub const fn ctype(self, n: u32) -> u8 {
411        assert!(n >= 1 && n < 8);
412        ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8
413    }
414
415    /// Returns the value of the `LoUIS` field.
416    pub const fn louis(self) -> u8 {
417        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
418    }
419
420    /// Returns the value of the `LoC` field.
421    pub const fn loc(self) -> u8 {
422        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
423    }
424
425    /// Returns the value of the `LoUU` field.
426    pub const fn louu(self) -> u8 {
427        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
428    }
429
430    /// Returns the value of the `ICB` field.
431    pub const fn icb(self) -> u8 {
432        ((self.bits() >> Self::ICB_SHIFT) & 0b11) as u8
433    }
434}
435
436#[cfg(feature = "el1")]
437bitflags! {
438    /// `CLIDR_EL1` system register value.
439    ///
440    /// Cache Level ID.
441    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
442    #[repr(transparent)]
443    pub struct ClidrEl1: u64 {
444    }
445}
446
447#[cfg(feature = "el1")]
448impl ClidrEl1 {
449    /// Offset of the `Ctype<n>` field.
450    pub const CTYPE_SHIFT: u32 = 0;
451    /// Mask for the `Ctype<n>` field.
452    pub const CTYPE_MASK: u64 = 0b111;
453    /// Offset of the `LoUIS` field.
454    pub const LOUIS_SHIFT: u32 = 21;
455    /// Mask for the `LoUIS` field.
456    pub const LOUIS_MASK: u64 = 0b111;
457    /// Offset of the `LoC` field.
458    pub const LOC_SHIFT: u32 = 24;
459    /// Mask for the `LoC` field.
460    pub const LOC_MASK: u64 = 0b111;
461    /// Offset of the `LoUU` field.
462    pub const LOUU_SHIFT: u32 = 27;
463    /// Mask for the `LoUU` field.
464    pub const LOUU_MASK: u64 = 0b111;
465    /// Offset of the `ICB` field.
466    pub const ICB_SHIFT: u32 = 30;
467    /// Mask for the `ICB` field.
468    pub const ICB_MASK: u64 = 0b111;
469    /// Offset of the `Ttype<n>` field.
470    pub const TTYPE_SHIFT: u32 = 33;
471    /// Mask for the `Ttype<n>` field.
472    pub const TTYPE_MASK: u64 = 0b11;
473
474    /// Returns the value of the given `Ctype<n>` field.
475    pub fn ctype(self, n: u32) -> crate::manual::CacheType {
476        assert!(n >= 1 && n < 8);
477        crate::manual::CacheType::try_from(
478            ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8,
479        )
480        .unwrap()
481    }
482
483    /// Returns the value of the `LoUIS` field.
484    ///
485    /// Level of Unification Inner Shareable for the cache hierarchy.
486    pub const fn louis(self) -> u8 {
487        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
488    }
489
490    /// Returns the value of the `LoC` field.
491    ///
492    /// Level of Coherence for the cache hierarchy.
493    pub const fn loc(self) -> u8 {
494        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
495    }
496
497    /// Returns the value of the `LoUU` field.
498    ///
499    /// Level of Unification Uniprocessor for the cache hierarchy.
500    pub const fn louu(self) -> u8 {
501        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
502    }
503
504    /// Returns the value of the `ICB` field.
505    ///
506    /// Inner cache boundary level.
507    pub const fn icb(self) -> u8 {
508        ((self.bits() >> Self::ICB_SHIFT) & 0b111) as u8
509    }
510
511    /// Returns the value of the given `Ttype<n>` field.
512    pub const fn ttype(self, n: u32) -> u8 {
513        assert!(n >= 1 && n < 8);
514        ((self.bits() >> (Self::TTYPE_SHIFT + (n - 1) * 2)) & 0b11) as u8
515    }
516}
517
518bitflags! {
519    /// `CNTFRQ` system register value.
520    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
521    #[repr(transparent)]
522    pub struct Cntfrq: u32 {
523    }
524}
525
526impl Cntfrq {
527    /// Offset of the `ClockFreq` field.
528    pub const CLOCKFREQ_SHIFT: u32 = 0;
529    /// Mask for the `ClockFreq` field.
530    pub const CLOCKFREQ_MASK: u32 = 0b11111111111111111111111111111111;
531
532    /// Returns the value of the `ClockFreq` field.
533    pub const fn clockfreq(self) -> u32 {
534        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
535    }
536}
537
538bitflags! {
539    /// `CNTFRQ_EL0` system register value.
540    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
541    #[repr(transparent)]
542    pub struct CntfrqEl0: u64 {
543    }
544}
545
546impl CntfrqEl0 {
547    /// Offset of the `ClockFreq` field.
548    pub const CLOCKFREQ_SHIFT: u32 = 0;
549    /// Mask for the `ClockFreq` field.
550    pub const CLOCKFREQ_MASK: u64 = 0b11111111111111111111111111111111;
551
552    /// Returns the value of the `ClockFreq` field.
553    pub const fn clockfreq(self) -> u32 {
554        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
555    }
556}
557
558bitflags! {
559    /// `CNTHCTL` system register value.
560    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
561    #[repr(transparent)]
562    pub struct Cnthctl: u32 {
563        /// `PL1PCTEN` bit.
564        const PL1PCTEN = 1 << 0;
565        /// `PL1PCEN` bit.
566        const PL1PCEN = 1 << 1;
567        /// `EVNTEN` bit.
568        const EVNTEN = 1 << 2;
569        /// `EVNTDIR` bit.
570        const EVNTDIR = 1 << 3;
571        /// `EVNTIS` bit.
572        const EVNTIS = 1 << 17;
573    }
574}
575
576impl Cnthctl {
577    /// Offset of the `PL1PCTEN` field.
578    pub const PL1PCTEN_SHIFT: u32 = 0;
579    /// Offset of the `PL1PCEN` field.
580    pub const PL1PCEN_SHIFT: u32 = 1;
581    /// Offset of the `EVNTEN` field.
582    pub const EVNTEN_SHIFT: u32 = 2;
583    /// Offset of the `EVNTDIR` field.
584    pub const EVNTDIR_SHIFT: u32 = 3;
585    /// Offset of the `EVNTI` field.
586    pub const EVNTI_SHIFT: u32 = 4;
587    /// Mask for the `EVNTI` field.
588    pub const EVNTI_MASK: u32 = 0b1111;
589    /// Offset of the `EVNTIS` field.
590    pub const EVNTIS_SHIFT: u32 = 17;
591
592    /// Returns the value of the `EVNTI` field.
593    pub const fn evnti(self) -> u8 {
594        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
595    }
596}
597
598#[cfg(feature = "el2")]
599bitflags! {
600    /// `CNTHCTL_EL2` system register value.
601    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
602    #[repr(transparent)]
603    pub struct CnthctlEl2: u64 {
604        /// `EL0PCTEN` bit.
605        const EL0PCTEN = 1 << 0;
606        /// `EL0VCTEN` bit.
607        const EL0VCTEN = 1 << 1;
608        /// `EL1PCEN` bit.
609        const EL1PCEN = 1 << 1;
610        /// `EVNTEN` bit.
611        const EVNTEN = 1 << 2;
612        /// `EVNTDIR` bit.
613        const EVNTDIR = 1 << 3;
614        /// `EL0VTEN` bit.
615        const EL0VTEN = 1 << 8;
616        /// `EL0PTEN` bit.
617        const EL0PTEN = 1 << 9;
618        /// `EL1PTEN` bit.
619        const EL1PTEN = 1 << 11;
620        /// `ECV` bit.
621        const ECV = 1 << 12;
622        /// `EL1TVT` bit.
623        const EL1TVT = 1 << 13;
624        /// `EL1TVCT` bit.
625        const EL1TVCT = 1 << 14;
626        /// `EL1NVPCT` bit.
627        const EL1NVPCT = 1 << 15;
628        /// `EL1NVVCT` bit.
629        const EL1NVVCT = 1 << 16;
630        /// `EVNTIS` bit.
631        const EVNTIS = 1 << 17;
632        /// `CNTVMASK` bit.
633        const CNTVMASK = 1 << 18;
634        /// `CNTPMASK` bit.
635        const CNTPMASK = 1 << 19;
636    }
637}
638
639#[cfg(feature = "el2")]
640impl CnthctlEl2 {
641    /// Offset of the `EL0PCTEN` field.
642    pub const EL0PCTEN_SHIFT: u32 = 0;
643    /// Offset of the `EL0VCTEN` field.
644    pub const EL0VCTEN_SHIFT: u32 = 1;
645    /// Offset of the `EL1PCEN` field.
646    pub const EL1PCEN_SHIFT: u32 = 1;
647    /// Offset of the `EVNTEN` field.
648    pub const EVNTEN_SHIFT: u32 = 2;
649    /// Offset of the `EVNTDIR` field.
650    pub const EVNTDIR_SHIFT: u32 = 3;
651    /// Offset of the `EVNTI` field.
652    pub const EVNTI_SHIFT: u32 = 4;
653    /// Mask for the `EVNTI` field.
654    pub const EVNTI_MASK: u64 = 0b1111;
655    /// Offset of the `EL0VTEN` field.
656    pub const EL0VTEN_SHIFT: u32 = 8;
657    /// Offset of the `EL0PTEN` field.
658    pub const EL0PTEN_SHIFT: u32 = 9;
659    /// Offset of the `EL1PTEN` field.
660    pub const EL1PTEN_SHIFT: u32 = 11;
661    /// Offset of the `ECV` field.
662    pub const ECV_SHIFT: u32 = 12;
663    /// Offset of the `EL1TVT` field.
664    pub const EL1TVT_SHIFT: u32 = 13;
665    /// Offset of the `EL1TVCT` field.
666    pub const EL1TVCT_SHIFT: u32 = 14;
667    /// Offset of the `EL1NVPCT` field.
668    pub const EL1NVPCT_SHIFT: u32 = 15;
669    /// Offset of the `EL1NVVCT` field.
670    pub const EL1NVVCT_SHIFT: u32 = 16;
671    /// Offset of the `EVNTIS` field.
672    pub const EVNTIS_SHIFT: u32 = 17;
673    /// Offset of the `CNTVMASK` field.
674    pub const CNTVMASK_SHIFT: u32 = 18;
675    /// Offset of the `CNTPMASK` field.
676    pub const CNTPMASK_SHIFT: u32 = 19;
677
678    /// Returns the value of the `EVNTI` field.
679    pub const fn evnti(self) -> u8 {
680        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
681    }
682}
683
684bitflags! {
685    /// `CNTHPS_CTL` system register value.
686    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
687    #[repr(transparent)]
688    pub struct CnthpsCtl: u32 {
689        /// `ENABLE` bit.
690        const ENABLE = 1 << 0;
691        /// `IMASK` bit.
692        const IMASK = 1 << 1;
693        /// `ISTATUS` bit.
694        const ISTATUS = 1 << 2;
695    }
696}
697
698impl CnthpsCtl {
699    /// Offset of the `ENABLE` field.
700    pub const ENABLE_SHIFT: u32 = 0;
701    /// Offset of the `IMASK` field.
702    pub const IMASK_SHIFT: u32 = 1;
703    /// Offset of the `ISTATUS` field.
704    pub const ISTATUS_SHIFT: u32 = 2;
705}
706
707bitflags! {
708    /// `CNTHPS_CVAL` system register value.
709    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
710    #[repr(transparent)]
711    pub struct CnthpsCval: u64 {
712    }
713}
714
715impl CnthpsCval {
716    /// Offset of the `CompareValue` field.
717    pub const COMPAREVALUE_SHIFT: u32 = 0;
718    /// Mask for the `CompareValue` field.
719    pub const COMPAREVALUE_MASK: u64 =
720        0b1111111111111111111111111111111111111111111111111111111111111111;
721
722    /// Returns the value of the `CompareValue` field.
723    pub const fn comparevalue(self) -> u64 {
724        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
725            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
726    }
727}
728
729bitflags! {
730    /// `CNTHPS_TVAL` system register value.
731    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
732    #[repr(transparent)]
733    pub struct CnthpsTval: u32 {
734    }
735}
736
737impl CnthpsTval {
738    /// Offset of the `TimerValue` field.
739    pub const TIMERVALUE_SHIFT: u32 = 0;
740    /// Mask for the `TimerValue` field.
741    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
742
743    /// Returns the value of the `TimerValue` field.
744    pub const fn timervalue(self) -> u32 {
745        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
746    }
747}
748
749bitflags! {
750    /// `CNTHP_CTL` system register value.
751    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
752    #[repr(transparent)]
753    pub struct CnthpCtl: u32 {
754        /// `ENABLE` bit.
755        const ENABLE = 1 << 0;
756        /// `IMASK` bit.
757        const IMASK = 1 << 1;
758        /// `ISTATUS` bit.
759        const ISTATUS = 1 << 2;
760    }
761}
762
763impl CnthpCtl {
764    /// Offset of the `ENABLE` field.
765    pub const ENABLE_SHIFT: u32 = 0;
766    /// Offset of the `IMASK` field.
767    pub const IMASK_SHIFT: u32 = 1;
768    /// Offset of the `ISTATUS` field.
769    pub const ISTATUS_SHIFT: u32 = 2;
770}
771
772bitflags! {
773    /// `CNTHP_CVAL` system register value.
774    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
775    #[repr(transparent)]
776    pub struct CnthpCval: u64 {
777    }
778}
779
780impl CnthpCval {
781    /// Offset of the `CompareValue` field.
782    pub const COMPAREVALUE_SHIFT: u32 = 0;
783    /// Mask for the `CompareValue` field.
784    pub const COMPAREVALUE_MASK: u64 =
785        0b1111111111111111111111111111111111111111111111111111111111111111;
786
787    /// Returns the value of the `CompareValue` field.
788    pub const fn comparevalue(self) -> u64 {
789        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
790            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
791    }
792}
793
794bitflags! {
795    /// `CNTHP_TVAL` system register value.
796    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
797    #[repr(transparent)]
798    pub struct CnthpTval: u32 {
799    }
800}
801
802impl CnthpTval {
803    /// Offset of the `TimerValue` field.
804    pub const TIMERVALUE_SHIFT: u32 = 0;
805    /// Mask for the `TimerValue` field.
806    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
807
808    /// Returns the value of the `TimerValue` field.
809    pub const fn timervalue(self) -> u32 {
810        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
811    }
812}
813
814bitflags! {
815    /// `CNTHVS_CTL` system register value.
816    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
817    #[repr(transparent)]
818    pub struct CnthvsCtl: u32 {
819        /// `ENABLE` bit.
820        const ENABLE = 1 << 0;
821        /// `IMASK` bit.
822        const IMASK = 1 << 1;
823        /// `ISTATUS` bit.
824        const ISTATUS = 1 << 2;
825    }
826}
827
828impl CnthvsCtl {
829    /// Offset of the `ENABLE` field.
830    pub const ENABLE_SHIFT: u32 = 0;
831    /// Offset of the `IMASK` field.
832    pub const IMASK_SHIFT: u32 = 1;
833    /// Offset of the `ISTATUS` field.
834    pub const ISTATUS_SHIFT: u32 = 2;
835}
836
837bitflags! {
838    /// `CNTHVS_CVAL` system register value.
839    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
840    #[repr(transparent)]
841    pub struct CnthvsCval: u64 {
842    }
843}
844
845impl CnthvsCval {
846    /// Offset of the `CompareValue` field.
847    pub const COMPAREVALUE_SHIFT: u32 = 0;
848    /// Mask for the `CompareValue` field.
849    pub const COMPAREVALUE_MASK: u64 =
850        0b1111111111111111111111111111111111111111111111111111111111111111;
851
852    /// Returns the value of the `CompareValue` field.
853    pub const fn comparevalue(self) -> u64 {
854        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
855            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
856    }
857}
858
859bitflags! {
860    /// `CNTHVS_TVAL` system register value.
861    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
862    #[repr(transparent)]
863    pub struct CnthvsTval: u32 {
864    }
865}
866
867impl CnthvsTval {
868    /// Offset of the `TimerValue` field.
869    pub const TIMERVALUE_SHIFT: u32 = 0;
870    /// Mask for the `TimerValue` field.
871    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
872
873    /// Returns the value of the `TimerValue` field.
874    pub const fn timervalue(self) -> u32 {
875        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
876    }
877}
878
879bitflags! {
880    /// `CNTHV_CTL` system register value.
881    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
882    #[repr(transparent)]
883    pub struct CnthvCtl: u32 {
884        /// `ENABLE` bit.
885        const ENABLE = 1 << 0;
886        /// `IMASK` bit.
887        const IMASK = 1 << 1;
888        /// `ISTATUS` bit.
889        const ISTATUS = 1 << 2;
890    }
891}
892
893impl CnthvCtl {
894    /// Offset of the `ENABLE` field.
895    pub const ENABLE_SHIFT: u32 = 0;
896    /// Offset of the `IMASK` field.
897    pub const IMASK_SHIFT: u32 = 1;
898    /// Offset of the `ISTATUS` field.
899    pub const ISTATUS_SHIFT: u32 = 2;
900}
901
902bitflags! {
903    /// `CNTHV_CVAL` system register value.
904    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
905    #[repr(transparent)]
906    pub struct CnthvCval: u64 {
907    }
908}
909
910impl CnthvCval {
911    /// Offset of the `CompareValue` field.
912    pub const COMPAREVALUE_SHIFT: u32 = 0;
913    /// Mask for the `CompareValue` field.
914    pub const COMPAREVALUE_MASK: u64 =
915        0b1111111111111111111111111111111111111111111111111111111111111111;
916
917    /// Returns the value of the `CompareValue` field.
918    pub const fn comparevalue(self) -> u64 {
919        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
920            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
921    }
922}
923
924bitflags! {
925    /// `CNTHV_TVAL` system register value.
926    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
927    #[repr(transparent)]
928    pub struct CnthvTval: u32 {
929    }
930}
931
932impl CnthvTval {
933    /// Offset of the `TimerValue` field.
934    pub const TIMERVALUE_SHIFT: u32 = 0;
935    /// Mask for the `TimerValue` field.
936    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
937
938    /// Returns the value of the `TimerValue` field.
939    pub const fn timervalue(self) -> u32 {
940        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
941    }
942}
943
944bitflags! {
945    /// `CNTKCTL` system register value.
946    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
947    #[repr(transparent)]
948    pub struct Cntkctl: u32 {
949        /// `PL0PCTEN` bit.
950        const PL0PCTEN = 1 << 0;
951        /// `PL0VCTEN` bit.
952        const PL0VCTEN = 1 << 1;
953        /// `EVNTEN` bit.
954        const EVNTEN = 1 << 2;
955        /// `EVNTDIR` bit.
956        const EVNTDIR = 1 << 3;
957        /// `PL0VTEN` bit.
958        const PL0VTEN = 1 << 8;
959        /// `PL0PTEN` bit.
960        const PL0PTEN = 1 << 9;
961        /// `EVNTIS` bit.
962        const EVNTIS = 1 << 17;
963    }
964}
965
966impl Cntkctl {
967    /// Offset of the `PL0PCTEN` field.
968    pub const PL0PCTEN_SHIFT: u32 = 0;
969    /// Offset of the `PL0VCTEN` field.
970    pub const PL0VCTEN_SHIFT: u32 = 1;
971    /// Offset of the `EVNTEN` field.
972    pub const EVNTEN_SHIFT: u32 = 2;
973    /// Offset of the `EVNTDIR` field.
974    pub const EVNTDIR_SHIFT: u32 = 3;
975    /// Offset of the `EVNTI` field.
976    pub const EVNTI_SHIFT: u32 = 4;
977    /// Mask for the `EVNTI` field.
978    pub const EVNTI_MASK: u32 = 0b1111;
979    /// Offset of the `PL0VTEN` field.
980    pub const PL0VTEN_SHIFT: u32 = 8;
981    /// Offset of the `PL0PTEN` field.
982    pub const PL0PTEN_SHIFT: u32 = 9;
983    /// Offset of the `EVNTIS` field.
984    pub const EVNTIS_SHIFT: u32 = 17;
985
986    /// Returns the value of the `EVNTI` field.
987    pub const fn evnti(self) -> u8 {
988        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
989    }
990}
991
992bitflags! {
993    /// `CNTPCT` system register value.
994    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
995    #[repr(transparent)]
996    pub struct Cntpct: u64 {
997    }
998}
999
1000impl Cntpct {
1001    /// Offset of the `PhysicalCount` field.
1002    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
1003    /// Mask for the `PhysicalCount` field.
1004    pub const PHYSICALCOUNT_MASK: u64 =
1005        0b1111111111111111111111111111111111111111111111111111111111111111;
1006
1007    /// Returns the value of the `PhysicalCount` field.
1008    pub const fn physicalcount(self) -> u64 {
1009        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
1010            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1011    }
1012}
1013
1014bitflags! {
1015    /// `CNTPCTSS` system register value.
1016    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1017    #[repr(transparent)]
1018    pub struct Cntpctss: u64 {
1019    }
1020}
1021
1022impl Cntpctss {
1023    /// Offset of the `SSPhysicalCount` field.
1024    pub const SSPHYSICALCOUNT_SHIFT: u32 = 0;
1025    /// Mask for the `SSPhysicalCount` field.
1026    pub const SSPHYSICALCOUNT_MASK: u64 =
1027        0b1111111111111111111111111111111111111111111111111111111111111111;
1028
1029    /// Returns the value of the `SSPhysicalCount` field.
1030    pub const fn ssphysicalcount(self) -> u64 {
1031        ((self.bits() >> Self::SSPHYSICALCOUNT_SHIFT)
1032            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1033    }
1034}
1035
1036bitflags! {
1037    /// `CNTPCT_EL0` system register value.
1038    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1039    #[repr(transparent)]
1040    pub struct CntpctEl0: u64 {
1041    }
1042}
1043
1044impl CntpctEl0 {
1045    /// Offset of the `PhysicalCount` field.
1046    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
1047    /// Mask for the `PhysicalCount` field.
1048    pub const PHYSICALCOUNT_MASK: u64 =
1049        0b1111111111111111111111111111111111111111111111111111111111111111;
1050
1051    /// Returns the value of the `PhysicalCount` field.
1052    pub const fn physicalcount(self) -> u64 {
1053        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
1054            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1055    }
1056}
1057
1058bitflags! {
1059    /// `CNTP_CTL` system register value.
1060    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1061    #[repr(transparent)]
1062    pub struct CntpCtl: u32 {
1063        /// `ENABLE` bit.
1064        const ENABLE = 1 << 0;
1065        /// `IMASK` bit.
1066        const IMASK = 1 << 1;
1067        /// `ISTATUS` bit.
1068        const ISTATUS = 1 << 2;
1069    }
1070}
1071
1072impl CntpCtl {
1073    /// Offset of the `ENABLE` field.
1074    pub const ENABLE_SHIFT: u32 = 0;
1075    /// Offset of the `IMASK` field.
1076    pub const IMASK_SHIFT: u32 = 1;
1077    /// Offset of the `ISTATUS` field.
1078    pub const ISTATUS_SHIFT: u32 = 2;
1079}
1080
1081bitflags! {
1082    /// `CNTP_CVAL` system register value.
1083    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1084    #[repr(transparent)]
1085    pub struct CntpCval: u64 {
1086    }
1087}
1088
1089impl CntpCval {
1090    /// Offset of the `CompareValue` field.
1091    pub const COMPAREVALUE_SHIFT: u32 = 0;
1092    /// Mask for the `CompareValue` field.
1093    pub const COMPAREVALUE_MASK: u64 =
1094        0b1111111111111111111111111111111111111111111111111111111111111111;
1095
1096    /// Returns the value of the `CompareValue` field.
1097    pub const fn comparevalue(self) -> u64 {
1098        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1099            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1100    }
1101}
1102
1103bitflags! {
1104    /// `CNTP_TVAL` system register value.
1105    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1106    #[repr(transparent)]
1107    pub struct CntpTval: u32 {
1108    }
1109}
1110
1111impl CntpTval {
1112    /// Offset of the `TimerValue` field.
1113    pub const TIMERVALUE_SHIFT: u32 = 0;
1114    /// Mask for the `TimerValue` field.
1115    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1116
1117    /// Returns the value of the `TimerValue` field.
1118    pub const fn timervalue(self) -> u32 {
1119        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1120    }
1121}
1122
1123bitflags! {
1124    /// `CNTVCT` system register value.
1125    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1126    #[repr(transparent)]
1127    pub struct Cntvct: u64 {
1128    }
1129}
1130
1131impl Cntvct {
1132    /// Offset of the `VirtualCount` field.
1133    pub const VIRTUALCOUNT_SHIFT: u32 = 0;
1134    /// Mask for the `VirtualCount` field.
1135    pub const VIRTUALCOUNT_MASK: u64 =
1136        0b1111111111111111111111111111111111111111111111111111111111111111;
1137
1138    /// Returns the value of the `VirtualCount` field.
1139    pub const fn virtualcount(self) -> u64 {
1140        ((self.bits() >> Self::VIRTUALCOUNT_SHIFT)
1141            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1142    }
1143}
1144
1145bitflags! {
1146    /// `CNTVCTSS` system register value.
1147    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1148    #[repr(transparent)]
1149    pub struct Cntvctss: u64 {
1150    }
1151}
1152
1153impl Cntvctss {
1154    /// Offset of the `SSVirtualCount` field.
1155    pub const SSVIRTUALCOUNT_SHIFT: u32 = 0;
1156    /// Mask for the `SSVirtualCount` field.
1157    pub const SSVIRTUALCOUNT_MASK: u64 =
1158        0b1111111111111111111111111111111111111111111111111111111111111111;
1159
1160    /// Returns the value of the `SSVirtualCount` field.
1161    pub const fn ssvirtualcount(self) -> u64 {
1162        ((self.bits() >> Self::SSVIRTUALCOUNT_SHIFT)
1163            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1164    }
1165}
1166
1167bitflags! {
1168    /// `CNTVOFF` system register value.
1169    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1170    #[repr(transparent)]
1171    pub struct Cntvoff: u64 {
1172    }
1173}
1174
1175impl Cntvoff {
1176    /// Offset of the `VOffset` field.
1177    pub const VOFFSET_SHIFT: u32 = 0;
1178    /// Mask for the `VOffset` field.
1179    pub const VOFFSET_MASK: u64 =
1180        0b1111111111111111111111111111111111111111111111111111111111111111;
1181
1182    /// Returns the value of the `VOffset` field.
1183    pub const fn voffset(self) -> u64 {
1184        ((self.bits() >> Self::VOFFSET_SHIFT)
1185            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1186    }
1187}
1188
1189#[cfg(feature = "el2")]
1190bitflags! {
1191    /// `CNTVOFF_EL2` system register value.
1192    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1193    #[repr(transparent)]
1194    pub struct CntvoffEl2: u64 {
1195    }
1196}
1197
1198#[cfg(feature = "el2")]
1199impl CntvoffEl2 {
1200    /// Offset of the `VOffset` field.
1201    pub const VOFFSET_SHIFT: u32 = 0;
1202    /// Mask for the `VOffset` field.
1203    pub const VOFFSET_MASK: u64 =
1204        0b1111111111111111111111111111111111111111111111111111111111111111;
1205
1206    /// Returns the value of the `VOffset` field.
1207    pub const fn voffset(self) -> u64 {
1208        ((self.bits() >> Self::VOFFSET_SHIFT)
1209            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1210    }
1211}
1212
1213bitflags! {
1214    /// `CNTV_CTL` system register value.
1215    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1216    #[repr(transparent)]
1217    pub struct CntvCtl: u32 {
1218        /// `ENABLE` bit.
1219        const ENABLE = 1 << 0;
1220        /// `IMASK` bit.
1221        const IMASK = 1 << 1;
1222        /// `ISTATUS` bit.
1223        const ISTATUS = 1 << 2;
1224    }
1225}
1226
1227impl CntvCtl {
1228    /// Offset of the `ENABLE` field.
1229    pub const ENABLE_SHIFT: u32 = 0;
1230    /// Offset of the `IMASK` field.
1231    pub const IMASK_SHIFT: u32 = 1;
1232    /// Offset of the `ISTATUS` field.
1233    pub const ISTATUS_SHIFT: u32 = 2;
1234}
1235
1236bitflags! {
1237    /// `CNTV_CVAL` system register value.
1238    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1239    #[repr(transparent)]
1240    pub struct CntvCval: u64 {
1241    }
1242}
1243
1244impl CntvCval {
1245    /// Offset of the `CompareValue` field.
1246    pub const COMPAREVALUE_SHIFT: u32 = 0;
1247    /// Mask for the `CompareValue` field.
1248    pub const COMPAREVALUE_MASK: u64 =
1249        0b1111111111111111111111111111111111111111111111111111111111111111;
1250
1251    /// Returns the value of the `CompareValue` field.
1252    pub const fn comparevalue(self) -> u64 {
1253        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1254            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1255    }
1256}
1257
1258bitflags! {
1259    /// `CNTV_TVAL` system register value.
1260    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1261    #[repr(transparent)]
1262    pub struct CntvTval: u32 {
1263    }
1264}
1265
1266impl CntvTval {
1267    /// Offset of the `TimerValue` field.
1268    pub const TIMERVALUE_SHIFT: u32 = 0;
1269    /// Mask for the `TimerValue` field.
1270    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1271
1272    /// Returns the value of the `TimerValue` field.
1273    pub const fn timervalue(self) -> u32 {
1274        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1275    }
1276}
1277
1278bitflags! {
1279    /// `CONTEXTIDR` system register value.
1280    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1281    #[repr(transparent)]
1282    pub struct Contextidr: u32 {
1283    }
1284}
1285
1286impl Contextidr {
1287    /// Offset of the `ASID` field.
1288    pub const ASID_SHIFT: u32 = 0;
1289    /// Mask for the `ASID` field.
1290    pub const ASID_MASK: u32 = 0b11111111;
1291
1292    /// Returns the value of the `ASID` field.
1293    pub const fn asid(self) -> u8 {
1294        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
1295    }
1296}
1297
1298#[cfg(feature = "el1")]
1299bitflags! {
1300    /// `CONTEXTIDR_EL1` system register value.
1301    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1302    #[repr(transparent)]
1303    pub struct ContextidrEl1: u64 {
1304    }
1305}
1306
1307#[cfg(feature = "el1")]
1308impl ContextidrEl1 {
1309    /// Offset of the `PROCID` field.
1310    pub const PROCID_SHIFT: u32 = 0;
1311    /// Mask for the `PROCID` field.
1312    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
1313
1314    /// Returns the value of the `PROCID` field.
1315    pub const fn procid(self) -> u32 {
1316        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
1317    }
1318}
1319
1320#[cfg(feature = "el2")]
1321bitflags! {
1322    /// `CONTEXTIDR_EL2` system register value.
1323    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1324    #[repr(transparent)]
1325    pub struct ContextidrEl2: u64 {
1326    }
1327}
1328
1329#[cfg(feature = "el2")]
1330impl ContextidrEl2 {
1331    /// Offset of the `PROCID` field.
1332    pub const PROCID_SHIFT: u32 = 0;
1333    /// Mask for the `PROCID` field.
1334    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
1335
1336    /// Returns the value of the `PROCID` field.
1337    pub const fn procid(self) -> u32 {
1338        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
1339    }
1340}
1341
1342bitflags! {
1343    /// `CPACR` system register value.
1344    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1345    #[repr(transparent)]
1346    pub struct Cpacr: u32 {
1347        /// `TRCDIS` bit.
1348        const TRCDIS = 1 << 28;
1349        /// `ASEDIS` bit.
1350        const ASEDIS = 1 << 31;
1351    }
1352}
1353
1354impl Cpacr {
1355    /// Offset of the `cp10` field.
1356    pub const CP10_SHIFT: u32 = 20;
1357    /// Mask for the `cp10` field.
1358    pub const CP10_MASK: u32 = 0b11;
1359    /// Offset of the `cp11` field.
1360    pub const CP11_SHIFT: u32 = 22;
1361    /// Mask for the `cp11` field.
1362    pub const CP11_MASK: u32 = 0b11;
1363    /// Offset of the `TRCDIS` field.
1364    pub const TRCDIS_SHIFT: u32 = 28;
1365    /// Offset of the `ASEDIS` field.
1366    pub const ASEDIS_SHIFT: u32 = 31;
1367
1368    /// Returns the value of the `cp10` field.
1369    pub const fn cp10(self) -> u8 {
1370        ((self.bits() >> Self::CP10_SHIFT) & 0b11) as u8
1371    }
1372
1373    /// Returns the value of the `cp11` field.
1374    pub const fn cp11(self) -> u8 {
1375        ((self.bits() >> Self::CP11_SHIFT) & 0b11) as u8
1376    }
1377}
1378
1379#[cfg(feature = "el1")]
1380bitflags! {
1381    /// `CPACR_EL1` system register value.
1382    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1383    #[repr(transparent)]
1384    pub struct CpacrEl1: u64 {
1385        /// `TTA` bit.
1386        const TTA = 1 << 28;
1387        /// `E0POE` bit.
1388        const E0POE = 1 << 29;
1389        /// `TAM` bit.
1390        const TAM = 1 << 30;
1391        /// `TCPAC` bit.
1392        const TCPAC = 1 << 31;
1393        /// `E0TP0E` bit.
1394        const E0TP0E = 1 << 32;
1395        /// `E0TP1E` bit.
1396        const E0TP1E = 1 << 33;
1397    }
1398}
1399
1400#[cfg(feature = "el1")]
1401impl CpacrEl1 {
1402    /// Offset of the `ZEN` field.
1403    pub const ZEN_SHIFT: u32 = 16;
1404    /// Mask for the `ZEN` field.
1405    pub const ZEN_MASK: u64 = 0b11;
1406    /// Offset of the `FPEN` field.
1407    pub const FPEN_SHIFT: u32 = 20;
1408    /// Mask for the `FPEN` field.
1409    pub const FPEN_MASK: u64 = 0b11;
1410    /// Offset of the `SMEN` field.
1411    pub const SMEN_SHIFT: u32 = 24;
1412    /// Mask for the `SMEN` field.
1413    pub const SMEN_MASK: u64 = 0b11;
1414    /// Offset of the `TTA` field.
1415    pub const TTA_SHIFT: u32 = 28;
1416    /// Offset of the `E0POE` field.
1417    pub const E0POE_SHIFT: u32 = 29;
1418    /// Offset of the `TAM` field.
1419    pub const TAM_SHIFT: u32 = 30;
1420    /// Offset of the `TCPAC` field.
1421    pub const TCPAC_SHIFT: u32 = 31;
1422    /// Offset of the `E0TP0E` field.
1423    pub const E0TP0E_SHIFT: u32 = 32;
1424    /// Offset of the `E0TP1E` field.
1425    pub const E0TP1E_SHIFT: u32 = 33;
1426
1427    /// Returns the value of the `ZEN` field.
1428    pub const fn zen(self) -> u8 {
1429        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
1430    }
1431
1432    /// Returns the value of the `FPEN` field.
1433    pub const fn fpen(self) -> u8 {
1434        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
1435    }
1436
1437    /// Returns the value of the `SMEN` field.
1438    pub const fn smen(self) -> u8 {
1439        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
1440    }
1441}
1442
1443#[cfg(feature = "el2")]
1444bitflags! {
1445    /// `CPTR_EL2` system register value.
1446    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1447    #[repr(transparent)]
1448    pub struct CptrEl2: u64 {
1449        /// RES1 bits in the `CPTR_EL2` register.
1450        const RES1 = 0b10001011111111;
1451        /// `TZ` bit.
1452        const TZ = 1 << 8;
1453        /// `TFP` bit.
1454        const TFP = 1 << 10;
1455        /// `TSM` bit.
1456        const TSM = 1 << 12;
1457        /// `E0POE` bit.
1458        const E0POE = 1 << 29;
1459        /// `TAM` bit.
1460        const TAM = 1 << 30;
1461        /// `TCPAC` bit.
1462        const TCPAC = 1 << 31;
1463        /// `E0TP0E` bit.
1464        const E0TP0E = 1 << 32;
1465        /// `E0TP1E` bit.
1466        const E0TP1E = 1 << 33;
1467    }
1468}
1469
1470#[cfg(feature = "el2")]
1471impl CptrEl2 {
1472    /// Offset of the `TZ` field.
1473    pub const TZ_SHIFT: u32 = 8;
1474    /// Offset of the `TFP` field.
1475    pub const TFP_SHIFT: u32 = 10;
1476    /// Offset of the `TSM` field.
1477    pub const TSM_SHIFT: u32 = 12;
1478    /// Offset of the `ZEN` field.
1479    pub const ZEN_SHIFT: u32 = 16;
1480    /// Mask for the `ZEN` field.
1481    pub const ZEN_MASK: u64 = 0b11;
1482    /// Offset of the `FPEN` field.
1483    pub const FPEN_SHIFT: u32 = 20;
1484    /// Mask for the `FPEN` field.
1485    pub const FPEN_MASK: u64 = 0b11;
1486    /// Offset of the `SMEN` field.
1487    pub const SMEN_SHIFT: u32 = 24;
1488    /// Mask for the `SMEN` field.
1489    pub const SMEN_MASK: u64 = 0b11;
1490    /// Offset of the `E0POE` field.
1491    pub const E0POE_SHIFT: u32 = 29;
1492    /// Offset of the `TAM` field.
1493    pub const TAM_SHIFT: u32 = 30;
1494    /// Offset of the `TCPAC` field.
1495    pub const TCPAC_SHIFT: u32 = 31;
1496    /// Offset of the `E0TP0E` field.
1497    pub const E0TP0E_SHIFT: u32 = 32;
1498    /// Offset of the `E0TP1E` field.
1499    pub const E0TP1E_SHIFT: u32 = 33;
1500
1501    /// Returns the value of the `ZEN` field.
1502    pub const fn zen(self) -> u8 {
1503        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
1504    }
1505
1506    /// Returns the value of the `FPEN` field.
1507    pub const fn fpen(self) -> u8 {
1508        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
1509    }
1510
1511    /// Returns the value of the `SMEN` field.
1512    pub const fn smen(self) -> u8 {
1513        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
1514    }
1515}
1516
1517#[cfg(feature = "el3")]
1518bitflags! {
1519    /// `CPTR_EL3` system register value.
1520    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1521    #[repr(transparent)]
1522    pub struct CptrEl3: u64 {
1523        /// Do not trap execution of SVE instructions.
1524        const EZ = 1 << 8;
1525        /// Trap Advanced SIMD instructions execution.
1526        const TFP = 1 << 10;
1527        /// When FEAT_SME is implemented, do not trap SME instructions and system registers accesses.
1528        const ESM = 1 << 12;
1529        /// Trap trace system register accesses.
1530        const TTA = 1 << 20;
1531        /// When FEAT_AMUv1 implemented trap accesses from EL2/EL1/EL0 to AMU registers.
1532        const TAM = 1 << 30;
1533        /// Trap EL2 accesses to CPTR_EL2/HCPTR, and EL2/EL1 accesses to CPACR_EL1/CPACR.
1534        const TCPAC = 1 << 31;
1535    }
1536}
1537
1538#[cfg(feature = "el3")]
1539impl CptrEl3 {
1540    /// Offset of the `EZ` field.
1541    pub const EZ_SHIFT: u32 = 8;
1542    /// Offset of the `TFP` field.
1543    pub const TFP_SHIFT: u32 = 10;
1544    /// Offset of the `ESM` field.
1545    pub const ESM_SHIFT: u32 = 12;
1546    /// Offset of the `TTA` field.
1547    pub const TTA_SHIFT: u32 = 20;
1548    /// Offset of the `TAM` field.
1549    pub const TAM_SHIFT: u32 = 30;
1550    /// Offset of the `TCPAC` field.
1551    pub const TCPAC_SHIFT: u32 = 31;
1552}
1553
1554bitflags! {
1555    /// `CSSELR` system register value.
1556    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1557    #[repr(transparent)]
1558    pub struct Csselr: u32 {
1559        /// `InD` bit.
1560        const IND = 1 << 0;
1561    }
1562}
1563
1564impl Csselr {
1565    /// Offset of the `InD` field.
1566    pub const IND_SHIFT: u32 = 0;
1567    /// Offset of the `Level` field.
1568    pub const LEVEL_SHIFT: u32 = 1;
1569    /// Mask for the `Level` field.
1570    pub const LEVEL_MASK: u32 = 0b111;
1571
1572    /// Returns the value of the `Level` field.
1573    pub const fn level(self) -> u8 {
1574        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
1575    }
1576}
1577
1578#[cfg(feature = "el1")]
1579bitflags! {
1580    /// `CSSELR_EL1` system register value.
1581    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1582    #[repr(transparent)]
1583    pub struct CsselrEl1: u64 {
1584        /// Instruction not Data bit.
1585        const IND = 1 << 0;
1586        /// Allocation Tag not Data bit, only valid if FEAT_MTE2 is implemented.
1587        const TND = 1 << 4;
1588    }
1589}
1590
1591#[cfg(feature = "el1")]
1592impl CsselrEl1 {
1593    /// Offset of the `InD` field.
1594    pub const IND_SHIFT: u32 = 0;
1595    /// Offset of the `Level` field.
1596    pub const LEVEL_SHIFT: u32 = 1;
1597    /// Mask for the `Level` field.
1598    pub const LEVEL_MASK: u64 = 0b111;
1599    /// Offset of the `TnD` field.
1600    pub const TND_SHIFT: u32 = 4;
1601
1602    /// Returns the value of the `Level` field.
1603    pub const fn level(self) -> u8 {
1604        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
1605    }
1606}
1607
1608bitflags! {
1609    /// `CTR` system register value.
1610    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1611    #[repr(transparent)]
1612    pub struct Ctr: u32 {
1613        /// RES1 bits in the `CTR` register.
1614        const RES1 = 0b10000000000000000000000000000000;
1615        /// `IDC` bit.
1616        const IDC = 1 << 28;
1617        /// `DIC` bit.
1618        const DIC = 1 << 29;
1619    }
1620}
1621
1622impl Ctr {
1623    /// Offset of the `IminLine` field.
1624    pub const IMINLINE_SHIFT: u32 = 0;
1625    /// Mask for the `IminLine` field.
1626    pub const IMINLINE_MASK: u32 = 0b1111;
1627    /// Offset of the `L1Ip` field.
1628    pub const L1IP_SHIFT: u32 = 14;
1629    /// Mask for the `L1Ip` field.
1630    pub const L1IP_MASK: u32 = 0b11;
1631    /// Offset of the `DminLine` field.
1632    pub const DMINLINE_SHIFT: u32 = 16;
1633    /// Mask for the `DminLine` field.
1634    pub const DMINLINE_MASK: u32 = 0b1111;
1635    /// Offset of the `ERG` field.
1636    pub const ERG_SHIFT: u32 = 20;
1637    /// Mask for the `ERG` field.
1638    pub const ERG_MASK: u32 = 0b1111;
1639    /// Offset of the `CWG` field.
1640    pub const CWG_SHIFT: u32 = 24;
1641    /// Mask for the `CWG` field.
1642    pub const CWG_MASK: u32 = 0b1111;
1643    /// Offset of the `IDC` field.
1644    pub const IDC_SHIFT: u32 = 28;
1645    /// Offset of the `DIC` field.
1646    pub const DIC_SHIFT: u32 = 29;
1647
1648    /// Returns the value of the `IminLine` field.
1649    pub const fn iminline(self) -> u8 {
1650        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
1651    }
1652
1653    /// Returns the value of the `L1Ip` field.
1654    pub const fn l1ip(self) -> u8 {
1655        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
1656    }
1657
1658    /// Returns the value of the `DminLine` field.
1659    pub const fn dminline(self) -> u8 {
1660        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
1661    }
1662
1663    /// Returns the value of the `ERG` field.
1664    pub const fn erg(self) -> u8 {
1665        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
1666    }
1667
1668    /// Returns the value of the `CWG` field.
1669    pub const fn cwg(self) -> u8 {
1670        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
1671    }
1672}
1673
1674bitflags! {
1675    /// `CTR_EL0` system register value.
1676    ///
1677    /// Cache Type Register.
1678    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1679    #[repr(transparent)]
1680    pub struct CtrEl0: u64 {
1681        /// RES1 bits in the `CTR_EL0` register.
1682        const RES1 = 0b10000000000000000000000000000000;
1683        /// `IDC` bit.
1684        const IDC = 1 << 28;
1685        /// `DIC` bit.
1686        const DIC = 1 << 29;
1687    }
1688}
1689
1690impl CtrEl0 {
1691    /// Offset of the `IminLine` field.
1692    pub const IMINLINE_SHIFT: u32 = 0;
1693    /// Mask for the `IminLine` field.
1694    pub const IMINLINE_MASK: u64 = 0b1111;
1695    /// Offset of the `L1Ip` field.
1696    pub const L1IP_SHIFT: u32 = 14;
1697    /// Mask for the `L1Ip` field.
1698    pub const L1IP_MASK: u64 = 0b11;
1699    /// Offset of the `DminLine` field.
1700    pub const DMINLINE_SHIFT: u32 = 16;
1701    /// Mask for the `DminLine` field.
1702    pub const DMINLINE_MASK: u64 = 0b1111;
1703    /// Offset of the `ERG` field.
1704    pub const ERG_SHIFT: u32 = 20;
1705    /// Mask for the `ERG` field.
1706    pub const ERG_MASK: u64 = 0b1111;
1707    /// Offset of the `CWG` field.
1708    pub const CWG_SHIFT: u32 = 24;
1709    /// Mask for the `CWG` field.
1710    pub const CWG_MASK: u64 = 0b1111;
1711    /// Offset of the `IDC` field.
1712    pub const IDC_SHIFT: u32 = 28;
1713    /// Offset of the `DIC` field.
1714    pub const DIC_SHIFT: u32 = 29;
1715    /// Offset of the `TminLine` field.
1716    pub const TMINLINE_SHIFT: u32 = 32;
1717    /// Mask for the `TminLine` field.
1718    pub const TMINLINE_MASK: u64 = 0b111111;
1719
1720    /// Returns the value of the `IminLine` field.
1721    pub const fn iminline(self) -> u8 {
1722        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
1723    }
1724
1725    /// Returns the value of the `L1Ip` field.
1726    pub const fn l1ip(self) -> u8 {
1727        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
1728    }
1729
1730    /// Returns the value of the `DminLine` field.
1731    ///
1732    /// Log2 of the number of words in the smallest cache line of all the data caches and unified caches that are controlled by the PE.
1733    pub const fn dminline(self) -> u8 {
1734        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
1735    }
1736
1737    /// Returns the value of the `ERG` field.
1738    pub const fn erg(self) -> u8 {
1739        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
1740    }
1741
1742    /// Returns the value of the `CWG` field.
1743    pub const fn cwg(self) -> u8 {
1744        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
1745    }
1746
1747    /// Returns the value of the `TminLine` field.
1748    pub const fn tminline(self) -> u8 {
1749        ((self.bits() >> Self::TMINLINE_SHIFT) & 0b111111) as u8
1750    }
1751}
1752
1753bitflags! {
1754    /// `CurrentEL` system register value.
1755    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1756    #[repr(transparent)]
1757    pub struct Currentel: u64 {
1758    }
1759}
1760
1761impl Currentel {
1762    /// Offset of the `EL` field.
1763    pub const EL_SHIFT: u32 = 2;
1764    /// Mask for the `EL` field.
1765    pub const EL_MASK: u64 = 0b11;
1766
1767    /// Returns the value of the `EL` field.
1768    pub const fn el(self) -> u8 {
1769        ((self.bits() >> Self::EL_SHIFT) & 0b11) as u8
1770    }
1771}
1772
1773bitflags! {
1774    /// `DACR` system register value.
1775    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1776    #[repr(transparent)]
1777    pub struct Dacr: u32 {
1778    }
1779}
1780
1781impl Dacr {
1782    /// Offset of the `D<n>` field.
1783    pub const D_SHIFT: u32 = 0;
1784    /// Mask for the `D<n>` field.
1785    pub const D_MASK: u32 = 0b11;
1786
1787    /// Returns the value of the given `D<n>` field.
1788    pub const fn d(self, n: u32) -> u8 {
1789        assert!(n < 16);
1790        ((self.bits() >> (Self::D_SHIFT + (n - 0) * 2)) & 0b11) as u8
1791    }
1792}
1793
1794bitflags! {
1795    /// `DBGAUTHSTATUS` system register value.
1796    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1797    #[repr(transparent)]
1798    pub struct Dbgauthstatus: u32 {
1799    }
1800}
1801
1802impl Dbgauthstatus {
1803    /// Offset of the `NSID` field.
1804    pub const NSID_SHIFT: u32 = 0;
1805    /// Mask for the `NSID` field.
1806    pub const NSID_MASK: u32 = 0b11;
1807    /// Offset of the `NSNID` field.
1808    pub const NSNID_SHIFT: u32 = 2;
1809    /// Mask for the `NSNID` field.
1810    pub const NSNID_MASK: u32 = 0b11;
1811    /// Offset of the `SID` field.
1812    pub const SID_SHIFT: u32 = 4;
1813    /// Mask for the `SID` field.
1814    pub const SID_MASK: u32 = 0b11;
1815    /// Offset of the `SNID` field.
1816    pub const SNID_SHIFT: u32 = 6;
1817    /// Mask for the `SNID` field.
1818    pub const SNID_MASK: u32 = 0b11;
1819
1820    /// Returns the value of the `NSID` field.
1821    pub const fn nsid(self) -> u8 {
1822        ((self.bits() >> Self::NSID_SHIFT) & 0b11) as u8
1823    }
1824
1825    /// Returns the value of the `NSNID` field.
1826    pub const fn nsnid(self) -> u8 {
1827        ((self.bits() >> Self::NSNID_SHIFT) & 0b11) as u8
1828    }
1829
1830    /// Returns the value of the `SID` field.
1831    pub const fn sid(self) -> u8 {
1832        ((self.bits() >> Self::SID_SHIFT) & 0b11) as u8
1833    }
1834
1835    /// Returns the value of the `SNID` field.
1836    pub const fn snid(self) -> u8 {
1837        ((self.bits() >> Self::SNID_SHIFT) & 0b11) as u8
1838    }
1839}
1840
1841bitflags! {
1842    /// `DBGCLAIMCLR` system register value.
1843    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1844    #[repr(transparent)]
1845    pub struct Dbgclaimclr: u32 {
1846        /// `CLAIM<m>` bit 0.
1847        const CLAIM0 = 1 << 0;
1848        /// `CLAIM<m>` bit 1.
1849        const CLAIM1 = 1 << 1;
1850        /// `CLAIM<m>` bit 2.
1851        const CLAIM2 = 1 << 2;
1852        /// `CLAIM<m>` bit 3.
1853        const CLAIM3 = 1 << 3;
1854        /// `CLAIM<m>` bit 4.
1855        const CLAIM4 = 1 << 4;
1856        /// `CLAIM<m>` bit 5.
1857        const CLAIM5 = 1 << 5;
1858        /// `CLAIM<m>` bit 6.
1859        const CLAIM6 = 1 << 6;
1860        /// `CLAIM<m>` bit 7.
1861        const CLAIM7 = 1 << 7;
1862    }
1863}
1864
1865impl Dbgclaimclr {
1866    /// Offset of the `CLAIM<m>` field.
1867    pub const CLAIM_SHIFT: u32 = 0;
1868}
1869
1870bitflags! {
1871    /// `DBGCLAIMSET` system register value.
1872    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1873    #[repr(transparent)]
1874    pub struct Dbgclaimset: u32 {
1875        /// `CLAIM<m>` bit 0.
1876        const CLAIM0 = 1 << 0;
1877        /// `CLAIM<m>` bit 1.
1878        const CLAIM1 = 1 << 1;
1879        /// `CLAIM<m>` bit 2.
1880        const CLAIM2 = 1 << 2;
1881        /// `CLAIM<m>` bit 3.
1882        const CLAIM3 = 1 << 3;
1883        /// `CLAIM<m>` bit 4.
1884        const CLAIM4 = 1 << 4;
1885        /// `CLAIM<m>` bit 5.
1886        const CLAIM5 = 1 << 5;
1887        /// `CLAIM<m>` bit 6.
1888        const CLAIM6 = 1 << 6;
1889        /// `CLAIM<m>` bit 7.
1890        const CLAIM7 = 1 << 7;
1891    }
1892}
1893
1894impl Dbgclaimset {
1895    /// Offset of the `CLAIM<m>` field.
1896    pub const CLAIM_SHIFT: u32 = 0;
1897}
1898
1899bitflags! {
1900    /// `DBGDCCINT` system register value.
1901    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1902    #[repr(transparent)]
1903    pub struct Dbgdccint: u32 {
1904        /// `TX` bit.
1905        const TX = 1 << 29;
1906        /// `RX` bit.
1907        const RX = 1 << 30;
1908    }
1909}
1910
1911impl Dbgdccint {
1912    /// Offset of the `TX` field.
1913    pub const TX_SHIFT: u32 = 29;
1914    /// Offset of the `RX` field.
1915    pub const RX_SHIFT: u32 = 30;
1916}
1917
1918bitflags! {
1919    /// `DBGDEVID` system register value.
1920    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
1921    #[repr(transparent)]
1922    pub struct Dbgdevid: u32 {
1923    }
1924}
1925
1926impl Dbgdevid {
1927    /// Offset of the `PCSample` field.
1928    pub const PCSAMPLE_SHIFT: u32 = 0;
1929    /// Mask for the `PCSample` field.
1930    pub const PCSAMPLE_MASK: u32 = 0b1111;
1931    /// Offset of the `WPAddrMask` field.
1932    pub const WPADDRMASK_SHIFT: u32 = 4;
1933    /// Mask for the `WPAddrMask` field.
1934    pub const WPADDRMASK_MASK: u32 = 0b1111;
1935    /// Offset of the `BPAddrMask` field.
1936    pub const BPADDRMASK_SHIFT: u32 = 8;
1937    /// Mask for the `BPAddrMask` field.
1938    pub const BPADDRMASK_MASK: u32 = 0b1111;
1939    /// Offset of the `VectorCatch` field.
1940    pub const VECTORCATCH_SHIFT: u32 = 12;
1941    /// Mask for the `VectorCatch` field.
1942    pub const VECTORCATCH_MASK: u32 = 0b1111;
1943    /// Offset of the `VirtExtns` field.
1944    pub const VIRTEXTNS_SHIFT: u32 = 16;
1945    /// Mask for the `VirtExtns` field.
1946    pub const VIRTEXTNS_MASK: u32 = 0b1111;
1947    /// Offset of the `DoubleLock` field.
1948    pub const DOUBLELOCK_SHIFT: u32 = 20;
1949    /// Mask for the `DoubleLock` field.
1950    pub const DOUBLELOCK_MASK: u32 = 0b1111;
1951    /// Offset of the `AuxRegs` field.
1952    pub const AUXREGS_SHIFT: u32 = 24;
1953    /// Mask for the `AuxRegs` field.
1954    pub const AUXREGS_MASK: u32 = 0b1111;
1955    /// Offset of the `CIDMask` field.
1956    pub const CIDMASK_SHIFT: u32 = 28;
1957    /// Mask for the `CIDMask` field.
1958    pub const CIDMASK_MASK: u32 = 0b1111;
1959
1960    /// Returns the value of the `PCSample` field.
1961    pub const fn pcsample(self) -> u8 {
1962        ((self.bits() >> Self::PCSAMPLE_SHIFT) & 0b1111) as u8
1963    }
1964
1965    /// Returns the value of the `WPAddrMask` field.
1966    pub const fn wpaddrmask(self) -> u8 {
1967        ((self.bits() >> Self::WPADDRMASK_SHIFT) & 0b1111) as u8
1968    }
1969
1970    /// Returns the value of the `BPAddrMask` field.
1971    pub const fn bpaddrmask(self) -> u8 {
1972        ((self.bits() >> Self::BPADDRMASK_SHIFT) & 0b1111) as u8
1973    }
1974
1975    /// Returns the value of the `VectorCatch` field.
1976    pub const fn vectorcatch(self) -> u8 {
1977        ((self.bits() >> Self::VECTORCATCH_SHIFT) & 0b1111) as u8
1978    }
1979
1980    /// Returns the value of the `VirtExtns` field.
1981    pub const fn virtextns(self) -> u8 {
1982        ((self.bits() >> Self::VIRTEXTNS_SHIFT) & 0b1111) as u8
1983    }
1984
1985    /// Returns the value of the `DoubleLock` field.
1986    pub const fn doublelock(self) -> u8 {
1987        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
1988    }
1989
1990    /// Returns the value of the `AuxRegs` field.
1991    pub const fn auxregs(self) -> u8 {
1992        ((self.bits() >> Self::AUXREGS_SHIFT) & 0b1111) as u8
1993    }
1994
1995    /// Returns the value of the `CIDMask` field.
1996    pub const fn cidmask(self) -> u8 {
1997        ((self.bits() >> Self::CIDMASK_SHIFT) & 0b1111) as u8
1998    }
1999}
2000
2001bitflags! {
2002    /// `DBGDEVID1` system register value.
2003    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2004    #[repr(transparent)]
2005    pub struct Dbgdevid1: u32 {
2006    }
2007}
2008
2009impl Dbgdevid1 {
2010    /// Offset of the `PCSROffset` field.
2011    pub const PCSROFFSET_SHIFT: u32 = 0;
2012    /// Mask for the `PCSROffset` field.
2013    pub const PCSROFFSET_MASK: u32 = 0b1111;
2014
2015    /// Returns the value of the `PCSROffset` field.
2016    pub const fn pcsroffset(self) -> u8 {
2017        ((self.bits() >> Self::PCSROFFSET_SHIFT) & 0b1111) as u8
2018    }
2019}
2020
2021bitflags! {
2022    /// `DBGDIDR` system register value.
2023    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2024    #[repr(transparent)]
2025    pub struct Dbgdidr: u32 {
2026        /// RES1 bits in the `DBGDIDR` register.
2027        const RES1 = 0b1000000000000000;
2028        /// `SE_imp` bit.
2029        const SE_IMP = 1 << 12;
2030        /// `nSUHD_imp` bit.
2031        const NSUHD_IMP = 1 << 14;
2032    }
2033}
2034
2035impl Dbgdidr {
2036    /// Offset of the `SE_imp` field.
2037    pub const SE_IMP_SHIFT: u32 = 12;
2038    /// Offset of the `nSUHD_imp` field.
2039    pub const NSUHD_IMP_SHIFT: u32 = 14;
2040    /// Offset of the `Version` field.
2041    pub const VERSION_SHIFT: u32 = 16;
2042    /// Mask for the `Version` field.
2043    pub const VERSION_MASK: u32 = 0b1111;
2044    /// Offset of the `CTX_CMPs` field.
2045    pub const CTX_CMPS_SHIFT: u32 = 20;
2046    /// Mask for the `CTX_CMPs` field.
2047    pub const CTX_CMPS_MASK: u32 = 0b1111;
2048    /// Offset of the `BRPs` field.
2049    pub const BRPS_SHIFT: u32 = 24;
2050    /// Mask for the `BRPs` field.
2051    pub const BRPS_MASK: u32 = 0b1111;
2052    /// Offset of the `WRPs` field.
2053    pub const WRPS_SHIFT: u32 = 28;
2054    /// Mask for the `WRPs` field.
2055    pub const WRPS_MASK: u32 = 0b1111;
2056
2057    /// Returns the value of the `Version` field.
2058    pub const fn version(self) -> u8 {
2059        ((self.bits() >> Self::VERSION_SHIFT) & 0b1111) as u8
2060    }
2061
2062    /// Returns the value of the `CTX_CMPs` field.
2063    pub const fn ctx_cmps(self) -> u8 {
2064        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
2065    }
2066
2067    /// Returns the value of the `BRPs` field.
2068    pub const fn brps(self) -> u8 {
2069        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
2070    }
2071
2072    /// Returns the value of the `WRPs` field.
2073    pub const fn wrps(self) -> u8 {
2074        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
2075    }
2076}
2077
2078bitflags! {
2079    /// `DBGDRAR` system register value.
2080    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2081    #[repr(transparent)]
2082    pub struct Dbgdrar: u64 {
2083    }
2084}
2085
2086impl Dbgdrar {
2087    /// Offset of the `Valid` field.
2088    pub const VALID_SHIFT: u32 = 0;
2089    /// Mask for the `Valid` field.
2090    pub const VALID_MASK: u64 = 0b11;
2091    /// Offset of the `ROMADDR[47:12]` field.
2092    pub const ROMADDR_47_12_SHIFT: u32 = 12;
2093    /// Mask for the `ROMADDR[47:12]` field.
2094    pub const ROMADDR_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
2095
2096    /// Returns the value of the `Valid` field.
2097    pub const fn valid(self) -> u8 {
2098        ((self.bits() >> Self::VALID_SHIFT) & 0b11) as u8
2099    }
2100
2101    /// Returns the value of the `ROMADDR[47:12]` field.
2102    pub const fn romaddr_47_12(self) -> u64 {
2103        ((self.bits() >> Self::ROMADDR_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
2104    }
2105}
2106
2107bitflags! {
2108    /// `DBGDSCRext` system register value.
2109    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2110    #[repr(transparent)]
2111    pub struct Dbgdscrext: u32 {
2112        /// `ERR` bit.
2113        const ERR = 1 << 6;
2114        /// `UDCCdis` bit.
2115        const UDCCDIS = 1 << 12;
2116        /// `HDE` bit.
2117        const HDE = 1 << 14;
2118        /// `MDBGen` bit.
2119        const MDBGEN = 1 << 15;
2120        /// `SPIDdis` bit.
2121        const SPIDDIS = 1 << 16;
2122        /// `SPNIDdis` bit.
2123        const SPNIDDIS = 1 << 17;
2124        /// `NS` bit.
2125        const NS = 1 << 18;
2126        /// `SC2` bit.
2127        const SC2 = 1 << 19;
2128        /// `TDA` bit.
2129        const TDA = 1 << 21;
2130        /// `TXU` bit.
2131        const TXU = 1 << 26;
2132        /// `RXO` bit.
2133        const RXO = 1 << 27;
2134        /// `TXfull` bit.
2135        const TXFULL = 1 << 29;
2136        /// `RXfull` bit.
2137        const RXFULL = 1 << 30;
2138        /// `TFO` bit.
2139        const TFO = 1 << 31;
2140    }
2141}
2142
2143impl Dbgdscrext {
2144    /// Offset of the `MOE` field.
2145    pub const MOE_SHIFT: u32 = 2;
2146    /// Mask for the `MOE` field.
2147    pub const MOE_MASK: u32 = 0b1111;
2148    /// Offset of the `ERR` field.
2149    pub const ERR_SHIFT: u32 = 6;
2150    /// Offset of the `UDCCdis` field.
2151    pub const UDCCDIS_SHIFT: u32 = 12;
2152    /// Offset of the `HDE` field.
2153    pub const HDE_SHIFT: u32 = 14;
2154    /// Offset of the `MDBGen` field.
2155    pub const MDBGEN_SHIFT: u32 = 15;
2156    /// Offset of the `SPIDdis` field.
2157    pub const SPIDDIS_SHIFT: u32 = 16;
2158    /// Offset of the `SPNIDdis` field.
2159    pub const SPNIDDIS_SHIFT: u32 = 17;
2160    /// Offset of the `NS` field.
2161    pub const NS_SHIFT: u32 = 18;
2162    /// Offset of the `SC2` field.
2163    pub const SC2_SHIFT: u32 = 19;
2164    /// Offset of the `TDA` field.
2165    pub const TDA_SHIFT: u32 = 21;
2166    /// Offset of the `INTdis` field.
2167    pub const INTDIS_SHIFT: u32 = 22;
2168    /// Mask for the `INTdis` field.
2169    pub const INTDIS_MASK: u32 = 0b11;
2170    /// Offset of the `TXU` field.
2171    pub const TXU_SHIFT: u32 = 26;
2172    /// Offset of the `RXO` field.
2173    pub const RXO_SHIFT: u32 = 27;
2174    /// Offset of the `TXfull` field.
2175    pub const TXFULL_SHIFT: u32 = 29;
2176    /// Offset of the `RXfull` field.
2177    pub const RXFULL_SHIFT: u32 = 30;
2178    /// Offset of the `TFO` field.
2179    pub const TFO_SHIFT: u32 = 31;
2180
2181    /// Returns the value of the `MOE` field.
2182    pub const fn moe(self) -> u8 {
2183        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
2184    }
2185
2186    /// Returns the value of the `INTdis` field.
2187    pub const fn intdis(self) -> u8 {
2188        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
2189    }
2190}
2191
2192bitflags! {
2193    /// `DBGDSCRint` system register value.
2194    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2195    #[repr(transparent)]
2196    pub struct Dbgdscrint: u32 {
2197        /// `UDCCdis` bit.
2198        const UDCCDIS = 1 << 12;
2199        /// `MDBGen` bit.
2200        const MDBGEN = 1 << 15;
2201        /// `SPIDdis` bit.
2202        const SPIDDIS = 1 << 16;
2203        /// `SPNIDdis` bit.
2204        const SPNIDDIS = 1 << 17;
2205        /// `NS` bit.
2206        const NS = 1 << 18;
2207        /// `TXfull` bit.
2208        const TXFULL = 1 << 29;
2209        /// `RXfull` bit.
2210        const RXFULL = 1 << 30;
2211    }
2212}
2213
2214impl Dbgdscrint {
2215    /// Offset of the `MOE` field.
2216    pub const MOE_SHIFT: u32 = 2;
2217    /// Mask for the `MOE` field.
2218    pub const MOE_MASK: u32 = 0b1111;
2219    /// Offset of the `UDCCdis` field.
2220    pub const UDCCDIS_SHIFT: u32 = 12;
2221    /// Offset of the `MDBGen` field.
2222    pub const MDBGEN_SHIFT: u32 = 15;
2223    /// Offset of the `SPIDdis` field.
2224    pub const SPIDDIS_SHIFT: u32 = 16;
2225    /// Offset of the `SPNIDdis` field.
2226    pub const SPNIDDIS_SHIFT: u32 = 17;
2227    /// Offset of the `NS` field.
2228    pub const NS_SHIFT: u32 = 18;
2229    /// Offset of the `TXfull` field.
2230    pub const TXFULL_SHIFT: u32 = 29;
2231    /// Offset of the `RXfull` field.
2232    pub const RXFULL_SHIFT: u32 = 30;
2233
2234    /// Returns the value of the `MOE` field.
2235    pub const fn moe(self) -> u8 {
2236        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
2237    }
2238}
2239
2240bitflags! {
2241    /// `DBGDTRRXext` system register value.
2242    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2243    #[repr(transparent)]
2244    pub struct Dbgdtrrxext: u32 {
2245    }
2246}
2247
2248impl Dbgdtrrxext {
2249    /// Offset of the `DTRRX` field.
2250    pub const DTRRX_SHIFT: u32 = 0;
2251    /// Mask for the `DTRRX` field.
2252    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
2253
2254    /// Returns the value of the `DTRRX` field.
2255    pub const fn dtrrx(self) -> u32 {
2256        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
2257    }
2258}
2259
2260bitflags! {
2261    /// `DBGDTRRXint` system register value.
2262    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2263    #[repr(transparent)]
2264    pub struct Dbgdtrrxint: u32 {
2265    }
2266}
2267
2268impl Dbgdtrrxint {
2269    /// Offset of the `DTRRX` field.
2270    pub const DTRRX_SHIFT: u32 = 0;
2271    /// Mask for the `DTRRX` field.
2272    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
2273
2274    /// Returns the value of the `DTRRX` field.
2275    pub const fn dtrrx(self) -> u32 {
2276        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
2277    }
2278}
2279
2280bitflags! {
2281    /// `DBGDTRTXext` system register value.
2282    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2283    #[repr(transparent)]
2284    pub struct Dbgdtrtxext: u32 {
2285    }
2286}
2287
2288impl Dbgdtrtxext {
2289    /// Offset of the `DTRTX` field.
2290    pub const DTRTX_SHIFT: u32 = 0;
2291    /// Mask for the `DTRTX` field.
2292    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
2293
2294    /// Returns the value of the `DTRTX` field.
2295    pub const fn dtrtx(self) -> u32 {
2296        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
2297    }
2298}
2299
2300bitflags! {
2301    /// `DBGDTRTXint` system register value.
2302    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2303    #[repr(transparent)]
2304    pub struct Dbgdtrtxint: u32 {
2305    }
2306}
2307
2308impl Dbgdtrtxint {
2309    /// Offset of the `DTRTX` field.
2310    pub const DTRTX_SHIFT: u32 = 0;
2311    /// Mask for the `DTRTX` field.
2312    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
2313
2314    /// Returns the value of the `DTRTX` field.
2315    pub const fn dtrtx(self) -> u32 {
2316        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
2317    }
2318}
2319
2320bitflags! {
2321    /// `DBGOSDLR` system register value.
2322    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2323    #[repr(transparent)]
2324    pub struct Dbgosdlr: u32 {
2325        /// `DLK` bit.
2326        const DLK = 1 << 0;
2327    }
2328}
2329
2330impl Dbgosdlr {
2331    /// Offset of the `DLK` field.
2332    pub const DLK_SHIFT: u32 = 0;
2333}
2334
2335bitflags! {
2336    /// `DBGOSECCR` system register value.
2337    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2338    #[repr(transparent)]
2339    pub struct Dbgoseccr: u32 {
2340    }
2341}
2342
2343impl Dbgoseccr {
2344    /// Offset of the `EDECCR` field.
2345    pub const EDECCR_SHIFT: u32 = 0;
2346    /// Mask for the `EDECCR` field.
2347    pub const EDECCR_MASK: u32 = 0b11111111111111111111111111111111;
2348
2349    /// Returns the value of the `EDECCR` field.
2350    pub const fn edeccr(self) -> u32 {
2351        ((self.bits() >> Self::EDECCR_SHIFT) & 0b11111111111111111111111111111111) as u32
2352    }
2353}
2354
2355bitflags! {
2356    /// `DBGOSLAR` system register value.
2357    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2358    #[repr(transparent)]
2359    pub struct Dbgoslar: u32 {
2360    }
2361}
2362
2363impl Dbgoslar {
2364    /// Offset of the `OSLA` field.
2365    pub const OSLA_SHIFT: u32 = 0;
2366    /// Mask for the `OSLA` field.
2367    pub const OSLA_MASK: u32 = 0b11111111111111111111111111111111;
2368
2369    /// Returns the value of the `OSLA` field.
2370    pub const fn osla(self) -> u32 {
2371        ((self.bits() >> Self::OSLA_SHIFT) & 0b11111111111111111111111111111111) as u32
2372    }
2373}
2374
2375bitflags! {
2376    /// `DBGOSLSR` system register value.
2377    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2378    #[repr(transparent)]
2379    pub struct Dbgoslsr: u32 {
2380        /// `OSLK` bit.
2381        const OSLK = 1 << 1;
2382        /// `nTT` bit.
2383        const NTT = 1 << 2;
2384    }
2385}
2386
2387impl Dbgoslsr {
2388    /// Offset of the `OSLK` field.
2389    pub const OSLK_SHIFT: u32 = 1;
2390    /// Offset of the `nTT` field.
2391    pub const NTT_SHIFT: u32 = 2;
2392}
2393
2394bitflags! {
2395    /// `DBGPRCR` system register value.
2396    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2397    #[repr(transparent)]
2398    pub struct Dbgprcr: u32 {
2399        /// `CORENPDRQ` bit.
2400        const CORENPDRQ = 1 << 0;
2401    }
2402}
2403
2404impl Dbgprcr {
2405    /// Offset of the `CORENPDRQ` field.
2406    pub const CORENPDRQ_SHIFT: u32 = 0;
2407}
2408
2409bitflags! {
2410    /// `DBGVCR` system register value.
2411    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2412    #[repr(transparent)]
2413    pub struct Dbgvcr: u32 {
2414        /// `SU` bit.
2415        const SU = 1 << 1;
2416        /// `U` bit.
2417        const U = 1 << 1;
2418        /// `S` bit.
2419        const S = 1 << 2;
2420        /// `SS` bit.
2421        const SS = 1 << 2;
2422        /// `P` bit.
2423        const P = 1 << 3;
2424        /// `SP` bit.
2425        const SP = 1 << 3;
2426        /// `D` bit.
2427        const D = 1 << 4;
2428        /// `SD` bit.
2429        const SD = 1 << 4;
2430        /// `I` bit.
2431        const I = 1 << 6;
2432        /// `SI` bit.
2433        const SI = 1 << 6;
2434        /// `F` bit.
2435        const F = 1 << 7;
2436        /// `SF` bit.
2437        const SF = 1 << 7;
2438        /// `MS` bit.
2439        const MS = 1 << 10;
2440        /// `MP` bit.
2441        const MP = 1 << 11;
2442        /// `MD` bit.
2443        const MD = 1 << 12;
2444        /// `MI` bit.
2445        const MI = 1 << 14;
2446        /// `MF` bit.
2447        const MF = 1 << 15;
2448        /// `NSU` bit.
2449        const NSU = 1 << 25;
2450        /// `NSS` bit.
2451        const NSS = 1 << 26;
2452        /// `NSP` bit.
2453        const NSP = 1 << 27;
2454        /// `NSD` bit.
2455        const NSD = 1 << 28;
2456        /// `NSI` bit.
2457        const NSI = 1 << 30;
2458        /// `NSF` bit.
2459        const NSF = 1 << 31;
2460    }
2461}
2462
2463impl Dbgvcr {
2464    /// Offset of the `SU` field.
2465    pub const SU_SHIFT: u32 = 1;
2466    /// Offset of the `U` field.
2467    pub const U_SHIFT: u32 = 1;
2468    /// Offset of the `S` field.
2469    pub const S_SHIFT: u32 = 2;
2470    /// Offset of the `SS` field.
2471    pub const SS_SHIFT: u32 = 2;
2472    /// Offset of the `P` field.
2473    pub const P_SHIFT: u32 = 3;
2474    /// Offset of the `SP` field.
2475    pub const SP_SHIFT: u32 = 3;
2476    /// Offset of the `D` field.
2477    pub const D_SHIFT: u32 = 4;
2478    /// Offset of the `SD` field.
2479    pub const SD_SHIFT: u32 = 4;
2480    /// Offset of the `I` field.
2481    pub const I_SHIFT: u32 = 6;
2482    /// Offset of the `SI` field.
2483    pub const SI_SHIFT: u32 = 6;
2484    /// Offset of the `F` field.
2485    pub const F_SHIFT: u32 = 7;
2486    /// Offset of the `SF` field.
2487    pub const SF_SHIFT: u32 = 7;
2488    /// Offset of the `MS` field.
2489    pub const MS_SHIFT: u32 = 10;
2490    /// Offset of the `MP` field.
2491    pub const MP_SHIFT: u32 = 11;
2492    /// Offset of the `MD` field.
2493    pub const MD_SHIFT: u32 = 12;
2494    /// Offset of the `MI` field.
2495    pub const MI_SHIFT: u32 = 14;
2496    /// Offset of the `MF` field.
2497    pub const MF_SHIFT: u32 = 15;
2498    /// Offset of the `NSU` field.
2499    pub const NSU_SHIFT: u32 = 25;
2500    /// Offset of the `NSS` field.
2501    pub const NSS_SHIFT: u32 = 26;
2502    /// Offset of the `NSP` field.
2503    pub const NSP_SHIFT: u32 = 27;
2504    /// Offset of the `NSD` field.
2505    pub const NSD_SHIFT: u32 = 28;
2506    /// Offset of the `NSI` field.
2507    pub const NSI_SHIFT: u32 = 30;
2508    /// Offset of the `NSF` field.
2509    pub const NSF_SHIFT: u32 = 31;
2510}
2511
2512bitflags! {
2513    /// `DFAR` system register value.
2514    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2515    #[repr(transparent)]
2516    pub struct Dfar: u32 {
2517    }
2518}
2519
2520impl Dfar {
2521    /// Offset of the `VA` field.
2522    pub const VA_SHIFT: u32 = 0;
2523    /// Mask for the `VA` field.
2524    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
2525
2526    /// Returns the value of the `VA` field.
2527    pub const fn va(self) -> u32 {
2528        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
2529    }
2530}
2531
2532bitflags! {
2533    /// `DFSR` system register value.
2534    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2535    #[repr(transparent)]
2536    pub struct Dfsr: u32 {
2537        /// `LPAE` bit.
2538        const LPAE = 1 << 9;
2539        /// `WnR` bit.
2540        const WNR = 1 << 11;
2541        /// `ExT` bit.
2542        const EXT = 1 << 12;
2543        /// `CM` bit.
2544        const CM = 1 << 13;
2545        /// `FnV` bit.
2546        const FNV = 1 << 16;
2547    }
2548}
2549
2550impl Dfsr {
2551    /// Offset of the `STATUS` field.
2552    pub const STATUS_SHIFT: u32 = 0;
2553    /// Mask for the `STATUS` field.
2554    pub const STATUS_MASK: u32 = 0b111111;
2555    /// Offset of the `Domain` field.
2556    pub const DOMAIN_SHIFT: u32 = 4;
2557    /// Mask for the `Domain` field.
2558    pub const DOMAIN_MASK: u32 = 0b1111;
2559    /// Offset of the `LPAE` field.
2560    pub const LPAE_SHIFT: u32 = 9;
2561    /// Offset of the `WnR` field.
2562    pub const WNR_SHIFT: u32 = 11;
2563    /// Offset of the `ExT` field.
2564    pub const EXT_SHIFT: u32 = 12;
2565    /// Offset of the `CM` field.
2566    pub const CM_SHIFT: u32 = 13;
2567    /// Offset of the `AET` field.
2568    pub const AET_SHIFT: u32 = 14;
2569    /// Mask for the `AET` field.
2570    pub const AET_MASK: u32 = 0b11;
2571    /// Offset of the `FnV` field.
2572    pub const FNV_SHIFT: u32 = 16;
2573
2574    /// Returns the value of the `STATUS` field.
2575    pub const fn status(self) -> u8 {
2576        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
2577    }
2578
2579    /// Returns the value of the `Domain` field.
2580    pub const fn domain(self) -> u8 {
2581        ((self.bits() >> Self::DOMAIN_SHIFT) & 0b1111) as u8
2582    }
2583
2584    /// Returns the value of the `AET` field.
2585    pub const fn aet(self) -> u8 {
2586        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
2587    }
2588}
2589
2590bitflags! {
2591    /// `DISR` system register value.
2592    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2593    #[repr(transparent)]
2594    pub struct Disr: u32 {
2595        /// `EA` bit.
2596        const EA = 1 << 9;
2597        /// `LPAE` bit.
2598        const LPAE = 1 << 9;
2599        /// `ExT` bit.
2600        const EXT = 1 << 12;
2601        /// `A` bit.
2602        const A = 1 << 31;
2603    }
2604}
2605
2606impl Disr {
2607    /// Offset of the `DFSC` field.
2608    pub const DFSC_SHIFT: u32 = 0;
2609    /// Mask for the `DFSC` field.
2610    pub const DFSC_MASK: u32 = 0b111111;
2611    /// Offset of the `STATUS` field.
2612    pub const STATUS_SHIFT: u32 = 0;
2613    /// Mask for the `STATUS` field.
2614    pub const STATUS_MASK: u32 = 0b111111;
2615    /// Offset of the `EA` field.
2616    pub const EA_SHIFT: u32 = 9;
2617    /// Offset of the `LPAE` field.
2618    pub const LPAE_SHIFT: u32 = 9;
2619    /// Offset of the `ExT` field.
2620    pub const EXT_SHIFT: u32 = 12;
2621    /// Offset of the `A` field.
2622    pub const A_SHIFT: u32 = 31;
2623
2624    /// Returns the value of the `DFSC` field.
2625    pub const fn dfsc(self) -> u8 {
2626        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
2627    }
2628
2629    /// Returns the value of the `STATUS` field.
2630    pub const fn status(self) -> u8 {
2631        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
2632    }
2633}
2634
2635#[cfg(feature = "el1")]
2636bitflags! {
2637    /// `DISR_EL1` system register value.
2638    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2639    #[repr(transparent)]
2640    pub struct DisrEl1: u64 {
2641        /// `WnR` bit.
2642        const WNR = 1 << 6;
2643        /// `WnRV` bit.
2644        const WNRV = 1 << 7;
2645        /// `EA` bit.
2646        const EA = 1 << 9;
2647        /// `IDS` bit.
2648        const IDS = 1 << 24;
2649        /// `A` bit.
2650        const A = 1 << 31;
2651    }
2652}
2653
2654#[cfg(feature = "el1")]
2655impl DisrEl1 {
2656    /// Offset of the `DFSC` field.
2657    pub const DFSC_SHIFT: u32 = 0;
2658    /// Mask for the `DFSC` field.
2659    pub const DFSC_MASK: u64 = 0b111111;
2660    /// Offset of the `WnR` field.
2661    pub const WNR_SHIFT: u32 = 6;
2662    /// Offset of the `WnRV` field.
2663    pub const WNRV_SHIFT: u32 = 7;
2664    /// Offset of the `EA` field.
2665    pub const EA_SHIFT: u32 = 9;
2666    /// Offset of the `AET` field.
2667    pub const AET_SHIFT: u32 = 10;
2668    /// Mask for the `AET` field.
2669    pub const AET_MASK: u64 = 0b111;
2670    /// Offset of the `WU` field.
2671    pub const WU_SHIFT: u32 = 16;
2672    /// Mask for the `WU` field.
2673    pub const WU_MASK: u64 = 0b11;
2674    /// Offset of the `IDS` field.
2675    pub const IDS_SHIFT: u32 = 24;
2676    /// Offset of the `A` field.
2677    pub const A_SHIFT: u32 = 31;
2678
2679    /// Returns the value of the `DFSC` field.
2680    pub const fn dfsc(self) -> u8 {
2681        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
2682    }
2683
2684    /// Returns the value of the `AET` field.
2685    pub const fn aet(self) -> u8 {
2686        ((self.bits() >> Self::AET_SHIFT) & 0b111) as u8
2687    }
2688
2689    /// Returns the value of the `WU` field.
2690    pub const fn wu(self) -> u8 {
2691        ((self.bits() >> Self::WU_SHIFT) & 0b11) as u8
2692    }
2693}
2694
2695bitflags! {
2696    /// `DIT` system register value.
2697    ///
2698    /// Data Independent Timing.
2699    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2700    #[repr(transparent)]
2701    pub struct Dit: u64 {
2702        /// Enable data independent timing.
2703        const DIT = 1 << 24;
2704    }
2705}
2706
2707impl Dit {
2708    /// Offset of the `DIT` field.
2709    pub const DIT_SHIFT: u32 = 24;
2710}
2711
2712bitflags! {
2713    /// `DLR` system register value.
2714    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2715    #[repr(transparent)]
2716    pub struct Dlr: u32 {
2717    }
2718}
2719
2720impl Dlr {
2721    /// Offset of the `ADDR` field.
2722    pub const ADDR_SHIFT: u32 = 0;
2723    /// Mask for the `ADDR` field.
2724    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
2725
2726    /// Returns the value of the `ADDR` field.
2727    pub const fn addr(self) -> u32 {
2728        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
2729    }
2730}
2731
2732bitflags! {
2733    /// `DSPSR` system register value.
2734    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2735    #[repr(transparent)]
2736    pub struct Dspsr: u32 {
2737        /// `T` bit.
2738        const T = 1 << 5;
2739        /// `F` bit.
2740        const F = 1 << 6;
2741        /// `I` bit.
2742        const I = 1 << 7;
2743        /// `A` bit.
2744        const A = 1 << 8;
2745        /// `E` bit.
2746        const E = 1 << 9;
2747        /// `IL` bit.
2748        const IL = 1 << 20;
2749        /// `SS` bit.
2750        const SS = 1 << 21;
2751        /// `PAN` bit.
2752        const PAN = 1 << 22;
2753        /// `SSBS` bit.
2754        const SSBS = 1 << 23;
2755        /// `DIT` bit.
2756        const DIT = 1 << 24;
2757        /// `Q` bit.
2758        const Q = 1 << 27;
2759        /// `V` bit.
2760        const V = 1 << 28;
2761        /// `C` bit.
2762        const C = 1 << 29;
2763        /// `Z` bit.
2764        const Z = 1 << 30;
2765        /// `N` bit.
2766        const N = 1 << 31;
2767    }
2768}
2769
2770impl Dspsr {
2771    /// Offset of the `M[4:0]` field.
2772    pub const M_4_0_SHIFT: u32 = 0;
2773    /// Mask for the `M[4:0]` field.
2774    pub const M_4_0_MASK: u32 = 0b11111;
2775    /// Offset of the `T` field.
2776    pub const T_SHIFT: u32 = 5;
2777    /// Offset of the `F` field.
2778    pub const F_SHIFT: u32 = 6;
2779    /// Offset of the `I` field.
2780    pub const I_SHIFT: u32 = 7;
2781    /// Offset of the `A` field.
2782    pub const A_SHIFT: u32 = 8;
2783    /// Offset of the `E` field.
2784    pub const E_SHIFT: u32 = 9;
2785    /// Offset of the `GE` field.
2786    pub const GE_SHIFT: u32 = 16;
2787    /// Mask for the `GE` field.
2788    pub const GE_MASK: u32 = 0b1111;
2789    /// Offset of the `IL` field.
2790    pub const IL_SHIFT: u32 = 20;
2791    /// Offset of the `SS` field.
2792    pub const SS_SHIFT: u32 = 21;
2793    /// Offset of the `PAN` field.
2794    pub const PAN_SHIFT: u32 = 22;
2795    /// Offset of the `SSBS` field.
2796    pub const SSBS_SHIFT: u32 = 23;
2797    /// Offset of the `DIT` field.
2798    pub const DIT_SHIFT: u32 = 24;
2799    /// Offset of the `Q` field.
2800    pub const Q_SHIFT: u32 = 27;
2801    /// Offset of the `V` field.
2802    pub const V_SHIFT: u32 = 28;
2803    /// Offset of the `C` field.
2804    pub const C_SHIFT: u32 = 29;
2805    /// Offset of the `Z` field.
2806    pub const Z_SHIFT: u32 = 30;
2807    /// Offset of the `N` field.
2808    pub const N_SHIFT: u32 = 31;
2809
2810    /// Returns the value of the `M[4:0]` field.
2811    pub const fn m_4_0(self) -> u8 {
2812        ((self.bits() >> Self::M_4_0_SHIFT) & 0b11111) as u8
2813    }
2814
2815    /// Returns the value of the `GE` field.
2816    pub const fn ge(self) -> u8 {
2817        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
2818    }
2819}
2820
2821bitflags! {
2822    /// `DSPSR2` system register value.
2823    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2824    #[repr(transparent)]
2825    pub struct Dspsr2: u32 {
2826        /// `PPEND` bit.
2827        const PPEND = 1 << 1;
2828        /// `UINJ` bit.
2829        const UINJ = 1 << 4;
2830    }
2831}
2832
2833impl Dspsr2 {
2834    /// Offset of the `PPEND` field.
2835    pub const PPEND_SHIFT: u32 = 1;
2836    /// Offset of the `UINJ` field.
2837    pub const UINJ_SHIFT: u32 = 4;
2838}
2839
2840#[cfg(feature = "el1")]
2841bitflags! {
2842    /// `ELR_EL1` system register value.
2843    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2844    #[repr(transparent)]
2845    pub struct ElrEl1: u64 {
2846    }
2847}
2848
2849#[cfg(feature = "el1")]
2850impl ElrEl1 {
2851    /// Offset of the `ADDR` field.
2852    pub const ADDR_SHIFT: u32 = 0;
2853    /// Mask for the `ADDR` field.
2854    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
2855
2856    /// Returns the value of the `ADDR` field.
2857    pub const fn addr(self) -> u64 {
2858        ((self.bits() >> Self::ADDR_SHIFT)
2859            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2860    }
2861}
2862
2863#[cfg(feature = "el2")]
2864bitflags! {
2865    /// `ELR_EL2` system register value.
2866    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2867    #[repr(transparent)]
2868    pub struct ElrEl2: u64 {
2869    }
2870}
2871
2872#[cfg(feature = "el2")]
2873impl ElrEl2 {
2874    /// Offset of the `ADDR` field.
2875    pub const ADDR_SHIFT: u32 = 0;
2876    /// Mask for the `ADDR` field.
2877    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
2878
2879    /// Returns the value of the `ADDR` field.
2880    pub const fn addr(self) -> u64 {
2881        ((self.bits() >> Self::ADDR_SHIFT)
2882            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2883    }
2884}
2885
2886#[cfg(feature = "el2")]
2887bitflags! {
2888    /// `ELR_hyp` system register value.
2889    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2890    #[repr(transparent)]
2891    pub struct ElrHyp: u32 {
2892    }
2893}
2894
2895#[cfg(feature = "el2")]
2896impl ElrHyp {
2897    /// Offset of the `ADDR` field.
2898    pub const ADDR_SHIFT: u32 = 0;
2899    /// Mask for the `ADDR` field.
2900    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
2901
2902    /// Returns the value of the `ADDR` field.
2903    pub const fn addr(self) -> u32 {
2904        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
2905    }
2906}
2907
2908bitflags! {
2909    /// `ERRIDR` system register value.
2910    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2911    #[repr(transparent)]
2912    pub struct Erridr: u32 {
2913    }
2914}
2915
2916impl Erridr {
2917    /// Offset of the `NUM` field.
2918    pub const NUM_SHIFT: u32 = 0;
2919    /// Mask for the `NUM` field.
2920    pub const NUM_MASK: u32 = 0b1111111111111111;
2921
2922    /// Returns the value of the `NUM` field.
2923    pub const fn num(self) -> u16 {
2924        ((self.bits() >> Self::NUM_SHIFT) & 0b1111111111111111) as u16
2925    }
2926}
2927
2928bitflags! {
2929    /// `ERRSELR` system register value.
2930    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2931    #[repr(transparent)]
2932    pub struct Errselr: u32 {
2933    }
2934}
2935
2936impl Errselr {
2937    /// Offset of the `SEL` field.
2938    pub const SEL_SHIFT: u32 = 0;
2939    /// Mask for the `SEL` field.
2940    pub const SEL_MASK: u32 = 0b1111111111111111;
2941
2942    /// Returns the value of the `SEL` field.
2943    pub const fn sel(self) -> u16 {
2944        ((self.bits() >> Self::SEL_SHIFT) & 0b1111111111111111) as u16
2945    }
2946}
2947
2948bitflags! {
2949    /// `ERXADDR` system register value.
2950    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2951    #[repr(transparent)]
2952    pub struct Erxaddr: u32 {
2953    }
2954}
2955
2956impl Erxaddr {
2957    /// Offset of the `ERRnADDRlo` field.
2958    pub const ERRNADDRLO_SHIFT: u32 = 0;
2959    /// Mask for the `ERRnADDRlo` field.
2960    pub const ERRNADDRLO_MASK: u32 = 0b11111111111111111111111111111111;
2961
2962    /// Returns the value of the `ERRnADDRlo` field.
2963    pub const fn errnaddrlo(self) -> u32 {
2964        ((self.bits() >> Self::ERRNADDRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
2965    }
2966}
2967
2968bitflags! {
2969    /// `ERXADDR2` system register value.
2970    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2971    #[repr(transparent)]
2972    pub struct Erxaddr2: u32 {
2973    }
2974}
2975
2976impl Erxaddr2 {
2977    /// Offset of the `ERRnADDRhi` field.
2978    pub const ERRNADDRHI_SHIFT: u32 = 0;
2979    /// Mask for the `ERRnADDRhi` field.
2980    pub const ERRNADDRHI_MASK: u32 = 0b11111111111111111111111111111111;
2981
2982    /// Returns the value of the `ERRnADDRhi` field.
2983    pub const fn errnaddrhi(self) -> u32 {
2984        ((self.bits() >> Self::ERRNADDRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
2985    }
2986}
2987
2988bitflags! {
2989    /// `ERXCTLR` system register value.
2990    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
2991    #[repr(transparent)]
2992    pub struct Erxctlr: u32 {
2993    }
2994}
2995
2996impl Erxctlr {
2997    /// Offset of the `ERRnCTLRlo` field.
2998    pub const ERRNCTLRLO_SHIFT: u32 = 0;
2999    /// Mask for the `ERRnCTLRlo` field.
3000    pub const ERRNCTLRLO_MASK: u32 = 0b11111111111111111111111111111111;
3001
3002    /// Returns the value of the `ERRnCTLRlo` field.
3003    pub const fn errnctlrlo(self) -> u32 {
3004        ((self.bits() >> Self::ERRNCTLRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
3005    }
3006}
3007
3008bitflags! {
3009    /// `ERXCTLR2` system register value.
3010    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3011    #[repr(transparent)]
3012    pub struct Erxctlr2: u32 {
3013    }
3014}
3015
3016impl Erxctlr2 {
3017    /// Offset of the `ERRnCTLRhi` field.
3018    pub const ERRNCTLRHI_SHIFT: u32 = 0;
3019    /// Mask for the `ERRnCTLRhi` field.
3020    pub const ERRNCTLRHI_MASK: u32 = 0b11111111111111111111111111111111;
3021
3022    /// Returns the value of the `ERRnCTLRhi` field.
3023    pub const fn errnctlrhi(self) -> u32 {
3024        ((self.bits() >> Self::ERRNCTLRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
3025    }
3026}
3027
3028bitflags! {
3029    /// `ERXFR` system register value.
3030    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3031    #[repr(transparent)]
3032    pub struct Erxfr: u32 {
3033    }
3034}
3035
3036impl Erxfr {
3037    /// Offset of the `ERRnFRlo` field.
3038    pub const ERRNFRLO_SHIFT: u32 = 0;
3039    /// Mask for the `ERRnFRlo` field.
3040    pub const ERRNFRLO_MASK: u32 = 0b11111111111111111111111111111111;
3041
3042    /// Returns the value of the `ERRnFRlo` field.
3043    pub const fn errnfrlo(self) -> u32 {
3044        ((self.bits() >> Self::ERRNFRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
3045    }
3046}
3047
3048bitflags! {
3049    /// `ERXFR2` system register value.
3050    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3051    #[repr(transparent)]
3052    pub struct Erxfr2: u32 {
3053    }
3054}
3055
3056impl Erxfr2 {
3057    /// Offset of the `ERRnFRhi` field.
3058    pub const ERRNFRHI_SHIFT: u32 = 0;
3059    /// Mask for the `ERRnFRhi` field.
3060    pub const ERRNFRHI_MASK: u32 = 0b11111111111111111111111111111111;
3061
3062    /// Returns the value of the `ERRnFRhi` field.
3063    pub const fn errnfrhi(self) -> u32 {
3064        ((self.bits() >> Self::ERRNFRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
3065    }
3066}
3067
3068bitflags! {
3069    /// `ERXMISC0` system register value.
3070    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3071    #[repr(transparent)]
3072    pub struct Erxmisc0: u32 {
3073    }
3074}
3075
3076impl Erxmisc0 {
3077    /// Offset of the `ERRnMISC0lo` field.
3078    pub const ERRNMISC0LO_SHIFT: u32 = 0;
3079    /// Mask for the `ERRnMISC0lo` field.
3080    pub const ERRNMISC0LO_MASK: u32 = 0b11111111111111111111111111111111;
3081
3082    /// Returns the value of the `ERRnMISC0lo` field.
3083    pub const fn errnmisc0lo(self) -> u32 {
3084        ((self.bits() >> Self::ERRNMISC0LO_SHIFT) & 0b11111111111111111111111111111111) as u32
3085    }
3086}
3087
3088bitflags! {
3089    /// `ERXMISC1` system register value.
3090    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3091    #[repr(transparent)]
3092    pub struct Erxmisc1: u32 {
3093    }
3094}
3095
3096impl Erxmisc1 {
3097    /// Offset of the `ERRnMISC0hi` field.
3098    pub const ERRNMISC0HI_SHIFT: u32 = 0;
3099    /// Mask for the `ERRnMISC0hi` field.
3100    pub const ERRNMISC0HI_MASK: u32 = 0b11111111111111111111111111111111;
3101
3102    /// Returns the value of the `ERRnMISC0hi` field.
3103    pub const fn errnmisc0hi(self) -> u32 {
3104        ((self.bits() >> Self::ERRNMISC0HI_SHIFT) & 0b11111111111111111111111111111111) as u32
3105    }
3106}
3107
3108bitflags! {
3109    /// `ERXMISC2` system register value.
3110    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3111    #[repr(transparent)]
3112    pub struct Erxmisc2: u32 {
3113    }
3114}
3115
3116impl Erxmisc2 {
3117    /// Offset of the `ERRnMISC1lo` field.
3118    pub const ERRNMISC1LO_SHIFT: u32 = 0;
3119    /// Mask for the `ERRnMISC1lo` field.
3120    pub const ERRNMISC1LO_MASK: u32 = 0b11111111111111111111111111111111;
3121
3122    /// Returns the value of the `ERRnMISC1lo` field.
3123    pub const fn errnmisc1lo(self) -> u32 {
3124        ((self.bits() >> Self::ERRNMISC1LO_SHIFT) & 0b11111111111111111111111111111111) as u32
3125    }
3126}
3127
3128bitflags! {
3129    /// `ERXMISC3` system register value.
3130    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3131    #[repr(transparent)]
3132    pub struct Erxmisc3: u32 {
3133    }
3134}
3135
3136impl Erxmisc3 {
3137    /// Offset of the `ERRnMISC1hi` field.
3138    pub const ERRNMISC1HI_SHIFT: u32 = 0;
3139    /// Mask for the `ERRnMISC1hi` field.
3140    pub const ERRNMISC1HI_MASK: u32 = 0b11111111111111111111111111111111;
3141
3142    /// Returns the value of the `ERRnMISC1hi` field.
3143    pub const fn errnmisc1hi(self) -> u32 {
3144        ((self.bits() >> Self::ERRNMISC1HI_SHIFT) & 0b11111111111111111111111111111111) as u32
3145    }
3146}
3147
3148bitflags! {
3149    /// `ERXMISC4` system register value.
3150    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3151    #[repr(transparent)]
3152    pub struct Erxmisc4: u32 {
3153    }
3154}
3155
3156impl Erxmisc4 {
3157    /// Offset of the `ERRnMISC2lo` field.
3158    pub const ERRNMISC2LO_SHIFT: u32 = 0;
3159    /// Mask for the `ERRnMISC2lo` field.
3160    pub const ERRNMISC2LO_MASK: u32 = 0b11111111111111111111111111111111;
3161
3162    /// Returns the value of the `ERRnMISC2lo` field.
3163    pub const fn errnmisc2lo(self) -> u32 {
3164        ((self.bits() >> Self::ERRNMISC2LO_SHIFT) & 0b11111111111111111111111111111111) as u32
3165    }
3166}
3167
3168bitflags! {
3169    /// `ERXMISC5` system register value.
3170    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3171    #[repr(transparent)]
3172    pub struct Erxmisc5: u32 {
3173    }
3174}
3175
3176impl Erxmisc5 {
3177    /// Offset of the `ERRnMISC2hi` field.
3178    pub const ERRNMISC2HI_SHIFT: u32 = 0;
3179    /// Mask for the `ERRnMISC2hi` field.
3180    pub const ERRNMISC2HI_MASK: u32 = 0b11111111111111111111111111111111;
3181
3182    /// Returns the value of the `ERRnMISC2hi` field.
3183    pub const fn errnmisc2hi(self) -> u32 {
3184        ((self.bits() >> Self::ERRNMISC2HI_SHIFT) & 0b11111111111111111111111111111111) as u32
3185    }
3186}
3187
3188bitflags! {
3189    /// `ERXMISC6` system register value.
3190    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3191    #[repr(transparent)]
3192    pub struct Erxmisc6: u32 {
3193    }
3194}
3195
3196impl Erxmisc6 {
3197    /// Offset of the `ERRnMISC3lo` field.
3198    pub const ERRNMISC3LO_SHIFT: u32 = 0;
3199    /// Mask for the `ERRnMISC3lo` field.
3200    pub const ERRNMISC3LO_MASK: u32 = 0b11111111111111111111111111111111;
3201
3202    /// Returns the value of the `ERRnMISC3lo` field.
3203    pub const fn errnmisc3lo(self) -> u32 {
3204        ((self.bits() >> Self::ERRNMISC3LO_SHIFT) & 0b11111111111111111111111111111111) as u32
3205    }
3206}
3207
3208bitflags! {
3209    /// `ERXMISC7` system register value.
3210    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3211    #[repr(transparent)]
3212    pub struct Erxmisc7: u32 {
3213    }
3214}
3215
3216impl Erxmisc7 {
3217    /// Offset of the `ERRnMISC3hi` field.
3218    pub const ERRNMISC3HI_SHIFT: u32 = 0;
3219    /// Mask for the `ERRnMISC3hi` field.
3220    pub const ERRNMISC3HI_MASK: u32 = 0b11111111111111111111111111111111;
3221
3222    /// Returns the value of the `ERRnMISC3hi` field.
3223    pub const fn errnmisc3hi(self) -> u32 {
3224        ((self.bits() >> Self::ERRNMISC3HI_SHIFT) & 0b11111111111111111111111111111111) as u32
3225    }
3226}
3227
3228bitflags! {
3229    /// `ERXSTATUS` system register value.
3230    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3231    #[repr(transparent)]
3232    pub struct Erxstatus: u32 {
3233    }
3234}
3235
3236impl Erxstatus {
3237    /// Offset of the `ERRnSTATUSlo` field.
3238    pub const ERRNSTATUSLO_SHIFT: u32 = 0;
3239    /// Mask for the `ERRnSTATUSlo` field.
3240    pub const ERRNSTATUSLO_MASK: u32 = 0b11111111111111111111111111111111;
3241
3242    /// Returns the value of the `ERRnSTATUSlo` field.
3243    pub const fn errnstatuslo(self) -> u32 {
3244        ((self.bits() >> Self::ERRNSTATUSLO_SHIFT) & 0b11111111111111111111111111111111) as u32
3245    }
3246}
3247
3248#[cfg(feature = "el1")]
3249bitflags! {
3250    /// `ESR_EL1` system register value.
3251    #[derive(Clone, Copy, Eq, PartialEq)]
3252    #[repr(transparent)]
3253    pub struct EsrEl1: u64 {
3254        /// `IL` bit.
3255        const IL = 1 << 25;
3256    }
3257}
3258
3259#[cfg(feature = "el1")]
3260impl EsrEl1 {
3261    /// Offset of the `ISS` field.
3262    pub const ISS_SHIFT: u32 = 0;
3263    /// Mask for the `ISS` field.
3264    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
3265    /// Offset of the `IL` field.
3266    pub const IL_SHIFT: u32 = 25;
3267    /// Offset of the `EC` field.
3268    pub const EC_SHIFT: u32 = 26;
3269    /// Mask for the `EC` field.
3270    pub const EC_MASK: u64 = 0b111111;
3271    /// Offset of the `ISS2` field.
3272    pub const ISS2_SHIFT: u32 = 32;
3273    /// Mask for the `ISS2` field.
3274    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
3275
3276    /// Returns the value of the `ISS` field.
3277    pub const fn iss(self) -> u32 {
3278        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
3279    }
3280
3281    /// Returns the value of the `EC` field.
3282    pub const fn ec(self) -> u8 {
3283        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
3284    }
3285
3286    /// Returns the value of the `ISS2` field.
3287    pub const fn iss2(self) -> u32 {
3288        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
3289    }
3290}
3291
3292#[cfg(feature = "el2")]
3293bitflags! {
3294    /// `ESR_EL2` system register value.
3295    #[derive(Clone, Copy, Eq, PartialEq)]
3296    #[repr(transparent)]
3297    pub struct EsrEl2: u64 {
3298        /// 32-bit instruction length.
3299        const IL = 1 << 25;
3300    }
3301}
3302
3303#[cfg(feature = "el2")]
3304impl EsrEl2 {
3305    /// Offset of the `ISS` field.
3306    pub const ISS_SHIFT: u32 = 0;
3307    /// Mask for the `ISS` field.
3308    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
3309    /// Offset of the `IL` field.
3310    pub const IL_SHIFT: u32 = 25;
3311    /// Offset of the `EC` field.
3312    pub const EC_SHIFT: u32 = 26;
3313    /// Mask for the `EC` field.
3314    pub const EC_MASK: u64 = 0b111111;
3315    /// Offset of the `ISS2` field.
3316    pub const ISS2_SHIFT: u32 = 32;
3317    /// Mask for the `ISS2` field.
3318    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
3319
3320    /// Returns the value of the `ISS` field.
3321    pub const fn iss(self) -> u32 {
3322        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
3323    }
3324
3325    /// Returns the value of the `EC` field.
3326    pub const fn ec(self) -> u8 {
3327        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
3328    }
3329
3330    /// Returns the value of the `ISS2` field.
3331    pub const fn iss2(self) -> u32 {
3332        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
3333    }
3334}
3335
3336#[cfg(feature = "el3")]
3337bitflags! {
3338    /// `ESR_EL3` system register value.
3339    #[derive(Clone, Copy, Eq, PartialEq)]
3340    #[repr(transparent)]
3341    pub struct EsrEl3: u64 {
3342        /// 32-bit instruction length.
3343        const IL = 1 << 25;
3344    }
3345}
3346
3347#[cfg(feature = "el3")]
3348impl EsrEl3 {
3349    /// Offset of the `ISS` field.
3350    pub const ISS_SHIFT: u32 = 0;
3351    /// Mask for the `ISS` field.
3352    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
3353    /// Offset of the `IL` field.
3354    pub const IL_SHIFT: u32 = 25;
3355    /// Offset of the `EC` field.
3356    pub const EC_SHIFT: u32 = 26;
3357    /// Mask for the `EC` field.
3358    pub const EC_MASK: u64 = 0b111111;
3359    /// Offset of the `ISS2` field.
3360    pub const ISS2_SHIFT: u32 = 32;
3361    /// Mask for the `ISS2` field.
3362    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
3363
3364    /// Returns the value of the `ISS` field.
3365    pub const fn iss(self) -> u32 {
3366        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
3367    }
3368
3369    /// Returns the value of the `EC` field.
3370    pub const fn ec(self) -> u8 {
3371        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
3372    }
3373
3374    /// Returns the value of the `ISS2` field.
3375    pub const fn iss2(self) -> u32 {
3376        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
3377    }
3378}
3379
3380#[cfg(feature = "el1")]
3381bitflags! {
3382    /// `FAR_EL1` system register value.
3383    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3384    #[repr(transparent)]
3385    pub struct FarEl1: u64 {
3386    }
3387}
3388
3389#[cfg(feature = "el1")]
3390impl FarEl1 {
3391    /// Offset of the `VA` field.
3392    pub const VA_SHIFT: u32 = 0;
3393    /// Mask for the `VA` field.
3394    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
3395
3396    /// Returns the value of the `VA` field.
3397    pub const fn va(self) -> u64 {
3398        ((self.bits() >> Self::VA_SHIFT)
3399            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3400    }
3401}
3402
3403#[cfg(feature = "el2")]
3404bitflags! {
3405    /// `FAR_EL2` system register value.
3406    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3407    #[repr(transparent)]
3408    pub struct FarEl2: u64 {
3409    }
3410}
3411
3412#[cfg(feature = "el2")]
3413impl FarEl2 {
3414    /// Offset of the `VA` field.
3415    pub const VA_SHIFT: u32 = 0;
3416    /// Mask for the `VA` field.
3417    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
3418
3419    /// Returns the value of the `VA` field.
3420    pub const fn va(self) -> u64 {
3421        ((self.bits() >> Self::VA_SHIFT)
3422            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3423    }
3424}
3425
3426#[cfg(feature = "el1")]
3427bitflags! {
3428    /// `GCR_EL1` system register value.
3429    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3430    #[repr(transparent)]
3431    pub struct GcrEl1: u64 {
3432        /// `RRND` bit.
3433        const RRND = 1 << 16;
3434    }
3435}
3436
3437#[cfg(feature = "el1")]
3438impl GcrEl1 {
3439    /// Offset of the `Exclude` field.
3440    pub const EXCLUDE_SHIFT: u32 = 0;
3441    /// Mask for the `Exclude` field.
3442    pub const EXCLUDE_MASK: u64 = 0b1111111111111111;
3443    /// Offset of the `RRND` field.
3444    pub const RRND_SHIFT: u32 = 16;
3445
3446    /// Returns the value of the `Exclude` field.
3447    pub const fn exclude(self) -> u16 {
3448        ((self.bits() >> Self::EXCLUDE_SHIFT) & 0b1111111111111111) as u16
3449    }
3450}
3451
3452#[cfg(feature = "el1")]
3453bitflags! {
3454    /// `GCSCR_EL1` system register value.
3455    ///
3456    /// Guarded Control Stack Control register.
3457    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3458    #[repr(transparent)]
3459    pub struct GcscrEl1: u64 {
3460        /// `PCRSEL` bit.
3461        const PCRSEL = 1 << 0;
3462        /// `RVCHKEN` bit.
3463        const RVCHKEN = 1 << 5;
3464        /// Exception state lock enable.
3465        const EXLOCKEN = 1 << 6;
3466        /// `PUSHMEn` bit.
3467        const PUSHMEN = 1 << 8;
3468        /// `STREn` bit.
3469        const STREN = 1 << 9;
3470    }
3471}
3472
3473#[cfg(feature = "el1")]
3474impl GcscrEl1 {
3475    /// Offset of the `PCRSEL` field.
3476    pub const PCRSEL_SHIFT: u32 = 0;
3477    /// Offset of the `RVCHKEN` field.
3478    pub const RVCHKEN_SHIFT: u32 = 5;
3479    /// Offset of the `EXLOCKEN` field.
3480    pub const EXLOCKEN_SHIFT: u32 = 6;
3481    /// Offset of the `PUSHMEn` field.
3482    pub const PUSHMEN_SHIFT: u32 = 8;
3483    /// Offset of the `STREn` field.
3484    pub const STREN_SHIFT: u32 = 9;
3485}
3486
3487#[cfg(feature = "el2")]
3488bitflags! {
3489    /// `GCSCR_EL2` system register value.
3490    ///
3491    /// Guarded Control Stack Control register.
3492    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3493    #[repr(transparent)]
3494    pub struct GcscrEl2: u64 {
3495        /// `PCRSEL` bit.
3496        const PCRSEL = 1 << 0;
3497        /// `RVCHKEN` bit.
3498        const RVCHKEN = 1 << 5;
3499        /// Exception state lock enable.
3500        const EXLOCKEN = 1 << 6;
3501        /// `PUSHMEn` bit.
3502        const PUSHMEN = 1 << 8;
3503        /// `STREn` bit.
3504        const STREN = 1 << 9;
3505    }
3506}
3507
3508#[cfg(feature = "el2")]
3509impl GcscrEl2 {
3510    /// Offset of the `PCRSEL` field.
3511    pub const PCRSEL_SHIFT: u32 = 0;
3512    /// Offset of the `RVCHKEN` field.
3513    pub const RVCHKEN_SHIFT: u32 = 5;
3514    /// Offset of the `EXLOCKEN` field.
3515    pub const EXLOCKEN_SHIFT: u32 = 6;
3516    /// Offset of the `PUSHMEn` field.
3517    pub const PUSHMEN_SHIFT: u32 = 8;
3518    /// Offset of the `STREn` field.
3519    pub const STREN_SHIFT: u32 = 9;
3520}
3521
3522#[cfg(feature = "el3")]
3523bitflags! {
3524    /// `GPCCR_EL3` system register value.
3525    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3526    #[repr(transparent)]
3527    pub struct GpccrEl3: u64 {
3528        /// `PPS3` bit.
3529        const PPS3 = 1 << 3;
3530        /// `RLPAD` bit.
3531        const RLPAD = 1 << 5;
3532        /// `NSPAD` bit.
3533        const NSPAD = 1 << 6;
3534        /// `SPAD` bit.
3535        const SPAD = 1 << 7;
3536        /// `GPC` bit.
3537        const GPC = 1 << 16;
3538        /// `GPCP` bit.
3539        const GPCP = 1 << 17;
3540        /// `TBGPCD` bit.
3541        const TBGPCD = 1 << 18;
3542        /// `NSO` bit.
3543        const NSO = 1 << 19;
3544        /// `APPSAA` bit.
3545        const APPSAA = 1 << 24;
3546        /// `SA` bit.
3547        const SA = 1 << 25;
3548        /// `NSP` bit.
3549        const NSP = 1 << 26;
3550        /// `NA6` bit.
3551        const NA6 = 1 << 27;
3552        /// `NA7` bit.
3553        const NA7 = 1 << 28;
3554        /// `GPCBW` bit.
3555        const GPCBW = 1 << 29;
3556    }
3557}
3558
3559#[cfg(feature = "el3")]
3560impl GpccrEl3 {
3561    /// Offset of the `PPS` field.
3562    pub const PPS_SHIFT: u32 = 0;
3563    /// Mask for the `PPS` field.
3564    pub const PPS_MASK: u64 = 0b111;
3565    /// Offset of the `PPS3` field.
3566    pub const PPS3_SHIFT: u32 = 3;
3567    /// Offset of the `RLPAD` field.
3568    pub const RLPAD_SHIFT: u32 = 5;
3569    /// Offset of the `NSPAD` field.
3570    pub const NSPAD_SHIFT: u32 = 6;
3571    /// Offset of the `SPAD` field.
3572    pub const SPAD_SHIFT: u32 = 7;
3573    /// Offset of the `IRGN` field.
3574    pub const IRGN_SHIFT: u32 = 8;
3575    /// Mask for the `IRGN` field.
3576    pub const IRGN_MASK: u64 = 0b11;
3577    /// Offset of the `ORGN` field.
3578    pub const ORGN_SHIFT: u32 = 10;
3579    /// Mask for the `ORGN` field.
3580    pub const ORGN_MASK: u64 = 0b11;
3581    /// Offset of the `SH` field.
3582    pub const SH_SHIFT: u32 = 12;
3583    /// Mask for the `SH` field.
3584    pub const SH_MASK: u64 = 0b11;
3585    /// Offset of the `PGS` field.
3586    pub const PGS_SHIFT: u32 = 14;
3587    /// Mask for the `PGS` field.
3588    pub const PGS_MASK: u64 = 0b11;
3589    /// Offset of the `GPC` field.
3590    pub const GPC_SHIFT: u32 = 16;
3591    /// Offset of the `GPCP` field.
3592    pub const GPCP_SHIFT: u32 = 17;
3593    /// Offset of the `TBGPCD` field.
3594    pub const TBGPCD_SHIFT: u32 = 18;
3595    /// Offset of the `NSO` field.
3596    pub const NSO_SHIFT: u32 = 19;
3597    /// Offset of the `L0GPTSZ` field.
3598    pub const L0GPTSZ_SHIFT: u32 = 20;
3599    /// Mask for the `L0GPTSZ` field.
3600    pub const L0GPTSZ_MASK: u64 = 0b1111;
3601    /// Offset of the `APPSAA` field.
3602    pub const APPSAA_SHIFT: u32 = 24;
3603    /// Offset of the `SA` field.
3604    pub const SA_SHIFT: u32 = 25;
3605    /// Offset of the `NSP` field.
3606    pub const NSP_SHIFT: u32 = 26;
3607    /// Offset of the `NA6` field.
3608    pub const NA6_SHIFT: u32 = 27;
3609    /// Offset of the `NA7` field.
3610    pub const NA7_SHIFT: u32 = 28;
3611    /// Offset of the `GPCBW` field.
3612    pub const GPCBW_SHIFT: u32 = 29;
3613
3614    /// Returns the value of the `PPS` field.
3615    pub const fn pps(self) -> u8 {
3616        ((self.bits() >> Self::PPS_SHIFT) & 0b111) as u8
3617    }
3618
3619    /// Returns the value of the `IRGN` field.
3620    pub fn irgn(self) -> crate::manual::Cacheability {
3621        crate::manual::Cacheability::try_from(((self.bits() >> Self::IRGN_SHIFT) & 0b11) as u8)
3622            .unwrap()
3623    }
3624
3625    /// Returns the value of the `ORGN` field.
3626    pub fn orgn(self) -> crate::manual::Cacheability {
3627        crate::manual::Cacheability::try_from(((self.bits() >> Self::ORGN_SHIFT) & 0b11) as u8)
3628            .unwrap()
3629    }
3630
3631    /// Returns the value of the `SH` field.
3632    pub fn sh(self) -> crate::manual::Shareability {
3633        crate::manual::Shareability::try_from(((self.bits() >> Self::SH_SHIFT) & 0b11) as u8)
3634            .unwrap()
3635    }
3636
3637    /// Returns the value of the `PGS` field.
3638    pub const fn pgs(self) -> u8 {
3639        ((self.bits() >> Self::PGS_SHIFT) & 0b11) as u8
3640    }
3641
3642    /// Returns the value of the `L0GPTSZ` field.
3643    pub const fn l0gptsz(self) -> u8 {
3644        ((self.bits() >> Self::L0GPTSZ_SHIFT) & 0b1111) as u8
3645    }
3646}
3647
3648#[cfg(feature = "el3")]
3649bitflags! {
3650    /// `GPTBR_EL3` system register value.
3651    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3652    #[repr(transparent)]
3653    pub struct GptbrEl3: u64 {
3654    }
3655}
3656
3657#[cfg(feature = "el3")]
3658impl GptbrEl3 {
3659    /// Offset of the `BADDR` field.
3660    pub const BADDR_SHIFT: u32 = 0;
3661    /// Mask for the `BADDR` field.
3662    pub const BADDR_MASK: u64 = 0b1111111111111111111111111111111111111111;
3663    /// Offset of the `BADDR[43:40]` field.
3664    pub const BADDR_43_40_SHIFT: u32 = 40;
3665    /// Mask for the `BADDR[43:40]` field.
3666    pub const BADDR_43_40_MASK: u64 = 0b1111;
3667
3668    /// Returns the value of the `BADDR` field.
3669    pub const fn baddr(self) -> u64 {
3670        ((self.bits() >> Self::BADDR_SHIFT) & 0b1111111111111111111111111111111111111111) as u64
3671    }
3672
3673    /// Returns the value of the `BADDR[43:40]` field.
3674    pub const fn baddr_43_40(self) -> u8 {
3675        ((self.bits() >> Self::BADDR_43_40_SHIFT) & 0b1111) as u8
3676    }
3677}
3678
3679bitflags! {
3680    /// `HCPTR` system register value.
3681    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3682    #[repr(transparent)]
3683    pub struct Hcptr: u32 {
3684        /// RES1 bits in the `HCPTR` register.
3685        const RES1 = 0b11001111111111;
3686        /// `TCP10` bit.
3687        const TCP10 = 1 << 10;
3688        /// `TCP11` bit.
3689        const TCP11 = 1 << 11;
3690        /// `TASE` bit.
3691        const TASE = 1 << 15;
3692        /// `TTA` bit.
3693        const TTA = 1 << 20;
3694        /// `TAM` bit.
3695        const TAM = 1 << 30;
3696        /// `TCPAC` bit.
3697        const TCPAC = 1 << 31;
3698    }
3699}
3700
3701impl Hcptr {
3702    /// Offset of the `TCP10` field.
3703    pub const TCP10_SHIFT: u32 = 10;
3704    /// Offset of the `TCP11` field.
3705    pub const TCP11_SHIFT: u32 = 11;
3706    /// Offset of the `TASE` field.
3707    pub const TASE_SHIFT: u32 = 15;
3708    /// Offset of the `TTA` field.
3709    pub const TTA_SHIFT: u32 = 20;
3710    /// Offset of the `TAM` field.
3711    pub const TAM_SHIFT: u32 = 30;
3712    /// Offset of the `TCPAC` field.
3713    pub const TCPAC_SHIFT: u32 = 31;
3714}
3715
3716bitflags! {
3717    /// `HCR` system register value.
3718    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3719    #[repr(transparent)]
3720    pub struct Hcr: u32 {
3721        /// `VM` bit.
3722        const VM = 1 << 0;
3723        /// `SWIO` bit.
3724        const SWIO = 1 << 1;
3725        /// `PTW` bit.
3726        const PTW = 1 << 2;
3727        /// `FMO` bit.
3728        const FMO = 1 << 3;
3729        /// `IMO` bit.
3730        const IMO = 1 << 4;
3731        /// `AMO` bit.
3732        const AMO = 1 << 5;
3733        /// `VF` bit.
3734        const VF = 1 << 6;
3735        /// `VI` bit.
3736        const VI = 1 << 7;
3737        /// `VA` bit.
3738        const VA = 1 << 8;
3739        /// `FB` bit.
3740        const FB = 1 << 9;
3741        /// `DC` bit.
3742        const DC = 1 << 12;
3743        /// `TWI` bit.
3744        const TWI = 1 << 13;
3745        /// `TWE` bit.
3746        const TWE = 1 << 14;
3747        /// `TID0` bit.
3748        const TID0 = 1 << 15;
3749        /// `TID1` bit.
3750        const TID1 = 1 << 16;
3751        /// `TID2` bit.
3752        const TID2 = 1 << 17;
3753        /// `TID3` bit.
3754        const TID3 = 1 << 18;
3755        /// `TSC` bit.
3756        const TSC = 1 << 19;
3757        /// `TIDCP` bit.
3758        const TIDCP = 1 << 20;
3759        /// `TAC` bit.
3760        const TAC = 1 << 21;
3761        /// `TSW` bit.
3762        const TSW = 1 << 22;
3763        /// `TPC` bit.
3764        const TPC = 1 << 23;
3765        /// `TPU` bit.
3766        const TPU = 1 << 24;
3767        /// `TTLB` bit.
3768        const TTLB = 1 << 25;
3769        /// `TVM` bit.
3770        const TVM = 1 << 26;
3771        /// `TGE` bit.
3772        const TGE = 1 << 27;
3773        /// `HCD` bit.
3774        const HCD = 1 << 29;
3775        /// `TRVM` bit.
3776        const TRVM = 1 << 30;
3777    }
3778}
3779
3780impl Hcr {
3781    /// Offset of the `VM` field.
3782    pub const VM_SHIFT: u32 = 0;
3783    /// Offset of the `SWIO` field.
3784    pub const SWIO_SHIFT: u32 = 1;
3785    /// Offset of the `PTW` field.
3786    pub const PTW_SHIFT: u32 = 2;
3787    /// Offset of the `FMO` field.
3788    pub const FMO_SHIFT: u32 = 3;
3789    /// Offset of the `IMO` field.
3790    pub const IMO_SHIFT: u32 = 4;
3791    /// Offset of the `AMO` field.
3792    pub const AMO_SHIFT: u32 = 5;
3793    /// Offset of the `VF` field.
3794    pub const VF_SHIFT: u32 = 6;
3795    /// Offset of the `VI` field.
3796    pub const VI_SHIFT: u32 = 7;
3797    /// Offset of the `VA` field.
3798    pub const VA_SHIFT: u32 = 8;
3799    /// Offset of the `FB` field.
3800    pub const FB_SHIFT: u32 = 9;
3801    /// Offset of the `BSU` field.
3802    pub const BSU_SHIFT: u32 = 10;
3803    /// Mask for the `BSU` field.
3804    pub const BSU_MASK: u32 = 0b11;
3805    /// Offset of the `DC` field.
3806    pub const DC_SHIFT: u32 = 12;
3807    /// Offset of the `TWI` field.
3808    pub const TWI_SHIFT: u32 = 13;
3809    /// Offset of the `TWE` field.
3810    pub const TWE_SHIFT: u32 = 14;
3811    /// Offset of the `TID0` field.
3812    pub const TID0_SHIFT: u32 = 15;
3813    /// Offset of the `TID1` field.
3814    pub const TID1_SHIFT: u32 = 16;
3815    /// Offset of the `TID2` field.
3816    pub const TID2_SHIFT: u32 = 17;
3817    /// Offset of the `TID3` field.
3818    pub const TID3_SHIFT: u32 = 18;
3819    /// Offset of the `TSC` field.
3820    pub const TSC_SHIFT: u32 = 19;
3821    /// Offset of the `TIDCP` field.
3822    pub const TIDCP_SHIFT: u32 = 20;
3823    /// Offset of the `TAC` field.
3824    pub const TAC_SHIFT: u32 = 21;
3825    /// Offset of the `TSW` field.
3826    pub const TSW_SHIFT: u32 = 22;
3827    /// Offset of the `TPC` field.
3828    pub const TPC_SHIFT: u32 = 23;
3829    /// Offset of the `TPU` field.
3830    pub const TPU_SHIFT: u32 = 24;
3831    /// Offset of the `TTLB` field.
3832    pub const TTLB_SHIFT: u32 = 25;
3833    /// Offset of the `TVM` field.
3834    pub const TVM_SHIFT: u32 = 26;
3835    /// Offset of the `TGE` field.
3836    pub const TGE_SHIFT: u32 = 27;
3837    /// Offset of the `HCD` field.
3838    pub const HCD_SHIFT: u32 = 29;
3839    /// Offset of the `TRVM` field.
3840    pub const TRVM_SHIFT: u32 = 30;
3841
3842    /// Returns the value of the `BSU` field.
3843    pub const fn bsu(self) -> u8 {
3844        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
3845    }
3846}
3847
3848bitflags! {
3849    /// `HCR2` system register value.
3850    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3851    #[repr(transparent)]
3852    pub struct Hcr2: u32 {
3853        /// `CD` bit.
3854        const CD = 1 << 0;
3855        /// `ID` bit.
3856        const ID = 1 << 1;
3857        /// `TERR` bit.
3858        const TERR = 1 << 4;
3859        /// `TEA` bit.
3860        const TEA = 1 << 5;
3861        /// `TID4` bit.
3862        const TID4 = 1 << 17;
3863        /// `TICAB` bit.
3864        const TICAB = 1 << 18;
3865        /// `TOCU` bit.
3866        const TOCU = 1 << 20;
3867        /// `TTLBIS` bit.
3868        const TTLBIS = 1 << 22;
3869    }
3870}
3871
3872impl Hcr2 {
3873    /// Offset of the `CD` field.
3874    pub const CD_SHIFT: u32 = 0;
3875    /// Offset of the `ID` field.
3876    pub const ID_SHIFT: u32 = 1;
3877    /// Offset of the `TERR` field.
3878    pub const TERR_SHIFT: u32 = 4;
3879    /// Offset of the `TEA` field.
3880    pub const TEA_SHIFT: u32 = 5;
3881    /// Offset of the `TID4` field.
3882    pub const TID4_SHIFT: u32 = 17;
3883    /// Offset of the `TICAB` field.
3884    pub const TICAB_SHIFT: u32 = 18;
3885    /// Offset of the `TOCU` field.
3886    pub const TOCU_SHIFT: u32 = 20;
3887    /// Offset of the `TTLBIS` field.
3888    pub const TTLBIS_SHIFT: u32 = 22;
3889}
3890
3891#[cfg(feature = "el2")]
3892bitflags! {
3893    /// `HCRX_EL2` system register value.
3894    ///
3895    /// Extended Hypervisor Configuration Register.
3896    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
3897    #[repr(transparent)]
3898    pub struct HcrxEl2: u64 {
3899        /// Do not trap execution of an ST64BV0 instruction at EL0 or EL1 to EL2.
3900        const ENAS0 = 1 << 0;
3901        /// Do not trap execution of an LD64B or ST64B instruction at EL0 or EL1 to EL2.
3902        const ENALS = 1 << 1;
3903        /// Do not trap execution of an ST64BV instruction at EL0 or EL1 to EL2.
3904        const ENASR = 1 << 2;
3905        /// Determines the behavior of TLBI instructions affected by the XS attribute.
3906        const FNXS = 1 << 3;
3907        /// Determines if the fine-grained traps in HFGITR_EL2 also apply to the corresponding TLBI maintenance instructions with the nXS qualifier.
3908        const FGTNXS = 1 << 4;
3909        /// Controls mapping of the value of SMPRI_EL1.Priority for streaming execution priority at EL0 or EL1.
3910        const SMPME = 1 << 5;
3911        /// Traps MSR writes of ALLINT at EL1 using AArch64 to EL2.
3912        const TALLINT = 1 << 6;
3913        /// Enables signaling of virtual IRQ interrupts with Superpriority.
3914        const VINMI = 1 << 7;
3915        /// Enables signaling of virtual FIQ interrupts with Superpriority.
3916        const VFNMI = 1 << 8;
3917        /// Controls the required permissions for cache maintenance instructions at EL1 or EL0.
3918        const CMOW = 1 << 9;
3919        /// Controls Memory Copy and Memory Set exceptions generated from EL1.
3920        const MCE2 = 1 << 10;
3921        /// Enables execution of Memory Set and Memory Copy instructions at EL1 or EL0.
3922        const MSCEN = 1 << 11;
3923        /// `TCR2En` bit.
3924        const TCR2EN = 1 << 14;
3925        /// `SCTLR2En` bit.
3926        const SCTLR2EN = 1 << 15;
3927        /// `PTTWI` bit.
3928        const PTTWI = 1 << 16;
3929        /// `D128En` bit.
3930        const D128EN = 1 << 17;
3931        /// `EnSNERR` bit.
3932        const ENSNERR = 1 << 18;
3933        /// `TMEA` bit.
3934        const TMEA = 1 << 19;
3935        /// `EnSDERR` bit.
3936        const ENSDERR = 1 << 20;
3937        /// `EnIDCP128` bit.
3938        const ENIDCP128 = 1 << 21;
3939        /// `GCSEn` bit.
3940        const GCSEN = 1 << 22;
3941        /// `EnFPM` bit.
3942        const ENFPM = 1 << 23;
3943        /// `PACMEn` bit.
3944        const PACMEN = 1 << 24;
3945        /// `VTLBIDEn` bit.
3946        const VTLBIDEN = 1 << 25;
3947        /// `SRMASKEn` bit.
3948        const SRMASKEN = 1 << 26;
3949        /// `NVTGE` bit.
3950        const NVTGE = 1 << 27;
3951        /// `POE2En` bit.
3952        const POE2EN = 1 << 29;
3953        /// `TPLIMEn` bit.
3954        const TPLIMEN = 1 << 30;
3955        /// `FDIT` bit.
3956        const FDIT = 1 << 31;
3957        /// `NVnTTLB` bit.
3958        const NVNTTLB = 1 << 32;
3959        /// `NVnTTLBIS` bit.
3960        const NVNTTLBIS = 1 << 33;
3961        /// `NVnTTLBOS` bit.
3962        const NVNTTLBOS = 1 << 34;
3963        /// `VTLBIDOSEn` bit.
3964        const VTLBIDOSEN = 1 << 35;
3965        /// `FNB` bit.
3966        const FNB = 1 << 36;
3967        /// `VTE` bit.
3968        const VTE = 1 << 37;
3969        /// `VTAO` bit.
3970        const VTAO = 1 << 38;
3971        /// `VTCO` bit.
3972        const VTCO = 1 << 39;
3973    }
3974}
3975
3976#[cfg(feature = "el2")]
3977impl HcrxEl2 {
3978    /// Offset of the `EnAS0` field.
3979    pub const ENAS0_SHIFT: u32 = 0;
3980    /// Offset of the `EnALS` field.
3981    pub const ENALS_SHIFT: u32 = 1;
3982    /// Offset of the `EnASR` field.
3983    pub const ENASR_SHIFT: u32 = 2;
3984    /// Offset of the `FnXS` field.
3985    pub const FNXS_SHIFT: u32 = 3;
3986    /// Offset of the `FGTnXS` field.
3987    pub const FGTNXS_SHIFT: u32 = 4;
3988    /// Offset of the `SMPME` field.
3989    pub const SMPME_SHIFT: u32 = 5;
3990    /// Offset of the `TALLINT` field.
3991    pub const TALLINT_SHIFT: u32 = 6;
3992    /// Offset of the `VINMI` field.
3993    pub const VINMI_SHIFT: u32 = 7;
3994    /// Offset of the `VFNMI` field.
3995    pub const VFNMI_SHIFT: u32 = 8;
3996    /// Offset of the `CMOW` field.
3997    pub const CMOW_SHIFT: u32 = 9;
3998    /// Offset of the `MCE2` field.
3999    pub const MCE2_SHIFT: u32 = 10;
4000    /// Offset of the `MSCEn` field.
4001    pub const MSCEN_SHIFT: u32 = 11;
4002    /// Offset of the `TCR2En` field.
4003    pub const TCR2EN_SHIFT: u32 = 14;
4004    /// Offset of the `SCTLR2En` field.
4005    pub const SCTLR2EN_SHIFT: u32 = 15;
4006    /// Offset of the `PTTWI` field.
4007    pub const PTTWI_SHIFT: u32 = 16;
4008    /// Offset of the `D128En` field.
4009    pub const D128EN_SHIFT: u32 = 17;
4010    /// Offset of the `EnSNERR` field.
4011    pub const ENSNERR_SHIFT: u32 = 18;
4012    /// Offset of the `TMEA` field.
4013    pub const TMEA_SHIFT: u32 = 19;
4014    /// Offset of the `EnSDERR` field.
4015    pub const ENSDERR_SHIFT: u32 = 20;
4016    /// Offset of the `EnIDCP128` field.
4017    pub const ENIDCP128_SHIFT: u32 = 21;
4018    /// Offset of the `GCSEn` field.
4019    pub const GCSEN_SHIFT: u32 = 22;
4020    /// Offset of the `EnFPM` field.
4021    pub const ENFPM_SHIFT: u32 = 23;
4022    /// Offset of the `PACMEn` field.
4023    pub const PACMEN_SHIFT: u32 = 24;
4024    /// Offset of the `VTLBIDEn` field.
4025    pub const VTLBIDEN_SHIFT: u32 = 25;
4026    /// Offset of the `SRMASKEn` field.
4027    pub const SRMASKEN_SHIFT: u32 = 26;
4028    /// Offset of the `NVTGE` field.
4029    pub const NVTGE_SHIFT: u32 = 27;
4030    /// Offset of the `POE2En` field.
4031    pub const POE2EN_SHIFT: u32 = 29;
4032    /// Offset of the `TPLIMEn` field.
4033    pub const TPLIMEN_SHIFT: u32 = 30;
4034    /// Offset of the `FDIT` field.
4035    pub const FDIT_SHIFT: u32 = 31;
4036    /// Offset of the `NVnTTLB` field.
4037    pub const NVNTTLB_SHIFT: u32 = 32;
4038    /// Offset of the `NVnTTLBIS` field.
4039    pub const NVNTTLBIS_SHIFT: u32 = 33;
4040    /// Offset of the `NVnTTLBOS` field.
4041    pub const NVNTTLBOS_SHIFT: u32 = 34;
4042    /// Offset of the `VTLBIDOSEn` field.
4043    pub const VTLBIDOSEN_SHIFT: u32 = 35;
4044    /// Offset of the `FNB` field.
4045    pub const FNB_SHIFT: u32 = 36;
4046    /// Offset of the `VTE` field.
4047    pub const VTE_SHIFT: u32 = 37;
4048    /// Offset of the `VTAO` field.
4049    pub const VTAO_SHIFT: u32 = 38;
4050    /// Offset of the `VTCO` field.
4051    pub const VTCO_SHIFT: u32 = 39;
4052}
4053
4054#[cfg(feature = "el2")]
4055bitflags! {
4056    /// `HCR_EL2` system register value.
4057    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4058    #[repr(transparent)]
4059    pub struct HcrEl2: u64 {
4060        /// `VM` bit.
4061        const VM = 1 << 0;
4062        /// `SWIO` bit.
4063        const SWIO = 1 << 1;
4064        /// `PTW` bit.
4065        const PTW = 1 << 2;
4066        /// `FMO` bit.
4067        const FMO = 1 << 3;
4068        /// `IMO` bit.
4069        const IMO = 1 << 4;
4070        /// `AMO` bit.
4071        const AMO = 1 << 5;
4072        /// `VF` bit.
4073        const VF = 1 << 6;
4074        /// `VI` bit.
4075        const VI = 1 << 7;
4076        /// `VSE` bit.
4077        const VSE = 1 << 8;
4078        /// `FB` bit.
4079        const FB = 1 << 9;
4080        /// `DC` bit.
4081        const DC = 1 << 12;
4082        /// `TWI` bit.
4083        const TWI = 1 << 13;
4084        /// `TWE` bit.
4085        const TWE = 1 << 14;
4086        /// `TID0` bit.
4087        const TID0 = 1 << 15;
4088        /// `TID1` bit.
4089        const TID1 = 1 << 16;
4090        /// `TID2` bit.
4091        const TID2 = 1 << 17;
4092        /// `TID3` bit.
4093        const TID3 = 1 << 18;
4094        /// `TSC` bit.
4095        const TSC = 1 << 19;
4096        /// `TIDCP` bit.
4097        const TIDCP = 1 << 20;
4098        /// `TACR` bit.
4099        const TACR = 1 << 21;
4100        /// `TSW` bit.
4101        const TSW = 1 << 22;
4102        /// `TPCP` bit.
4103        const TPCP = 1 << 23;
4104        /// `TPU` bit.
4105        const TPU = 1 << 24;
4106        /// `TTLB` bit.
4107        const TTLB = 1 << 25;
4108        /// `TVM` bit.
4109        const TVM = 1 << 26;
4110        /// Trap general exceptions to EL2.
4111        const TGE = 1 << 27;
4112        /// `TDZ` bit.
4113        const TDZ = 1 << 28;
4114        /// `HCD` bit.
4115        const HCD = 1 << 29;
4116        /// `TRVM` bit.
4117        const TRVM = 1 << 30;
4118        /// `RW` bit.
4119        const RW = 1 << 31;
4120        /// `CD` bit.
4121        const CD = 1 << 32;
4122        /// `ID` bit.
4123        const ID = 1 << 33;
4124        /// `E2H` bit.
4125        const E2H = 1 << 34;
4126        /// `TLOR` bit.
4127        const TLOR = 1 << 35;
4128        /// `TERR` bit.
4129        const TERR = 1 << 36;
4130        /// `TEA` bit.
4131        const TEA = 1 << 37;
4132        /// `APK` bit.
4133        const APK = 1 << 40;
4134        /// `API` bit.
4135        const API = 1 << 41;
4136        /// `NV` bit.
4137        const NV = 1 << 42;
4138        /// `NV1` bit.
4139        const NV1 = 1 << 43;
4140        /// `AT` bit.
4141        const AT = 1 << 44;
4142        /// `NV2` bit.
4143        const NV2 = 1 << 45;
4144        /// `FWB` bit.
4145        const FWB = 1 << 46;
4146        /// `FIEN` bit.
4147        const FIEN = 1 << 47;
4148        /// `GPF` bit.
4149        const GPF = 1 << 48;
4150        /// `TID4` bit.
4151        const TID4 = 1 << 49;
4152        /// `TICAB` bit.
4153        const TICAB = 1 << 50;
4154        /// `AMVOFFEN` bit.
4155        const AMVOFFEN = 1 << 51;
4156        /// `TOCU` bit.
4157        const TOCU = 1 << 52;
4158        /// `EnSCXT` bit.
4159        const ENSCXT = 1 << 53;
4160        /// `TTLBIS` bit.
4161        const TTLBIS = 1 << 54;
4162        /// `TTLBOS` bit.
4163        const TTLBOS = 1 << 55;
4164        /// `ATA` bit.
4165        const ATA = 1 << 56;
4166        /// `DCT` bit.
4167        const DCT = 1 << 57;
4168        /// `TID5` bit.
4169        const TID5 = 1 << 58;
4170        /// `TWEDEn` bit.
4171        const TWEDEN = 1 << 59;
4172    }
4173}
4174
4175#[cfg(feature = "el2")]
4176impl HcrEl2 {
4177    /// Offset of the `VM` field.
4178    pub const VM_SHIFT: u32 = 0;
4179    /// Offset of the `SWIO` field.
4180    pub const SWIO_SHIFT: u32 = 1;
4181    /// Offset of the `PTW` field.
4182    pub const PTW_SHIFT: u32 = 2;
4183    /// Offset of the `FMO` field.
4184    pub const FMO_SHIFT: u32 = 3;
4185    /// Offset of the `IMO` field.
4186    pub const IMO_SHIFT: u32 = 4;
4187    /// Offset of the `AMO` field.
4188    pub const AMO_SHIFT: u32 = 5;
4189    /// Offset of the `VF` field.
4190    pub const VF_SHIFT: u32 = 6;
4191    /// Offset of the `VI` field.
4192    pub const VI_SHIFT: u32 = 7;
4193    /// Offset of the `VSE` field.
4194    pub const VSE_SHIFT: u32 = 8;
4195    /// Offset of the `FB` field.
4196    pub const FB_SHIFT: u32 = 9;
4197    /// Offset of the `BSU` field.
4198    pub const BSU_SHIFT: u32 = 10;
4199    /// Mask for the `BSU` field.
4200    pub const BSU_MASK: u64 = 0b11;
4201    /// Offset of the `DC` field.
4202    pub const DC_SHIFT: u32 = 12;
4203    /// Offset of the `TWI` field.
4204    pub const TWI_SHIFT: u32 = 13;
4205    /// Offset of the `TWE` field.
4206    pub const TWE_SHIFT: u32 = 14;
4207    /// Offset of the `TID0` field.
4208    pub const TID0_SHIFT: u32 = 15;
4209    /// Offset of the `TID1` field.
4210    pub const TID1_SHIFT: u32 = 16;
4211    /// Offset of the `TID2` field.
4212    pub const TID2_SHIFT: u32 = 17;
4213    /// Offset of the `TID3` field.
4214    pub const TID3_SHIFT: u32 = 18;
4215    /// Offset of the `TSC` field.
4216    pub const TSC_SHIFT: u32 = 19;
4217    /// Offset of the `TIDCP` field.
4218    pub const TIDCP_SHIFT: u32 = 20;
4219    /// Offset of the `TACR` field.
4220    pub const TACR_SHIFT: u32 = 21;
4221    /// Offset of the `TSW` field.
4222    pub const TSW_SHIFT: u32 = 22;
4223    /// Offset of the `TPCP` field.
4224    pub const TPCP_SHIFT: u32 = 23;
4225    /// Offset of the `TPU` field.
4226    pub const TPU_SHIFT: u32 = 24;
4227    /// Offset of the `TTLB` field.
4228    pub const TTLB_SHIFT: u32 = 25;
4229    /// Offset of the `TVM` field.
4230    pub const TVM_SHIFT: u32 = 26;
4231    /// Offset of the `TGE` field.
4232    pub const TGE_SHIFT: u32 = 27;
4233    /// Offset of the `TDZ` field.
4234    pub const TDZ_SHIFT: u32 = 28;
4235    /// Offset of the `HCD` field.
4236    pub const HCD_SHIFT: u32 = 29;
4237    /// Offset of the `TRVM` field.
4238    pub const TRVM_SHIFT: u32 = 30;
4239    /// Offset of the `RW` field.
4240    pub const RW_SHIFT: u32 = 31;
4241    /// Offset of the `CD` field.
4242    pub const CD_SHIFT: u32 = 32;
4243    /// Offset of the `ID` field.
4244    pub const ID_SHIFT: u32 = 33;
4245    /// Offset of the `E2H` field.
4246    pub const E2H_SHIFT: u32 = 34;
4247    /// Offset of the `TLOR` field.
4248    pub const TLOR_SHIFT: u32 = 35;
4249    /// Offset of the `TERR` field.
4250    pub const TERR_SHIFT: u32 = 36;
4251    /// Offset of the `TEA` field.
4252    pub const TEA_SHIFT: u32 = 37;
4253    /// Offset of the `APK` field.
4254    pub const APK_SHIFT: u32 = 40;
4255    /// Offset of the `API` field.
4256    pub const API_SHIFT: u32 = 41;
4257    /// Offset of the `NV` field.
4258    pub const NV_SHIFT: u32 = 42;
4259    /// Offset of the `NV1` field.
4260    pub const NV1_SHIFT: u32 = 43;
4261    /// Offset of the `AT` field.
4262    pub const AT_SHIFT: u32 = 44;
4263    /// Offset of the `NV2` field.
4264    pub const NV2_SHIFT: u32 = 45;
4265    /// Offset of the `FWB` field.
4266    pub const FWB_SHIFT: u32 = 46;
4267    /// Offset of the `FIEN` field.
4268    pub const FIEN_SHIFT: u32 = 47;
4269    /// Offset of the `GPF` field.
4270    pub const GPF_SHIFT: u32 = 48;
4271    /// Offset of the `TID4` field.
4272    pub const TID4_SHIFT: u32 = 49;
4273    /// Offset of the `TICAB` field.
4274    pub const TICAB_SHIFT: u32 = 50;
4275    /// Offset of the `AMVOFFEN` field.
4276    pub const AMVOFFEN_SHIFT: u32 = 51;
4277    /// Offset of the `TOCU` field.
4278    pub const TOCU_SHIFT: u32 = 52;
4279    /// Offset of the `EnSCXT` field.
4280    pub const ENSCXT_SHIFT: u32 = 53;
4281    /// Offset of the `TTLBIS` field.
4282    pub const TTLBIS_SHIFT: u32 = 54;
4283    /// Offset of the `TTLBOS` field.
4284    pub const TTLBOS_SHIFT: u32 = 55;
4285    /// Offset of the `ATA` field.
4286    pub const ATA_SHIFT: u32 = 56;
4287    /// Offset of the `DCT` field.
4288    pub const DCT_SHIFT: u32 = 57;
4289    /// Offset of the `TID5` field.
4290    pub const TID5_SHIFT: u32 = 58;
4291    /// Offset of the `TWEDEn` field.
4292    pub const TWEDEN_SHIFT: u32 = 59;
4293    /// Offset of the `TWEDEL` field.
4294    pub const TWEDEL_SHIFT: u32 = 60;
4295    /// Mask for the `TWEDEL` field.
4296    pub const TWEDEL_MASK: u64 = 0b1111;
4297
4298    /// Returns the value of the `BSU` field.
4299    pub const fn bsu(self) -> u8 {
4300        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
4301    }
4302
4303    /// Returns the value of the `TWEDEL` field.
4304    pub const fn twedel(self) -> u8 {
4305        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
4306    }
4307}
4308
4309bitflags! {
4310    /// `HDCR` system register value.
4311    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4312    #[repr(transparent)]
4313    pub struct Hdcr: u32 {
4314        /// `TPMCR` bit.
4315        const TPMCR = 1 << 5;
4316        /// `TPM` bit.
4317        const TPM = 1 << 6;
4318        /// `HPME` bit.
4319        const HPME = 1 << 7;
4320        /// `TDE` bit.
4321        const TDE = 1 << 8;
4322        /// `TDA` bit.
4323        const TDA = 1 << 9;
4324        /// `TDOSA` bit.
4325        const TDOSA = 1 << 10;
4326        /// `TDRA` bit.
4327        const TDRA = 1 << 11;
4328        /// `HPMD` bit.
4329        const HPMD = 1 << 17;
4330        /// `TTRF` bit.
4331        const TTRF = 1 << 19;
4332        /// `HCCD` bit.
4333        const HCCD = 1 << 23;
4334        /// `HLP` bit.
4335        const HLP = 1 << 26;
4336        /// `TDCC` bit.
4337        const TDCC = 1 << 27;
4338        /// `MTPME` bit.
4339        const MTPME = 1 << 28;
4340        /// `HPMFZO` bit.
4341        const HPMFZO = 1 << 29;
4342    }
4343}
4344
4345impl Hdcr {
4346    /// Offset of the `HPMN` field.
4347    pub const HPMN_SHIFT: u32 = 0;
4348    /// Mask for the `HPMN` field.
4349    pub const HPMN_MASK: u32 = 0b11111;
4350    /// Offset of the `TPMCR` field.
4351    pub const TPMCR_SHIFT: u32 = 5;
4352    /// Offset of the `TPM` field.
4353    pub const TPM_SHIFT: u32 = 6;
4354    /// Offset of the `HPME` field.
4355    pub const HPME_SHIFT: u32 = 7;
4356    /// Offset of the `TDE` field.
4357    pub const TDE_SHIFT: u32 = 8;
4358    /// Offset of the `TDA` field.
4359    pub const TDA_SHIFT: u32 = 9;
4360    /// Offset of the `TDOSA` field.
4361    pub const TDOSA_SHIFT: u32 = 10;
4362    /// Offset of the `TDRA` field.
4363    pub const TDRA_SHIFT: u32 = 11;
4364    /// Offset of the `HPMD` field.
4365    pub const HPMD_SHIFT: u32 = 17;
4366    /// Offset of the `TTRF` field.
4367    pub const TTRF_SHIFT: u32 = 19;
4368    /// Offset of the `HCCD` field.
4369    pub const HCCD_SHIFT: u32 = 23;
4370    /// Offset of the `HLP` field.
4371    pub const HLP_SHIFT: u32 = 26;
4372    /// Offset of the `TDCC` field.
4373    pub const TDCC_SHIFT: u32 = 27;
4374    /// Offset of the `MTPME` field.
4375    pub const MTPME_SHIFT: u32 = 28;
4376    /// Offset of the `HPMFZO` field.
4377    pub const HPMFZO_SHIFT: u32 = 29;
4378
4379    /// Returns the value of the `HPMN` field.
4380    pub const fn hpmn(self) -> u8 {
4381        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
4382    }
4383}
4384
4385bitflags! {
4386    /// `HDFAR` system register value.
4387    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4388    #[repr(transparent)]
4389    pub struct Hdfar: u32 {
4390    }
4391}
4392
4393impl Hdfar {
4394    /// Offset of the `VA` field.
4395    pub const VA_SHIFT: u32 = 0;
4396    /// Mask for the `VA` field.
4397    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
4398
4399    /// Returns the value of the `VA` field.
4400    pub const fn va(self) -> u32 {
4401        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
4402    }
4403}
4404
4405#[cfg(feature = "el2")]
4406bitflags! {
4407    /// `HDFGRTR2_EL2` system register value.
4408    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4409    #[repr(transparent)]
4410    pub struct Hdfgrtr2El2: u64 {
4411        /// `nPMECR_EL1` bit.
4412        const NPMECR_EL1 = 1 << 0;
4413        /// `nPMIAR_EL1` bit.
4414        const NPMIAR_EL1 = 1 << 1;
4415        /// `nPMICNTR_EL0` bit.
4416        const NPMICNTR_EL0 = 1 << 2;
4417        /// `nPMICFILTR_EL0` bit.
4418        const NPMICFILTR_EL0 = 1 << 3;
4419        /// `nPMUACR_EL1` bit.
4420        const NPMUACR_EL1 = 1 << 4;
4421        /// `nMDSELR_EL1` bit.
4422        const NMDSELR_EL1 = 1 << 5;
4423        /// `nPMSSDATA` bit.
4424        const NPMSSDATA = 1 << 6;
4425        /// `nPMSSCR_EL1` bit.
4426        const NPMSSCR_EL1 = 1 << 7;
4427        /// `nSPMEVCNTRn_EL0` bit.
4428        const NSPMEVCNTRN_EL0 = 1 << 8;
4429        /// `nSPMEVTYPERn_EL0` bit.
4430        const NSPMEVTYPERN_EL0 = 1 << 9;
4431        /// `nSPMSELR_EL0` bit.
4432        const NSPMSELR_EL0 = 1 << 10;
4433        /// `nSPMCNTEN` bit.
4434        const NSPMCNTEN = 1 << 11;
4435        /// `nSPMINTEN` bit.
4436        const NSPMINTEN = 1 << 12;
4437        /// `nSPMOVS` bit.
4438        const NSPMOVS = 1 << 13;
4439        /// `nSPMCR_EL0` bit.
4440        const NSPMCR_EL0 = 1 << 14;
4441        /// `nSPMACCESSR_EL1` bit.
4442        const NSPMACCESSR_EL1 = 1 << 15;
4443        /// `nSPMSCR_EL1` bit.
4444        const NSPMSCR_EL1 = 1 << 16;
4445        /// `nSPMID` bit.
4446        const NSPMID = 1 << 17;
4447        /// `nSPMDEVAFF_EL1` bit.
4448        const NSPMDEVAFF_EL1 = 1 << 18;
4449        /// `nPMSDSFR_EL1` bit.
4450        const NPMSDSFR_EL1 = 1 << 19;
4451        /// `nTRCITECR_EL1` bit.
4452        const NTRCITECR_EL1 = 1 << 20;
4453        /// `nTRBMPAM_EL1` bit.
4454        const NTRBMPAM_EL1 = 1 << 22;
4455        /// `nMDSTEPOP_EL1` bit.
4456        const NMDSTEPOP_EL1 = 1 << 23;
4457        /// `nPMBMAR_EL1` bit.
4458        const NPMBMAR_EL1 = 1 << 24;
4459    }
4460}
4461
4462#[cfg(feature = "el2")]
4463impl Hdfgrtr2El2 {
4464    /// Offset of the `nPMECR_EL1` field.
4465    pub const NPMECR_EL1_SHIFT: u32 = 0;
4466    /// Offset of the `nPMIAR_EL1` field.
4467    pub const NPMIAR_EL1_SHIFT: u32 = 1;
4468    /// Offset of the `nPMICNTR_EL0` field.
4469    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
4470    /// Offset of the `nPMICFILTR_EL0` field.
4471    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
4472    /// Offset of the `nPMUACR_EL1` field.
4473    pub const NPMUACR_EL1_SHIFT: u32 = 4;
4474    /// Offset of the `nMDSELR_EL1` field.
4475    pub const NMDSELR_EL1_SHIFT: u32 = 5;
4476    /// Offset of the `nPMSSDATA` field.
4477    pub const NPMSSDATA_SHIFT: u32 = 6;
4478    /// Offset of the `nPMSSCR_EL1` field.
4479    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
4480    /// Offset of the `nSPMEVCNTRn_EL0` field.
4481    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
4482    /// Offset of the `nSPMEVTYPERn_EL0` field.
4483    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
4484    /// Offset of the `nSPMSELR_EL0` field.
4485    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
4486    /// Offset of the `nSPMCNTEN` field.
4487    pub const NSPMCNTEN_SHIFT: u32 = 11;
4488    /// Offset of the `nSPMINTEN` field.
4489    pub const NSPMINTEN_SHIFT: u32 = 12;
4490    /// Offset of the `nSPMOVS` field.
4491    pub const NSPMOVS_SHIFT: u32 = 13;
4492    /// Offset of the `nSPMCR_EL0` field.
4493    pub const NSPMCR_EL0_SHIFT: u32 = 14;
4494    /// Offset of the `nSPMACCESSR_EL1` field.
4495    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
4496    /// Offset of the `nSPMSCR_EL1` field.
4497    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
4498    /// Offset of the `nSPMID` field.
4499    pub const NSPMID_SHIFT: u32 = 17;
4500    /// Offset of the `nSPMDEVAFF_EL1` field.
4501    pub const NSPMDEVAFF_EL1_SHIFT: u32 = 18;
4502    /// Offset of the `nPMSDSFR_EL1` field.
4503    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
4504    /// Offset of the `nTRCITECR_EL1` field.
4505    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
4506    /// Offset of the `nTRBMPAM_EL1` field.
4507    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
4508    /// Offset of the `nMDSTEPOP_EL1` field.
4509    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
4510    /// Offset of the `nPMBMAR_EL1` field.
4511    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
4512}
4513
4514#[cfg(feature = "el2")]
4515bitflags! {
4516    /// `HDFGWTR2_EL2` system register value.
4517    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4518    #[repr(transparent)]
4519    pub struct Hdfgwtr2El2: u64 {
4520        /// `nPMECR_EL1` bit.
4521        const NPMECR_EL1 = 1 << 0;
4522        /// `nPMIAR_EL1` bit.
4523        const NPMIAR_EL1 = 1 << 1;
4524        /// `nPMICNTR_EL0` bit.
4525        const NPMICNTR_EL0 = 1 << 2;
4526        /// `nPMICFILTR_EL0` bit.
4527        const NPMICFILTR_EL0 = 1 << 3;
4528        /// `nPMUACR_EL1` bit.
4529        const NPMUACR_EL1 = 1 << 4;
4530        /// `nMDSELR_EL1` bit.
4531        const NMDSELR_EL1 = 1 << 5;
4532        /// `nPMSSCR_EL1` bit.
4533        const NPMSSCR_EL1 = 1 << 7;
4534        /// `nSPMEVCNTRn_EL0` bit.
4535        const NSPMEVCNTRN_EL0 = 1 << 8;
4536        /// `nSPMEVTYPERn_EL0` bit.
4537        const NSPMEVTYPERN_EL0 = 1 << 9;
4538        /// `nSPMSELR_EL0` bit.
4539        const NSPMSELR_EL0 = 1 << 10;
4540        /// `nSPMCNTEN` bit.
4541        const NSPMCNTEN = 1 << 11;
4542        /// `nSPMINTEN` bit.
4543        const NSPMINTEN = 1 << 12;
4544        /// `nSPMOVS` bit.
4545        const NSPMOVS = 1 << 13;
4546        /// `nSPMCR_EL0` bit.
4547        const NSPMCR_EL0 = 1 << 14;
4548        /// `nSPMACCESSR_EL1` bit.
4549        const NSPMACCESSR_EL1 = 1 << 15;
4550        /// `nSPMSCR_EL1` bit.
4551        const NSPMSCR_EL1 = 1 << 16;
4552        /// `nPMSDSFR_EL1` bit.
4553        const NPMSDSFR_EL1 = 1 << 19;
4554        /// `nTRCITECR_EL1` bit.
4555        const NTRCITECR_EL1 = 1 << 20;
4556        /// `nPMZR_EL0` bit.
4557        const NPMZR_EL0 = 1 << 21;
4558        /// `nTRBMPAM_EL1` bit.
4559        const NTRBMPAM_EL1 = 1 << 22;
4560        /// `nMDSTEPOP_EL1` bit.
4561        const NMDSTEPOP_EL1 = 1 << 23;
4562        /// `nPMBMAR_EL1` bit.
4563        const NPMBMAR_EL1 = 1 << 24;
4564    }
4565}
4566
4567#[cfg(feature = "el2")]
4568impl Hdfgwtr2El2 {
4569    /// Offset of the `nPMECR_EL1` field.
4570    pub const NPMECR_EL1_SHIFT: u32 = 0;
4571    /// Offset of the `nPMIAR_EL1` field.
4572    pub const NPMIAR_EL1_SHIFT: u32 = 1;
4573    /// Offset of the `nPMICNTR_EL0` field.
4574    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
4575    /// Offset of the `nPMICFILTR_EL0` field.
4576    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
4577    /// Offset of the `nPMUACR_EL1` field.
4578    pub const NPMUACR_EL1_SHIFT: u32 = 4;
4579    /// Offset of the `nMDSELR_EL1` field.
4580    pub const NMDSELR_EL1_SHIFT: u32 = 5;
4581    /// Offset of the `nPMSSCR_EL1` field.
4582    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
4583    /// Offset of the `nSPMEVCNTRn_EL0` field.
4584    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
4585    /// Offset of the `nSPMEVTYPERn_EL0` field.
4586    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
4587    /// Offset of the `nSPMSELR_EL0` field.
4588    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
4589    /// Offset of the `nSPMCNTEN` field.
4590    pub const NSPMCNTEN_SHIFT: u32 = 11;
4591    /// Offset of the `nSPMINTEN` field.
4592    pub const NSPMINTEN_SHIFT: u32 = 12;
4593    /// Offset of the `nSPMOVS` field.
4594    pub const NSPMOVS_SHIFT: u32 = 13;
4595    /// Offset of the `nSPMCR_EL0` field.
4596    pub const NSPMCR_EL0_SHIFT: u32 = 14;
4597    /// Offset of the `nSPMACCESSR_EL1` field.
4598    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
4599    /// Offset of the `nSPMSCR_EL1` field.
4600    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
4601    /// Offset of the `nPMSDSFR_EL1` field.
4602    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
4603    /// Offset of the `nTRCITECR_EL1` field.
4604    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
4605    /// Offset of the `nPMZR_EL0` field.
4606    pub const NPMZR_EL0_SHIFT: u32 = 21;
4607    /// Offset of the `nTRBMPAM_EL1` field.
4608    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
4609    /// Offset of the `nMDSTEPOP_EL1` field.
4610    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
4611    /// Offset of the `nPMBMAR_EL1` field.
4612    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
4613}
4614
4615#[cfg(feature = "el2")]
4616bitflags! {
4617    /// `HFGITR2_EL2` system register value.
4618    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4619    #[repr(transparent)]
4620    pub struct Hfgitr2El2: u64 {
4621        /// `TSBCSYNC` bit.
4622        const TSBCSYNC = 1 << 0;
4623        /// `nDCCIVAPS` bit.
4624        const NDCCIVAPS = 1 << 1;
4625        /// `PLBIPERME1OS` bit.
4626        const PLBIPERME1OS = 1 << 2;
4627        /// `PLBIASIDE1OS` bit.
4628        const PLBIASIDE1OS = 1 << 3;
4629        /// `PLBIVMALLE1OS` bit.
4630        const PLBIVMALLE1OS = 1 << 4;
4631        /// `PLBIPERME1IS` bit.
4632        const PLBIPERME1IS = 1 << 5;
4633        /// `PLBIASIDE1IS` bit.
4634        const PLBIASIDE1IS = 1 << 6;
4635        /// `PLBIVMALLE1IS` bit.
4636        const PLBIVMALLE1IS = 1 << 7;
4637        /// `PLBIPERME1` bit.
4638        const PLBIPERME1 = 1 << 8;
4639        /// `PLBIASIDE1` bit.
4640        const PLBIASIDE1 = 1 << 9;
4641        /// `PLBIVMALLE1` bit.
4642        const PLBIVMALLE1 = 1 << 10;
4643        /// `PLBIPERMAE1OS` bit.
4644        const PLBIPERMAE1OS = 1 << 11;
4645        /// `PLBIPERMAE1IS` bit.
4646        const PLBIPERMAE1IS = 1 << 12;
4647        /// `PLBIPERMAE1` bit.
4648        const PLBIPERMAE1 = 1 << 13;
4649        /// `DCGBVA` bit.
4650        const DCGBVA = 1 << 14;
4651    }
4652}
4653
4654#[cfg(feature = "el2")]
4655impl Hfgitr2El2 {
4656    /// Offset of the `TSBCSYNC` field.
4657    pub const TSBCSYNC_SHIFT: u32 = 0;
4658    /// Offset of the `nDCCIVAPS` field.
4659    pub const NDCCIVAPS_SHIFT: u32 = 1;
4660    /// Offset of the `PLBIPERME1OS` field.
4661    pub const PLBIPERME1OS_SHIFT: u32 = 2;
4662    /// Offset of the `PLBIASIDE1OS` field.
4663    pub const PLBIASIDE1OS_SHIFT: u32 = 3;
4664    /// Offset of the `PLBIVMALLE1OS` field.
4665    pub const PLBIVMALLE1OS_SHIFT: u32 = 4;
4666    /// Offset of the `PLBIPERME1IS` field.
4667    pub const PLBIPERME1IS_SHIFT: u32 = 5;
4668    /// Offset of the `PLBIASIDE1IS` field.
4669    pub const PLBIASIDE1IS_SHIFT: u32 = 6;
4670    /// Offset of the `PLBIVMALLE1IS` field.
4671    pub const PLBIVMALLE1IS_SHIFT: u32 = 7;
4672    /// Offset of the `PLBIPERME1` field.
4673    pub const PLBIPERME1_SHIFT: u32 = 8;
4674    /// Offset of the `PLBIASIDE1` field.
4675    pub const PLBIASIDE1_SHIFT: u32 = 9;
4676    /// Offset of the `PLBIVMALLE1` field.
4677    pub const PLBIVMALLE1_SHIFT: u32 = 10;
4678    /// Offset of the `PLBIPERMAE1OS` field.
4679    pub const PLBIPERMAE1OS_SHIFT: u32 = 11;
4680    /// Offset of the `PLBIPERMAE1IS` field.
4681    pub const PLBIPERMAE1IS_SHIFT: u32 = 12;
4682    /// Offset of the `PLBIPERMAE1` field.
4683    pub const PLBIPERMAE1_SHIFT: u32 = 13;
4684    /// Offset of the `DCGBVA` field.
4685    pub const DCGBVA_SHIFT: u32 = 14;
4686}
4687
4688#[cfg(feature = "el2")]
4689bitflags! {
4690    /// `HFGRTR2_EL2` system register value.
4691    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4692    #[repr(transparent)]
4693    pub struct Hfgrtr2El2: u64 {
4694        /// `nPFAR_EL1` bit.
4695        const NPFAR_EL1 = 1 << 0;
4696        /// `nERXGSR_EL1` bit.
4697        const NERXGSR_EL1 = 1 << 1;
4698        /// `nRCWSMASK_EL1` bit.
4699        const NRCWSMASK_EL1 = 1 << 2;
4700        /// `nCPACRMASK_EL1` bit.
4701        const NCPACRMASK_EL1 = 1 << 3;
4702        /// `nSCTLRMASK_EL1` bit.
4703        const NSCTLRMASK_EL1 = 1 << 4;
4704        /// `nSCTLR2MASK_EL1` bit.
4705        const NSCTLR2MASK_EL1 = 1 << 5;
4706        /// `nTCRMASK_EL1` bit.
4707        const NTCRMASK_EL1 = 1 << 6;
4708        /// `nTCR2MASK_EL1` bit.
4709        const NTCR2MASK_EL1 = 1 << 7;
4710        /// `nCPACRALIAS_EL1` bit.
4711        const NCPACRALIAS_EL1 = 1 << 8;
4712        /// `nSCTLRALIAS_EL1` bit.
4713        const NSCTLRALIAS_EL1 = 1 << 9;
4714        /// `nSCTLR2ALIAS_EL1` bit.
4715        const NSCTLR2ALIAS_EL1 = 1 << 10;
4716        /// `nTCRALIAS_EL1` bit.
4717        const NTCRALIAS_EL1 = 1 << 11;
4718        /// `nTCR2ALIAS_EL1` bit.
4719        const NTCR2ALIAS_EL1 = 1 << 12;
4720        /// `nACTLRMASK_EL1` bit.
4721        const NACTLRMASK_EL1 = 1 << 13;
4722        /// `nACTLRALIAS_EL1` bit.
4723        const NACTLRALIAS_EL1 = 1 << 14;
4724        /// `nTINDEX_EL0` bit.
4725        const NTINDEX_EL0 = 1 << 15;
4726        /// `nTINDEX_EL1` bit.
4727        const NTINDEX_EL1 = 1 << 16;
4728        /// `nSTINDEX_EL1` bit.
4729        const NSTINDEX_EL1 = 1 << 17;
4730        /// `nTTTBRP_EL1` bit.
4731        const NTTTBRP_EL1 = 1 << 20;
4732        /// `nTTTBRU_EL1` bit.
4733        const NTTTBRU_EL1 = 1 << 21;
4734        /// `nIRTBRP_EL1` bit.
4735        const NIRTBRP_EL1 = 1 << 22;
4736        /// `nIRTBRU_EL1` bit.
4737        const NIRTBRU_EL1 = 1 << 23;
4738        /// `nDPOTBR1_EL1` bit.
4739        const NDPOTBR1_EL1 = 1 << 24;
4740        /// `nDPOTBR0_EL1` bit.
4741        const NDPOTBR0_EL1 = 1 << 25;
4742        /// `nTPMIN1_EL1` bit.
4743        const NTPMIN1_EL1 = 1 << 26;
4744        /// `nTPMIN0_EL1` bit.
4745        const NTPMIN0_EL1 = 1 << 27;
4746        /// `nTPMIN1_EL0` bit.
4747        const NTPMIN1_EL0 = 1 << 28;
4748        /// `nTPMIN0_EL0` bit.
4749        const NTPMIN0_EL0 = 1 << 29;
4750        /// `nTLBIDIDR_EL1` bit.
4751        const NTLBIDIDR_EL1 = 1 << 30;
4752        /// `TFSR_EL1` bit.
4753        const TFSR_EL1 = 1 << 33;
4754        /// `RGSR_EL1` bit.
4755        const RGSR_EL1 = 1 << 34;
4756        /// `GCR_EL1` bit.
4757        const GCR_EL1 = 1 << 35;
4758        /// `nTPIDR3_EL0` bit.
4759        const NTPIDR3_EL0 = 1 << 36;
4760        /// `nTPIDR3_EL1` bit.
4761        const NTPIDR3_EL1 = 1 << 37;
4762    }
4763}
4764
4765#[cfg(feature = "el2")]
4766impl Hfgrtr2El2 {
4767    /// Offset of the `nPFAR_EL1` field.
4768    pub const NPFAR_EL1_SHIFT: u32 = 0;
4769    /// Offset of the `nERXGSR_EL1` field.
4770    pub const NERXGSR_EL1_SHIFT: u32 = 1;
4771    /// Offset of the `nRCWSMASK_EL1` field.
4772    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
4773    /// Offset of the `nCPACRMASK_EL1` field.
4774    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
4775    /// Offset of the `nSCTLRMASK_EL1` field.
4776    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
4777    /// Offset of the `nSCTLR2MASK_EL1` field.
4778    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
4779    /// Offset of the `nTCRMASK_EL1` field.
4780    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
4781    /// Offset of the `nTCR2MASK_EL1` field.
4782    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
4783    /// Offset of the `nCPACRALIAS_EL1` field.
4784    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
4785    /// Offset of the `nSCTLRALIAS_EL1` field.
4786    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
4787    /// Offset of the `nSCTLR2ALIAS_EL1` field.
4788    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
4789    /// Offset of the `nTCRALIAS_EL1` field.
4790    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
4791    /// Offset of the `nTCR2ALIAS_EL1` field.
4792    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
4793    /// Offset of the `nACTLRMASK_EL1` field.
4794    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
4795    /// Offset of the `nACTLRALIAS_EL1` field.
4796    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
4797    /// Offset of the `nTINDEX_EL0` field.
4798    pub const NTINDEX_EL0_SHIFT: u32 = 15;
4799    /// Offset of the `nTINDEX_EL1` field.
4800    pub const NTINDEX_EL1_SHIFT: u32 = 16;
4801    /// Offset of the `nSTINDEX_EL1` field.
4802    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
4803    /// Offset of the `nFGDTn_EL1` field.
4804    pub const NFGDTN_EL1_SHIFT: u32 = 18;
4805    /// Mask for the `nFGDTn_EL1` field.
4806    pub const NFGDTN_EL1_MASK: u64 = 0b11;
4807    /// Offset of the `nTTTBRP_EL1` field.
4808    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
4809    /// Offset of the `nTTTBRU_EL1` field.
4810    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
4811    /// Offset of the `nIRTBRP_EL1` field.
4812    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
4813    /// Offset of the `nIRTBRU_EL1` field.
4814    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
4815    /// Offset of the `nDPOTBR1_EL1` field.
4816    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
4817    /// Offset of the `nDPOTBR0_EL1` field.
4818    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
4819    /// Offset of the `nTPMIN1_EL1` field.
4820    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
4821    /// Offset of the `nTPMIN0_EL1` field.
4822    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
4823    /// Offset of the `nTPMIN1_EL0` field.
4824    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
4825    /// Offset of the `nTPMIN0_EL0` field.
4826    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
4827    /// Offset of the `nTLBIDIDR_EL1` field.
4828    pub const NTLBIDIDR_EL1_SHIFT: u32 = 30;
4829    /// Offset of the `nAFGDTn_EL1` field.
4830    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
4831    /// Mask for the `nAFGDTn_EL1` field.
4832    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
4833    /// Offset of the `TFSR_EL1` field.
4834    pub const TFSR_EL1_SHIFT: u32 = 33;
4835    /// Offset of the `RGSR_EL1` field.
4836    pub const RGSR_EL1_SHIFT: u32 = 34;
4837    /// Offset of the `GCR_EL1` field.
4838    pub const GCR_EL1_SHIFT: u32 = 35;
4839    /// Offset of the `nTPIDR3_EL0` field.
4840    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
4841    /// Offset of the `nTPIDR3_EL1` field.
4842    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
4843
4844    /// Returns the value of the `nFGDTn_EL1` field.
4845    pub const fn nfgdtn_el1(self) -> u8 {
4846        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
4847    }
4848
4849    /// Returns the value of the `nAFGDTn_EL1` field.
4850    pub const fn nafgdtn_el1(self) -> u8 {
4851        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
4852    }
4853}
4854
4855#[cfg(feature = "el2")]
4856bitflags! {
4857    /// `HFGWTR2_EL2` system register value.
4858    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
4859    #[repr(transparent)]
4860    pub struct Hfgwtr2El2: u64 {
4861        /// `nPFAR_EL1` bit.
4862        const NPFAR_EL1 = 1 << 0;
4863        /// `nRCWSMASK_EL1` bit.
4864        const NRCWSMASK_EL1 = 1 << 2;
4865        /// `nCPACRMASK_EL1` bit.
4866        const NCPACRMASK_EL1 = 1 << 3;
4867        /// `nSCTLRMASK_EL1` bit.
4868        const NSCTLRMASK_EL1 = 1 << 4;
4869        /// `nSCTLR2MASK_EL1` bit.
4870        const NSCTLR2MASK_EL1 = 1 << 5;
4871        /// `nTCRMASK_EL1` bit.
4872        const NTCRMASK_EL1 = 1 << 6;
4873        /// `nTCR2MASK_EL1` bit.
4874        const NTCR2MASK_EL1 = 1 << 7;
4875        /// `nCPACRALIAS_EL1` bit.
4876        const NCPACRALIAS_EL1 = 1 << 8;
4877        /// `nSCTLRALIAS_EL1` bit.
4878        const NSCTLRALIAS_EL1 = 1 << 9;
4879        /// `nSCTLR2ALIAS_EL1` bit.
4880        const NSCTLR2ALIAS_EL1 = 1 << 10;
4881        /// `nTCRALIAS_EL1` bit.
4882        const NTCRALIAS_EL1 = 1 << 11;
4883        /// `nTCR2ALIAS_EL1` bit.
4884        const NTCR2ALIAS_EL1 = 1 << 12;
4885        /// `nACTLRMASK_EL1` bit.
4886        const NACTLRMASK_EL1 = 1 << 13;
4887        /// `nACTLRALIAS_EL1` bit.
4888        const NACTLRALIAS_EL1 = 1 << 14;
4889        /// `nTINDEX_EL0` bit.
4890        const NTINDEX_EL0 = 1 << 15;
4891        /// `nTINDEX_EL1` bit.
4892        const NTINDEX_EL1 = 1 << 16;
4893        /// `nSTINDEX_EL1` bit.
4894        const NSTINDEX_EL1 = 1 << 17;
4895        /// `nTTTBRP_EL1` bit.
4896        const NTTTBRP_EL1 = 1 << 20;
4897        /// `nTTTBRU_EL1` bit.
4898        const NTTTBRU_EL1 = 1 << 21;
4899        /// `nIRTBRP_EL1` bit.
4900        const NIRTBRP_EL1 = 1 << 22;
4901        /// `nIRTBRU_EL1` bit.
4902        const NIRTBRU_EL1 = 1 << 23;
4903        /// `nDPOTBR1_EL1` bit.
4904        const NDPOTBR1_EL1 = 1 << 24;
4905        /// `nDPOTBR0_EL1` bit.
4906        const NDPOTBR0_EL1 = 1 << 25;
4907        /// `nTPMIN1_EL1` bit.
4908        const NTPMIN1_EL1 = 1 << 26;
4909        /// `nTPMIN0_EL1` bit.
4910        const NTPMIN0_EL1 = 1 << 27;
4911        /// `nTPMIN1_EL0` bit.
4912        const NTPMIN1_EL0 = 1 << 28;
4913        /// `nTPMIN0_EL0` bit.
4914        const NTPMIN0_EL0 = 1 << 29;
4915        /// `TFSR_EL1` bit.
4916        const TFSR_EL1 = 1 << 33;
4917        /// `RGSR_EL1` bit.
4918        const RGSR_EL1 = 1 << 34;
4919        /// `GCR_EL1` bit.
4920        const GCR_EL1 = 1 << 35;
4921        /// `nTPIDR3_EL0` bit.
4922        const NTPIDR3_EL0 = 1 << 36;
4923        /// `nTPIDR3_EL1` bit.
4924        const NTPIDR3_EL1 = 1 << 37;
4925    }
4926}
4927
4928#[cfg(feature = "el2")]
4929impl Hfgwtr2El2 {
4930    /// Offset of the `nPFAR_EL1` field.
4931    pub const NPFAR_EL1_SHIFT: u32 = 0;
4932    /// Offset of the `nRCWSMASK_EL1` field.
4933    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
4934    /// Offset of the `nCPACRMASK_EL1` field.
4935    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
4936    /// Offset of the `nSCTLRMASK_EL1` field.
4937    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
4938    /// Offset of the `nSCTLR2MASK_EL1` field.
4939    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
4940    /// Offset of the `nTCRMASK_EL1` field.
4941    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
4942    /// Offset of the `nTCR2MASK_EL1` field.
4943    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
4944    /// Offset of the `nCPACRALIAS_EL1` field.
4945    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
4946    /// Offset of the `nSCTLRALIAS_EL1` field.
4947    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
4948    /// Offset of the `nSCTLR2ALIAS_EL1` field.
4949    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
4950    /// Offset of the `nTCRALIAS_EL1` field.
4951    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
4952    /// Offset of the `nTCR2ALIAS_EL1` field.
4953    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
4954    /// Offset of the `nACTLRMASK_EL1` field.
4955    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
4956    /// Offset of the `nACTLRALIAS_EL1` field.
4957    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
4958    /// Offset of the `nTINDEX_EL0` field.
4959    pub const NTINDEX_EL0_SHIFT: u32 = 15;
4960    /// Offset of the `nTINDEX_EL1` field.
4961    pub const NTINDEX_EL1_SHIFT: u32 = 16;
4962    /// Offset of the `nSTINDEX_EL1` field.
4963    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
4964    /// Offset of the `nFGDTn_EL1` field.
4965    pub const NFGDTN_EL1_SHIFT: u32 = 18;
4966    /// Mask for the `nFGDTn_EL1` field.
4967    pub const NFGDTN_EL1_MASK: u64 = 0b11;
4968    /// Offset of the `nTTTBRP_EL1` field.
4969    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
4970    /// Offset of the `nTTTBRU_EL1` field.
4971    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
4972    /// Offset of the `nIRTBRP_EL1` field.
4973    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
4974    /// Offset of the `nIRTBRU_EL1` field.
4975    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
4976    /// Offset of the `nDPOTBR1_EL1` field.
4977    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
4978    /// Offset of the `nDPOTBR0_EL1` field.
4979    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
4980    /// Offset of the `nTPMIN1_EL1` field.
4981    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
4982    /// Offset of the `nTPMIN0_EL1` field.
4983    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
4984    /// Offset of the `nTPMIN1_EL0` field.
4985    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
4986    /// Offset of the `nTPMIN0_EL0` field.
4987    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
4988    /// Offset of the `nAFGDTn_EL1` field.
4989    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
4990    /// Mask for the `nAFGDTn_EL1` field.
4991    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
4992    /// Offset of the `TFSR_EL1` field.
4993    pub const TFSR_EL1_SHIFT: u32 = 33;
4994    /// Offset of the `RGSR_EL1` field.
4995    pub const RGSR_EL1_SHIFT: u32 = 34;
4996    /// Offset of the `GCR_EL1` field.
4997    pub const GCR_EL1_SHIFT: u32 = 35;
4998    /// Offset of the `nTPIDR3_EL0` field.
4999    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
5000    /// Offset of the `nTPIDR3_EL1` field.
5001    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
5002
5003    /// Returns the value of the `nFGDTn_EL1` field.
5004    pub const fn nfgdtn_el1(self) -> u8 {
5005        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
5006    }
5007
5008    /// Returns the value of the `nAFGDTn_EL1` field.
5009    pub const fn nafgdtn_el1(self) -> u8 {
5010        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
5011    }
5012}
5013
5014#[cfg(feature = "el2")]
5015bitflags! {
5016    /// `HFGWTR_EL2` system register value.
5017    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5018    #[repr(transparent)]
5019    pub struct HfgwtrEl2: u64 {
5020        /// `AFSR0_EL1` bit.
5021        const AFSR0_EL1 = 1 << 0;
5022        /// `AFSR1_EL1` bit.
5023        const AFSR1_EL1 = 1 << 1;
5024        /// `AMAIR_EL1` bit.
5025        const AMAIR_EL1 = 1 << 3;
5026        /// `APDAKey` bit.
5027        const APDAKEY = 1 << 4;
5028        /// `APDBKey` bit.
5029        const APDBKEY = 1 << 5;
5030        /// `APGAKey` bit.
5031        const APGAKEY = 1 << 6;
5032        /// `APIAKey` bit.
5033        const APIAKEY = 1 << 7;
5034        /// `APIBKey` bit.
5035        const APIBKEY = 1 << 8;
5036        /// `CONTEXTIDR_EL1` bit.
5037        const CONTEXTIDR_EL1 = 1 << 11;
5038        /// `CPACR_EL1` bit.
5039        const CPACR_EL1 = 1 << 12;
5040        /// `CSSELR_EL1` bit.
5041        const CSSELR_EL1 = 1 << 13;
5042        /// `ESR_EL1` bit.
5043        const ESR_EL1 = 1 << 16;
5044        /// `FAR_EL1` bit.
5045        const FAR_EL1 = 1 << 17;
5046        /// `LORC_EL1` bit.
5047        const LORC_EL1 = 1 << 19;
5048        /// `LOREA_EL1` bit.
5049        const LOREA_EL1 = 1 << 20;
5050        /// `LORN_EL1` bit.
5051        const LORN_EL1 = 1 << 22;
5052        /// `LORSA_EL1` bit.
5053        const LORSA_EL1 = 1 << 23;
5054        /// `MAIR_EL1` bit.
5055        const MAIR_EL1 = 1 << 24;
5056        /// `PAR_EL1` bit.
5057        const PAR_EL1 = 1 << 27;
5058        /// `SCTLR_EL1` bit.
5059        const SCTLR_EL1 = 1 << 29;
5060        /// `SCXTNUM_EL1` bit.
5061        const SCXTNUM_EL1 = 1 << 30;
5062        /// `SCXTNUM_EL0` bit.
5063        const SCXTNUM_EL0 = 1 << 31;
5064        /// `TCR_EL1` bit.
5065        const TCR_EL1 = 1 << 32;
5066        /// `TPIDR_EL1` bit.
5067        const TPIDR_EL1 = 1 << 33;
5068        /// `TPIDRRO_EL0` bit.
5069        const TPIDRRO_EL0 = 1 << 34;
5070        /// `TPIDR_EL0` bit.
5071        const TPIDR_EL0 = 1 << 35;
5072        /// `TTBR0_EL1` bit.
5073        const TTBR0_EL1 = 1 << 36;
5074        /// `TTBR1_EL1` bit.
5075        const TTBR1_EL1 = 1 << 37;
5076        /// `VBAR_EL1` bit.
5077        const VBAR_EL1 = 1 << 38;
5078        /// `ICC_IGRPENn_EL1` bit.
5079        const ICC_IGRPENN_EL1 = 1 << 39;
5080        /// `ERRSELR_EL1` bit.
5081        const ERRSELR_EL1 = 1 << 41;
5082        /// `ERXCTLR_EL1` bit.
5083        const ERXCTLR_EL1 = 1 << 43;
5084        /// `ERXSTATUS_EL1` bit.
5085        const ERXSTATUS_EL1 = 1 << 44;
5086        /// `ERXMISCn_EL1` bit.
5087        const ERXMISCN_EL1 = 1 << 45;
5088        /// `ERXPFGCTL_EL1` bit.
5089        const ERXPFGCTL_EL1 = 1 << 47;
5090        /// `ERXPFGCDN_EL1` bit.
5091        const ERXPFGCDN_EL1 = 1 << 48;
5092        /// `ERXADDR_EL1` bit.
5093        const ERXADDR_EL1 = 1 << 49;
5094        /// `nACCDATA_EL1` bit.
5095        const NACCDATA_EL1 = 1 << 50;
5096        /// `nGCS_EL0` bit.
5097        const NGCS_EL0 = 1 << 52;
5098        /// `nGCS_EL1` bit.
5099        const NGCS_EL1 = 1 << 53;
5100        /// `nSMPRI_EL1` bit.
5101        const NSMPRI_EL1 = 1 << 54;
5102        /// `nTPIDR2_EL0` bit.
5103        const NTPIDR2_EL0 = 1 << 55;
5104        /// `nRCWMASK_EL1` bit.
5105        const NRCWMASK_EL1 = 1 << 56;
5106        /// `nPIRE0_EL1` bit.
5107        const NPIRE0_EL1 = 1 << 57;
5108        /// `nPIR_EL1` bit.
5109        const NPIR_EL1 = 1 << 58;
5110        /// `nPOR_EL0` bit.
5111        const NPOR_EL0 = 1 << 59;
5112        /// `nPOR_EL1` bit.
5113        const NPOR_EL1 = 1 << 60;
5114        /// `nS2POR_EL1` bit.
5115        const NS2POR_EL1 = 1 << 61;
5116        /// `nMAIR2_EL1` bit.
5117        const NMAIR2_EL1 = 1 << 62;
5118        /// `nAMAIR2_EL1` bit.
5119        const NAMAIR2_EL1 = 1 << 63;
5120    }
5121}
5122
5123#[cfg(feature = "el2")]
5124impl HfgwtrEl2 {
5125    /// Offset of the `AFSR0_EL1` field.
5126    pub const AFSR0_EL1_SHIFT: u32 = 0;
5127    /// Offset of the `AFSR1_EL1` field.
5128    pub const AFSR1_EL1_SHIFT: u32 = 1;
5129    /// Offset of the `AMAIR_EL1` field.
5130    pub const AMAIR_EL1_SHIFT: u32 = 3;
5131    /// Offset of the `APDAKey` field.
5132    pub const APDAKEY_SHIFT: u32 = 4;
5133    /// Offset of the `APDBKey` field.
5134    pub const APDBKEY_SHIFT: u32 = 5;
5135    /// Offset of the `APGAKey` field.
5136    pub const APGAKEY_SHIFT: u32 = 6;
5137    /// Offset of the `APIAKey` field.
5138    pub const APIAKEY_SHIFT: u32 = 7;
5139    /// Offset of the `APIBKey` field.
5140    pub const APIBKEY_SHIFT: u32 = 8;
5141    /// Offset of the `CONTEXTIDR_EL1` field.
5142    pub const CONTEXTIDR_EL1_SHIFT: u32 = 11;
5143    /// Offset of the `CPACR_EL1` field.
5144    pub const CPACR_EL1_SHIFT: u32 = 12;
5145    /// Offset of the `CSSELR_EL1` field.
5146    pub const CSSELR_EL1_SHIFT: u32 = 13;
5147    /// Offset of the `ESR_EL1` field.
5148    pub const ESR_EL1_SHIFT: u32 = 16;
5149    /// Offset of the `FAR_EL1` field.
5150    pub const FAR_EL1_SHIFT: u32 = 17;
5151    /// Offset of the `LORC_EL1` field.
5152    pub const LORC_EL1_SHIFT: u32 = 19;
5153    /// Offset of the `LOREA_EL1` field.
5154    pub const LOREA_EL1_SHIFT: u32 = 20;
5155    /// Offset of the `LORN_EL1` field.
5156    pub const LORN_EL1_SHIFT: u32 = 22;
5157    /// Offset of the `LORSA_EL1` field.
5158    pub const LORSA_EL1_SHIFT: u32 = 23;
5159    /// Offset of the `MAIR_EL1` field.
5160    pub const MAIR_EL1_SHIFT: u32 = 24;
5161    /// Offset of the `PAR_EL1` field.
5162    pub const PAR_EL1_SHIFT: u32 = 27;
5163    /// Offset of the `SCTLR_EL1` field.
5164    pub const SCTLR_EL1_SHIFT: u32 = 29;
5165    /// Offset of the `SCXTNUM_EL1` field.
5166    pub const SCXTNUM_EL1_SHIFT: u32 = 30;
5167    /// Offset of the `SCXTNUM_EL0` field.
5168    pub const SCXTNUM_EL0_SHIFT: u32 = 31;
5169    /// Offset of the `TCR_EL1` field.
5170    pub const TCR_EL1_SHIFT: u32 = 32;
5171    /// Offset of the `TPIDR_EL1` field.
5172    pub const TPIDR_EL1_SHIFT: u32 = 33;
5173    /// Offset of the `TPIDRRO_EL0` field.
5174    pub const TPIDRRO_EL0_SHIFT: u32 = 34;
5175    /// Offset of the `TPIDR_EL0` field.
5176    pub const TPIDR_EL0_SHIFT: u32 = 35;
5177    /// Offset of the `TTBR0_EL1` field.
5178    pub const TTBR0_EL1_SHIFT: u32 = 36;
5179    /// Offset of the `TTBR1_EL1` field.
5180    pub const TTBR1_EL1_SHIFT: u32 = 37;
5181    /// Offset of the `VBAR_EL1` field.
5182    pub const VBAR_EL1_SHIFT: u32 = 38;
5183    /// Offset of the `ICC_IGRPENn_EL1` field.
5184    pub const ICC_IGRPENN_EL1_SHIFT: u32 = 39;
5185    /// Offset of the `ERRSELR_EL1` field.
5186    pub const ERRSELR_EL1_SHIFT: u32 = 41;
5187    /// Offset of the `ERXCTLR_EL1` field.
5188    pub const ERXCTLR_EL1_SHIFT: u32 = 43;
5189    /// Offset of the `ERXSTATUS_EL1` field.
5190    pub const ERXSTATUS_EL1_SHIFT: u32 = 44;
5191    /// Offset of the `ERXMISCn_EL1` field.
5192    pub const ERXMISCN_EL1_SHIFT: u32 = 45;
5193    /// Offset of the `ERXPFGCTL_EL1` field.
5194    pub const ERXPFGCTL_EL1_SHIFT: u32 = 47;
5195    /// Offset of the `ERXPFGCDN_EL1` field.
5196    pub const ERXPFGCDN_EL1_SHIFT: u32 = 48;
5197    /// Offset of the `ERXADDR_EL1` field.
5198    pub const ERXADDR_EL1_SHIFT: u32 = 49;
5199    /// Offset of the `nACCDATA_EL1` field.
5200    pub const NACCDATA_EL1_SHIFT: u32 = 50;
5201    /// Offset of the `nGCS_EL0` field.
5202    pub const NGCS_EL0_SHIFT: u32 = 52;
5203    /// Offset of the `nGCS_EL1` field.
5204    pub const NGCS_EL1_SHIFT: u32 = 53;
5205    /// Offset of the `nSMPRI_EL1` field.
5206    pub const NSMPRI_EL1_SHIFT: u32 = 54;
5207    /// Offset of the `nTPIDR2_EL0` field.
5208    pub const NTPIDR2_EL0_SHIFT: u32 = 55;
5209    /// Offset of the `nRCWMASK_EL1` field.
5210    pub const NRCWMASK_EL1_SHIFT: u32 = 56;
5211    /// Offset of the `nPIRE0_EL1` field.
5212    pub const NPIRE0_EL1_SHIFT: u32 = 57;
5213    /// Offset of the `nPIR_EL1` field.
5214    pub const NPIR_EL1_SHIFT: u32 = 58;
5215    /// Offset of the `nPOR_EL0` field.
5216    pub const NPOR_EL0_SHIFT: u32 = 59;
5217    /// Offset of the `nPOR_EL1` field.
5218    pub const NPOR_EL1_SHIFT: u32 = 60;
5219    /// Offset of the `nS2POR_EL1` field.
5220    pub const NS2POR_EL1_SHIFT: u32 = 61;
5221    /// Offset of the `nMAIR2_EL1` field.
5222    pub const NMAIR2_EL1_SHIFT: u32 = 62;
5223    /// Offset of the `nAMAIR2_EL1` field.
5224    pub const NAMAIR2_EL1_SHIFT: u32 = 63;
5225}
5226
5227bitflags! {
5228    /// `HIFAR` system register value.
5229    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5230    #[repr(transparent)]
5231    pub struct Hifar: u32 {
5232    }
5233}
5234
5235impl Hifar {
5236    /// Offset of the `VA` field.
5237    pub const VA_SHIFT: u32 = 0;
5238    /// Mask for the `VA` field.
5239    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
5240
5241    /// Returns the value of the `VA` field.
5242    pub const fn va(self) -> u32 {
5243        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
5244    }
5245}
5246
5247bitflags! {
5248    /// `HMAIR0` system register value.
5249    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5250    #[repr(transparent)]
5251    pub struct Hmair0: u32 {
5252    }
5253}
5254
5255impl Hmair0 {
5256    /// Offset of the `Attr<n>` field.
5257    pub const ATTR_SHIFT: u32 = 0;
5258    /// Mask for the `Attr<n>` field.
5259    pub const ATTR_MASK: u32 = 0b11111111;
5260
5261    /// Returns the value of the given `Attr<n>` field.
5262    pub const fn attr(self, n: u32) -> u8 {
5263        assert!(n < 4);
5264        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
5265    }
5266}
5267
5268bitflags! {
5269    /// `HMAIR1` system register value.
5270    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5271    #[repr(transparent)]
5272    pub struct Hmair1: u32 {
5273    }
5274}
5275
5276impl Hmair1 {
5277    /// Offset of the `Attr<n>` field.
5278    pub const ATTR_SHIFT: u32 = 0;
5279    /// Mask for the `Attr<n>` field.
5280    pub const ATTR_MASK: u32 = 0b11111111;
5281
5282    /// Returns the value of the given `Attr<n>` field.
5283    pub const fn attr(self, n: u32) -> u8 {
5284        assert!(n >= 4 && n < 8);
5285        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
5286    }
5287}
5288
5289bitflags! {
5290    /// `HPFAR` system register value.
5291    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5292    #[repr(transparent)]
5293    pub struct Hpfar: u32 {
5294    }
5295}
5296
5297impl Hpfar {
5298    /// Offset of the `FIPA[39:12]` field.
5299    pub const FIPA_39_12_SHIFT: u32 = 4;
5300    /// Mask for the `FIPA[39:12]` field.
5301    pub const FIPA_39_12_MASK: u32 = 0b1111111111111111111111111111;
5302
5303    /// Returns the value of the `FIPA[39:12]` field.
5304    pub const fn fipa_39_12(self) -> u32 {
5305        ((self.bits() >> Self::FIPA_39_12_SHIFT) & 0b1111111111111111111111111111) as u32
5306    }
5307}
5308
5309#[cfg(feature = "el2")]
5310bitflags! {
5311    /// `HPFAR_EL2` system register value.
5312    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5313    #[repr(transparent)]
5314    pub struct HpfarEl2: u64 {
5315        /// `NS` bit.
5316        const NS = 1 << 63;
5317    }
5318}
5319
5320#[cfg(feature = "el2")]
5321impl HpfarEl2 {
5322    /// Offset of the `FIPA` field.
5323    pub const FIPA_SHIFT: u32 = 4;
5324    /// Mask for the `FIPA` field.
5325    pub const FIPA_MASK: u64 = 0b11111111111111111111111111111111111111111111;
5326    /// Offset of the `NS` field.
5327    pub const NS_SHIFT: u32 = 63;
5328
5329    /// Returns the value of the `FIPA` field.
5330    pub const fn fipa(self) -> u64 {
5331        ((self.bits() >> Self::FIPA_SHIFT) & 0b11111111111111111111111111111111111111111111) as u64
5332    }
5333}
5334
5335bitflags! {
5336    /// `HRMR` system register value.
5337    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5338    #[repr(transparent)]
5339    pub struct Hrmr: u32 {
5340        /// `AA64` bit.
5341        const AA64 = 1 << 0;
5342        /// `RR` bit.
5343        const RR = 1 << 1;
5344    }
5345}
5346
5347impl Hrmr {
5348    /// Offset of the `AA64` field.
5349    pub const AA64_SHIFT: u32 = 0;
5350    /// Offset of the `RR` field.
5351    pub const RR_SHIFT: u32 = 1;
5352}
5353
5354bitflags! {
5355    /// `HSCTLR` system register value.
5356    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5357    #[repr(transparent)]
5358    pub struct Hsctlr: u32 {
5359        /// RES1 bits in the `HSCTLR` register.
5360        const RES1 = 0b110000110001010000100000000000;
5361        /// `M` bit.
5362        const M = 1 << 0;
5363        /// `A` bit.
5364        const A = 1 << 1;
5365        /// `C` bit.
5366        const C = 1 << 2;
5367        /// `nTLSMD` bit.
5368        const NTLSMD = 1 << 3;
5369        /// `LSMAOE` bit.
5370        const LSMAOE = 1 << 4;
5371        /// `CP15BEN` bit.
5372        const CP15BEN = 1 << 5;
5373        /// `ITD` bit.
5374        const ITD = 1 << 7;
5375        /// `SED` bit.
5376        const SED = 1 << 8;
5377        /// `I` bit.
5378        const I = 1 << 12;
5379        /// `WXN` bit.
5380        const WXN = 1 << 19;
5381        /// `TE` bit.
5382        const TE = 1 << 30;
5383        /// `DSSBS` bit.
5384        const DSSBS = 1 << 31;
5385    }
5386}
5387
5388impl Hsctlr {
5389    /// Offset of the `M` field.
5390    pub const M_SHIFT: u32 = 0;
5391    /// Offset of the `A` field.
5392    pub const A_SHIFT: u32 = 1;
5393    /// Offset of the `C` field.
5394    pub const C_SHIFT: u32 = 2;
5395    /// Offset of the `nTLSMD` field.
5396    pub const NTLSMD_SHIFT: u32 = 3;
5397    /// Offset of the `LSMAOE` field.
5398    pub const LSMAOE_SHIFT: u32 = 4;
5399    /// Offset of the `CP15BEN` field.
5400    pub const CP15BEN_SHIFT: u32 = 5;
5401    /// Offset of the `ITD` field.
5402    pub const ITD_SHIFT: u32 = 7;
5403    /// Offset of the `SED` field.
5404    pub const SED_SHIFT: u32 = 8;
5405    /// Offset of the `I` field.
5406    pub const I_SHIFT: u32 = 12;
5407    /// Offset of the `WXN` field.
5408    pub const WXN_SHIFT: u32 = 19;
5409    /// Offset of the `TE` field.
5410    pub const TE_SHIFT: u32 = 30;
5411    /// Offset of the `DSSBS` field.
5412    pub const DSSBS_SHIFT: u32 = 31;
5413}
5414
5415bitflags! {
5416    /// `HSR` system register value.
5417    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5418    #[repr(transparent)]
5419    pub struct Hsr: u32 {
5420        /// `IL` bit.
5421        const IL = 1 << 25;
5422    }
5423}
5424
5425impl Hsr {
5426    /// Offset of the `ISS` field.
5427    pub const ISS_SHIFT: u32 = 0;
5428    /// Mask for the `ISS` field.
5429    pub const ISS_MASK: u32 = 0b1111111111111111111111111;
5430    /// Offset of the `IL` field.
5431    pub const IL_SHIFT: u32 = 25;
5432    /// Offset of the `EC` field.
5433    pub const EC_SHIFT: u32 = 26;
5434    /// Mask for the `EC` field.
5435    pub const EC_MASK: u32 = 0b111111;
5436
5437    /// Returns the value of the `ISS` field.
5438    pub const fn iss(self) -> u32 {
5439        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
5440    }
5441
5442    /// Returns the value of the `EC` field.
5443    pub const fn ec(self) -> u8 {
5444        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
5445    }
5446}
5447
5448bitflags! {
5449    /// `HTCR` system register value.
5450    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5451    #[repr(transparent)]
5452    pub struct Htcr: u32 {
5453        /// RES1 bits in the `HTCR` register.
5454        const RES1 = 0b10000000100000000000000000000000;
5455        /// `HPD` bit.
5456        const HPD = 1 << 24;
5457        /// `HWU59` bit.
5458        const HWU59 = 1 << 25;
5459        /// `HWU60` bit.
5460        const HWU60 = 1 << 26;
5461        /// `HWU61` bit.
5462        const HWU61 = 1 << 27;
5463        /// `HWU62` bit.
5464        const HWU62 = 1 << 28;
5465    }
5466}
5467
5468impl Htcr {
5469    /// Offset of the `T0SZ` field.
5470    pub const T0SZ_SHIFT: u32 = 0;
5471    /// Mask for the `T0SZ` field.
5472    pub const T0SZ_MASK: u32 = 0b111;
5473    /// Offset of the `IRGN0` field.
5474    pub const IRGN0_SHIFT: u32 = 8;
5475    /// Mask for the `IRGN0` field.
5476    pub const IRGN0_MASK: u32 = 0b11;
5477    /// Offset of the `ORGN0` field.
5478    pub const ORGN0_SHIFT: u32 = 10;
5479    /// Mask for the `ORGN0` field.
5480    pub const ORGN0_MASK: u32 = 0b11;
5481    /// Offset of the `SH0` field.
5482    pub const SH0_SHIFT: u32 = 12;
5483    /// Mask for the `SH0` field.
5484    pub const SH0_MASK: u32 = 0b11;
5485    /// Offset of the `HPD` field.
5486    pub const HPD_SHIFT: u32 = 24;
5487    /// Offset of the `HWU59` field.
5488    pub const HWU59_SHIFT: u32 = 25;
5489    /// Offset of the `HWU60` field.
5490    pub const HWU60_SHIFT: u32 = 26;
5491    /// Offset of the `HWU61` field.
5492    pub const HWU61_SHIFT: u32 = 27;
5493    /// Offset of the `HWU62` field.
5494    pub const HWU62_SHIFT: u32 = 28;
5495
5496    /// Returns the value of the `T0SZ` field.
5497    pub const fn t0sz(self) -> u8 {
5498        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
5499    }
5500
5501    /// Returns the value of the `IRGN0` field.
5502    pub const fn irgn0(self) -> u8 {
5503        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
5504    }
5505
5506    /// Returns the value of the `ORGN0` field.
5507    pub const fn orgn0(self) -> u8 {
5508        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
5509    }
5510
5511    /// Returns the value of the `SH0` field.
5512    pub const fn sh0(self) -> u8 {
5513        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
5514    }
5515}
5516
5517bitflags! {
5518    /// `HTPIDR` system register value.
5519    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5520    #[repr(transparent)]
5521    pub struct Htpidr: u32 {
5522    }
5523}
5524
5525impl Htpidr {
5526    /// Offset of the `TID` field.
5527    pub const TID_SHIFT: u32 = 0;
5528    /// Mask for the `TID` field.
5529    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
5530
5531    /// Returns the value of the `TID` field.
5532    pub const fn tid(self) -> u32 {
5533        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
5534    }
5535}
5536
5537bitflags! {
5538    /// `HTRFCR` system register value.
5539    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5540    #[repr(transparent)]
5541    pub struct Htrfcr: u32 {
5542        /// `E0HTRE` bit.
5543        const E0HTRE = 1 << 0;
5544        /// `E2TRE` bit.
5545        const E2TRE = 1 << 1;
5546        /// `CX` bit.
5547        const CX = 1 << 3;
5548    }
5549}
5550
5551impl Htrfcr {
5552    /// Offset of the `E0HTRE` field.
5553    pub const E0HTRE_SHIFT: u32 = 0;
5554    /// Offset of the `E2TRE` field.
5555    pub const E2TRE_SHIFT: u32 = 1;
5556    /// Offset of the `CX` field.
5557    pub const CX_SHIFT: u32 = 3;
5558    /// Offset of the `TS` field.
5559    pub const TS_SHIFT: u32 = 5;
5560    /// Mask for the `TS` field.
5561    pub const TS_MASK: u32 = 0b11;
5562
5563    /// Returns the value of the `TS` field.
5564    pub const fn ts(self) -> u8 {
5565        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
5566    }
5567}
5568
5569bitflags! {
5570    /// `HTTBR` system register value.
5571    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5572    #[repr(transparent)]
5573    pub struct Httbr: u64 {
5574        /// `CnP` bit.
5575        const CNP = 1 << 0;
5576    }
5577}
5578
5579impl Httbr {
5580    /// Offset of the `CnP` field.
5581    pub const CNP_SHIFT: u32 = 0;
5582    /// Offset of the `BADDR` field.
5583    pub const BADDR_SHIFT: u32 = 1;
5584    /// Mask for the `BADDR` field.
5585    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
5586
5587    /// Returns the value of the `BADDR` field.
5588    pub const fn baddr(self) -> u64 {
5589        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
5590            as u64
5591    }
5592}
5593
5594bitflags! {
5595    /// `HVBAR` system register value.
5596    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5597    #[repr(transparent)]
5598    pub struct Hvbar: u32 {
5599    }
5600}
5601
5602impl Hvbar {
5603    /// Offset of the `VBA` field.
5604    pub const VBA_SHIFT: u32 = 5;
5605    /// Mask for the `VBA` field.
5606    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
5607
5608    /// Returns the value of the `VBA` field.
5609    pub const fn vba(self) -> u32 {
5610        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
5611    }
5612}
5613
5614#[cfg(feature = "el1")]
5615bitflags! {
5616    /// `ICC_SRE_EL1` system register value.
5617    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5618    #[repr(transparent)]
5619    pub struct IccSreEl1: u64 {
5620        /// Enable the system register interface.
5621        const SRE = 1 << 0;
5622        /// Disable FIQ bypass.
5623        const DFB = 1 << 1;
5624        /// Disable IRQ bypass.
5625        const DIB = 1 << 2;
5626    }
5627}
5628
5629#[cfg(feature = "el1")]
5630impl IccSreEl1 {
5631    /// Offset of the `SRE` field.
5632    pub const SRE_SHIFT: u32 = 0;
5633    /// Offset of the `DFB` field.
5634    pub const DFB_SHIFT: u32 = 1;
5635    /// Offset of the `DIB` field.
5636    pub const DIB_SHIFT: u32 = 2;
5637}
5638
5639#[cfg(feature = "el2")]
5640bitflags! {
5641    /// `ICC_SRE_EL2` system register value.
5642    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5643    #[repr(transparent)]
5644    pub struct IccSreEl2: u64 {
5645        /// Enable the system register interface.
5646        const SRE = 1 << 0;
5647        /// Disable FIQ bypass.
5648        const DFB = 1 << 1;
5649        /// Disable IRQ bypass.
5650        const DIB = 1 << 2;
5651        /// Enable lower exception level access.
5652        const ENABLE = 1 << 3;
5653    }
5654}
5655
5656#[cfg(feature = "el2")]
5657impl IccSreEl2 {
5658    /// Offset of the `SRE` field.
5659    pub const SRE_SHIFT: u32 = 0;
5660    /// Offset of the `DFB` field.
5661    pub const DFB_SHIFT: u32 = 1;
5662    /// Offset of the `DIB` field.
5663    pub const DIB_SHIFT: u32 = 2;
5664    /// Offset of the `Enable` field.
5665    pub const ENABLE_SHIFT: u32 = 3;
5666}
5667
5668#[cfg(feature = "el3")]
5669bitflags! {
5670    /// `ICC_SRE_EL3` system register value.
5671    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5672    #[repr(transparent)]
5673    pub struct IccSreEl3: u64 {
5674        /// Enable the system register interface.
5675        const SRE = 1 << 0;
5676        /// Disable FIQ bypass.
5677        const DFB = 1 << 1;
5678        /// Disable IRQ bypass.
5679        const DIB = 1 << 2;
5680        /// Enable lower exception level access.
5681        const ENABLE = 1 << 3;
5682    }
5683}
5684
5685#[cfg(feature = "el3")]
5686impl IccSreEl3 {
5687    /// Offset of the `SRE` field.
5688    pub const SRE_SHIFT: u32 = 0;
5689    /// Offset of the `DFB` field.
5690    pub const DFB_SHIFT: u32 = 1;
5691    /// Offset of the `DIB` field.
5692    pub const DIB_SHIFT: u32 = 2;
5693    /// Offset of the `Enable` field.
5694    pub const ENABLE_SHIFT: u32 = 3;
5695}
5696
5697#[cfg(feature = "el2")]
5698bitflags! {
5699    /// `ICH_HCR_EL2` system register value.
5700    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5701    #[repr(transparent)]
5702    pub struct IchHcrEl2: u64 {
5703        /// `En` bit.
5704        const EN = 1 << 0;
5705        /// `UIE` bit.
5706        const UIE = 1 << 1;
5707        /// `LRENPIE` bit.
5708        const LRENPIE = 1 << 2;
5709        /// `NPIE` bit.
5710        const NPIE = 1 << 3;
5711        /// `VGrp0EIE` bit.
5712        const VGRP0EIE = 1 << 4;
5713        /// `VGrp0DIE` bit.
5714        const VGRP0DIE = 1 << 5;
5715        /// `VGrp1EIE` bit.
5716        const VGRP1EIE = 1 << 6;
5717        /// `VGrp1DIE` bit.
5718        const VGRP1DIE = 1 << 7;
5719        /// `vSGIEOICount` bit.
5720        const VSGIEOICOUNT = 1 << 8;
5721        /// `TC` bit.
5722        const TC = 1 << 10;
5723        /// `TALL0` bit.
5724        const TALL0 = 1 << 11;
5725        /// `TALL1` bit.
5726        const TALL1 = 1 << 12;
5727        /// `TSEI` bit.
5728        const TSEI = 1 << 13;
5729        /// `TDIR` bit.
5730        const TDIR = 1 << 14;
5731        /// `DVIM` bit.
5732        const DVIM = 1 << 15;
5733    }
5734}
5735
5736#[cfg(feature = "el2")]
5737impl IchHcrEl2 {
5738    /// Offset of the `En` field.
5739    pub const EN_SHIFT: u32 = 0;
5740    /// Offset of the `UIE` field.
5741    pub const UIE_SHIFT: u32 = 1;
5742    /// Offset of the `LRENPIE` field.
5743    pub const LRENPIE_SHIFT: u32 = 2;
5744    /// Offset of the `NPIE` field.
5745    pub const NPIE_SHIFT: u32 = 3;
5746    /// Offset of the `VGrp0EIE` field.
5747    pub const VGRP0EIE_SHIFT: u32 = 4;
5748    /// Offset of the `VGrp0DIE` field.
5749    pub const VGRP0DIE_SHIFT: u32 = 5;
5750    /// Offset of the `VGrp1EIE` field.
5751    pub const VGRP1EIE_SHIFT: u32 = 6;
5752    /// Offset of the `VGrp1DIE` field.
5753    pub const VGRP1DIE_SHIFT: u32 = 7;
5754    /// Offset of the `vSGIEOICount` field.
5755    pub const VSGIEOICOUNT_SHIFT: u32 = 8;
5756    /// Offset of the `TC` field.
5757    pub const TC_SHIFT: u32 = 10;
5758    /// Offset of the `TALL0` field.
5759    pub const TALL0_SHIFT: u32 = 11;
5760    /// Offset of the `TALL1` field.
5761    pub const TALL1_SHIFT: u32 = 12;
5762    /// Offset of the `TSEI` field.
5763    pub const TSEI_SHIFT: u32 = 13;
5764    /// Offset of the `TDIR` field.
5765    pub const TDIR_SHIFT: u32 = 14;
5766    /// Offset of the `DVIM` field.
5767    pub const DVIM_SHIFT: u32 = 15;
5768    /// Offset of the `EOIcount` field.
5769    pub const EOICOUNT_SHIFT: u32 = 27;
5770    /// Mask for the `EOIcount` field.
5771    pub const EOICOUNT_MASK: u64 = 0b11111;
5772
5773    /// Returns the value of the `EOIcount` field.
5774    pub const fn eoicount(self) -> u8 {
5775        ((self.bits() >> Self::EOICOUNT_SHIFT) & 0b11111) as u8
5776    }
5777}
5778
5779#[cfg(feature = "el2")]
5780bitflags! {
5781    /// `ICH_VMCR_EL2` system register value.
5782    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5783    #[repr(transparent)]
5784    pub struct IchVmcrEl2: u64 {
5785        /// `EN` bit.
5786        const EN = 1 << 0;
5787        /// `VENG0` bit.
5788        const VENG0 = 1 << 0;
5789        /// `VENG1` bit.
5790        const VENG1 = 1 << 1;
5791        /// `VAckCtl` bit.
5792        const VACKCTL = 1 << 2;
5793        /// `VFIQEn` bit.
5794        const VFIQEN = 1 << 3;
5795        /// `VCBPR` bit.
5796        const VCBPR = 1 << 4;
5797        /// `VEOIM` bit.
5798        const VEOIM = 1 << 9;
5799    }
5800}
5801
5802#[cfg(feature = "el2")]
5803impl IchVmcrEl2 {
5804    /// Offset of the `EN` field.
5805    pub const EN_SHIFT: u32 = 0;
5806    /// Offset of the `VENG0` field.
5807    pub const VENG0_SHIFT: u32 = 0;
5808    /// Offset of the `VENG1` field.
5809    pub const VENG1_SHIFT: u32 = 1;
5810    /// Offset of the `VAckCtl` field.
5811    pub const VACKCTL_SHIFT: u32 = 2;
5812    /// Offset of the `VFIQEn` field.
5813    pub const VFIQEN_SHIFT: u32 = 3;
5814    /// Offset of the `VCBPR` field.
5815    pub const VCBPR_SHIFT: u32 = 4;
5816    /// Offset of the `VEOIM` field.
5817    pub const VEOIM_SHIFT: u32 = 9;
5818    /// Offset of the `VBPR1` field.
5819    pub const VBPR1_SHIFT: u32 = 18;
5820    /// Mask for the `VBPR1` field.
5821    pub const VBPR1_MASK: u64 = 0b111;
5822    /// Offset of the `VBPR0` field.
5823    pub const VBPR0_SHIFT: u32 = 21;
5824    /// Mask for the `VBPR0` field.
5825    pub const VBPR0_MASK: u64 = 0b111;
5826
5827    /// Returns the value of the `VBPR1` field.
5828    pub const fn vbpr1(self) -> u8 {
5829        ((self.bits() >> Self::VBPR1_SHIFT) & 0b111) as u8
5830    }
5831
5832    /// Returns the value of the `VBPR0` field.
5833    pub const fn vbpr0(self) -> u8 {
5834        ((self.bits() >> Self::VBPR0_SHIFT) & 0b111) as u8
5835    }
5836}
5837
5838#[cfg(feature = "el1")]
5839bitflags! {
5840    /// `ID_AA64DFR0_EL1` system register value.
5841    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5842    #[repr(transparent)]
5843    pub struct IdAa64dfr0El1: u64 {
5844    }
5845}
5846
5847#[cfg(feature = "el1")]
5848impl IdAa64dfr0El1 {
5849    /// Offset of the `DebugVer` field.
5850    pub const DEBUGVER_SHIFT: u32 = 0;
5851    /// Mask for the `DebugVer` field.
5852    pub const DEBUGVER_MASK: u64 = 0b1111;
5853    /// Offset of the `TraceVer` field.
5854    pub const TRACEVER_SHIFT: u32 = 4;
5855    /// Mask for the `TraceVer` field.
5856    pub const TRACEVER_MASK: u64 = 0b1111;
5857    /// Offset of the `PMUVer` field.
5858    pub const PMUVER_SHIFT: u32 = 8;
5859    /// Mask for the `PMUVer` field.
5860    pub const PMUVER_MASK: u64 = 0b1111;
5861    /// Offset of the `BRPs` field.
5862    pub const BRPS_SHIFT: u32 = 12;
5863    /// Mask for the `BRPs` field.
5864    pub const BRPS_MASK: u64 = 0b1111;
5865    /// Offset of the `PMSS` field.
5866    pub const PMSS_SHIFT: u32 = 16;
5867    /// Mask for the `PMSS` field.
5868    pub const PMSS_MASK: u64 = 0b1111;
5869    /// Offset of the `WRPs` field.
5870    pub const WRPS_SHIFT: u32 = 20;
5871    /// Mask for the `WRPs` field.
5872    pub const WRPS_MASK: u64 = 0b1111;
5873    /// Offset of the `SEBEP` field.
5874    pub const SEBEP_SHIFT: u32 = 24;
5875    /// Mask for the `SEBEP` field.
5876    pub const SEBEP_MASK: u64 = 0b1111;
5877    /// Offset of the `CTX_CMPs` field.
5878    pub const CTX_CMPS_SHIFT: u32 = 28;
5879    /// Mask for the `CTX_CMPs` field.
5880    pub const CTX_CMPS_MASK: u64 = 0b1111;
5881    /// Offset of the `PMSVer` field.
5882    pub const PMSVER_SHIFT: u32 = 32;
5883    /// Mask for the `PMSVer` field.
5884    pub const PMSVER_MASK: u64 = 0b1111;
5885    /// Offset of the `DoubleLock` field.
5886    pub const DOUBLELOCK_SHIFT: u32 = 36;
5887    /// Mask for the `DoubleLock` field.
5888    pub const DOUBLELOCK_MASK: u64 = 0b1111;
5889    /// Offset of the `TraceFilt` field.
5890    pub const TRACEFILT_SHIFT: u32 = 40;
5891    /// Mask for the `TraceFilt` field.
5892    pub const TRACEFILT_MASK: u64 = 0b1111;
5893    /// Offset of the `TraceBuffer` field.
5894    pub const TRACEBUFFER_SHIFT: u32 = 44;
5895    /// Mask for the `TraceBuffer` field.
5896    pub const TRACEBUFFER_MASK: u64 = 0b1111;
5897    /// Offset of the `MTPMU` field.
5898    pub const MTPMU_SHIFT: u32 = 48;
5899    /// Mask for the `MTPMU` field.
5900    pub const MTPMU_MASK: u64 = 0b1111;
5901    /// Offset of the `BRBE` field.
5902    pub const BRBE_SHIFT: u32 = 52;
5903    /// Mask for the `BRBE` field.
5904    pub const BRBE_MASK: u64 = 0b1111;
5905    /// Offset of the `ExtTrcBuff` field.
5906    pub const EXTTRCBUFF_SHIFT: u32 = 56;
5907    /// Mask for the `ExtTrcBuff` field.
5908    pub const EXTTRCBUFF_MASK: u64 = 0b1111;
5909    /// Offset of the `HPMN0` field.
5910    pub const HPMN0_SHIFT: u32 = 60;
5911    /// Mask for the `HPMN0` field.
5912    pub const HPMN0_MASK: u64 = 0b1111;
5913
5914    /// Returns the value of the `DebugVer` field.
5915    pub const fn debugver(self) -> u8 {
5916        ((self.bits() >> Self::DEBUGVER_SHIFT) & 0b1111) as u8
5917    }
5918
5919    /// Returns the value of the `TraceVer` field.
5920    pub const fn tracever(self) -> u8 {
5921        ((self.bits() >> Self::TRACEVER_SHIFT) & 0b1111) as u8
5922    }
5923
5924    /// Returns the value of the `PMUVer` field.
5925    pub const fn pmuver(self) -> u8 {
5926        ((self.bits() >> Self::PMUVER_SHIFT) & 0b1111) as u8
5927    }
5928
5929    /// Returns the value of the `BRPs` field.
5930    pub const fn brps(self) -> u8 {
5931        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
5932    }
5933
5934    /// Returns the value of the `PMSS` field.
5935    pub const fn pmss(self) -> u8 {
5936        ((self.bits() >> Self::PMSS_SHIFT) & 0b1111) as u8
5937    }
5938
5939    /// Returns the value of the `WRPs` field.
5940    pub const fn wrps(self) -> u8 {
5941        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
5942    }
5943
5944    /// Returns the value of the `SEBEP` field.
5945    pub const fn sebep(self) -> u8 {
5946        ((self.bits() >> Self::SEBEP_SHIFT) & 0b1111) as u8
5947    }
5948
5949    /// Returns the value of the `CTX_CMPs` field.
5950    pub const fn ctx_cmps(self) -> u8 {
5951        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
5952    }
5953
5954    /// Returns the value of the `PMSVer` field.
5955    pub const fn pmsver(self) -> u8 {
5956        ((self.bits() >> Self::PMSVER_SHIFT) & 0b1111) as u8
5957    }
5958
5959    /// Returns the value of the `DoubleLock` field.
5960    pub const fn doublelock(self) -> u8 {
5961        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
5962    }
5963
5964    /// Returns the value of the `TraceFilt` field.
5965    pub const fn tracefilt(self) -> u8 {
5966        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
5967    }
5968
5969    /// Returns the value of the `TraceBuffer` field.
5970    pub const fn tracebuffer(self) -> u8 {
5971        ((self.bits() >> Self::TRACEBUFFER_SHIFT) & 0b1111) as u8
5972    }
5973
5974    /// Returns the value of the `MTPMU` field.
5975    pub const fn mtpmu(self) -> u8 {
5976        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
5977    }
5978
5979    /// Returns the value of the `BRBE` field.
5980    pub const fn brbe(self) -> u8 {
5981        ((self.bits() >> Self::BRBE_SHIFT) & 0b1111) as u8
5982    }
5983
5984    /// Returns the value of the `ExtTrcBuff` field.
5985    pub const fn exttrcbuff(self) -> u8 {
5986        ((self.bits() >> Self::EXTTRCBUFF_SHIFT) & 0b1111) as u8
5987    }
5988
5989    /// Returns the value of the `HPMN0` field.
5990    pub const fn hpmn0(self) -> u8 {
5991        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
5992    }
5993}
5994
5995#[cfg(feature = "el1")]
5996bitflags! {
5997    /// `ID_AA64DFR1_EL1` system register value.
5998    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
5999    #[repr(transparent)]
6000    pub struct IdAa64dfr1El1: u64 {
6001    }
6002}
6003
6004#[cfg(feature = "el1")]
6005impl IdAa64dfr1El1 {
6006    /// Offset of the `SYSPMUID` field.
6007    pub const SYSPMUID_SHIFT: u32 = 0;
6008    /// Mask for the `SYSPMUID` field.
6009    pub const SYSPMUID_MASK: u64 = 0b11111111;
6010    /// Offset of the `BRPs` field.
6011    pub const BRPS_SHIFT: u32 = 8;
6012    /// Mask for the `BRPs` field.
6013    pub const BRPS_MASK: u64 = 0b11111111;
6014    /// Offset of the `WRPs` field.
6015    pub const WRPS_SHIFT: u32 = 16;
6016    /// Mask for the `WRPs` field.
6017    pub const WRPS_MASK: u64 = 0b11111111;
6018    /// Offset of the `CTX_CMPs` field.
6019    pub const CTX_CMPS_SHIFT: u32 = 24;
6020    /// Mask for the `CTX_CMPs` field.
6021    pub const CTX_CMPS_MASK: u64 = 0b11111111;
6022    /// Offset of the `SPMU` field.
6023    pub const SPMU_SHIFT: u32 = 32;
6024    /// Mask for the `SPMU` field.
6025    pub const SPMU_MASK: u64 = 0b1111;
6026    /// Offset of the `PMICNTR` field.
6027    pub const PMICNTR_SHIFT: u32 = 36;
6028    /// Mask for the `PMICNTR` field.
6029    pub const PMICNTR_MASK: u64 = 0b1111;
6030    /// Offset of the `ABLE` field.
6031    pub const ABLE_SHIFT: u32 = 40;
6032    /// Mask for the `ABLE` field.
6033    pub const ABLE_MASK: u64 = 0b1111;
6034    /// Offset of the `ITE` field.
6035    pub const ITE_SHIFT: u32 = 44;
6036    /// Mask for the `ITE` field.
6037    pub const ITE_MASK: u64 = 0b1111;
6038    /// Offset of the `EBEP` field.
6039    pub const EBEP_SHIFT: u32 = 48;
6040    /// Mask for the `EBEP` field.
6041    pub const EBEP_MASK: u64 = 0b1111;
6042    /// Offset of the `DPFZS` field.
6043    pub const DPFZS_SHIFT: u32 = 52;
6044    /// Mask for the `DPFZS` field.
6045    pub const DPFZS_MASK: u64 = 0b1111;
6046    /// Offset of the `ABL_CMPs` field.
6047    pub const ABL_CMPS_SHIFT: u32 = 56;
6048    /// Mask for the `ABL_CMPs` field.
6049    pub const ABL_CMPS_MASK: u64 = 0b11111111;
6050
6051    /// Returns the value of the `SYSPMUID` field.
6052    pub const fn syspmuid(self) -> u8 {
6053        ((self.bits() >> Self::SYSPMUID_SHIFT) & 0b11111111) as u8
6054    }
6055
6056    /// Returns the value of the `BRPs` field.
6057    pub const fn brps(self) -> u8 {
6058        ((self.bits() >> Self::BRPS_SHIFT) & 0b11111111) as u8
6059    }
6060
6061    /// Returns the value of the `WRPs` field.
6062    pub const fn wrps(self) -> u8 {
6063        ((self.bits() >> Self::WRPS_SHIFT) & 0b11111111) as u8
6064    }
6065
6066    /// Returns the value of the `CTX_CMPs` field.
6067    pub const fn ctx_cmps(self) -> u8 {
6068        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b11111111) as u8
6069    }
6070
6071    /// Returns the value of the `SPMU` field.
6072    pub const fn spmu(self) -> u8 {
6073        ((self.bits() >> Self::SPMU_SHIFT) & 0b1111) as u8
6074    }
6075
6076    /// Returns the value of the `PMICNTR` field.
6077    pub const fn pmicntr(self) -> u8 {
6078        ((self.bits() >> Self::PMICNTR_SHIFT) & 0b1111) as u8
6079    }
6080
6081    /// Returns the value of the `ABLE` field.
6082    pub const fn able(self) -> u8 {
6083        ((self.bits() >> Self::ABLE_SHIFT) & 0b1111) as u8
6084    }
6085
6086    /// Returns the value of the `ITE` field.
6087    pub const fn ite(self) -> u8 {
6088        ((self.bits() >> Self::ITE_SHIFT) & 0b1111) as u8
6089    }
6090
6091    /// Returns the value of the `EBEP` field.
6092    pub const fn ebep(self) -> u8 {
6093        ((self.bits() >> Self::EBEP_SHIFT) & 0b1111) as u8
6094    }
6095
6096    /// Returns the value of the `DPFZS` field.
6097    pub const fn dpfzs(self) -> u8 {
6098        ((self.bits() >> Self::DPFZS_SHIFT) & 0b1111) as u8
6099    }
6100
6101    /// Returns the value of the `ABL_CMPs` field.
6102    pub const fn abl_cmps(self) -> u8 {
6103        ((self.bits() >> Self::ABL_CMPS_SHIFT) & 0b11111111) as u8
6104    }
6105}
6106
6107#[cfg(feature = "el1")]
6108bitflags! {
6109    /// `ID_AA64ISAR1_EL1` system register value.
6110    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
6111    #[repr(transparent)]
6112    pub struct IdAa64isar1El1: u64 {
6113    }
6114}
6115
6116#[cfg(feature = "el1")]
6117impl IdAa64isar1El1 {
6118    /// Offset of the `DPB` field.
6119    pub const DPB_SHIFT: u32 = 0;
6120    /// Mask for the `DPB` field.
6121    pub const DPB_MASK: u64 = 0b1111;
6122    /// Offset of the `APA` field.
6123    pub const APA_SHIFT: u32 = 4;
6124    /// Mask for the `APA` field.
6125    pub const APA_MASK: u64 = 0b1111;
6126    /// Offset of the `API` field.
6127    pub const API_SHIFT: u32 = 8;
6128    /// Mask for the `API` field.
6129    pub const API_MASK: u64 = 0b1111;
6130    /// Offset of the `JSCVT` field.
6131    pub const JSCVT_SHIFT: u32 = 12;
6132    /// Mask for the `JSCVT` field.
6133    pub const JSCVT_MASK: u64 = 0b1111;
6134    /// Offset of the `FCMA` field.
6135    pub const FCMA_SHIFT: u32 = 16;
6136    /// Mask for the `FCMA` field.
6137    pub const FCMA_MASK: u64 = 0b1111;
6138    /// Offset of the `LRCPC` field.
6139    pub const LRCPC_SHIFT: u32 = 20;
6140    /// Mask for the `LRCPC` field.
6141    pub const LRCPC_MASK: u64 = 0b1111;
6142    /// Offset of the `GPA` field.
6143    pub const GPA_SHIFT: u32 = 24;
6144    /// Mask for the `GPA` field.
6145    pub const GPA_MASK: u64 = 0b1111;
6146    /// Offset of the `GPI` field.
6147    pub const GPI_SHIFT: u32 = 28;
6148    /// Mask for the `GPI` field.
6149    pub const GPI_MASK: u64 = 0b1111;
6150    /// Offset of the `FRINTTS` field.
6151    pub const FRINTTS_SHIFT: u32 = 32;
6152    /// Mask for the `FRINTTS` field.
6153    pub const FRINTTS_MASK: u64 = 0b1111;
6154    /// Offset of the `SB` field.
6155    pub const SB_SHIFT: u32 = 36;
6156    /// Mask for the `SB` field.
6157    pub const SB_MASK: u64 = 0b1111;
6158    /// Offset of the `SPECRES` field.
6159    pub const SPECRES_SHIFT: u32 = 40;
6160    /// Mask for the `SPECRES` field.
6161    pub const SPECRES_MASK: u64 = 0b1111;
6162    /// Offset of the `BF16` field.
6163    pub const BF16_SHIFT: u32 = 44;
6164    /// Mask for the `BF16` field.
6165    pub const BF16_MASK: u64 = 0b1111;
6166    /// Offset of the `DGH` field.
6167    pub const DGH_SHIFT: u32 = 48;
6168    /// Mask for the `DGH` field.
6169    pub const DGH_MASK: u64 = 0b1111;
6170    /// Offset of the `I8MM` field.
6171    pub const I8MM_SHIFT: u32 = 52;
6172    /// Mask for the `I8MM` field.
6173    pub const I8MM_MASK: u64 = 0b1111;
6174    /// Offset of the `XS` field.
6175    pub const XS_SHIFT: u32 = 56;
6176    /// Mask for the `XS` field.
6177    pub const XS_MASK: u64 = 0b1111;
6178    /// Offset of the `LS64` field.
6179    pub const LS64_SHIFT: u32 = 60;
6180    /// Mask for the `LS64` field.
6181    pub const LS64_MASK: u64 = 0b1111;
6182
6183    /// Returns the value of the `DPB` field.
6184    pub const fn dpb(self) -> u8 {
6185        ((self.bits() >> Self::DPB_SHIFT) & 0b1111) as u8
6186    }
6187
6188    /// Returns the value of the `APA` field.
6189    pub const fn apa(self) -> u8 {
6190        ((self.bits() >> Self::APA_SHIFT) & 0b1111) as u8
6191    }
6192
6193    /// Returns the value of the `API` field.
6194    pub const fn api(self) -> u8 {
6195        ((self.bits() >> Self::API_SHIFT) & 0b1111) as u8
6196    }
6197
6198    /// Returns the value of the `JSCVT` field.
6199    pub const fn jscvt(self) -> u8 {
6200        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
6201    }
6202
6203    /// Returns the value of the `FCMA` field.
6204    pub const fn fcma(self) -> u8 {
6205        ((self.bits() >> Self::FCMA_SHIFT) & 0b1111) as u8
6206    }
6207
6208    /// Returns the value of the `LRCPC` field.
6209    pub const fn lrcpc(self) -> u8 {
6210        ((self.bits() >> Self::LRCPC_SHIFT) & 0b1111) as u8
6211    }
6212
6213    /// Returns the value of the `GPA` field.
6214    pub const fn gpa(self) -> u8 {
6215        ((self.bits() >> Self::GPA_SHIFT) & 0b1111) as u8
6216    }
6217
6218    /// Returns the value of the `GPI` field.
6219    pub const fn gpi(self) -> u8 {
6220        ((self.bits() >> Self::GPI_SHIFT) & 0b1111) as u8
6221    }
6222
6223    /// Returns the value of the `FRINTTS` field.
6224    pub const fn frintts(self) -> u8 {
6225        ((self.bits() >> Self::FRINTTS_SHIFT) & 0b1111) as u8
6226    }
6227
6228    /// Returns the value of the `SB` field.
6229    pub const fn sb(self) -> u8 {
6230        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
6231    }
6232
6233    /// Returns the value of the `SPECRES` field.
6234    pub const fn specres(self) -> u8 {
6235        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
6236    }
6237
6238    /// Returns the value of the `BF16` field.
6239    pub const fn bf16(self) -> u8 {
6240        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
6241    }
6242
6243    /// Returns the value of the `DGH` field.
6244    pub const fn dgh(self) -> u8 {
6245        ((self.bits() >> Self::DGH_SHIFT) & 0b1111) as u8
6246    }
6247
6248    /// Returns the value of the `I8MM` field.
6249    pub const fn i8mm(self) -> u8 {
6250        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
6251    }
6252
6253    /// Returns the value of the `XS` field.
6254    pub const fn xs(self) -> u8 {
6255        ((self.bits() >> Self::XS_SHIFT) & 0b1111) as u8
6256    }
6257
6258    /// Returns the value of the `LS64` field.
6259    pub const fn ls64(self) -> u8 {
6260        ((self.bits() >> Self::LS64_SHIFT) & 0b1111) as u8
6261    }
6262}
6263
6264#[cfg(feature = "el1")]
6265bitflags! {
6266    /// `ID_AA64ISAR2_EL1` system register value.
6267    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
6268    #[repr(transparent)]
6269    pub struct IdAa64isar2El1: u64 {
6270    }
6271}
6272
6273#[cfg(feature = "el1")]
6274impl IdAa64isar2El1 {
6275    /// Offset of the `WFxT` field.
6276    pub const WFXT_SHIFT: u32 = 0;
6277    /// Mask for the `WFxT` field.
6278    pub const WFXT_MASK: u64 = 0b1111;
6279    /// Offset of the `RPRES` field.
6280    pub const RPRES_SHIFT: u32 = 4;
6281    /// Mask for the `RPRES` field.
6282    pub const RPRES_MASK: u64 = 0b1111;
6283    /// Offset of the `GPA3` field.
6284    pub const GPA3_SHIFT: u32 = 8;
6285    /// Mask for the `GPA3` field.
6286    pub const GPA3_MASK: u64 = 0b1111;
6287    /// Offset of the `APA3` field.
6288    pub const APA3_SHIFT: u32 = 12;
6289    /// Mask for the `APA3` field.
6290    pub const APA3_MASK: u64 = 0b1111;
6291    /// Offset of the `MOPS` field.
6292    pub const MOPS_SHIFT: u32 = 16;
6293    /// Mask for the `MOPS` field.
6294    pub const MOPS_MASK: u64 = 0b1111;
6295    /// Offset of the `BC` field.
6296    pub const BC_SHIFT: u32 = 20;
6297    /// Mask for the `BC` field.
6298    pub const BC_MASK: u64 = 0b1111;
6299    /// Offset of the `PAC_frac` field.
6300    pub const PAC_FRAC_SHIFT: u32 = 24;
6301    /// Mask for the `PAC_frac` field.
6302    pub const PAC_FRAC_MASK: u64 = 0b1111;
6303    /// Offset of the `CLRBHB` field.
6304    pub const CLRBHB_SHIFT: u32 = 28;
6305    /// Mask for the `CLRBHB` field.
6306    pub const CLRBHB_MASK: u64 = 0b1111;
6307    /// Offset of the `SYSREG_128` field.
6308    pub const SYSREG_128_SHIFT: u32 = 32;
6309    /// Mask for the `SYSREG_128` field.
6310    pub const SYSREG_128_MASK: u64 = 0b1111;
6311    /// Offset of the `SYSINSTR_128` field.
6312    pub const SYSINSTR_128_SHIFT: u32 = 36;
6313    /// Mask for the `SYSINSTR_128` field.
6314    pub const SYSINSTR_128_MASK: u64 = 0b1111;
6315    /// Offset of the `PRFMSLC` field.
6316    pub const PRFMSLC_SHIFT: u32 = 40;
6317    /// Mask for the `PRFMSLC` field.
6318    pub const PRFMSLC_MASK: u64 = 0b1111;
6319    /// Offset of the `PCDPHINT` field.
6320    pub const PCDPHINT_SHIFT: u32 = 44;
6321    /// Mask for the `PCDPHINT` field.
6322    pub const PCDPHINT_MASK: u64 = 0b1111;
6323    /// Offset of the `RPRFM` field.
6324    pub const RPRFM_SHIFT: u32 = 48;
6325    /// Mask for the `RPRFM` field.
6326    pub const RPRFM_MASK: u64 = 0b1111;
6327    /// Offset of the `CSSC` field.
6328    pub const CSSC_SHIFT: u32 = 52;
6329    /// Mask for the `CSSC` field.
6330    pub const CSSC_MASK: u64 = 0b1111;
6331    /// Offset of the `LUT` field.
6332    pub const LUT_SHIFT: u32 = 56;
6333    /// Mask for the `LUT` field.
6334    pub const LUT_MASK: u64 = 0b1111;
6335    /// Offset of the `ATS1A` field.
6336    pub const ATS1A_SHIFT: u32 = 60;
6337    /// Mask for the `ATS1A` field.
6338    pub const ATS1A_MASK: u64 = 0b1111;
6339
6340    /// Returns the value of the `WFxT` field.
6341    pub const fn wfxt(self) -> u8 {
6342        ((self.bits() >> Self::WFXT_SHIFT) & 0b1111) as u8
6343    }
6344
6345    /// Returns the value of the `RPRES` field.
6346    pub const fn rpres(self) -> u8 {
6347        ((self.bits() >> Self::RPRES_SHIFT) & 0b1111) as u8
6348    }
6349
6350    /// Returns the value of the `GPA3` field.
6351    pub const fn gpa3(self) -> u8 {
6352        ((self.bits() >> Self::GPA3_SHIFT) & 0b1111) as u8
6353    }
6354
6355    /// Returns the value of the `APA3` field.
6356    pub const fn apa3(self) -> u8 {
6357        ((self.bits() >> Self::APA3_SHIFT) & 0b1111) as u8
6358    }
6359
6360    /// Returns the value of the `MOPS` field.
6361    pub const fn mops(self) -> u8 {
6362        ((self.bits() >> Self::MOPS_SHIFT) & 0b1111) as u8
6363    }
6364
6365    /// Returns the value of the `BC` field.
6366    pub const fn bc(self) -> u8 {
6367        ((self.bits() >> Self::BC_SHIFT) & 0b1111) as u8
6368    }
6369
6370    /// Returns the value of the `PAC_frac` field.
6371    pub const fn pac_frac(self) -> u8 {
6372        ((self.bits() >> Self::PAC_FRAC_SHIFT) & 0b1111) as u8
6373    }
6374
6375    /// Returns the value of the `CLRBHB` field.
6376    pub const fn clrbhb(self) -> u8 {
6377        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
6378    }
6379
6380    /// Returns the value of the `SYSREG_128` field.
6381    pub const fn sysreg_128(self) -> u8 {
6382        ((self.bits() >> Self::SYSREG_128_SHIFT) & 0b1111) as u8
6383    }
6384
6385    /// Returns the value of the `SYSINSTR_128` field.
6386    pub const fn sysinstr_128(self) -> u8 {
6387        ((self.bits() >> Self::SYSINSTR_128_SHIFT) & 0b1111) as u8
6388    }
6389
6390    /// Returns the value of the `PRFMSLC` field.
6391    pub const fn prfmslc(self) -> u8 {
6392        ((self.bits() >> Self::PRFMSLC_SHIFT) & 0b1111) as u8
6393    }
6394
6395    /// Returns the value of the `PCDPHINT` field.
6396    pub const fn pcdphint(self) -> u8 {
6397        ((self.bits() >> Self::PCDPHINT_SHIFT) & 0b1111) as u8
6398    }
6399
6400    /// Returns the value of the `RPRFM` field.
6401    pub const fn rprfm(self) -> u8 {
6402        ((self.bits() >> Self::RPRFM_SHIFT) & 0b1111) as u8
6403    }
6404
6405    /// Returns the value of the `CSSC` field.
6406    pub const fn cssc(self) -> u8 {
6407        ((self.bits() >> Self::CSSC_SHIFT) & 0b1111) as u8
6408    }
6409
6410    /// Returns the value of the `LUT` field.
6411    pub const fn lut(self) -> u8 {
6412        ((self.bits() >> Self::LUT_SHIFT) & 0b1111) as u8
6413    }
6414
6415    /// Returns the value of the `ATS1A` field.
6416    pub const fn ats1a(self) -> u8 {
6417        ((self.bits() >> Self::ATS1A_SHIFT) & 0b1111) as u8
6418    }
6419}
6420
6421#[cfg(feature = "el1")]
6422bitflags! {
6423    /// `ID_AA64MMFR0_EL1` system register value.
6424    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
6425    #[repr(transparent)]
6426    pub struct IdAa64mmfr0El1: u64 {
6427    }
6428}
6429
6430#[cfg(feature = "el1")]
6431impl IdAa64mmfr0El1 {
6432    /// Offset of the `PARange` field.
6433    pub const PARANGE_SHIFT: u32 = 0;
6434    /// Mask for the `PARange` field.
6435    pub const PARANGE_MASK: u64 = 0b1111;
6436    /// Offset of the `ASIDBits` field.
6437    pub const ASIDBITS_SHIFT: u32 = 4;
6438    /// Mask for the `ASIDBits` field.
6439    pub const ASIDBITS_MASK: u64 = 0b1111;
6440    /// Offset of the `BigEnd` field.
6441    pub const BIGEND_SHIFT: u32 = 8;
6442    /// Mask for the `BigEnd` field.
6443    pub const BIGEND_MASK: u64 = 0b1111;
6444    /// Offset of the `SNSMem` field.
6445    pub const SNSMEM_SHIFT: u32 = 12;
6446    /// Mask for the `SNSMem` field.
6447    pub const SNSMEM_MASK: u64 = 0b1111;
6448    /// Offset of the `BigEndEL0` field.
6449    pub const BIGENDEL0_SHIFT: u32 = 16;
6450    /// Mask for the `BigEndEL0` field.
6451    pub const BIGENDEL0_MASK: u64 = 0b1111;
6452    /// Offset of the `TGran16` field.
6453    pub const TGRAN16_SHIFT: u32 = 20;
6454    /// Mask for the `TGran16` field.
6455    pub const TGRAN16_MASK: u64 = 0b1111;
6456    /// Offset of the `TGran64` field.
6457    pub const TGRAN64_SHIFT: u32 = 24;
6458    /// Mask for the `TGran64` field.
6459    pub const TGRAN64_MASK: u64 = 0b1111;
6460    /// Offset of the `TGran4` field.
6461    pub const TGRAN4_SHIFT: u32 = 28;
6462    /// Mask for the `TGran4` field.
6463    pub const TGRAN4_MASK: u64 = 0b1111;
6464    /// Offset of the `TGran16_2` field.
6465    pub const TGRAN16_2_SHIFT: u32 = 32;
6466    /// Mask for the `TGran16_2` field.
6467    pub const TGRAN16_2_MASK: u64 = 0b1111;
6468    /// Offset of the `TGran64_2` field.
6469    pub const TGRAN64_2_SHIFT: u32 = 36;
6470    /// Mask for the `TGran64_2` field.
6471    pub const TGRAN64_2_MASK: u64 = 0b1111;
6472    /// Offset of the `TGran4_2` field.
6473    pub const TGRAN4_2_SHIFT: u32 = 40;
6474    /// Mask for the `TGran4_2` field.
6475    pub const TGRAN4_2_MASK: u64 = 0b1111;
6476    /// Offset of the `ExS` field.
6477    pub const EXS_SHIFT: u32 = 44;
6478    /// Mask for the `ExS` field.
6479    pub const EXS_MASK: u64 = 0b1111;
6480    /// Offset of the `FGT` field.
6481    pub const FGT_SHIFT: u32 = 56;
6482    /// Mask for the `FGT` field.
6483    pub const FGT_MASK: u64 = 0b1111;
6484    /// Offset of the `ECV` field.
6485    pub const ECV_SHIFT: u32 = 60;
6486    /// Mask for the `ECV` field.
6487    pub const ECV_MASK: u64 = 0b1111;
6488
6489    /// Returns the value of the `PARange` field.
6490    pub const fn parange(self) -> u8 {
6491        ((self.bits() >> Self::PARANGE_SHIFT) & 0b1111) as u8
6492    }
6493
6494    /// Returns the value of the `ASIDBits` field.
6495    pub const fn asidbits(self) -> u8 {
6496        ((self.bits() >> Self::ASIDBITS_SHIFT) & 0b1111) as u8
6497    }
6498
6499    /// Returns the value of the `BigEnd` field.
6500    pub const fn bigend(self) -> u8 {
6501        ((self.bits() >> Self::BIGEND_SHIFT) & 0b1111) as u8
6502    }
6503
6504    /// Returns the value of the `SNSMem` field.
6505    pub const fn snsmem(self) -> u8 {
6506        ((self.bits() >> Self::SNSMEM_SHIFT) & 0b1111) as u8
6507    }
6508
6509    /// Returns the value of the `BigEndEL0` field.
6510    pub const fn bigendel0(self) -> u8 {
6511        ((self.bits() >> Self::BIGENDEL0_SHIFT) & 0b1111) as u8
6512    }
6513
6514    /// Returns the value of the `TGran16` field.
6515    pub const fn tgran16(self) -> u8 {
6516        ((self.bits() >> Self::TGRAN16_SHIFT) & 0b1111) as u8
6517    }
6518
6519    /// Returns the value of the `TGran64` field.
6520    pub const fn tgran64(self) -> u8 {
6521        ((self.bits() >> Self::TGRAN64_SHIFT) & 0b1111) as u8
6522    }
6523
6524    /// Returns the value of the `TGran4` field.
6525    pub const fn tgran4(self) -> u8 {
6526        ((self.bits() >> Self::TGRAN4_SHIFT) & 0b1111) as u8
6527    }
6528
6529    /// Returns the value of the `TGran16_2` field.
6530    pub const fn tgran16_2(self) -> u8 {
6531        ((self.bits() >> Self::TGRAN16_2_SHIFT) & 0b1111) as u8
6532    }
6533
6534    /// Returns the value of the `TGran64_2` field.
6535    pub const fn tgran64_2(self) -> u8 {
6536        ((self.bits() >> Self::TGRAN64_2_SHIFT) & 0b1111) as u8
6537    }
6538
6539    /// Returns the value of the `TGran4_2` field.
6540    pub const fn tgran4_2(self) -> u8 {
6541        ((self.bits() >> Self::TGRAN4_2_SHIFT) & 0b1111) as u8
6542    }
6543
6544    /// Returns the value of the `ExS` field.
6545    pub const fn exs(self) -> u8 {
6546        ((self.bits() >> Self::EXS_SHIFT) & 0b1111) as u8
6547    }
6548
6549    /// Returns the value of the `FGT` field.
6550    pub const fn fgt(self) -> u8 {
6551        ((self.bits() >> Self::FGT_SHIFT) & 0b1111) as u8
6552    }
6553
6554    /// Returns the value of the `ECV` field.
6555    pub const fn ecv(self) -> u8 {
6556        ((self.bits() >> Self::ECV_SHIFT) & 0b1111) as u8
6557    }
6558}
6559
6560#[cfg(feature = "el1")]
6561bitflags! {
6562    /// `ID_AA64MMFR1_EL1` system register value.
6563    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
6564    #[repr(transparent)]
6565    pub struct IdAa64mmfr1El1: u64 {
6566    }
6567}
6568
6569#[cfg(feature = "el1")]
6570impl IdAa64mmfr1El1 {
6571    /// Offset of the `HAFDBS` field.
6572    pub const HAFDBS_SHIFT: u32 = 0;
6573    /// Mask for the `HAFDBS` field.
6574    pub const HAFDBS_MASK: u64 = 0b1111;
6575    /// Offset of the `VMIDBits` field.
6576    pub const VMIDBITS_SHIFT: u32 = 4;
6577    /// Mask for the `VMIDBits` field.
6578    pub const VMIDBITS_MASK: u64 = 0b1111;
6579    /// Offset of the `VH` field.
6580    pub const VH_SHIFT: u32 = 8;
6581    /// Mask for the `VH` field.
6582    pub const VH_MASK: u64 = 0b1111;
6583    /// Offset of the `HPDS` field.
6584    pub const HPDS_SHIFT: u32 = 12;
6585    /// Mask for the `HPDS` field.
6586    pub const HPDS_MASK: u64 = 0b1111;
6587    /// Offset of the `LO` field.
6588    pub const LO_SHIFT: u32 = 16;
6589    /// Mask for the `LO` field.
6590    pub const LO_MASK: u64 = 0b1111;
6591    /// Offset of the `PAN` field.
6592    pub const PAN_SHIFT: u32 = 20;
6593    /// Mask for the `PAN` field.
6594    pub const PAN_MASK: u64 = 0b1111;
6595    /// Offset of the `SpecSEI` field.
6596    pub const SPECSEI_SHIFT: u32 = 24;
6597    /// Mask for the `SpecSEI` field.
6598    pub const SPECSEI_MASK: u64 = 0b1111;
6599    /// Offset of the `XNX` field.
6600    pub const XNX_SHIFT: u32 = 28;
6601    /// Mask for the `XNX` field.
6602    pub const XNX_MASK: u64 = 0b1111;
6603    /// Offset of the `TWED` field.
6604    pub const TWED_SHIFT: u32 = 32;
6605    /// Mask for the `TWED` field.
6606    pub const TWED_MASK: u64 = 0b1111;
6607    /// Offset of the `ETS` field.
6608    pub const ETS_SHIFT: u32 = 36;
6609    /// Mask for the `ETS` field.
6610    pub const ETS_MASK: u64 = 0b1111;
6611    /// Offset of the `HCX` field.
6612    pub const HCX_SHIFT: u32 = 40;
6613    /// Mask for the `HCX` field.
6614    pub const HCX_MASK: u64 = 0b1111;
6615    /// Offset of the `AFP` field.
6616    pub const AFP_SHIFT: u32 = 44;
6617    /// Mask for the `AFP` field.
6618    pub const AFP_MASK: u64 = 0b1111;
6619    /// Offset of the `nTLBPA` field.
6620    pub const NTLBPA_SHIFT: u32 = 48;
6621    /// Mask for the `nTLBPA` field.
6622    pub const NTLBPA_MASK: u64 = 0b1111;
6623    /// Offset of the `TIDCP1` field.
6624    pub const TIDCP1_SHIFT: u32 = 52;
6625    /// Mask for the `TIDCP1` field.
6626    pub const TIDCP1_MASK: u64 = 0b1111;
6627    /// Offset of the `CMOW` field.
6628    pub const CMOW_SHIFT: u32 = 56;
6629    /// Mask for the `CMOW` field.
6630    pub const CMOW_MASK: u64 = 0b1111;
6631    /// Offset of the `ECBHB` field.
6632    pub const ECBHB_SHIFT: u32 = 60;
6633    /// Mask for the `ECBHB` field.
6634    pub const ECBHB_MASK: u64 = 0b1111;
6635
6636    /// Returns the value of the `HAFDBS` field.
6637    pub const fn hafdbs(self) -> u8 {
6638        ((self.bits() >> Self::HAFDBS_SHIFT) & 0b1111) as u8
6639    }
6640
6641    /// Returns the value of the `VMIDBits` field.
6642    pub const fn vmidbits(self) -> u8 {
6643        ((self.bits() >> Self::VMIDBITS_SHIFT) & 0b1111) as u8
6644    }
6645
6646    /// Returns the value of the `VH` field.
6647    pub const fn vh(self) -> u8 {
6648        ((self.bits() >> Self::VH_SHIFT) & 0b1111) as u8
6649    }
6650
6651    /// Returns the value of the `HPDS` field.
6652    pub const fn hpds(self) -> u8 {
6653        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
6654    }
6655
6656    /// Returns the value of the `LO` field.
6657    pub const fn lo(self) -> u8 {
6658        ((self.bits() >> Self::LO_SHIFT) & 0b1111) as u8
6659    }
6660
6661    /// Returns the value of the `PAN` field.
6662    pub const fn pan(self) -> u8 {
6663        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
6664    }
6665
6666    /// Returns the value of the `SpecSEI` field.
6667    pub const fn specsei(self) -> u8 {
6668        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
6669    }
6670
6671    /// Returns the value of the `XNX` field.
6672    pub const fn xnx(self) -> u8 {
6673        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
6674    }
6675
6676    /// Returns the value of the `TWED` field.
6677    pub const fn twed(self) -> u8 {
6678        ((self.bits() >> Self::TWED_SHIFT) & 0b1111) as u8
6679    }
6680
6681    /// Returns the value of the `ETS` field.
6682    pub const fn ets(self) -> u8 {
6683        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
6684    }
6685
6686    /// Returns the value of the `HCX` field.
6687    pub const fn hcx(self) -> u8 {
6688        ((self.bits() >> Self::HCX_SHIFT) & 0b1111) as u8
6689    }
6690
6691    /// Returns the value of the `AFP` field.
6692    pub const fn afp(self) -> u8 {
6693        ((self.bits() >> Self::AFP_SHIFT) & 0b1111) as u8
6694    }
6695
6696    /// Returns the value of the `nTLBPA` field.
6697    pub const fn ntlbpa(self) -> u8 {
6698        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
6699    }
6700
6701    /// Returns the value of the `TIDCP1` field.
6702    pub const fn tidcp1(self) -> u8 {
6703        ((self.bits() >> Self::TIDCP1_SHIFT) & 0b1111) as u8
6704    }
6705
6706    /// Returns the value of the `CMOW` field.
6707    pub const fn cmow(self) -> u8 {
6708        ((self.bits() >> Self::CMOW_SHIFT) & 0b1111) as u8
6709    }
6710
6711    /// Returns the value of the `ECBHB` field.
6712    pub const fn ecbhb(self) -> u8 {
6713        ((self.bits() >> Self::ECBHB_SHIFT) & 0b1111) as u8
6714    }
6715}
6716
6717#[cfg(feature = "el1")]
6718bitflags! {
6719    /// `ID_AA64MMFR2_EL1` system register value.
6720    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
6721    #[repr(transparent)]
6722    pub struct IdAa64mmfr2El1: u64 {
6723    }
6724}
6725
6726#[cfg(feature = "el1")]
6727impl IdAa64mmfr2El1 {
6728    /// Offset of the `CnP` field.
6729    pub const CNP_SHIFT: u32 = 0;
6730    /// Mask for the `CnP` field.
6731    pub const CNP_MASK: u64 = 0b1111;
6732    /// Offset of the `UAO` field.
6733    pub const UAO_SHIFT: u32 = 4;
6734    /// Mask for the `UAO` field.
6735    pub const UAO_MASK: u64 = 0b1111;
6736    /// Offset of the `LSM` field.
6737    pub const LSM_SHIFT: u32 = 8;
6738    /// Mask for the `LSM` field.
6739    pub const LSM_MASK: u64 = 0b1111;
6740    /// Offset of the `IESB` field.
6741    pub const IESB_SHIFT: u32 = 12;
6742    /// Mask for the `IESB` field.
6743    pub const IESB_MASK: u64 = 0b1111;
6744    /// Offset of the `VARange` field.
6745    pub const VARANGE_SHIFT: u32 = 16;
6746    /// Mask for the `VARange` field.
6747    pub const VARANGE_MASK: u64 = 0b1111;
6748    /// Offset of the `CCIDX` field.
6749    pub const CCIDX_SHIFT: u32 = 20;
6750    /// Mask for the `CCIDX` field.
6751    pub const CCIDX_MASK: u64 = 0b1111;
6752    /// Offset of the `NV` field.
6753    pub const NV_SHIFT: u32 = 24;
6754    /// Mask for the `NV` field.
6755    pub const NV_MASK: u64 = 0b1111;
6756    /// Offset of the `ST` field.
6757    pub const ST_SHIFT: u32 = 28;
6758    /// Mask for the `ST` field.
6759    pub const ST_MASK: u64 = 0b1111;
6760    /// Offset of the `AT` field.
6761    pub const AT_SHIFT: u32 = 32;
6762    /// Mask for the `AT` field.
6763    pub const AT_MASK: u64 = 0b1111;
6764    /// Offset of the `IDS` field.
6765    pub const IDS_SHIFT: u32 = 36;
6766    /// Mask for the `IDS` field.
6767    pub const IDS_MASK: u64 = 0b1111;
6768    /// Offset of the `FWB` field.
6769    pub const FWB_SHIFT: u32 = 40;
6770    /// Mask for the `FWB` field.
6771    pub const FWB_MASK: u64 = 0b1111;
6772    /// Offset of the `TTL` field.
6773    pub const TTL_SHIFT: u32 = 48;
6774    /// Mask for the `TTL` field.
6775    pub const TTL_MASK: u64 = 0b1111;
6776    /// Offset of the `BBM` field.
6777    pub const BBM_SHIFT: u32 = 52;
6778    /// Mask for the `BBM` field.
6779    pub const BBM_MASK: u64 = 0b1111;
6780    /// Offset of the `EVT` field.
6781    pub const EVT_SHIFT: u32 = 56;
6782    /// Mask for the `EVT` field.
6783    pub const EVT_MASK: u64 = 0b1111;
6784    /// Offset of the `E0PD` field.
6785    pub const E0PD_SHIFT: u32 = 60;
6786    /// Mask for the `E0PD` field.
6787    pub const E0PD_MASK: u64 = 0b1111;
6788
6789    /// Returns the value of the `CnP` field.
6790    pub const fn cnp(self) -> u8 {
6791        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
6792    }
6793
6794    /// Returns the value of the `UAO` field.
6795    pub const fn uao(self) -> u8 {
6796        ((self.bits() >> Self::UAO_SHIFT) & 0b1111) as u8
6797    }
6798
6799    /// Returns the value of the `LSM` field.
6800    pub const fn lsm(self) -> u8 {
6801        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
6802    }
6803
6804    /// Returns the value of the `IESB` field.
6805    pub const fn iesb(self) -> u8 {
6806        ((self.bits() >> Self::IESB_SHIFT) & 0b1111) as u8
6807    }
6808
6809    /// Returns the value of the `VARange` field.
6810    pub const fn varange(self) -> u8 {
6811        ((self.bits() >> Self::VARANGE_SHIFT) & 0b1111) as u8
6812    }
6813
6814    /// Returns the value of the `CCIDX` field.
6815    pub const fn ccidx(self) -> u8 {
6816        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
6817    }
6818
6819    /// Returns the value of the `NV` field.
6820    pub const fn nv(self) -> u8 {
6821        ((self.bits() >> Self::NV_SHIFT) & 0b1111) as u8
6822    }
6823
6824    /// Returns the value of the `ST` field.
6825    pub const fn st(self) -> u8 {
6826        ((self.bits() >> Self::ST_SHIFT) & 0b1111) as u8
6827    }
6828
6829    /// Returns the value of the `AT` field.
6830    pub const fn at(self) -> u8 {
6831        ((self.bits() >> Self::AT_SHIFT) & 0b1111) as u8
6832    }
6833
6834    /// Returns the value of the `IDS` field.
6835    pub const fn ids(self) -> u8 {
6836        ((self.bits() >> Self::IDS_SHIFT) & 0b1111) as u8
6837    }
6838
6839    /// Returns the value of the `FWB` field.
6840    pub const fn fwb(self) -> u8 {
6841        ((self.bits() >> Self::FWB_SHIFT) & 0b1111) as u8
6842    }
6843
6844    /// Returns the value of the `TTL` field.
6845    pub const fn ttl(self) -> u8 {
6846        ((self.bits() >> Self::TTL_SHIFT) & 0b1111) as u8
6847    }
6848
6849    /// Returns the value of the `BBM` field.
6850    pub const fn bbm(self) -> u8 {
6851        ((self.bits() >> Self::BBM_SHIFT) & 0b1111) as u8
6852    }
6853
6854    /// Returns the value of the `EVT` field.
6855    pub const fn evt(self) -> u8 {
6856        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
6857    }
6858
6859    /// Returns the value of the `E0PD` field.
6860    pub const fn e0pd(self) -> u8 {
6861        ((self.bits() >> Self::E0PD_SHIFT) & 0b1111) as u8
6862    }
6863}
6864
6865#[cfg(feature = "el1")]
6866bitflags! {
6867    /// `ID_AA64MMFR3_EL1` system register value.
6868    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
6869    #[repr(transparent)]
6870    pub struct IdAa64mmfr3El1: u64 {
6871    }
6872}
6873
6874#[cfg(feature = "el1")]
6875impl IdAa64mmfr3El1 {
6876    /// Offset of the `TCRX` field.
6877    pub const TCRX_SHIFT: u32 = 0;
6878    /// Mask for the `TCRX` field.
6879    pub const TCRX_MASK: u64 = 0b1111;
6880    /// Offset of the `SCTLRX` field.
6881    pub const SCTLRX_SHIFT: u32 = 4;
6882    /// Mask for the `SCTLRX` field.
6883    pub const SCTLRX_MASK: u64 = 0b1111;
6884    /// Offset of the `S1PIE` field.
6885    pub const S1PIE_SHIFT: u32 = 8;
6886    /// Mask for the `S1PIE` field.
6887    pub const S1PIE_MASK: u64 = 0b1111;
6888    /// Offset of the `S2PIE` field.
6889    pub const S2PIE_SHIFT: u32 = 12;
6890    /// Mask for the `S2PIE` field.
6891    pub const S2PIE_MASK: u64 = 0b1111;
6892    /// Offset of the `S1POE` field.
6893    pub const S1POE_SHIFT: u32 = 16;
6894    /// Mask for the `S1POE` field.
6895    pub const S1POE_MASK: u64 = 0b1111;
6896    /// Offset of the `S2POE` field.
6897    pub const S2POE_SHIFT: u32 = 20;
6898    /// Mask for the `S2POE` field.
6899    pub const S2POE_MASK: u64 = 0b1111;
6900    /// Offset of the `AIE` field.
6901    pub const AIE_SHIFT: u32 = 24;
6902    /// Mask for the `AIE` field.
6903    pub const AIE_MASK: u64 = 0b1111;
6904    /// Offset of the `MEC` field.
6905    pub const MEC_SHIFT: u32 = 28;
6906    /// Mask for the `MEC` field.
6907    pub const MEC_MASK: u64 = 0b1111;
6908    /// Offset of the `D128` field.
6909    pub const D128_SHIFT: u32 = 32;
6910    /// Mask for the `D128` field.
6911    pub const D128_MASK: u64 = 0b1111;
6912    /// Offset of the `D128_2` field.
6913    pub const D128_2_SHIFT: u32 = 36;
6914    /// Mask for the `D128_2` field.
6915    pub const D128_2_MASK: u64 = 0b1111;
6916    /// Offset of the `SNERR` field.
6917    pub const SNERR_SHIFT: u32 = 40;
6918    /// Mask for the `SNERR` field.
6919    pub const SNERR_MASK: u64 = 0b1111;
6920    /// Offset of the `ANERR` field.
6921    pub const ANERR_SHIFT: u32 = 44;
6922    /// Mask for the `ANERR` field.
6923    pub const ANERR_MASK: u64 = 0b1111;
6924    /// Offset of the `SDERR` field.
6925    pub const SDERR_SHIFT: u32 = 52;
6926    /// Mask for the `SDERR` field.
6927    pub const SDERR_MASK: u64 = 0b1111;
6928    /// Offset of the `ADERR` field.
6929    pub const ADERR_SHIFT: u32 = 56;
6930    /// Mask for the `ADERR` field.
6931    pub const ADERR_MASK: u64 = 0b1111;
6932    /// Offset of the `Spec_FPACC` field.
6933    pub const SPEC_FPACC_SHIFT: u32 = 60;
6934    /// Mask for the `Spec_FPACC` field.
6935    pub const SPEC_FPACC_MASK: u64 = 0b1111;
6936
6937    /// Returns the value of the `TCRX` field.
6938    pub const fn tcrx(self) -> u8 {
6939        ((self.bits() >> Self::TCRX_SHIFT) & 0b1111) as u8
6940    }
6941
6942    /// Returns the value of the `SCTLRX` field.
6943    pub const fn sctlrx(self) -> u8 {
6944        ((self.bits() >> Self::SCTLRX_SHIFT) & 0b1111) as u8
6945    }
6946
6947    /// Returns the value of the `S1PIE` field.
6948    pub const fn s1pie(self) -> u8 {
6949        ((self.bits() >> Self::S1PIE_SHIFT) & 0b1111) as u8
6950    }
6951
6952    /// Returns the value of the `S2PIE` field.
6953    pub const fn s2pie(self) -> u8 {
6954        ((self.bits() >> Self::S2PIE_SHIFT) & 0b1111) as u8
6955    }
6956
6957    /// Returns the value of the `S1POE` field.
6958    pub const fn s1poe(self) -> u8 {
6959        ((self.bits() >> Self::S1POE_SHIFT) & 0b1111) as u8
6960    }
6961
6962    /// Returns the value of the `S2POE` field.
6963    pub const fn s2poe(self) -> u8 {
6964        ((self.bits() >> Self::S2POE_SHIFT) & 0b1111) as u8
6965    }
6966
6967    /// Returns the value of the `AIE` field.
6968    pub const fn aie(self) -> u8 {
6969        ((self.bits() >> Self::AIE_SHIFT) & 0b1111) as u8
6970    }
6971
6972    /// Returns the value of the `MEC` field.
6973    pub const fn mec(self) -> u8 {
6974        ((self.bits() >> Self::MEC_SHIFT) & 0b1111) as u8
6975    }
6976
6977    /// Returns the value of the `D128` field.
6978    pub const fn d128(self) -> u8 {
6979        ((self.bits() >> Self::D128_SHIFT) & 0b1111) as u8
6980    }
6981
6982    /// Returns the value of the `D128_2` field.
6983    pub const fn d128_2(self) -> u8 {
6984        ((self.bits() >> Self::D128_2_SHIFT) & 0b1111) as u8
6985    }
6986
6987    /// Returns the value of the `SNERR` field.
6988    pub const fn snerr(self) -> u8 {
6989        ((self.bits() >> Self::SNERR_SHIFT) & 0b1111) as u8
6990    }
6991
6992    /// Returns the value of the `ANERR` field.
6993    pub const fn anerr(self) -> u8 {
6994        ((self.bits() >> Self::ANERR_SHIFT) & 0b1111) as u8
6995    }
6996
6997    /// Returns the value of the `SDERR` field.
6998    pub const fn sderr(self) -> u8 {
6999        ((self.bits() >> Self::SDERR_SHIFT) & 0b1111) as u8
7000    }
7001
7002    /// Returns the value of the `ADERR` field.
7003    pub const fn aderr(self) -> u8 {
7004        ((self.bits() >> Self::ADERR_SHIFT) & 0b1111) as u8
7005    }
7006
7007    /// Returns the value of the `Spec_FPACC` field.
7008    pub const fn spec_fpacc(self) -> u8 {
7009        ((self.bits() >> Self::SPEC_FPACC_SHIFT) & 0b1111) as u8
7010    }
7011}
7012
7013#[cfg(feature = "el1")]
7014bitflags! {
7015    /// `ID_AA64PFR0_EL1` system register value.
7016    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7017    #[repr(transparent)]
7018    pub struct IdAa64pfr0El1: u64 {
7019    }
7020}
7021
7022#[cfg(feature = "el1")]
7023impl IdAa64pfr0El1 {
7024    /// Offset of the `EL0` field.
7025    pub const EL0_SHIFT: u32 = 0;
7026    /// Mask for the `EL0` field.
7027    pub const EL0_MASK: u64 = 0b1111;
7028    /// Offset of the `EL1` field.
7029    pub const EL1_SHIFT: u32 = 4;
7030    /// Mask for the `EL1` field.
7031    pub const EL1_MASK: u64 = 0b1111;
7032    /// Offset of the `EL2` field.
7033    pub const EL2_SHIFT: u32 = 8;
7034    /// Mask for the `EL2` field.
7035    pub const EL2_MASK: u64 = 0b1111;
7036    /// Offset of the `EL3` field.
7037    pub const EL3_SHIFT: u32 = 12;
7038    /// Mask for the `EL3` field.
7039    pub const EL3_MASK: u64 = 0b1111;
7040    /// Offset of the `FP` field.
7041    pub const FP_SHIFT: u32 = 16;
7042    /// Mask for the `FP` field.
7043    pub const FP_MASK: u64 = 0b1111;
7044    /// Offset of the `AdvSIMD` field.
7045    pub const ADVSIMD_SHIFT: u32 = 20;
7046    /// Mask for the `AdvSIMD` field.
7047    pub const ADVSIMD_MASK: u64 = 0b1111;
7048    /// Offset of the `GIC` field.
7049    pub const GIC_SHIFT: u32 = 24;
7050    /// Mask for the `GIC` field.
7051    pub const GIC_MASK: u64 = 0b1111;
7052    /// Offset of the `RAS` field.
7053    pub const RAS_SHIFT: u32 = 28;
7054    /// Mask for the `RAS` field.
7055    pub const RAS_MASK: u64 = 0b1111;
7056    /// Offset of the `SVE` field.
7057    pub const SVE_SHIFT: u32 = 32;
7058    /// Mask for the `SVE` field.
7059    pub const SVE_MASK: u64 = 0b1111;
7060    /// Offset of the `SEL2` field.
7061    pub const SEL2_SHIFT: u32 = 36;
7062    /// Mask for the `SEL2` field.
7063    pub const SEL2_MASK: u64 = 0b1111;
7064    /// Offset of the `MPAM` field.
7065    pub const MPAM_SHIFT: u32 = 40;
7066    /// Mask for the `MPAM` field.
7067    pub const MPAM_MASK: u64 = 0b1111;
7068    /// Offset of the `AMU` field.
7069    pub const AMU_SHIFT: u32 = 44;
7070    /// Mask for the `AMU` field.
7071    pub const AMU_MASK: u64 = 0b1111;
7072    /// Offset of the `DIT` field.
7073    pub const DIT_SHIFT: u32 = 48;
7074    /// Mask for the `DIT` field.
7075    pub const DIT_MASK: u64 = 0b1111;
7076    /// Offset of the `RME` field.
7077    pub const RME_SHIFT: u32 = 52;
7078    /// Mask for the `RME` field.
7079    pub const RME_MASK: u64 = 0b1111;
7080    /// Offset of the `CSV2` field.
7081    pub const CSV2_SHIFT: u32 = 56;
7082    /// Mask for the `CSV2` field.
7083    pub const CSV2_MASK: u64 = 0b1111;
7084    /// Offset of the `CSV3` field.
7085    pub const CSV3_SHIFT: u32 = 60;
7086    /// Mask for the `CSV3` field.
7087    pub const CSV3_MASK: u64 = 0b1111;
7088
7089    /// Returns the value of the `EL0` field.
7090    pub const fn el0(self) -> u8 {
7091        ((self.bits() >> Self::EL0_SHIFT) & 0b1111) as u8
7092    }
7093
7094    /// Returns the value of the `EL1` field.
7095    pub const fn el1(self) -> u8 {
7096        ((self.bits() >> Self::EL1_SHIFT) & 0b1111) as u8
7097    }
7098
7099    /// Returns the value of the `EL2` field.
7100    pub const fn el2(self) -> u8 {
7101        ((self.bits() >> Self::EL2_SHIFT) & 0b1111) as u8
7102    }
7103
7104    /// Returns the value of the `EL3` field.
7105    pub const fn el3(self) -> u8 {
7106        ((self.bits() >> Self::EL3_SHIFT) & 0b1111) as u8
7107    }
7108
7109    /// Returns the value of the `FP` field.
7110    pub const fn fp(self) -> u8 {
7111        ((self.bits() >> Self::FP_SHIFT) & 0b1111) as u8
7112    }
7113
7114    /// Returns the value of the `AdvSIMD` field.
7115    pub const fn advsimd(self) -> u8 {
7116        ((self.bits() >> Self::ADVSIMD_SHIFT) & 0b1111) as u8
7117    }
7118
7119    /// Returns the value of the `GIC` field.
7120    pub const fn gic(self) -> u8 {
7121        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
7122    }
7123
7124    /// Returns the value of the `RAS` field.
7125    pub const fn ras(self) -> u8 {
7126        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
7127    }
7128
7129    /// Returns the value of the `SVE` field.
7130    pub const fn sve(self) -> u8 {
7131        ((self.bits() >> Self::SVE_SHIFT) & 0b1111) as u8
7132    }
7133
7134    /// Returns the value of the `SEL2` field.
7135    pub const fn sel2(self) -> u8 {
7136        ((self.bits() >> Self::SEL2_SHIFT) & 0b1111) as u8
7137    }
7138
7139    /// Returns the value of the `MPAM` field.
7140    pub const fn mpam(self) -> u8 {
7141        ((self.bits() >> Self::MPAM_SHIFT) & 0b1111) as u8
7142    }
7143
7144    /// Returns the value of the `AMU` field.
7145    pub const fn amu(self) -> u8 {
7146        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
7147    }
7148
7149    /// Returns the value of the `DIT` field.
7150    pub const fn dit(self) -> u8 {
7151        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
7152    }
7153
7154    /// Returns the value of the `RME` field.
7155    pub const fn rme(self) -> u8 {
7156        ((self.bits() >> Self::RME_SHIFT) & 0b1111) as u8
7157    }
7158
7159    /// Returns the value of the `CSV2` field.
7160    pub const fn csv2(self) -> u8 {
7161        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
7162    }
7163
7164    /// Returns the value of the `CSV3` field.
7165    pub const fn csv3(self) -> u8 {
7166        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
7167    }
7168}
7169
7170#[cfg(feature = "el1")]
7171bitflags! {
7172    /// `ID_AA64PFR1_EL1` system register value.
7173    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7174    #[repr(transparent)]
7175    pub struct IdAa64pfr1El1: u64 {
7176    }
7177}
7178
7179#[cfg(feature = "el1")]
7180impl IdAa64pfr1El1 {
7181    /// Offset of the `BT` field.
7182    pub const BT_SHIFT: u32 = 0;
7183    /// Mask for the `BT` field.
7184    pub const BT_MASK: u64 = 0b1111;
7185    /// Offset of the `SSBS` field.
7186    pub const SSBS_SHIFT: u32 = 4;
7187    /// Mask for the `SSBS` field.
7188    pub const SSBS_MASK: u64 = 0b1111;
7189    /// Offset of the `MTE` field.
7190    pub const MTE_SHIFT: u32 = 8;
7191    /// Mask for the `MTE` field.
7192    pub const MTE_MASK: u64 = 0b1111;
7193    /// Offset of the `RAS_frac` field.
7194    pub const RAS_FRAC_SHIFT: u32 = 12;
7195    /// Mask for the `RAS_frac` field.
7196    pub const RAS_FRAC_MASK: u64 = 0b1111;
7197    /// Offset of the `MPAM_frac` field.
7198    pub const MPAM_FRAC_SHIFT: u32 = 16;
7199    /// Mask for the `MPAM_frac` field.
7200    pub const MPAM_FRAC_MASK: u64 = 0b1111;
7201    /// Offset of the `SME` field.
7202    pub const SME_SHIFT: u32 = 24;
7203    /// Mask for the `SME` field.
7204    pub const SME_MASK: u64 = 0b1111;
7205    /// Offset of the `RNDR_trap` field.
7206    pub const RNDR_TRAP_SHIFT: u32 = 28;
7207    /// Mask for the `RNDR_trap` field.
7208    pub const RNDR_TRAP_MASK: u64 = 0b1111;
7209    /// Offset of the `CSV2_frac` field.
7210    pub const CSV2_FRAC_SHIFT: u32 = 32;
7211    /// Mask for the `CSV2_frac` field.
7212    pub const CSV2_FRAC_MASK: u64 = 0b1111;
7213    /// Offset of the `NMI` field.
7214    pub const NMI_SHIFT: u32 = 36;
7215    /// Mask for the `NMI` field.
7216    pub const NMI_MASK: u64 = 0b1111;
7217    /// Offset of the `MTE_frac` field.
7218    pub const MTE_FRAC_SHIFT: u32 = 40;
7219    /// Mask for the `MTE_frac` field.
7220    pub const MTE_FRAC_MASK: u64 = 0b1111;
7221    /// Offset of the `GCS` field.
7222    pub const GCS_SHIFT: u32 = 44;
7223    /// Mask for the `GCS` field.
7224    pub const GCS_MASK: u64 = 0b1111;
7225    /// Offset of the `THE` field.
7226    pub const THE_SHIFT: u32 = 48;
7227    /// Mask for the `THE` field.
7228    pub const THE_MASK: u64 = 0b1111;
7229    /// Offset of the `MTEX` field.
7230    pub const MTEX_SHIFT: u32 = 52;
7231    /// Mask for the `MTEX` field.
7232    pub const MTEX_MASK: u64 = 0b1111;
7233    /// Offset of the `DF2` field.
7234    pub const DF2_SHIFT: u32 = 56;
7235    /// Mask for the `DF2` field.
7236    pub const DF2_MASK: u64 = 0b1111;
7237    /// Offset of the `PFAR` field.
7238    pub const PFAR_SHIFT: u32 = 60;
7239    /// Mask for the `PFAR` field.
7240    pub const PFAR_MASK: u64 = 0b1111;
7241
7242    /// Returns the value of the `BT` field.
7243    pub const fn bt(self) -> u8 {
7244        ((self.bits() >> Self::BT_SHIFT) & 0b1111) as u8
7245    }
7246
7247    /// Returns the value of the `SSBS` field.
7248    pub const fn ssbs(self) -> u8 {
7249        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
7250    }
7251
7252    /// Returns the value of the `MTE` field.
7253    pub const fn mte(self) -> u8 {
7254        ((self.bits() >> Self::MTE_SHIFT) & 0b1111) as u8
7255    }
7256
7257    /// Returns the value of the `RAS_frac` field.
7258    pub const fn ras_frac(self) -> u8 {
7259        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
7260    }
7261
7262    /// Returns the value of the `MPAM_frac` field.
7263    pub const fn mpam_frac(self) -> u8 {
7264        ((self.bits() >> Self::MPAM_FRAC_SHIFT) & 0b1111) as u8
7265    }
7266
7267    /// Returns the value of the `SME` field.
7268    pub const fn sme(self) -> u8 {
7269        ((self.bits() >> Self::SME_SHIFT) & 0b1111) as u8
7270    }
7271
7272    /// Returns the value of the `RNDR_trap` field.
7273    pub const fn rndr_trap(self) -> u8 {
7274        ((self.bits() >> Self::RNDR_TRAP_SHIFT) & 0b1111) as u8
7275    }
7276
7277    /// Returns the value of the `CSV2_frac` field.
7278    pub const fn csv2_frac(self) -> u8 {
7279        ((self.bits() >> Self::CSV2_FRAC_SHIFT) & 0b1111) as u8
7280    }
7281
7282    /// Returns the value of the `NMI` field.
7283    pub const fn nmi(self) -> u8 {
7284        ((self.bits() >> Self::NMI_SHIFT) & 0b1111) as u8
7285    }
7286
7287    /// Returns the value of the `MTE_frac` field.
7288    pub const fn mte_frac(self) -> u8 {
7289        ((self.bits() >> Self::MTE_FRAC_SHIFT) & 0b1111) as u8
7290    }
7291
7292    /// Returns the value of the `GCS` field.
7293    pub const fn gcs(self) -> u8 {
7294        ((self.bits() >> Self::GCS_SHIFT) & 0b1111) as u8
7295    }
7296
7297    /// Returns the value of the `THE` field.
7298    pub const fn the(self) -> u8 {
7299        ((self.bits() >> Self::THE_SHIFT) & 0b1111) as u8
7300    }
7301
7302    /// Returns the value of the `MTEX` field.
7303    pub const fn mtex(self) -> u8 {
7304        ((self.bits() >> Self::MTEX_SHIFT) & 0b1111) as u8
7305    }
7306
7307    /// Returns the value of the `DF2` field.
7308    pub const fn df2(self) -> u8 {
7309        ((self.bits() >> Self::DF2_SHIFT) & 0b1111) as u8
7310    }
7311
7312    /// Returns the value of the `PFAR` field.
7313    pub const fn pfar(self) -> u8 {
7314        ((self.bits() >> Self::PFAR_SHIFT) & 0b1111) as u8
7315    }
7316}
7317
7318#[cfg(feature = "el1")]
7319bitflags! {
7320    /// `ID_AA64SMFR0_EL1` system register value.
7321    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7322    #[repr(transparent)]
7323    pub struct IdAa64smfr0El1: u64 {
7324        /// `SMOP4` bit.
7325        const SMOP4 = 1 << 0;
7326        /// `STMOP` bit.
7327        const STMOP = 1 << 16;
7328        /// `SFEXPA` bit.
7329        const SFEXPA = 1 << 23;
7330        /// `AES` bit.
7331        const AES = 1 << 24;
7332        /// `SBitPerm` bit.
7333        const SBITPERM = 1 << 25;
7334        /// `SF8DP2` bit.
7335        const SF8DP2 = 1 << 28;
7336        /// `SF8DP4` bit.
7337        const SF8DP4 = 1 << 29;
7338        /// `SF8FMA` bit.
7339        const SF8FMA = 1 << 30;
7340        /// `F32F32` bit.
7341        const F32F32 = 1 << 32;
7342        /// `BI32I32` bit.
7343        const BI32I32 = 1 << 33;
7344        /// `B16F32` bit.
7345        const B16F32 = 1 << 34;
7346        /// `F16F32` bit.
7347        const F16F32 = 1 << 35;
7348        /// `F8F32` bit.
7349        const F8F32 = 1 << 40;
7350        /// `F8F16` bit.
7351        const F8F16 = 1 << 41;
7352        /// `F16F16` bit.
7353        const F16F16 = 1 << 42;
7354        /// `B16B16` bit.
7355        const B16B16 = 1 << 43;
7356        /// `F64F64` bit.
7357        const F64F64 = 1 << 48;
7358        /// `LUTv2` bit.
7359        const LUTV2 = 1 << 60;
7360        /// `LUT6` bit.
7361        const LUT6 = 1 << 61;
7362        /// `FA64` bit.
7363        const FA64 = 1 << 63;
7364    }
7365}
7366
7367#[cfg(feature = "el1")]
7368impl IdAa64smfr0El1 {
7369    /// Offset of the `SMOP4` field.
7370    pub const SMOP4_SHIFT: u32 = 0;
7371    /// Offset of the `STMOP` field.
7372    pub const STMOP_SHIFT: u32 = 16;
7373    /// Offset of the `SFEXPA` field.
7374    pub const SFEXPA_SHIFT: u32 = 23;
7375    /// Offset of the `AES` field.
7376    pub const AES_SHIFT: u32 = 24;
7377    /// Offset of the `SBitPerm` field.
7378    pub const SBITPERM_SHIFT: u32 = 25;
7379    /// Offset of the `SF8DP2` field.
7380    pub const SF8DP2_SHIFT: u32 = 28;
7381    /// Offset of the `SF8DP4` field.
7382    pub const SF8DP4_SHIFT: u32 = 29;
7383    /// Offset of the `SF8FMA` field.
7384    pub const SF8FMA_SHIFT: u32 = 30;
7385    /// Offset of the `F32F32` field.
7386    pub const F32F32_SHIFT: u32 = 32;
7387    /// Offset of the `BI32I32` field.
7388    pub const BI32I32_SHIFT: u32 = 33;
7389    /// Offset of the `B16F32` field.
7390    pub const B16F32_SHIFT: u32 = 34;
7391    /// Offset of the `F16F32` field.
7392    pub const F16F32_SHIFT: u32 = 35;
7393    /// Offset of the `I8I32` field.
7394    pub const I8I32_SHIFT: u32 = 36;
7395    /// Mask for the `I8I32` field.
7396    pub const I8I32_MASK: u64 = 0b1111;
7397    /// Offset of the `F8F32` field.
7398    pub const F8F32_SHIFT: u32 = 40;
7399    /// Offset of the `F8F16` field.
7400    pub const F8F16_SHIFT: u32 = 41;
7401    /// Offset of the `F16F16` field.
7402    pub const F16F16_SHIFT: u32 = 42;
7403    /// Offset of the `B16B16` field.
7404    pub const B16B16_SHIFT: u32 = 43;
7405    /// Offset of the `I16I32` field.
7406    pub const I16I32_SHIFT: u32 = 44;
7407    /// Mask for the `I16I32` field.
7408    pub const I16I32_MASK: u64 = 0b1111;
7409    /// Offset of the `F64F64` field.
7410    pub const F64F64_SHIFT: u32 = 48;
7411    /// Offset of the `I16I64` field.
7412    pub const I16I64_SHIFT: u32 = 52;
7413    /// Mask for the `I16I64` field.
7414    pub const I16I64_MASK: u64 = 0b1111;
7415    /// Offset of the `SMEver` field.
7416    pub const SMEVER_SHIFT: u32 = 56;
7417    /// Mask for the `SMEver` field.
7418    pub const SMEVER_MASK: u64 = 0b1111;
7419    /// Offset of the `LUTv2` field.
7420    pub const LUTV2_SHIFT: u32 = 60;
7421    /// Offset of the `LUT6` field.
7422    pub const LUT6_SHIFT: u32 = 61;
7423    /// Offset of the `FA64` field.
7424    pub const FA64_SHIFT: u32 = 63;
7425
7426    /// Returns the value of the `I8I32` field.
7427    pub const fn i8i32(self) -> u8 {
7428        ((self.bits() >> Self::I8I32_SHIFT) & 0b1111) as u8
7429    }
7430
7431    /// Returns the value of the `I16I32` field.
7432    pub const fn i16i32(self) -> u8 {
7433        ((self.bits() >> Self::I16I32_SHIFT) & 0b1111) as u8
7434    }
7435
7436    /// Returns the value of the `I16I64` field.
7437    pub const fn i16i64(self) -> u8 {
7438        ((self.bits() >> Self::I16I64_SHIFT) & 0b1111) as u8
7439    }
7440
7441    /// Returns the value of the `SMEver` field.
7442    pub const fn smever(self) -> u8 {
7443        ((self.bits() >> Self::SMEVER_SHIFT) & 0b1111) as u8
7444    }
7445}
7446
7447bitflags! {
7448    /// `ID_DFR0` system register value.
7449    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7450    #[repr(transparent)]
7451    pub struct IdDfr0: u32 {
7452    }
7453}
7454
7455impl IdDfr0 {
7456    /// Offset of the `CopDbg` field.
7457    pub const COPDBG_SHIFT: u32 = 0;
7458    /// Mask for the `CopDbg` field.
7459    pub const COPDBG_MASK: u32 = 0b1111;
7460    /// Offset of the `CopSDbg` field.
7461    pub const COPSDBG_SHIFT: u32 = 4;
7462    /// Mask for the `CopSDbg` field.
7463    pub const COPSDBG_MASK: u32 = 0b1111;
7464    /// Offset of the `MMapDbg` field.
7465    pub const MMAPDBG_SHIFT: u32 = 8;
7466    /// Mask for the `MMapDbg` field.
7467    pub const MMAPDBG_MASK: u32 = 0b1111;
7468    /// Offset of the `CopTrc` field.
7469    pub const COPTRC_SHIFT: u32 = 12;
7470    /// Mask for the `CopTrc` field.
7471    pub const COPTRC_MASK: u32 = 0b1111;
7472    /// Offset of the `MMapTrc` field.
7473    pub const MMAPTRC_SHIFT: u32 = 16;
7474    /// Mask for the `MMapTrc` field.
7475    pub const MMAPTRC_MASK: u32 = 0b1111;
7476    /// Offset of the `MProfDbg` field.
7477    pub const MPROFDBG_SHIFT: u32 = 20;
7478    /// Mask for the `MProfDbg` field.
7479    pub const MPROFDBG_MASK: u32 = 0b1111;
7480    /// Offset of the `PerfMon` field.
7481    pub const PERFMON_SHIFT: u32 = 24;
7482    /// Mask for the `PerfMon` field.
7483    pub const PERFMON_MASK: u32 = 0b1111;
7484    /// Offset of the `TraceFilt` field.
7485    pub const TRACEFILT_SHIFT: u32 = 28;
7486    /// Mask for the `TraceFilt` field.
7487    pub const TRACEFILT_MASK: u32 = 0b1111;
7488
7489    /// Returns the value of the `CopDbg` field.
7490    pub const fn copdbg(self) -> u8 {
7491        ((self.bits() >> Self::COPDBG_SHIFT) & 0b1111) as u8
7492    }
7493
7494    /// Returns the value of the `CopSDbg` field.
7495    pub const fn copsdbg(self) -> u8 {
7496        ((self.bits() >> Self::COPSDBG_SHIFT) & 0b1111) as u8
7497    }
7498
7499    /// Returns the value of the `MMapDbg` field.
7500    pub const fn mmapdbg(self) -> u8 {
7501        ((self.bits() >> Self::MMAPDBG_SHIFT) & 0b1111) as u8
7502    }
7503
7504    /// Returns the value of the `CopTrc` field.
7505    pub const fn coptrc(self) -> u8 {
7506        ((self.bits() >> Self::COPTRC_SHIFT) & 0b1111) as u8
7507    }
7508
7509    /// Returns the value of the `MMapTrc` field.
7510    pub const fn mmaptrc(self) -> u8 {
7511        ((self.bits() >> Self::MMAPTRC_SHIFT) & 0b1111) as u8
7512    }
7513
7514    /// Returns the value of the `MProfDbg` field.
7515    pub const fn mprofdbg(self) -> u8 {
7516        ((self.bits() >> Self::MPROFDBG_SHIFT) & 0b1111) as u8
7517    }
7518
7519    /// Returns the value of the `PerfMon` field.
7520    pub const fn perfmon(self) -> u8 {
7521        ((self.bits() >> Self::PERFMON_SHIFT) & 0b1111) as u8
7522    }
7523
7524    /// Returns the value of the `TraceFilt` field.
7525    pub const fn tracefilt(self) -> u8 {
7526        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
7527    }
7528}
7529
7530bitflags! {
7531    /// `ID_DFR1` system register value.
7532    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7533    #[repr(transparent)]
7534    pub struct IdDfr1: u32 {
7535    }
7536}
7537
7538impl IdDfr1 {
7539    /// Offset of the `MTPMU` field.
7540    pub const MTPMU_SHIFT: u32 = 0;
7541    /// Mask for the `MTPMU` field.
7542    pub const MTPMU_MASK: u32 = 0b1111;
7543    /// Offset of the `HPMN0` field.
7544    pub const HPMN0_SHIFT: u32 = 4;
7545    /// Mask for the `HPMN0` field.
7546    pub const HPMN0_MASK: u32 = 0b1111;
7547
7548    /// Returns the value of the `MTPMU` field.
7549    pub const fn mtpmu(self) -> u8 {
7550        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
7551    }
7552
7553    /// Returns the value of the `HPMN0` field.
7554    pub const fn hpmn0(self) -> u8 {
7555        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
7556    }
7557}
7558
7559bitflags! {
7560    /// `ID_ISAR0` system register value.
7561    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7562    #[repr(transparent)]
7563    pub struct IdIsar0: u32 {
7564    }
7565}
7566
7567impl IdIsar0 {
7568    /// Offset of the `Swap` field.
7569    pub const SWAP_SHIFT: u32 = 0;
7570    /// Mask for the `Swap` field.
7571    pub const SWAP_MASK: u32 = 0b1111;
7572    /// Offset of the `BitCount` field.
7573    pub const BITCOUNT_SHIFT: u32 = 4;
7574    /// Mask for the `BitCount` field.
7575    pub const BITCOUNT_MASK: u32 = 0b1111;
7576    /// Offset of the `BitField` field.
7577    pub const BITFIELD_SHIFT: u32 = 8;
7578    /// Mask for the `BitField` field.
7579    pub const BITFIELD_MASK: u32 = 0b1111;
7580    /// Offset of the `CmpBranch` field.
7581    pub const CMPBRANCH_SHIFT: u32 = 12;
7582    /// Mask for the `CmpBranch` field.
7583    pub const CMPBRANCH_MASK: u32 = 0b1111;
7584    /// Offset of the `Coproc` field.
7585    pub const COPROC_SHIFT: u32 = 16;
7586    /// Mask for the `Coproc` field.
7587    pub const COPROC_MASK: u32 = 0b1111;
7588    /// Offset of the `Debug` field.
7589    pub const DEBUG_SHIFT: u32 = 20;
7590    /// Mask for the `Debug` field.
7591    pub const DEBUG_MASK: u32 = 0b1111;
7592    /// Offset of the `Divide` field.
7593    pub const DIVIDE_SHIFT: u32 = 24;
7594    /// Mask for the `Divide` field.
7595    pub const DIVIDE_MASK: u32 = 0b1111;
7596
7597    /// Returns the value of the `Swap` field.
7598    pub const fn swap(self) -> u8 {
7599        ((self.bits() >> Self::SWAP_SHIFT) & 0b1111) as u8
7600    }
7601
7602    /// Returns the value of the `BitCount` field.
7603    pub const fn bitcount(self) -> u8 {
7604        ((self.bits() >> Self::BITCOUNT_SHIFT) & 0b1111) as u8
7605    }
7606
7607    /// Returns the value of the `BitField` field.
7608    pub const fn bitfield(self) -> u8 {
7609        ((self.bits() >> Self::BITFIELD_SHIFT) & 0b1111) as u8
7610    }
7611
7612    /// Returns the value of the `CmpBranch` field.
7613    pub const fn cmpbranch(self) -> u8 {
7614        ((self.bits() >> Self::CMPBRANCH_SHIFT) & 0b1111) as u8
7615    }
7616
7617    /// Returns the value of the `Coproc` field.
7618    pub const fn coproc(self) -> u8 {
7619        ((self.bits() >> Self::COPROC_SHIFT) & 0b1111) as u8
7620    }
7621
7622    /// Returns the value of the `Debug` field.
7623    pub const fn debug(self) -> u8 {
7624        ((self.bits() >> Self::DEBUG_SHIFT) & 0b1111) as u8
7625    }
7626
7627    /// Returns the value of the `Divide` field.
7628    pub const fn divide(self) -> u8 {
7629        ((self.bits() >> Self::DIVIDE_SHIFT) & 0b1111) as u8
7630    }
7631}
7632
7633bitflags! {
7634    /// `ID_ISAR1` system register value.
7635    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7636    #[repr(transparent)]
7637    pub struct IdIsar1: u32 {
7638    }
7639}
7640
7641impl IdIsar1 {
7642    /// Offset of the `Endian` field.
7643    pub const ENDIAN_SHIFT: u32 = 0;
7644    /// Mask for the `Endian` field.
7645    pub const ENDIAN_MASK: u32 = 0b1111;
7646    /// Offset of the `Except` field.
7647    pub const EXCEPT_SHIFT: u32 = 4;
7648    /// Mask for the `Except` field.
7649    pub const EXCEPT_MASK: u32 = 0b1111;
7650    /// Offset of the `Except_AR` field.
7651    pub const EXCEPT_AR_SHIFT: u32 = 8;
7652    /// Mask for the `Except_AR` field.
7653    pub const EXCEPT_AR_MASK: u32 = 0b1111;
7654    /// Offset of the `Extend` field.
7655    pub const EXTEND_SHIFT: u32 = 12;
7656    /// Mask for the `Extend` field.
7657    pub const EXTEND_MASK: u32 = 0b1111;
7658    /// Offset of the `IfThen` field.
7659    pub const IFTHEN_SHIFT: u32 = 16;
7660    /// Mask for the `IfThen` field.
7661    pub const IFTHEN_MASK: u32 = 0b1111;
7662    /// Offset of the `Immediate` field.
7663    pub const IMMEDIATE_SHIFT: u32 = 20;
7664    /// Mask for the `Immediate` field.
7665    pub const IMMEDIATE_MASK: u32 = 0b1111;
7666    /// Offset of the `Interwork` field.
7667    pub const INTERWORK_SHIFT: u32 = 24;
7668    /// Mask for the `Interwork` field.
7669    pub const INTERWORK_MASK: u32 = 0b1111;
7670    /// Offset of the `Jazelle` field.
7671    pub const JAZELLE_SHIFT: u32 = 28;
7672    /// Mask for the `Jazelle` field.
7673    pub const JAZELLE_MASK: u32 = 0b1111;
7674
7675    /// Returns the value of the `Endian` field.
7676    pub const fn endian(self) -> u8 {
7677        ((self.bits() >> Self::ENDIAN_SHIFT) & 0b1111) as u8
7678    }
7679
7680    /// Returns the value of the `Except` field.
7681    pub const fn except(self) -> u8 {
7682        ((self.bits() >> Self::EXCEPT_SHIFT) & 0b1111) as u8
7683    }
7684
7685    /// Returns the value of the `Except_AR` field.
7686    pub const fn except_ar(self) -> u8 {
7687        ((self.bits() >> Self::EXCEPT_AR_SHIFT) & 0b1111) as u8
7688    }
7689
7690    /// Returns the value of the `Extend` field.
7691    pub const fn extend_(self) -> u8 {
7692        ((self.bits() >> Self::EXTEND_SHIFT) & 0b1111) as u8
7693    }
7694
7695    /// Returns the value of the `IfThen` field.
7696    pub const fn ifthen(self) -> u8 {
7697        ((self.bits() >> Self::IFTHEN_SHIFT) & 0b1111) as u8
7698    }
7699
7700    /// Returns the value of the `Immediate` field.
7701    pub const fn immediate(self) -> u8 {
7702        ((self.bits() >> Self::IMMEDIATE_SHIFT) & 0b1111) as u8
7703    }
7704
7705    /// Returns the value of the `Interwork` field.
7706    pub const fn interwork(self) -> u8 {
7707        ((self.bits() >> Self::INTERWORK_SHIFT) & 0b1111) as u8
7708    }
7709
7710    /// Returns the value of the `Jazelle` field.
7711    pub const fn jazelle(self) -> u8 {
7712        ((self.bits() >> Self::JAZELLE_SHIFT) & 0b1111) as u8
7713    }
7714}
7715
7716bitflags! {
7717    /// `ID_ISAR2` system register value.
7718    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7719    #[repr(transparent)]
7720    pub struct IdIsar2: u32 {
7721    }
7722}
7723
7724impl IdIsar2 {
7725    /// Offset of the `LoadStore` field.
7726    pub const LOADSTORE_SHIFT: u32 = 0;
7727    /// Mask for the `LoadStore` field.
7728    pub const LOADSTORE_MASK: u32 = 0b1111;
7729    /// Offset of the `MemHint` field.
7730    pub const MEMHINT_SHIFT: u32 = 4;
7731    /// Mask for the `MemHint` field.
7732    pub const MEMHINT_MASK: u32 = 0b1111;
7733    /// Offset of the `MultiAccessInt` field.
7734    pub const MULTIACCESSINT_SHIFT: u32 = 8;
7735    /// Mask for the `MultiAccessInt` field.
7736    pub const MULTIACCESSINT_MASK: u32 = 0b1111;
7737    /// Offset of the `Mult` field.
7738    pub const MULT_SHIFT: u32 = 12;
7739    /// Mask for the `Mult` field.
7740    pub const MULT_MASK: u32 = 0b1111;
7741    /// Offset of the `MultS` field.
7742    pub const MULTS_SHIFT: u32 = 16;
7743    /// Mask for the `MultS` field.
7744    pub const MULTS_MASK: u32 = 0b1111;
7745    /// Offset of the `MultU` field.
7746    pub const MULTU_SHIFT: u32 = 20;
7747    /// Mask for the `MultU` field.
7748    pub const MULTU_MASK: u32 = 0b1111;
7749    /// Offset of the `PSR_AR` field.
7750    pub const PSR_AR_SHIFT: u32 = 24;
7751    /// Mask for the `PSR_AR` field.
7752    pub const PSR_AR_MASK: u32 = 0b1111;
7753    /// Offset of the `Reversal` field.
7754    pub const REVERSAL_SHIFT: u32 = 28;
7755    /// Mask for the `Reversal` field.
7756    pub const REVERSAL_MASK: u32 = 0b1111;
7757
7758    /// Returns the value of the `LoadStore` field.
7759    pub const fn loadstore(self) -> u8 {
7760        ((self.bits() >> Self::LOADSTORE_SHIFT) & 0b1111) as u8
7761    }
7762
7763    /// Returns the value of the `MemHint` field.
7764    pub const fn memhint(self) -> u8 {
7765        ((self.bits() >> Self::MEMHINT_SHIFT) & 0b1111) as u8
7766    }
7767
7768    /// Returns the value of the `MultiAccessInt` field.
7769    pub const fn multiaccessint(self) -> u8 {
7770        ((self.bits() >> Self::MULTIACCESSINT_SHIFT) & 0b1111) as u8
7771    }
7772
7773    /// Returns the value of the `Mult` field.
7774    pub const fn mult(self) -> u8 {
7775        ((self.bits() >> Self::MULT_SHIFT) & 0b1111) as u8
7776    }
7777
7778    /// Returns the value of the `MultS` field.
7779    pub const fn mults(self) -> u8 {
7780        ((self.bits() >> Self::MULTS_SHIFT) & 0b1111) as u8
7781    }
7782
7783    /// Returns the value of the `MultU` field.
7784    pub const fn multu(self) -> u8 {
7785        ((self.bits() >> Self::MULTU_SHIFT) & 0b1111) as u8
7786    }
7787
7788    /// Returns the value of the `PSR_AR` field.
7789    pub const fn psr_ar(self) -> u8 {
7790        ((self.bits() >> Self::PSR_AR_SHIFT) & 0b1111) as u8
7791    }
7792
7793    /// Returns the value of the `Reversal` field.
7794    pub const fn reversal(self) -> u8 {
7795        ((self.bits() >> Self::REVERSAL_SHIFT) & 0b1111) as u8
7796    }
7797}
7798
7799bitflags! {
7800    /// `ID_ISAR3` system register value.
7801    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7802    #[repr(transparent)]
7803    pub struct IdIsar3: u32 {
7804    }
7805}
7806
7807impl IdIsar3 {
7808    /// Offset of the `Saturate` field.
7809    pub const SATURATE_SHIFT: u32 = 0;
7810    /// Mask for the `Saturate` field.
7811    pub const SATURATE_MASK: u32 = 0b1111;
7812    /// Offset of the `SIMD` field.
7813    pub const SIMD_SHIFT: u32 = 4;
7814    /// Mask for the `SIMD` field.
7815    pub const SIMD_MASK: u32 = 0b1111;
7816    /// Offset of the `SVC` field.
7817    pub const SVC_SHIFT: u32 = 8;
7818    /// Mask for the `SVC` field.
7819    pub const SVC_MASK: u32 = 0b1111;
7820    /// Offset of the `SynchPrim` field.
7821    pub const SYNCHPRIM_SHIFT: u32 = 12;
7822    /// Mask for the `SynchPrim` field.
7823    pub const SYNCHPRIM_MASK: u32 = 0b1111;
7824    /// Offset of the `TabBranch` field.
7825    pub const TABBRANCH_SHIFT: u32 = 16;
7826    /// Mask for the `TabBranch` field.
7827    pub const TABBRANCH_MASK: u32 = 0b1111;
7828    /// Offset of the `T32Copy` field.
7829    pub const T32COPY_SHIFT: u32 = 20;
7830    /// Mask for the `T32Copy` field.
7831    pub const T32COPY_MASK: u32 = 0b1111;
7832    /// Offset of the `TrueNOP` field.
7833    pub const TRUENOP_SHIFT: u32 = 24;
7834    /// Mask for the `TrueNOP` field.
7835    pub const TRUENOP_MASK: u32 = 0b1111;
7836    /// Offset of the `T32EE` field.
7837    pub const T32EE_SHIFT: u32 = 28;
7838    /// Mask for the `T32EE` field.
7839    pub const T32EE_MASK: u32 = 0b1111;
7840
7841    /// Returns the value of the `Saturate` field.
7842    pub const fn saturate(self) -> u8 {
7843        ((self.bits() >> Self::SATURATE_SHIFT) & 0b1111) as u8
7844    }
7845
7846    /// Returns the value of the `SIMD` field.
7847    pub const fn simd(self) -> u8 {
7848        ((self.bits() >> Self::SIMD_SHIFT) & 0b1111) as u8
7849    }
7850
7851    /// Returns the value of the `SVC` field.
7852    pub const fn svc(self) -> u8 {
7853        ((self.bits() >> Self::SVC_SHIFT) & 0b1111) as u8
7854    }
7855
7856    /// Returns the value of the `SynchPrim` field.
7857    pub const fn synchprim(self) -> u8 {
7858        ((self.bits() >> Self::SYNCHPRIM_SHIFT) & 0b1111) as u8
7859    }
7860
7861    /// Returns the value of the `TabBranch` field.
7862    pub const fn tabbranch(self) -> u8 {
7863        ((self.bits() >> Self::TABBRANCH_SHIFT) & 0b1111) as u8
7864    }
7865
7866    /// Returns the value of the `T32Copy` field.
7867    pub const fn t32copy(self) -> u8 {
7868        ((self.bits() >> Self::T32COPY_SHIFT) & 0b1111) as u8
7869    }
7870
7871    /// Returns the value of the `TrueNOP` field.
7872    pub const fn truenop(self) -> u8 {
7873        ((self.bits() >> Self::TRUENOP_SHIFT) & 0b1111) as u8
7874    }
7875
7876    /// Returns the value of the `T32EE` field.
7877    pub const fn t32ee(self) -> u8 {
7878        ((self.bits() >> Self::T32EE_SHIFT) & 0b1111) as u8
7879    }
7880}
7881
7882bitflags! {
7883    /// `ID_ISAR4` system register value.
7884    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7885    #[repr(transparent)]
7886    pub struct IdIsar4: u32 {
7887    }
7888}
7889
7890impl IdIsar4 {
7891    /// Offset of the `Unpriv` field.
7892    pub const UNPRIV_SHIFT: u32 = 0;
7893    /// Mask for the `Unpriv` field.
7894    pub const UNPRIV_MASK: u32 = 0b1111;
7895    /// Offset of the `WithShifts` field.
7896    pub const WITHSHIFTS_SHIFT: u32 = 4;
7897    /// Mask for the `WithShifts` field.
7898    pub const WITHSHIFTS_MASK: u32 = 0b1111;
7899    /// Offset of the `Writeback` field.
7900    pub const WRITEBACK_SHIFT: u32 = 8;
7901    /// Mask for the `Writeback` field.
7902    pub const WRITEBACK_MASK: u32 = 0b1111;
7903    /// Offset of the `SMC` field.
7904    pub const SMC_SHIFT: u32 = 12;
7905    /// Mask for the `SMC` field.
7906    pub const SMC_MASK: u32 = 0b1111;
7907    /// Offset of the `Barrier` field.
7908    pub const BARRIER_SHIFT: u32 = 16;
7909    /// Mask for the `Barrier` field.
7910    pub const BARRIER_MASK: u32 = 0b1111;
7911    /// Offset of the `SynchPrim_frac` field.
7912    pub const SYNCHPRIM_FRAC_SHIFT: u32 = 20;
7913    /// Mask for the `SynchPrim_frac` field.
7914    pub const SYNCHPRIM_FRAC_MASK: u32 = 0b1111;
7915    /// Offset of the `PSR_M` field.
7916    pub const PSR_M_SHIFT: u32 = 24;
7917    /// Mask for the `PSR_M` field.
7918    pub const PSR_M_MASK: u32 = 0b1111;
7919    /// Offset of the `SWP_frac` field.
7920    pub const SWP_FRAC_SHIFT: u32 = 28;
7921    /// Mask for the `SWP_frac` field.
7922    pub const SWP_FRAC_MASK: u32 = 0b1111;
7923
7924    /// Returns the value of the `Unpriv` field.
7925    pub const fn unpriv(self) -> u8 {
7926        ((self.bits() >> Self::UNPRIV_SHIFT) & 0b1111) as u8
7927    }
7928
7929    /// Returns the value of the `WithShifts` field.
7930    pub const fn withshifts(self) -> u8 {
7931        ((self.bits() >> Self::WITHSHIFTS_SHIFT) & 0b1111) as u8
7932    }
7933
7934    /// Returns the value of the `Writeback` field.
7935    pub const fn writeback(self) -> u8 {
7936        ((self.bits() >> Self::WRITEBACK_SHIFT) & 0b1111) as u8
7937    }
7938
7939    /// Returns the value of the `SMC` field.
7940    pub const fn smc(self) -> u8 {
7941        ((self.bits() >> Self::SMC_SHIFT) & 0b1111) as u8
7942    }
7943
7944    /// Returns the value of the `Barrier` field.
7945    pub const fn barrier(self) -> u8 {
7946        ((self.bits() >> Self::BARRIER_SHIFT) & 0b1111) as u8
7947    }
7948
7949    /// Returns the value of the `SynchPrim_frac` field.
7950    pub const fn synchprim_frac(self) -> u8 {
7951        ((self.bits() >> Self::SYNCHPRIM_FRAC_SHIFT) & 0b1111) as u8
7952    }
7953
7954    /// Returns the value of the `PSR_M` field.
7955    pub const fn psr_m(self) -> u8 {
7956        ((self.bits() >> Self::PSR_M_SHIFT) & 0b1111) as u8
7957    }
7958
7959    /// Returns the value of the `SWP_frac` field.
7960    pub const fn swp_frac(self) -> u8 {
7961        ((self.bits() >> Self::SWP_FRAC_SHIFT) & 0b1111) as u8
7962    }
7963}
7964
7965bitflags! {
7966    /// `ID_ISAR5` system register value.
7967    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
7968    #[repr(transparent)]
7969    pub struct IdIsar5: u32 {
7970    }
7971}
7972
7973impl IdIsar5 {
7974    /// Offset of the `SEVL` field.
7975    pub const SEVL_SHIFT: u32 = 0;
7976    /// Mask for the `SEVL` field.
7977    pub const SEVL_MASK: u32 = 0b1111;
7978    /// Offset of the `AES` field.
7979    pub const AES_SHIFT: u32 = 4;
7980    /// Mask for the `AES` field.
7981    pub const AES_MASK: u32 = 0b1111;
7982    /// Offset of the `SHA1` field.
7983    pub const SHA1_SHIFT: u32 = 8;
7984    /// Mask for the `SHA1` field.
7985    pub const SHA1_MASK: u32 = 0b1111;
7986    /// Offset of the `SHA2` field.
7987    pub const SHA2_SHIFT: u32 = 12;
7988    /// Mask for the `SHA2` field.
7989    pub const SHA2_MASK: u32 = 0b1111;
7990    /// Offset of the `CRC32` field.
7991    pub const CRC32_SHIFT: u32 = 16;
7992    /// Mask for the `CRC32` field.
7993    pub const CRC32_MASK: u32 = 0b1111;
7994    /// Offset of the `RDM` field.
7995    pub const RDM_SHIFT: u32 = 24;
7996    /// Mask for the `RDM` field.
7997    pub const RDM_MASK: u32 = 0b1111;
7998    /// Offset of the `VCMA` field.
7999    pub const VCMA_SHIFT: u32 = 28;
8000    /// Mask for the `VCMA` field.
8001    pub const VCMA_MASK: u32 = 0b1111;
8002
8003    /// Returns the value of the `SEVL` field.
8004    pub const fn sevl(self) -> u8 {
8005        ((self.bits() >> Self::SEVL_SHIFT) & 0b1111) as u8
8006    }
8007
8008    /// Returns the value of the `AES` field.
8009    pub const fn aes(self) -> u8 {
8010        ((self.bits() >> Self::AES_SHIFT) & 0b1111) as u8
8011    }
8012
8013    /// Returns the value of the `SHA1` field.
8014    pub const fn sha1(self) -> u8 {
8015        ((self.bits() >> Self::SHA1_SHIFT) & 0b1111) as u8
8016    }
8017
8018    /// Returns the value of the `SHA2` field.
8019    pub const fn sha2(self) -> u8 {
8020        ((self.bits() >> Self::SHA2_SHIFT) & 0b1111) as u8
8021    }
8022
8023    /// Returns the value of the `CRC32` field.
8024    pub const fn crc32(self) -> u8 {
8025        ((self.bits() >> Self::CRC32_SHIFT) & 0b1111) as u8
8026    }
8027
8028    /// Returns the value of the `RDM` field.
8029    pub const fn rdm(self) -> u8 {
8030        ((self.bits() >> Self::RDM_SHIFT) & 0b1111) as u8
8031    }
8032
8033    /// Returns the value of the `VCMA` field.
8034    pub const fn vcma(self) -> u8 {
8035        ((self.bits() >> Self::VCMA_SHIFT) & 0b1111) as u8
8036    }
8037}
8038
8039bitflags! {
8040    /// `ID_ISAR6` system register value.
8041    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8042    #[repr(transparent)]
8043    pub struct IdIsar6: u32 {
8044    }
8045}
8046
8047impl IdIsar6 {
8048    /// Offset of the `JSCVT` field.
8049    pub const JSCVT_SHIFT: u32 = 0;
8050    /// Mask for the `JSCVT` field.
8051    pub const JSCVT_MASK: u32 = 0b1111;
8052    /// Offset of the `DP` field.
8053    pub const DP_SHIFT: u32 = 4;
8054    /// Mask for the `DP` field.
8055    pub const DP_MASK: u32 = 0b1111;
8056    /// Offset of the `FHM` field.
8057    pub const FHM_SHIFT: u32 = 8;
8058    /// Mask for the `FHM` field.
8059    pub const FHM_MASK: u32 = 0b1111;
8060    /// Offset of the `SB` field.
8061    pub const SB_SHIFT: u32 = 12;
8062    /// Mask for the `SB` field.
8063    pub const SB_MASK: u32 = 0b1111;
8064    /// Offset of the `SPECRES` field.
8065    pub const SPECRES_SHIFT: u32 = 16;
8066    /// Mask for the `SPECRES` field.
8067    pub const SPECRES_MASK: u32 = 0b1111;
8068    /// Offset of the `BF16` field.
8069    pub const BF16_SHIFT: u32 = 20;
8070    /// Mask for the `BF16` field.
8071    pub const BF16_MASK: u32 = 0b1111;
8072    /// Offset of the `I8MM` field.
8073    pub const I8MM_SHIFT: u32 = 24;
8074    /// Mask for the `I8MM` field.
8075    pub const I8MM_MASK: u32 = 0b1111;
8076    /// Offset of the `CLRBHB` field.
8077    pub const CLRBHB_SHIFT: u32 = 28;
8078    /// Mask for the `CLRBHB` field.
8079    pub const CLRBHB_MASK: u32 = 0b1111;
8080
8081    /// Returns the value of the `JSCVT` field.
8082    pub const fn jscvt(self) -> u8 {
8083        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
8084    }
8085
8086    /// Returns the value of the `DP` field.
8087    pub const fn dp(self) -> u8 {
8088        ((self.bits() >> Self::DP_SHIFT) & 0b1111) as u8
8089    }
8090
8091    /// Returns the value of the `FHM` field.
8092    pub const fn fhm(self) -> u8 {
8093        ((self.bits() >> Self::FHM_SHIFT) & 0b1111) as u8
8094    }
8095
8096    /// Returns the value of the `SB` field.
8097    pub const fn sb(self) -> u8 {
8098        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
8099    }
8100
8101    /// Returns the value of the `SPECRES` field.
8102    pub const fn specres(self) -> u8 {
8103        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
8104    }
8105
8106    /// Returns the value of the `BF16` field.
8107    pub const fn bf16(self) -> u8 {
8108        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
8109    }
8110
8111    /// Returns the value of the `I8MM` field.
8112    pub const fn i8mm(self) -> u8 {
8113        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
8114    }
8115
8116    /// Returns the value of the `CLRBHB` field.
8117    pub const fn clrbhb(self) -> u8 {
8118        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
8119    }
8120}
8121
8122bitflags! {
8123    /// `ID_MMFR0` system register value.
8124    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8125    #[repr(transparent)]
8126    pub struct IdMmfr0: u32 {
8127    }
8128}
8129
8130impl IdMmfr0 {
8131    /// Offset of the `VMSA` field.
8132    pub const VMSA_SHIFT: u32 = 0;
8133    /// Mask for the `VMSA` field.
8134    pub const VMSA_MASK: u32 = 0b1111;
8135    /// Offset of the `PMSA` field.
8136    pub const PMSA_SHIFT: u32 = 4;
8137    /// Mask for the `PMSA` field.
8138    pub const PMSA_MASK: u32 = 0b1111;
8139    /// Offset of the `OuterShr` field.
8140    pub const OUTERSHR_SHIFT: u32 = 8;
8141    /// Mask for the `OuterShr` field.
8142    pub const OUTERSHR_MASK: u32 = 0b1111;
8143    /// Offset of the `ShareLvl` field.
8144    pub const SHARELVL_SHIFT: u32 = 12;
8145    /// Mask for the `ShareLvl` field.
8146    pub const SHARELVL_MASK: u32 = 0b1111;
8147    /// Offset of the `TCM` field.
8148    pub const TCM_SHIFT: u32 = 16;
8149    /// Mask for the `TCM` field.
8150    pub const TCM_MASK: u32 = 0b1111;
8151    /// Offset of the `AuxReg` field.
8152    pub const AUXREG_SHIFT: u32 = 20;
8153    /// Mask for the `AuxReg` field.
8154    pub const AUXREG_MASK: u32 = 0b1111;
8155    /// Offset of the `FCSE` field.
8156    pub const FCSE_SHIFT: u32 = 24;
8157    /// Mask for the `FCSE` field.
8158    pub const FCSE_MASK: u32 = 0b1111;
8159    /// Offset of the `InnerShr` field.
8160    pub const INNERSHR_SHIFT: u32 = 28;
8161    /// Mask for the `InnerShr` field.
8162    pub const INNERSHR_MASK: u32 = 0b1111;
8163
8164    /// Returns the value of the `VMSA` field.
8165    pub const fn vmsa(self) -> u8 {
8166        ((self.bits() >> Self::VMSA_SHIFT) & 0b1111) as u8
8167    }
8168
8169    /// Returns the value of the `PMSA` field.
8170    pub const fn pmsa(self) -> u8 {
8171        ((self.bits() >> Self::PMSA_SHIFT) & 0b1111) as u8
8172    }
8173
8174    /// Returns the value of the `OuterShr` field.
8175    pub const fn outershr(self) -> u8 {
8176        ((self.bits() >> Self::OUTERSHR_SHIFT) & 0b1111) as u8
8177    }
8178
8179    /// Returns the value of the `ShareLvl` field.
8180    pub const fn sharelvl(self) -> u8 {
8181        ((self.bits() >> Self::SHARELVL_SHIFT) & 0b1111) as u8
8182    }
8183
8184    /// Returns the value of the `TCM` field.
8185    pub const fn tcm(self) -> u8 {
8186        ((self.bits() >> Self::TCM_SHIFT) & 0b1111) as u8
8187    }
8188
8189    /// Returns the value of the `AuxReg` field.
8190    pub const fn auxreg(self) -> u8 {
8191        ((self.bits() >> Self::AUXREG_SHIFT) & 0b1111) as u8
8192    }
8193
8194    /// Returns the value of the `FCSE` field.
8195    pub const fn fcse(self) -> u8 {
8196        ((self.bits() >> Self::FCSE_SHIFT) & 0b1111) as u8
8197    }
8198
8199    /// Returns the value of the `InnerShr` field.
8200    pub const fn innershr(self) -> u8 {
8201        ((self.bits() >> Self::INNERSHR_SHIFT) & 0b1111) as u8
8202    }
8203}
8204
8205bitflags! {
8206    /// `ID_MMFR1` system register value.
8207    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8208    #[repr(transparent)]
8209    pub struct IdMmfr1: u32 {
8210    }
8211}
8212
8213impl IdMmfr1 {
8214    /// Offset of the `L1HvdVA` field.
8215    pub const L1HVDVA_SHIFT: u32 = 0;
8216    /// Mask for the `L1HvdVA` field.
8217    pub const L1HVDVA_MASK: u32 = 0b1111;
8218    /// Offset of the `L1UniVA` field.
8219    pub const L1UNIVA_SHIFT: u32 = 4;
8220    /// Mask for the `L1UniVA` field.
8221    pub const L1UNIVA_MASK: u32 = 0b1111;
8222    /// Offset of the `L1HvdSW` field.
8223    pub const L1HVDSW_SHIFT: u32 = 8;
8224    /// Mask for the `L1HvdSW` field.
8225    pub const L1HVDSW_MASK: u32 = 0b1111;
8226    /// Offset of the `L1UniSW` field.
8227    pub const L1UNISW_SHIFT: u32 = 12;
8228    /// Mask for the `L1UniSW` field.
8229    pub const L1UNISW_MASK: u32 = 0b1111;
8230    /// Offset of the `L1Hvd` field.
8231    pub const L1HVD_SHIFT: u32 = 16;
8232    /// Mask for the `L1Hvd` field.
8233    pub const L1HVD_MASK: u32 = 0b1111;
8234    /// Offset of the `L1Uni` field.
8235    pub const L1UNI_SHIFT: u32 = 20;
8236    /// Mask for the `L1Uni` field.
8237    pub const L1UNI_MASK: u32 = 0b1111;
8238    /// Offset of the `L1TstCln` field.
8239    pub const L1TSTCLN_SHIFT: u32 = 24;
8240    /// Mask for the `L1TstCln` field.
8241    pub const L1TSTCLN_MASK: u32 = 0b1111;
8242    /// Offset of the `BPred` field.
8243    pub const BPRED_SHIFT: u32 = 28;
8244    /// Mask for the `BPred` field.
8245    pub const BPRED_MASK: u32 = 0b1111;
8246
8247    /// Returns the value of the `L1HvdVA` field.
8248    pub const fn l1hvdva(self) -> u8 {
8249        ((self.bits() >> Self::L1HVDVA_SHIFT) & 0b1111) as u8
8250    }
8251
8252    /// Returns the value of the `L1UniVA` field.
8253    pub const fn l1univa(self) -> u8 {
8254        ((self.bits() >> Self::L1UNIVA_SHIFT) & 0b1111) as u8
8255    }
8256
8257    /// Returns the value of the `L1HvdSW` field.
8258    pub const fn l1hvdsw(self) -> u8 {
8259        ((self.bits() >> Self::L1HVDSW_SHIFT) & 0b1111) as u8
8260    }
8261
8262    /// Returns the value of the `L1UniSW` field.
8263    pub const fn l1unisw(self) -> u8 {
8264        ((self.bits() >> Self::L1UNISW_SHIFT) & 0b1111) as u8
8265    }
8266
8267    /// Returns the value of the `L1Hvd` field.
8268    pub const fn l1hvd(self) -> u8 {
8269        ((self.bits() >> Self::L1HVD_SHIFT) & 0b1111) as u8
8270    }
8271
8272    /// Returns the value of the `L1Uni` field.
8273    pub const fn l1uni(self) -> u8 {
8274        ((self.bits() >> Self::L1UNI_SHIFT) & 0b1111) as u8
8275    }
8276
8277    /// Returns the value of the `L1TstCln` field.
8278    pub const fn l1tstcln(self) -> u8 {
8279        ((self.bits() >> Self::L1TSTCLN_SHIFT) & 0b1111) as u8
8280    }
8281
8282    /// Returns the value of the `BPred` field.
8283    pub const fn bpred(self) -> u8 {
8284        ((self.bits() >> Self::BPRED_SHIFT) & 0b1111) as u8
8285    }
8286}
8287
8288bitflags! {
8289    /// `ID_MMFR2` system register value.
8290    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8291    #[repr(transparent)]
8292    pub struct IdMmfr2: u32 {
8293    }
8294}
8295
8296impl IdMmfr2 {
8297    /// Offset of the `L1HvdFG` field.
8298    pub const L1HVDFG_SHIFT: u32 = 0;
8299    /// Mask for the `L1HvdFG` field.
8300    pub const L1HVDFG_MASK: u32 = 0b1111;
8301    /// Offset of the `L1HvdBG` field.
8302    pub const L1HVDBG_SHIFT: u32 = 4;
8303    /// Mask for the `L1HvdBG` field.
8304    pub const L1HVDBG_MASK: u32 = 0b1111;
8305    /// Offset of the `L1HvdRng` field.
8306    pub const L1HVDRNG_SHIFT: u32 = 8;
8307    /// Mask for the `L1HvdRng` field.
8308    pub const L1HVDRNG_MASK: u32 = 0b1111;
8309    /// Offset of the `HvdTLB` field.
8310    pub const HVDTLB_SHIFT: u32 = 12;
8311    /// Mask for the `HvdTLB` field.
8312    pub const HVDTLB_MASK: u32 = 0b1111;
8313    /// Offset of the `UniTLB` field.
8314    pub const UNITLB_SHIFT: u32 = 16;
8315    /// Mask for the `UniTLB` field.
8316    pub const UNITLB_MASK: u32 = 0b1111;
8317    /// Offset of the `MemBarr` field.
8318    pub const MEMBARR_SHIFT: u32 = 20;
8319    /// Mask for the `MemBarr` field.
8320    pub const MEMBARR_MASK: u32 = 0b1111;
8321    /// Offset of the `WFIStall` field.
8322    pub const WFISTALL_SHIFT: u32 = 24;
8323    /// Mask for the `WFIStall` field.
8324    pub const WFISTALL_MASK: u32 = 0b1111;
8325    /// Offset of the `HWAccFlg` field.
8326    pub const HWACCFLG_SHIFT: u32 = 28;
8327    /// Mask for the `HWAccFlg` field.
8328    pub const HWACCFLG_MASK: u32 = 0b1111;
8329
8330    /// Returns the value of the `L1HvdFG` field.
8331    pub const fn l1hvdfg(self) -> u8 {
8332        ((self.bits() >> Self::L1HVDFG_SHIFT) & 0b1111) as u8
8333    }
8334
8335    /// Returns the value of the `L1HvdBG` field.
8336    pub const fn l1hvdbg(self) -> u8 {
8337        ((self.bits() >> Self::L1HVDBG_SHIFT) & 0b1111) as u8
8338    }
8339
8340    /// Returns the value of the `L1HvdRng` field.
8341    pub const fn l1hvdrng(self) -> u8 {
8342        ((self.bits() >> Self::L1HVDRNG_SHIFT) & 0b1111) as u8
8343    }
8344
8345    /// Returns the value of the `HvdTLB` field.
8346    pub const fn hvdtlb(self) -> u8 {
8347        ((self.bits() >> Self::HVDTLB_SHIFT) & 0b1111) as u8
8348    }
8349
8350    /// Returns the value of the `UniTLB` field.
8351    pub const fn unitlb(self) -> u8 {
8352        ((self.bits() >> Self::UNITLB_SHIFT) & 0b1111) as u8
8353    }
8354
8355    /// Returns the value of the `MemBarr` field.
8356    pub const fn membarr(self) -> u8 {
8357        ((self.bits() >> Self::MEMBARR_SHIFT) & 0b1111) as u8
8358    }
8359
8360    /// Returns the value of the `WFIStall` field.
8361    pub const fn wfistall(self) -> u8 {
8362        ((self.bits() >> Self::WFISTALL_SHIFT) & 0b1111) as u8
8363    }
8364
8365    /// Returns the value of the `HWAccFlg` field.
8366    pub const fn hwaccflg(self) -> u8 {
8367        ((self.bits() >> Self::HWACCFLG_SHIFT) & 0b1111) as u8
8368    }
8369}
8370
8371bitflags! {
8372    /// `ID_MMFR3` system register value.
8373    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8374    #[repr(transparent)]
8375    pub struct IdMmfr3: u32 {
8376    }
8377}
8378
8379impl IdMmfr3 {
8380    /// Offset of the `CMaintVA` field.
8381    pub const CMAINTVA_SHIFT: u32 = 0;
8382    /// Mask for the `CMaintVA` field.
8383    pub const CMAINTVA_MASK: u32 = 0b1111;
8384    /// Offset of the `CMaintSW` field.
8385    pub const CMAINTSW_SHIFT: u32 = 4;
8386    /// Mask for the `CMaintSW` field.
8387    pub const CMAINTSW_MASK: u32 = 0b1111;
8388    /// Offset of the `BPMaint` field.
8389    pub const BPMAINT_SHIFT: u32 = 8;
8390    /// Mask for the `BPMaint` field.
8391    pub const BPMAINT_MASK: u32 = 0b1111;
8392    /// Offset of the `MaintBcst` field.
8393    pub const MAINTBCST_SHIFT: u32 = 12;
8394    /// Mask for the `MaintBcst` field.
8395    pub const MAINTBCST_MASK: u32 = 0b1111;
8396    /// Offset of the `PAN` field.
8397    pub const PAN_SHIFT: u32 = 16;
8398    /// Mask for the `PAN` field.
8399    pub const PAN_MASK: u32 = 0b1111;
8400    /// Offset of the `CohWalk` field.
8401    pub const COHWALK_SHIFT: u32 = 20;
8402    /// Mask for the `CohWalk` field.
8403    pub const COHWALK_MASK: u32 = 0b1111;
8404    /// Offset of the `CMemSz` field.
8405    pub const CMEMSZ_SHIFT: u32 = 24;
8406    /// Mask for the `CMemSz` field.
8407    pub const CMEMSZ_MASK: u32 = 0b1111;
8408    /// Offset of the `Supersec` field.
8409    pub const SUPERSEC_SHIFT: u32 = 28;
8410    /// Mask for the `Supersec` field.
8411    pub const SUPERSEC_MASK: u32 = 0b1111;
8412
8413    /// Returns the value of the `CMaintVA` field.
8414    pub const fn cmaintva(self) -> u8 {
8415        ((self.bits() >> Self::CMAINTVA_SHIFT) & 0b1111) as u8
8416    }
8417
8418    /// Returns the value of the `CMaintSW` field.
8419    pub const fn cmaintsw(self) -> u8 {
8420        ((self.bits() >> Self::CMAINTSW_SHIFT) & 0b1111) as u8
8421    }
8422
8423    /// Returns the value of the `BPMaint` field.
8424    pub const fn bpmaint(self) -> u8 {
8425        ((self.bits() >> Self::BPMAINT_SHIFT) & 0b1111) as u8
8426    }
8427
8428    /// Returns the value of the `MaintBcst` field.
8429    pub const fn maintbcst(self) -> u8 {
8430        ((self.bits() >> Self::MAINTBCST_SHIFT) & 0b1111) as u8
8431    }
8432
8433    /// Returns the value of the `PAN` field.
8434    pub const fn pan(self) -> u8 {
8435        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
8436    }
8437
8438    /// Returns the value of the `CohWalk` field.
8439    pub const fn cohwalk(self) -> u8 {
8440        ((self.bits() >> Self::COHWALK_SHIFT) & 0b1111) as u8
8441    }
8442
8443    /// Returns the value of the `CMemSz` field.
8444    pub const fn cmemsz(self) -> u8 {
8445        ((self.bits() >> Self::CMEMSZ_SHIFT) & 0b1111) as u8
8446    }
8447
8448    /// Returns the value of the `Supersec` field.
8449    pub const fn supersec(self) -> u8 {
8450        ((self.bits() >> Self::SUPERSEC_SHIFT) & 0b1111) as u8
8451    }
8452}
8453
8454bitflags! {
8455    /// `ID_MMFR4` system register value.
8456    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8457    #[repr(transparent)]
8458    pub struct IdMmfr4: u32 {
8459    }
8460}
8461
8462impl IdMmfr4 {
8463    /// Offset of the `SpecSEI` field.
8464    pub const SPECSEI_SHIFT: u32 = 0;
8465    /// Mask for the `SpecSEI` field.
8466    pub const SPECSEI_MASK: u32 = 0b1111;
8467    /// Offset of the `AC2` field.
8468    pub const AC2_SHIFT: u32 = 4;
8469    /// Mask for the `AC2` field.
8470    pub const AC2_MASK: u32 = 0b1111;
8471    /// Offset of the `XNX` field.
8472    pub const XNX_SHIFT: u32 = 8;
8473    /// Mask for the `XNX` field.
8474    pub const XNX_MASK: u32 = 0b1111;
8475    /// Offset of the `CnP` field.
8476    pub const CNP_SHIFT: u32 = 12;
8477    /// Mask for the `CnP` field.
8478    pub const CNP_MASK: u32 = 0b1111;
8479    /// Offset of the `HPDS` field.
8480    pub const HPDS_SHIFT: u32 = 16;
8481    /// Mask for the `HPDS` field.
8482    pub const HPDS_MASK: u32 = 0b1111;
8483    /// Offset of the `LSM` field.
8484    pub const LSM_SHIFT: u32 = 20;
8485    /// Mask for the `LSM` field.
8486    pub const LSM_MASK: u32 = 0b1111;
8487    /// Offset of the `CCIDX` field.
8488    pub const CCIDX_SHIFT: u32 = 24;
8489    /// Mask for the `CCIDX` field.
8490    pub const CCIDX_MASK: u32 = 0b1111;
8491    /// Offset of the `EVT` field.
8492    pub const EVT_SHIFT: u32 = 28;
8493    /// Mask for the `EVT` field.
8494    pub const EVT_MASK: u32 = 0b1111;
8495
8496    /// Returns the value of the `SpecSEI` field.
8497    pub const fn specsei(self) -> u8 {
8498        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
8499    }
8500
8501    /// Returns the value of the `AC2` field.
8502    pub const fn ac2(self) -> u8 {
8503        ((self.bits() >> Self::AC2_SHIFT) & 0b1111) as u8
8504    }
8505
8506    /// Returns the value of the `XNX` field.
8507    pub const fn xnx(self) -> u8 {
8508        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
8509    }
8510
8511    /// Returns the value of the `CnP` field.
8512    pub const fn cnp(self) -> u8 {
8513        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
8514    }
8515
8516    /// Returns the value of the `HPDS` field.
8517    pub const fn hpds(self) -> u8 {
8518        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
8519    }
8520
8521    /// Returns the value of the `LSM` field.
8522    pub const fn lsm(self) -> u8 {
8523        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
8524    }
8525
8526    /// Returns the value of the `CCIDX` field.
8527    pub const fn ccidx(self) -> u8 {
8528        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
8529    }
8530
8531    /// Returns the value of the `EVT` field.
8532    pub const fn evt(self) -> u8 {
8533        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
8534    }
8535}
8536
8537bitflags! {
8538    /// `ID_MMFR5` system register value.
8539    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8540    #[repr(transparent)]
8541    pub struct IdMmfr5: u32 {
8542    }
8543}
8544
8545impl IdMmfr5 {
8546    /// Offset of the `ETS` field.
8547    pub const ETS_SHIFT: u32 = 0;
8548    /// Mask for the `ETS` field.
8549    pub const ETS_MASK: u32 = 0b1111;
8550    /// Offset of the `nTLBPA` field.
8551    pub const NTLBPA_SHIFT: u32 = 4;
8552    /// Mask for the `nTLBPA` field.
8553    pub const NTLBPA_MASK: u32 = 0b1111;
8554
8555    /// Returns the value of the `ETS` field.
8556    pub const fn ets(self) -> u8 {
8557        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
8558    }
8559
8560    /// Returns the value of the `nTLBPA` field.
8561    pub const fn ntlbpa(self) -> u8 {
8562        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
8563    }
8564}
8565
8566bitflags! {
8567    /// `ID_PFR0` system register value.
8568    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8569    #[repr(transparent)]
8570    pub struct IdPfr0: u32 {
8571    }
8572}
8573
8574impl IdPfr0 {
8575    /// Offset of the `State0` field.
8576    pub const STATE0_SHIFT: u32 = 0;
8577    /// Mask for the `State0` field.
8578    pub const STATE0_MASK: u32 = 0b1111;
8579    /// Offset of the `State1` field.
8580    pub const STATE1_SHIFT: u32 = 4;
8581    /// Mask for the `State1` field.
8582    pub const STATE1_MASK: u32 = 0b1111;
8583    /// Offset of the `State2` field.
8584    pub const STATE2_SHIFT: u32 = 8;
8585    /// Mask for the `State2` field.
8586    pub const STATE2_MASK: u32 = 0b1111;
8587    /// Offset of the `State3` field.
8588    pub const STATE3_SHIFT: u32 = 12;
8589    /// Mask for the `State3` field.
8590    pub const STATE3_MASK: u32 = 0b1111;
8591    /// Offset of the `CSV2` field.
8592    pub const CSV2_SHIFT: u32 = 16;
8593    /// Mask for the `CSV2` field.
8594    pub const CSV2_MASK: u32 = 0b1111;
8595    /// Offset of the `AMU` field.
8596    pub const AMU_SHIFT: u32 = 20;
8597    /// Mask for the `AMU` field.
8598    pub const AMU_MASK: u32 = 0b1111;
8599    /// Offset of the `DIT` field.
8600    pub const DIT_SHIFT: u32 = 24;
8601    /// Mask for the `DIT` field.
8602    pub const DIT_MASK: u32 = 0b1111;
8603    /// Offset of the `RAS` field.
8604    pub const RAS_SHIFT: u32 = 28;
8605    /// Mask for the `RAS` field.
8606    pub const RAS_MASK: u32 = 0b1111;
8607
8608    /// Returns the value of the `State0` field.
8609    pub const fn state0(self) -> u8 {
8610        ((self.bits() >> Self::STATE0_SHIFT) & 0b1111) as u8
8611    }
8612
8613    /// Returns the value of the `State1` field.
8614    pub const fn state1(self) -> u8 {
8615        ((self.bits() >> Self::STATE1_SHIFT) & 0b1111) as u8
8616    }
8617
8618    /// Returns the value of the `State2` field.
8619    pub const fn state2(self) -> u8 {
8620        ((self.bits() >> Self::STATE2_SHIFT) & 0b1111) as u8
8621    }
8622
8623    /// Returns the value of the `State3` field.
8624    pub const fn state3(self) -> u8 {
8625        ((self.bits() >> Self::STATE3_SHIFT) & 0b1111) as u8
8626    }
8627
8628    /// Returns the value of the `CSV2` field.
8629    pub const fn csv2(self) -> u8 {
8630        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
8631    }
8632
8633    /// Returns the value of the `AMU` field.
8634    pub const fn amu(self) -> u8 {
8635        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
8636    }
8637
8638    /// Returns the value of the `DIT` field.
8639    pub const fn dit(self) -> u8 {
8640        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
8641    }
8642
8643    /// Returns the value of the `RAS` field.
8644    pub const fn ras(self) -> u8 {
8645        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
8646    }
8647}
8648
8649bitflags! {
8650    /// `ID_PFR1` system register value.
8651    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8652    #[repr(transparent)]
8653    pub struct IdPfr1: u32 {
8654    }
8655}
8656
8657impl IdPfr1 {
8658    /// Offset of the `ProgMod` field.
8659    pub const PROGMOD_SHIFT: u32 = 0;
8660    /// Mask for the `ProgMod` field.
8661    pub const PROGMOD_MASK: u32 = 0b1111;
8662    /// Offset of the `Security` field.
8663    pub const SECURITY_SHIFT: u32 = 4;
8664    /// Mask for the `Security` field.
8665    pub const SECURITY_MASK: u32 = 0b1111;
8666    /// Offset of the `MProgMod` field.
8667    pub const MPROGMOD_SHIFT: u32 = 8;
8668    /// Mask for the `MProgMod` field.
8669    pub const MPROGMOD_MASK: u32 = 0b1111;
8670    /// Offset of the `Virtualization` field.
8671    pub const VIRTUALIZATION_SHIFT: u32 = 12;
8672    /// Mask for the `Virtualization` field.
8673    pub const VIRTUALIZATION_MASK: u32 = 0b1111;
8674    /// Offset of the `GenTimer` field.
8675    pub const GENTIMER_SHIFT: u32 = 16;
8676    /// Mask for the `GenTimer` field.
8677    pub const GENTIMER_MASK: u32 = 0b1111;
8678    /// Offset of the `Sec_frac` field.
8679    pub const SEC_FRAC_SHIFT: u32 = 20;
8680    /// Mask for the `Sec_frac` field.
8681    pub const SEC_FRAC_MASK: u32 = 0b1111;
8682    /// Offset of the `Virt_frac` field.
8683    pub const VIRT_FRAC_SHIFT: u32 = 24;
8684    /// Mask for the `Virt_frac` field.
8685    pub const VIRT_FRAC_MASK: u32 = 0b1111;
8686    /// Offset of the `GIC` field.
8687    pub const GIC_SHIFT: u32 = 28;
8688    /// Mask for the `GIC` field.
8689    pub const GIC_MASK: u32 = 0b1111;
8690
8691    /// Returns the value of the `ProgMod` field.
8692    pub const fn progmod(self) -> u8 {
8693        ((self.bits() >> Self::PROGMOD_SHIFT) & 0b1111) as u8
8694    }
8695
8696    /// Returns the value of the `Security` field.
8697    pub const fn security(self) -> u8 {
8698        ((self.bits() >> Self::SECURITY_SHIFT) & 0b1111) as u8
8699    }
8700
8701    /// Returns the value of the `MProgMod` field.
8702    pub const fn mprogmod(self) -> u8 {
8703        ((self.bits() >> Self::MPROGMOD_SHIFT) & 0b1111) as u8
8704    }
8705
8706    /// Returns the value of the `Virtualization` field.
8707    pub const fn virtualization(self) -> u8 {
8708        ((self.bits() >> Self::VIRTUALIZATION_SHIFT) & 0b1111) as u8
8709    }
8710
8711    /// Returns the value of the `GenTimer` field.
8712    pub const fn gentimer(self) -> u8 {
8713        ((self.bits() >> Self::GENTIMER_SHIFT) & 0b1111) as u8
8714    }
8715
8716    /// Returns the value of the `Sec_frac` field.
8717    pub const fn sec_frac(self) -> u8 {
8718        ((self.bits() >> Self::SEC_FRAC_SHIFT) & 0b1111) as u8
8719    }
8720
8721    /// Returns the value of the `Virt_frac` field.
8722    pub const fn virt_frac(self) -> u8 {
8723        ((self.bits() >> Self::VIRT_FRAC_SHIFT) & 0b1111) as u8
8724    }
8725
8726    /// Returns the value of the `GIC` field.
8727    pub const fn gic(self) -> u8 {
8728        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
8729    }
8730}
8731
8732bitflags! {
8733    /// `ID_PFR2` system register value.
8734    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8735    #[repr(transparent)]
8736    pub struct IdPfr2: u32 {
8737    }
8738}
8739
8740impl IdPfr2 {
8741    /// Offset of the `CSV3` field.
8742    pub const CSV3_SHIFT: u32 = 0;
8743    /// Mask for the `CSV3` field.
8744    pub const CSV3_MASK: u32 = 0b1111;
8745    /// Offset of the `SSBS` field.
8746    pub const SSBS_SHIFT: u32 = 4;
8747    /// Mask for the `SSBS` field.
8748    pub const SSBS_MASK: u32 = 0b1111;
8749    /// Offset of the `RAS_frac` field.
8750    pub const RAS_FRAC_SHIFT: u32 = 8;
8751    /// Mask for the `RAS_frac` field.
8752    pub const RAS_FRAC_MASK: u32 = 0b1111;
8753
8754    /// Returns the value of the `CSV3` field.
8755    pub const fn csv3(self) -> u8 {
8756        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
8757    }
8758
8759    /// Returns the value of the `SSBS` field.
8760    pub const fn ssbs(self) -> u8 {
8761        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
8762    }
8763
8764    /// Returns the value of the `RAS_frac` field.
8765    pub const fn ras_frac(self) -> u8 {
8766        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
8767    }
8768}
8769
8770bitflags! {
8771    /// `IFAR` system register value.
8772    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8773    #[repr(transparent)]
8774    pub struct Ifar: u32 {
8775    }
8776}
8777
8778impl Ifar {
8779    /// Offset of the `VA` field.
8780    pub const VA_SHIFT: u32 = 0;
8781    /// Mask for the `VA` field.
8782    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
8783
8784    /// Returns the value of the `VA` field.
8785    pub const fn va(self) -> u32 {
8786        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
8787    }
8788}
8789
8790bitflags! {
8791    /// `IFSR` system register value.
8792    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8793    #[repr(transparent)]
8794    pub struct Ifsr: u32 {
8795        /// `LPAE` bit.
8796        const LPAE = 1 << 9;
8797        /// `ExT` bit.
8798        const EXT = 1 << 12;
8799        /// `FnV` bit.
8800        const FNV = 1 << 16;
8801    }
8802}
8803
8804impl Ifsr {
8805    /// Offset of the `STATUS` field.
8806    pub const STATUS_SHIFT: u32 = 0;
8807    /// Mask for the `STATUS` field.
8808    pub const STATUS_MASK: u32 = 0b111111;
8809    /// Offset of the `LPAE` field.
8810    pub const LPAE_SHIFT: u32 = 9;
8811    /// Offset of the `ExT` field.
8812    pub const EXT_SHIFT: u32 = 12;
8813    /// Offset of the `FnV` field.
8814    pub const FNV_SHIFT: u32 = 16;
8815
8816    /// Returns the value of the `STATUS` field.
8817    pub const fn status(self) -> u8 {
8818        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
8819    }
8820}
8821
8822bitflags! {
8823    /// `ISR` system register value.
8824    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8825    #[repr(transparent)]
8826    pub struct Isr: u32 {
8827        /// `F` bit.
8828        const F = 1 << 6;
8829        /// `I` bit.
8830        const I = 1 << 7;
8831        /// `A` bit.
8832        const A = 1 << 8;
8833    }
8834}
8835
8836impl Isr {
8837    /// Offset of the `F` field.
8838    pub const F_SHIFT: u32 = 6;
8839    /// Offset of the `I` field.
8840    pub const I_SHIFT: u32 = 7;
8841    /// Offset of the `A` field.
8842    pub const A_SHIFT: u32 = 8;
8843}
8844
8845#[cfg(feature = "el1")]
8846bitflags! {
8847    /// `ISR_EL1` system register value.
8848    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8849    #[repr(transparent)]
8850    pub struct IsrEl1: u64 {
8851        /// `F` bit.
8852        const F = 1 << 6;
8853        /// `I` bit.
8854        const I = 1 << 7;
8855        /// `A` bit.
8856        const A = 1 << 8;
8857        /// `FS` bit.
8858        const FS = 1 << 9;
8859        /// `IS` bit.
8860        const IS = 1 << 10;
8861    }
8862}
8863
8864#[cfg(feature = "el1")]
8865impl IsrEl1 {
8866    /// Offset of the `F` field.
8867    pub const F_SHIFT: u32 = 6;
8868    /// Offset of the `I` field.
8869    pub const I_SHIFT: u32 = 7;
8870    /// Offset of the `A` field.
8871    pub const A_SHIFT: u32 = 8;
8872    /// Offset of the `FS` field.
8873    pub const FS_SHIFT: u32 = 9;
8874    /// Offset of the `IS` field.
8875    pub const IS_SHIFT: u32 = 10;
8876}
8877
8878bitflags! {
8879    /// `MAIR0` system register value.
8880    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8881    #[repr(transparent)]
8882    pub struct Mair0: u32 {
8883    }
8884}
8885
8886impl Mair0 {
8887    /// Offset of the `Attr<n>` field.
8888    pub const ATTR_SHIFT: u32 = 0;
8889    /// Mask for the `Attr<n>` field.
8890    pub const ATTR_MASK: u32 = 0b11111111;
8891
8892    /// Returns the value of the given `Attr<n>` field.
8893    pub const fn attr(self, n: u32) -> u8 {
8894        assert!(n < 4);
8895        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
8896    }
8897}
8898
8899bitflags! {
8900    /// `MAIR1` system register value.
8901    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8902    #[repr(transparent)]
8903    pub struct Mair1: u32 {
8904    }
8905}
8906
8907impl Mair1 {
8908    /// Offset of the `Attr<n>` field.
8909    pub const ATTR_SHIFT: u32 = 0;
8910    /// Mask for the `Attr<n>` field.
8911    pub const ATTR_MASK: u32 = 0b11111111;
8912
8913    /// Returns the value of the given `Attr<n>` field.
8914    pub const fn attr(self, n: u32) -> u8 {
8915        assert!(n >= 4 && n < 8);
8916        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
8917    }
8918}
8919
8920#[cfg(feature = "el1")]
8921bitflags! {
8922    /// `MAIR_EL1` system register value.
8923    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8924    #[repr(transparent)]
8925    pub struct MairEl1: u64 {
8926    }
8927}
8928
8929#[cfg(feature = "el1")]
8930impl MairEl1 {
8931    /// Offset of the `Attr<n>` field.
8932    pub const ATTR_SHIFT: u32 = 0;
8933    /// Mask for the `Attr<n>` field.
8934    pub const ATTR_MASK: u64 = 0b11111111;
8935
8936    /// Returns the value of the given `Attr<n>` field.
8937    pub const fn attr(self, n: u32) -> u8 {
8938        assert!(n < 8);
8939        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
8940    }
8941}
8942
8943#[cfg(feature = "el2")]
8944bitflags! {
8945    /// `MAIR_EL2` system register value.
8946    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8947    #[repr(transparent)]
8948    pub struct MairEl2: u64 {
8949    }
8950}
8951
8952#[cfg(feature = "el2")]
8953impl MairEl2 {
8954    /// Offset of the `Attr<n>` field.
8955    pub const ATTR_SHIFT: u32 = 0;
8956    /// Mask for the `Attr<n>` field.
8957    pub const ATTR_MASK: u64 = 0b11111111;
8958
8959    /// Returns the value of the given `Attr<n>` field.
8960    pub const fn attr(self, n: u32) -> u8 {
8961        assert!(n < 8);
8962        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
8963    }
8964}
8965
8966#[cfg(feature = "el3")]
8967bitflags! {
8968    /// `MAIR_EL3` system register value.
8969    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8970    #[repr(transparent)]
8971    pub struct MairEl3: u64 {
8972    }
8973}
8974
8975#[cfg(feature = "el3")]
8976impl MairEl3 {
8977    /// Offset of the `Attr<n>` field.
8978    pub const ATTR_SHIFT: u32 = 0;
8979    /// Mask for the `Attr<n>` field.
8980    pub const ATTR_MASK: u64 = 0b11111111;
8981
8982    /// Returns the value of the given `Attr<n>` field.
8983    pub const fn attr(self, n: u32) -> u8 {
8984        assert!(n < 8);
8985        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
8986    }
8987}
8988
8989#[cfg(feature = "el1")]
8990bitflags! {
8991    /// `MDCCINT_EL1` system register value.
8992    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
8993    #[repr(transparent)]
8994    pub struct MdccintEl1: u64 {
8995        /// `TX` bit.
8996        const TX = 1 << 29;
8997        /// `RX` bit.
8998        const RX = 1 << 30;
8999    }
9000}
9001
9002#[cfg(feature = "el1")]
9003impl MdccintEl1 {
9004    /// Offset of the `TX` field.
9005    pub const TX_SHIFT: u32 = 29;
9006    /// Offset of the `RX` field.
9007    pub const RX_SHIFT: u32 = 30;
9008}
9009
9010#[cfg(feature = "el2")]
9011bitflags! {
9012    /// `MDCR_EL2` system register value.
9013    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9014    #[repr(transparent)]
9015    pub struct MdcrEl2: u64 {
9016        /// `TPMCR` bit.
9017        const TPMCR = 1 << 5;
9018        /// `TPM` bit.
9019        const TPM = 1 << 6;
9020        /// `HPME` bit.
9021        const HPME = 1 << 7;
9022        /// `TDE` bit.
9023        const TDE = 1 << 8;
9024        /// `TDA` bit.
9025        const TDA = 1 << 9;
9026        /// `TDOSA` bit.
9027        const TDOSA = 1 << 10;
9028        /// `TDRA` bit.
9029        const TDRA = 1 << 11;
9030        /// `TPMS` bit.
9031        const TPMS = 1 << 14;
9032        /// `EnSPM` bit.
9033        const ENSPM = 1 << 15;
9034        /// `HPMD` bit.
9035        const HPMD = 1 << 17;
9036        /// `TTRF` bit.
9037        const TTRF = 1 << 19;
9038        /// `HCCD` bit.
9039        const HCCD = 1 << 23;
9040        /// `HLP` bit.
9041        const HLP = 1 << 26;
9042        /// `TDCC` bit.
9043        const TDCC = 1 << 27;
9044        /// `MTPME` bit.
9045        const MTPME = 1 << 28;
9046        /// `HPMFZO` bit.
9047        const HPMFZO = 1 << 29;
9048        /// `HPMFZS` bit.
9049        const HPMFZS = 1 << 36;
9050        /// `EBWE` bit.
9051        const EBWE = 1 << 43;
9052        /// `EnSTEPOP` bit.
9053        const ENSTEPOP = 1 << 50;
9054    }
9055}
9056
9057#[cfg(feature = "el2")]
9058impl MdcrEl2 {
9059    /// Offset of the `HPMN` field.
9060    pub const HPMN_SHIFT: u32 = 0;
9061    /// Mask for the `HPMN` field.
9062    pub const HPMN_MASK: u64 = 0b11111;
9063    /// Offset of the `TPMCR` field.
9064    pub const TPMCR_SHIFT: u32 = 5;
9065    /// Offset of the `TPM` field.
9066    pub const TPM_SHIFT: u32 = 6;
9067    /// Offset of the `HPME` field.
9068    pub const HPME_SHIFT: u32 = 7;
9069    /// Offset of the `TDE` field.
9070    pub const TDE_SHIFT: u32 = 8;
9071    /// Offset of the `TDA` field.
9072    pub const TDA_SHIFT: u32 = 9;
9073    /// Offset of the `TDOSA` field.
9074    pub const TDOSA_SHIFT: u32 = 10;
9075    /// Offset of the `TDRA` field.
9076    pub const TDRA_SHIFT: u32 = 11;
9077    /// Offset of the `E2PB` field.
9078    pub const E2PB_SHIFT: u32 = 12;
9079    /// Mask for the `E2PB` field.
9080    pub const E2PB_MASK: u64 = 0b11;
9081    /// Offset of the `TPMS` field.
9082    pub const TPMS_SHIFT: u32 = 14;
9083    /// Offset of the `EnSPM` field.
9084    pub const ENSPM_SHIFT: u32 = 15;
9085    /// Offset of the `HPMD` field.
9086    pub const HPMD_SHIFT: u32 = 17;
9087    /// Offset of the `TTRF` field.
9088    pub const TTRF_SHIFT: u32 = 19;
9089    /// Offset of the `HCCD` field.
9090    pub const HCCD_SHIFT: u32 = 23;
9091    /// Offset of the `E2TB` field.
9092    pub const E2TB_SHIFT: u32 = 24;
9093    /// Mask for the `E2TB` field.
9094    pub const E2TB_MASK: u64 = 0b11;
9095    /// Offset of the `HLP` field.
9096    pub const HLP_SHIFT: u32 = 26;
9097    /// Offset of the `TDCC` field.
9098    pub const TDCC_SHIFT: u32 = 27;
9099    /// Offset of the `MTPME` field.
9100    pub const MTPME_SHIFT: u32 = 28;
9101    /// Offset of the `HPMFZO` field.
9102    pub const HPMFZO_SHIFT: u32 = 29;
9103    /// Offset of the `PMSSE` field.
9104    pub const PMSSE_SHIFT: u32 = 30;
9105    /// Mask for the `PMSSE` field.
9106    pub const PMSSE_MASK: u64 = 0b11;
9107    /// Offset of the `HPMFZS` field.
9108    pub const HPMFZS_SHIFT: u32 = 36;
9109    /// Offset of the `PMEE` field.
9110    pub const PMEE_SHIFT: u32 = 40;
9111    /// Mask for the `PMEE` field.
9112    pub const PMEE_MASK: u64 = 0b11;
9113    /// Offset of the `EBWE` field.
9114    pub const EBWE_SHIFT: u32 = 43;
9115    /// Offset of the `EnSTEPOP` field.
9116    pub const ENSTEPOP_SHIFT: u32 = 50;
9117
9118    /// Returns the value of the `HPMN` field.
9119    pub const fn hpmn(self) -> u8 {
9120        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
9121    }
9122
9123    /// Returns the value of the `E2PB` field.
9124    pub const fn e2pb(self) -> u8 {
9125        ((self.bits() >> Self::E2PB_SHIFT) & 0b11) as u8
9126    }
9127
9128    /// Returns the value of the `E2TB` field.
9129    pub const fn e2tb(self) -> u8 {
9130        ((self.bits() >> Self::E2TB_SHIFT) & 0b11) as u8
9131    }
9132
9133    /// Returns the value of the `PMSSE` field.
9134    pub const fn pmsse(self) -> u8 {
9135        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
9136    }
9137
9138    /// Returns the value of the `PMEE` field.
9139    pub const fn pmee(self) -> u8 {
9140        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
9141    }
9142}
9143
9144#[cfg(feature = "el3")]
9145bitflags! {
9146    /// `MDCR_EL3` system register value.
9147    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9148    #[repr(transparent)]
9149    pub struct MdcrEl3: u64 {
9150        /// Realm Trace enable. Enables tracing in Realm state.
9151        const RLTE = 1 << 0;
9152        /// `EPMADE` bit.
9153        const EPMADE = 1 << 2;
9154        /// `ETADE` bit.
9155        const ETADE = 1 << 3;
9156        /// `EDADE` bit.
9157        const EDADE = 1 << 4;
9158        /// Trap Performance Monitor register accesses
9159        const TPM = 1 << 6;
9160        /// Do not trap various PMUv3p9 related system register accesses to EL3.
9161        const ENPM2 = 1 << 7;
9162        /// `TDA` bit.
9163        const TDA = 1 << 9;
9164        /// `TDOSA` bit.
9165        const TDOSA = 1 << 10;
9166        /// Non-secure Profiling Buffer Extended. Together with MDCR_EL3.NSPB, controls the Profiling Buffer owning Security state and accesses to Statistical Profiling and Profiling Buffer System registers from EL2 and EL1.
9167        const NSPBE = 1 << 11;
9168        /// Set to one to disable AArch64 Secure self-hosted debug. Debug exceptions, other than Breakpoint Instruction exceptions, are disabled from all ELs in Secure state.
9169        const SDD = 1 << 16;
9170        /// Secure Performance Monitors Enable. Controls event counting in Secure state and EL3.
9171        const SPME = 1 << 17;
9172        /// Secure Trace enable. Enables tracing in Secure state.
9173        const STE = 1 << 18;
9174        /// Trap Trace Filter controls. Traps use of the Trace Filter control registers at EL2 and EL1 to EL3.
9175        const TTRF = 1 << 19;
9176        /// `EDAD` bit.
9177        const EDAD = 1 << 20;
9178        /// `EPMAD` bit.
9179        const EPMAD = 1 << 21;
9180        /// `ETAD` bit.
9181        const ETAD = 1 << 22;
9182        /// Secure Cycle Counter Disable. Prohibits PMCCNTR_EL0 from counting in Secure state.
9183        const SCCD = 1 << 23;
9184        /// Non-secure Trace Buffer Extended. Together with MDCR_EL3.NSTB, controls the trace buffer owning Security state and accesses to trace buffer System registers from EL2 and EL1.
9185        const NSTBE = 1 << 26;
9186        /// `TDCC` bit.
9187        const TDCC = 1 << 27;
9188        /// Multi-threaded PMU Enable. Enables use of the PMEVTYPER<n>_EL0.MT bits.
9189        const MTPME = 1 << 28;
9190        /// Monitor Cycle Counter Disable. Prohibits the Cycle Counter, PMCCNTR_EL0, from counting at EL3.
9191        const MCCD = 1 << 34;
9192        /// Monitor Performance Monitors Extended control. In conjunction with MDCR_EL3.SPME, controls when event counters are enabled at EL3 and in other Secure Exception levels.
9193        const MPMX = 1 << 35;
9194        /// Trap accesses to PMSNEVFR_EL1. Controls access to Statistical Profiling PMSNEVFR_EL1 System register from EL2 and EL1.
9195        const ENPMSN = 1 << 36;
9196        /// `E3BREW` bit.
9197        const E3BREW = 1 << 37;
9198        /// `E3BREC` bit.
9199        const E3BREC = 1 << 38;
9200        /// `EnTB2` bit.
9201        const ENTB2 = 1 << 39;
9202        /// Enable access to SPE registers. When disabled, accesses to SPE registers generate a trap to EL3.
9203        const ENPMS3 = 1 << 42;
9204        /// `EBWE` bit.
9205        const EBWE = 1 << 43;
9206        /// `EnPMSS` bit.
9207        const ENPMSS = 1 << 44;
9208        /// `EnITE` bit.
9209        const ENITE = 1 << 47;
9210        /// `EnSTEPOP` bit.
9211        const ENSTEPOP = 1 << 50;
9212        /// `EnPMS4` bit.
9213        const ENPMS4 = 1 << 55;
9214    }
9215}
9216
9217#[cfg(feature = "el3")]
9218impl MdcrEl3 {
9219    /// Offset of the `RLTE` field.
9220    pub const RLTE_SHIFT: u32 = 0;
9221    /// Offset of the `EPMADE` field.
9222    pub const EPMADE_SHIFT: u32 = 2;
9223    /// Offset of the `ETADE` field.
9224    pub const ETADE_SHIFT: u32 = 3;
9225    /// Offset of the `EDADE` field.
9226    pub const EDADE_SHIFT: u32 = 4;
9227    /// Offset of the `TPM` field.
9228    pub const TPM_SHIFT: u32 = 6;
9229    /// Offset of the `EnPM2` field.
9230    pub const ENPM2_SHIFT: u32 = 7;
9231    /// Offset of the `TDA` field.
9232    pub const TDA_SHIFT: u32 = 9;
9233    /// Offset of the `TDOSA` field.
9234    pub const TDOSA_SHIFT: u32 = 10;
9235    /// Offset of the `NSPBE` field.
9236    pub const NSPBE_SHIFT: u32 = 11;
9237    /// Offset of the `NSPB` field.
9238    pub const NSPB_SHIFT: u32 = 12;
9239    /// Mask for the `NSPB` field.
9240    pub const NSPB_MASK: u64 = 0b11;
9241    /// Offset of the `SPD32` field.
9242    pub const SPD32_SHIFT: u32 = 14;
9243    /// Mask for the `SPD32` field.
9244    pub const SPD32_MASK: u64 = 0b11;
9245    /// Offset of the `SDD` field.
9246    pub const SDD_SHIFT: u32 = 16;
9247    /// Offset of the `SPME` field.
9248    pub const SPME_SHIFT: u32 = 17;
9249    /// Offset of the `STE` field.
9250    pub const STE_SHIFT: u32 = 18;
9251    /// Offset of the `TTRF` field.
9252    pub const TTRF_SHIFT: u32 = 19;
9253    /// Offset of the `EDAD` field.
9254    pub const EDAD_SHIFT: u32 = 20;
9255    /// Offset of the `EPMAD` field.
9256    pub const EPMAD_SHIFT: u32 = 21;
9257    /// Offset of the `ETAD` field.
9258    pub const ETAD_SHIFT: u32 = 22;
9259    /// Offset of the `SCCD` field.
9260    pub const SCCD_SHIFT: u32 = 23;
9261    /// Offset of the `NSTB` field.
9262    pub const NSTB_SHIFT: u32 = 24;
9263    /// Mask for the `NSTB` field.
9264    pub const NSTB_MASK: u64 = 0b11;
9265    /// Offset of the `NSTBE` field.
9266    pub const NSTBE_SHIFT: u32 = 26;
9267    /// Offset of the `TDCC` field.
9268    pub const TDCC_SHIFT: u32 = 27;
9269    /// Offset of the `MTPME` field.
9270    pub const MTPME_SHIFT: u32 = 28;
9271    /// Offset of the `PMSSE` field.
9272    pub const PMSSE_SHIFT: u32 = 30;
9273    /// Mask for the `PMSSE` field.
9274    pub const PMSSE_MASK: u64 = 0b11;
9275    /// Offset of the `SBRBE` field.
9276    pub const SBRBE_SHIFT: u32 = 32;
9277    /// Mask for the `SBRBE` field.
9278    pub const SBRBE_MASK: u64 = 0b11;
9279    /// Offset of the `MCCD` field.
9280    pub const MCCD_SHIFT: u32 = 34;
9281    /// Offset of the `MPMX` field.
9282    pub const MPMX_SHIFT: u32 = 35;
9283    /// Offset of the `EnPMSN` field.
9284    pub const ENPMSN_SHIFT: u32 = 36;
9285    /// Offset of the `E3BREW` field.
9286    pub const E3BREW_SHIFT: u32 = 37;
9287    /// Offset of the `E3BREC` field.
9288    pub const E3BREC_SHIFT: u32 = 38;
9289    /// Offset of the `EnTB2` field.
9290    pub const ENTB2_SHIFT: u32 = 39;
9291    /// Offset of the `PMEE` field.
9292    pub const PMEE_SHIFT: u32 = 40;
9293    /// Mask for the `PMEE` field.
9294    pub const PMEE_MASK: u64 = 0b11;
9295    /// Offset of the `EnPMS3` field.
9296    pub const ENPMS3_SHIFT: u32 = 42;
9297    /// Offset of the `EBWE` field.
9298    pub const EBWE_SHIFT: u32 = 43;
9299    /// Offset of the `EnPMSS` field.
9300    pub const ENPMSS_SHIFT: u32 = 44;
9301    /// Offset of the `EPMSSAD` field.
9302    pub const EPMSSAD_SHIFT: u32 = 45;
9303    /// Mask for the `EPMSSAD` field.
9304    pub const EPMSSAD_MASK: u64 = 0b11;
9305    /// Offset of the `EnITE` field.
9306    pub const ENITE_SHIFT: u32 = 47;
9307    /// Offset of the `ETBAD` field.
9308    pub const ETBAD_SHIFT: u32 = 48;
9309    /// Mask for the `ETBAD` field.
9310    pub const ETBAD_MASK: u64 = 0b11;
9311    /// Offset of the `EnSTEPOP` field.
9312    pub const ENSTEPOP_SHIFT: u32 = 50;
9313    /// Offset of the `PMSEE` field.
9314    pub const PMSEE_SHIFT: u32 = 51;
9315    /// Mask for the `PMSEE` field.
9316    pub const PMSEE_MASK: u64 = 0b11;
9317    /// Offset of the `TRBEE` field.
9318    pub const TRBEE_SHIFT: u32 = 53;
9319    /// Mask for the `TRBEE` field.
9320    pub const TRBEE_MASK: u64 = 0b11;
9321    /// Offset of the `EnPMS4` field.
9322    pub const ENPMS4_SHIFT: u32 = 55;
9323
9324    /// Returns the value of the `NSPB` field.
9325    pub const fn nspb(self) -> u8 {
9326        ((self.bits() >> Self::NSPB_SHIFT) & 0b11) as u8
9327    }
9328
9329    /// Returns the value of the `SPD32` field.
9330    pub const fn spd32(self) -> u8 {
9331        ((self.bits() >> Self::SPD32_SHIFT) & 0b11) as u8
9332    }
9333
9334    /// Returns the value of the `NSTB` field.
9335    pub const fn nstb(self) -> u8 {
9336        ((self.bits() >> Self::NSTB_SHIFT) & 0b11) as u8
9337    }
9338
9339    /// Returns the value of the `PMSSE` field.
9340    pub const fn pmsse(self) -> u8 {
9341        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
9342    }
9343
9344    /// Returns the value of the `SBRBE` field.
9345    pub const fn sbrbe(self) -> u8 {
9346        ((self.bits() >> Self::SBRBE_SHIFT) & 0b11) as u8
9347    }
9348
9349    /// Returns the value of the `PMEE` field.
9350    pub const fn pmee(self) -> u8 {
9351        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
9352    }
9353
9354    /// Returns the value of the `EPMSSAD` field.
9355    pub const fn epmssad(self) -> u8 {
9356        ((self.bits() >> Self::EPMSSAD_SHIFT) & 0b11) as u8
9357    }
9358
9359    /// Returns the value of the `ETBAD` field.
9360    pub const fn etbad(self) -> u8 {
9361        ((self.bits() >> Self::ETBAD_SHIFT) & 0b11) as u8
9362    }
9363
9364    /// Returns the value of the `PMSEE` field.
9365    pub const fn pmsee(self) -> u8 {
9366        ((self.bits() >> Self::PMSEE_SHIFT) & 0b11) as u8
9367    }
9368
9369    /// Returns the value of the `TRBEE` field.
9370    pub const fn trbee(self) -> u8 {
9371        ((self.bits() >> Self::TRBEE_SHIFT) & 0b11) as u8
9372    }
9373}
9374
9375#[cfg(feature = "el1")]
9376bitflags! {
9377    /// `MDSCR_EL1` system register value.
9378    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9379    #[repr(transparent)]
9380    pub struct MdscrEl1: u64 {
9381        /// `SS` bit.
9382        const SS = 1 << 0;
9383        /// `ERR` bit.
9384        const ERR = 1 << 6;
9385        /// `TDCC` bit.
9386        const TDCC = 1 << 12;
9387        /// `KDE` bit.
9388        const KDE = 1 << 13;
9389        /// `HDE` bit.
9390        const HDE = 1 << 14;
9391        /// `MDE` bit.
9392        const MDE = 1 << 15;
9393        /// `SC2` bit.
9394        const SC2 = 1 << 19;
9395        /// `TDA` bit.
9396        const TDA = 1 << 21;
9397        /// `TXU` bit.
9398        const TXU = 1 << 26;
9399        /// `RXO` bit.
9400        const RXO = 1 << 27;
9401        /// `TXfull` bit.
9402        const TXFULL = 1 << 29;
9403        /// `RXfull` bit.
9404        const RXFULL = 1 << 30;
9405        /// `TFO` bit.
9406        const TFO = 1 << 31;
9407        /// `EMBWE` bit.
9408        const EMBWE = 1 << 32;
9409        /// `TTA` bit.
9410        const TTA = 1 << 33;
9411        /// `EnSPM` bit.
9412        const ENSPM = 1 << 34;
9413        /// `EHBWE` bit.
9414        const EHBWE = 1 << 35;
9415        /// `EnSTEPOP` bit.
9416        const ENSTEPOP = 1 << 50;
9417    }
9418}
9419
9420#[cfg(feature = "el1")]
9421impl MdscrEl1 {
9422    /// Offset of the `SS` field.
9423    pub const SS_SHIFT: u32 = 0;
9424    /// Offset of the `ERR` field.
9425    pub const ERR_SHIFT: u32 = 6;
9426    /// Offset of the `TDCC` field.
9427    pub const TDCC_SHIFT: u32 = 12;
9428    /// Offset of the `KDE` field.
9429    pub const KDE_SHIFT: u32 = 13;
9430    /// Offset of the `HDE` field.
9431    pub const HDE_SHIFT: u32 = 14;
9432    /// Offset of the `MDE` field.
9433    pub const MDE_SHIFT: u32 = 15;
9434    /// Offset of the `SC2` field.
9435    pub const SC2_SHIFT: u32 = 19;
9436    /// Offset of the `TDA` field.
9437    pub const TDA_SHIFT: u32 = 21;
9438    /// Offset of the `INTdis` field.
9439    pub const INTDIS_SHIFT: u32 = 22;
9440    /// Mask for the `INTdis` field.
9441    pub const INTDIS_MASK: u64 = 0b11;
9442    /// Offset of the `TXU` field.
9443    pub const TXU_SHIFT: u32 = 26;
9444    /// Offset of the `RXO` field.
9445    pub const RXO_SHIFT: u32 = 27;
9446    /// Offset of the `TXfull` field.
9447    pub const TXFULL_SHIFT: u32 = 29;
9448    /// Offset of the `RXfull` field.
9449    pub const RXFULL_SHIFT: u32 = 30;
9450    /// Offset of the `TFO` field.
9451    pub const TFO_SHIFT: u32 = 31;
9452    /// Offset of the `EMBWE` field.
9453    pub const EMBWE_SHIFT: u32 = 32;
9454    /// Offset of the `TTA` field.
9455    pub const TTA_SHIFT: u32 = 33;
9456    /// Offset of the `EnSPM` field.
9457    pub const ENSPM_SHIFT: u32 = 34;
9458    /// Offset of the `EHBWE` field.
9459    pub const EHBWE_SHIFT: u32 = 35;
9460    /// Offset of the `EnSTEPOP` field.
9461    pub const ENSTEPOP_SHIFT: u32 = 50;
9462
9463    /// Returns the value of the `INTdis` field.
9464    pub const fn intdis(self) -> u8 {
9465        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
9466    }
9467}
9468
9469bitflags! {
9470    /// `MIDR` system register value.
9471    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9472    #[repr(transparent)]
9473    pub struct Midr: u32 {
9474    }
9475}
9476
9477impl Midr {
9478    /// Offset of the `Revision` field.
9479    pub const REVISION_SHIFT: u32 = 0;
9480    /// Mask for the `Revision` field.
9481    pub const REVISION_MASK: u32 = 0b1111;
9482    /// Offset of the `PartNum` field.
9483    pub const PARTNUM_SHIFT: u32 = 4;
9484    /// Mask for the `PartNum` field.
9485    pub const PARTNUM_MASK: u32 = 0b111111111111;
9486    /// Offset of the `Architecture` field.
9487    pub const ARCHITECTURE_SHIFT: u32 = 16;
9488    /// Mask for the `Architecture` field.
9489    pub const ARCHITECTURE_MASK: u32 = 0b1111;
9490    /// Offset of the `Variant` field.
9491    pub const VARIANT_SHIFT: u32 = 20;
9492    /// Mask for the `Variant` field.
9493    pub const VARIANT_MASK: u32 = 0b1111;
9494    /// Offset of the `Implementer` field.
9495    pub const IMPLEMENTER_SHIFT: u32 = 24;
9496    /// Mask for the `Implementer` field.
9497    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
9498
9499    /// Returns the value of the `Revision` field.
9500    pub const fn revision(self) -> u8 {
9501        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
9502    }
9503
9504    /// Returns the value of the `PartNum` field.
9505    pub const fn partnum(self) -> u16 {
9506        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
9507    }
9508
9509    /// Returns the value of the `Architecture` field.
9510    pub const fn architecture(self) -> u8 {
9511        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
9512    }
9513
9514    /// Returns the value of the `Variant` field.
9515    pub const fn variant(self) -> u8 {
9516        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
9517    }
9518
9519    /// Returns the value of the `Implementer` field.
9520    pub const fn implementer(self) -> u8 {
9521        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
9522    }
9523}
9524
9525#[cfg(feature = "el1")]
9526bitflags! {
9527    /// `MIDR_EL1` system register value.
9528    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9529    #[repr(transparent)]
9530    pub struct MidrEl1: u64 {
9531    }
9532}
9533
9534#[cfg(feature = "el1")]
9535impl MidrEl1 {
9536    /// Offset of the `Revision` field.
9537    pub const REVISION_SHIFT: u32 = 0;
9538    /// Mask for the `Revision` field.
9539    pub const REVISION_MASK: u64 = 0b1111;
9540    /// Offset of the `PartNum` field.
9541    pub const PARTNUM_SHIFT: u32 = 4;
9542    /// Mask for the `PartNum` field.
9543    pub const PARTNUM_MASK: u64 = 0b111111111111;
9544    /// Offset of the `Architecture` field.
9545    pub const ARCHITECTURE_SHIFT: u32 = 16;
9546    /// Mask for the `Architecture` field.
9547    pub const ARCHITECTURE_MASK: u64 = 0b1111;
9548    /// Offset of the `Variant` field.
9549    pub const VARIANT_SHIFT: u32 = 20;
9550    /// Mask for the `Variant` field.
9551    pub const VARIANT_MASK: u64 = 0b1111;
9552    /// Offset of the `Implementer` field.
9553    pub const IMPLEMENTER_SHIFT: u32 = 24;
9554    /// Mask for the `Implementer` field.
9555    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
9556
9557    /// Returns the value of the `Revision` field.
9558    pub const fn revision(self) -> u8 {
9559        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
9560    }
9561
9562    /// Returns the value of the `PartNum` field.
9563    pub const fn partnum(self) -> u16 {
9564        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
9565    }
9566
9567    /// Returns the value of the `Architecture` field.
9568    pub const fn architecture(self) -> u8 {
9569        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
9570    }
9571
9572    /// Returns the value of the `Variant` field.
9573    pub const fn variant(self) -> u8 {
9574        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
9575    }
9576
9577    /// Returns the value of the `Implementer` field.
9578    pub const fn implementer(self) -> u8 {
9579        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
9580    }
9581}
9582
9583#[cfg(feature = "el2")]
9584bitflags! {
9585    /// `MPAM2_EL2` system register value.
9586    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9587    #[repr(transparent)]
9588    pub struct Mpam2El2: u64 {
9589        /// `TRAPMPAM1EL1` bit.
9590        const TRAPMPAM1EL1 = 1 << 48;
9591        /// `TRAPMPAM0EL1` bit.
9592        const TRAPMPAM0EL1 = 1 << 49;
9593        /// `EnMPAMSM` bit.
9594        const ENMPAMSM = 1 << 50;
9595        /// `ALTSP_FRCD` bit.
9596        const ALTSP_FRCD = 1 << 54;
9597        /// `ALTSP_EL2` bit.
9598        const ALTSP_EL2 = 1 << 55;
9599        /// `ALTSP_HFC` bit.
9600        const ALTSP_HFC = 1 << 56;
9601        /// `TIDR` bit.
9602        const TIDR = 1 << 58;
9603        /// `MPAMEN` bit.
9604        const MPAMEN = 1 << 63;
9605    }
9606}
9607
9608#[cfg(feature = "el2")]
9609impl Mpam2El2 {
9610    /// Offset of the `PARTID` field.
9611    pub const PARTID_SHIFT: u32 = 0;
9612    /// Mask for the `PARTID` field.
9613    pub const PARTID_MASK: u64 = 0b1111111111111111;
9614    /// Offset of the `PARTID_I` field.
9615    pub const PARTID_I_SHIFT: u32 = 0;
9616    /// Mask for the `PARTID_I` field.
9617    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
9618    /// Offset of the `PARTID_D` field.
9619    pub const PARTID_D_SHIFT: u32 = 16;
9620    /// Mask for the `PARTID_D` field.
9621    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
9622    /// Offset of the `altPARTID` field.
9623    pub const ALTPARTID_SHIFT: u32 = 16;
9624    /// Mask for the `altPARTID` field.
9625    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
9626    /// Offset of the `PMG` field.
9627    pub const PMG_SHIFT: u32 = 32;
9628    /// Mask for the `PMG` field.
9629    pub const PMG_MASK: u64 = 0b1111111111111111;
9630    /// Offset of the `PMG_I` field.
9631    pub const PMG_I_SHIFT: u32 = 32;
9632    /// Mask for the `PMG_I` field.
9633    pub const PMG_I_MASK: u64 = 0b11111111;
9634    /// Offset of the `PMG_D` field.
9635    pub const PMG_D_SHIFT: u32 = 40;
9636    /// Mask for the `PMG_D` field.
9637    pub const PMG_D_MASK: u64 = 0b11111111;
9638    /// Offset of the `TRAPMPAM1EL1` field.
9639    pub const TRAPMPAM1EL1_SHIFT: u32 = 48;
9640    /// Offset of the `altPMG` field.
9641    pub const ALTPMG_SHIFT: u32 = 48;
9642    /// Mask for the `altPMG` field.
9643    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
9644    /// Offset of the `TRAPMPAM0EL1` field.
9645    pub const TRAPMPAM0EL1_SHIFT: u32 = 49;
9646    /// Offset of the `EnMPAMSM` field.
9647    pub const ENMPAMSM_SHIFT: u32 = 50;
9648    /// Offset of the `ALTSP_FRCD` field.
9649    pub const ALTSP_FRCD_SHIFT: u32 = 54;
9650    /// Offset of the `ALTSP_EL2` field.
9651    pub const ALTSP_EL2_SHIFT: u32 = 55;
9652    /// Offset of the `ALTSP_HFC` field.
9653    pub const ALTSP_HFC_SHIFT: u32 = 56;
9654    /// Offset of the `TIDR` field.
9655    pub const TIDR_SHIFT: u32 = 58;
9656    /// Offset of the `MPAMEN` field.
9657    pub const MPAMEN_SHIFT: u32 = 63;
9658
9659    /// Returns the value of the `PARTID` field.
9660    pub const fn partid(self) -> u16 {
9661        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
9662    }
9663
9664    /// Returns the value of the `PARTID_I` field.
9665    pub const fn partid_i(self) -> u16 {
9666        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
9667    }
9668
9669    /// Returns the value of the `PARTID_D` field.
9670    pub const fn partid_d(self) -> u16 {
9671        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
9672    }
9673
9674    /// Returns the value of the `altPARTID` field.
9675    pub const fn altpartid(self) -> u16 {
9676        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
9677    }
9678
9679    /// Returns the value of the `PMG` field.
9680    pub const fn pmg(self) -> u16 {
9681        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
9682    }
9683
9684    /// Returns the value of the `PMG_I` field.
9685    pub const fn pmg_i(self) -> u8 {
9686        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
9687    }
9688
9689    /// Returns the value of the `PMG_D` field.
9690    pub const fn pmg_d(self) -> u8 {
9691        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
9692    }
9693
9694    /// Returns the value of the `altPMG` field.
9695    pub const fn altpmg(self) -> u16 {
9696        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
9697    }
9698}
9699
9700#[cfg(feature = "el3")]
9701bitflags! {
9702    /// `MPAM3_EL3` system register value.
9703    ///
9704    /// Holds information to generate MPAM labels for memory requests when executing at EL3.
9705    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9706    #[repr(transparent)]
9707    pub struct Mpam3El3: u64 {
9708        /// `RT_ALTSP_NS` bit.
9709        const RT_ALTSP_NS = 1 << 52;
9710        /// `ALTSP_EL3` bit.
9711        const ALTSP_EL3 = 1 << 55;
9712        /// `ALTSP_HFC` bit.
9713        const ALTSP_HFC = 1 << 56;
9714        /// `ALTSP_HEN` bit.
9715        const ALTSP_HEN = 1 << 57;
9716        /// `FORCE_NS` bit.
9717        const FORCE_NS = 1 << 60;
9718        /// `SDEFLT` bit.
9719        const SDEFLT = 1 << 61;
9720        /// Trap direct accesses to MPAM System registers that are not UNDEFINED from all ELn lower than EL3.
9721        const TRAPLOWER = 1 << 62;
9722        /// MPAM Enable. If set, MPAM information is output based on the MPAMn_ELx register for ELn according the MPAM configuration. If not set, the default PARTID and default PMG are output in MPAM information when executing at any ELn.
9723        const MPAMEN = 1 << 63;
9724    }
9725}
9726
9727#[cfg(feature = "el3")]
9728impl Mpam3El3 {
9729    /// Offset of the `PARTID` field.
9730    pub const PARTID_SHIFT: u32 = 0;
9731    /// Mask for the `PARTID` field.
9732    pub const PARTID_MASK: u64 = 0b1111111111111111;
9733    /// Offset of the `PARTID_I` field.
9734    pub const PARTID_I_SHIFT: u32 = 0;
9735    /// Mask for the `PARTID_I` field.
9736    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
9737    /// Offset of the `PARTID_D` field.
9738    pub const PARTID_D_SHIFT: u32 = 16;
9739    /// Mask for the `PARTID_D` field.
9740    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
9741    /// Offset of the `altPARTID` field.
9742    pub const ALTPARTID_SHIFT: u32 = 16;
9743    /// Mask for the `altPARTID` field.
9744    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
9745    /// Offset of the `PMG` field.
9746    pub const PMG_SHIFT: u32 = 32;
9747    /// Mask for the `PMG` field.
9748    pub const PMG_MASK: u64 = 0b1111111111111111;
9749    /// Offset of the `PMG_I` field.
9750    pub const PMG_I_SHIFT: u32 = 32;
9751    /// Mask for the `PMG_I` field.
9752    pub const PMG_I_MASK: u64 = 0b11111111;
9753    /// Offset of the `PMG_D` field.
9754    pub const PMG_D_SHIFT: u32 = 40;
9755    /// Mask for the `PMG_D` field.
9756    pub const PMG_D_MASK: u64 = 0b11111111;
9757    /// Offset of the `altPMG` field.
9758    pub const ALTPMG_SHIFT: u32 = 48;
9759    /// Mask for the `altPMG` field.
9760    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
9761    /// Offset of the `RT_ALTSP_NS` field.
9762    pub const RT_ALTSP_NS_SHIFT: u32 = 52;
9763    /// Offset of the `ALTSP_EL3` field.
9764    pub const ALTSP_EL3_SHIFT: u32 = 55;
9765    /// Offset of the `ALTSP_HFC` field.
9766    pub const ALTSP_HFC_SHIFT: u32 = 56;
9767    /// Offset of the `ALTSP_HEN` field.
9768    pub const ALTSP_HEN_SHIFT: u32 = 57;
9769    /// Offset of the `FORCE_NS` field.
9770    pub const FORCE_NS_SHIFT: u32 = 60;
9771    /// Offset of the `SDEFLT` field.
9772    pub const SDEFLT_SHIFT: u32 = 61;
9773    /// Offset of the `TRAPLOWER` field.
9774    pub const TRAPLOWER_SHIFT: u32 = 62;
9775    /// Offset of the `MPAMEN` field.
9776    pub const MPAMEN_SHIFT: u32 = 63;
9777
9778    /// Returns the value of the `PARTID` field.
9779    pub const fn partid(self) -> u16 {
9780        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
9781    }
9782
9783    /// Returns the value of the `PARTID_I` field.
9784    pub const fn partid_i(self) -> u16 {
9785        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
9786    }
9787
9788    /// Returns the value of the `PARTID_D` field.
9789    pub const fn partid_d(self) -> u16 {
9790        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
9791    }
9792
9793    /// Returns the value of the `altPARTID` field.
9794    pub const fn altpartid(self) -> u16 {
9795        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
9796    }
9797
9798    /// Returns the value of the `PMG` field.
9799    pub const fn pmg(self) -> u16 {
9800        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
9801    }
9802
9803    /// Returns the value of the `PMG_I` field.
9804    pub const fn pmg_i(self) -> u8 {
9805        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
9806    }
9807
9808    /// Returns the value of the `PMG_D` field.
9809    pub const fn pmg_d(self) -> u8 {
9810        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
9811    }
9812
9813    /// Returns the value of the `altPMG` field.
9814    pub const fn altpmg(self) -> u16 {
9815        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
9816    }
9817}
9818
9819#[cfg(feature = "el2")]
9820bitflags! {
9821    /// `MPAMHCR_EL2` system register value.
9822    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9823    #[repr(transparent)]
9824    pub struct MpamhcrEl2: u64 {
9825        /// `EL0_VPMEN` bit.
9826        const EL0_VPMEN = 1 << 0;
9827        /// `EL1_VPMEN` bit.
9828        const EL1_VPMEN = 1 << 1;
9829        /// `VPMEN` bit.
9830        const VPMEN = 1 << 2;
9831        /// `VMMEN` bit.
9832        const VMMEN = 1 << 3;
9833        /// `SMVPMEN` bit.
9834        const SMVPMEN = 1 << 4;
9835        /// `SMVMMEN` bit.
9836        const SMVMMEN = 1 << 5;
9837        /// `GSTAPP_PLK` bit.
9838        const GSTAPP_PLK = 1 << 8;
9839        /// `TRAP_MPAMIDR_EL1` bit.
9840        const TRAP_MPAMIDR_EL1 = 1 << 31;
9841    }
9842}
9843
9844#[cfg(feature = "el2")]
9845impl MpamhcrEl2 {
9846    /// Offset of the `EL0_VPMEN` field.
9847    pub const EL0_VPMEN_SHIFT: u32 = 0;
9848    /// Offset of the `EL1_VPMEN` field.
9849    pub const EL1_VPMEN_SHIFT: u32 = 1;
9850    /// Offset of the `VPMEN` field.
9851    pub const VPMEN_SHIFT: u32 = 2;
9852    /// Offset of the `VMMEN` field.
9853    pub const VMMEN_SHIFT: u32 = 3;
9854    /// Offset of the `SMVPMEN` field.
9855    pub const SMVPMEN_SHIFT: u32 = 4;
9856    /// Offset of the `SMVMMEN` field.
9857    pub const SMVMMEN_SHIFT: u32 = 5;
9858    /// Offset of the `GSTAPP_PLK` field.
9859    pub const GSTAPP_PLK_SHIFT: u32 = 8;
9860    /// Offset of the `TRAP_MPAMIDR_EL1` field.
9861    pub const TRAP_MPAMIDR_EL1_SHIFT: u32 = 31;
9862}
9863
9864#[cfg(feature = "el1")]
9865bitflags! {
9866    /// `MPAMIDR_EL1` system register value.
9867    ///
9868    /// Indicates the maximum PARTID and PMG values supported in the implementation and the support for other optional features.
9869    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9870    #[repr(transparent)]
9871    pub struct MpamidrEl1: u64 {
9872        /// Indicates support for MPAM virtualization.
9873        const HAS_HCR = 1 << 17;
9874        /// `HAS_ALT_ID` bit.
9875        const HAS_ALT_ID = 1 << 21;
9876        /// `HAS_INSTR_ALT_ID` bit.
9877        const HAS_INSTR_ALT_ID = 1 << 22;
9878        /// `HAS_BW_CTRL` bit.
9879        const HAS_BW_CTRL = 1 << 56;
9880        /// `HAS_ALTSP` bit.
9881        const HAS_ALTSP = 1 << 57;
9882        /// `HAS_TIDR` bit.
9883        const HAS_TIDR = 1 << 58;
9884        /// `SP4` bit.
9885        const SP4 = 1 << 59;
9886        /// `HAS_FORCE_NS` bit.
9887        const HAS_FORCE_NS = 1 << 60;
9888        /// `HAS_SDEFLT` bit.
9889        const HAS_SDEFLT = 1 << 61;
9890    }
9891}
9892
9893#[cfg(feature = "el1")]
9894impl MpamidrEl1 {
9895    /// Offset of the `PARTID_MAX` field.
9896    pub const PARTID_MAX_SHIFT: u32 = 0;
9897    /// Mask for the `PARTID_MAX` field.
9898    pub const PARTID_MAX_MASK: u64 = 0b1111111111111111;
9899    /// Offset of the `HAS_HCR` field.
9900    pub const HAS_HCR_SHIFT: u32 = 17;
9901    /// Offset of the `VPMR_MAX` field.
9902    pub const VPMR_MAX_SHIFT: u32 = 18;
9903    /// Mask for the `VPMR_MAX` field.
9904    pub const VPMR_MAX_MASK: u64 = 0b111;
9905    /// Offset of the `HAS_ALT_ID` field.
9906    pub const HAS_ALT_ID_SHIFT: u32 = 21;
9907    /// Offset of the `HAS_INSTR_ALT_ID` field.
9908    pub const HAS_INSTR_ALT_ID_SHIFT: u32 = 22;
9909    /// Offset of the `HAS_BW_CTRL` field.
9910    pub const HAS_BW_CTRL_SHIFT: u32 = 56;
9911    /// Offset of the `HAS_ALTSP` field.
9912    pub const HAS_ALTSP_SHIFT: u32 = 57;
9913    /// Offset of the `HAS_TIDR` field.
9914    pub const HAS_TIDR_SHIFT: u32 = 58;
9915    /// Offset of the `SP4` field.
9916    pub const SP4_SHIFT: u32 = 59;
9917    /// Offset of the `HAS_FORCE_NS` field.
9918    pub const HAS_FORCE_NS_SHIFT: u32 = 60;
9919    /// Offset of the `HAS_SDEFLT` field.
9920    pub const HAS_SDEFLT_SHIFT: u32 = 61;
9921
9922    /// Returns the value of the `PARTID_MAX` field.
9923    pub const fn partid_max(self) -> u16 {
9924        ((self.bits() >> Self::PARTID_MAX_SHIFT) & 0b1111111111111111) as u16
9925    }
9926
9927    /// Returns the value of the `VPMR_MAX` field.
9928    ///
9929    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
9930    pub const fn vpmr_max(self) -> u8 {
9931        ((self.bits() >> Self::VPMR_MAX_SHIFT) & 0b111) as u8
9932    }
9933}
9934
9935#[cfg(feature = "el2")]
9936bitflags! {
9937    /// `MPAMVPM0_EL2` system register value.
9938    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9939    #[repr(transparent)]
9940    pub struct Mpamvpm0El2: u64 {
9941    }
9942}
9943
9944#[cfg(feature = "el2")]
9945impl Mpamvpm0El2 {
9946    /// Offset of the `PhyPARTID0` field.
9947    pub const PHYPARTID0_SHIFT: u32 = 0;
9948    /// Mask for the `PhyPARTID0` field.
9949    pub const PHYPARTID0_MASK: u64 = 0b1111111111111111;
9950    /// Offset of the `PhyPARTID1` field.
9951    pub const PHYPARTID1_SHIFT: u32 = 16;
9952    /// Mask for the `PhyPARTID1` field.
9953    pub const PHYPARTID1_MASK: u64 = 0b1111111111111111;
9954    /// Offset of the `PhyPARTID2` field.
9955    pub const PHYPARTID2_SHIFT: u32 = 32;
9956    /// Mask for the `PhyPARTID2` field.
9957    pub const PHYPARTID2_MASK: u64 = 0b1111111111111111;
9958    /// Offset of the `PhyPARTID3` field.
9959    pub const PHYPARTID3_SHIFT: u32 = 48;
9960    /// Mask for the `PhyPARTID3` field.
9961    pub const PHYPARTID3_MASK: u64 = 0b1111111111111111;
9962
9963    /// Returns the value of the `PhyPARTID0` field.
9964    pub const fn phypartid0(self) -> u16 {
9965        ((self.bits() >> Self::PHYPARTID0_SHIFT) & 0b1111111111111111) as u16
9966    }
9967
9968    /// Returns the value of the `PhyPARTID1` field.
9969    pub const fn phypartid1(self) -> u16 {
9970        ((self.bits() >> Self::PHYPARTID1_SHIFT) & 0b1111111111111111) as u16
9971    }
9972
9973    /// Returns the value of the `PhyPARTID2` field.
9974    pub const fn phypartid2(self) -> u16 {
9975        ((self.bits() >> Self::PHYPARTID2_SHIFT) & 0b1111111111111111) as u16
9976    }
9977
9978    /// Returns the value of the `PhyPARTID3` field.
9979    pub const fn phypartid3(self) -> u16 {
9980        ((self.bits() >> Self::PHYPARTID3_SHIFT) & 0b1111111111111111) as u16
9981    }
9982}
9983
9984#[cfg(feature = "el2")]
9985bitflags! {
9986    /// `MPAMVPM1_EL2` system register value.
9987    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
9988    #[repr(transparent)]
9989    pub struct Mpamvpm1El2: u64 {
9990    }
9991}
9992
9993#[cfg(feature = "el2")]
9994impl Mpamvpm1El2 {
9995    /// Offset of the `PhyPARTID4` field.
9996    pub const PHYPARTID4_SHIFT: u32 = 0;
9997    /// Mask for the `PhyPARTID4` field.
9998    pub const PHYPARTID4_MASK: u64 = 0b1111111111111111;
9999    /// Offset of the `PhyPARTID5` field.
10000    pub const PHYPARTID5_SHIFT: u32 = 16;
10001    /// Mask for the `PhyPARTID5` field.
10002    pub const PHYPARTID5_MASK: u64 = 0b1111111111111111;
10003    /// Offset of the `PhyPARTID6` field.
10004    pub const PHYPARTID6_SHIFT: u32 = 32;
10005    /// Mask for the `PhyPARTID6` field.
10006    pub const PHYPARTID6_MASK: u64 = 0b1111111111111111;
10007    /// Offset of the `PhyPARTID7` field.
10008    pub const PHYPARTID7_SHIFT: u32 = 48;
10009    /// Mask for the `PhyPARTID7` field.
10010    pub const PHYPARTID7_MASK: u64 = 0b1111111111111111;
10011
10012    /// Returns the value of the `PhyPARTID4` field.
10013    pub const fn phypartid4(self) -> u16 {
10014        ((self.bits() >> Self::PHYPARTID4_SHIFT) & 0b1111111111111111) as u16
10015    }
10016
10017    /// Returns the value of the `PhyPARTID5` field.
10018    pub const fn phypartid5(self) -> u16 {
10019        ((self.bits() >> Self::PHYPARTID5_SHIFT) & 0b1111111111111111) as u16
10020    }
10021
10022    /// Returns the value of the `PhyPARTID6` field.
10023    pub const fn phypartid6(self) -> u16 {
10024        ((self.bits() >> Self::PHYPARTID6_SHIFT) & 0b1111111111111111) as u16
10025    }
10026
10027    /// Returns the value of the `PhyPARTID7` field.
10028    pub const fn phypartid7(self) -> u16 {
10029        ((self.bits() >> Self::PHYPARTID7_SHIFT) & 0b1111111111111111) as u16
10030    }
10031}
10032
10033#[cfg(feature = "el2")]
10034bitflags! {
10035    /// `MPAMVPM2_EL2` system register value.
10036    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10037    #[repr(transparent)]
10038    pub struct Mpamvpm2El2: u64 {
10039    }
10040}
10041
10042#[cfg(feature = "el2")]
10043impl Mpamvpm2El2 {
10044    /// Offset of the `PhyPARTID8` field.
10045    pub const PHYPARTID8_SHIFT: u32 = 0;
10046    /// Mask for the `PhyPARTID8` field.
10047    pub const PHYPARTID8_MASK: u64 = 0b1111111111111111;
10048    /// Offset of the `PhyPARTID9` field.
10049    pub const PHYPARTID9_SHIFT: u32 = 16;
10050    /// Mask for the `PhyPARTID9` field.
10051    pub const PHYPARTID9_MASK: u64 = 0b1111111111111111;
10052    /// Offset of the `PhyPARTID10` field.
10053    pub const PHYPARTID10_SHIFT: u32 = 32;
10054    /// Mask for the `PhyPARTID10` field.
10055    pub const PHYPARTID10_MASK: u64 = 0b1111111111111111;
10056    /// Offset of the `PhyPARTID11` field.
10057    pub const PHYPARTID11_SHIFT: u32 = 48;
10058    /// Mask for the `PhyPARTID11` field.
10059    pub const PHYPARTID11_MASK: u64 = 0b1111111111111111;
10060
10061    /// Returns the value of the `PhyPARTID8` field.
10062    pub const fn phypartid8(self) -> u16 {
10063        ((self.bits() >> Self::PHYPARTID8_SHIFT) & 0b1111111111111111) as u16
10064    }
10065
10066    /// Returns the value of the `PhyPARTID9` field.
10067    pub const fn phypartid9(self) -> u16 {
10068        ((self.bits() >> Self::PHYPARTID9_SHIFT) & 0b1111111111111111) as u16
10069    }
10070
10071    /// Returns the value of the `PhyPARTID10` field.
10072    pub const fn phypartid10(self) -> u16 {
10073        ((self.bits() >> Self::PHYPARTID10_SHIFT) & 0b1111111111111111) as u16
10074    }
10075
10076    /// Returns the value of the `PhyPARTID11` field.
10077    pub const fn phypartid11(self) -> u16 {
10078        ((self.bits() >> Self::PHYPARTID11_SHIFT) & 0b1111111111111111) as u16
10079    }
10080}
10081
10082#[cfg(feature = "el2")]
10083bitflags! {
10084    /// `MPAMVPM3_EL2` system register value.
10085    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10086    #[repr(transparent)]
10087    pub struct Mpamvpm3El2: u64 {
10088    }
10089}
10090
10091#[cfg(feature = "el2")]
10092impl Mpamvpm3El2 {
10093    /// Offset of the `PhyPARTID12` field.
10094    pub const PHYPARTID12_SHIFT: u32 = 0;
10095    /// Mask for the `PhyPARTID12` field.
10096    pub const PHYPARTID12_MASK: u64 = 0b1111111111111111;
10097    /// Offset of the `PhyPARTID13` field.
10098    pub const PHYPARTID13_SHIFT: u32 = 16;
10099    /// Mask for the `PhyPARTID13` field.
10100    pub const PHYPARTID13_MASK: u64 = 0b1111111111111111;
10101    /// Offset of the `PhyPARTID14` field.
10102    pub const PHYPARTID14_SHIFT: u32 = 32;
10103    /// Mask for the `PhyPARTID14` field.
10104    pub const PHYPARTID14_MASK: u64 = 0b1111111111111111;
10105    /// Offset of the `PhyPARTID15` field.
10106    pub const PHYPARTID15_SHIFT: u32 = 48;
10107    /// Mask for the `PhyPARTID15` field.
10108    pub const PHYPARTID15_MASK: u64 = 0b1111111111111111;
10109
10110    /// Returns the value of the `PhyPARTID12` field.
10111    pub const fn phypartid12(self) -> u16 {
10112        ((self.bits() >> Self::PHYPARTID12_SHIFT) & 0b1111111111111111) as u16
10113    }
10114
10115    /// Returns the value of the `PhyPARTID13` field.
10116    pub const fn phypartid13(self) -> u16 {
10117        ((self.bits() >> Self::PHYPARTID13_SHIFT) & 0b1111111111111111) as u16
10118    }
10119
10120    /// Returns the value of the `PhyPARTID14` field.
10121    pub const fn phypartid14(self) -> u16 {
10122        ((self.bits() >> Self::PHYPARTID14_SHIFT) & 0b1111111111111111) as u16
10123    }
10124
10125    /// Returns the value of the `PhyPARTID15` field.
10126    pub const fn phypartid15(self) -> u16 {
10127        ((self.bits() >> Self::PHYPARTID15_SHIFT) & 0b1111111111111111) as u16
10128    }
10129}
10130
10131#[cfg(feature = "el2")]
10132bitflags! {
10133    /// `MPAMVPM4_EL2` system register value.
10134    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10135    #[repr(transparent)]
10136    pub struct Mpamvpm4El2: u64 {
10137    }
10138}
10139
10140#[cfg(feature = "el2")]
10141impl Mpamvpm4El2 {
10142    /// Offset of the `PhyPARTID16` field.
10143    pub const PHYPARTID16_SHIFT: u32 = 0;
10144    /// Mask for the `PhyPARTID16` field.
10145    pub const PHYPARTID16_MASK: u64 = 0b1111111111111111;
10146    /// Offset of the `PhyPARTID17` field.
10147    pub const PHYPARTID17_SHIFT: u32 = 16;
10148    /// Mask for the `PhyPARTID17` field.
10149    pub const PHYPARTID17_MASK: u64 = 0b1111111111111111;
10150    /// Offset of the `PhyPARTID18` field.
10151    pub const PHYPARTID18_SHIFT: u32 = 32;
10152    /// Mask for the `PhyPARTID18` field.
10153    pub const PHYPARTID18_MASK: u64 = 0b1111111111111111;
10154    /// Offset of the `PhyPARTID19` field.
10155    pub const PHYPARTID19_SHIFT: u32 = 48;
10156    /// Mask for the `PhyPARTID19` field.
10157    pub const PHYPARTID19_MASK: u64 = 0b1111111111111111;
10158
10159    /// Returns the value of the `PhyPARTID16` field.
10160    pub const fn phypartid16(self) -> u16 {
10161        ((self.bits() >> Self::PHYPARTID16_SHIFT) & 0b1111111111111111) as u16
10162    }
10163
10164    /// Returns the value of the `PhyPARTID17` field.
10165    pub const fn phypartid17(self) -> u16 {
10166        ((self.bits() >> Self::PHYPARTID17_SHIFT) & 0b1111111111111111) as u16
10167    }
10168
10169    /// Returns the value of the `PhyPARTID18` field.
10170    pub const fn phypartid18(self) -> u16 {
10171        ((self.bits() >> Self::PHYPARTID18_SHIFT) & 0b1111111111111111) as u16
10172    }
10173
10174    /// Returns the value of the `PhyPARTID19` field.
10175    pub const fn phypartid19(self) -> u16 {
10176        ((self.bits() >> Self::PHYPARTID19_SHIFT) & 0b1111111111111111) as u16
10177    }
10178}
10179
10180#[cfg(feature = "el2")]
10181bitflags! {
10182    /// `MPAMVPM5_EL2` system register value.
10183    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10184    #[repr(transparent)]
10185    pub struct Mpamvpm5El2: u64 {
10186    }
10187}
10188
10189#[cfg(feature = "el2")]
10190impl Mpamvpm5El2 {
10191    /// Offset of the `PhyPARTID20` field.
10192    pub const PHYPARTID20_SHIFT: u32 = 0;
10193    /// Mask for the `PhyPARTID20` field.
10194    pub const PHYPARTID20_MASK: u64 = 0b1111111111111111;
10195    /// Offset of the `PhyPARTID21` field.
10196    pub const PHYPARTID21_SHIFT: u32 = 16;
10197    /// Mask for the `PhyPARTID21` field.
10198    pub const PHYPARTID21_MASK: u64 = 0b1111111111111111;
10199    /// Offset of the `PhyPARTID22` field.
10200    pub const PHYPARTID22_SHIFT: u32 = 32;
10201    /// Mask for the `PhyPARTID22` field.
10202    pub const PHYPARTID22_MASK: u64 = 0b1111111111111111;
10203    /// Offset of the `PhyPARTID23` field.
10204    pub const PHYPARTID23_SHIFT: u32 = 48;
10205    /// Mask for the `PhyPARTID23` field.
10206    pub const PHYPARTID23_MASK: u64 = 0b1111111111111111;
10207
10208    /// Returns the value of the `PhyPARTID20` field.
10209    pub const fn phypartid20(self) -> u16 {
10210        ((self.bits() >> Self::PHYPARTID20_SHIFT) & 0b1111111111111111) as u16
10211    }
10212
10213    /// Returns the value of the `PhyPARTID21` field.
10214    pub const fn phypartid21(self) -> u16 {
10215        ((self.bits() >> Self::PHYPARTID21_SHIFT) & 0b1111111111111111) as u16
10216    }
10217
10218    /// Returns the value of the `PhyPARTID22` field.
10219    pub const fn phypartid22(self) -> u16 {
10220        ((self.bits() >> Self::PHYPARTID22_SHIFT) & 0b1111111111111111) as u16
10221    }
10222
10223    /// Returns the value of the `PhyPARTID23` field.
10224    pub const fn phypartid23(self) -> u16 {
10225        ((self.bits() >> Self::PHYPARTID23_SHIFT) & 0b1111111111111111) as u16
10226    }
10227}
10228
10229#[cfg(feature = "el2")]
10230bitflags! {
10231    /// `MPAMVPM6_EL2` system register value.
10232    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10233    #[repr(transparent)]
10234    pub struct Mpamvpm6El2: u64 {
10235    }
10236}
10237
10238#[cfg(feature = "el2")]
10239impl Mpamvpm6El2 {
10240    /// Offset of the `PhyPARTID24` field.
10241    pub const PHYPARTID24_SHIFT: u32 = 0;
10242    /// Mask for the `PhyPARTID24` field.
10243    pub const PHYPARTID24_MASK: u64 = 0b1111111111111111;
10244    /// Offset of the `PhyPARTID25` field.
10245    pub const PHYPARTID25_SHIFT: u32 = 16;
10246    /// Mask for the `PhyPARTID25` field.
10247    pub const PHYPARTID25_MASK: u64 = 0b1111111111111111;
10248    /// Offset of the `PhyPARTID26` field.
10249    pub const PHYPARTID26_SHIFT: u32 = 32;
10250    /// Mask for the `PhyPARTID26` field.
10251    pub const PHYPARTID26_MASK: u64 = 0b1111111111111111;
10252    /// Offset of the `PhyPARTID27` field.
10253    pub const PHYPARTID27_SHIFT: u32 = 48;
10254    /// Mask for the `PhyPARTID27` field.
10255    pub const PHYPARTID27_MASK: u64 = 0b1111111111111111;
10256
10257    /// Returns the value of the `PhyPARTID24` field.
10258    pub const fn phypartid24(self) -> u16 {
10259        ((self.bits() >> Self::PHYPARTID24_SHIFT) & 0b1111111111111111) as u16
10260    }
10261
10262    /// Returns the value of the `PhyPARTID25` field.
10263    pub const fn phypartid25(self) -> u16 {
10264        ((self.bits() >> Self::PHYPARTID25_SHIFT) & 0b1111111111111111) as u16
10265    }
10266
10267    /// Returns the value of the `PhyPARTID26` field.
10268    pub const fn phypartid26(self) -> u16 {
10269        ((self.bits() >> Self::PHYPARTID26_SHIFT) & 0b1111111111111111) as u16
10270    }
10271
10272    /// Returns the value of the `PhyPARTID27` field.
10273    pub const fn phypartid27(self) -> u16 {
10274        ((self.bits() >> Self::PHYPARTID27_SHIFT) & 0b1111111111111111) as u16
10275    }
10276}
10277
10278#[cfg(feature = "el2")]
10279bitflags! {
10280    /// `MPAMVPM7_EL2` system register value.
10281    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10282    #[repr(transparent)]
10283    pub struct Mpamvpm7El2: u64 {
10284    }
10285}
10286
10287#[cfg(feature = "el2")]
10288impl Mpamvpm7El2 {
10289    /// Offset of the `PhyPARTID28` field.
10290    pub const PHYPARTID28_SHIFT: u32 = 0;
10291    /// Mask for the `PhyPARTID28` field.
10292    pub const PHYPARTID28_MASK: u64 = 0b1111111111111111;
10293    /// Offset of the `PhyPARTID29` field.
10294    pub const PHYPARTID29_SHIFT: u32 = 16;
10295    /// Mask for the `PhyPARTID29` field.
10296    pub const PHYPARTID29_MASK: u64 = 0b1111111111111111;
10297    /// Offset of the `PhyPARTID30` field.
10298    pub const PHYPARTID30_SHIFT: u32 = 32;
10299    /// Mask for the `PhyPARTID30` field.
10300    pub const PHYPARTID30_MASK: u64 = 0b1111111111111111;
10301    /// Offset of the `PhyPARTID31` field.
10302    pub const PHYPARTID31_SHIFT: u32 = 48;
10303    /// Mask for the `PhyPARTID31` field.
10304    pub const PHYPARTID31_MASK: u64 = 0b1111111111111111;
10305
10306    /// Returns the value of the `PhyPARTID28` field.
10307    pub const fn phypartid28(self) -> u16 {
10308        ((self.bits() >> Self::PHYPARTID28_SHIFT) & 0b1111111111111111) as u16
10309    }
10310
10311    /// Returns the value of the `PhyPARTID29` field.
10312    pub const fn phypartid29(self) -> u16 {
10313        ((self.bits() >> Self::PHYPARTID29_SHIFT) & 0b1111111111111111) as u16
10314    }
10315
10316    /// Returns the value of the `PhyPARTID30` field.
10317    pub const fn phypartid30(self) -> u16 {
10318        ((self.bits() >> Self::PHYPARTID30_SHIFT) & 0b1111111111111111) as u16
10319    }
10320
10321    /// Returns the value of the `PhyPARTID31` field.
10322    pub const fn phypartid31(self) -> u16 {
10323        ((self.bits() >> Self::PHYPARTID31_SHIFT) & 0b1111111111111111) as u16
10324    }
10325}
10326
10327#[cfg(feature = "el2")]
10328bitflags! {
10329    /// `MPAMVPMV_EL2` system register value.
10330    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10331    #[repr(transparent)]
10332    pub struct MpamvpmvEl2: u64 {
10333        /// `VPM_V<m>` bit 0.
10334        const VPM_V0 = 1 << 0;
10335        /// `VPM_V<m>` bit 1.
10336        const VPM_V1 = 1 << 1;
10337        /// `VPM_V<m>` bit 2.
10338        const VPM_V2 = 1 << 2;
10339        /// `VPM_V<m>` bit 3.
10340        const VPM_V3 = 1 << 3;
10341        /// `VPM_V<m>` bit 4.
10342        const VPM_V4 = 1 << 4;
10343        /// `VPM_V<m>` bit 5.
10344        const VPM_V5 = 1 << 5;
10345        /// `VPM_V<m>` bit 6.
10346        const VPM_V6 = 1 << 6;
10347        /// `VPM_V<m>` bit 7.
10348        const VPM_V7 = 1 << 7;
10349        /// `VPM_V<m>` bit 8.
10350        const VPM_V8 = 1 << 8;
10351        /// `VPM_V<m>` bit 9.
10352        const VPM_V9 = 1 << 9;
10353        /// `VPM_V<m>` bit 10.
10354        const VPM_V10 = 1 << 10;
10355        /// `VPM_V<m>` bit 11.
10356        const VPM_V11 = 1 << 11;
10357        /// `VPM_V<m>` bit 12.
10358        const VPM_V12 = 1 << 12;
10359        /// `VPM_V<m>` bit 13.
10360        const VPM_V13 = 1 << 13;
10361        /// `VPM_V<m>` bit 14.
10362        const VPM_V14 = 1 << 14;
10363        /// `VPM_V<m>` bit 15.
10364        const VPM_V15 = 1 << 15;
10365        /// `VPM_V<m>` bit 16.
10366        const VPM_V16 = 1 << 16;
10367        /// `VPM_V<m>` bit 17.
10368        const VPM_V17 = 1 << 17;
10369        /// `VPM_V<m>` bit 18.
10370        const VPM_V18 = 1 << 18;
10371        /// `VPM_V<m>` bit 19.
10372        const VPM_V19 = 1 << 19;
10373        /// `VPM_V<m>` bit 20.
10374        const VPM_V20 = 1 << 20;
10375        /// `VPM_V<m>` bit 21.
10376        const VPM_V21 = 1 << 21;
10377        /// `VPM_V<m>` bit 22.
10378        const VPM_V22 = 1 << 22;
10379        /// `VPM_V<m>` bit 23.
10380        const VPM_V23 = 1 << 23;
10381        /// `VPM_V<m>` bit 24.
10382        const VPM_V24 = 1 << 24;
10383        /// `VPM_V<m>` bit 25.
10384        const VPM_V25 = 1 << 25;
10385        /// `VPM_V<m>` bit 26.
10386        const VPM_V26 = 1 << 26;
10387        /// `VPM_V<m>` bit 27.
10388        const VPM_V27 = 1 << 27;
10389        /// `VPM_V<m>` bit 28.
10390        const VPM_V28 = 1 << 28;
10391        /// `VPM_V<m>` bit 29.
10392        const VPM_V29 = 1 << 29;
10393        /// `VPM_V<m>` bit 30.
10394        const VPM_V30 = 1 << 30;
10395        /// `VPM_V<m>` bit 31.
10396        const VPM_V31 = 1 << 31;
10397    }
10398}
10399
10400#[cfg(feature = "el2")]
10401impl MpamvpmvEl2 {
10402    /// Offset of the `VPM_V<m>` field.
10403    pub const VPM_V_SHIFT: u32 = 0;
10404}
10405
10406bitflags! {
10407    /// `MPIDR` system register value.
10408    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10409    #[repr(transparent)]
10410    pub struct Mpidr: u32 {
10411        /// `MT` bit.
10412        const MT = 1 << 24;
10413        /// `U` bit.
10414        const U = 1 << 30;
10415        /// `M` bit.
10416        const M = 1 << 31;
10417    }
10418}
10419
10420impl Mpidr {
10421    /// Offset of the `Aff0` field.
10422    pub const AFF0_SHIFT: u32 = 0;
10423    /// Mask for the `Aff0` field.
10424    pub const AFF0_MASK: u32 = 0b11111111;
10425    /// Offset of the `Aff1` field.
10426    pub const AFF1_SHIFT: u32 = 8;
10427    /// Mask for the `Aff1` field.
10428    pub const AFF1_MASK: u32 = 0b11111111;
10429    /// Offset of the `Aff2` field.
10430    pub const AFF2_SHIFT: u32 = 16;
10431    /// Mask for the `Aff2` field.
10432    pub const AFF2_MASK: u32 = 0b11111111;
10433    /// Offset of the `MT` field.
10434    pub const MT_SHIFT: u32 = 24;
10435    /// Offset of the `U` field.
10436    pub const U_SHIFT: u32 = 30;
10437    /// Offset of the `M` field.
10438    pub const M_SHIFT: u32 = 31;
10439
10440    /// Returns the value of the `Aff0` field.
10441    pub const fn aff0(self) -> u8 {
10442        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
10443    }
10444
10445    /// Returns the value of the `Aff1` field.
10446    pub const fn aff1(self) -> u8 {
10447        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
10448    }
10449
10450    /// Returns the value of the `Aff2` field.
10451    pub const fn aff2(self) -> u8 {
10452        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
10453    }
10454}
10455
10456#[cfg(feature = "el1")]
10457bitflags! {
10458    /// `MPIDR_EL1` system register value.
10459    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10460    #[repr(transparent)]
10461    pub struct MpidrEl1: u64 {
10462        /// RES1 bits in the `MPIDR_EL1` register.
10463        const RES1 = 0b10000000000000000000000000000000;
10464        /// `MT` bit.
10465        const MT = 1 << 24;
10466        /// `U` bit.
10467        const U = 1 << 30;
10468    }
10469}
10470
10471#[cfg(feature = "el1")]
10472impl MpidrEl1 {
10473    /// Offset of the `Aff0` field.
10474    pub const AFF0_SHIFT: u32 = 0;
10475    /// Mask for the `Aff0` field.
10476    pub const AFF0_MASK: u64 = 0b11111111;
10477    /// Offset of the `Aff1` field.
10478    pub const AFF1_SHIFT: u32 = 8;
10479    /// Mask for the `Aff1` field.
10480    pub const AFF1_MASK: u64 = 0b11111111;
10481    /// Offset of the `Aff2` field.
10482    pub const AFF2_SHIFT: u32 = 16;
10483    /// Mask for the `Aff2` field.
10484    pub const AFF2_MASK: u64 = 0b11111111;
10485    /// Offset of the `MT` field.
10486    pub const MT_SHIFT: u32 = 24;
10487    /// Offset of the `U` field.
10488    pub const U_SHIFT: u32 = 30;
10489    /// Offset of the `Aff3` field.
10490    pub const AFF3_SHIFT: u32 = 32;
10491    /// Mask for the `Aff3` field.
10492    pub const AFF3_MASK: u64 = 0b11111111;
10493
10494    /// Returns the value of the `Aff0` field.
10495    pub const fn aff0(self) -> u8 {
10496        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
10497    }
10498
10499    /// Returns the value of the `Aff1` field.
10500    pub const fn aff1(self) -> u8 {
10501        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
10502    }
10503
10504    /// Returns the value of the `Aff2` field.
10505    pub const fn aff2(self) -> u8 {
10506        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
10507    }
10508
10509    /// Returns the value of the `Aff3` field.
10510    pub const fn aff3(self) -> u8 {
10511        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
10512    }
10513}
10514
10515bitflags! {
10516    /// `MVBAR` system register value.
10517    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10518    #[repr(transparent)]
10519    pub struct Mvbar: u32 {
10520    }
10521}
10522
10523impl Mvbar {
10524    /// Offset of the `Reserved` field.
10525    pub const RESERVED_SHIFT: u32 = 0;
10526    /// Mask for the `Reserved` field.
10527    pub const RESERVED_MASK: u32 = 0b11111;
10528    /// Offset of the `VBA` field.
10529    pub const VBA_SHIFT: u32 = 5;
10530    /// Mask for the `VBA` field.
10531    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
10532
10533    /// Returns the value of the `Reserved` field.
10534    pub const fn reserved(self) -> u8 {
10535        ((self.bits() >> Self::RESERVED_SHIFT) & 0b11111) as u8
10536    }
10537
10538    /// Returns the value of the `VBA` field.
10539    pub const fn vba(self) -> u32 {
10540        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
10541    }
10542}
10543
10544bitflags! {
10545    /// `NMRR` system register value.
10546    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10547    #[repr(transparent)]
10548    pub struct Nmrr: u32 {
10549    }
10550}
10551
10552impl Nmrr {
10553    /// Offset of the `IR<n>` field.
10554    pub const IR_SHIFT: u32 = 0;
10555    /// Mask for the `IR<n>` field.
10556    pub const IR_MASK: u32 = 0b11;
10557    /// Offset of the `OR<n>` field.
10558    pub const OR_SHIFT: u32 = 16;
10559    /// Mask for the `OR<n>` field.
10560    pub const OR_MASK: u32 = 0b11;
10561
10562    /// Returns the value of the given `IR<n>` field.
10563    pub const fn ir(self, n: u32) -> u8 {
10564        assert!(n < 8);
10565        ((self.bits() >> (Self::IR_SHIFT + (n - 0) * 2)) & 0b11) as u8
10566    }
10567
10568    /// Returns the value of the given `OR<n>` field.
10569    pub const fn or(self, n: u32) -> u8 {
10570        assert!(n < 8);
10571        ((self.bits() >> (Self::OR_SHIFT + (n - 0) * 2)) & 0b11) as u8
10572    }
10573}
10574
10575bitflags! {
10576    /// `NSACR` system register value.
10577    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10578    #[repr(transparent)]
10579    pub struct Nsacr: u32 {
10580        /// `cp10` bit.
10581        const CP10 = 1 << 10;
10582        /// `cp11` bit.
10583        const CP11 = 1 << 11;
10584        /// `NSASEDIS` bit.
10585        const NSASEDIS = 1 << 15;
10586        /// `NSTRCDIS` bit.
10587        const NSTRCDIS = 1 << 20;
10588    }
10589}
10590
10591impl Nsacr {
10592    /// Offset of the `cp10` field.
10593    pub const CP10_SHIFT: u32 = 10;
10594    /// Offset of the `cp11` field.
10595    pub const CP11_SHIFT: u32 = 11;
10596    /// Offset of the `NSASEDIS` field.
10597    pub const NSASEDIS_SHIFT: u32 = 15;
10598    /// Offset of the `NSTRCDIS` field.
10599    pub const NSTRCDIS_SHIFT: u32 = 20;
10600}
10601
10602bitflags! {
10603    /// `PAR` system register value.
10604    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10605    #[repr(transparent)]
10606    pub struct Par: u64 {
10607        /// `F` bit.
10608        const F = 1 << 0;
10609        /// `SS` bit.
10610        const SS = 1 << 1;
10611        /// `FS[5]` bit.
10612        const FS_5 = 1 << 6;
10613        /// `S2WLK` bit.
10614        const S2WLK = 1 << 8;
10615        /// `FSTAGE` bit.
10616        const FSTAGE = 1 << 9;
10617        /// `NS` bit.
10618        const NS = 1 << 9;
10619        /// `NOS` bit.
10620        const NOS = 1 << 10;
10621        /// `LPAE` bit.
10622        const LPAE = 1 << 11;
10623    }
10624}
10625
10626impl Par {
10627    /// Offset of the `F` field.
10628    pub const F_SHIFT: u32 = 0;
10629    /// Offset of the `FST` field.
10630    pub const FST_SHIFT: u32 = 1;
10631    /// Mask for the `FST` field.
10632    pub const FST_MASK: u64 = 0b111111;
10633    /// Offset of the `FS[4:0]` field.
10634    pub const FS_4_0_SHIFT: u32 = 1;
10635    /// Mask for the `FS[4:0]` field.
10636    pub const FS_4_0_MASK: u64 = 0b11111;
10637    /// Offset of the `SS` field.
10638    pub const SS_SHIFT: u32 = 1;
10639    /// Offset of the `Outer[1:0]` field.
10640    pub const OUTER_1_0_SHIFT: u32 = 2;
10641    /// Mask for the `Outer[1:0]` field.
10642    pub const OUTER_1_0_MASK: u64 = 0b11;
10643    /// Offset of the `Inner[2:0]` field.
10644    pub const INNER_2_0_SHIFT: u32 = 4;
10645    /// Mask for the `Inner[2:0]` field.
10646    pub const INNER_2_0_MASK: u64 = 0b111;
10647    /// Offset of the `FS[5]` field.
10648    pub const FS_5_SHIFT: u32 = 6;
10649    /// Offset of the `S2WLK` field.
10650    pub const S2WLK_SHIFT: u32 = 8;
10651    /// Offset of the `FSTAGE` field.
10652    pub const FSTAGE_SHIFT: u32 = 9;
10653    /// Offset of the `NS` field.
10654    pub const NS_SHIFT: u32 = 9;
10655    /// Offset of the `NOS` field.
10656    pub const NOS_SHIFT: u32 = 10;
10657    /// Offset of the `LPAE` field.
10658    pub const LPAE_SHIFT: u32 = 11;
10659    /// Offset of the `ATTR` field.
10660    pub const ATTR_SHIFT: u32 = 56;
10661    /// Mask for the `ATTR` field.
10662    pub const ATTR_MASK: u64 = 0b11111111;
10663
10664    /// Returns the value of the `FST` field.
10665    pub const fn fst(self) -> u8 {
10666        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
10667    }
10668
10669    /// Returns the value of the `FS[4:0]` field.
10670    pub const fn fs_4_0(self) -> u8 {
10671        ((self.bits() >> Self::FS_4_0_SHIFT) & 0b11111) as u8
10672    }
10673
10674    /// Returns the value of the `Outer[1:0]` field.
10675    pub const fn outer_1_0(self) -> u8 {
10676        ((self.bits() >> Self::OUTER_1_0_SHIFT) & 0b11) as u8
10677    }
10678
10679    /// Returns the value of the `Inner[2:0]` field.
10680    pub const fn inner_2_0(self) -> u8 {
10681        ((self.bits() >> Self::INNER_2_0_SHIFT) & 0b111) as u8
10682    }
10683
10684    /// Returns the value of the `ATTR` field.
10685    pub const fn attr(self) -> u8 {
10686        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
10687    }
10688}
10689
10690#[cfg(feature = "el1")]
10691bitflags! {
10692    /// `PAR_EL1` system register value.
10693    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10694    #[repr(transparent)]
10695    pub struct ParEl1: u64 {
10696        /// RES1 bits in the `PAR_EL1` register.
10697        const RES1 = 0b100000000000;
10698        /// `F` bit.
10699        const F = 1 << 0;
10700        /// `PTW` bit.
10701        const PTW = 1 << 8;
10702        /// `NS` bit.
10703        const NS = 1 << 9;
10704        /// `S` bit.
10705        const S = 1 << 9;
10706        /// `NSE` bit.
10707        const NSE = 1 << 11;
10708        /// `AssuredOnly` bit.
10709        const ASSUREDONLY = 1 << 12;
10710        /// `TopLevel` bit.
10711        const TOPLEVEL = 1 << 13;
10712        /// `Overlay` bit.
10713        const OVERLAY = 1 << 14;
10714        /// `DirtyBit` bit.
10715        const DIRTYBIT = 1 << 15;
10716    }
10717}
10718
10719#[cfg(feature = "el1")]
10720impl ParEl1 {
10721    /// Offset of the `F` field.
10722    pub const F_SHIFT: u32 = 0;
10723    /// Offset of the `FST` field.
10724    pub const FST_SHIFT: u32 = 1;
10725    /// Mask for the `FST` field.
10726    pub const FST_MASK: u64 = 0b111111;
10727    /// Offset of the `SH` field.
10728    pub const SH_SHIFT: u32 = 7;
10729    /// Mask for the `SH` field.
10730    pub const SH_MASK: u64 = 0b11;
10731    /// Offset of the `PTW` field.
10732    pub const PTW_SHIFT: u32 = 8;
10733    /// Offset of the `NS` field.
10734    pub const NS_SHIFT: u32 = 9;
10735    /// Offset of the `S` field.
10736    pub const S_SHIFT: u32 = 9;
10737    /// Offset of the `NSE` field.
10738    pub const NSE_SHIFT: u32 = 11;
10739    /// Offset of the `AssuredOnly` field.
10740    pub const ASSUREDONLY_SHIFT: u32 = 12;
10741    /// Offset of the `PA[47:12]` field.
10742    pub const PA_47_12_SHIFT: u32 = 12;
10743    /// Mask for the `PA[47:12]` field.
10744    pub const PA_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
10745    /// Offset of the `TopLevel` field.
10746    pub const TOPLEVEL_SHIFT: u32 = 13;
10747    /// Offset of the `Overlay` field.
10748    pub const OVERLAY_SHIFT: u32 = 14;
10749    /// Offset of the `DirtyBit` field.
10750    pub const DIRTYBIT_SHIFT: u32 = 15;
10751    /// Offset of the `PA[51:48]` field.
10752    pub const PA_51_48_SHIFT: u32 = 48;
10753    /// Mask for the `PA[51:48]` field.
10754    pub const PA_51_48_MASK: u64 = 0b1111;
10755    /// Offset of the `ATTR` field.
10756    pub const ATTR_SHIFT: u32 = 56;
10757    /// Mask for the `ATTR` field.
10758    pub const ATTR_MASK: u64 = 0b11111111;
10759
10760    /// Returns the value of the `FST` field.
10761    pub const fn fst(self) -> u8 {
10762        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
10763    }
10764
10765    /// Returns the value of the `SH` field.
10766    pub const fn sh(self) -> u8 {
10767        ((self.bits() >> Self::SH_SHIFT) & 0b11) as u8
10768    }
10769
10770    /// Returns the value of the `PA[47:12]` field.
10771    pub const fn pa_47_12(self) -> u64 {
10772        ((self.bits() >> Self::PA_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
10773    }
10774
10775    /// Returns the value of the `PA[51:48]` field.
10776    pub const fn pa_51_48(self) -> u8 {
10777        ((self.bits() >> Self::PA_51_48_SHIFT) & 0b1111) as u8
10778    }
10779
10780    /// Returns the value of the `ATTR` field.
10781    pub const fn attr(self) -> u8 {
10782        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
10783    }
10784}
10785
10786bitflags! {
10787    /// `PMCCFILTR` system register value.
10788    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10789    #[repr(transparent)]
10790    pub struct Pmccfiltr: u32 {
10791        /// `RLU` bit.
10792        const RLU = 1 << 21;
10793        /// `NSH` bit.
10794        const NSH = 1 << 27;
10795        /// `NSU` bit.
10796        const NSU = 1 << 28;
10797        /// `NSK` bit.
10798        const NSK = 1 << 29;
10799        /// `U` bit.
10800        const U = 1 << 30;
10801        /// `P` bit.
10802        const P = 1 << 31;
10803    }
10804}
10805
10806impl Pmccfiltr {
10807    /// Offset of the `RLU` field.
10808    pub const RLU_SHIFT: u32 = 21;
10809    /// Offset of the `NSH` field.
10810    pub const NSH_SHIFT: u32 = 27;
10811    /// Offset of the `NSU` field.
10812    pub const NSU_SHIFT: u32 = 28;
10813    /// Offset of the `NSK` field.
10814    pub const NSK_SHIFT: u32 = 29;
10815    /// Offset of the `U` field.
10816    pub const U_SHIFT: u32 = 30;
10817    /// Offset of the `P` field.
10818    pub const P_SHIFT: u32 = 31;
10819}
10820
10821bitflags! {
10822    /// `PMCCNTR` system register value.
10823    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10824    #[repr(transparent)]
10825    pub struct Pmccntr: u64 {
10826    }
10827}
10828
10829impl Pmccntr {
10830    /// Offset of the `CCNT` field.
10831    pub const CCNT_SHIFT: u32 = 0;
10832    /// Mask for the `CCNT` field.
10833    pub const CCNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
10834
10835    /// Returns the value of the `CCNT` field.
10836    pub const fn ccnt(self) -> u64 {
10837        ((self.bits() >> Self::CCNT_SHIFT)
10838            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
10839    }
10840}
10841
10842bitflags! {
10843    /// `PMCEID0` system register value.
10844    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10845    #[repr(transparent)]
10846    pub struct Pmceid0: u32 {
10847        /// `ID<n>` bit 0.
10848        const ID0 = 1 << 0;
10849        /// `ID<n>` bit 1.
10850        const ID1 = 1 << 1;
10851        /// `ID<n>` bit 2.
10852        const ID2 = 1 << 2;
10853        /// `ID<n>` bit 3.
10854        const ID3 = 1 << 3;
10855        /// `ID<n>` bit 4.
10856        const ID4 = 1 << 4;
10857        /// `ID<n>` bit 5.
10858        const ID5 = 1 << 5;
10859        /// `ID<n>` bit 6.
10860        const ID6 = 1 << 6;
10861        /// `ID<n>` bit 7.
10862        const ID7 = 1 << 7;
10863        /// `ID<n>` bit 8.
10864        const ID8 = 1 << 8;
10865        /// `ID<n>` bit 9.
10866        const ID9 = 1 << 9;
10867        /// `ID<n>` bit 10.
10868        const ID10 = 1 << 10;
10869        /// `ID<n>` bit 11.
10870        const ID11 = 1 << 11;
10871        /// `ID<n>` bit 12.
10872        const ID12 = 1 << 12;
10873        /// `ID<n>` bit 13.
10874        const ID13 = 1 << 13;
10875        /// `ID<n>` bit 14.
10876        const ID14 = 1 << 14;
10877        /// `ID<n>` bit 15.
10878        const ID15 = 1 << 15;
10879        /// `ID<n>` bit 16.
10880        const ID16 = 1 << 16;
10881        /// `ID<n>` bit 17.
10882        const ID17 = 1 << 17;
10883        /// `ID<n>` bit 18.
10884        const ID18 = 1 << 18;
10885        /// `ID<n>` bit 19.
10886        const ID19 = 1 << 19;
10887        /// `ID<n>` bit 20.
10888        const ID20 = 1 << 20;
10889        /// `ID<n>` bit 21.
10890        const ID21 = 1 << 21;
10891        /// `ID<n>` bit 22.
10892        const ID22 = 1 << 22;
10893        /// `ID<n>` bit 23.
10894        const ID23 = 1 << 23;
10895        /// `ID<n>` bit 24.
10896        const ID24 = 1 << 24;
10897        /// `ID<n>` bit 25.
10898        const ID25 = 1 << 25;
10899        /// `ID<n>` bit 26.
10900        const ID26 = 1 << 26;
10901        /// `ID<n>` bit 27.
10902        const ID27 = 1 << 27;
10903        /// `ID<n>` bit 28.
10904        const ID28 = 1 << 28;
10905        /// `ID<n>` bit 29.
10906        const ID29 = 1 << 29;
10907        /// `ID<n>` bit 30.
10908        const ID30 = 1 << 30;
10909        /// `ID<n>` bit 31.
10910        const ID31 = 1 << 31;
10911    }
10912}
10913
10914impl Pmceid0 {
10915    /// Offset of the `ID<n>` field.
10916    pub const ID_SHIFT: u32 = 0;
10917}
10918
10919bitflags! {
10920    /// `PMCEID1` system register value.
10921    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10922    #[repr(transparent)]
10923    pub struct Pmceid1: u32 {
10924        /// `ID<n>` bit 0.
10925        const ID0 = 1 << 0;
10926        /// `ID<n>` bit 1.
10927        const ID1 = 1 << 1;
10928        /// `ID<n>` bit 2.
10929        const ID2 = 1 << 2;
10930        /// `ID<n>` bit 3.
10931        const ID3 = 1 << 3;
10932        /// `ID<n>` bit 4.
10933        const ID4 = 1 << 4;
10934        /// `ID<n>` bit 5.
10935        const ID5 = 1 << 5;
10936        /// `ID<n>` bit 6.
10937        const ID6 = 1 << 6;
10938        /// `ID<n>` bit 7.
10939        const ID7 = 1 << 7;
10940        /// `ID<n>` bit 8.
10941        const ID8 = 1 << 8;
10942        /// `ID<n>` bit 9.
10943        const ID9 = 1 << 9;
10944        /// `ID<n>` bit 10.
10945        const ID10 = 1 << 10;
10946        /// `ID<n>` bit 11.
10947        const ID11 = 1 << 11;
10948        /// `ID<n>` bit 12.
10949        const ID12 = 1 << 12;
10950        /// `ID<n>` bit 13.
10951        const ID13 = 1 << 13;
10952        /// `ID<n>` bit 14.
10953        const ID14 = 1 << 14;
10954        /// `ID<n>` bit 15.
10955        const ID15 = 1 << 15;
10956        /// `ID<n>` bit 16.
10957        const ID16 = 1 << 16;
10958        /// `ID<n>` bit 17.
10959        const ID17 = 1 << 17;
10960        /// `ID<n>` bit 18.
10961        const ID18 = 1 << 18;
10962        /// `ID<n>` bit 19.
10963        const ID19 = 1 << 19;
10964        /// `ID<n>` bit 20.
10965        const ID20 = 1 << 20;
10966        /// `ID<n>` bit 21.
10967        const ID21 = 1 << 21;
10968        /// `ID<n>` bit 22.
10969        const ID22 = 1 << 22;
10970        /// `ID<n>` bit 23.
10971        const ID23 = 1 << 23;
10972        /// `ID<n>` bit 24.
10973        const ID24 = 1 << 24;
10974        /// `ID<n>` bit 25.
10975        const ID25 = 1 << 25;
10976        /// `ID<n>` bit 26.
10977        const ID26 = 1 << 26;
10978        /// `ID<n>` bit 27.
10979        const ID27 = 1 << 27;
10980        /// `ID<n>` bit 28.
10981        const ID28 = 1 << 28;
10982        /// `ID<n>` bit 29.
10983        const ID29 = 1 << 29;
10984        /// `ID<n>` bit 30.
10985        const ID30 = 1 << 30;
10986        /// `ID<n>` bit 31.
10987        const ID31 = 1 << 31;
10988    }
10989}
10990
10991impl Pmceid1 {
10992    /// Offset of the `ID<n>` field.
10993    pub const ID_SHIFT: u32 = 0;
10994}
10995
10996bitflags! {
10997    /// `PMCEID2` system register value.
10998    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
10999    #[repr(transparent)]
11000    pub struct Pmceid2: u32 {
11001        /// `IDhi<n>` bit 0.
11002        const IDHI0 = 1 << 0;
11003        /// `IDhi<n>` bit 1.
11004        const IDHI1 = 1 << 1;
11005        /// `IDhi<n>` bit 2.
11006        const IDHI2 = 1 << 2;
11007        /// `IDhi<n>` bit 3.
11008        const IDHI3 = 1 << 3;
11009        /// `IDhi<n>` bit 4.
11010        const IDHI4 = 1 << 4;
11011        /// `IDhi<n>` bit 5.
11012        const IDHI5 = 1 << 5;
11013        /// `IDhi<n>` bit 6.
11014        const IDHI6 = 1 << 6;
11015        /// `IDhi<n>` bit 7.
11016        const IDHI7 = 1 << 7;
11017        /// `IDhi<n>` bit 8.
11018        const IDHI8 = 1 << 8;
11019        /// `IDhi<n>` bit 9.
11020        const IDHI9 = 1 << 9;
11021        /// `IDhi<n>` bit 10.
11022        const IDHI10 = 1 << 10;
11023        /// `IDhi<n>` bit 11.
11024        const IDHI11 = 1 << 11;
11025        /// `IDhi<n>` bit 12.
11026        const IDHI12 = 1 << 12;
11027        /// `IDhi<n>` bit 13.
11028        const IDHI13 = 1 << 13;
11029        /// `IDhi<n>` bit 14.
11030        const IDHI14 = 1 << 14;
11031        /// `IDhi<n>` bit 15.
11032        const IDHI15 = 1 << 15;
11033        /// `IDhi<n>` bit 16.
11034        const IDHI16 = 1 << 16;
11035        /// `IDhi<n>` bit 17.
11036        const IDHI17 = 1 << 17;
11037        /// `IDhi<n>` bit 18.
11038        const IDHI18 = 1 << 18;
11039        /// `IDhi<n>` bit 19.
11040        const IDHI19 = 1 << 19;
11041        /// `IDhi<n>` bit 20.
11042        const IDHI20 = 1 << 20;
11043        /// `IDhi<n>` bit 21.
11044        const IDHI21 = 1 << 21;
11045        /// `IDhi<n>` bit 22.
11046        const IDHI22 = 1 << 22;
11047        /// `IDhi<n>` bit 23.
11048        const IDHI23 = 1 << 23;
11049        /// `IDhi<n>` bit 24.
11050        const IDHI24 = 1 << 24;
11051        /// `IDhi<n>` bit 25.
11052        const IDHI25 = 1 << 25;
11053        /// `IDhi<n>` bit 26.
11054        const IDHI26 = 1 << 26;
11055        /// `IDhi<n>` bit 27.
11056        const IDHI27 = 1 << 27;
11057        /// `IDhi<n>` bit 28.
11058        const IDHI28 = 1 << 28;
11059        /// `IDhi<n>` bit 29.
11060        const IDHI29 = 1 << 29;
11061        /// `IDhi<n>` bit 30.
11062        const IDHI30 = 1 << 30;
11063        /// `IDhi<n>` bit 31.
11064        const IDHI31 = 1 << 31;
11065    }
11066}
11067
11068impl Pmceid2 {
11069    /// Offset of the `IDhi<n>` field.
11070    pub const IDHI_SHIFT: u32 = 0;
11071}
11072
11073bitflags! {
11074    /// `PMCEID3` system register value.
11075    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11076    #[repr(transparent)]
11077    pub struct Pmceid3: u32 {
11078        /// `IDhi<n>` bit 0.
11079        const IDHI0 = 1 << 0;
11080        /// `IDhi<n>` bit 1.
11081        const IDHI1 = 1 << 1;
11082        /// `IDhi<n>` bit 2.
11083        const IDHI2 = 1 << 2;
11084        /// `IDhi<n>` bit 3.
11085        const IDHI3 = 1 << 3;
11086        /// `IDhi<n>` bit 4.
11087        const IDHI4 = 1 << 4;
11088        /// `IDhi<n>` bit 5.
11089        const IDHI5 = 1 << 5;
11090        /// `IDhi<n>` bit 6.
11091        const IDHI6 = 1 << 6;
11092        /// `IDhi<n>` bit 7.
11093        const IDHI7 = 1 << 7;
11094        /// `IDhi<n>` bit 8.
11095        const IDHI8 = 1 << 8;
11096        /// `IDhi<n>` bit 9.
11097        const IDHI9 = 1 << 9;
11098        /// `IDhi<n>` bit 10.
11099        const IDHI10 = 1 << 10;
11100        /// `IDhi<n>` bit 11.
11101        const IDHI11 = 1 << 11;
11102        /// `IDhi<n>` bit 12.
11103        const IDHI12 = 1 << 12;
11104        /// `IDhi<n>` bit 13.
11105        const IDHI13 = 1 << 13;
11106        /// `IDhi<n>` bit 14.
11107        const IDHI14 = 1 << 14;
11108        /// `IDhi<n>` bit 15.
11109        const IDHI15 = 1 << 15;
11110        /// `IDhi<n>` bit 16.
11111        const IDHI16 = 1 << 16;
11112        /// `IDhi<n>` bit 17.
11113        const IDHI17 = 1 << 17;
11114        /// `IDhi<n>` bit 18.
11115        const IDHI18 = 1 << 18;
11116        /// `IDhi<n>` bit 19.
11117        const IDHI19 = 1 << 19;
11118        /// `IDhi<n>` bit 20.
11119        const IDHI20 = 1 << 20;
11120        /// `IDhi<n>` bit 21.
11121        const IDHI21 = 1 << 21;
11122        /// `IDhi<n>` bit 22.
11123        const IDHI22 = 1 << 22;
11124        /// `IDhi<n>` bit 23.
11125        const IDHI23 = 1 << 23;
11126        /// `IDhi<n>` bit 24.
11127        const IDHI24 = 1 << 24;
11128        /// `IDhi<n>` bit 25.
11129        const IDHI25 = 1 << 25;
11130        /// `IDhi<n>` bit 26.
11131        const IDHI26 = 1 << 26;
11132        /// `IDhi<n>` bit 27.
11133        const IDHI27 = 1 << 27;
11134        /// `IDhi<n>` bit 28.
11135        const IDHI28 = 1 << 28;
11136        /// `IDhi<n>` bit 29.
11137        const IDHI29 = 1 << 29;
11138        /// `IDhi<n>` bit 30.
11139        const IDHI30 = 1 << 30;
11140        /// `IDhi<n>` bit 31.
11141        const IDHI31 = 1 << 31;
11142    }
11143}
11144
11145impl Pmceid3 {
11146    /// Offset of the `IDhi<n>` field.
11147    pub const IDHI_SHIFT: u32 = 0;
11148}
11149
11150bitflags! {
11151    /// `PMCNTENCLR` system register value.
11152    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11153    #[repr(transparent)]
11154    pub struct Pmcntenclr: u32 {
11155        /// `P<m>` bit 0.
11156        const P0 = 1 << 0;
11157        /// `P<m>` bit 1.
11158        const P1 = 1 << 1;
11159        /// `P<m>` bit 2.
11160        const P2 = 1 << 2;
11161        /// `P<m>` bit 3.
11162        const P3 = 1 << 3;
11163        /// `P<m>` bit 4.
11164        const P4 = 1 << 4;
11165        /// `P<m>` bit 5.
11166        const P5 = 1 << 5;
11167        /// `P<m>` bit 6.
11168        const P6 = 1 << 6;
11169        /// `P<m>` bit 7.
11170        const P7 = 1 << 7;
11171        /// `P<m>` bit 8.
11172        const P8 = 1 << 8;
11173        /// `P<m>` bit 9.
11174        const P9 = 1 << 9;
11175        /// `P<m>` bit 10.
11176        const P10 = 1 << 10;
11177        /// `P<m>` bit 11.
11178        const P11 = 1 << 11;
11179        /// `P<m>` bit 12.
11180        const P12 = 1 << 12;
11181        /// `P<m>` bit 13.
11182        const P13 = 1 << 13;
11183        /// `P<m>` bit 14.
11184        const P14 = 1 << 14;
11185        /// `P<m>` bit 15.
11186        const P15 = 1 << 15;
11187        /// `P<m>` bit 16.
11188        const P16 = 1 << 16;
11189        /// `P<m>` bit 17.
11190        const P17 = 1 << 17;
11191        /// `P<m>` bit 18.
11192        const P18 = 1 << 18;
11193        /// `P<m>` bit 19.
11194        const P19 = 1 << 19;
11195        /// `P<m>` bit 20.
11196        const P20 = 1 << 20;
11197        /// `P<m>` bit 21.
11198        const P21 = 1 << 21;
11199        /// `P<m>` bit 22.
11200        const P22 = 1 << 22;
11201        /// `P<m>` bit 23.
11202        const P23 = 1 << 23;
11203        /// `P<m>` bit 24.
11204        const P24 = 1 << 24;
11205        /// `P<m>` bit 25.
11206        const P25 = 1 << 25;
11207        /// `P<m>` bit 26.
11208        const P26 = 1 << 26;
11209        /// `P<m>` bit 27.
11210        const P27 = 1 << 27;
11211        /// `P<m>` bit 28.
11212        const P28 = 1 << 28;
11213        /// `P<m>` bit 29.
11214        const P29 = 1 << 29;
11215        /// `P<m>` bit 30.
11216        const P30 = 1 << 30;
11217        /// `C` bit.
11218        const C = 1 << 31;
11219    }
11220}
11221
11222impl Pmcntenclr {
11223    /// Offset of the `P<m>` field.
11224    pub const P_SHIFT: u32 = 0;
11225    /// Offset of the `C` field.
11226    pub const C_SHIFT: u32 = 31;
11227}
11228
11229bitflags! {
11230    /// `PMCNTENSET` system register value.
11231    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11232    #[repr(transparent)]
11233    pub struct Pmcntenset: u32 {
11234        /// `P<m>` bit 0.
11235        const P0 = 1 << 0;
11236        /// `P<m>` bit 1.
11237        const P1 = 1 << 1;
11238        /// `P<m>` bit 2.
11239        const P2 = 1 << 2;
11240        /// `P<m>` bit 3.
11241        const P3 = 1 << 3;
11242        /// `P<m>` bit 4.
11243        const P4 = 1 << 4;
11244        /// `P<m>` bit 5.
11245        const P5 = 1 << 5;
11246        /// `P<m>` bit 6.
11247        const P6 = 1 << 6;
11248        /// `P<m>` bit 7.
11249        const P7 = 1 << 7;
11250        /// `P<m>` bit 8.
11251        const P8 = 1 << 8;
11252        /// `P<m>` bit 9.
11253        const P9 = 1 << 9;
11254        /// `P<m>` bit 10.
11255        const P10 = 1 << 10;
11256        /// `P<m>` bit 11.
11257        const P11 = 1 << 11;
11258        /// `P<m>` bit 12.
11259        const P12 = 1 << 12;
11260        /// `P<m>` bit 13.
11261        const P13 = 1 << 13;
11262        /// `P<m>` bit 14.
11263        const P14 = 1 << 14;
11264        /// `P<m>` bit 15.
11265        const P15 = 1 << 15;
11266        /// `P<m>` bit 16.
11267        const P16 = 1 << 16;
11268        /// `P<m>` bit 17.
11269        const P17 = 1 << 17;
11270        /// `P<m>` bit 18.
11271        const P18 = 1 << 18;
11272        /// `P<m>` bit 19.
11273        const P19 = 1 << 19;
11274        /// `P<m>` bit 20.
11275        const P20 = 1 << 20;
11276        /// `P<m>` bit 21.
11277        const P21 = 1 << 21;
11278        /// `P<m>` bit 22.
11279        const P22 = 1 << 22;
11280        /// `P<m>` bit 23.
11281        const P23 = 1 << 23;
11282        /// `P<m>` bit 24.
11283        const P24 = 1 << 24;
11284        /// `P<m>` bit 25.
11285        const P25 = 1 << 25;
11286        /// `P<m>` bit 26.
11287        const P26 = 1 << 26;
11288        /// `P<m>` bit 27.
11289        const P27 = 1 << 27;
11290        /// `P<m>` bit 28.
11291        const P28 = 1 << 28;
11292        /// `P<m>` bit 29.
11293        const P29 = 1 << 29;
11294        /// `P<m>` bit 30.
11295        const P30 = 1 << 30;
11296        /// `C` bit.
11297        const C = 1 << 31;
11298    }
11299}
11300
11301impl Pmcntenset {
11302    /// Offset of the `P<m>` field.
11303    pub const P_SHIFT: u32 = 0;
11304    /// Offset of the `C` field.
11305    pub const C_SHIFT: u32 = 31;
11306}
11307
11308bitflags! {
11309    /// `PMCR` system register value.
11310    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11311    #[repr(transparent)]
11312    pub struct Pmcr: u32 {
11313        /// `E` bit.
11314        const E = 1 << 0;
11315        /// `P` bit.
11316        const P = 1 << 1;
11317        /// `C` bit.
11318        const C = 1 << 2;
11319        /// `D` bit.
11320        const D = 1 << 3;
11321        /// `X` bit.
11322        const X = 1 << 4;
11323        /// `DP` bit.
11324        const DP = 1 << 5;
11325        /// `LC` bit.
11326        const LC = 1 << 6;
11327        /// `LP` bit.
11328        const LP = 1 << 7;
11329        /// `FZO` bit.
11330        const FZO = 1 << 9;
11331    }
11332}
11333
11334impl Pmcr {
11335    /// Offset of the `E` field.
11336    pub const E_SHIFT: u32 = 0;
11337    /// Offset of the `P` field.
11338    pub const P_SHIFT: u32 = 1;
11339    /// Offset of the `C` field.
11340    pub const C_SHIFT: u32 = 2;
11341    /// Offset of the `D` field.
11342    pub const D_SHIFT: u32 = 3;
11343    /// Offset of the `X` field.
11344    pub const X_SHIFT: u32 = 4;
11345    /// Offset of the `DP` field.
11346    pub const DP_SHIFT: u32 = 5;
11347    /// Offset of the `LC` field.
11348    pub const LC_SHIFT: u32 = 6;
11349    /// Offset of the `LP` field.
11350    pub const LP_SHIFT: u32 = 7;
11351    /// Offset of the `FZO` field.
11352    pub const FZO_SHIFT: u32 = 9;
11353    /// Offset of the `N` field.
11354    pub const N_SHIFT: u32 = 11;
11355    /// Mask for the `N` field.
11356    pub const N_MASK: u32 = 0b11111;
11357    /// Offset of the `IDCODE` field.
11358    pub const IDCODE_SHIFT: u32 = 16;
11359    /// Mask for the `IDCODE` field.
11360    pub const IDCODE_MASK: u32 = 0b11111111;
11361    /// Offset of the `IMP` field.
11362    pub const IMP_SHIFT: u32 = 24;
11363    /// Mask for the `IMP` field.
11364    pub const IMP_MASK: u32 = 0b11111111;
11365
11366    /// Returns the value of the `N` field.
11367    pub const fn n(self) -> u8 {
11368        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
11369    }
11370
11371    /// Returns the value of the `IDCODE` field.
11372    pub const fn idcode(self) -> u8 {
11373        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
11374    }
11375
11376    /// Returns the value of the `IMP` field.
11377    pub const fn imp(self) -> u8 {
11378        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
11379    }
11380}
11381
11382bitflags! {
11383    /// `PMCR_EL0` system register value.
11384    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11385    #[repr(transparent)]
11386    pub struct PmcrEl0: u64 {
11387        /// Enable. Affected counters are enabled by PMCNTENSET_EL0.
11388        const E = 1 << 0;
11389        /// Event counter reset. Reset all affected event counters PMEVCNTR<n>_EL0 to zero.
11390        const P = 1 << 1;
11391        /// Cycle counter reset. Reset PMCCNTR_EL0 to zero.
11392        const C = 1 << 2;
11393        /// Clock divider. If set PMCCNTR_EL0 counts once every 64 clock cycles.
11394        const D = 1 << 3;
11395        /// Enable export of events in an IMPLEMENTATION DEFINED PMU event export bus. If set, export events where not prohibited.
11396        const X = 1 << 4;
11397        /// If set, cycle counting by PMCCNTR_EL0 is disabled in prohibited regions.
11398        const DP = 1 << 5;
11399        /// `LC` bit.
11400        const LC = 1 << 6;
11401        /// `LP` bit.
11402        const LP = 1 << 7;
11403        /// `FZO` bit.
11404        const FZO = 1 << 9;
11405        /// `FZS` bit.
11406        const FZS = 1 << 32;
11407    }
11408}
11409
11410impl PmcrEl0 {
11411    /// Offset of the `E` field.
11412    pub const E_SHIFT: u32 = 0;
11413    /// Offset of the `P` field.
11414    pub const P_SHIFT: u32 = 1;
11415    /// Offset of the `C` field.
11416    pub const C_SHIFT: u32 = 2;
11417    /// Offset of the `D` field.
11418    pub const D_SHIFT: u32 = 3;
11419    /// Offset of the `X` field.
11420    pub const X_SHIFT: u32 = 4;
11421    /// Offset of the `DP` field.
11422    pub const DP_SHIFT: u32 = 5;
11423    /// Offset of the `LC` field.
11424    pub const LC_SHIFT: u32 = 6;
11425    /// Offset of the `LP` field.
11426    pub const LP_SHIFT: u32 = 7;
11427    /// Offset of the `FZO` field.
11428    pub const FZO_SHIFT: u32 = 9;
11429    /// Offset of the `N` field.
11430    pub const N_SHIFT: u32 = 11;
11431    /// Mask for the `N` field.
11432    pub const N_MASK: u64 = 0b11111;
11433    /// Offset of the `IDCODE` field.
11434    pub const IDCODE_SHIFT: u32 = 16;
11435    /// Mask for the `IDCODE` field.
11436    pub const IDCODE_MASK: u64 = 0b11111111;
11437    /// Offset of the `IMP` field.
11438    pub const IMP_SHIFT: u32 = 24;
11439    /// Mask for the `IMP` field.
11440    pub const IMP_MASK: u64 = 0b11111111;
11441    /// Offset of the `FZS` field.
11442    pub const FZS_SHIFT: u32 = 32;
11443
11444    /// Returns the value of the `N` field.
11445    pub const fn n(self) -> u8 {
11446        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
11447    }
11448
11449    /// Returns the value of the `IDCODE` field.
11450    pub const fn idcode(self) -> u8 {
11451        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
11452    }
11453
11454    /// Returns the value of the `IMP` field.
11455    pub const fn imp(self) -> u8 {
11456        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
11457    }
11458}
11459
11460bitflags! {
11461    /// `PMINTENCLR` system register value.
11462    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11463    #[repr(transparent)]
11464    pub struct Pmintenclr: u32 {
11465        /// `P<m>` bit 0.
11466        const P0 = 1 << 0;
11467        /// `P<m>` bit 1.
11468        const P1 = 1 << 1;
11469        /// `P<m>` bit 2.
11470        const P2 = 1 << 2;
11471        /// `P<m>` bit 3.
11472        const P3 = 1 << 3;
11473        /// `P<m>` bit 4.
11474        const P4 = 1 << 4;
11475        /// `P<m>` bit 5.
11476        const P5 = 1 << 5;
11477        /// `P<m>` bit 6.
11478        const P6 = 1 << 6;
11479        /// `P<m>` bit 7.
11480        const P7 = 1 << 7;
11481        /// `P<m>` bit 8.
11482        const P8 = 1 << 8;
11483        /// `P<m>` bit 9.
11484        const P9 = 1 << 9;
11485        /// `P<m>` bit 10.
11486        const P10 = 1 << 10;
11487        /// `P<m>` bit 11.
11488        const P11 = 1 << 11;
11489        /// `P<m>` bit 12.
11490        const P12 = 1 << 12;
11491        /// `P<m>` bit 13.
11492        const P13 = 1 << 13;
11493        /// `P<m>` bit 14.
11494        const P14 = 1 << 14;
11495        /// `P<m>` bit 15.
11496        const P15 = 1 << 15;
11497        /// `P<m>` bit 16.
11498        const P16 = 1 << 16;
11499        /// `P<m>` bit 17.
11500        const P17 = 1 << 17;
11501        /// `P<m>` bit 18.
11502        const P18 = 1 << 18;
11503        /// `P<m>` bit 19.
11504        const P19 = 1 << 19;
11505        /// `P<m>` bit 20.
11506        const P20 = 1 << 20;
11507        /// `P<m>` bit 21.
11508        const P21 = 1 << 21;
11509        /// `P<m>` bit 22.
11510        const P22 = 1 << 22;
11511        /// `P<m>` bit 23.
11512        const P23 = 1 << 23;
11513        /// `P<m>` bit 24.
11514        const P24 = 1 << 24;
11515        /// `P<m>` bit 25.
11516        const P25 = 1 << 25;
11517        /// `P<m>` bit 26.
11518        const P26 = 1 << 26;
11519        /// `P<m>` bit 27.
11520        const P27 = 1 << 27;
11521        /// `P<m>` bit 28.
11522        const P28 = 1 << 28;
11523        /// `P<m>` bit 29.
11524        const P29 = 1 << 29;
11525        /// `P<m>` bit 30.
11526        const P30 = 1 << 30;
11527        /// `C` bit.
11528        const C = 1 << 31;
11529    }
11530}
11531
11532impl Pmintenclr {
11533    /// Offset of the `P<m>` field.
11534    pub const P_SHIFT: u32 = 0;
11535    /// Offset of the `C` field.
11536    pub const C_SHIFT: u32 = 31;
11537}
11538
11539bitflags! {
11540    /// `PMINTENSET` system register value.
11541    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11542    #[repr(transparent)]
11543    pub struct Pmintenset: u32 {
11544        /// `P<m>` bit 0.
11545        const P0 = 1 << 0;
11546        /// `P<m>` bit 1.
11547        const P1 = 1 << 1;
11548        /// `P<m>` bit 2.
11549        const P2 = 1 << 2;
11550        /// `P<m>` bit 3.
11551        const P3 = 1 << 3;
11552        /// `P<m>` bit 4.
11553        const P4 = 1 << 4;
11554        /// `P<m>` bit 5.
11555        const P5 = 1 << 5;
11556        /// `P<m>` bit 6.
11557        const P6 = 1 << 6;
11558        /// `P<m>` bit 7.
11559        const P7 = 1 << 7;
11560        /// `P<m>` bit 8.
11561        const P8 = 1 << 8;
11562        /// `P<m>` bit 9.
11563        const P9 = 1 << 9;
11564        /// `P<m>` bit 10.
11565        const P10 = 1 << 10;
11566        /// `P<m>` bit 11.
11567        const P11 = 1 << 11;
11568        /// `P<m>` bit 12.
11569        const P12 = 1 << 12;
11570        /// `P<m>` bit 13.
11571        const P13 = 1 << 13;
11572        /// `P<m>` bit 14.
11573        const P14 = 1 << 14;
11574        /// `P<m>` bit 15.
11575        const P15 = 1 << 15;
11576        /// `P<m>` bit 16.
11577        const P16 = 1 << 16;
11578        /// `P<m>` bit 17.
11579        const P17 = 1 << 17;
11580        /// `P<m>` bit 18.
11581        const P18 = 1 << 18;
11582        /// `P<m>` bit 19.
11583        const P19 = 1 << 19;
11584        /// `P<m>` bit 20.
11585        const P20 = 1 << 20;
11586        /// `P<m>` bit 21.
11587        const P21 = 1 << 21;
11588        /// `P<m>` bit 22.
11589        const P22 = 1 << 22;
11590        /// `P<m>` bit 23.
11591        const P23 = 1 << 23;
11592        /// `P<m>` bit 24.
11593        const P24 = 1 << 24;
11594        /// `P<m>` bit 25.
11595        const P25 = 1 << 25;
11596        /// `P<m>` bit 26.
11597        const P26 = 1 << 26;
11598        /// `P<m>` bit 27.
11599        const P27 = 1 << 27;
11600        /// `P<m>` bit 28.
11601        const P28 = 1 << 28;
11602        /// `P<m>` bit 29.
11603        const P29 = 1 << 29;
11604        /// `P<m>` bit 30.
11605        const P30 = 1 << 30;
11606        /// `C` bit.
11607        const C = 1 << 31;
11608    }
11609}
11610
11611impl Pmintenset {
11612    /// Offset of the `P<m>` field.
11613    pub const P_SHIFT: u32 = 0;
11614    /// Offset of the `C` field.
11615    pub const C_SHIFT: u32 = 31;
11616}
11617
11618bitflags! {
11619    /// `PMMIR` system register value.
11620    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11621    #[repr(transparent)]
11622    pub struct Pmmir: u32 {
11623    }
11624}
11625
11626impl Pmmir {
11627    /// Offset of the `SLOTS` field.
11628    pub const SLOTS_SHIFT: u32 = 0;
11629    /// Mask for the `SLOTS` field.
11630    pub const SLOTS_MASK: u32 = 0b11111111;
11631    /// Offset of the `BUS_SLOTS` field.
11632    pub const BUS_SLOTS_SHIFT: u32 = 8;
11633    /// Mask for the `BUS_SLOTS` field.
11634    pub const BUS_SLOTS_MASK: u32 = 0b11111111;
11635    /// Offset of the `BUS_WIDTH` field.
11636    pub const BUS_WIDTH_SHIFT: u32 = 16;
11637    /// Mask for the `BUS_WIDTH` field.
11638    pub const BUS_WIDTH_MASK: u32 = 0b1111;
11639    /// Offset of the `THWIDTH` field.
11640    pub const THWIDTH_SHIFT: u32 = 20;
11641    /// Mask for the `THWIDTH` field.
11642    pub const THWIDTH_MASK: u32 = 0b1111;
11643    /// Offset of the `EDGE` field.
11644    pub const EDGE_SHIFT: u32 = 24;
11645    /// Mask for the `EDGE` field.
11646    pub const EDGE_MASK: u32 = 0b1111;
11647
11648    /// Returns the value of the `SLOTS` field.
11649    pub const fn slots(self) -> u8 {
11650        ((self.bits() >> Self::SLOTS_SHIFT) & 0b11111111) as u8
11651    }
11652
11653    /// Returns the value of the `BUS_SLOTS` field.
11654    pub const fn bus_slots(self) -> u8 {
11655        ((self.bits() >> Self::BUS_SLOTS_SHIFT) & 0b11111111) as u8
11656    }
11657
11658    /// Returns the value of the `BUS_WIDTH` field.
11659    pub const fn bus_width(self) -> u8 {
11660        ((self.bits() >> Self::BUS_WIDTH_SHIFT) & 0b1111) as u8
11661    }
11662
11663    /// Returns the value of the `THWIDTH` field.
11664    pub const fn thwidth(self) -> u8 {
11665        ((self.bits() >> Self::THWIDTH_SHIFT) & 0b1111) as u8
11666    }
11667
11668    /// Returns the value of the `EDGE` field.
11669    pub const fn edge(self) -> u8 {
11670        ((self.bits() >> Self::EDGE_SHIFT) & 0b1111) as u8
11671    }
11672}
11673
11674bitflags! {
11675    /// `PMOVSR` system register value.
11676    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11677    #[repr(transparent)]
11678    pub struct Pmovsr: u32 {
11679        /// `P<m>` bit 0.
11680        const P0 = 1 << 0;
11681        /// `P<m>` bit 1.
11682        const P1 = 1 << 1;
11683        /// `P<m>` bit 2.
11684        const P2 = 1 << 2;
11685        /// `P<m>` bit 3.
11686        const P3 = 1 << 3;
11687        /// `P<m>` bit 4.
11688        const P4 = 1 << 4;
11689        /// `P<m>` bit 5.
11690        const P5 = 1 << 5;
11691        /// `P<m>` bit 6.
11692        const P6 = 1 << 6;
11693        /// `P<m>` bit 7.
11694        const P7 = 1 << 7;
11695        /// `P<m>` bit 8.
11696        const P8 = 1 << 8;
11697        /// `P<m>` bit 9.
11698        const P9 = 1 << 9;
11699        /// `P<m>` bit 10.
11700        const P10 = 1 << 10;
11701        /// `P<m>` bit 11.
11702        const P11 = 1 << 11;
11703        /// `P<m>` bit 12.
11704        const P12 = 1 << 12;
11705        /// `P<m>` bit 13.
11706        const P13 = 1 << 13;
11707        /// `P<m>` bit 14.
11708        const P14 = 1 << 14;
11709        /// `P<m>` bit 15.
11710        const P15 = 1 << 15;
11711        /// `P<m>` bit 16.
11712        const P16 = 1 << 16;
11713        /// `P<m>` bit 17.
11714        const P17 = 1 << 17;
11715        /// `P<m>` bit 18.
11716        const P18 = 1 << 18;
11717        /// `P<m>` bit 19.
11718        const P19 = 1 << 19;
11719        /// `P<m>` bit 20.
11720        const P20 = 1 << 20;
11721        /// `P<m>` bit 21.
11722        const P21 = 1 << 21;
11723        /// `P<m>` bit 22.
11724        const P22 = 1 << 22;
11725        /// `P<m>` bit 23.
11726        const P23 = 1 << 23;
11727        /// `P<m>` bit 24.
11728        const P24 = 1 << 24;
11729        /// `P<m>` bit 25.
11730        const P25 = 1 << 25;
11731        /// `P<m>` bit 26.
11732        const P26 = 1 << 26;
11733        /// `P<m>` bit 27.
11734        const P27 = 1 << 27;
11735        /// `P<m>` bit 28.
11736        const P28 = 1 << 28;
11737        /// `P<m>` bit 29.
11738        const P29 = 1 << 29;
11739        /// `P<m>` bit 30.
11740        const P30 = 1 << 30;
11741        /// `C` bit.
11742        const C = 1 << 31;
11743    }
11744}
11745
11746impl Pmovsr {
11747    /// Offset of the `P<m>` field.
11748    pub const P_SHIFT: u32 = 0;
11749    /// Offset of the `C` field.
11750    pub const C_SHIFT: u32 = 31;
11751}
11752
11753bitflags! {
11754    /// `PMOVSSET` system register value.
11755    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11756    #[repr(transparent)]
11757    pub struct Pmovsset: u32 {
11758        /// `P<m>` bit 0.
11759        const P0 = 1 << 0;
11760        /// `P<m>` bit 1.
11761        const P1 = 1 << 1;
11762        /// `P<m>` bit 2.
11763        const P2 = 1 << 2;
11764        /// `P<m>` bit 3.
11765        const P3 = 1 << 3;
11766        /// `P<m>` bit 4.
11767        const P4 = 1 << 4;
11768        /// `P<m>` bit 5.
11769        const P5 = 1 << 5;
11770        /// `P<m>` bit 6.
11771        const P6 = 1 << 6;
11772        /// `P<m>` bit 7.
11773        const P7 = 1 << 7;
11774        /// `P<m>` bit 8.
11775        const P8 = 1 << 8;
11776        /// `P<m>` bit 9.
11777        const P9 = 1 << 9;
11778        /// `P<m>` bit 10.
11779        const P10 = 1 << 10;
11780        /// `P<m>` bit 11.
11781        const P11 = 1 << 11;
11782        /// `P<m>` bit 12.
11783        const P12 = 1 << 12;
11784        /// `P<m>` bit 13.
11785        const P13 = 1 << 13;
11786        /// `P<m>` bit 14.
11787        const P14 = 1 << 14;
11788        /// `P<m>` bit 15.
11789        const P15 = 1 << 15;
11790        /// `P<m>` bit 16.
11791        const P16 = 1 << 16;
11792        /// `P<m>` bit 17.
11793        const P17 = 1 << 17;
11794        /// `P<m>` bit 18.
11795        const P18 = 1 << 18;
11796        /// `P<m>` bit 19.
11797        const P19 = 1 << 19;
11798        /// `P<m>` bit 20.
11799        const P20 = 1 << 20;
11800        /// `P<m>` bit 21.
11801        const P21 = 1 << 21;
11802        /// `P<m>` bit 22.
11803        const P22 = 1 << 22;
11804        /// `P<m>` bit 23.
11805        const P23 = 1 << 23;
11806        /// `P<m>` bit 24.
11807        const P24 = 1 << 24;
11808        /// `P<m>` bit 25.
11809        const P25 = 1 << 25;
11810        /// `P<m>` bit 26.
11811        const P26 = 1 << 26;
11812        /// `P<m>` bit 27.
11813        const P27 = 1 << 27;
11814        /// `P<m>` bit 28.
11815        const P28 = 1 << 28;
11816        /// `P<m>` bit 29.
11817        const P29 = 1 << 29;
11818        /// `P<m>` bit 30.
11819        const P30 = 1 << 30;
11820        /// `C` bit.
11821        const C = 1 << 31;
11822    }
11823}
11824
11825impl Pmovsset {
11826    /// Offset of the `P<m>` field.
11827    pub const P_SHIFT: u32 = 0;
11828    /// Offset of the `C` field.
11829    pub const C_SHIFT: u32 = 31;
11830}
11831
11832bitflags! {
11833    /// `PMSELR` system register value.
11834    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11835    #[repr(transparent)]
11836    pub struct Pmselr: u32 {
11837    }
11838}
11839
11840impl Pmselr {
11841    /// Offset of the `SEL` field.
11842    pub const SEL_SHIFT: u32 = 0;
11843    /// Mask for the `SEL` field.
11844    pub const SEL_MASK: u32 = 0b11111;
11845
11846    /// Returns the value of the `SEL` field.
11847    pub const fn sel(self) -> u8 {
11848        ((self.bits() >> Self::SEL_SHIFT) & 0b11111) as u8
11849    }
11850}
11851
11852bitflags! {
11853    /// `PMSWINC` system register value.
11854    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11855    #[repr(transparent)]
11856    pub struct Pmswinc: u32 {
11857        /// `P<m>` bit 0.
11858        const P0 = 1 << 0;
11859        /// `P<m>` bit 1.
11860        const P1 = 1 << 1;
11861        /// `P<m>` bit 2.
11862        const P2 = 1 << 2;
11863        /// `P<m>` bit 3.
11864        const P3 = 1 << 3;
11865        /// `P<m>` bit 4.
11866        const P4 = 1 << 4;
11867        /// `P<m>` bit 5.
11868        const P5 = 1 << 5;
11869        /// `P<m>` bit 6.
11870        const P6 = 1 << 6;
11871        /// `P<m>` bit 7.
11872        const P7 = 1 << 7;
11873        /// `P<m>` bit 8.
11874        const P8 = 1 << 8;
11875        /// `P<m>` bit 9.
11876        const P9 = 1 << 9;
11877        /// `P<m>` bit 10.
11878        const P10 = 1 << 10;
11879        /// `P<m>` bit 11.
11880        const P11 = 1 << 11;
11881        /// `P<m>` bit 12.
11882        const P12 = 1 << 12;
11883        /// `P<m>` bit 13.
11884        const P13 = 1 << 13;
11885        /// `P<m>` bit 14.
11886        const P14 = 1 << 14;
11887        /// `P<m>` bit 15.
11888        const P15 = 1 << 15;
11889        /// `P<m>` bit 16.
11890        const P16 = 1 << 16;
11891        /// `P<m>` bit 17.
11892        const P17 = 1 << 17;
11893        /// `P<m>` bit 18.
11894        const P18 = 1 << 18;
11895        /// `P<m>` bit 19.
11896        const P19 = 1 << 19;
11897        /// `P<m>` bit 20.
11898        const P20 = 1 << 20;
11899        /// `P<m>` bit 21.
11900        const P21 = 1 << 21;
11901        /// `P<m>` bit 22.
11902        const P22 = 1 << 22;
11903        /// `P<m>` bit 23.
11904        const P23 = 1 << 23;
11905        /// `P<m>` bit 24.
11906        const P24 = 1 << 24;
11907        /// `P<m>` bit 25.
11908        const P25 = 1 << 25;
11909        /// `P<m>` bit 26.
11910        const P26 = 1 << 26;
11911        /// `P<m>` bit 27.
11912        const P27 = 1 << 27;
11913        /// `P<m>` bit 28.
11914        const P28 = 1 << 28;
11915        /// `P<m>` bit 29.
11916        const P29 = 1 << 29;
11917        /// `P<m>` bit 30.
11918        const P30 = 1 << 30;
11919    }
11920}
11921
11922impl Pmswinc {
11923    /// Offset of the `P<m>` field.
11924    pub const P_SHIFT: u32 = 0;
11925}
11926
11927bitflags! {
11928    /// `PMUSERENR` system register value.
11929    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11930    #[repr(transparent)]
11931    pub struct Pmuserenr: u32 {
11932        /// `EN` bit.
11933        const EN = 1 << 0;
11934        /// `SW` bit.
11935        const SW = 1 << 1;
11936        /// `CR` bit.
11937        const CR = 1 << 2;
11938        /// `ER` bit.
11939        const ER = 1 << 3;
11940        /// `TID` bit.
11941        const TID = 1 << 6;
11942    }
11943}
11944
11945impl Pmuserenr {
11946    /// Offset of the `EN` field.
11947    pub const EN_SHIFT: u32 = 0;
11948    /// Offset of the `SW` field.
11949    pub const SW_SHIFT: u32 = 1;
11950    /// Offset of the `CR` field.
11951    pub const CR_SHIFT: u32 = 2;
11952    /// Offset of the `ER` field.
11953    pub const ER_SHIFT: u32 = 3;
11954    /// Offset of the `TID` field.
11955    pub const TID_SHIFT: u32 = 6;
11956}
11957
11958bitflags! {
11959    /// `PMXEVTYPER` system register value.
11960    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11961    #[repr(transparent)]
11962    pub struct Pmxevtyper: u32 {
11963    }
11964}
11965
11966impl Pmxevtyper {
11967    /// Offset of the `ETR` field.
11968    pub const ETR_SHIFT: u32 = 0;
11969    /// Mask for the `ETR` field.
11970    pub const ETR_MASK: u32 = 0b11111111111111111111111111111111;
11971
11972    /// Returns the value of the `ETR` field.
11973    pub const fn etr(self) -> u32 {
11974        ((self.bits() >> Self::ETR_SHIFT) & 0b11111111111111111111111111111111) as u32
11975    }
11976}
11977
11978bitflags! {
11979    /// `PRRR` system register value.
11980    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
11981    #[repr(transparent)]
11982    pub struct Prrr: u32 {
11983        /// `DS0` bit.
11984        const DS0 = 1 << 16;
11985        /// `DS1` bit.
11986        const DS1 = 1 << 17;
11987        /// `NS0` bit.
11988        const NS0 = 1 << 18;
11989        /// `NS1` bit.
11990        const NS1 = 1 << 19;
11991        /// `NOS<n>` bit 0.
11992        const NOS0 = 1 << 24;
11993        /// `NOS<n>` bit 1.
11994        const NOS1 = 1 << 25;
11995        /// `NOS<n>` bit 2.
11996        const NOS2 = 1 << 26;
11997        /// `NOS<n>` bit 3.
11998        const NOS3 = 1 << 27;
11999        /// `NOS<n>` bit 4.
12000        const NOS4 = 1 << 28;
12001        /// `NOS<n>` bit 5.
12002        const NOS5 = 1 << 29;
12003        /// `NOS<n>` bit 6.
12004        const NOS6 = 1 << 30;
12005        /// `NOS<n>` bit 7.
12006        const NOS7 = 1 << 31;
12007    }
12008}
12009
12010impl Prrr {
12011    /// Offset of the `TR<n>` field.
12012    pub const TR_SHIFT: u32 = 0;
12013    /// Mask for the `TR<n>` field.
12014    pub const TR_MASK: u32 = 0b11;
12015    /// Offset of the `DS0` field.
12016    pub const DS0_SHIFT: u32 = 16;
12017    /// Offset of the `DS1` field.
12018    pub const DS1_SHIFT: u32 = 17;
12019    /// Offset of the `NS0` field.
12020    pub const NS0_SHIFT: u32 = 18;
12021    /// Offset of the `NS1` field.
12022    pub const NS1_SHIFT: u32 = 19;
12023    /// Offset of the `NOS<n>` field.
12024    pub const NOS_SHIFT: u32 = 24;
12025
12026    /// Returns the value of the given `TR<n>` field.
12027    pub const fn tr(self, n: u32) -> u8 {
12028        assert!(n < 8);
12029        ((self.bits() >> (Self::TR_SHIFT + (n - 0) * 2)) & 0b11) as u8
12030    }
12031}
12032
12033#[cfg(feature = "el1")]
12034bitflags! {
12035    /// `RGSR_EL1` system register value.
12036    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12037    #[repr(transparent)]
12038    pub struct RgsrEl1: u64 {
12039    }
12040}
12041
12042#[cfg(feature = "el1")]
12043impl RgsrEl1 {
12044    /// Offset of the `TAG` field.
12045    pub const TAG_SHIFT: u32 = 0;
12046    /// Mask for the `TAG` field.
12047    pub const TAG_MASK: u64 = 0b1111;
12048    /// Offset of the `SEED` field.
12049    pub const SEED_SHIFT: u32 = 8;
12050    /// Mask for the `SEED` field.
12051    pub const SEED_MASK: u64 = 0b1111111111111111;
12052
12053    /// Returns the value of the `TAG` field.
12054    pub const fn tag(self) -> u8 {
12055        ((self.bits() >> Self::TAG_SHIFT) & 0b1111) as u8
12056    }
12057
12058    /// Returns the value of the `SEED` field.
12059    pub const fn seed(self) -> u16 {
12060        ((self.bits() >> Self::SEED_SHIFT) & 0b1111111111111111) as u16
12061    }
12062}
12063
12064bitflags! {
12065    /// `RMR` system register value.
12066    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12067    #[repr(transparent)]
12068    pub struct Rmr: u32 {
12069        /// `AA64` bit.
12070        const AA64 = 1 << 0;
12071        /// `RR` bit.
12072        const RR = 1 << 1;
12073    }
12074}
12075
12076impl Rmr {
12077    /// Offset of the `AA64` field.
12078    pub const AA64_SHIFT: u32 = 0;
12079    /// Offset of the `RR` field.
12080    pub const RR_SHIFT: u32 = 1;
12081}
12082
12083bitflags! {
12084    /// `RVBAR` system register value.
12085    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12086    #[repr(transparent)]
12087    pub struct Rvbar: u32 {
12088        /// RES1 bits in the `RVBAR` register.
12089        const RES1 = 0b1;
12090    }
12091}
12092
12093impl Rvbar {
12094    /// Offset of the `ResetAddress` field.
12095    pub const RESETADDRESS_SHIFT: u32 = 1;
12096    /// Mask for the `ResetAddress` field.
12097    pub const RESETADDRESS_MASK: u32 = 0b1111111111111111111111111111111;
12098
12099    /// Returns the value of the `ResetAddress` field.
12100    pub const fn resetaddress(self) -> u32 {
12101        ((self.bits() >> Self::RESETADDRESS_SHIFT) & 0b1111111111111111111111111111111) as u32
12102    }
12103}
12104
12105bitflags! {
12106    /// `SCR` system register value.
12107    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12108    #[repr(transparent)]
12109    pub struct Scr: u32 {
12110        /// `NS` bit.
12111        const NS = 1 << 0;
12112        /// `IRQ` bit.
12113        const IRQ = 1 << 1;
12114        /// `FIQ` bit.
12115        const FIQ = 1 << 2;
12116        /// `EA` bit.
12117        const EA = 1 << 3;
12118        /// `FW` bit.
12119        const FW = 1 << 4;
12120        /// `AW` bit.
12121        const AW = 1 << 5;
12122        /// `nET` bit.
12123        const NET = 1 << 6;
12124        /// `SCD` bit.
12125        const SCD = 1 << 7;
12126        /// `HCE` bit.
12127        const HCE = 1 << 8;
12128        /// `SIF` bit.
12129        const SIF = 1 << 9;
12130        /// `TWI` bit.
12131        const TWI = 1 << 12;
12132        /// `TWE` bit.
12133        const TWE = 1 << 13;
12134        /// `TERR` bit.
12135        const TERR = 1 << 15;
12136    }
12137}
12138
12139impl Scr {
12140    /// Offset of the `NS` field.
12141    pub const NS_SHIFT: u32 = 0;
12142    /// Offset of the `IRQ` field.
12143    pub const IRQ_SHIFT: u32 = 1;
12144    /// Offset of the `FIQ` field.
12145    pub const FIQ_SHIFT: u32 = 2;
12146    /// Offset of the `EA` field.
12147    pub const EA_SHIFT: u32 = 3;
12148    /// Offset of the `FW` field.
12149    pub const FW_SHIFT: u32 = 4;
12150    /// Offset of the `AW` field.
12151    pub const AW_SHIFT: u32 = 5;
12152    /// Offset of the `nET` field.
12153    pub const NET_SHIFT: u32 = 6;
12154    /// Offset of the `SCD` field.
12155    pub const SCD_SHIFT: u32 = 7;
12156    /// Offset of the `HCE` field.
12157    pub const HCE_SHIFT: u32 = 8;
12158    /// Offset of the `SIF` field.
12159    pub const SIF_SHIFT: u32 = 9;
12160    /// Offset of the `TWI` field.
12161    pub const TWI_SHIFT: u32 = 12;
12162    /// Offset of the `TWE` field.
12163    pub const TWE_SHIFT: u32 = 13;
12164    /// Offset of the `TERR` field.
12165    pub const TERR_SHIFT: u32 = 15;
12166}
12167
12168#[cfg(feature = "el3")]
12169bitflags! {
12170    /// `SCR_EL3` system register value.
12171    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12172    #[repr(transparent)]
12173    pub struct ScrEl3: u64 {
12174        /// RES1 bits in the `SCR_EL3` register.
12175        const RES1 = 0b110000;
12176        /// Non-secure.
12177        const NS = 1 << 0;
12178        /// Take physical IRQs at EL3.
12179        const IRQ = 1 << 1;
12180        /// Take physical FIQs at EL3.
12181        const FIQ = 1 << 2;
12182        /// Take external abort and SError exceptions at EL3.
12183        const EA = 1 << 3;
12184        /// Disable SMC instructions.
12185        const SMD = 1 << 7;
12186        /// Enable HVC instructions.
12187        const HCE = 1 << 8;
12188        /// Disable execution from non-secure memory.
12189        const SIF = 1 << 9;
12190        /// Enable AArch64 in lower ELs.
12191        const RW = 1 << 10;
12192        /// Trap physical secure timer to EL3.
12193        const ST = 1 << 11;
12194        /// Trap WFI to EL3.
12195        const TWI = 1 << 12;
12196        /// Trap WFE to EL3.
12197        const TWE = 1 << 13;
12198        /// Trap LOR register access to EL3.
12199        const TLOR = 1 << 14;
12200        /// Trap error record register access to EL3.
12201        const TERR = 1 << 15;
12202        /// Don't trap PAC key registers to EL3.
12203        const APK = 1 << 16;
12204        /// Don't trap PAuth instructions to EL3.
12205        const API = 1 << 17;
12206        /// Enable Secure EL2.
12207        const EEL2 = 1 << 18;
12208        /// Synchronous external aborts are taken as SErrors.
12209        const EASE = 1 << 19;
12210        /// Take SError exceptions at EL3.
12211        const NMEA = 1 << 20;
12212        /// Enable fault injection at lower ELs.
12213        const FIEN = 1 << 21;
12214        /// Trap ID group 3 registers to EL3.
12215        const TID3 = 1 << 22;
12216        /// Trap ID group 5 register to EL3.
12217        const TID5 = 1 << 23;
12218        /// `POE2En` bit.
12219        const POE2EN = 1 << 24;
12220        /// Enable SCXT at lower ELs.
12221        const ENSCXT = 1 << 25;
12222        /// Enable memory tagging at lower ELs.
12223        const ATA = 1 << 26;
12224        /// Enable fine-grained traps to EL2.
12225        const FGTEN = 1 << 27;
12226        /// Enable access to CNTPOFF_EL2.
12227        const ECVEN = 1 << 28;
12228        /// Enable a configurable delay for WFE traps.
12229        const TWEDEN = 1 << 29;
12230        /// Enable activity monitors virtual offsets.
12231        const AMVOFFEN = 1 << 35;
12232        /// Enable ST64BV0 at lower ELs.
12233        const ENAS0 = 1 << 36;
12234        /// Enable ACCDATA_EL1 at lower ELs.
12235        const ADEN = 1 << 37;
12236        /// Enable HCRX_EL2.
12237        const HXEN = 1 << 38;
12238        /// Enable guarded control stack.
12239        const GCSEN = 1 << 39;
12240        /// Trap RNDR and RNDRRS to EL3.
12241        const TRNDR = 1 << 40;
12242        /// Enable TPIDR2_EL0 at lower ELs.
12243        const ENTP2 = 1 << 41;
12244        /// Enable RCW and RCWS mask registers at lower ELs.
12245        const RCWMASKEN = 1 << 42;
12246        /// Enable TCR2_ELx registers at lower ELs.
12247        const TCR2EN = 1 << 43;
12248        /// Enable SCTLR2_ELx registers at lower ELs.
12249        const SCTLR2EN = 1 << 44;
12250        /// Enable permission indirection and overlay registers at lower ELs.
12251        const PIEN = 1 << 45;
12252        /// Enable MAIR2_ELx and AMAIR2_ELx at lower ELs.
12253        const AIEN = 1 << 46;
12254        /// Enable 128-bit system registers at  lower ELs.
12255        const D128EN = 1 << 47;
12256        /// Route GPFs to EL3.
12257        const GPF = 1 << 48;
12258        /// Enable MECID registers at EL2.
12259        const MECEN = 1 << 49;
12260        /// Enable access to FPMR at lower ELs.
12261        const ENFPM = 1 << 50;
12262        /// Take synchronous external abort and physical SError exception to EL3.
12263        const TMEA = 1 << 51;
12264        /// Trap writes to Error Record registers to EL3.
12265        const TWERR = 1 << 52;
12266        /// Enable access to physical fault address registers at lower ELs.
12267        const PFAREN = 1 << 53;
12268        /// Enable access to mask registers at lower ELs.
12269        const SRMASKEN = 1 << 54;
12270        /// Enable implementation-defined 128-bit system registers.
12271        const ENIDCP128 = 1 << 55;
12272        /// `VTLBIDEn` bit.
12273        const VTLBIDEN = 1 << 56;
12274        /// A delegated SError exception is pending.
12275        const DSE = 1 << 57;
12276        /// Enable delegated SError exceptions.
12277        const ENDSE = 1 << 58;
12278        /// Enable fine-grained traps to EL2.
12279        const FGTEN2 = 1 << 59;
12280        /// Enable HDBSSBR_EL2 and HDBSSPROD_EL2 registers at EL2.
12281        const HDBSSEN = 1 << 60;
12282        /// Enable HACDBSBR_EL2 and HACDBSCONS_EL2 registers at EL2.
12283        const HACDBSEN = 1 << 61;
12284        /// Non-secure realm world bit.
12285        const NSE = 1 << 62;
12286        /// `TPLIMEn` bit.
12287        const TPLIMEN = 1 << 63;
12288    }
12289}
12290
12291#[cfg(feature = "el3")]
12292impl ScrEl3 {
12293    /// Offset of the `NS` field.
12294    pub const NS_SHIFT: u32 = 0;
12295    /// Offset of the `IRQ` field.
12296    pub const IRQ_SHIFT: u32 = 1;
12297    /// Offset of the `FIQ` field.
12298    pub const FIQ_SHIFT: u32 = 2;
12299    /// Offset of the `EA` field.
12300    pub const EA_SHIFT: u32 = 3;
12301    /// Offset of the `SMD` field.
12302    pub const SMD_SHIFT: u32 = 7;
12303    /// Offset of the `HCE` field.
12304    pub const HCE_SHIFT: u32 = 8;
12305    /// Offset of the `SIF` field.
12306    pub const SIF_SHIFT: u32 = 9;
12307    /// Offset of the `RW` field.
12308    pub const RW_SHIFT: u32 = 10;
12309    /// Offset of the `ST` field.
12310    pub const ST_SHIFT: u32 = 11;
12311    /// Offset of the `TWI` field.
12312    pub const TWI_SHIFT: u32 = 12;
12313    /// Offset of the `TWE` field.
12314    pub const TWE_SHIFT: u32 = 13;
12315    /// Offset of the `TLOR` field.
12316    pub const TLOR_SHIFT: u32 = 14;
12317    /// Offset of the `TERR` field.
12318    pub const TERR_SHIFT: u32 = 15;
12319    /// Offset of the `APK` field.
12320    pub const APK_SHIFT: u32 = 16;
12321    /// Offset of the `API` field.
12322    pub const API_SHIFT: u32 = 17;
12323    /// Offset of the `EEL2` field.
12324    pub const EEL2_SHIFT: u32 = 18;
12325    /// Offset of the `EASE` field.
12326    pub const EASE_SHIFT: u32 = 19;
12327    /// Offset of the `NMEA` field.
12328    pub const NMEA_SHIFT: u32 = 20;
12329    /// Offset of the `FIEN` field.
12330    pub const FIEN_SHIFT: u32 = 21;
12331    /// Offset of the `TID3` field.
12332    pub const TID3_SHIFT: u32 = 22;
12333    /// Offset of the `TID5` field.
12334    pub const TID5_SHIFT: u32 = 23;
12335    /// Offset of the `POE2En` field.
12336    pub const POE2EN_SHIFT: u32 = 24;
12337    /// Offset of the `EnSCXT` field.
12338    pub const ENSCXT_SHIFT: u32 = 25;
12339    /// Offset of the `ATA` field.
12340    pub const ATA_SHIFT: u32 = 26;
12341    /// Offset of the `FGTEn` field.
12342    pub const FGTEN_SHIFT: u32 = 27;
12343    /// Offset of the `ECVEn` field.
12344    pub const ECVEN_SHIFT: u32 = 28;
12345    /// Offset of the `TWEDEn` field.
12346    pub const TWEDEN_SHIFT: u32 = 29;
12347    /// Offset of the `TWEDEL` field.
12348    pub const TWEDEL_SHIFT: u32 = 30;
12349    /// Mask for the `TWEDEL` field.
12350    pub const TWEDEL_MASK: u64 = 0b1111;
12351    /// Offset of the `AMVOFFEN` field.
12352    pub const AMVOFFEN_SHIFT: u32 = 35;
12353    /// Offset of the `EnAS0` field.
12354    pub const ENAS0_SHIFT: u32 = 36;
12355    /// Offset of the `ADEn` field.
12356    pub const ADEN_SHIFT: u32 = 37;
12357    /// Offset of the `HXEn` field.
12358    pub const HXEN_SHIFT: u32 = 38;
12359    /// Offset of the `GCSEn` field.
12360    pub const GCSEN_SHIFT: u32 = 39;
12361    /// Offset of the `TRNDR` field.
12362    pub const TRNDR_SHIFT: u32 = 40;
12363    /// Offset of the `EnTP2` field.
12364    pub const ENTP2_SHIFT: u32 = 41;
12365    /// Offset of the `RCWMASKEn` field.
12366    pub const RCWMASKEN_SHIFT: u32 = 42;
12367    /// Offset of the `TCR2En` field.
12368    pub const TCR2EN_SHIFT: u32 = 43;
12369    /// Offset of the `SCTLR2En` field.
12370    pub const SCTLR2EN_SHIFT: u32 = 44;
12371    /// Offset of the `PIEn` field.
12372    pub const PIEN_SHIFT: u32 = 45;
12373    /// Offset of the `AIEn` field.
12374    pub const AIEN_SHIFT: u32 = 46;
12375    /// Offset of the `D128En` field.
12376    pub const D128EN_SHIFT: u32 = 47;
12377    /// Offset of the `GPF` field.
12378    pub const GPF_SHIFT: u32 = 48;
12379    /// Offset of the `MECEn` field.
12380    pub const MECEN_SHIFT: u32 = 49;
12381    /// Offset of the `EnFPM` field.
12382    pub const ENFPM_SHIFT: u32 = 50;
12383    /// Offset of the `TMEA` field.
12384    pub const TMEA_SHIFT: u32 = 51;
12385    /// Offset of the `TWERR` field.
12386    pub const TWERR_SHIFT: u32 = 52;
12387    /// Offset of the `PFAREn` field.
12388    pub const PFAREN_SHIFT: u32 = 53;
12389    /// Offset of the `SRMASKEn` field.
12390    pub const SRMASKEN_SHIFT: u32 = 54;
12391    /// Offset of the `EnIDCP128` field.
12392    pub const ENIDCP128_SHIFT: u32 = 55;
12393    /// Offset of the `VTLBIDEn` field.
12394    pub const VTLBIDEN_SHIFT: u32 = 56;
12395    /// Offset of the `DSE` field.
12396    pub const DSE_SHIFT: u32 = 57;
12397    /// Offset of the `EnDSE` field.
12398    pub const ENDSE_SHIFT: u32 = 58;
12399    /// Offset of the `FGTEn2` field.
12400    pub const FGTEN2_SHIFT: u32 = 59;
12401    /// Offset of the `HDBSSEn` field.
12402    pub const HDBSSEN_SHIFT: u32 = 60;
12403    /// Offset of the `HACDBSEn` field.
12404    pub const HACDBSEN_SHIFT: u32 = 61;
12405    /// Offset of the `NSE` field.
12406    pub const NSE_SHIFT: u32 = 62;
12407    /// Offset of the `TPLIMEn` field.
12408    pub const TPLIMEN_SHIFT: u32 = 63;
12409
12410    /// Returns the value of the `TWEDEL` field.
12411    pub const fn twedel(self) -> u8 {
12412        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
12413    }
12414}
12415
12416bitflags! {
12417    /// `SCTLR` system register value.
12418    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12419    #[repr(transparent)]
12420    pub struct Sctlr: u32 {
12421        /// RES1 bits in the `SCTLR` register.
12422        const RES1 = 0b10000000000100000000000;
12423        /// `M` bit.
12424        const M = 1 << 0;
12425        /// `A` bit.
12426        const A = 1 << 1;
12427        /// `C` bit.
12428        const C = 1 << 2;
12429        /// `nTLSMD` bit.
12430        const NTLSMD = 1 << 3;
12431        /// `LSMAOE` bit.
12432        const LSMAOE = 1 << 4;
12433        /// `CP15BEN` bit.
12434        const CP15BEN = 1 << 5;
12435        /// `UNK` bit.
12436        const UNK = 1 << 6;
12437        /// `ITD` bit.
12438        const ITD = 1 << 7;
12439        /// `SED` bit.
12440        const SED = 1 << 8;
12441        /// `EnRCTX` bit.
12442        const ENRCTX = 1 << 10;
12443        /// `I` bit.
12444        const I = 1 << 12;
12445        /// `V` bit.
12446        const V = 1 << 13;
12447        /// `nTWI` bit.
12448        const NTWI = 1 << 16;
12449        /// `nTWE` bit.
12450        const NTWE = 1 << 18;
12451        /// `WXN` bit.
12452        const WXN = 1 << 19;
12453        /// `UWXN` bit.
12454        const UWXN = 1 << 20;
12455        /// `SPAN` bit.
12456        const SPAN = 1 << 23;
12457        /// `EE` bit.
12458        const EE = 1 << 25;
12459        /// `TRE` bit.
12460        const TRE = 1 << 28;
12461        /// `AFE` bit.
12462        const AFE = 1 << 29;
12463        /// `TE` bit.
12464        const TE = 1 << 30;
12465        /// `DSSBS` bit.
12466        const DSSBS = 1 << 31;
12467    }
12468}
12469
12470impl Sctlr {
12471    /// Offset of the `M` field.
12472    pub const M_SHIFT: u32 = 0;
12473    /// Offset of the `A` field.
12474    pub const A_SHIFT: u32 = 1;
12475    /// Offset of the `C` field.
12476    pub const C_SHIFT: u32 = 2;
12477    /// Offset of the `nTLSMD` field.
12478    pub const NTLSMD_SHIFT: u32 = 3;
12479    /// Offset of the `LSMAOE` field.
12480    pub const LSMAOE_SHIFT: u32 = 4;
12481    /// Offset of the `CP15BEN` field.
12482    pub const CP15BEN_SHIFT: u32 = 5;
12483    /// Offset of the `UNK` field.
12484    pub const UNK_SHIFT: u32 = 6;
12485    /// Offset of the `ITD` field.
12486    pub const ITD_SHIFT: u32 = 7;
12487    /// Offset of the `SED` field.
12488    pub const SED_SHIFT: u32 = 8;
12489    /// Offset of the `EnRCTX` field.
12490    pub const ENRCTX_SHIFT: u32 = 10;
12491    /// Offset of the `I` field.
12492    pub const I_SHIFT: u32 = 12;
12493    /// Offset of the `V` field.
12494    pub const V_SHIFT: u32 = 13;
12495    /// Offset of the `nTWI` field.
12496    pub const NTWI_SHIFT: u32 = 16;
12497    /// Offset of the `nTWE` field.
12498    pub const NTWE_SHIFT: u32 = 18;
12499    /// Offset of the `WXN` field.
12500    pub const WXN_SHIFT: u32 = 19;
12501    /// Offset of the `UWXN` field.
12502    pub const UWXN_SHIFT: u32 = 20;
12503    /// Offset of the `SPAN` field.
12504    pub const SPAN_SHIFT: u32 = 23;
12505    /// Offset of the `EE` field.
12506    pub const EE_SHIFT: u32 = 25;
12507    /// Offset of the `TRE` field.
12508    pub const TRE_SHIFT: u32 = 28;
12509    /// Offset of the `AFE` field.
12510    pub const AFE_SHIFT: u32 = 29;
12511    /// Offset of the `TE` field.
12512    pub const TE_SHIFT: u32 = 30;
12513    /// Offset of the `DSSBS` field.
12514    pub const DSSBS_SHIFT: u32 = 31;
12515}
12516
12517#[cfg(feature = "el3")]
12518bitflags! {
12519    /// `SCTLR2_EL3` system register value.
12520    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12521    #[repr(transparent)]
12522    pub struct Sctlr2El3: u64 {
12523        /// `EMEC` bit.
12524        const EMEC = 1 << 1;
12525        /// `EnADERR` bit.
12526        const ENADERR = 1 << 3;
12527        /// `EnANERR` bit.
12528        const ENANERR = 1 << 4;
12529        /// `EnPACM` bit.
12530        const ENPACM = 1 << 7;
12531        /// `CPTA` bit.
12532        const CPTA = 1 << 9;
12533        /// `CPTM` bit.
12534        const CPTM = 1 << 11;
12535        /// `DTZ` bit.
12536        const DTZ = 1 << 14;
12537        /// `TEIS` bit.
12538        const TEIS = 1 << 15;
12539        /// `TEOS` bit.
12540        const TEOS = 1 << 16;
12541        /// `VT` bit.
12542        const VT = 1 << 17;
12543        /// `BTD` bit.
12544        const BTD = 1 << 24;
12545    }
12546}
12547
12548#[cfg(feature = "el3")]
12549impl Sctlr2El3 {
12550    /// Offset of the `EMEC` field.
12551    pub const EMEC_SHIFT: u32 = 1;
12552    /// Offset of the `EnADERR` field.
12553    pub const ENADERR_SHIFT: u32 = 3;
12554    /// Offset of the `EnANERR` field.
12555    pub const ENANERR_SHIFT: u32 = 4;
12556    /// Offset of the `EnPACM` field.
12557    pub const ENPACM_SHIFT: u32 = 7;
12558    /// Offset of the `CPTA` field.
12559    pub const CPTA_SHIFT: u32 = 9;
12560    /// Offset of the `CPTM` field.
12561    pub const CPTM_SHIFT: u32 = 11;
12562    /// Offset of the `DTZ` field.
12563    pub const DTZ_SHIFT: u32 = 14;
12564    /// Offset of the `TEIS` field.
12565    pub const TEIS_SHIFT: u32 = 15;
12566    /// Offset of the `TEOS` field.
12567    pub const TEOS_SHIFT: u32 = 16;
12568    /// Offset of the `VT` field.
12569    pub const VT_SHIFT: u32 = 17;
12570    /// Offset of the `BTD` field.
12571    pub const BTD_SHIFT: u32 = 24;
12572}
12573
12574#[cfg(feature = "el1")]
12575bitflags! {
12576    /// `SCTLR_EL1` system register value.
12577    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12578    #[repr(transparent)]
12579    pub struct SctlrEl1: u64 {
12580        /// `M` bit.
12581        const M = 1 << 0;
12582        /// `A` bit.
12583        const A = 1 << 1;
12584        /// `C` bit.
12585        const C = 1 << 2;
12586        /// `SA` bit.
12587        const SA = 1 << 3;
12588        /// `SA0` bit.
12589        const SA0 = 1 << 4;
12590        /// `CP15BEN` bit.
12591        const CP15BEN = 1 << 5;
12592        /// `nAA` bit.
12593        const NAA = 1 << 6;
12594        /// `ITD` bit.
12595        const ITD = 1 << 7;
12596        /// `SED` bit.
12597        const SED = 1 << 8;
12598        /// `UMA` bit.
12599        const UMA = 1 << 9;
12600        /// `EnRCTX` bit.
12601        const ENRCTX = 1 << 10;
12602        /// `EOS` bit.
12603        const EOS = 1 << 11;
12604        /// `I` bit.
12605        const I = 1 << 12;
12606        /// `EnDB` bit.
12607        const ENDB = 1 << 13;
12608        /// `DZE` bit.
12609        const DZE = 1 << 14;
12610        /// `UCT` bit.
12611        const UCT = 1 << 15;
12612        /// `nTWI` bit.
12613        const NTWI = 1 << 16;
12614        /// `nTWE` bit.
12615        const NTWE = 1 << 18;
12616        /// `WXN` bit.
12617        const WXN = 1 << 19;
12618        /// `TSCXT` bit.
12619        const TSCXT = 1 << 20;
12620        /// `IESB` bit.
12621        const IESB = 1 << 21;
12622        /// `EIS` bit.
12623        const EIS = 1 << 22;
12624        /// Do not set Privileged Access Never, on taking an exception to EL1.
12625        const SPAN = 1 << 23;
12626        /// `UCI` bit.
12627        const UCI = 1 << 26;
12628        /// `EnDA` bit.
12629        const ENDA = 1 << 27;
12630        /// `nTLSMD` bit.
12631        const NTLSMD = 1 << 28;
12632        /// `LSMAOE` bit.
12633        const LSMAOE = 1 << 29;
12634        /// Enable pointer authentication using APIBKey_EL1.
12635        const ENIB = 1 << 30;
12636        /// Enable pointer authentication using APIAKey_EL1.
12637        const ENIA = 1 << 31;
12638        /// `CMOW` bit.
12639        const CMOW = 1 << 32;
12640        /// `MSCEn` bit.
12641        const MSCEN = 1 << 33;
12642        /// `EnFPM` bit.
12643        const ENFPM = 1 << 34;
12644        /// `BT0` bit.
12645        const BT0 = 1 << 35;
12646        /// `BT1` bit.
12647        const BT1 = 1 << 36;
12648        /// `ITFSB` bit.
12649        const ITFSB = 1 << 37;
12650        /// `ATA0` bit.
12651        const ATA0 = 1 << 42;
12652        /// `ATA` bit.
12653        const ATA = 1 << 43;
12654        /// Default PSTATE.SSBS value on Exception Entry.
12655        const DSSBS = 1 << 44;
12656        /// `TWEDEn` bit.
12657        const TWEDEN = 1 << 45;
12658        /// `EnASR` bit.
12659        const ENASR = 1 << 54;
12660        /// `EnAS0` bit.
12661        const ENAS0 = 1 << 55;
12662        /// `EnALS` bit.
12663        const ENALS = 1 << 56;
12664        /// `EPAN` bit.
12665        const EPAN = 1 << 57;
12666        /// `TCSO0` bit.
12667        const TCSO0 = 1 << 58;
12668        /// `TCSO` bit.
12669        const TCSO = 1 << 59;
12670        /// `EnTP2` bit.
12671        const ENTP2 = 1 << 60;
12672        /// `NMI` bit.
12673        const NMI = 1 << 61;
12674        /// SP Interrupt Mask enable.
12675        const SPINTMASK = 1 << 62;
12676        /// `TIDCP` bit.
12677        const TIDCP = 1 << 63;
12678    }
12679}
12680
12681#[cfg(feature = "el1")]
12682impl SctlrEl1 {
12683    /// Offset of the `M` field.
12684    pub const M_SHIFT: u32 = 0;
12685    /// Offset of the `A` field.
12686    pub const A_SHIFT: u32 = 1;
12687    /// Offset of the `C` field.
12688    pub const C_SHIFT: u32 = 2;
12689    /// Offset of the `SA` field.
12690    pub const SA_SHIFT: u32 = 3;
12691    /// Offset of the `SA0` field.
12692    pub const SA0_SHIFT: u32 = 4;
12693    /// Offset of the `CP15BEN` field.
12694    pub const CP15BEN_SHIFT: u32 = 5;
12695    /// Offset of the `nAA` field.
12696    pub const NAA_SHIFT: u32 = 6;
12697    /// Offset of the `ITD` field.
12698    pub const ITD_SHIFT: u32 = 7;
12699    /// Offset of the `SED` field.
12700    pub const SED_SHIFT: u32 = 8;
12701    /// Offset of the `UMA` field.
12702    pub const UMA_SHIFT: u32 = 9;
12703    /// Offset of the `EnRCTX` field.
12704    pub const ENRCTX_SHIFT: u32 = 10;
12705    /// Offset of the `EOS` field.
12706    pub const EOS_SHIFT: u32 = 11;
12707    /// Offset of the `I` field.
12708    pub const I_SHIFT: u32 = 12;
12709    /// Offset of the `EnDB` field.
12710    pub const ENDB_SHIFT: u32 = 13;
12711    /// Offset of the `DZE` field.
12712    pub const DZE_SHIFT: u32 = 14;
12713    /// Offset of the `UCT` field.
12714    pub const UCT_SHIFT: u32 = 15;
12715    /// Offset of the `nTWI` field.
12716    pub const NTWI_SHIFT: u32 = 16;
12717    /// Offset of the `nTWE` field.
12718    pub const NTWE_SHIFT: u32 = 18;
12719    /// Offset of the `WXN` field.
12720    pub const WXN_SHIFT: u32 = 19;
12721    /// Offset of the `TSCXT` field.
12722    pub const TSCXT_SHIFT: u32 = 20;
12723    /// Offset of the `IESB` field.
12724    pub const IESB_SHIFT: u32 = 21;
12725    /// Offset of the `EIS` field.
12726    pub const EIS_SHIFT: u32 = 22;
12727    /// Offset of the `SPAN` field.
12728    pub const SPAN_SHIFT: u32 = 23;
12729    /// Offset of the `UCI` field.
12730    pub const UCI_SHIFT: u32 = 26;
12731    /// Offset of the `EnDA` field.
12732    pub const ENDA_SHIFT: u32 = 27;
12733    /// Offset of the `nTLSMD` field.
12734    pub const NTLSMD_SHIFT: u32 = 28;
12735    /// Offset of the `LSMAOE` field.
12736    pub const LSMAOE_SHIFT: u32 = 29;
12737    /// Offset of the `EnIB` field.
12738    pub const ENIB_SHIFT: u32 = 30;
12739    /// Offset of the `EnIA` field.
12740    pub const ENIA_SHIFT: u32 = 31;
12741    /// Offset of the `CMOW` field.
12742    pub const CMOW_SHIFT: u32 = 32;
12743    /// Offset of the `MSCEn` field.
12744    pub const MSCEN_SHIFT: u32 = 33;
12745    /// Offset of the `EnFPM` field.
12746    pub const ENFPM_SHIFT: u32 = 34;
12747    /// Offset of the `BT0` field.
12748    pub const BT0_SHIFT: u32 = 35;
12749    /// Offset of the `BT1` field.
12750    pub const BT1_SHIFT: u32 = 36;
12751    /// Offset of the `ITFSB` field.
12752    pub const ITFSB_SHIFT: u32 = 37;
12753    /// Offset of the `TCF0` field.
12754    pub const TCF0_SHIFT: u32 = 38;
12755    /// Mask for the `TCF0` field.
12756    pub const TCF0_MASK: u64 = 0b11;
12757    /// Offset of the `TCF` field.
12758    pub const TCF_SHIFT: u32 = 40;
12759    /// Mask for the `TCF` field.
12760    pub const TCF_MASK: u64 = 0b11;
12761    /// Offset of the `ATA0` field.
12762    pub const ATA0_SHIFT: u32 = 42;
12763    /// Offset of the `ATA` field.
12764    pub const ATA_SHIFT: u32 = 43;
12765    /// Offset of the `DSSBS` field.
12766    pub const DSSBS_SHIFT: u32 = 44;
12767    /// Offset of the `TWEDEn` field.
12768    pub const TWEDEN_SHIFT: u32 = 45;
12769    /// Offset of the `TWEDEL` field.
12770    pub const TWEDEL_SHIFT: u32 = 46;
12771    /// Mask for the `TWEDEL` field.
12772    pub const TWEDEL_MASK: u64 = 0b1111;
12773    /// Offset of the `EnASR` field.
12774    pub const ENASR_SHIFT: u32 = 54;
12775    /// Offset of the `EnAS0` field.
12776    pub const ENAS0_SHIFT: u32 = 55;
12777    /// Offset of the `EnALS` field.
12778    pub const ENALS_SHIFT: u32 = 56;
12779    /// Offset of the `EPAN` field.
12780    pub const EPAN_SHIFT: u32 = 57;
12781    /// Offset of the `TCSO0` field.
12782    pub const TCSO0_SHIFT: u32 = 58;
12783    /// Offset of the `TCSO` field.
12784    pub const TCSO_SHIFT: u32 = 59;
12785    /// Offset of the `EnTP2` field.
12786    pub const ENTP2_SHIFT: u32 = 60;
12787    /// Offset of the `NMI` field.
12788    pub const NMI_SHIFT: u32 = 61;
12789    /// Offset of the `SPINTMASK` field.
12790    pub const SPINTMASK_SHIFT: u32 = 62;
12791    /// Offset of the `TIDCP` field.
12792    pub const TIDCP_SHIFT: u32 = 63;
12793
12794    /// Returns the value of the `TCF0` field.
12795    pub const fn tcf0(self) -> u8 {
12796        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
12797    }
12798
12799    /// Returns the value of the `TCF` field.
12800    pub const fn tcf(self) -> u8 {
12801        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
12802    }
12803
12804    /// Returns the value of the `TWEDEL` field.
12805    pub const fn twedel(self) -> u8 {
12806        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
12807    }
12808}
12809
12810#[cfg(feature = "el2")]
12811bitflags! {
12812    /// `SCTLR_EL2` system register value.
12813    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
12814    #[repr(transparent)]
12815    pub struct SctlrEl2: u64 {
12816        /// `M` bit.
12817        const M = 1 << 0;
12818        /// `A` bit.
12819        const A = 1 << 1;
12820        /// `C` bit.
12821        const C = 1 << 2;
12822        /// `SA` bit.
12823        const SA = 1 << 3;
12824        /// `SA0` bit.
12825        const SA0 = 1 << 4;
12826        /// `CP15BEN` bit.
12827        const CP15BEN = 1 << 5;
12828        /// `nAA` bit.
12829        const NAA = 1 << 6;
12830        /// `SED` bit.
12831        const SED = 1 << 8;
12832        /// `UMA` bit.
12833        const UMA = 1 << 9;
12834        /// `EnRCTX` bit.
12835        const ENRCTX = 1 << 10;
12836        /// `EOS` bit.
12837        const EOS = 1 << 11;
12838        /// `I` bit.
12839        const I = 1 << 12;
12840        /// `EnDB` bit.
12841        const ENDB = 1 << 13;
12842        /// `DZE` bit.
12843        const DZE = 1 << 14;
12844        /// `UCT` bit.
12845        const UCT = 1 << 15;
12846        /// `nTWI` bit.
12847        const NTWI = 1 << 16;
12848        /// `nTWE` bit.
12849        const NTWE = 1 << 18;
12850        /// `WXN` bit.
12851        const WXN = 1 << 19;
12852        /// `IESB` bit.
12853        const IESB = 1 << 21;
12854        /// `EIS` bit.
12855        const EIS = 1 << 22;
12856        /// Do not set Privileged Access Never, on taking an exception to EL2.
12857        const SPAN = 1 << 23;
12858        /// `UCI` bit.
12859        const UCI = 1 << 26;
12860        /// `EnDA` bit.
12861        const ENDA = 1 << 27;
12862        /// `nTLSMD` bit.
12863        const NTLSMD = 1 << 28;
12864        /// `LSMAOE` bit.
12865        const LSMAOE = 1 << 29;
12866        /// Enable pointer authentication using APIBKey_EL1.
12867        const ENIB = 1 << 30;
12868        /// Enable pointer authentication using APIAKey_EL1.
12869        const ENIA = 1 << 31;
12870        /// `CMOW` bit.
12871        const CMOW = 1 << 32;
12872        /// `MSCEn` bit.
12873        const MSCEN = 1 << 33;
12874        /// `EnFPM` bit.
12875        const ENFPM = 1 << 34;
12876        /// `BT0` bit.
12877        const BT0 = 1 << 35;
12878        /// `BT` bit.
12879        const BT = 1 << 36;
12880        /// `ITFSB` bit.
12881        const ITFSB = 1 << 37;
12882        /// `ATA0` bit.
12883        const ATA0 = 1 << 42;
12884        /// `ATA` bit.
12885        const ATA = 1 << 43;
12886        /// Default PSTATE.SSBS value on Exception Entry.
12887        const DSSBS = 1 << 44;
12888        /// `TWEDEn` bit.
12889        const TWEDEN = 1 << 45;
12890        /// `EnASR` bit.
12891        const ENASR = 1 << 54;
12892        /// `EnAS0` bit.
12893        const ENAS0 = 1 << 55;
12894        /// `EnALS` bit.
12895        const ENALS = 1 << 56;
12896        /// `EPAN` bit.
12897        const EPAN = 1 << 57;
12898        /// `TCSO0` bit.
12899        const TCSO0 = 1 << 58;
12900        /// `TCSO` bit.
12901        const TCSO = 1 << 59;
12902        /// `EnTP2` bit.
12903        const ENTP2 = 1 << 60;
12904        /// `NMI` bit.
12905        const NMI = 1 << 61;
12906        /// SP Interrupt Mask enable.
12907        const SPINTMASK = 1 << 62;
12908        /// `TIDCP` bit.
12909        const TIDCP = 1 << 63;
12910    }
12911}
12912
12913#[cfg(feature = "el2")]
12914impl SctlrEl2 {
12915    /// Offset of the `M` field.
12916    pub const M_SHIFT: u32 = 0;
12917    /// Offset of the `A` field.
12918    pub const A_SHIFT: u32 = 1;
12919    /// Offset of the `C` field.
12920    pub const C_SHIFT: u32 = 2;
12921    /// Offset of the `SA` field.
12922    pub const SA_SHIFT: u32 = 3;
12923    /// Offset of the `SA0` field.
12924    pub const SA0_SHIFT: u32 = 4;
12925    /// Offset of the `CP15BEN` field.
12926    pub const CP15BEN_SHIFT: u32 = 5;
12927    /// Offset of the `nAA` field.
12928    pub const NAA_SHIFT: u32 = 6;
12929    /// Offset of the `SED` field.
12930    pub const SED_SHIFT: u32 = 8;
12931    /// Offset of the `UMA` field.
12932    pub const UMA_SHIFT: u32 = 9;
12933    /// Offset of the `EnRCTX` field.
12934    pub const ENRCTX_SHIFT: u32 = 10;
12935    /// Offset of the `EOS` field.
12936    pub const EOS_SHIFT: u32 = 11;
12937    /// Offset of the `I` field.
12938    pub const I_SHIFT: u32 = 12;
12939    /// Offset of the `EnDB` field.
12940    pub const ENDB_SHIFT: u32 = 13;
12941    /// Offset of the `DZE` field.
12942    pub const DZE_SHIFT: u32 = 14;
12943    /// Offset of the `UCT` field.
12944    pub const UCT_SHIFT: u32 = 15;
12945    /// Offset of the `nTWI` field.
12946    pub const NTWI_SHIFT: u32 = 16;
12947    /// Offset of the `nTWE` field.
12948    pub const NTWE_SHIFT: u32 = 18;
12949    /// Offset of the `WXN` field.
12950    pub const WXN_SHIFT: u32 = 19;
12951    /// Offset of the `IESB` field.
12952    pub const IESB_SHIFT: u32 = 21;
12953    /// Offset of the `EIS` field.
12954    pub const EIS_SHIFT: u32 = 22;
12955    /// Offset of the `SPAN` field.
12956    pub const SPAN_SHIFT: u32 = 23;
12957    /// Offset of the `UCI` field.
12958    pub const UCI_SHIFT: u32 = 26;
12959    /// Offset of the `EnDA` field.
12960    pub const ENDA_SHIFT: u32 = 27;
12961    /// Offset of the `nTLSMD` field.
12962    pub const NTLSMD_SHIFT: u32 = 28;
12963    /// Offset of the `LSMAOE` field.
12964    pub const LSMAOE_SHIFT: u32 = 29;
12965    /// Offset of the `EnIB` field.
12966    pub const ENIB_SHIFT: u32 = 30;
12967    /// Offset of the `EnIA` field.
12968    pub const ENIA_SHIFT: u32 = 31;
12969    /// Offset of the `CMOW` field.
12970    pub const CMOW_SHIFT: u32 = 32;
12971    /// Offset of the `MSCEn` field.
12972    pub const MSCEN_SHIFT: u32 = 33;
12973    /// Offset of the `EnFPM` field.
12974    pub const ENFPM_SHIFT: u32 = 34;
12975    /// Offset of the `BT0` field.
12976    pub const BT0_SHIFT: u32 = 35;
12977    /// Offset of the `BT` field.
12978    pub const BT_SHIFT: u32 = 36;
12979    /// Offset of the `ITFSB` field.
12980    pub const ITFSB_SHIFT: u32 = 37;
12981    /// Offset of the `TCF0` field.
12982    pub const TCF0_SHIFT: u32 = 38;
12983    /// Mask for the `TCF0` field.
12984    pub const TCF0_MASK: u64 = 0b11;
12985    /// Offset of the `TCF` field.
12986    pub const TCF_SHIFT: u32 = 40;
12987    /// Mask for the `TCF` field.
12988    pub const TCF_MASK: u64 = 0b11;
12989    /// Offset of the `ATA0` field.
12990    pub const ATA0_SHIFT: u32 = 42;
12991    /// Offset of the `ATA` field.
12992    pub const ATA_SHIFT: u32 = 43;
12993    /// Offset of the `DSSBS` field.
12994    pub const DSSBS_SHIFT: u32 = 44;
12995    /// Offset of the `TWEDEn` field.
12996    pub const TWEDEN_SHIFT: u32 = 45;
12997    /// Offset of the `TWEDEL` field.
12998    pub const TWEDEL_SHIFT: u32 = 46;
12999    /// Mask for the `TWEDEL` field.
13000    pub const TWEDEL_MASK: u64 = 0b1111;
13001    /// Offset of the `EnASR` field.
13002    pub const ENASR_SHIFT: u32 = 54;
13003    /// Offset of the `EnAS0` field.
13004    pub const ENAS0_SHIFT: u32 = 55;
13005    /// Offset of the `EnALS` field.
13006    pub const ENALS_SHIFT: u32 = 56;
13007    /// Offset of the `EPAN` field.
13008    pub const EPAN_SHIFT: u32 = 57;
13009    /// Offset of the `TCSO0` field.
13010    pub const TCSO0_SHIFT: u32 = 58;
13011    /// Offset of the `TCSO` field.
13012    pub const TCSO_SHIFT: u32 = 59;
13013    /// Offset of the `EnTP2` field.
13014    pub const ENTP2_SHIFT: u32 = 60;
13015    /// Offset of the `NMI` field.
13016    pub const NMI_SHIFT: u32 = 61;
13017    /// Offset of the `SPINTMASK` field.
13018    pub const SPINTMASK_SHIFT: u32 = 62;
13019    /// Offset of the `TIDCP` field.
13020    pub const TIDCP_SHIFT: u32 = 63;
13021
13022    /// Returns the value of the `TCF0` field.
13023    pub const fn tcf0(self) -> u8 {
13024        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
13025    }
13026
13027    /// Returns the value of the `TCF` field.
13028    pub const fn tcf(self) -> u8 {
13029        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
13030    }
13031
13032    /// Returns the value of the `TWEDEL` field.
13033    pub const fn twedel(self) -> u8 {
13034        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
13035    }
13036}
13037
13038#[cfg(feature = "el3")]
13039bitflags! {
13040    /// `SCTLR_EL3` system register value.
13041    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13042    #[repr(transparent)]
13043    pub struct SctlrEl3: u64 {
13044        /// RES1 bits in the `SCTLR_EL3` register.
13045        const RES1 = 0b110000100001010000000000110000;
13046        /// MMU enable for EL3 stage 1 address translation.
13047        const M = 1 << 0;
13048        /// Alignment check enable.
13049        const A = 1 << 1;
13050        /// Cacheability control, for data accesses at EL3.
13051        const C = 1 << 2;
13052        /// SP alignment check enable.
13053        const SA = 1 << 3;
13054        /// `nAA` bit.
13055        const NAA = 1 << 6;
13056        /// `EOS` bit.
13057        const EOS = 1 << 11;
13058        /// Cacheability control, for instruction accesses at EL3.
13059        const I = 1 << 12;
13060        /// `EnDB` bit.
13061        const ENDB = 1 << 13;
13062        /// Write permission implies XN (Execute-never). For the EL3 translation regime, this bit can force all memory regions that are writable to be treated as XN.
13063        const WXN = 1 << 19;
13064        /// Enable Implicit Error Synchronization events.
13065        const IESB = 1 << 21;
13066        /// `EIS` bit.
13067        const EIS = 1 << 22;
13068        /// `EnDA` bit.
13069        const ENDA = 1 << 27;
13070        /// Enable pointer authentication using APIBKey_EL1.
13071        const ENIB = 1 << 30;
13072        /// Enable pointer authentication using APIAKey_EL1.
13073        const ENIA = 1 << 31;
13074        /// `BT` bit.
13075        const BT = 1 << 36;
13076        /// `ITFSB` bit.
13077        const ITFSB = 1 << 37;
13078        /// `ATA` bit.
13079        const ATA = 1 << 43;
13080        /// `DSSBS` bit.
13081        const DSSBS = 1 << 44;
13082        /// `TCSO` bit.
13083        const TCSO = 1 << 59;
13084        /// `NMI` bit.
13085        const NMI = 1 << 61;
13086        /// `SPINTMASK` bit.
13087        const SPINTMASK = 1 << 62;
13088    }
13089}
13090
13091#[cfg(feature = "el3")]
13092impl SctlrEl3 {
13093    /// Offset of the `M` field.
13094    pub const M_SHIFT: u32 = 0;
13095    /// Offset of the `A` field.
13096    pub const A_SHIFT: u32 = 1;
13097    /// Offset of the `C` field.
13098    pub const C_SHIFT: u32 = 2;
13099    /// Offset of the `SA` field.
13100    pub const SA_SHIFT: u32 = 3;
13101    /// Offset of the `nAA` field.
13102    pub const NAA_SHIFT: u32 = 6;
13103    /// Offset of the `EOS` field.
13104    pub const EOS_SHIFT: u32 = 11;
13105    /// Offset of the `I` field.
13106    pub const I_SHIFT: u32 = 12;
13107    /// Offset of the `EnDB` field.
13108    pub const ENDB_SHIFT: u32 = 13;
13109    /// Offset of the `WXN` field.
13110    pub const WXN_SHIFT: u32 = 19;
13111    /// Offset of the `IESB` field.
13112    pub const IESB_SHIFT: u32 = 21;
13113    /// Offset of the `EIS` field.
13114    pub const EIS_SHIFT: u32 = 22;
13115    /// Offset of the `EnDA` field.
13116    pub const ENDA_SHIFT: u32 = 27;
13117    /// Offset of the `EnIB` field.
13118    pub const ENIB_SHIFT: u32 = 30;
13119    /// Offset of the `EnIA` field.
13120    pub const ENIA_SHIFT: u32 = 31;
13121    /// Offset of the `BT` field.
13122    pub const BT_SHIFT: u32 = 36;
13123    /// Offset of the `ITFSB` field.
13124    pub const ITFSB_SHIFT: u32 = 37;
13125    /// Offset of the `TCF` field.
13126    pub const TCF_SHIFT: u32 = 40;
13127    /// Mask for the `TCF` field.
13128    pub const TCF_MASK: u64 = 0b11;
13129    /// Offset of the `ATA` field.
13130    pub const ATA_SHIFT: u32 = 43;
13131    /// Offset of the `DSSBS` field.
13132    pub const DSSBS_SHIFT: u32 = 44;
13133    /// Offset of the `TCSO` field.
13134    pub const TCSO_SHIFT: u32 = 59;
13135    /// Offset of the `NMI` field.
13136    pub const NMI_SHIFT: u32 = 61;
13137    /// Offset of the `SPINTMASK` field.
13138    pub const SPINTMASK_SHIFT: u32 = 62;
13139
13140    /// Returns the value of the `TCF` field.
13141    pub const fn tcf(self) -> u8 {
13142        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
13143    }
13144}
13145
13146bitflags! {
13147    /// `SDCR` system register value.
13148    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13149    #[repr(transparent)]
13150    pub struct Sdcr: u32 {
13151        /// `SPME` bit.
13152        const SPME = 1 << 17;
13153        /// `STE` bit.
13154        const STE = 1 << 18;
13155        /// `TTRF` bit.
13156        const TTRF = 1 << 19;
13157        /// `EDAD` bit.
13158        const EDAD = 1 << 20;
13159        /// `EPMAD` bit.
13160        const EPMAD = 1 << 21;
13161        /// `SCCD` bit.
13162        const SCCD = 1 << 23;
13163        /// `TDCC` bit.
13164        const TDCC = 1 << 27;
13165        /// `MTPME` bit.
13166        const MTPME = 1 << 28;
13167    }
13168}
13169
13170impl Sdcr {
13171    /// Offset of the `SPD` field.
13172    pub const SPD_SHIFT: u32 = 14;
13173    /// Mask for the `SPD` field.
13174    pub const SPD_MASK: u32 = 0b11;
13175    /// Offset of the `SPME` field.
13176    pub const SPME_SHIFT: u32 = 17;
13177    /// Offset of the `STE` field.
13178    pub const STE_SHIFT: u32 = 18;
13179    /// Offset of the `TTRF` field.
13180    pub const TTRF_SHIFT: u32 = 19;
13181    /// Offset of the `EDAD` field.
13182    pub const EDAD_SHIFT: u32 = 20;
13183    /// Offset of the `EPMAD` field.
13184    pub const EPMAD_SHIFT: u32 = 21;
13185    /// Offset of the `SCCD` field.
13186    pub const SCCD_SHIFT: u32 = 23;
13187    /// Offset of the `TDCC` field.
13188    pub const TDCC_SHIFT: u32 = 27;
13189    /// Offset of the `MTPME` field.
13190    pub const MTPME_SHIFT: u32 = 28;
13191
13192    /// Returns the value of the `SPD` field.
13193    pub const fn spd(self) -> u8 {
13194        ((self.bits() >> Self::SPD_SHIFT) & 0b11) as u8
13195    }
13196}
13197
13198bitflags! {
13199    /// `SDER` system register value.
13200    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13201    #[repr(transparent)]
13202    pub struct Sder: u32 {
13203        /// `SUIDEN` bit.
13204        const SUIDEN = 1 << 0;
13205        /// `SUNIDEN` bit.
13206        const SUNIDEN = 1 << 1;
13207    }
13208}
13209
13210impl Sder {
13211    /// Offset of the `SUIDEN` field.
13212    pub const SUIDEN_SHIFT: u32 = 0;
13213    /// Offset of the `SUNIDEN` field.
13214    pub const SUNIDEN_SHIFT: u32 = 1;
13215}
13216
13217#[cfg(feature = "el3")]
13218bitflags! {
13219    /// `SMCR_EL3` system register value.
13220    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13221    #[repr(transparent)]
13222    pub struct SmcrEl3: u64 {
13223        /// `EZT0` bit.
13224        const EZT0 = 1 << 30;
13225        /// `FA64` bit.
13226        const FA64 = 1 << 31;
13227    }
13228}
13229
13230#[cfg(feature = "el3")]
13231impl SmcrEl3 {
13232    /// Offset of the `LEN` field.
13233    pub const LEN_SHIFT: u32 = 0;
13234    /// Mask for the `LEN` field.
13235    pub const LEN_MASK: u64 = 0b1111;
13236    /// Offset of the `EZT0` field.
13237    pub const EZT0_SHIFT: u32 = 30;
13238    /// Offset of the `FA64` field.
13239    pub const FA64_SHIFT: u32 = 31;
13240
13241    /// Returns the value of the `LEN` field.
13242    pub const fn len(self) -> u8 {
13243        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
13244    }
13245}
13246
13247#[cfg(feature = "el1")]
13248bitflags! {
13249    /// `SPSR_EL1` system register value.
13250    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13251    #[repr(transparent)]
13252    pub struct SpsrEl1: u64 {
13253        /// `M[4]` bit.
13254        const M_4 = 1 << 4;
13255        /// `T` bit.
13256        const T = 1 << 5;
13257        /// `F` bit.
13258        const F = 1 << 6;
13259        /// `I` bit.
13260        const I = 1 << 7;
13261        /// `A` bit.
13262        const A = 1 << 8;
13263        /// `D` bit.
13264        const D = 1 << 9;
13265        /// `E` bit.
13266        const E = 1 << 9;
13267        /// `ALLINT` bit.
13268        const ALLINT = 1 << 13;
13269        /// `BTYPE2` bit.
13270        const BTYPE2 = 1 << 14;
13271        /// `IL` bit.
13272        const IL = 1 << 20;
13273        /// `SS` bit.
13274        const SS = 1 << 21;
13275        /// `PAN` bit.
13276        const PAN = 1 << 22;
13277        /// `UAO` bit.
13278        const UAO = 1 << 23;
13279        /// `DIT` bit.
13280        const DIT = 1 << 24;
13281        /// `TCO` bit.
13282        const TCO = 1 << 25;
13283        /// `Q` bit.
13284        const Q = 1 << 27;
13285        /// `V` bit.
13286        const V = 1 << 28;
13287        /// `C` bit.
13288        const C = 1 << 29;
13289        /// `Z` bit.
13290        const Z = 1 << 30;
13291        /// `N` bit.
13292        const N = 1 << 31;
13293        /// `PM` bit.
13294        const PM = 1 << 32;
13295        /// `PPEND` bit.
13296        const PPEND = 1 << 33;
13297        /// `EXLOCK` bit.
13298        const EXLOCK = 1 << 34;
13299        /// `PACM` bit.
13300        const PACM = 1 << 35;
13301        /// `UINJ` bit.
13302        const UINJ = 1 << 36;
13303    }
13304}
13305
13306#[cfg(feature = "el1")]
13307impl SpsrEl1 {
13308    /// Offset of the `M[3:0]` field.
13309    pub const M_3_0_SHIFT: u32 = 0;
13310    /// Mask for the `M[3:0]` field.
13311    pub const M_3_0_MASK: u64 = 0b1111;
13312    /// Offset of the `M[4]` field.
13313    pub const M_4_SHIFT: u32 = 4;
13314    /// Offset of the `T` field.
13315    pub const T_SHIFT: u32 = 5;
13316    /// Offset of the `F` field.
13317    pub const F_SHIFT: u32 = 6;
13318    /// Offset of the `I` field.
13319    pub const I_SHIFT: u32 = 7;
13320    /// Offset of the `A` field.
13321    pub const A_SHIFT: u32 = 8;
13322    /// Offset of the `D` field.
13323    pub const D_SHIFT: u32 = 9;
13324    /// Offset of the `E` field.
13325    pub const E_SHIFT: u32 = 9;
13326    /// Offset of the `BTYPE` field.
13327    pub const BTYPE_SHIFT: u32 = 10;
13328    /// Mask for the `BTYPE` field.
13329    pub const BTYPE_MASK: u64 = 0b11;
13330    /// Offset of the `ALLINT` field.
13331    pub const ALLINT_SHIFT: u32 = 13;
13332    /// Offset of the `BTYPE2` field.
13333    pub const BTYPE2_SHIFT: u32 = 14;
13334    /// Offset of the `GE` field.
13335    pub const GE_SHIFT: u32 = 16;
13336    /// Mask for the `GE` field.
13337    pub const GE_MASK: u64 = 0b1111;
13338    /// Offset of the `IL` field.
13339    pub const IL_SHIFT: u32 = 20;
13340    /// Offset of the `SS` field.
13341    pub const SS_SHIFT: u32 = 21;
13342    /// Offset of the `PAN` field.
13343    pub const PAN_SHIFT: u32 = 22;
13344    /// Offset of the `UAO` field.
13345    pub const UAO_SHIFT: u32 = 23;
13346    /// Offset of the `DIT` field.
13347    pub const DIT_SHIFT: u32 = 24;
13348    /// Offset of the `TCO` field.
13349    pub const TCO_SHIFT: u32 = 25;
13350    /// Offset of the `Q` field.
13351    pub const Q_SHIFT: u32 = 27;
13352    /// Offset of the `V` field.
13353    pub const V_SHIFT: u32 = 28;
13354    /// Offset of the `C` field.
13355    pub const C_SHIFT: u32 = 29;
13356    /// Offset of the `Z` field.
13357    pub const Z_SHIFT: u32 = 30;
13358    /// Offset of the `N` field.
13359    pub const N_SHIFT: u32 = 31;
13360    /// Offset of the `PM` field.
13361    pub const PM_SHIFT: u32 = 32;
13362    /// Offset of the `PPEND` field.
13363    pub const PPEND_SHIFT: u32 = 33;
13364    /// Offset of the `EXLOCK` field.
13365    pub const EXLOCK_SHIFT: u32 = 34;
13366    /// Offset of the `PACM` field.
13367    pub const PACM_SHIFT: u32 = 35;
13368    /// Offset of the `UINJ` field.
13369    pub const UINJ_SHIFT: u32 = 36;
13370
13371    /// Returns the value of the `M[3:0]` field.
13372    pub const fn m_3_0(self) -> u8 {
13373        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
13374    }
13375
13376    /// Returns the value of the `BTYPE` field.
13377    pub const fn btype(self) -> u8 {
13378        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
13379    }
13380
13381    /// Returns the value of the `GE` field.
13382    pub const fn ge(self) -> u8 {
13383        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
13384    }
13385}
13386
13387#[cfg(feature = "el2")]
13388bitflags! {
13389    /// `SPSR_EL2` system register value.
13390    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13391    #[repr(transparent)]
13392    pub struct SpsrEl2: u64 {
13393        /// `M[4]` bit.
13394        const M_4 = 1 << 4;
13395        /// `T` bit.
13396        const T = 1 << 5;
13397        /// `F` bit.
13398        const F = 1 << 6;
13399        /// `I` bit.
13400        const I = 1 << 7;
13401        /// `A` bit.
13402        const A = 1 << 8;
13403        /// `D` bit.
13404        const D = 1 << 9;
13405        /// `E` bit.
13406        const E = 1 << 9;
13407        /// `ALLINT` bit.
13408        const ALLINT = 1 << 13;
13409        /// `BTYPE2` bit.
13410        const BTYPE2 = 1 << 14;
13411        /// `IL` bit.
13412        const IL = 1 << 20;
13413        /// `SS` bit.
13414        const SS = 1 << 21;
13415        /// `PAN` bit.
13416        const PAN = 1 << 22;
13417        /// `UAO` bit.
13418        const UAO = 1 << 23;
13419        /// `DIT` bit.
13420        const DIT = 1 << 24;
13421        /// `TCO` bit.
13422        const TCO = 1 << 25;
13423        /// `Q` bit.
13424        const Q = 1 << 27;
13425        /// `V` bit.
13426        const V = 1 << 28;
13427        /// `C` bit.
13428        const C = 1 << 29;
13429        /// `Z` bit.
13430        const Z = 1 << 30;
13431        /// `N` bit.
13432        const N = 1 << 31;
13433        /// `PM` bit.
13434        const PM = 1 << 32;
13435        /// `PPEND` bit.
13436        const PPEND = 1 << 33;
13437        /// `EXLOCK` bit.
13438        const EXLOCK = 1 << 34;
13439        /// `PACM` bit.
13440        const PACM = 1 << 35;
13441        /// `UINJ` bit.
13442        const UINJ = 1 << 36;
13443    }
13444}
13445
13446#[cfg(feature = "el2")]
13447impl SpsrEl2 {
13448    /// Offset of the `M[3:0]` field.
13449    pub const M_3_0_SHIFT: u32 = 0;
13450    /// Mask for the `M[3:0]` field.
13451    pub const M_3_0_MASK: u64 = 0b1111;
13452    /// Offset of the `M[4]` field.
13453    pub const M_4_SHIFT: u32 = 4;
13454    /// Offset of the `T` field.
13455    pub const T_SHIFT: u32 = 5;
13456    /// Offset of the `F` field.
13457    pub const F_SHIFT: u32 = 6;
13458    /// Offset of the `I` field.
13459    pub const I_SHIFT: u32 = 7;
13460    /// Offset of the `A` field.
13461    pub const A_SHIFT: u32 = 8;
13462    /// Offset of the `D` field.
13463    pub const D_SHIFT: u32 = 9;
13464    /// Offset of the `E` field.
13465    pub const E_SHIFT: u32 = 9;
13466    /// Offset of the `BTYPE` field.
13467    pub const BTYPE_SHIFT: u32 = 10;
13468    /// Mask for the `BTYPE` field.
13469    pub const BTYPE_MASK: u64 = 0b11;
13470    /// Offset of the `ALLINT` field.
13471    pub const ALLINT_SHIFT: u32 = 13;
13472    /// Offset of the `BTYPE2` field.
13473    pub const BTYPE2_SHIFT: u32 = 14;
13474    /// Offset of the `GE` field.
13475    pub const GE_SHIFT: u32 = 16;
13476    /// Mask for the `GE` field.
13477    pub const GE_MASK: u64 = 0b1111;
13478    /// Offset of the `IL` field.
13479    pub const IL_SHIFT: u32 = 20;
13480    /// Offset of the `SS` field.
13481    pub const SS_SHIFT: u32 = 21;
13482    /// Offset of the `PAN` field.
13483    pub const PAN_SHIFT: u32 = 22;
13484    /// Offset of the `UAO` field.
13485    pub const UAO_SHIFT: u32 = 23;
13486    /// Offset of the `DIT` field.
13487    pub const DIT_SHIFT: u32 = 24;
13488    /// Offset of the `TCO` field.
13489    pub const TCO_SHIFT: u32 = 25;
13490    /// Offset of the `Q` field.
13491    pub const Q_SHIFT: u32 = 27;
13492    /// Offset of the `V` field.
13493    pub const V_SHIFT: u32 = 28;
13494    /// Offset of the `C` field.
13495    pub const C_SHIFT: u32 = 29;
13496    /// Offset of the `Z` field.
13497    pub const Z_SHIFT: u32 = 30;
13498    /// Offset of the `N` field.
13499    pub const N_SHIFT: u32 = 31;
13500    /// Offset of the `PM` field.
13501    pub const PM_SHIFT: u32 = 32;
13502    /// Offset of the `PPEND` field.
13503    pub const PPEND_SHIFT: u32 = 33;
13504    /// Offset of the `EXLOCK` field.
13505    pub const EXLOCK_SHIFT: u32 = 34;
13506    /// Offset of the `PACM` field.
13507    pub const PACM_SHIFT: u32 = 35;
13508    /// Offset of the `UINJ` field.
13509    pub const UINJ_SHIFT: u32 = 36;
13510
13511    /// Returns the value of the `M[3:0]` field.
13512    pub const fn m_3_0(self) -> u8 {
13513        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
13514    }
13515
13516    /// Returns the value of the `BTYPE` field.
13517    pub const fn btype(self) -> u8 {
13518        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
13519    }
13520
13521    /// Returns the value of the `GE` field.
13522    pub const fn ge(self) -> u8 {
13523        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
13524    }
13525}
13526
13527#[cfg(feature = "el3")]
13528bitflags! {
13529    /// `SPSR_EL3` system register value.
13530    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13531    #[repr(transparent)]
13532    pub struct SpsrEl3: u64 {
13533        /// `M[4]` bit.
13534        const M_4 = 1 << 4;
13535        /// `T` bit.
13536        const T = 1 << 5;
13537        /// `F` bit.
13538        const F = 1 << 6;
13539        /// `I` bit.
13540        const I = 1 << 7;
13541        /// `A` bit.
13542        const A = 1 << 8;
13543        /// `D` bit.
13544        const D = 1 << 9;
13545        /// `E` bit.
13546        const E = 1 << 9;
13547        /// `ALLINT` bit.
13548        const ALLINT = 1 << 13;
13549        /// `BTYPE2` bit.
13550        const BTYPE2 = 1 << 14;
13551        /// `IL` bit.
13552        const IL = 1 << 20;
13553        /// `SS` bit.
13554        const SS = 1 << 21;
13555        /// `PAN` bit.
13556        const PAN = 1 << 22;
13557        /// `UAO` bit.
13558        const UAO = 1 << 23;
13559        /// `DIT` bit.
13560        const DIT = 1 << 24;
13561        /// `TCO` bit.
13562        const TCO = 1 << 25;
13563        /// `Q` bit.
13564        const Q = 1 << 27;
13565        /// `V` bit.
13566        const V = 1 << 28;
13567        /// `C` bit.
13568        const C = 1 << 29;
13569        /// `Z` bit.
13570        const Z = 1 << 30;
13571        /// `N` bit.
13572        const N = 1 << 31;
13573        /// `PM` bit.
13574        const PM = 1 << 32;
13575        /// `PPEND` bit.
13576        const PPEND = 1 << 33;
13577        /// `EXLOCK` bit.
13578        const EXLOCK = 1 << 34;
13579        /// `PACM` bit.
13580        const PACM = 1 << 35;
13581        /// `UINJ` bit.
13582        const UINJ = 1 << 36;
13583    }
13584}
13585
13586#[cfg(feature = "el3")]
13587impl SpsrEl3 {
13588    /// Offset of the `M[3:0]` field.
13589    pub const M_3_0_SHIFT: u32 = 0;
13590    /// Mask for the `M[3:0]` field.
13591    pub const M_3_0_MASK: u64 = 0b1111;
13592    /// Offset of the `M[4]` field.
13593    pub const M_4_SHIFT: u32 = 4;
13594    /// Offset of the `T` field.
13595    pub const T_SHIFT: u32 = 5;
13596    /// Offset of the `F` field.
13597    pub const F_SHIFT: u32 = 6;
13598    /// Offset of the `I` field.
13599    pub const I_SHIFT: u32 = 7;
13600    /// Offset of the `A` field.
13601    pub const A_SHIFT: u32 = 8;
13602    /// Offset of the `D` field.
13603    pub const D_SHIFT: u32 = 9;
13604    /// Offset of the `E` field.
13605    pub const E_SHIFT: u32 = 9;
13606    /// Offset of the `BTYPE` field.
13607    pub const BTYPE_SHIFT: u32 = 10;
13608    /// Mask for the `BTYPE` field.
13609    pub const BTYPE_MASK: u64 = 0b11;
13610    /// Offset of the `ALLINT` field.
13611    pub const ALLINT_SHIFT: u32 = 13;
13612    /// Offset of the `BTYPE2` field.
13613    pub const BTYPE2_SHIFT: u32 = 14;
13614    /// Offset of the `GE` field.
13615    pub const GE_SHIFT: u32 = 16;
13616    /// Mask for the `GE` field.
13617    pub const GE_MASK: u64 = 0b1111;
13618    /// Offset of the `IL` field.
13619    pub const IL_SHIFT: u32 = 20;
13620    /// Offset of the `SS` field.
13621    pub const SS_SHIFT: u32 = 21;
13622    /// Offset of the `PAN` field.
13623    pub const PAN_SHIFT: u32 = 22;
13624    /// Offset of the `UAO` field.
13625    pub const UAO_SHIFT: u32 = 23;
13626    /// Offset of the `DIT` field.
13627    pub const DIT_SHIFT: u32 = 24;
13628    /// Offset of the `TCO` field.
13629    pub const TCO_SHIFT: u32 = 25;
13630    /// Offset of the `Q` field.
13631    pub const Q_SHIFT: u32 = 27;
13632    /// Offset of the `V` field.
13633    pub const V_SHIFT: u32 = 28;
13634    /// Offset of the `C` field.
13635    pub const C_SHIFT: u32 = 29;
13636    /// Offset of the `Z` field.
13637    pub const Z_SHIFT: u32 = 30;
13638    /// Offset of the `N` field.
13639    pub const N_SHIFT: u32 = 31;
13640    /// Offset of the `PM` field.
13641    pub const PM_SHIFT: u32 = 32;
13642    /// Offset of the `PPEND` field.
13643    pub const PPEND_SHIFT: u32 = 33;
13644    /// Offset of the `EXLOCK` field.
13645    pub const EXLOCK_SHIFT: u32 = 34;
13646    /// Offset of the `PACM` field.
13647    pub const PACM_SHIFT: u32 = 35;
13648    /// Offset of the `UINJ` field.
13649    pub const UINJ_SHIFT: u32 = 36;
13650
13651    /// Returns the value of the `M[3:0]` field.
13652    pub const fn m_3_0(self) -> u8 {
13653        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
13654    }
13655
13656    /// Returns the value of the `BTYPE` field.
13657    pub const fn btype(self) -> u8 {
13658        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
13659    }
13660
13661    /// Returns the value of the `GE` field.
13662    pub const fn ge(self) -> u8 {
13663        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
13664    }
13665}
13666
13667#[cfg(feature = "el1")]
13668bitflags! {
13669    /// `SP_EL1` system register value.
13670    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13671    #[repr(transparent)]
13672    pub struct SpEl1: u64 {
13673    }
13674}
13675
13676#[cfg(feature = "el1")]
13677impl SpEl1 {
13678    /// Offset of the `StackPointer` field.
13679    pub const STACKPOINTER_SHIFT: u32 = 0;
13680    /// Mask for the `StackPointer` field.
13681    pub const STACKPOINTER_MASK: u64 =
13682        0b1111111111111111111111111111111111111111111111111111111111111111;
13683
13684    /// Returns the value of the `StackPointer` field.
13685    pub const fn stackpointer(self) -> u64 {
13686        ((self.bits() >> Self::STACKPOINTER_SHIFT)
13687            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
13688    }
13689}
13690
13691#[cfg(feature = "el2")]
13692bitflags! {
13693    /// `SP_EL2` system register value.
13694    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13695    #[repr(transparent)]
13696    pub struct SpEl2: u64 {
13697    }
13698}
13699
13700#[cfg(feature = "el2")]
13701impl SpEl2 {
13702    /// Offset of the `StackPointer` field.
13703    pub const STACKPOINTER_SHIFT: u32 = 0;
13704    /// Mask for the `StackPointer` field.
13705    pub const STACKPOINTER_MASK: u64 =
13706        0b1111111111111111111111111111111111111111111111111111111111111111;
13707
13708    /// Returns the value of the `StackPointer` field.
13709    pub const fn stackpointer(self) -> u64 {
13710        ((self.bits() >> Self::STACKPOINTER_SHIFT)
13711            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
13712    }
13713}
13714
13715#[cfg(feature = "el1")]
13716bitflags! {
13717    /// `TCR2_EL1` system register value.
13718    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13719    #[repr(transparent)]
13720    pub struct Tcr2El1: u64 {
13721        /// `PnCH` bit.
13722        const PNCH = 1 << 0;
13723        /// `PIE` bit.
13724        const PIE = 1 << 1;
13725        /// `E0POE` bit.
13726        const E0POE = 1 << 2;
13727        /// `POE` bit.
13728        const POE = 1 << 3;
13729        /// `AIE` bit.
13730        const AIE = 1 << 4;
13731        /// `D128` bit.
13732        const D128 = 1 << 5;
13733        /// `PTTWI` bit.
13734        const PTTWI = 1 << 10;
13735        /// `HAFT` bit.
13736        const HAFT = 1 << 11;
13737        /// `DisCH0` bit.
13738        const DISCH0 = 1 << 14;
13739        /// `DisCH1` bit.
13740        const DISCH1 = 1 << 15;
13741        /// `A2` bit.
13742        const A2 = 1 << 16;
13743        /// `FNG0` bit.
13744        const FNG0 = 1 << 17;
13745        /// `FNG1` bit.
13746        const FNG1 = 1 << 18;
13747        /// `POE2F` bit.
13748        const POE2F = 1 << 19;
13749        /// `FNGNA0` bit.
13750        const FNGNA0 = 1 << 20;
13751        /// `FNGNA1` bit.
13752        const FNGNA1 = 1 << 21;
13753        /// `TVAD0` bit.
13754        const TVAD0 = 1 << 35;
13755        /// `TVAD1` bit.
13756        const TVAD1 = 1 << 36;
13757    }
13758}
13759
13760#[cfg(feature = "el1")]
13761impl Tcr2El1 {
13762    /// Offset of the `PnCH` field.
13763    pub const PNCH_SHIFT: u32 = 0;
13764    /// Offset of the `PIE` field.
13765    pub const PIE_SHIFT: u32 = 1;
13766    /// Offset of the `E0POE` field.
13767    pub const E0POE_SHIFT: u32 = 2;
13768    /// Offset of the `POE` field.
13769    pub const POE_SHIFT: u32 = 3;
13770    /// Offset of the `AIE` field.
13771    pub const AIE_SHIFT: u32 = 4;
13772    /// Offset of the `D128` field.
13773    pub const D128_SHIFT: u32 = 5;
13774    /// Offset of the `PTTWI` field.
13775    pub const PTTWI_SHIFT: u32 = 10;
13776    /// Offset of the `HAFT` field.
13777    pub const HAFT_SHIFT: u32 = 11;
13778    /// Offset of the `DisCH0` field.
13779    pub const DISCH0_SHIFT: u32 = 14;
13780    /// Offset of the `DisCH1` field.
13781    pub const DISCH1_SHIFT: u32 = 15;
13782    /// Offset of the `A2` field.
13783    pub const A2_SHIFT: u32 = 16;
13784    /// Offset of the `FNG0` field.
13785    pub const FNG0_SHIFT: u32 = 17;
13786    /// Offset of the `FNG1` field.
13787    pub const FNG1_SHIFT: u32 = 18;
13788    /// Offset of the `POE2F` field.
13789    pub const POE2F_SHIFT: u32 = 19;
13790    /// Offset of the `FNGNA0` field.
13791    pub const FNGNA0_SHIFT: u32 = 20;
13792    /// Offset of the `FNGNA1` field.
13793    pub const FNGNA1_SHIFT: u32 = 21;
13794    /// Offset of the `POIW` field.
13795    pub const POIW_SHIFT: u32 = 22;
13796    /// Mask for the `POIW` field.
13797    pub const POIW_MASK: u64 = 0b111;
13798    /// Offset of the `VTB0` field.
13799    pub const VTB0_SHIFT: u32 = 25;
13800    /// Mask for the `VTB0` field.
13801    pub const VTB0_MASK: u64 = 0b11111;
13802    /// Offset of the `VTB1` field.
13803    pub const VTB1_SHIFT: u32 = 30;
13804    /// Mask for the `VTB1` field.
13805    pub const VTB1_MASK: u64 = 0b11111;
13806    /// Offset of the `TVAD0` field.
13807    pub const TVAD0_SHIFT: u32 = 35;
13808    /// Offset of the `TVAD1` field.
13809    pub const TVAD1_SHIFT: u32 = 36;
13810
13811    /// Returns the value of the `POIW` field.
13812    pub const fn poiw(self) -> u8 {
13813        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
13814    }
13815
13816    /// Returns the value of the `VTB0` field.
13817    pub const fn vtb0(self) -> u8 {
13818        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
13819    }
13820
13821    /// Returns the value of the `VTB1` field.
13822    pub const fn vtb1(self) -> u8 {
13823        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
13824    }
13825}
13826
13827#[cfg(feature = "el2")]
13828bitflags! {
13829    /// `TCR2_EL2` system register value.
13830    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13831    #[repr(transparent)]
13832    pub struct Tcr2El2: u64 {
13833        /// `PnCH` bit.
13834        const PNCH = 1 << 0;
13835        /// `PIE` bit.
13836        const PIE = 1 << 1;
13837        /// `E0POE` bit.
13838        const E0POE = 1 << 2;
13839        /// `POE` bit.
13840        const POE = 1 << 3;
13841        /// `AIE` bit.
13842        const AIE = 1 << 4;
13843        /// `D128` bit.
13844        const D128 = 1 << 5;
13845        /// `PTTWI` bit.
13846        const PTTWI = 1 << 10;
13847        /// `HAFT` bit.
13848        const HAFT = 1 << 11;
13849        /// `AMEC0` bit.
13850        const AMEC0 = 1 << 12;
13851        /// `AMEC1` bit.
13852        const AMEC1 = 1 << 13;
13853        /// `DisCH0` bit.
13854        const DISCH0 = 1 << 14;
13855        /// `DisCH1` bit.
13856        const DISCH1 = 1 << 15;
13857        /// `A2` bit.
13858        const A2 = 1 << 16;
13859        /// `FNG0` bit.
13860        const FNG0 = 1 << 17;
13861        /// `FNG1` bit.
13862        const FNG1 = 1 << 18;
13863        /// `POE2F` bit.
13864        const POE2F = 1 << 19;
13865        /// `TVAD0` bit.
13866        const TVAD0 = 1 << 35;
13867        /// `TVAD1` bit.
13868        const TVAD1 = 1 << 36;
13869    }
13870}
13871
13872#[cfg(feature = "el2")]
13873impl Tcr2El2 {
13874    /// Offset of the `PnCH` field.
13875    pub const PNCH_SHIFT: u32 = 0;
13876    /// Offset of the `PIE` field.
13877    pub const PIE_SHIFT: u32 = 1;
13878    /// Offset of the `E0POE` field.
13879    pub const E0POE_SHIFT: u32 = 2;
13880    /// Offset of the `POE` field.
13881    pub const POE_SHIFT: u32 = 3;
13882    /// Offset of the `AIE` field.
13883    pub const AIE_SHIFT: u32 = 4;
13884    /// Offset of the `D128` field.
13885    pub const D128_SHIFT: u32 = 5;
13886    /// Offset of the `PTTWI` field.
13887    pub const PTTWI_SHIFT: u32 = 10;
13888    /// Offset of the `HAFT` field.
13889    pub const HAFT_SHIFT: u32 = 11;
13890    /// Offset of the `AMEC0` field.
13891    pub const AMEC0_SHIFT: u32 = 12;
13892    /// Offset of the `AMEC1` field.
13893    pub const AMEC1_SHIFT: u32 = 13;
13894    /// Offset of the `DisCH0` field.
13895    pub const DISCH0_SHIFT: u32 = 14;
13896    /// Offset of the `DisCH1` field.
13897    pub const DISCH1_SHIFT: u32 = 15;
13898    /// Offset of the `A2` field.
13899    pub const A2_SHIFT: u32 = 16;
13900    /// Offset of the `FNG0` field.
13901    pub const FNG0_SHIFT: u32 = 17;
13902    /// Offset of the `FNG1` field.
13903    pub const FNG1_SHIFT: u32 = 18;
13904    /// Offset of the `POE2F` field.
13905    pub const POE2F_SHIFT: u32 = 19;
13906    /// Offset of the `POIW` field.
13907    pub const POIW_SHIFT: u32 = 22;
13908    /// Mask for the `POIW` field.
13909    pub const POIW_MASK: u64 = 0b111;
13910    /// Offset of the `VTB0` field.
13911    pub const VTB0_SHIFT: u32 = 25;
13912    /// Mask for the `VTB0` field.
13913    pub const VTB0_MASK: u64 = 0b11111;
13914    /// Offset of the `VTB1` field.
13915    pub const VTB1_SHIFT: u32 = 30;
13916    /// Mask for the `VTB1` field.
13917    pub const VTB1_MASK: u64 = 0b11111;
13918    /// Offset of the `TVAD0` field.
13919    pub const TVAD0_SHIFT: u32 = 35;
13920    /// Offset of the `TVAD1` field.
13921    pub const TVAD1_SHIFT: u32 = 36;
13922
13923    /// Returns the value of the `POIW` field.
13924    pub const fn poiw(self) -> u8 {
13925        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
13926    }
13927
13928    /// Returns the value of the `VTB0` field.
13929    pub const fn vtb0(self) -> u8 {
13930        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
13931    }
13932
13933    /// Returns the value of the `VTB1` field.
13934    pub const fn vtb1(self) -> u8 {
13935        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
13936    }
13937}
13938
13939#[cfg(feature = "el1")]
13940bitflags! {
13941    /// `TCR_EL1` system register value.
13942    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
13943    #[repr(transparent)]
13944    pub struct TcrEl1: u64 {
13945        /// `EPD0` bit.
13946        const EPD0 = 1 << 7;
13947        /// `A1` bit.
13948        const A1 = 1 << 22;
13949        /// `EPD1` bit.
13950        const EPD1 = 1 << 23;
13951        /// `AS` bit.
13952        const AS = 1 << 36;
13953        /// `TBI0` bit.
13954        const TBI0 = 1 << 37;
13955        /// `TBI1` bit.
13956        const TBI1 = 1 << 38;
13957        /// `HA` bit.
13958        const HA = 1 << 39;
13959        /// `HD` bit.
13960        const HD = 1 << 40;
13961        /// `HPD0` bit.
13962        const HPD0 = 1 << 41;
13963        /// `HPD1` bit.
13964        const HPD1 = 1 << 42;
13965        /// `HWU059` bit.
13966        const HWU059 = 1 << 43;
13967        /// `HWU060` bit.
13968        const HWU060 = 1 << 44;
13969        /// `HWU061` bit.
13970        const HWU061 = 1 << 45;
13971        /// `HWU062` bit.
13972        const HWU062 = 1 << 46;
13973        /// `HWU159` bit.
13974        const HWU159 = 1 << 47;
13975        /// `HWU160` bit.
13976        const HWU160 = 1 << 48;
13977        /// `HWU161` bit.
13978        const HWU161 = 1 << 49;
13979        /// `HWU162` bit.
13980        const HWU162 = 1 << 50;
13981        /// `TBID0` bit.
13982        const TBID0 = 1 << 51;
13983        /// `TBID1` bit.
13984        const TBID1 = 1 << 52;
13985        /// `NFD0` bit.
13986        const NFD0 = 1 << 53;
13987        /// `NFD1` bit.
13988        const NFD1 = 1 << 54;
13989        /// `E0PD0` bit.
13990        const E0PD0 = 1 << 55;
13991        /// `E0PD1` bit.
13992        const E0PD1 = 1 << 56;
13993        /// `TCMA0` bit.
13994        const TCMA0 = 1 << 57;
13995        /// `TCMA1` bit.
13996        const TCMA1 = 1 << 58;
13997        /// `DS` bit.
13998        const DS = 1 << 59;
13999        /// `MTX0` bit.
14000        const MTX0 = 1 << 60;
14001        /// `MTX1` bit.
14002        const MTX1 = 1 << 61;
14003    }
14004}
14005
14006#[cfg(feature = "el1")]
14007impl TcrEl1 {
14008    /// Offset of the `T0SZ` field.
14009    pub const T0SZ_SHIFT: u32 = 0;
14010    /// Mask for the `T0SZ` field.
14011    pub const T0SZ_MASK: u64 = 0b111111;
14012    /// Offset of the `EPD0` field.
14013    pub const EPD0_SHIFT: u32 = 7;
14014    /// Offset of the `IRGN0` field.
14015    pub const IRGN0_SHIFT: u32 = 8;
14016    /// Mask for the `IRGN0` field.
14017    pub const IRGN0_MASK: u64 = 0b11;
14018    /// Offset of the `ORGN0` field.
14019    pub const ORGN0_SHIFT: u32 = 10;
14020    /// Mask for the `ORGN0` field.
14021    pub const ORGN0_MASK: u64 = 0b11;
14022    /// Offset of the `SH0` field.
14023    pub const SH0_SHIFT: u32 = 12;
14024    /// Mask for the `SH0` field.
14025    pub const SH0_MASK: u64 = 0b11;
14026    /// Offset of the `TG0` field.
14027    pub const TG0_SHIFT: u32 = 14;
14028    /// Mask for the `TG0` field.
14029    pub const TG0_MASK: u64 = 0b11;
14030    /// Offset of the `T1SZ` field.
14031    pub const T1SZ_SHIFT: u32 = 16;
14032    /// Mask for the `T1SZ` field.
14033    pub const T1SZ_MASK: u64 = 0b111111;
14034    /// Offset of the `A1` field.
14035    pub const A1_SHIFT: u32 = 22;
14036    /// Offset of the `EPD1` field.
14037    pub const EPD1_SHIFT: u32 = 23;
14038    /// Offset of the `IRGN1` field.
14039    pub const IRGN1_SHIFT: u32 = 24;
14040    /// Mask for the `IRGN1` field.
14041    pub const IRGN1_MASK: u64 = 0b11;
14042    /// Offset of the `ORGN1` field.
14043    pub const ORGN1_SHIFT: u32 = 26;
14044    /// Mask for the `ORGN1` field.
14045    pub const ORGN1_MASK: u64 = 0b11;
14046    /// Offset of the `SH1` field.
14047    pub const SH1_SHIFT: u32 = 28;
14048    /// Mask for the `SH1` field.
14049    pub const SH1_MASK: u64 = 0b11;
14050    /// Offset of the `TG1` field.
14051    pub const TG1_SHIFT: u32 = 30;
14052    /// Mask for the `TG1` field.
14053    pub const TG1_MASK: u64 = 0b11;
14054    /// Offset of the `IPS` field.
14055    pub const IPS_SHIFT: u32 = 32;
14056    /// Mask for the `IPS` field.
14057    pub const IPS_MASK: u64 = 0b111;
14058    /// Offset of the `AS` field.
14059    pub const AS_SHIFT: u32 = 36;
14060    /// Offset of the `TBI0` field.
14061    pub const TBI0_SHIFT: u32 = 37;
14062    /// Offset of the `TBI1` field.
14063    pub const TBI1_SHIFT: u32 = 38;
14064    /// Offset of the `HA` field.
14065    pub const HA_SHIFT: u32 = 39;
14066    /// Offset of the `HD` field.
14067    pub const HD_SHIFT: u32 = 40;
14068    /// Offset of the `HPD0` field.
14069    pub const HPD0_SHIFT: u32 = 41;
14070    /// Offset of the `HPD1` field.
14071    pub const HPD1_SHIFT: u32 = 42;
14072    /// Offset of the `HWU059` field.
14073    pub const HWU059_SHIFT: u32 = 43;
14074    /// Offset of the `HWU060` field.
14075    pub const HWU060_SHIFT: u32 = 44;
14076    /// Offset of the `HWU061` field.
14077    pub const HWU061_SHIFT: u32 = 45;
14078    /// Offset of the `HWU062` field.
14079    pub const HWU062_SHIFT: u32 = 46;
14080    /// Offset of the `HWU159` field.
14081    pub const HWU159_SHIFT: u32 = 47;
14082    /// Offset of the `HWU160` field.
14083    pub const HWU160_SHIFT: u32 = 48;
14084    /// Offset of the `HWU161` field.
14085    pub const HWU161_SHIFT: u32 = 49;
14086    /// Offset of the `HWU162` field.
14087    pub const HWU162_SHIFT: u32 = 50;
14088    /// Offset of the `TBID0` field.
14089    pub const TBID0_SHIFT: u32 = 51;
14090    /// Offset of the `TBID1` field.
14091    pub const TBID1_SHIFT: u32 = 52;
14092    /// Offset of the `NFD0` field.
14093    pub const NFD0_SHIFT: u32 = 53;
14094    /// Offset of the `NFD1` field.
14095    pub const NFD1_SHIFT: u32 = 54;
14096    /// Offset of the `E0PD0` field.
14097    pub const E0PD0_SHIFT: u32 = 55;
14098    /// Offset of the `E0PD1` field.
14099    pub const E0PD1_SHIFT: u32 = 56;
14100    /// Offset of the `TCMA0` field.
14101    pub const TCMA0_SHIFT: u32 = 57;
14102    /// Offset of the `TCMA1` field.
14103    pub const TCMA1_SHIFT: u32 = 58;
14104    /// Offset of the `DS` field.
14105    pub const DS_SHIFT: u32 = 59;
14106    /// Offset of the `MTX0` field.
14107    pub const MTX0_SHIFT: u32 = 60;
14108    /// Offset of the `MTX1` field.
14109    pub const MTX1_SHIFT: u32 = 61;
14110
14111    /// Returns the value of the `T0SZ` field.
14112    pub const fn t0sz(self) -> u8 {
14113        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
14114    }
14115
14116    /// Returns the value of the `IRGN0` field.
14117    pub const fn irgn0(self) -> u8 {
14118        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
14119    }
14120
14121    /// Returns the value of the `ORGN0` field.
14122    pub const fn orgn0(self) -> u8 {
14123        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
14124    }
14125
14126    /// Returns the value of the `SH0` field.
14127    pub const fn sh0(self) -> u8 {
14128        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
14129    }
14130
14131    /// Returns the value of the `TG0` field.
14132    pub const fn tg0(self) -> u8 {
14133        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
14134    }
14135
14136    /// Returns the value of the `T1SZ` field.
14137    pub const fn t1sz(self) -> u8 {
14138        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
14139    }
14140
14141    /// Returns the value of the `IRGN1` field.
14142    pub const fn irgn1(self) -> u8 {
14143        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
14144    }
14145
14146    /// Returns the value of the `ORGN1` field.
14147    pub const fn orgn1(self) -> u8 {
14148        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
14149    }
14150
14151    /// Returns the value of the `SH1` field.
14152    pub const fn sh1(self) -> u8 {
14153        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
14154    }
14155
14156    /// Returns the value of the `TG1` field.
14157    pub const fn tg1(self) -> u8 {
14158        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
14159    }
14160
14161    /// Returns the value of the `IPS` field.
14162    pub const fn ips(self) -> u8 {
14163        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
14164    }
14165}
14166
14167#[cfg(feature = "el2")]
14168bitflags! {
14169    /// `TCR_EL2` system register value.
14170    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14171    #[repr(transparent)]
14172    pub struct TcrEl2: u64 {
14173        /// RES1 bits in the `TCR_EL2` register.
14174        const RES1 = 0b10000000100000000000000000000000;
14175        /// `EPD0` bit.
14176        const EPD0 = 1 << 7;
14177        /// `TBI` bit.
14178        const TBI = 1 << 20;
14179        /// `A1` bit.
14180        const A1 = 1 << 22;
14181        /// `EPD1` bit.
14182        const EPD1 = 1 << 23;
14183        /// `HPD` bit.
14184        const HPD = 1 << 24;
14185        /// `HWU59` bit.
14186        const HWU59 = 1 << 25;
14187        /// `HWU60` bit.
14188        const HWU60 = 1 << 26;
14189        /// `HWU61` bit.
14190        const HWU61 = 1 << 27;
14191        /// `HWU62` bit.
14192        const HWU62 = 1 << 28;
14193        /// `TBID` bit.
14194        const TBID = 1 << 29;
14195        /// `TCMA` bit.
14196        const TCMA = 1 << 30;
14197        /// `MTX` bit.
14198        const MTX = 1 << 33;
14199        /// `AS` bit.
14200        const AS = 1 << 36;
14201        /// `TBI0` bit.
14202        const TBI0 = 1 << 37;
14203        /// `TBI1` bit.
14204        const TBI1 = 1 << 38;
14205        /// `HPD0` bit.
14206        const HPD0 = 1 << 41;
14207        /// `HPD1` bit.
14208        const HPD1 = 1 << 42;
14209        /// `HWU059` bit.
14210        const HWU059 = 1 << 43;
14211        /// `HWU060` bit.
14212        const HWU060 = 1 << 44;
14213        /// `HWU061` bit.
14214        const HWU061 = 1 << 45;
14215        /// `HWU062` bit.
14216        const HWU062 = 1 << 46;
14217        /// `HWU159` bit.
14218        const HWU159 = 1 << 47;
14219        /// `HWU160` bit.
14220        const HWU160 = 1 << 48;
14221        /// `HWU161` bit.
14222        const HWU161 = 1 << 49;
14223        /// `HWU162` bit.
14224        const HWU162 = 1 << 50;
14225        /// `TBID0` bit.
14226        const TBID0 = 1 << 51;
14227        /// `TBID1` bit.
14228        const TBID1 = 1 << 52;
14229        /// `NFD0` bit.
14230        const NFD0 = 1 << 53;
14231        /// `TVAD` bit.
14232        const TVAD = 1 << 53;
14233        /// `NFD1` bit.
14234        const NFD1 = 1 << 54;
14235        /// `E0PD0` bit.
14236        const E0PD0 = 1 << 55;
14237        /// `E0PD1` bit.
14238        const E0PD1 = 1 << 56;
14239        /// `TCMA0` bit.
14240        const TCMA0 = 1 << 57;
14241        /// `TCMA1` bit.
14242        const TCMA1 = 1 << 58;
14243        /// `MTX0` bit.
14244        const MTX0 = 1 << 60;
14245        /// `MTX1` bit.
14246        const MTX1 = 1 << 61;
14247    }
14248}
14249
14250#[cfg(feature = "el2")]
14251impl TcrEl2 {
14252    /// Offset of the `T0SZ` field.
14253    pub const T0SZ_SHIFT: u32 = 0;
14254    /// Mask for the `T0SZ` field.
14255    pub const T0SZ_MASK: u64 = 0b111111;
14256    /// Offset of the `EPD0` field.
14257    pub const EPD0_SHIFT: u32 = 7;
14258    /// Offset of the `IRGN0` field.
14259    pub const IRGN0_SHIFT: u32 = 8;
14260    /// Mask for the `IRGN0` field.
14261    pub const IRGN0_MASK: u64 = 0b11;
14262    /// Offset of the `ORGN0` field.
14263    pub const ORGN0_SHIFT: u32 = 10;
14264    /// Mask for the `ORGN0` field.
14265    pub const ORGN0_MASK: u64 = 0b11;
14266    /// Offset of the `SH0` field.
14267    pub const SH0_SHIFT: u32 = 12;
14268    /// Mask for the `SH0` field.
14269    pub const SH0_MASK: u64 = 0b11;
14270    /// Offset of the `TG0` field.
14271    pub const TG0_SHIFT: u32 = 14;
14272    /// Mask for the `TG0` field.
14273    pub const TG0_MASK: u64 = 0b11;
14274    /// Offset of the `PS` field.
14275    pub const PS_SHIFT: u32 = 16;
14276    /// Mask for the `PS` field.
14277    pub const PS_MASK: u64 = 0b111;
14278    /// Offset of the `T1SZ` field.
14279    pub const T1SZ_SHIFT: u32 = 16;
14280    /// Mask for the `T1SZ` field.
14281    pub const T1SZ_MASK: u64 = 0b111111;
14282    /// Offset of the `TBI` field.
14283    pub const TBI_SHIFT: u32 = 20;
14284    /// Offset of the `A1` field.
14285    pub const A1_SHIFT: u32 = 22;
14286    /// Offset of the `EPD1` field.
14287    pub const EPD1_SHIFT: u32 = 23;
14288    /// Offset of the `HPD` field.
14289    pub const HPD_SHIFT: u32 = 24;
14290    /// Offset of the `IRGN1` field.
14291    pub const IRGN1_SHIFT: u32 = 24;
14292    /// Mask for the `IRGN1` field.
14293    pub const IRGN1_MASK: u64 = 0b11;
14294    /// Offset of the `HWU59` field.
14295    pub const HWU59_SHIFT: u32 = 25;
14296    /// Offset of the `HWU60` field.
14297    pub const HWU60_SHIFT: u32 = 26;
14298    /// Offset of the `ORGN1` field.
14299    pub const ORGN1_SHIFT: u32 = 26;
14300    /// Mask for the `ORGN1` field.
14301    pub const ORGN1_MASK: u64 = 0b11;
14302    /// Offset of the `HWU61` field.
14303    pub const HWU61_SHIFT: u32 = 27;
14304    /// Offset of the `HWU62` field.
14305    pub const HWU62_SHIFT: u32 = 28;
14306    /// Offset of the `SH1` field.
14307    pub const SH1_SHIFT: u32 = 28;
14308    /// Mask for the `SH1` field.
14309    pub const SH1_MASK: u64 = 0b11;
14310    /// Offset of the `TBID` field.
14311    pub const TBID_SHIFT: u32 = 29;
14312    /// Offset of the `TCMA` field.
14313    pub const TCMA_SHIFT: u32 = 30;
14314    /// Offset of the `TG1` field.
14315    pub const TG1_SHIFT: u32 = 30;
14316    /// Mask for the `TG1` field.
14317    pub const TG1_MASK: u64 = 0b11;
14318    /// Offset of the `IPS` field.
14319    pub const IPS_SHIFT: u32 = 32;
14320    /// Mask for the `IPS` field.
14321    pub const IPS_MASK: u64 = 0b111;
14322    /// Offset of the `MTX` field.
14323    pub const MTX_SHIFT: u32 = 33;
14324    /// Offset of the `AS` field.
14325    pub const AS_SHIFT: u32 = 36;
14326    /// Offset of the `TBI0` field.
14327    pub const TBI0_SHIFT: u32 = 37;
14328    /// Offset of the `TBI1` field.
14329    pub const TBI1_SHIFT: u32 = 38;
14330    /// Offset of the `HPD0` field.
14331    pub const HPD0_SHIFT: u32 = 41;
14332    /// Offset of the `HPD1` field.
14333    pub const HPD1_SHIFT: u32 = 42;
14334    /// Offset of the `HWU059` field.
14335    pub const HWU059_SHIFT: u32 = 43;
14336    /// Offset of the `HWU060` field.
14337    pub const HWU060_SHIFT: u32 = 44;
14338    /// Offset of the `HWU061` field.
14339    pub const HWU061_SHIFT: u32 = 45;
14340    /// Offset of the `HWU062` field.
14341    pub const HWU062_SHIFT: u32 = 46;
14342    /// Offset of the `HWU159` field.
14343    pub const HWU159_SHIFT: u32 = 47;
14344    /// Offset of the `HWU160` field.
14345    pub const HWU160_SHIFT: u32 = 48;
14346    /// Offset of the `VTB` field.
14347    pub const VTB_SHIFT: u32 = 48;
14348    /// Mask for the `VTB` field.
14349    pub const VTB_MASK: u64 = 0b11111;
14350    /// Offset of the `HWU161` field.
14351    pub const HWU161_SHIFT: u32 = 49;
14352    /// Offset of the `HWU162` field.
14353    pub const HWU162_SHIFT: u32 = 50;
14354    /// Offset of the `TBID0` field.
14355    pub const TBID0_SHIFT: u32 = 51;
14356    /// Offset of the `TBID1` field.
14357    pub const TBID1_SHIFT: u32 = 52;
14358    /// Offset of the `NFD0` field.
14359    pub const NFD0_SHIFT: u32 = 53;
14360    /// Offset of the `TVAD` field.
14361    pub const TVAD_SHIFT: u32 = 53;
14362    /// Offset of the `NFD1` field.
14363    pub const NFD1_SHIFT: u32 = 54;
14364    /// Offset of the `E0PD0` field.
14365    pub const E0PD0_SHIFT: u32 = 55;
14366    /// Offset of the `E0PD1` field.
14367    pub const E0PD1_SHIFT: u32 = 56;
14368    /// Offset of the `TCMA0` field.
14369    pub const TCMA0_SHIFT: u32 = 57;
14370    /// Offset of the `TCMA1` field.
14371    pub const TCMA1_SHIFT: u32 = 58;
14372    /// Offset of the `MTX0` field.
14373    pub const MTX0_SHIFT: u32 = 60;
14374    /// Offset of the `MTX1` field.
14375    pub const MTX1_SHIFT: u32 = 61;
14376
14377    /// Returns the value of the `T0SZ` field.
14378    pub const fn t0sz(self) -> u8 {
14379        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
14380    }
14381
14382    /// Returns the value of the `IRGN0` field.
14383    pub const fn irgn0(self) -> u8 {
14384        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
14385    }
14386
14387    /// Returns the value of the `ORGN0` field.
14388    pub const fn orgn0(self) -> u8 {
14389        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
14390    }
14391
14392    /// Returns the value of the `SH0` field.
14393    pub const fn sh0(self) -> u8 {
14394        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
14395    }
14396
14397    /// Returns the value of the `TG0` field.
14398    pub const fn tg0(self) -> u8 {
14399        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
14400    }
14401
14402    /// Returns the value of the `PS` field.
14403    pub const fn ps(self) -> u8 {
14404        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
14405    }
14406
14407    /// Returns the value of the `T1SZ` field.
14408    pub const fn t1sz(self) -> u8 {
14409        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
14410    }
14411
14412    /// Returns the value of the `IRGN1` field.
14413    pub const fn irgn1(self) -> u8 {
14414        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
14415    }
14416
14417    /// Returns the value of the `ORGN1` field.
14418    pub const fn orgn1(self) -> u8 {
14419        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
14420    }
14421
14422    /// Returns the value of the `SH1` field.
14423    pub const fn sh1(self) -> u8 {
14424        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
14425    }
14426
14427    /// Returns the value of the `TG1` field.
14428    pub const fn tg1(self) -> u8 {
14429        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
14430    }
14431
14432    /// Returns the value of the `IPS` field.
14433    pub const fn ips(self) -> u8 {
14434        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
14435    }
14436
14437    /// Returns the value of the `VTB` field.
14438    pub const fn vtb(self) -> u8 {
14439        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
14440    }
14441}
14442
14443#[cfg(feature = "el3")]
14444bitflags! {
14445    /// `TCR_EL3` system register value.
14446    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14447    #[repr(transparent)]
14448    pub struct TcrEl3: u64 {
14449        /// RES1 bits in the `TCR_EL3` register.
14450        const RES1 = 0b10000000100000000000000000000000;
14451        /// `TBI` bit.
14452        const TBI = 1 << 20;
14453        /// `HA` bit.
14454        const HA = 1 << 21;
14455        /// `HD` bit.
14456        const HD = 1 << 22;
14457        /// `HPD` bit.
14458        const HPD = 1 << 24;
14459        /// `HWU59` bit.
14460        const HWU59 = 1 << 25;
14461        /// `HWU60` bit.
14462        const HWU60 = 1 << 26;
14463        /// `HWU61` bit.
14464        const HWU61 = 1 << 27;
14465        /// `HWU62` bit.
14466        const HWU62 = 1 << 28;
14467        /// `TBID` bit.
14468        const TBID = 1 << 29;
14469        /// `TCMA` bit.
14470        const TCMA = 1 << 30;
14471        /// `DS` bit.
14472        const DS = 1 << 32;
14473        /// `MTX` bit.
14474        const MTX = 1 << 33;
14475        /// `PnCH` bit.
14476        const PNCH = 1 << 34;
14477        /// `PIE` bit.
14478        const PIE = 1 << 35;
14479        /// `POE` bit.
14480        const POE = 1 << 36;
14481        /// `AIE` bit.
14482        const AIE = 1 << 37;
14483        /// `D128` bit.
14484        const D128 = 1 << 38;
14485        /// `PTTWI` bit.
14486        const PTTWI = 1 << 41;
14487        /// `HAFT` bit.
14488        const HAFT = 1 << 42;
14489        /// `DisCH0` bit.
14490        const DISCH0 = 1 << 43;
14491        /// `POE2F` bit.
14492        const POE2F = 1 << 44;
14493        /// `TVAD` bit.
14494        const TVAD = 1 << 53;
14495    }
14496}
14497
14498#[cfg(feature = "el3")]
14499impl TcrEl3 {
14500    /// Offset of the `T0SZ` field.
14501    pub const T0SZ_SHIFT: u32 = 0;
14502    /// Mask for the `T0SZ` field.
14503    pub const T0SZ_MASK: u64 = 0b111111;
14504    /// Offset of the `IRGN0` field.
14505    pub const IRGN0_SHIFT: u32 = 8;
14506    /// Mask for the `IRGN0` field.
14507    pub const IRGN0_MASK: u64 = 0b11;
14508    /// Offset of the `ORGN0` field.
14509    pub const ORGN0_SHIFT: u32 = 10;
14510    /// Mask for the `ORGN0` field.
14511    pub const ORGN0_MASK: u64 = 0b11;
14512    /// Offset of the `SH0` field.
14513    pub const SH0_SHIFT: u32 = 12;
14514    /// Mask for the `SH0` field.
14515    pub const SH0_MASK: u64 = 0b11;
14516    /// Offset of the `TG0` field.
14517    pub const TG0_SHIFT: u32 = 14;
14518    /// Mask for the `TG0` field.
14519    pub const TG0_MASK: u64 = 0b11;
14520    /// Offset of the `PS` field.
14521    pub const PS_SHIFT: u32 = 16;
14522    /// Mask for the `PS` field.
14523    pub const PS_MASK: u64 = 0b111;
14524    /// Offset of the `TBI` field.
14525    pub const TBI_SHIFT: u32 = 20;
14526    /// Offset of the `HA` field.
14527    pub const HA_SHIFT: u32 = 21;
14528    /// Offset of the `HD` field.
14529    pub const HD_SHIFT: u32 = 22;
14530    /// Offset of the `HPD` field.
14531    pub const HPD_SHIFT: u32 = 24;
14532    /// Offset of the `HWU59` field.
14533    pub const HWU59_SHIFT: u32 = 25;
14534    /// Offset of the `HWU60` field.
14535    pub const HWU60_SHIFT: u32 = 26;
14536    /// Offset of the `HWU61` field.
14537    pub const HWU61_SHIFT: u32 = 27;
14538    /// Offset of the `HWU62` field.
14539    pub const HWU62_SHIFT: u32 = 28;
14540    /// Offset of the `TBID` field.
14541    pub const TBID_SHIFT: u32 = 29;
14542    /// Offset of the `TCMA` field.
14543    pub const TCMA_SHIFT: u32 = 30;
14544    /// Offset of the `DS` field.
14545    pub const DS_SHIFT: u32 = 32;
14546    /// Offset of the `MTX` field.
14547    pub const MTX_SHIFT: u32 = 33;
14548    /// Offset of the `PnCH` field.
14549    pub const PNCH_SHIFT: u32 = 34;
14550    /// Offset of the `PIE` field.
14551    pub const PIE_SHIFT: u32 = 35;
14552    /// Offset of the `POE` field.
14553    pub const POE_SHIFT: u32 = 36;
14554    /// Offset of the `AIE` field.
14555    pub const AIE_SHIFT: u32 = 37;
14556    /// Offset of the `D128` field.
14557    pub const D128_SHIFT: u32 = 38;
14558    /// Offset of the `PTTWI` field.
14559    pub const PTTWI_SHIFT: u32 = 41;
14560    /// Offset of the `HAFT` field.
14561    pub const HAFT_SHIFT: u32 = 42;
14562    /// Offset of the `DisCH0` field.
14563    pub const DISCH0_SHIFT: u32 = 43;
14564    /// Offset of the `POE2F` field.
14565    pub const POE2F_SHIFT: u32 = 44;
14566    /// Offset of the `POIW` field.
14567    pub const POIW_SHIFT: u32 = 45;
14568    /// Mask for the `POIW` field.
14569    pub const POIW_MASK: u64 = 0b111;
14570    /// Offset of the `VTB` field.
14571    pub const VTB_SHIFT: u32 = 48;
14572    /// Mask for the `VTB` field.
14573    pub const VTB_MASK: u64 = 0b11111;
14574    /// Offset of the `TVAD` field.
14575    pub const TVAD_SHIFT: u32 = 53;
14576
14577    /// Returns the value of the `T0SZ` field.
14578    pub const fn t0sz(self) -> u8 {
14579        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
14580    }
14581
14582    /// Returns the value of the `IRGN0` field.
14583    pub const fn irgn0(self) -> u8 {
14584        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
14585    }
14586
14587    /// Returns the value of the `ORGN0` field.
14588    pub const fn orgn0(self) -> u8 {
14589        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
14590    }
14591
14592    /// Returns the value of the `SH0` field.
14593    pub const fn sh0(self) -> u8 {
14594        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
14595    }
14596
14597    /// Returns the value of the `TG0` field.
14598    pub const fn tg0(self) -> u8 {
14599        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
14600    }
14601
14602    /// Returns the value of the `PS` field.
14603    pub const fn ps(self) -> u8 {
14604        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
14605    }
14606
14607    /// Returns the value of the `POIW` field.
14608    pub const fn poiw(self) -> u8 {
14609        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
14610    }
14611
14612    /// Returns the value of the `VTB` field.
14613    pub const fn vtb(self) -> u8 {
14614        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
14615    }
14616}
14617
14618#[cfg(feature = "el1")]
14619bitflags! {
14620    /// `TFSRE0_EL1` system register value.
14621    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14622    #[repr(transparent)]
14623    pub struct Tfsre0El1: u64 {
14624        /// `TF0` bit.
14625        const TF0 = 1 << 0;
14626        /// `TF1` bit.
14627        const TF1 = 1 << 1;
14628    }
14629}
14630
14631#[cfg(feature = "el1")]
14632impl Tfsre0El1 {
14633    /// Offset of the `TF0` field.
14634    pub const TF0_SHIFT: u32 = 0;
14635    /// Offset of the `TF1` field.
14636    pub const TF1_SHIFT: u32 = 1;
14637}
14638
14639#[cfg(feature = "el1")]
14640bitflags! {
14641    /// `TFSR_EL1` system register value.
14642    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14643    #[repr(transparent)]
14644    pub struct TfsrEl1: u64 {
14645        /// `TF0` bit.
14646        const TF0 = 1 << 0;
14647        /// `TF1` bit.
14648        const TF1 = 1 << 1;
14649    }
14650}
14651
14652#[cfg(feature = "el1")]
14653impl TfsrEl1 {
14654    /// Offset of the `TF0` field.
14655    pub const TF0_SHIFT: u32 = 0;
14656    /// Offset of the `TF1` field.
14657    pub const TF1_SHIFT: u32 = 1;
14658}
14659
14660#[cfg(feature = "el2")]
14661bitflags! {
14662    /// `TFSR_EL2` system register value.
14663    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14664    #[repr(transparent)]
14665    pub struct TfsrEl2: u64 {
14666        /// `TF0` bit.
14667        const TF0 = 1 << 0;
14668        /// `TF1` bit.
14669        const TF1 = 1 << 1;
14670    }
14671}
14672
14673#[cfg(feature = "el2")]
14674impl TfsrEl2 {
14675    /// Offset of the `TF0` field.
14676    pub const TF0_SHIFT: u32 = 0;
14677    /// Offset of the `TF1` field.
14678    pub const TF1_SHIFT: u32 = 1;
14679}
14680
14681bitflags! {
14682    /// `TLBTR` system register value.
14683    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14684    #[repr(transparent)]
14685    pub struct Tlbtr: u32 {
14686        /// `nU` bit.
14687        const NU = 1 << 0;
14688    }
14689}
14690
14691impl Tlbtr {
14692    /// Offset of the `nU` field.
14693    pub const NU_SHIFT: u32 = 0;
14694}
14695
14696bitflags! {
14697    /// `TPIDRPRW` system register value.
14698    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14699    #[repr(transparent)]
14700    pub struct Tpidrprw: u32 {
14701    }
14702}
14703
14704impl Tpidrprw {
14705    /// Offset of the `TID` field.
14706    pub const TID_SHIFT: u32 = 0;
14707    /// Mask for the `TID` field.
14708    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
14709
14710    /// Returns the value of the `TID` field.
14711    pub const fn tid(self) -> u32 {
14712        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
14713    }
14714}
14715
14716bitflags! {
14717    /// `TPIDRRO_EL0` system register value.
14718    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14719    #[repr(transparent)]
14720    pub struct TpidrroEl0: u64 {
14721    }
14722}
14723
14724impl TpidrroEl0 {
14725    /// Offset of the `ThreadID` field.
14726    pub const THREADID_SHIFT: u32 = 0;
14727    /// Mask for the `ThreadID` field.
14728    pub const THREADID_MASK: u64 =
14729        0b1111111111111111111111111111111111111111111111111111111111111111;
14730
14731    /// Returns the value of the `ThreadID` field.
14732    pub const fn threadid(self) -> u64 {
14733        ((self.bits() >> Self::THREADID_SHIFT)
14734            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
14735    }
14736}
14737
14738bitflags! {
14739    /// `TPIDRURO` system register value.
14740    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14741    #[repr(transparent)]
14742    pub struct Tpidruro: u32 {
14743    }
14744}
14745
14746impl Tpidruro {
14747    /// Offset of the `TID` field.
14748    pub const TID_SHIFT: u32 = 0;
14749    /// Mask for the `TID` field.
14750    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
14751
14752    /// Returns the value of the `TID` field.
14753    pub const fn tid(self) -> u32 {
14754        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
14755    }
14756}
14757
14758bitflags! {
14759    /// `TPIDRURW` system register value.
14760    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14761    #[repr(transparent)]
14762    pub struct Tpidrurw: u32 {
14763    }
14764}
14765
14766impl Tpidrurw {
14767    /// Offset of the `TID` field.
14768    pub const TID_SHIFT: u32 = 0;
14769    /// Mask for the `TID` field.
14770    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
14771
14772    /// Returns the value of the `TID` field.
14773    pub const fn tid(self) -> u32 {
14774        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
14775    }
14776}
14777
14778bitflags! {
14779    /// `TPIDR_EL0` system register value.
14780    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14781    #[repr(transparent)]
14782    pub struct TpidrEl0: u64 {
14783    }
14784}
14785
14786impl TpidrEl0 {
14787    /// Offset of the `ThreadID` field.
14788    pub const THREADID_SHIFT: u32 = 0;
14789    /// Mask for the `ThreadID` field.
14790    pub const THREADID_MASK: u64 =
14791        0b1111111111111111111111111111111111111111111111111111111111111111;
14792
14793    /// Returns the value of the `ThreadID` field.
14794    pub const fn threadid(self) -> u64 {
14795        ((self.bits() >> Self::THREADID_SHIFT)
14796            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
14797    }
14798}
14799
14800#[cfg(feature = "el1")]
14801bitflags! {
14802    /// `TPIDR_EL1` system register value.
14803    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14804    #[repr(transparent)]
14805    pub struct TpidrEl1: u64 {
14806    }
14807}
14808
14809#[cfg(feature = "el1")]
14810impl TpidrEl1 {
14811    /// Offset of the `ThreadID` field.
14812    pub const THREADID_SHIFT: u32 = 0;
14813    /// Mask for the `ThreadID` field.
14814    pub const THREADID_MASK: u64 =
14815        0b1111111111111111111111111111111111111111111111111111111111111111;
14816
14817    /// Returns the value of the `ThreadID` field.
14818    pub const fn threadid(self) -> u64 {
14819        ((self.bits() >> Self::THREADID_SHIFT)
14820            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
14821    }
14822}
14823
14824#[cfg(feature = "el2")]
14825bitflags! {
14826    /// `TPIDR_EL2` system register value.
14827    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14828    #[repr(transparent)]
14829    pub struct TpidrEl2: u64 {
14830    }
14831}
14832
14833#[cfg(feature = "el2")]
14834impl TpidrEl2 {
14835    /// Offset of the `ThreadID` field.
14836    pub const THREADID_SHIFT: u32 = 0;
14837    /// Mask for the `ThreadID` field.
14838    pub const THREADID_MASK: u64 =
14839        0b1111111111111111111111111111111111111111111111111111111111111111;
14840
14841    /// Returns the value of the `ThreadID` field.
14842    pub const fn threadid(self) -> u64 {
14843        ((self.bits() >> Self::THREADID_SHIFT)
14844            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
14845    }
14846}
14847
14848bitflags! {
14849    /// `TRFCR` system register value.
14850    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14851    #[repr(transparent)]
14852    pub struct Trfcr: u32 {
14853        /// `E0TRE` bit.
14854        const E0TRE = 1 << 0;
14855        /// `E1TRE` bit.
14856        const E1TRE = 1 << 1;
14857    }
14858}
14859
14860impl Trfcr {
14861    /// Offset of the `E0TRE` field.
14862    pub const E0TRE_SHIFT: u32 = 0;
14863    /// Offset of the `E1TRE` field.
14864    pub const E1TRE_SHIFT: u32 = 1;
14865    /// Offset of the `TS` field.
14866    pub const TS_SHIFT: u32 = 5;
14867    /// Mask for the `TS` field.
14868    pub const TS_MASK: u32 = 0b11;
14869
14870    /// Returns the value of the `TS` field.
14871    pub const fn ts(self) -> u8 {
14872        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
14873    }
14874}
14875
14876bitflags! {
14877    /// `TTBCR` system register value.
14878    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14879    #[repr(transparent)]
14880    pub struct Ttbcr: u32 {
14881        /// `PD0` bit.
14882        const PD0 = 1 << 4;
14883        /// `PD1` bit.
14884        const PD1 = 1 << 5;
14885        /// `T2E` bit.
14886        const T2E = 1 << 6;
14887        /// `EPD0` bit.
14888        const EPD0 = 1 << 7;
14889        /// `A1` bit.
14890        const A1 = 1 << 22;
14891        /// `EPD1` bit.
14892        const EPD1 = 1 << 23;
14893        /// `EAE` bit.
14894        const EAE = 1 << 31;
14895    }
14896}
14897
14898impl Ttbcr {
14899    /// Offset of the `N` field.
14900    pub const N_SHIFT: u32 = 0;
14901    /// Mask for the `N` field.
14902    pub const N_MASK: u32 = 0b111;
14903    /// Offset of the `T0SZ` field.
14904    pub const T0SZ_SHIFT: u32 = 0;
14905    /// Mask for the `T0SZ` field.
14906    pub const T0SZ_MASK: u32 = 0b111;
14907    /// Offset of the `PD0` field.
14908    pub const PD0_SHIFT: u32 = 4;
14909    /// Offset of the `PD1` field.
14910    pub const PD1_SHIFT: u32 = 5;
14911    /// Offset of the `T2E` field.
14912    pub const T2E_SHIFT: u32 = 6;
14913    /// Offset of the `EPD0` field.
14914    pub const EPD0_SHIFT: u32 = 7;
14915    /// Offset of the `IRGN0` field.
14916    pub const IRGN0_SHIFT: u32 = 8;
14917    /// Mask for the `IRGN0` field.
14918    pub const IRGN0_MASK: u32 = 0b11;
14919    /// Offset of the `ORGN0` field.
14920    pub const ORGN0_SHIFT: u32 = 10;
14921    /// Mask for the `ORGN0` field.
14922    pub const ORGN0_MASK: u32 = 0b11;
14923    /// Offset of the `SH0` field.
14924    pub const SH0_SHIFT: u32 = 12;
14925    /// Mask for the `SH0` field.
14926    pub const SH0_MASK: u32 = 0b11;
14927    /// Offset of the `T1SZ` field.
14928    pub const T1SZ_SHIFT: u32 = 16;
14929    /// Mask for the `T1SZ` field.
14930    pub const T1SZ_MASK: u32 = 0b111;
14931    /// Offset of the `A1` field.
14932    pub const A1_SHIFT: u32 = 22;
14933    /// Offset of the `EPD1` field.
14934    pub const EPD1_SHIFT: u32 = 23;
14935    /// Offset of the `IRGN1` field.
14936    pub const IRGN1_SHIFT: u32 = 24;
14937    /// Mask for the `IRGN1` field.
14938    pub const IRGN1_MASK: u32 = 0b11;
14939    /// Offset of the `ORGN1` field.
14940    pub const ORGN1_SHIFT: u32 = 26;
14941    /// Mask for the `ORGN1` field.
14942    pub const ORGN1_MASK: u32 = 0b11;
14943    /// Offset of the `SH1` field.
14944    pub const SH1_SHIFT: u32 = 28;
14945    /// Mask for the `SH1` field.
14946    pub const SH1_MASK: u32 = 0b11;
14947    /// Offset of the `EAE` field.
14948    pub const EAE_SHIFT: u32 = 31;
14949
14950    /// Returns the value of the `N` field.
14951    pub const fn n(self) -> u8 {
14952        ((self.bits() >> Self::N_SHIFT) & 0b111) as u8
14953    }
14954
14955    /// Returns the value of the `T0SZ` field.
14956    pub const fn t0sz(self) -> u8 {
14957        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
14958    }
14959
14960    /// Returns the value of the `IRGN0` field.
14961    pub const fn irgn0(self) -> u8 {
14962        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
14963    }
14964
14965    /// Returns the value of the `ORGN0` field.
14966    pub const fn orgn0(self) -> u8 {
14967        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
14968    }
14969
14970    /// Returns the value of the `SH0` field.
14971    pub const fn sh0(self) -> u8 {
14972        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
14973    }
14974
14975    /// Returns the value of the `T1SZ` field.
14976    pub const fn t1sz(self) -> u8 {
14977        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111) as u8
14978    }
14979
14980    /// Returns the value of the `IRGN1` field.
14981    pub const fn irgn1(self) -> u8 {
14982        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
14983    }
14984
14985    /// Returns the value of the `ORGN1` field.
14986    pub const fn orgn1(self) -> u8 {
14987        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
14988    }
14989
14990    /// Returns the value of the `SH1` field.
14991    pub const fn sh1(self) -> u8 {
14992        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
14993    }
14994}
14995
14996bitflags! {
14997    /// `TTBCR2` system register value.
14998    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
14999    #[repr(transparent)]
15000    pub struct Ttbcr2: u32 {
15001        /// `HPD0` bit.
15002        const HPD0 = 1 << 9;
15003        /// `HPD1` bit.
15004        const HPD1 = 1 << 10;
15005        /// `HWU059` bit.
15006        const HWU059 = 1 << 11;
15007        /// `HWU060` bit.
15008        const HWU060 = 1 << 12;
15009        /// `HWU061` bit.
15010        const HWU061 = 1 << 13;
15011        /// `HWU062` bit.
15012        const HWU062 = 1 << 14;
15013        /// `HWU159` bit.
15014        const HWU159 = 1 << 15;
15015        /// `HWU160` bit.
15016        const HWU160 = 1 << 16;
15017        /// `HWU161` bit.
15018        const HWU161 = 1 << 17;
15019        /// `HWU162` bit.
15020        const HWU162 = 1 << 18;
15021    }
15022}
15023
15024impl Ttbcr2 {
15025    /// Offset of the `HPD0` field.
15026    pub const HPD0_SHIFT: u32 = 9;
15027    /// Offset of the `HPD1` field.
15028    pub const HPD1_SHIFT: u32 = 10;
15029    /// Offset of the `HWU059` field.
15030    pub const HWU059_SHIFT: u32 = 11;
15031    /// Offset of the `HWU060` field.
15032    pub const HWU060_SHIFT: u32 = 12;
15033    /// Offset of the `HWU061` field.
15034    pub const HWU061_SHIFT: u32 = 13;
15035    /// Offset of the `HWU062` field.
15036    pub const HWU062_SHIFT: u32 = 14;
15037    /// Offset of the `HWU159` field.
15038    pub const HWU159_SHIFT: u32 = 15;
15039    /// Offset of the `HWU160` field.
15040    pub const HWU160_SHIFT: u32 = 16;
15041    /// Offset of the `HWU161` field.
15042    pub const HWU161_SHIFT: u32 = 17;
15043    /// Offset of the `HWU162` field.
15044    pub const HWU162_SHIFT: u32 = 18;
15045}
15046
15047bitflags! {
15048    /// `TTBR0` system register value.
15049    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15050    #[repr(transparent)]
15051    pub struct Ttbr0: u64 {
15052        /// `CnP` bit.
15053        const CNP = 1 << 0;
15054        /// `S` bit.
15055        const S = 1 << 1;
15056        /// `IMP` bit.
15057        const IMP = 1 << 2;
15058        /// `NOS` bit.
15059        const NOS = 1 << 5;
15060    }
15061}
15062
15063impl Ttbr0 {
15064    /// Offset of the `CnP` field.
15065    pub const CNP_SHIFT: u32 = 0;
15066    /// Offset of the `BADDR` field.
15067    pub const BADDR_SHIFT: u32 = 1;
15068    /// Mask for the `BADDR` field.
15069    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
15070    /// Offset of the `S` field.
15071    pub const S_SHIFT: u32 = 1;
15072    /// Offset of the `IMP` field.
15073    pub const IMP_SHIFT: u32 = 2;
15074    /// Offset of the `RGN` field.
15075    pub const RGN_SHIFT: u32 = 3;
15076    /// Mask for the `RGN` field.
15077    pub const RGN_MASK: u64 = 0b11;
15078    /// Offset of the `NOS` field.
15079    pub const NOS_SHIFT: u32 = 5;
15080    /// Offset of the `TTB0` field.
15081    pub const TTB0_SHIFT: u32 = 7;
15082    /// Mask for the `TTB0` field.
15083    pub const TTB0_MASK: u64 = 0b1111111111111111111111111;
15084    /// Offset of the `ASID` field.
15085    pub const ASID_SHIFT: u32 = 48;
15086    /// Mask for the `ASID` field.
15087    pub const ASID_MASK: u64 = 0b11111111;
15088
15089    /// Returns the value of the `BADDR` field.
15090    pub const fn baddr(self) -> u64 {
15091        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
15092            as u64
15093    }
15094
15095    /// Returns the value of the `RGN` field.
15096    pub const fn rgn(self) -> u8 {
15097        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
15098    }
15099
15100    /// Returns the value of the `TTB0` field.
15101    pub const fn ttb0(self) -> u32 {
15102        ((self.bits() >> Self::TTB0_SHIFT) & 0b1111111111111111111111111) as u32
15103    }
15104
15105    /// Returns the value of the `ASID` field.
15106    pub const fn asid(self) -> u8 {
15107        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
15108    }
15109}
15110
15111#[cfg(feature = "el1")]
15112bitflags! {
15113    /// `TTBR0_EL1` system register value.
15114    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15115    #[repr(transparent)]
15116    pub struct Ttbr0El1: u64 {
15117        /// `CnP` bit.
15118        const CNP = 1 << 0;
15119    }
15120}
15121
15122#[cfg(feature = "el1")]
15123impl Ttbr0El1 {
15124    /// Offset of the `CnP` field.
15125    pub const CNP_SHIFT: u32 = 0;
15126    /// Offset of the `BADDR[47:1]` field.
15127    pub const BADDR_47_1_SHIFT: u32 = 1;
15128    /// Mask for the `BADDR[47:1]` field.
15129    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
15130    /// Offset of the `SKL` field.
15131    pub const SKL_SHIFT: u32 = 1;
15132    /// Mask for the `SKL` field.
15133    pub const SKL_MASK: u64 = 0b11;
15134    /// Offset of the `ASID` field.
15135    pub const ASID_SHIFT: u32 = 48;
15136    /// Mask for the `ASID` field.
15137    pub const ASID_MASK: u64 = 0b1111111111111111;
15138
15139    /// Returns the value of the `BADDR[47:1]` field.
15140    pub const fn baddr_47_1(self) -> u64 {
15141        ((self.bits() >> Self::BADDR_47_1_SHIFT)
15142            & 0b11111111111111111111111111111111111111111111111) as u64
15143    }
15144
15145    /// Returns the value of the `SKL` field.
15146    pub const fn skl(self) -> u8 {
15147        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
15148    }
15149
15150    /// Returns the value of the `ASID` field.
15151    pub const fn asid(self) -> u16 {
15152        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
15153    }
15154}
15155
15156#[cfg(feature = "el2")]
15157bitflags! {
15158    /// `TTBR0_EL2` system register value.
15159    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15160    #[repr(transparent)]
15161    pub struct Ttbr0El2: u64 {
15162        /// `CnP` bit.
15163        const CNP = 1 << 0;
15164    }
15165}
15166
15167#[cfg(feature = "el2")]
15168impl Ttbr0El2 {
15169    /// Offset of the `CnP` field.
15170    pub const CNP_SHIFT: u32 = 0;
15171    /// Offset of the `BADDR[47:1]` field.
15172    pub const BADDR_47_1_SHIFT: u32 = 1;
15173    /// Mask for the `BADDR[47:1]` field.
15174    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
15175    /// Offset of the `SKL` field.
15176    pub const SKL_SHIFT: u32 = 1;
15177    /// Mask for the `SKL` field.
15178    pub const SKL_MASK: u64 = 0b11;
15179    /// Offset of the `ASID` field.
15180    pub const ASID_SHIFT: u32 = 48;
15181    /// Mask for the `ASID` field.
15182    pub const ASID_MASK: u64 = 0b1111111111111111;
15183
15184    /// Returns the value of the `BADDR[47:1]` field.
15185    pub const fn baddr_47_1(self) -> u64 {
15186        ((self.bits() >> Self::BADDR_47_1_SHIFT)
15187            & 0b11111111111111111111111111111111111111111111111) as u64
15188    }
15189
15190    /// Returns the value of the `SKL` field.
15191    pub const fn skl(self) -> u8 {
15192        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
15193    }
15194
15195    /// Returns the value of the `ASID` field.
15196    pub const fn asid(self) -> u16 {
15197        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
15198    }
15199}
15200
15201#[cfg(feature = "el3")]
15202bitflags! {
15203    /// `TTBR0_EL3` system register value.
15204    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15205    #[repr(transparent)]
15206    pub struct Ttbr0El3: u64 {
15207        /// `CnP` bit.
15208        const CNP = 1 << 0;
15209    }
15210}
15211
15212#[cfg(feature = "el3")]
15213impl Ttbr0El3 {
15214    /// Offset of the `CnP` field.
15215    pub const CNP_SHIFT: u32 = 0;
15216    /// Offset of the `SKL` field.
15217    pub const SKL_SHIFT: u32 = 1;
15218    /// Mask for the `SKL` field.
15219    pub const SKL_MASK: u64 = 0b11;
15220
15221    /// Returns the value of the `SKL` field.
15222    pub const fn skl(self) -> u8 {
15223        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
15224    }
15225}
15226
15227bitflags! {
15228    /// `TTBR1` system register value.
15229    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15230    #[repr(transparent)]
15231    pub struct Ttbr1: u64 {
15232        /// `CnP` bit.
15233        const CNP = 1 << 0;
15234        /// `S` bit.
15235        const S = 1 << 1;
15236        /// `IMP` bit.
15237        const IMP = 1 << 2;
15238        /// `NOS` bit.
15239        const NOS = 1 << 5;
15240    }
15241}
15242
15243impl Ttbr1 {
15244    /// Offset of the `CnP` field.
15245    pub const CNP_SHIFT: u32 = 0;
15246    /// Offset of the `BADDR` field.
15247    pub const BADDR_SHIFT: u32 = 1;
15248    /// Mask for the `BADDR` field.
15249    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
15250    /// Offset of the `S` field.
15251    pub const S_SHIFT: u32 = 1;
15252    /// Offset of the `IMP` field.
15253    pub const IMP_SHIFT: u32 = 2;
15254    /// Offset of the `RGN` field.
15255    pub const RGN_SHIFT: u32 = 3;
15256    /// Mask for the `RGN` field.
15257    pub const RGN_MASK: u64 = 0b11;
15258    /// Offset of the `NOS` field.
15259    pub const NOS_SHIFT: u32 = 5;
15260    /// Offset of the `TTB1` field.
15261    pub const TTB1_SHIFT: u32 = 7;
15262    /// Mask for the `TTB1` field.
15263    pub const TTB1_MASK: u64 = 0b1111111111111111111111111;
15264    /// Offset of the `ASID` field.
15265    pub const ASID_SHIFT: u32 = 48;
15266    /// Mask for the `ASID` field.
15267    pub const ASID_MASK: u64 = 0b11111111;
15268
15269    /// Returns the value of the `BADDR` field.
15270    pub const fn baddr(self) -> u64 {
15271        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
15272            as u64
15273    }
15274
15275    /// Returns the value of the `RGN` field.
15276    pub const fn rgn(self) -> u8 {
15277        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
15278    }
15279
15280    /// Returns the value of the `TTB1` field.
15281    pub const fn ttb1(self) -> u32 {
15282        ((self.bits() >> Self::TTB1_SHIFT) & 0b1111111111111111111111111) as u32
15283    }
15284
15285    /// Returns the value of the `ASID` field.
15286    pub const fn asid(self) -> u8 {
15287        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
15288    }
15289}
15290
15291#[cfg(feature = "el1")]
15292bitflags! {
15293    /// `TTBR1_EL1` system register value.
15294    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15295    #[repr(transparent)]
15296    pub struct Ttbr1El1: u64 {
15297        /// `CnP` bit.
15298        const CNP = 1 << 0;
15299    }
15300}
15301
15302#[cfg(feature = "el1")]
15303impl Ttbr1El1 {
15304    /// Offset of the `CnP` field.
15305    pub const CNP_SHIFT: u32 = 0;
15306    /// Offset of the `BADDR[47:1]` field.
15307    pub const BADDR_47_1_SHIFT: u32 = 1;
15308    /// Mask for the `BADDR[47:1]` field.
15309    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
15310    /// Offset of the `SKL` field.
15311    pub const SKL_SHIFT: u32 = 1;
15312    /// Mask for the `SKL` field.
15313    pub const SKL_MASK: u64 = 0b11;
15314    /// Offset of the `ASID` field.
15315    pub const ASID_SHIFT: u32 = 48;
15316    /// Mask for the `ASID` field.
15317    pub const ASID_MASK: u64 = 0b1111111111111111;
15318
15319    /// Returns the value of the `BADDR[47:1]` field.
15320    pub const fn baddr_47_1(self) -> u64 {
15321        ((self.bits() >> Self::BADDR_47_1_SHIFT)
15322            & 0b11111111111111111111111111111111111111111111111) as u64
15323    }
15324
15325    /// Returns the value of the `SKL` field.
15326    pub const fn skl(self) -> u8 {
15327        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
15328    }
15329
15330    /// Returns the value of the `ASID` field.
15331    pub const fn asid(self) -> u16 {
15332        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
15333    }
15334}
15335
15336#[cfg(feature = "el2")]
15337bitflags! {
15338    /// `TTBR1_EL2` system register value.
15339    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15340    #[repr(transparent)]
15341    pub struct Ttbr1El2: u64 {
15342        /// `CnP` bit.
15343        const CNP = 1 << 0;
15344    }
15345}
15346
15347#[cfg(feature = "el2")]
15348impl Ttbr1El2 {
15349    /// Offset of the `CnP` field.
15350    pub const CNP_SHIFT: u32 = 0;
15351    /// Offset of the `BADDR[47:1]` field.
15352    pub const BADDR_47_1_SHIFT: u32 = 1;
15353    /// Mask for the `BADDR[47:1]` field.
15354    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
15355    /// Offset of the `SKL` field.
15356    pub const SKL_SHIFT: u32 = 1;
15357    /// Mask for the `SKL` field.
15358    pub const SKL_MASK: u64 = 0b11;
15359    /// Offset of the `ASID` field.
15360    pub const ASID_SHIFT: u32 = 48;
15361    /// Mask for the `ASID` field.
15362    pub const ASID_MASK: u64 = 0b1111111111111111;
15363
15364    /// Returns the value of the `BADDR[47:1]` field.
15365    pub const fn baddr_47_1(self) -> u64 {
15366        ((self.bits() >> Self::BADDR_47_1_SHIFT)
15367            & 0b11111111111111111111111111111111111111111111111) as u64
15368    }
15369
15370    /// Returns the value of the `SKL` field.
15371    pub const fn skl(self) -> u8 {
15372        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
15373    }
15374
15375    /// Returns the value of the `ASID` field.
15376    pub const fn asid(self) -> u16 {
15377        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
15378    }
15379}
15380
15381bitflags! {
15382    /// `VBAR` system register value.
15383    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15384    #[repr(transparent)]
15385    pub struct Vbar: u32 {
15386    }
15387}
15388
15389impl Vbar {
15390    /// Offset of the `VBA` field.
15391    pub const VBA_SHIFT: u32 = 5;
15392    /// Mask for the `VBA` field.
15393    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
15394
15395    /// Returns the value of the `VBA` field.
15396    pub const fn vba(self) -> u32 {
15397        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
15398    }
15399}
15400
15401#[cfg(feature = "el1")]
15402bitflags! {
15403    /// `VBAR_EL1` system register value.
15404    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15405    #[repr(transparent)]
15406    pub struct VbarEl1: u64 {
15407        /// `UT` bit.
15408        const UT = 1 << 0;
15409    }
15410}
15411
15412#[cfg(feature = "el1")]
15413impl VbarEl1 {
15414    /// Offset of the `UT` field.
15415    pub const UT_SHIFT: u32 = 0;
15416    /// Offset of the `VBA` field.
15417    pub const VBA_SHIFT: u32 = 11;
15418    /// Mask for the `VBA` field.
15419    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
15420
15421    /// Returns the value of the `VBA` field.
15422    pub const fn vba(self) -> u64 {
15423        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
15424            as u64
15425    }
15426}
15427
15428#[cfg(feature = "el2")]
15429bitflags! {
15430    /// `VBAR_EL2` system register value.
15431    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15432    #[repr(transparent)]
15433    pub struct VbarEl2: u64 {
15434        /// `UT` bit.
15435        const UT = 1 << 0;
15436    }
15437}
15438
15439#[cfg(feature = "el2")]
15440impl VbarEl2 {
15441    /// Offset of the `UT` field.
15442    pub const UT_SHIFT: u32 = 0;
15443    /// Offset of the `VBA` field.
15444    pub const VBA_SHIFT: u32 = 11;
15445    /// Mask for the `VBA` field.
15446    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
15447
15448    /// Returns the value of the `VBA` field.
15449    pub const fn vba(self) -> u64 {
15450        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
15451            as u64
15452    }
15453}
15454
15455bitflags! {
15456    /// `VDFSR` system register value.
15457    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15458    #[repr(transparent)]
15459    pub struct Vdfsr: u32 {
15460        /// `ExT` bit.
15461        const EXT = 1 << 12;
15462    }
15463}
15464
15465impl Vdfsr {
15466    /// Offset of the `ExT` field.
15467    pub const EXT_SHIFT: u32 = 12;
15468    /// Offset of the `AET` field.
15469    pub const AET_SHIFT: u32 = 14;
15470    /// Mask for the `AET` field.
15471    pub const AET_MASK: u32 = 0b11;
15472
15473    /// Returns the value of the `AET` field.
15474    pub const fn aet(self) -> u8 {
15475        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
15476    }
15477}
15478
15479bitflags! {
15480    /// `VDISR` system register value.
15481    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15482    #[repr(transparent)]
15483    pub struct Vdisr: u32 {
15484        /// `LPAE` bit.
15485        const LPAE = 1 << 9;
15486        /// `ExT` bit.
15487        const EXT = 1 << 12;
15488        /// `A` bit.
15489        const A = 1 << 31;
15490    }
15491}
15492
15493impl Vdisr {
15494    /// Offset of the `STATUS` field.
15495    pub const STATUS_SHIFT: u32 = 0;
15496    /// Mask for the `STATUS` field.
15497    pub const STATUS_MASK: u32 = 0b111111;
15498    /// Offset of the `LPAE` field.
15499    pub const LPAE_SHIFT: u32 = 9;
15500    /// Offset of the `ExT` field.
15501    pub const EXT_SHIFT: u32 = 12;
15502    /// Offset of the `AET` field.
15503    pub const AET_SHIFT: u32 = 14;
15504    /// Mask for the `AET` field.
15505    pub const AET_MASK: u32 = 0b11;
15506    /// Offset of the `A` field.
15507    pub const A_SHIFT: u32 = 31;
15508
15509    /// Returns the value of the `STATUS` field.
15510    pub const fn status(self) -> u8 {
15511        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
15512    }
15513
15514    /// Returns the value of the `AET` field.
15515    pub const fn aet(self) -> u8 {
15516        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
15517    }
15518}
15519
15520#[cfg(feature = "el2")]
15521bitflags! {
15522    /// `VDISR_EL2` system register value.
15523    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15524    #[repr(transparent)]
15525    pub struct VdisrEl2: u64 {
15526        /// `LPAE` bit.
15527        const LPAE = 1 << 9;
15528        /// `ExT` bit.
15529        const EXT = 1 << 12;
15530        /// `IDS` bit.
15531        const IDS = 1 << 24;
15532        /// `A` bit.
15533        const A = 1 << 31;
15534    }
15535}
15536
15537#[cfg(feature = "el2")]
15538impl VdisrEl2 {
15539    /// Offset of the `ISS` field.
15540    pub const ISS_SHIFT: u32 = 0;
15541    /// Mask for the `ISS` field.
15542    pub const ISS_MASK: u64 = 0b111111111111111111111111;
15543    /// Offset of the `STATUS` field.
15544    pub const STATUS_SHIFT: u32 = 0;
15545    /// Mask for the `STATUS` field.
15546    pub const STATUS_MASK: u64 = 0b111111;
15547    /// Offset of the `LPAE` field.
15548    pub const LPAE_SHIFT: u32 = 9;
15549    /// Offset of the `ExT` field.
15550    pub const EXT_SHIFT: u32 = 12;
15551    /// Offset of the `AET` field.
15552    pub const AET_SHIFT: u32 = 14;
15553    /// Mask for the `AET` field.
15554    pub const AET_MASK: u64 = 0b11;
15555    /// Offset of the `IDS` field.
15556    pub const IDS_SHIFT: u32 = 24;
15557    /// Offset of the `A` field.
15558    pub const A_SHIFT: u32 = 31;
15559
15560    /// Returns the value of the `ISS` field.
15561    pub const fn iss(self) -> u32 {
15562        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
15563    }
15564
15565    /// Returns the value of the `STATUS` field.
15566    pub const fn status(self) -> u8 {
15567        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
15568    }
15569
15570    /// Returns the value of the `AET` field.
15571    pub const fn aet(self) -> u8 {
15572        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
15573    }
15574}
15575
15576bitflags! {
15577    /// `VMPIDR` system register value.
15578    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15579    #[repr(transparent)]
15580    pub struct Vmpidr: u32 {
15581        /// `MT` bit.
15582        const MT = 1 << 24;
15583        /// `U` bit.
15584        const U = 1 << 30;
15585        /// `M` bit.
15586        const M = 1 << 31;
15587    }
15588}
15589
15590impl Vmpidr {
15591    /// Offset of the `Aff0` field.
15592    pub const AFF0_SHIFT: u32 = 0;
15593    /// Mask for the `Aff0` field.
15594    pub const AFF0_MASK: u32 = 0b11111111;
15595    /// Offset of the `Aff1` field.
15596    pub const AFF1_SHIFT: u32 = 8;
15597    /// Mask for the `Aff1` field.
15598    pub const AFF1_MASK: u32 = 0b11111111;
15599    /// Offset of the `Aff2` field.
15600    pub const AFF2_SHIFT: u32 = 16;
15601    /// Mask for the `Aff2` field.
15602    pub const AFF2_MASK: u32 = 0b11111111;
15603    /// Offset of the `MT` field.
15604    pub const MT_SHIFT: u32 = 24;
15605    /// Offset of the `U` field.
15606    pub const U_SHIFT: u32 = 30;
15607    /// Offset of the `M` field.
15608    pub const M_SHIFT: u32 = 31;
15609
15610    /// Returns the value of the `Aff0` field.
15611    pub const fn aff0(self) -> u8 {
15612        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
15613    }
15614
15615    /// Returns the value of the `Aff1` field.
15616    pub const fn aff1(self) -> u8 {
15617        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
15618    }
15619
15620    /// Returns the value of the `Aff2` field.
15621    pub const fn aff2(self) -> u8 {
15622        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
15623    }
15624}
15625
15626#[cfg(feature = "el2")]
15627bitflags! {
15628    /// `VMPIDR_EL2` system register value.
15629    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15630    #[repr(transparent)]
15631    pub struct VmpidrEl2: u64 {
15632        /// RES1 bits in the `VMPIDR_EL2` register.
15633        const RES1 = 0b10000000000000000000000000000000;
15634        /// `MT` bit.
15635        const MT = 1 << 24;
15636        /// `U` bit.
15637        const U = 1 << 30;
15638    }
15639}
15640
15641#[cfg(feature = "el2")]
15642impl VmpidrEl2 {
15643    /// Offset of the `Aff0` field.
15644    pub const AFF0_SHIFT: u32 = 0;
15645    /// Mask for the `Aff0` field.
15646    pub const AFF0_MASK: u64 = 0b11111111;
15647    /// Offset of the `Aff1` field.
15648    pub const AFF1_SHIFT: u32 = 8;
15649    /// Mask for the `Aff1` field.
15650    pub const AFF1_MASK: u64 = 0b11111111;
15651    /// Offset of the `Aff2` field.
15652    pub const AFF2_SHIFT: u32 = 16;
15653    /// Mask for the `Aff2` field.
15654    pub const AFF2_MASK: u64 = 0b11111111;
15655    /// Offset of the `MT` field.
15656    pub const MT_SHIFT: u32 = 24;
15657    /// Offset of the `U` field.
15658    pub const U_SHIFT: u32 = 30;
15659    /// Offset of the `Aff3` field.
15660    pub const AFF3_SHIFT: u32 = 32;
15661    /// Mask for the `Aff3` field.
15662    pub const AFF3_MASK: u64 = 0b11111111;
15663
15664    /// Returns the value of the `Aff0` field.
15665    pub const fn aff0(self) -> u8 {
15666        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
15667    }
15668
15669    /// Returns the value of the `Aff1` field.
15670    pub const fn aff1(self) -> u8 {
15671        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
15672    }
15673
15674    /// Returns the value of the `Aff2` field.
15675    pub const fn aff2(self) -> u8 {
15676        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
15677    }
15678
15679    /// Returns the value of the `Aff3` field.
15680    pub const fn aff3(self) -> u8 {
15681        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
15682    }
15683}
15684
15685bitflags! {
15686    /// `VPIDR` system register value.
15687    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15688    #[repr(transparent)]
15689    pub struct Vpidr: u32 {
15690    }
15691}
15692
15693impl Vpidr {
15694    /// Offset of the `Revision` field.
15695    pub const REVISION_SHIFT: u32 = 0;
15696    /// Mask for the `Revision` field.
15697    pub const REVISION_MASK: u32 = 0b1111;
15698    /// Offset of the `PartNum` field.
15699    pub const PARTNUM_SHIFT: u32 = 4;
15700    /// Mask for the `PartNum` field.
15701    pub const PARTNUM_MASK: u32 = 0b111111111111;
15702    /// Offset of the `Architecture` field.
15703    pub const ARCHITECTURE_SHIFT: u32 = 16;
15704    /// Mask for the `Architecture` field.
15705    pub const ARCHITECTURE_MASK: u32 = 0b1111;
15706    /// Offset of the `Variant` field.
15707    pub const VARIANT_SHIFT: u32 = 20;
15708    /// Mask for the `Variant` field.
15709    pub const VARIANT_MASK: u32 = 0b1111;
15710    /// Offset of the `Implementer` field.
15711    pub const IMPLEMENTER_SHIFT: u32 = 24;
15712    /// Mask for the `Implementer` field.
15713    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
15714
15715    /// Returns the value of the `Revision` field.
15716    pub const fn revision(self) -> u8 {
15717        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
15718    }
15719
15720    /// Returns the value of the `PartNum` field.
15721    pub const fn partnum(self) -> u16 {
15722        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
15723    }
15724
15725    /// Returns the value of the `Architecture` field.
15726    pub const fn architecture(self) -> u8 {
15727        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
15728    }
15729
15730    /// Returns the value of the `Variant` field.
15731    pub const fn variant(self) -> u8 {
15732        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
15733    }
15734
15735    /// Returns the value of the `Implementer` field.
15736    pub const fn implementer(self) -> u8 {
15737        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
15738    }
15739}
15740
15741#[cfg(feature = "el2")]
15742bitflags! {
15743    /// `VPIDR_EL2` system register value.
15744    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15745    #[repr(transparent)]
15746    pub struct VpidrEl2: u64 {
15747    }
15748}
15749
15750#[cfg(feature = "el2")]
15751impl VpidrEl2 {
15752    /// Offset of the `Revision` field.
15753    pub const REVISION_SHIFT: u32 = 0;
15754    /// Mask for the `Revision` field.
15755    pub const REVISION_MASK: u64 = 0b1111;
15756    /// Offset of the `PartNum` field.
15757    pub const PARTNUM_SHIFT: u32 = 4;
15758    /// Mask for the `PartNum` field.
15759    pub const PARTNUM_MASK: u64 = 0b111111111111;
15760    /// Offset of the `Architecture` field.
15761    pub const ARCHITECTURE_SHIFT: u32 = 16;
15762    /// Mask for the `Architecture` field.
15763    pub const ARCHITECTURE_MASK: u64 = 0b1111;
15764    /// Offset of the `Variant` field.
15765    pub const VARIANT_SHIFT: u32 = 20;
15766    /// Mask for the `Variant` field.
15767    pub const VARIANT_MASK: u64 = 0b1111;
15768    /// Offset of the `Implementer` field.
15769    pub const IMPLEMENTER_SHIFT: u32 = 24;
15770    /// Mask for the `Implementer` field.
15771    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
15772
15773    /// Returns the value of the `Revision` field.
15774    pub const fn revision(self) -> u8 {
15775        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
15776    }
15777
15778    /// Returns the value of the `PartNum` field.
15779    pub const fn partnum(self) -> u16 {
15780        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
15781    }
15782
15783    /// Returns the value of the `Architecture` field.
15784    pub const fn architecture(self) -> u8 {
15785        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
15786    }
15787
15788    /// Returns the value of the `Variant` field.
15789    pub const fn variant(self) -> u8 {
15790        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
15791    }
15792
15793    /// Returns the value of the `Implementer` field.
15794    pub const fn implementer(self) -> u8 {
15795        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
15796    }
15797}
15798
15799#[cfg(feature = "el2")]
15800bitflags! {
15801    /// `VSESR_EL2` system register value.
15802    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15803    #[repr(transparent)]
15804    pub struct VsesrEl2: u64 {
15805        /// `ExT` bit.
15806        const EXT = 1 << 12;
15807        /// `IDS` bit.
15808        const IDS = 1 << 24;
15809    }
15810}
15811
15812#[cfg(feature = "el2")]
15813impl VsesrEl2 {
15814    /// Offset of the `ISS` field.
15815    pub const ISS_SHIFT: u32 = 0;
15816    /// Mask for the `ISS` field.
15817    pub const ISS_MASK: u64 = 0b111111111111111111111111;
15818    /// Offset of the `ExT` field.
15819    pub const EXT_SHIFT: u32 = 12;
15820    /// Offset of the `AET` field.
15821    pub const AET_SHIFT: u32 = 14;
15822    /// Mask for the `AET` field.
15823    pub const AET_MASK: u64 = 0b11;
15824    /// Offset of the `IDS` field.
15825    pub const IDS_SHIFT: u32 = 24;
15826
15827    /// Returns the value of the `ISS` field.
15828    pub const fn iss(self) -> u32 {
15829        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
15830    }
15831
15832    /// Returns the value of the `AET` field.
15833    pub const fn aet(self) -> u8 {
15834        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
15835    }
15836}
15837
15838bitflags! {
15839    /// `VTCR` system register value.
15840    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15841    #[repr(transparent)]
15842    pub struct Vtcr: u32 {
15843        /// RES1 bits in the `VTCR` register.
15844        const RES1 = 0b10000000000000000000000000000000;
15845        /// `S` bit.
15846        const S = 1 << 4;
15847        /// `HWU59` bit.
15848        const HWU59 = 1 << 25;
15849        /// `HWU60` bit.
15850        const HWU60 = 1 << 26;
15851        /// `HWU61` bit.
15852        const HWU61 = 1 << 27;
15853        /// `HWU62` bit.
15854        const HWU62 = 1 << 28;
15855    }
15856}
15857
15858impl Vtcr {
15859    /// Offset of the `T0SZ` field.
15860    pub const T0SZ_SHIFT: u32 = 0;
15861    /// Mask for the `T0SZ` field.
15862    pub const T0SZ_MASK: u32 = 0b1111;
15863    /// Offset of the `S` field.
15864    pub const S_SHIFT: u32 = 4;
15865    /// Offset of the `SL0` field.
15866    pub const SL0_SHIFT: u32 = 6;
15867    /// Mask for the `SL0` field.
15868    pub const SL0_MASK: u32 = 0b11;
15869    /// Offset of the `IRGN0` field.
15870    pub const IRGN0_SHIFT: u32 = 8;
15871    /// Mask for the `IRGN0` field.
15872    pub const IRGN0_MASK: u32 = 0b11;
15873    /// Offset of the `ORGN0` field.
15874    pub const ORGN0_SHIFT: u32 = 10;
15875    /// Mask for the `ORGN0` field.
15876    pub const ORGN0_MASK: u32 = 0b11;
15877    /// Offset of the `SH0` field.
15878    pub const SH0_SHIFT: u32 = 12;
15879    /// Mask for the `SH0` field.
15880    pub const SH0_MASK: u32 = 0b11;
15881    /// Offset of the `HWU59` field.
15882    pub const HWU59_SHIFT: u32 = 25;
15883    /// Offset of the `HWU60` field.
15884    pub const HWU60_SHIFT: u32 = 26;
15885    /// Offset of the `HWU61` field.
15886    pub const HWU61_SHIFT: u32 = 27;
15887    /// Offset of the `HWU62` field.
15888    pub const HWU62_SHIFT: u32 = 28;
15889
15890    /// Returns the value of the `T0SZ` field.
15891    pub const fn t0sz(self) -> u8 {
15892        ((self.bits() >> Self::T0SZ_SHIFT) & 0b1111) as u8
15893    }
15894
15895    /// Returns the value of the `SL0` field.
15896    pub const fn sl0(self) -> u8 {
15897        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
15898    }
15899
15900    /// Returns the value of the `IRGN0` field.
15901    pub const fn irgn0(self) -> u8 {
15902        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
15903    }
15904
15905    /// Returns the value of the `ORGN0` field.
15906    pub const fn orgn0(self) -> u8 {
15907        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
15908    }
15909
15910    /// Returns the value of the `SH0` field.
15911    pub const fn sh0(self) -> u8 {
15912        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
15913    }
15914}
15915
15916#[cfg(feature = "el2")]
15917bitflags! {
15918    /// `VTCR_EL2` system register value.
15919    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
15920    #[repr(transparent)]
15921    pub struct VtcrEl2: u64 {
15922        /// RES1 bits in the `VTCR_EL2` register.
15923        const RES1 = 0b10000000000000000000000000000000;
15924        /// `VS` bit.
15925        const VS = 1 << 19;
15926        /// `HA` bit.
15927        const HA = 1 << 21;
15928        /// `HD` bit.
15929        const HD = 1 << 22;
15930        /// `HWU59` bit.
15931        const HWU59 = 1 << 25;
15932        /// `HWU60` bit.
15933        const HWU60 = 1 << 26;
15934        /// `HWU61` bit.
15935        const HWU61 = 1 << 27;
15936        /// `HWU62` bit.
15937        const HWU62 = 1 << 28;
15938        /// `NSW` bit.
15939        const NSW = 1 << 29;
15940        /// `NSA` bit.
15941        const NSA = 1 << 30;
15942        /// `DS` bit.
15943        const DS = 1 << 32;
15944        /// `SL2` bit.
15945        const SL2 = 1 << 33;
15946        /// `AssuredOnly` bit.
15947        const ASSUREDONLY = 1 << 34;
15948        /// `TL1` bit.
15949        const TL1 = 1 << 35;
15950        /// `S2PIE` bit.
15951        const S2PIE = 1 << 36;
15952        /// `S2POE` bit.
15953        const S2POE = 1 << 37;
15954        /// `D128` bit.
15955        const D128 = 1 << 38;
15956        /// `GCSH` bit.
15957        const GCSH = 1 << 40;
15958        /// `TL0` bit.
15959        const TL0 = 1 << 41;
15960        /// `HAFT` bit.
15961        const HAFT = 1 << 44;
15962        /// `HDBSS` bit.
15963        const HDBSS = 1 << 45;
15964    }
15965}
15966
15967#[cfg(feature = "el2")]
15968impl VtcrEl2 {
15969    /// Offset of the `T0SZ` field.
15970    pub const T0SZ_SHIFT: u32 = 0;
15971    /// Mask for the `T0SZ` field.
15972    pub const T0SZ_MASK: u64 = 0b111111;
15973    /// Offset of the `SL0` field.
15974    pub const SL0_SHIFT: u32 = 6;
15975    /// Mask for the `SL0` field.
15976    pub const SL0_MASK: u64 = 0b11;
15977    /// Offset of the `IRGN0` field.
15978    pub const IRGN0_SHIFT: u32 = 8;
15979    /// Mask for the `IRGN0` field.
15980    pub const IRGN0_MASK: u64 = 0b11;
15981    /// Offset of the `ORGN0` field.
15982    pub const ORGN0_SHIFT: u32 = 10;
15983    /// Mask for the `ORGN0` field.
15984    pub const ORGN0_MASK: u64 = 0b11;
15985    /// Offset of the `SH0` field.
15986    pub const SH0_SHIFT: u32 = 12;
15987    /// Mask for the `SH0` field.
15988    pub const SH0_MASK: u64 = 0b11;
15989    /// Offset of the `TG0` field.
15990    pub const TG0_SHIFT: u32 = 14;
15991    /// Mask for the `TG0` field.
15992    pub const TG0_MASK: u64 = 0b11;
15993    /// Offset of the `PS` field.
15994    pub const PS_SHIFT: u32 = 16;
15995    /// Mask for the `PS` field.
15996    pub const PS_MASK: u64 = 0b111;
15997    /// Offset of the `VS` field.
15998    pub const VS_SHIFT: u32 = 19;
15999    /// Offset of the `HA` field.
16000    pub const HA_SHIFT: u32 = 21;
16001    /// Offset of the `HD` field.
16002    pub const HD_SHIFT: u32 = 22;
16003    /// Offset of the `HWU59` field.
16004    pub const HWU59_SHIFT: u32 = 25;
16005    /// Offset of the `HWU60` field.
16006    pub const HWU60_SHIFT: u32 = 26;
16007    /// Offset of the `HWU61` field.
16008    pub const HWU61_SHIFT: u32 = 27;
16009    /// Offset of the `HWU62` field.
16010    pub const HWU62_SHIFT: u32 = 28;
16011    /// Offset of the `NSW` field.
16012    pub const NSW_SHIFT: u32 = 29;
16013    /// Offset of the `NSA` field.
16014    pub const NSA_SHIFT: u32 = 30;
16015    /// Offset of the `DS` field.
16016    pub const DS_SHIFT: u32 = 32;
16017    /// Offset of the `SL2` field.
16018    pub const SL2_SHIFT: u32 = 33;
16019    /// Offset of the `AssuredOnly` field.
16020    pub const ASSUREDONLY_SHIFT: u32 = 34;
16021    /// Offset of the `TL1` field.
16022    pub const TL1_SHIFT: u32 = 35;
16023    /// Offset of the `S2PIE` field.
16024    pub const S2PIE_SHIFT: u32 = 36;
16025    /// Offset of the `S2POE` field.
16026    pub const S2POE_SHIFT: u32 = 37;
16027    /// Offset of the `D128` field.
16028    pub const D128_SHIFT: u32 = 38;
16029    /// Offset of the `GCSH` field.
16030    pub const GCSH_SHIFT: u32 = 40;
16031    /// Offset of the `TL0` field.
16032    pub const TL0_SHIFT: u32 = 41;
16033    /// Offset of the `HAFT` field.
16034    pub const HAFT_SHIFT: u32 = 44;
16035    /// Offset of the `HDBSS` field.
16036    pub const HDBSS_SHIFT: u32 = 45;
16037
16038    /// Returns the value of the `T0SZ` field.
16039    pub const fn t0sz(self) -> u8 {
16040        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
16041    }
16042
16043    /// Returns the value of the `SL0` field.
16044    pub const fn sl0(self) -> u8 {
16045        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
16046    }
16047
16048    /// Returns the value of the `IRGN0` field.
16049    pub const fn irgn0(self) -> u8 {
16050        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
16051    }
16052
16053    /// Returns the value of the `ORGN0` field.
16054    pub const fn orgn0(self) -> u8 {
16055        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
16056    }
16057
16058    /// Returns the value of the `SH0` field.
16059    pub const fn sh0(self) -> u8 {
16060        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
16061    }
16062
16063    /// Returns the value of the `TG0` field.
16064    pub const fn tg0(self) -> u8 {
16065        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
16066    }
16067
16068    /// Returns the value of the `PS` field.
16069    pub const fn ps(self) -> u8 {
16070        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
16071    }
16072}
16073
16074bitflags! {
16075    /// `VTTBR` system register value.
16076    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
16077    #[repr(transparent)]
16078    pub struct Vttbr: u64 {
16079        /// `CnP` bit.
16080        const CNP = 1 << 0;
16081    }
16082}
16083
16084impl Vttbr {
16085    /// Offset of the `CnP` field.
16086    pub const CNP_SHIFT: u32 = 0;
16087    /// Offset of the `BADDR` field.
16088    pub const BADDR_SHIFT: u32 = 1;
16089    /// Mask for the `BADDR` field.
16090    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
16091    /// Offset of the `VMID` field.
16092    pub const VMID_SHIFT: u32 = 48;
16093    /// Mask for the `VMID` field.
16094    pub const VMID_MASK: u64 = 0b11111111;
16095
16096    /// Returns the value of the `BADDR` field.
16097    pub const fn baddr(self) -> u64 {
16098        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
16099            as u64
16100    }
16101
16102    /// Returns the value of the `VMID` field.
16103    pub const fn vmid(self) -> u8 {
16104        ((self.bits() >> Self::VMID_SHIFT) & 0b11111111) as u8
16105    }
16106}
16107
16108#[cfg(feature = "el2")]
16109bitflags! {
16110    /// `VTTBR_EL2` system register value.
16111    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
16112    #[repr(transparent)]
16113    pub struct VttbrEl2: u64 {
16114        /// `CnP` bit.
16115        const CNP = 1 << 0;
16116    }
16117}
16118
16119#[cfg(feature = "el2")]
16120impl VttbrEl2 {
16121    /// Offset of the `CnP` field.
16122    pub const CNP_SHIFT: u32 = 0;
16123    /// Offset of the `BADDR` field.
16124    pub const BADDR_SHIFT: u32 = 1;
16125    /// Mask for the `BADDR` field.
16126    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
16127    /// Offset of the `SKL` field.
16128    pub const SKL_SHIFT: u32 = 1;
16129    /// Mask for the `SKL` field.
16130    pub const SKL_MASK: u64 = 0b11;
16131    /// Offset of the `VMID` field.
16132    pub const VMID_SHIFT: u32 = 48;
16133    /// Mask for the `VMID` field.
16134    pub const VMID_MASK: u64 = 0b1111111111111111;
16135
16136    /// Returns the value of the `BADDR` field.
16137    pub const fn baddr(self) -> u64 {
16138        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
16139            as u64
16140    }
16141
16142    /// Returns the value of the `SKL` field.
16143    pub const fn skl(self) -> u8 {
16144        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
16145    }
16146
16147    /// Returns the value of the `VMID` field.
16148    pub const fn vmid(self) -> u16 {
16149        ((self.bits() >> Self::VMID_SHIFT) & 0b1111111111111111) as u16
16150    }
16151}
16152
16153#[cfg(feature = "el3")]
16154bitflags! {
16155    /// `ZCR_EL3` system register value.
16156    #[derive(Clone, Copy, Debug, Eq, PartialEq)]
16157    #[repr(transparent)]
16158    pub struct ZcrEl3: u64 {
16159    }
16160}
16161
16162#[cfg(feature = "el3")]
16163impl ZcrEl3 {
16164    /// Offset of the `LEN` field.
16165    pub const LEN_SHIFT: u32 = 0;
16166    /// Mask for the `LEN` field.
16167    pub const LEN_MASK: u64 = 0b1111;
16168
16169    /// Returns the value of the `LEN` field.
16170    pub const fn len(self) -> u8 {
16171        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
16172    }
16173}
16174
16175#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16176read_write_sysreg!(actlr: (p15, 0, c0, c1, 1), u32, safe_read, fake::SYSREGS);
16177#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16178read_write_sysreg!(actlr2: (p15, 0, c0, c1, 3), u32, safe_read, fake::SYSREGS);
16179#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16180read_write_sysreg!(actlr_el1, u64, safe_read, fake::SYSREGS);
16181#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16182read_write_sysreg!(actlr_el2, u64, safe_read, fake::SYSREGS);
16183#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16184read_write_sysreg!(adfsr: (p15, 0, c1, c5, 0), u32, safe_read, fake::SYSREGS);
16185#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16186read_write_sysreg!(afsr0_el1, u64, safe_read, fake::SYSREGS);
16187#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16188read_write_sysreg!(afsr0_el2, u64, safe_read, fake::SYSREGS);
16189#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16190read_write_sysreg!(afsr1_el1, u64, safe_read, fake::SYSREGS);
16191#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16192read_write_sysreg!(afsr1_el2, u64, safe_read, fake::SYSREGS);
16193#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16194read_sysreg!(aidr: (p15, 1, c0, c0, 7), u32, safe, fake::SYSREGS);
16195#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16196read_write_sysreg!(aifsr: (p15, 0, c1, c5, 1), u32, safe_read, fake::SYSREGS);
16197#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16198read_write_sysreg!(amair0: (p15, 0, c3, c10, 0), u32, safe_read, fake::SYSREGS);
16199#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16200read_write_sysreg!(amair1: (p15, 0, c3, c10, 1), u32, safe_read, fake::SYSREGS);
16201#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16202read_write_sysreg!(amair_el1, u64, safe_read, fake::SYSREGS);
16203#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16204read_write_sysreg!(amair_el2, u64, safe_read, fake::SYSREGS);
16205#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16206read_sysreg!(amcfgr: (p15, 0, c2, c13, 1), u32: Amcfgr, safe, fake::SYSREGS);
16207#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16208read_sysreg!(amcgcr: (p15, 0, c2, c13, 2), u32: Amcgcr, safe, fake::SYSREGS);
16209#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16210read_write_sysreg!(amcntenclr0: (p15, 0, c2, c13, 4), u32: Amcntenclr0, safe_read, fake::SYSREGS);
16211#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16212read_write_sysreg!(amcntenclr1: (p15, 0, c3, c13, 0), u32: Amcntenclr1, safe_read, fake::SYSREGS);
16213#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16214read_write_sysreg!(amcntenset0: (p15, 0, c2, c13, 5), u32: Amcntenset0, safe_read, fake::SYSREGS);
16215#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16216read_write_sysreg!(amcntenset1: (p15, 0, c3, c13, 1), u32: Amcntenset1, safe_read, fake::SYSREGS);
16217#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16218read_write_sysreg!(amcr: (p15, 0, c2, c13, 0), u32: Amcr, safe_read, fake::SYSREGS);
16219#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16220read_write_sysreg!(amuserenr: (p15, 0, c2, c13, 3), u32: Amuserenr, safe_read, fake::SYSREGS);
16221#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16222read_write_sysreg!(apiakeyhi_el1: s3_0_c2_c1_1, u64: ApiakeyhiEl1, safe_read, fake::SYSREGS);
16223#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16224read_write_sysreg!(apiakeylo_el1: s3_0_c2_c1_0, u64: ApiakeyloEl1, safe_read, fake::SYSREGS);
16225#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16226read_sysreg!(ccsidr: (p15, 1, c0, c0, 0), u32: Ccsidr, safe, fake::SYSREGS);
16227#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16228read_sysreg!(ccsidr2: (p15, 1, c0, c0, 2), u32: Ccsidr2, safe, fake::SYSREGS);
16229#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16230read_sysreg!(ccsidr_el1, u64: CcsidrEl1, safe, fake::SYSREGS);
16231#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16232read_sysreg!(clidr: (p15, 1, c0, c0, 1), u32: Clidr, safe, fake::SYSREGS);
16233#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16234read_sysreg!(clidr_el1, u64: ClidrEl1, safe, fake::SYSREGS);
16235#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16236read_write_sysreg!(cntfrq: (p15, 0, c0, c14, 0), u32: Cntfrq, safe_read, fake::SYSREGS);
16237#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16238read_write_sysreg!(cntfrq_el0, u64: CntfrqEl0, safe_read, safe_write, fake::SYSREGS);
16239#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16240read_write_sysreg!(cnthctl: (p15, 4, c1, c14, 0), u32: Cnthctl, safe_read, fake::SYSREGS);
16241#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16242read_write_sysreg!(cnthctl_el2, u64: CnthctlEl2, safe_read, safe_write, fake::SYSREGS);
16243#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16244read_write_sysreg!(cnthps_ctl: (p15, 0, c2, c14, 1), u32: CnthpsCtl, safe_read, fake::SYSREGS);
16245#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16246read_write_sysreg!(cnthps_cval: (p15, 2, c14), u64: CnthpsCval, safe_read, fake::SYSREGS);
16247#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16248read_write_sysreg!(cnthps_tval: (p15, 0, c2, c14, 0), u32: CnthpsTval, safe_read, fake::SYSREGS);
16249#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16250read_write_sysreg!(cnthp_ctl: (p15, 0, c2, c14, 1), u32: CnthpCtl, safe_read, fake::SYSREGS);
16251#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16252read_write_sysreg!(cnthp_cval: (p15, 2, c14), u64: CnthpCval, safe_read, fake::SYSREGS);
16253#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16254read_write_sysreg!(cnthp_tval: (p15, 0, c2, c14, 0), u32: CnthpTval, safe_read, fake::SYSREGS);
16255#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16256read_write_sysreg!(cnthvs_ctl: (p15, 0, c3, c14, 1), u32: CnthvsCtl, safe_read, fake::SYSREGS);
16257#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16258read_write_sysreg!(cnthvs_cval: (p15, 3, c14), u64: CnthvsCval, safe_read, fake::SYSREGS);
16259#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16260read_write_sysreg!(cnthvs_tval: (p15, 0, c3, c14, 0), u32: CnthvsTval, safe_read, fake::SYSREGS);
16261#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16262read_write_sysreg!(cnthv_ctl: (p15, 0, c3, c14, 1), u32: CnthvCtl, safe_read, fake::SYSREGS);
16263#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16264read_write_sysreg!(cnthv_cval: (p15, 3, c14), u64: CnthvCval, safe_read, fake::SYSREGS);
16265#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16266read_write_sysreg!(cnthv_tval: (p15, 0, c3, c14, 0), u32: CnthvTval, safe_read, fake::SYSREGS);
16267#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16268read_write_sysreg!(cntkctl: (p15, 0, c1, c14, 0), u32: Cntkctl, safe_read, fake::SYSREGS);
16269#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16270read_sysreg!(cntpct: (p15, 0, c14), u64: Cntpct, safe, fake::SYSREGS);
16271#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16272read_sysreg!(cntpctss: (p15, 8, c14), u64: Cntpctss, safe, fake::SYSREGS);
16273#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16274read_sysreg!(cntpct_el0, u64: CntpctEl0, safe, fake::SYSREGS);
16275#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16276read_write_sysreg!(cntp_ctl: (p15, 0, c2, c14, 1), u32: CntpCtl, safe_read, fake::SYSREGS);
16277#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16278read_write_sysreg!(cntp_cval: (p15, 2, c14), u64: CntpCval, safe_read, fake::SYSREGS);
16279#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16280read_write_sysreg!(cntp_tval: (p15, 0, c2, c14, 0), u32: CntpTval, safe_read, fake::SYSREGS);
16281#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16282read_sysreg!(cntvct: (p15, 1, c14), u64: Cntvct, safe, fake::SYSREGS);
16283#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16284read_sysreg!(cntvctss: (p15, 9, c14), u64: Cntvctss, safe, fake::SYSREGS);
16285#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16286read_write_sysreg!(cntvoff: (p15, 4, c14), u64: Cntvoff, safe_read, fake::SYSREGS);
16287#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16288read_write_sysreg!(cntvoff_el2, u64: CntvoffEl2, safe_read, safe_write, fake::SYSREGS);
16289#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16290read_write_sysreg!(cntv_ctl: (p15, 0, c3, c14, 1), u32: CntvCtl, safe_read, fake::SYSREGS);
16291#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16292read_write_sysreg!(cntv_cval: (p15, 3, c14), u64: CntvCval, safe_read, fake::SYSREGS);
16293#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16294read_write_sysreg!(cntv_tval: (p15, 0, c3, c14, 0), u32: CntvTval, safe_read, fake::SYSREGS);
16295#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16296read_write_sysreg!(contextidr: (p15, 0, c0, c13, 1), u32: Contextidr, safe_read, fake::SYSREGS);
16297#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16298read_write_sysreg!(contextidr_el1, u64: ContextidrEl1, safe_read, safe_write, fake::SYSREGS);
16299#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16300read_write_sysreg!(contextidr_el2: s3_4_c13_c0_1, u64: ContextidrEl2, safe_read, safe_write, fake::SYSREGS);
16301#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16302read_write_sysreg!(cpacr: (p15, 0, c0, c1, 2), u32: Cpacr, safe_read, fake::SYSREGS);
16303#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16304read_write_sysreg!(cpacr_el1, u64: CpacrEl1, safe_read, fake::SYSREGS);
16305#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16306read_write_sysreg!(cptr_el2, u64: CptrEl2, safe_read, fake::SYSREGS);
16307#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16308read_write_sysreg!(cptr_el3, u64: CptrEl3, safe_read, fake::SYSREGS);
16309#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16310read_write_sysreg!(csselr: (p15, 2, c0, c0, 0), u32: Csselr, safe_read, fake::SYSREGS);
16311#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16312read_write_sysreg!(csselr_el1, u64: CsselrEl1, safe_read, safe_write, fake::SYSREGS);
16313#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16314read_sysreg!(ctr: (p15, 0, c0, c0, 1), u32: Ctr, safe, fake::SYSREGS);
16315#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16316read_sysreg!(ctr_el0, u64: CtrEl0, safe, fake::SYSREGS);
16317#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16318read_sysreg!(currentel, u64: Currentel, safe, fake::SYSREGS);
16319#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16320read_write_sysreg!(dacr: (p15, 0, c0, c3, 0), u32: Dacr, safe_read, fake::SYSREGS);
16321#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16322read_sysreg!(dbgauthstatus: (p14, 0, c14, c7, 6), u32: Dbgauthstatus, safe, fake::SYSREGS);
16323#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16324read_write_sysreg!(dbgclaimclr: (p14, 0, c9, c7, 6), u32: Dbgclaimclr, safe_read, fake::SYSREGS);
16325#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16326read_write_sysreg!(dbgclaimset: (p14, 0, c8, c7, 6), u32: Dbgclaimset, safe_read, fake::SYSREGS);
16327#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16328read_write_sysreg!(dbgdccint: (p14, 0, c2, c0, 0), u32: Dbgdccint, safe_read, fake::SYSREGS);
16329#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16330read_sysreg!(dbgdevid: (p14, 0, c2, c7, 7), u32: Dbgdevid, safe, fake::SYSREGS);
16331#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16332read_sysreg!(dbgdevid1: (p14, 0, c1, c7, 7), u32: Dbgdevid1, safe, fake::SYSREGS);
16333#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16334read_sysreg!(dbgdevid2: (p14, 0, c0, c7, 7), u32, safe, fake::SYSREGS);
16335#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16336read_sysreg!(dbgdidr: (p14, 0, c0, c0, 0), u32: Dbgdidr, safe, fake::SYSREGS);
16337#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16338read_sysreg!(dbgdrar: (p14, 0, c1), u64: Dbgdrar, safe, fake::SYSREGS);
16339#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16340read_sysreg!(dbgdsar: (p14, 0, c2), u64, safe, fake::SYSREGS);
16341#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16342read_write_sysreg!(dbgdscrext: (p14, 0, c2, c0, 2), u32: Dbgdscrext, safe_read, fake::SYSREGS);
16343#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16344read_sysreg!(dbgdscrint: (p14, 0, c1, c0, 0), u32: Dbgdscrint, safe, fake::SYSREGS);
16345#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16346read_write_sysreg!(dbgdtrrxext: (p14, 0, c0, c0, 2), u32: Dbgdtrrxext, safe_read, fake::SYSREGS);
16347#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16348read_sysreg!(dbgdtrrxint: (p14, 0, c5, c0, 0), u32: Dbgdtrrxint, safe, fake::SYSREGS);
16349#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16350read_write_sysreg!(dbgdtrtxext: (p14, 0, c3, c0, 2), u32: Dbgdtrtxext, safe_read, fake::SYSREGS);
16351#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16352write_sysreg!(dbgdtrtxint: (p14, 0, c5, c0, 0), u32: Dbgdtrtxint, fake::SYSREGS);
16353#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16354read_write_sysreg!(dbgosdlr: (p14, 0, c3, c1, 4), u32: Dbgosdlr, safe_read, fake::SYSREGS);
16355#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16356read_write_sysreg!(dbgoseccr: (p14, 0, c6, c0, 2), u32: Dbgoseccr, safe_read, fake::SYSREGS);
16357#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16358write_sysreg!(dbgoslar: (p14, 0, c0, c1, 4), u32: Dbgoslar, fake::SYSREGS);
16359#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16360read_sysreg!(dbgoslsr: (p14, 0, c1, c1, 4), u32: Dbgoslsr, safe, fake::SYSREGS);
16361#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16362read_write_sysreg!(dbgprcr: (p14, 0, c4, c1, 4), u32: Dbgprcr, safe_read, fake::SYSREGS);
16363#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16364read_write_sysreg!(dbgvcr: (p14, 0, c7, c0, 0), u32: Dbgvcr, safe_read, fake::SYSREGS);
16365#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16366read_write_sysreg!(dbgwfar: (p14, 0, c6, c0, 0), u32, safe_read, fake::SYSREGS);
16367#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16368read_write_sysreg!(dfar: (p15, 0, c0, c6, 0), u32: Dfar, safe_read, fake::SYSREGS);
16369#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16370read_write_sysreg!(dfsr: (p15, 0, c0, c5, 0), u32: Dfsr, safe_read, fake::SYSREGS);
16371#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16372read_write_sysreg!(disr: (p15, 0, c1, c12, 1), u32: Disr, safe_read, fake::SYSREGS);
16373#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16374read_write_sysreg!(disr_el1: s3_0_c12_c1_1, u64: DisrEl1, safe_read, safe_write, fake::SYSREGS);
16375#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16376read_write_sysreg!(dit: s3_3_c4_c2_5, u64: Dit, safe_read, safe_write, fake::SYSREGS);
16377#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16378read_write_sysreg!(dlr: (p15, 3, c5, c4, 1), u32: Dlr, safe_read, fake::SYSREGS);
16379#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16380read_write_sysreg!(dspsr: (p15, 3, c5, c4, 0), u32: Dspsr, safe_read, fake::SYSREGS);
16381#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16382read_write_sysreg!(dspsr2: (p15, 3, c5, c4, 2), u32: Dspsr2, safe_read, fake::SYSREGS);
16383#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16384read_write_sysreg!(elr_el1, u64: ElrEl1, safe_read, fake::SYSREGS);
16385#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16386read_write_sysreg!(elr_el2, u64: ElrEl2, safe_read, fake::SYSREGS);
16387#[cfg(all(any(test, feature = "fakes", target_arch = "arm"), feature = "el2"))]
16388read_write_sysreg!(elr_hyp, u32: ElrHyp, safe_read, fake::SYSREGS);
16389#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16390read_sysreg!(erridr: (p15, 0, c3, c5, 0), u32: Erridr, safe, fake::SYSREGS);
16391#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16392read_write_sysreg!(errselr: (p15, 0, c3, c5, 1), u32: Errselr, safe_read, fake::SYSREGS);
16393#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16394read_write_sysreg!(erxaddr: (p15, 0, c4, c5, 3), u32: Erxaddr, safe_read, fake::SYSREGS);
16395#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16396read_write_sysreg!(erxaddr2: (p15, 0, c4, c5, 7), u32: Erxaddr2, safe_read, fake::SYSREGS);
16397#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16398read_write_sysreg!(erxctlr: (p15, 0, c4, c5, 1), u32: Erxctlr, safe_read, fake::SYSREGS);
16399#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16400read_write_sysreg!(erxctlr2: (p15, 0, c4, c5, 5), u32: Erxctlr2, safe_read, fake::SYSREGS);
16401#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16402read_sysreg!(erxfr: (p15, 0, c4, c5, 0), u32: Erxfr, safe, fake::SYSREGS);
16403#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16404read_sysreg!(erxfr2: (p15, 0, c4, c5, 4), u32: Erxfr2, safe, fake::SYSREGS);
16405#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16406read_write_sysreg!(erxmisc0: (p15, 0, c5, c5, 0), u32: Erxmisc0, safe_read, fake::SYSREGS);
16407#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16408read_write_sysreg!(erxmisc1: (p15, 0, c5, c5, 1), u32: Erxmisc1, safe_read, fake::SYSREGS);
16409#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16410read_write_sysreg!(erxmisc2: (p15, 0, c5, c5, 4), u32: Erxmisc2, safe_read, fake::SYSREGS);
16411#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16412read_write_sysreg!(erxmisc3: (p15, 0, c5, c5, 5), u32: Erxmisc3, safe_read, fake::SYSREGS);
16413#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16414read_write_sysreg!(erxmisc4: (p15, 0, c5, c5, 2), u32: Erxmisc4, safe_read, fake::SYSREGS);
16415#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16416read_write_sysreg!(erxmisc5: (p15, 0, c5, c5, 3), u32: Erxmisc5, safe_read, fake::SYSREGS);
16417#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16418read_write_sysreg!(erxmisc6: (p15, 0, c5, c5, 6), u32: Erxmisc6, safe_read, fake::SYSREGS);
16419#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16420read_write_sysreg!(erxmisc7: (p15, 0, c5, c5, 7), u32: Erxmisc7, safe_read, fake::SYSREGS);
16421#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16422read_write_sysreg!(erxstatus: (p15, 0, c4, c5, 2), u32: Erxstatus, safe_read, fake::SYSREGS);
16423#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16424read_write_sysreg!(esr_el1, u64: EsrEl1, safe_read, safe_write, fake::SYSREGS);
16425#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16426read_write_sysreg!(esr_el2, u64: EsrEl2, safe_read, safe_write, fake::SYSREGS);
16427#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16428read_write_sysreg!(esr_el3, u64: EsrEl3, safe_read, safe_write, fake::SYSREGS);
16429#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16430read_write_sysreg!(far_el1, u64: FarEl1, safe_read, fake::SYSREGS);
16431#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16432read_write_sysreg!(far_el2, u64: FarEl2, safe_read, fake::SYSREGS);
16433#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16434read_write_sysreg!(fcseidr: (p15, 0, c0, c13, 0), u32, safe_read, fake::SYSREGS);
16435#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16436read_write_sysreg!(gcr_el1: s3_0_c1_c0_6, u64: GcrEl1, safe_read, fake::SYSREGS);
16437#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16438read_write_sysreg!(gcscr_el1: s3_0_c2_c5_0, u64: GcscrEl1, safe_read, fake::SYSREGS);
16439#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16440read_write_sysreg!(gcscr_el2: s3_4_c2_c5_0, u64: GcscrEl2, safe_read, fake::SYSREGS);
16441#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16442read_write_sysreg!(gpccr_el3: s3_6_c2_c1_6, u64: GpccrEl3, safe_read, fake::SYSREGS);
16443#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16444read_write_sysreg!(gptbr_el3: s3_6_c2_c1_4, u64: GptbrEl3, safe_read, fake::SYSREGS);
16445#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16446read_write_sysreg!(hacr: (p15, 4, c1, c1, 7), u32, safe_read, fake::SYSREGS);
16447#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16448read_write_sysreg!(hacr_el2, u64, safe_read, fake::SYSREGS);
16449#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16450read_write_sysreg!(hactlr: (p15, 4, c0, c1, 1), u32, safe_read, fake::SYSREGS);
16451#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16452read_write_sysreg!(hactlr2: (p15, 4, c0, c1, 3), u32, safe_read, fake::SYSREGS);
16453#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16454read_write_sysreg!(hadfsr: (p15, 4, c1, c5, 0), u32, safe_read, fake::SYSREGS);
16455#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16456read_write_sysreg!(haifsr: (p15, 4, c1, c5, 1), u32, safe_read, fake::SYSREGS);
16457#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16458read_write_sysreg!(hamair0: (p15, 4, c3, c10, 0), u32, safe_read, fake::SYSREGS);
16459#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16460read_write_sysreg!(hamair1: (p15, 4, c3, c10, 1), u32, safe_read, fake::SYSREGS);
16461#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16462read_write_sysreg!(hcptr: (p15, 4, c1, c1, 2), u32: Hcptr, safe_read, fake::SYSREGS);
16463#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16464read_write_sysreg!(hcr: (p15, 4, c1, c1, 0), u32: Hcr, safe_read, fake::SYSREGS);
16465#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16466read_write_sysreg!(hcr2: (p15, 4, c1, c1, 4), u32: Hcr2, safe_read, fake::SYSREGS);
16467#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16468read_write_sysreg!(hcrx_el2: s3_4_c1_c2_2, u64: HcrxEl2, safe_read, fake::SYSREGS);
16469#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16470read_write_sysreg!(hcr_el2, u64: HcrEl2, safe_read, fake::SYSREGS);
16471#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16472read_write_sysreg!(hdcr: (p15, 4, c1, c1, 1), u32: Hdcr, safe_read, fake::SYSREGS);
16473#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16474read_write_sysreg!(hdfar: (p15, 4, c0, c6, 0), u32: Hdfar, safe_read, fake::SYSREGS);
16475#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16476read_write_sysreg!(hdfgrtr2_el2: s3_4_c3_c1_0, u64: Hdfgrtr2El2, safe_read, fake::SYSREGS);
16477#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16478read_write_sysreg!(hdfgwtr2_el2: s3_4_c3_c1_1, u64: Hdfgwtr2El2, safe_read, fake::SYSREGS);
16479#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16480read_write_sysreg!(hfgitr2_el2: s3_4_c3_c1_7, u64: Hfgitr2El2, safe_read, fake::SYSREGS);
16481#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16482read_write_sysreg!(hfgrtr2_el2: s3_4_c3_c1_2, u64: Hfgrtr2El2, safe_read, fake::SYSREGS);
16483#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16484read_write_sysreg!(hfgwtr2_el2: s3_4_c3_c1_3, u64: Hfgwtr2El2, safe_read, fake::SYSREGS);
16485#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16486read_write_sysreg!(hfgwtr_el2: s3_4_c1_c1_5, u64: HfgwtrEl2, safe_read, fake::SYSREGS);
16487#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16488read_write_sysreg!(hifar: (p15, 4, c0, c6, 2), u32: Hifar, safe_read, fake::SYSREGS);
16489#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16490read_write_sysreg!(hmair0: (p15, 4, c2, c10, 0), u32: Hmair0, safe_read, fake::SYSREGS);
16491#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16492read_write_sysreg!(hmair1: (p15, 4, c2, c10, 1), u32: Hmair1, safe_read, fake::SYSREGS);
16493#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16494read_write_sysreg!(hpfar: (p15, 4, c0, c6, 4), u32: Hpfar, safe_read, fake::SYSREGS);
16495#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16496read_write_sysreg!(hpfar_el2, u64: HpfarEl2, safe_read, fake::SYSREGS);
16497#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16498read_write_sysreg!(hrmr: (p15, 4, c0, c12, 2), u32: Hrmr, safe_read, fake::SYSREGS);
16499#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16500read_write_sysreg!(hsctlr: (p15, 4, c0, c1, 0), u32: Hsctlr, safe_read, fake::SYSREGS);
16501#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16502read_write_sysreg!(hsr: (p15, 4, c2, c5, 0), u32: Hsr, safe_read, fake::SYSREGS);
16503#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16504read_write_sysreg!(hstr: (p15, 4, c1, c1, 3), u32, safe_read, fake::SYSREGS);
16505#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16506read_write_sysreg!(hstr_el2, u64, safe_read, safe_write, fake::SYSREGS);
16507#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16508read_write_sysreg!(htcr: (p15, 4, c0, c2, 2), u32: Htcr, safe_read, fake::SYSREGS);
16509#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16510read_write_sysreg!(htpidr: (p15, 4, c0, c13, 2), u32: Htpidr, safe_read, fake::SYSREGS);
16511#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16512read_write_sysreg!(htrfcr: (p15, 4, c2, c1, 1), u32: Htrfcr, safe_read, fake::SYSREGS);
16513#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16514read_write_sysreg!(httbr: (p15, 4, c2), u64: Httbr, safe_read, fake::SYSREGS);
16515#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16516read_write_sysreg!(hvbar: (p15, 4, c0, c12, 0), u32: Hvbar, safe_read, fake::SYSREGS);
16517#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16518read_write_sysreg!(icc_sre_el1: s3_0_c12_c12_5, u64: IccSreEl1, safe_read, fake::SYSREGS);
16519#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16520read_write_sysreg!(icc_sre_el2: s3_4_c12_c9_5, u64: IccSreEl2, safe_read, fake::SYSREGS);
16521#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16522read_write_sysreg! {
16523    /// # Safety
16524    ///
16525    /// The SRE bit of `icc_sre_el3` must not be changed from 1 to 0, as this can result in unpredictable behaviour.
16526    icc_sre_el3: s3_6_c12_c12_5, u64: IccSreEl3, safe_read, fake::SYSREGS
16527}
16528#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16529read_write_sysreg!(ich_hcr_el2: s3_4_c12_c11_0, u64: IchHcrEl2, safe_read, fake::SYSREGS);
16530#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16531read_write_sysreg!(ich_vmcr_el2: s3_4_c12_c11_7, u64: IchVmcrEl2, safe_read, safe_write, fake::SYSREGS);
16532#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16533read_sysreg!(id_aa64dfr0_el1, u64: IdAa64dfr0El1, safe, fake::SYSREGS);
16534#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16535read_sysreg!(id_aa64dfr1_el1, u64: IdAa64dfr1El1, safe, fake::SYSREGS);
16536#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16537read_sysreg!(id_aa64isar1_el1, u64: IdAa64isar1El1, safe, fake::SYSREGS);
16538#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16539read_sysreg!(id_aa64isar2_el1, u64: IdAa64isar2El1, safe, fake::SYSREGS);
16540#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16541read_sysreg!(id_aa64mmfr0_el1, u64: IdAa64mmfr0El1, safe, fake::SYSREGS);
16542#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16543read_sysreg!(id_aa64mmfr1_el1, u64: IdAa64mmfr1El1, safe, fake::SYSREGS);
16544#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16545read_sysreg!(id_aa64mmfr2_el1, u64: IdAa64mmfr2El1, safe, fake::SYSREGS);
16546#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16547read_sysreg!(id_aa64mmfr3_el1, u64: IdAa64mmfr3El1, safe, fake::SYSREGS);
16548#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16549read_sysreg!(id_aa64pfr0_el1, u64: IdAa64pfr0El1, safe, fake::SYSREGS);
16550#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16551read_sysreg!(id_aa64pfr1_el1, u64: IdAa64pfr1El1, safe, fake::SYSREGS);
16552#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16553read_sysreg!(id_aa64smfr0_el1, u64: IdAa64smfr0El1, safe, fake::SYSREGS);
16554#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16555read_sysreg!(id_afr0: (p15, 0, c1, c0, 3), u32, safe, fake::SYSREGS);
16556#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16557read_sysreg!(id_dfr0: (p15, 0, c1, c0, 2), u32: IdDfr0, safe, fake::SYSREGS);
16558#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16559read_sysreg!(id_dfr1: (p15, 0, c3, c0, 5), u32: IdDfr1, safe, fake::SYSREGS);
16560#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16561read_sysreg!(id_isar0: (p15, 0, c2, c0, 0), u32: IdIsar0, safe, fake::SYSREGS);
16562#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16563read_sysreg!(id_isar1: (p15, 0, c2, c0, 1), u32: IdIsar1, safe, fake::SYSREGS);
16564#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16565read_sysreg!(id_isar2: (p15, 0, c2, c0, 2), u32: IdIsar2, safe, fake::SYSREGS);
16566#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16567read_sysreg!(id_isar3: (p15, 0, c2, c0, 3), u32: IdIsar3, safe, fake::SYSREGS);
16568#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16569read_sysreg!(id_isar4: (p15, 0, c2, c0, 4), u32: IdIsar4, safe, fake::SYSREGS);
16570#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16571read_sysreg!(id_isar5: (p15, 0, c2, c0, 5), u32: IdIsar5, safe, fake::SYSREGS);
16572#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16573read_sysreg!(id_isar6: (p15, 0, c2, c0, 7), u32: IdIsar6, safe, fake::SYSREGS);
16574#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16575read_sysreg!(id_mmfr0: (p15, 0, c1, c0, 4), u32: IdMmfr0, safe, fake::SYSREGS);
16576#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16577read_sysreg!(id_mmfr1: (p15, 0, c1, c0, 5), u32: IdMmfr1, safe, fake::SYSREGS);
16578#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16579read_sysreg!(id_mmfr2: (p15, 0, c1, c0, 6), u32: IdMmfr2, safe, fake::SYSREGS);
16580#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16581read_sysreg!(id_mmfr3: (p15, 0, c1, c0, 7), u32: IdMmfr3, safe, fake::SYSREGS);
16582#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16583read_sysreg!(id_mmfr4: (p15, 0, c2, c0, 6), u32: IdMmfr4, safe, fake::SYSREGS);
16584#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16585read_sysreg!(id_mmfr5: (p15, 0, c3, c0, 6), u32: IdMmfr5, safe, fake::SYSREGS);
16586#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16587read_sysreg!(id_pfr0: (p15, 0, c1, c0, 0), u32: IdPfr0, safe, fake::SYSREGS);
16588#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16589read_sysreg!(id_pfr1: (p15, 0, c1, c0, 1), u32: IdPfr1, safe, fake::SYSREGS);
16590#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16591read_sysreg!(id_pfr2: (p15, 0, c3, c0, 4), u32: IdPfr2, safe, fake::SYSREGS);
16592#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16593read_write_sysreg!(ifar: (p15, 0, c0, c6, 2), u32: Ifar, safe_read, fake::SYSREGS);
16594#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16595read_write_sysreg!(ifsr: (p15, 0, c0, c5, 1), u32: Ifsr, safe_read, fake::SYSREGS);
16596#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16597read_sysreg!(isr: (p15, 0, c1, c12, 0), u32: Isr, safe, fake::SYSREGS);
16598#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16599read_sysreg!(isr_el1, u64: IsrEl1, safe, fake::SYSREGS);
16600#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16601read_sysreg!(jidr: (p14, 7, c0, c0, 0), u32, safe, fake::SYSREGS);
16602#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16603read_write_sysreg!(jmcr: (p14, 7, c0, c2, 0), u32, safe_read, fake::SYSREGS);
16604#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16605read_write_sysreg!(joscr: (p14, 7, c0, c1, 0), u32, safe_read, fake::SYSREGS);
16606#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16607read_write_sysreg!(mair0: (p15, 0, c2, c10, 0), u32: Mair0, safe_read, fake::SYSREGS);
16608#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16609read_write_sysreg!(mair1: (p15, 0, c2, c10, 1), u32: Mair1, safe_read, fake::SYSREGS);
16610#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16611read_write_sysreg!(mair_el1, u64: MairEl1, safe_read, fake::SYSREGS);
16612#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16613read_write_sysreg!(mair_el2, u64: MairEl2, safe_read, fake::SYSREGS);
16614#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16615read_write_sysreg! {
16616    /// # Safety
16617    ///
16618    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 memory attribute indirection register.
16619    mair_el3, u64: MairEl3, safe_read, fake::SYSREGS
16620}
16621#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16622read_write_sysreg!(mdccint_el1, u64: MdccintEl1, safe_read, safe_write, fake::SYSREGS);
16623#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16624read_write_sysreg!(mdcr_el2, u64: MdcrEl2, safe_read, safe_write, fake::SYSREGS);
16625#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16626read_write_sysreg!(mdcr_el3, u64: MdcrEl3, safe_read, safe_write, fake::SYSREGS);
16627#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16628read_write_sysreg!(mdscr_el1, u64: MdscrEl1, safe_read, safe_write, fake::SYSREGS);
16629#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16630read_sysreg!(midr: (p15, 0, c0, c0, 0), u32: Midr, safe, fake::SYSREGS);
16631#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16632read_sysreg!(midr_el1, u64: MidrEl1, safe, fake::SYSREGS);
16633#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16634read_write_sysreg!(mpam2_el2: s3_4_c10_c5_0, u64: Mpam2El2, safe_read, fake::SYSREGS);
16635#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16636read_write_sysreg!(mpam3_el3: s3_6_c10_c5_0, u64: Mpam3El3, safe_read, fake::SYSREGS);
16637#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16638read_write_sysreg!(mpamhcr_el2: s3_4_c10_c4_0, u64: MpamhcrEl2, safe_read, fake::SYSREGS);
16639#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16640read_sysreg!(mpamidr_el1: s3_0_c10_c4_4, u64: MpamidrEl1, safe, fake::SYSREGS);
16641#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16642read_write_sysreg!(mpamvpm0_el2: s3_4_c10_c6_0, u64: Mpamvpm0El2, safe_read, fake::SYSREGS);
16643#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16644read_write_sysreg!(mpamvpm1_el2: s3_4_c10_c6_1, u64: Mpamvpm1El2, safe_read, fake::SYSREGS);
16645#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16646read_write_sysreg!(mpamvpm2_el2: s3_4_c10_c6_2, u64: Mpamvpm2El2, safe_read, fake::SYSREGS);
16647#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16648read_write_sysreg!(mpamvpm3_el2: s3_4_c10_c6_3, u64: Mpamvpm3El2, safe_read, fake::SYSREGS);
16649#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16650read_write_sysreg!(mpamvpm4_el2: s3_4_c10_c6_4, u64: Mpamvpm4El2, safe_read, fake::SYSREGS);
16651#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16652read_write_sysreg!(mpamvpm5_el2: s3_4_c10_c6_5, u64: Mpamvpm5El2, safe_read, fake::SYSREGS);
16653#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16654read_write_sysreg!(mpamvpm6_el2: s3_4_c10_c6_6, u64: Mpamvpm6El2, safe_read, fake::SYSREGS);
16655#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16656read_write_sysreg!(mpamvpm7_el2: s3_4_c10_c6_7, u64: Mpamvpm7El2, safe_read, fake::SYSREGS);
16657#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16658read_write_sysreg!(mpamvpmv_el2: s3_4_c10_c4_1, u64: MpamvpmvEl2, safe_read, fake::SYSREGS);
16659#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16660read_sysreg!(mpidr: (p15, 0, c0, c0, 5), u32: Mpidr, safe, fake::SYSREGS);
16661#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16662read_sysreg!(mpidr_el1, u64: MpidrEl1, safe, fake::SYSREGS);
16663#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16664read_write_sysreg!(mvbar: (p15, 0, c0, c12, 1), u32: Mvbar, safe_read, fake::SYSREGS);
16665#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16666read_write_sysreg!(nmrr: (p15, 0, c2, c10, 1), u32: Nmrr, safe_read, fake::SYSREGS);
16667#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16668read_write_sysreg!(nsacr: (p15, 0, c1, c1, 2), u32: Nsacr, safe_read, fake::SYSREGS);
16669#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16670read_write_sysreg!(par: (p15, 0, c7), u64: Par, safe_read, fake::SYSREGS);
16671#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16672read_write_sysreg!(par_el1, u64: ParEl1, safe_read, fake::SYSREGS);
16673#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16674read_write_sysreg!(pmccfiltr: (p15, 0, c15, c14, 7), u32: Pmccfiltr, safe_read, fake::SYSREGS);
16675#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16676read_write_sysreg!(pmccntr: (p15, 0, c9), u64: Pmccntr, safe_read, fake::SYSREGS);
16677#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16678read_sysreg!(pmceid0: (p15, 0, c12, c9, 6), u32: Pmceid0, safe, fake::SYSREGS);
16679#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16680read_sysreg!(pmceid1: (p15, 0, c12, c9, 7), u32: Pmceid1, safe, fake::SYSREGS);
16681#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16682read_sysreg!(pmceid2: (p15, 0, c14, c9, 4), u32: Pmceid2, safe, fake::SYSREGS);
16683#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16684read_sysreg!(pmceid3: (p15, 0, c14, c9, 5), u32: Pmceid3, safe, fake::SYSREGS);
16685#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16686read_write_sysreg!(pmcntenclr: (p15, 0, c12, c9, 2), u32: Pmcntenclr, safe_read, fake::SYSREGS);
16687#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16688read_write_sysreg!(pmcntenset: (p15, 0, c12, c9, 1), u32: Pmcntenset, safe_read, fake::SYSREGS);
16689#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16690read_write_sysreg!(pmcr: (p15, 0, c12, c9, 0), u32: Pmcr, safe_read, fake::SYSREGS);
16691#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16692read_write_sysreg!(pmcr_el0: s3_3_c9_c12_0, u64: PmcrEl0, safe_read, safe_write, fake::SYSREGS);
16693#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16694read_write_sysreg!(pmintenclr: (p15, 0, c14, c9, 2), u32: Pmintenclr, safe_read, fake::SYSREGS);
16695#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16696read_write_sysreg!(pmintenset: (p15, 0, c14, c9, 1), u32: Pmintenset, safe_read, fake::SYSREGS);
16697#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16698read_sysreg!(pmmir: (p15, 0, c14, c9, 6), u32: Pmmir, safe, fake::SYSREGS);
16699#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16700read_write_sysreg!(pmovsr: (p15, 0, c12, c9, 3), u32: Pmovsr, safe_read, fake::SYSREGS);
16701#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16702read_write_sysreg!(pmovsset: (p15, 0, c14, c9, 3), u32: Pmovsset, safe_read, fake::SYSREGS);
16703#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16704read_write_sysreg!(pmselr: (p15, 0, c12, c9, 5), u32: Pmselr, safe_read, fake::SYSREGS);
16705#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16706write_sysreg!(pmswinc: (p15, 0, c12, c9, 4), u32: Pmswinc, fake::SYSREGS);
16707#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16708read_write_sysreg!(pmuserenr: (p15, 0, c14, c9, 0), u32: Pmuserenr, safe_read, fake::SYSREGS);
16709#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16710read_write_sysreg!(pmxevtyper: (p15, 0, c13, c9, 1), u32: Pmxevtyper, safe_read, fake::SYSREGS);
16711#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16712read_write_sysreg!(prrr: (p15, 0, c2, c10, 0), u32: Prrr, safe_read, fake::SYSREGS);
16713#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16714read_sysreg!(revidr: (p15, 0, c0, c0, 6), u32, safe, fake::SYSREGS);
16715#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16716read_write_sysreg!(rgsr_el1: s3_0_c1_c0_5, u64: RgsrEl1, safe_read, safe_write, fake::SYSREGS);
16717#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16718read_write_sysreg!(rmr: (p15, 0, c0, c12, 2), u32: Rmr, safe_read, fake::SYSREGS);
16719#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16720read_sysreg!(rvbar: (p15, 0, c0, c12, 1), u32: Rvbar, safe, fake::SYSREGS);
16721#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16722read_write_sysreg!(scr: (p15, 0, c1, c1, 0), u32: Scr, safe_read, fake::SYSREGS);
16723#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16724read_write_sysreg!(scr_el3, u64: ScrEl3, safe_read, fake::SYSREGS);
16725#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16726read_write_sysreg!(sctlr: (p15, 0, c0, c1, 0), u32: Sctlr, safe_read, fake::SYSREGS);
16727#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16728read_write_sysreg!(sctlr2_el3: s3_6_c1_c0_3, u64: Sctlr2El3, safe_read, fake::SYSREGS);
16729#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16730read_write_sysreg!(sctlr_el1, u64: SctlrEl1, safe_read, fake::SYSREGS);
16731#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16732read_write_sysreg!(sctlr_el2, u64: SctlrEl2, safe_read, fake::SYSREGS);
16733#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16734read_write_sysreg! {
16735    /// # Safety
16736    ///
16737    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 system control register.
16738    sctlr_el3, u64: SctlrEl3, safe_read, fake::SYSREGS
16739}
16740#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16741read_write_sysreg!(sdcr: (p15, 0, c3, c1, 1), u32: Sdcr, safe_read, fake::SYSREGS);
16742#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16743read_write_sysreg!(sder: (p15, 0, c1, c1, 1), u32: Sder, safe_read, fake::SYSREGS);
16744#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16745read_write_sysreg!(smcr_el3: s3_6_c1_c2_6, u64: SmcrEl3, safe_read, fake::SYSREGS);
16746#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16747read_write_sysreg!(spsr_el1, u64: SpsrEl1, safe_read, fake::SYSREGS);
16748#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16749read_write_sysreg!(spsr_el2, u64: SpsrEl2, safe_read, fake::SYSREGS);
16750#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16751read_write_sysreg!(spsr_el3, u64: SpsrEl3, safe_read, fake::SYSREGS);
16752#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16753read_write_sysreg!(sp_el1, u64: SpEl1, safe_read, fake::SYSREGS);
16754#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16755read_write_sysreg!(sp_el2, u64: SpEl2, safe_read, fake::SYSREGS);
16756#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16757read_sysreg!(tcmtr: (p15, 0, c0, c0, 2), u32, safe, fake::SYSREGS);
16758#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16759read_write_sysreg!(tcr2_el1: s3_0_c2_c0_3, u64: Tcr2El1, safe_read, fake::SYSREGS);
16760#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16761read_write_sysreg!(tcr2_el2: s3_4_c2_c0_3, u64: Tcr2El2, safe_read, fake::SYSREGS);
16762#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16763read_write_sysreg!(tcr_el1, u64: TcrEl1, safe_read, fake::SYSREGS);
16764#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16765read_write_sysreg!(tcr_el2, u64: TcrEl2, safe_read, fake::SYSREGS);
16766#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16767read_write_sysreg! {
16768    /// # Safety
16769    ///
16770    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 translation control register.
16771    tcr_el3, u64: TcrEl3, safe_read, fake::SYSREGS
16772}
16773#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16774read_write_sysreg!(tfsre0_el1: s3_0_c5_c6_1, u64: Tfsre0El1, safe_read, safe_write, fake::SYSREGS);
16775#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16776read_write_sysreg!(tfsr_el1: s3_0_c5_c6_0, u64: TfsrEl1, safe_read, safe_write, fake::SYSREGS);
16777#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16778read_write_sysreg!(tfsr_el2: s3_4_c5_c6_0, u64: TfsrEl2, safe_read, safe_write, fake::SYSREGS);
16779#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16780read_sysreg!(tlbtr: (p15, 0, c0, c0, 3), u32: Tlbtr, safe, fake::SYSREGS);
16781#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16782read_write_sysreg!(tpidrprw: (p15, 0, c0, c13, 4), u32: Tpidrprw, safe_read, fake::SYSREGS);
16783#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16784read_write_sysreg!(tpidrro_el0, u64: TpidrroEl0, safe_read, fake::SYSREGS);
16785#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16786read_write_sysreg!(tpidruro: (p15, 0, c0, c13, 3), u32: Tpidruro, safe_read, fake::SYSREGS);
16787#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16788read_write_sysreg!(tpidrurw: (p15, 0, c0, c13, 2), u32: Tpidrurw, safe_read, fake::SYSREGS);
16789#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
16790read_write_sysreg!(tpidr_el0, u64: TpidrEl0, safe_read, fake::SYSREGS);
16791#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16792read_write_sysreg!(tpidr_el1, u64: TpidrEl1, safe_read, fake::SYSREGS);
16793#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16794read_write_sysreg!(tpidr_el2, u64: TpidrEl2, safe_read, fake::SYSREGS);
16795#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16796read_write_sysreg!(trfcr: (p15, 0, c2, c1, 1), u32: Trfcr, safe_read, fake::SYSREGS);
16797#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16798read_write_sysreg!(ttbcr: (p15, 0, c0, c2, 2), u32: Ttbcr, safe_read, fake::SYSREGS);
16799#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16800read_write_sysreg!(ttbcr2: (p15, 0, c0, c2, 3), u32: Ttbcr2, safe_read, fake::SYSREGS);
16801#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16802read_write_sysreg!(ttbr0: (p15, 0, c2), u64: Ttbr0, safe_read, fake::SYSREGS);
16803#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16804read_write_sysreg! {
16805    /// # Safety
16806    ///
16807    /// The base address must point to a valid and properly aligned translation table.
16808    ttbr0_el1, u64: Ttbr0El1, safe_read, fake::SYSREGS
16809}
16810#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16811read_write_sysreg! {
16812    /// # Safety
16813    ///
16814    /// The base address must point to a valid and properly aligned translation table.
16815    ttbr0_el2, u64: Ttbr0El2, safe_read, fake::SYSREGS
16816}
16817#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16818read_write_sysreg! {
16819    /// # Safety
16820    ///
16821    /// The base address must point to a valid and properly aligned translation table.
16822    ttbr0_el3, u64: Ttbr0El3, safe_read, fake::SYSREGS
16823}
16824#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16825read_write_sysreg!(ttbr1: (p15, 1, c2), u64: Ttbr1, safe_read, fake::SYSREGS);
16826#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16827read_write_sysreg! {
16828    /// # Safety
16829    ///
16830    /// The base address must point to a valid and properly aligned translation table.
16831    ttbr1_el1, u64: Ttbr1El1, safe_read, fake::SYSREGS
16832}
16833#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16834read_write_sysreg! {
16835    /// # Safety
16836    ///
16837    /// The base address must point to a valid and properly aligned translation table.
16838    ttbr1_el2, u64: Ttbr1El2, safe_read, fake::SYSREGS
16839}
16840#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16841read_write_sysreg!(vbar: (p15, 0, c0, c12, 0), u32: Vbar, safe_read, fake::SYSREGS);
16842#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
16843read_write_sysreg! {
16844    /// # Safety
16845    ///
16846    /// The base address must point to a valid exception vector.
16847    vbar_el1, u64: VbarEl1, safe_read, fake::SYSREGS
16848}
16849#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16850read_write_sysreg! {
16851    /// # Safety
16852    ///
16853    /// The base address must point to a valid exception vector.
16854    vbar_el2, u64: VbarEl2, safe_read, fake::SYSREGS
16855}
16856#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16857read_write_sysreg!(vdfsr: (p15, 4, c2, c5, 3), u32: Vdfsr, safe_read, fake::SYSREGS);
16858#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16859read_write_sysreg!(vdisr: (p15, 0, c1, c12, 1), u32: Vdisr, safe_read, fake::SYSREGS);
16860#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16861read_write_sysreg!(vdisr_el2: s3_4_c12_c1_1, u64: VdisrEl2, safe_read, safe_write, fake::SYSREGS);
16862#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16863read_write_sysreg!(vmpidr: (p15, 0, c0, c0, 5), u32: Vmpidr, safe_read, fake::SYSREGS);
16864#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16865read_write_sysreg!(vmpidr_el2, u64: VmpidrEl2, safe_read, safe_write, fake::SYSREGS);
16866#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16867read_write_sysreg!(vpidr: (p15, 0, c0, c0, 0), u32: Vpidr, safe_read, fake::SYSREGS);
16868#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16869read_write_sysreg!(vpidr_el2, u64: VpidrEl2, safe_read, safe_write, fake::SYSREGS);
16870#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16871read_write_sysreg!(vsesr_el2: s3_4_c5_c2_3, u64: VsesrEl2, safe_read, safe_write, fake::SYSREGS);
16872#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16873read_write_sysreg!(vtcr: (p15, 4, c1, c2, 2), u32: Vtcr, safe_read, fake::SYSREGS);
16874#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16875read_write_sysreg!(vtcr_el2, u64: VtcrEl2, safe_read, fake::SYSREGS);
16876#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
16877read_write_sysreg!(vttbr: (p15, 6, c2), u64: Vttbr, safe_read, fake::SYSREGS);
16878#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
16879read_write_sysreg! {
16880    /// # Safety
16881    ///
16882    /// The base address must point to a valid and properly aligned stage 2 translation table.
16883    vttbr_el2, u64: VttbrEl2, safe_read, fake::SYSREGS
16884}
16885#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
16886read_write_sysreg!(zcr_el3: s3_6_c1_c2_0, u64: ZcrEl3, safe_read, fake::SYSREGS);