Skip to main content

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, Default, 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    /// Sets the value of the `N` field.
55    pub const fn set_n(&mut self, value: u8) {
56        let offset = Self::N_SHIFT;
57        assert!(value & (Self::N_MASK as u8) == value);
58        *self = Self::from_bits_retain(
59            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
60        );
61    }
62
63    /// Returns the value of the `SIZE` field.
64    pub const fn size(self) -> u8 {
65        ((self.bits() >> Self::SIZE_SHIFT) & 0b111111) as u8
66    }
67
68    /// Sets the value of the `SIZE` field.
69    pub const fn set_size(&mut self, value: u8) {
70        let offset = Self::SIZE_SHIFT;
71        assert!(value & (Self::SIZE_MASK as u8) == value);
72        *self = Self::from_bits_retain(
73            (self.bits() & !(Self::SIZE_MASK << offset)) | ((value as u32) << offset),
74        );
75    }
76
77    /// Returns the value of the `NCG` field.
78    pub const fn ncg(self) -> u8 {
79        ((self.bits() >> Self::NCG_SHIFT) & 0b1111) as u8
80    }
81
82    /// Sets the value of the `NCG` field.
83    pub const fn set_ncg(&mut self, value: u8) {
84        let offset = Self::NCG_SHIFT;
85        assert!(value & (Self::NCG_MASK as u8) == value);
86        *self = Self::from_bits_retain(
87            (self.bits() & !(Self::NCG_MASK << offset)) | ((value as u32) << offset),
88        );
89    }
90}
91
92bitflags! {
93    /// `AMCGCR` system register value.
94    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
95    #[repr(transparent)]
96    pub struct Amcgcr: u32 {
97    }
98}
99
100impl Amcgcr {
101    /// Offset of the `CG0NC` field.
102    pub const CG0NC_SHIFT: u32 = 0;
103    /// Mask for the `CG0NC` field.
104    pub const CG0NC_MASK: u32 = 0b11111111;
105    /// Offset of the `CG1NC` field.
106    pub const CG1NC_SHIFT: u32 = 8;
107    /// Mask for the `CG1NC` field.
108    pub const CG1NC_MASK: u32 = 0b11111111;
109
110    /// Returns the value of the `CG0NC` field.
111    pub const fn cg0nc(self) -> u8 {
112        ((self.bits() >> Self::CG0NC_SHIFT) & 0b11111111) as u8
113    }
114
115    /// Sets the value of the `CG0NC` field.
116    pub const fn set_cg0nc(&mut self, value: u8) {
117        let offset = Self::CG0NC_SHIFT;
118        assert!(value & (Self::CG0NC_MASK as u8) == value);
119        *self = Self::from_bits_retain(
120            (self.bits() & !(Self::CG0NC_MASK << offset)) | ((value as u32) << offset),
121        );
122    }
123
124    /// Returns the value of the `CG1NC` field.
125    pub const fn cg1nc(self) -> u8 {
126        ((self.bits() >> Self::CG1NC_SHIFT) & 0b11111111) as u8
127    }
128
129    /// Sets the value of the `CG1NC` field.
130    pub const fn set_cg1nc(&mut self, value: u8) {
131        let offset = Self::CG1NC_SHIFT;
132        assert!(value & (Self::CG1NC_MASK as u8) == value);
133        *self = Self::from_bits_retain(
134            (self.bits() & !(Self::CG1NC_MASK << offset)) | ((value as u32) << offset),
135        );
136    }
137}
138
139bitflags! {
140    /// `AMCNTENCLR0` system register value.
141    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
142    #[repr(transparent)]
143    pub struct Amcntenclr0: u32 {
144        /// `P<n>` bit 0.
145        const P0 = 1 << 0;
146        /// `P<n>` bit 1.
147        const P1 = 1 << 1;
148        /// `P<n>` bit 2.
149        const P2 = 1 << 2;
150        /// `P<n>` bit 3.
151        const P3 = 1 << 3;
152    }
153}
154
155impl Amcntenclr0 {
156    /// Offset of the `P<n>` field.
157    pub const P_SHIFT: u32 = 0;
158}
159
160bitflags! {
161    /// `AMCNTENCLR1` system register value.
162    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
163    #[repr(transparent)]
164    pub struct Amcntenclr1: 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        /// `P<n>` bit 4.
174        const P4 = 1 << 4;
175        /// `P<n>` bit 5.
176        const P5 = 1 << 5;
177        /// `P<n>` bit 6.
178        const P6 = 1 << 6;
179        /// `P<n>` bit 7.
180        const P7 = 1 << 7;
181        /// `P<n>` bit 8.
182        const P8 = 1 << 8;
183        /// `P<n>` bit 9.
184        const P9 = 1 << 9;
185        /// `P<n>` bit 10.
186        const P10 = 1 << 10;
187        /// `P<n>` bit 11.
188        const P11 = 1 << 11;
189        /// `P<n>` bit 12.
190        const P12 = 1 << 12;
191        /// `P<n>` bit 13.
192        const P13 = 1 << 13;
193        /// `P<n>` bit 14.
194        const P14 = 1 << 14;
195        /// `P<n>` bit 15.
196        const P15 = 1 << 15;
197    }
198}
199
200impl Amcntenclr1 {
201    /// Offset of the `P<n>` field.
202    pub const P_SHIFT: u32 = 0;
203}
204
205bitflags! {
206    /// `AMCNTENSET0` system register value.
207    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
208    #[repr(transparent)]
209    pub struct Amcntenset0: u32 {
210        /// `P<n>` bit 0.
211        const P0 = 1 << 0;
212        /// `P<n>` bit 1.
213        const P1 = 1 << 1;
214        /// `P<n>` bit 2.
215        const P2 = 1 << 2;
216        /// `P<n>` bit 3.
217        const P3 = 1 << 3;
218    }
219}
220
221impl Amcntenset0 {
222    /// Offset of the `P<n>` field.
223    pub const P_SHIFT: u32 = 0;
224}
225
226bitflags! {
227    /// `AMCNTENSET1` system register value.
228    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
229    #[repr(transparent)]
230    pub struct Amcntenset1: u32 {
231        /// `P<n>` bit 0.
232        const P0 = 1 << 0;
233        /// `P<n>` bit 1.
234        const P1 = 1 << 1;
235        /// `P<n>` bit 2.
236        const P2 = 1 << 2;
237        /// `P<n>` bit 3.
238        const P3 = 1 << 3;
239        /// `P<n>` bit 4.
240        const P4 = 1 << 4;
241        /// `P<n>` bit 5.
242        const P5 = 1 << 5;
243        /// `P<n>` bit 6.
244        const P6 = 1 << 6;
245        /// `P<n>` bit 7.
246        const P7 = 1 << 7;
247        /// `P<n>` bit 8.
248        const P8 = 1 << 8;
249        /// `P<n>` bit 9.
250        const P9 = 1 << 9;
251        /// `P<n>` bit 10.
252        const P10 = 1 << 10;
253        /// `P<n>` bit 11.
254        const P11 = 1 << 11;
255        /// `P<n>` bit 12.
256        const P12 = 1 << 12;
257        /// `P<n>` bit 13.
258        const P13 = 1 << 13;
259        /// `P<n>` bit 14.
260        const P14 = 1 << 14;
261        /// `P<n>` bit 15.
262        const P15 = 1 << 15;
263    }
264}
265
266impl Amcntenset1 {
267    /// Offset of the `P<n>` field.
268    pub const P_SHIFT: u32 = 0;
269}
270
271bitflags! {
272    /// `AMCR` system register value.
273    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
274    #[repr(transparent)]
275    pub struct Amcr: u32 {
276        /// `HDBG` bit.
277        const HDBG = 1 << 10;
278        /// `CG1RZ` bit.
279        const CG1RZ = 1 << 17;
280    }
281}
282
283impl Amcr {
284    /// Offset of the `HDBG` field.
285    pub const HDBG_SHIFT: u32 = 10;
286    /// Offset of the `CG1RZ` field.
287    pub const CG1RZ_SHIFT: u32 = 17;
288}
289
290bitflags! {
291    /// `AMUSERENR` system register value.
292    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
293    #[repr(transparent)]
294    pub struct Amuserenr: u32 {
295        /// `EN` bit.
296        const EN = 1 << 0;
297    }
298}
299
300impl Amuserenr {
301    /// Offset of the `EN` field.
302    pub const EN_SHIFT: u32 = 0;
303}
304
305#[cfg(feature = "el1")]
306bitflags! {
307    /// `APIAKeyHi_EL1` system register value.
308    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
309    #[repr(transparent)]
310    pub struct ApiakeyhiEl1: u64 {
311    }
312}
313
314#[cfg(feature = "el1")]
315impl ApiakeyhiEl1 {
316    /// Offset of the `APIAKeyHi` field.
317    pub const APIAKEYHI_SHIFT: u32 = 0;
318    /// Mask for the `APIAKeyHi` field.
319    pub const APIAKEYHI_MASK: u64 =
320        0b1111111111111111111111111111111111111111111111111111111111111111;
321
322    /// Returns the value of the `APIAKeyHi` field.
323    pub const fn apiakeyhi(self) -> u64 {
324        ((self.bits() >> Self::APIAKEYHI_SHIFT)
325            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
326    }
327
328    /// Sets the value of the `APIAKeyHi` field.
329    pub const fn set_apiakeyhi(&mut self, value: u64) {
330        let offset = Self::APIAKEYHI_SHIFT;
331        assert!(value & (Self::APIAKEYHI_MASK as u64) == value);
332        *self = Self::from_bits_retain(
333            (self.bits() & !(Self::APIAKEYHI_MASK << offset)) | ((value as u64) << offset),
334        );
335    }
336}
337
338#[cfg(feature = "el1")]
339bitflags! {
340    /// `APIAKeyLo_EL1` system register value.
341    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
342    #[repr(transparent)]
343    pub struct ApiakeyloEl1: u64 {
344    }
345}
346
347#[cfg(feature = "el1")]
348impl ApiakeyloEl1 {
349    /// Offset of the `APIAKeyLo` field.
350    pub const APIAKEYLO_SHIFT: u32 = 0;
351    /// Mask for the `APIAKeyLo` field.
352    pub const APIAKEYLO_MASK: u64 =
353        0b1111111111111111111111111111111111111111111111111111111111111111;
354
355    /// Returns the value of the `APIAKeyLo` field.
356    pub const fn apiakeylo(self) -> u64 {
357        ((self.bits() >> Self::APIAKEYLO_SHIFT)
358            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
359    }
360
361    /// Sets the value of the `APIAKeyLo` field.
362    pub const fn set_apiakeylo(&mut self, value: u64) {
363        let offset = Self::APIAKEYLO_SHIFT;
364        assert!(value & (Self::APIAKEYLO_MASK as u64) == value);
365        *self = Self::from_bits_retain(
366            (self.bits() & !(Self::APIAKEYLO_MASK << offset)) | ((value as u64) << offset),
367        );
368    }
369}
370
371bitflags! {
372    /// `CCSIDR` system register value.
373    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
374    #[repr(transparent)]
375    pub struct Ccsidr: u32 {
376    }
377}
378
379impl Ccsidr {
380    /// Offset of the `LineSize` field.
381    pub const LINESIZE_SHIFT: u32 = 0;
382    /// Mask for the `LineSize` field.
383    pub const LINESIZE_MASK: u32 = 0b111;
384    /// Offset of the `NumSets` field.
385    pub const NUMSETS_SHIFT: u32 = 13;
386    /// Mask for the `NumSets` field.
387    pub const NUMSETS_MASK: u32 = 0b111111111111111;
388
389    /// Returns the value of the `LineSize` field.
390    pub const fn linesize(self) -> u8 {
391        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
392    }
393
394    /// Sets the value of the `LineSize` field.
395    pub const fn set_linesize(&mut self, value: u8) {
396        let offset = Self::LINESIZE_SHIFT;
397        assert!(value & (Self::LINESIZE_MASK as u8) == value);
398        *self = Self::from_bits_retain(
399            (self.bits() & !(Self::LINESIZE_MASK << offset)) | ((value as u32) << offset),
400        );
401    }
402
403    /// Returns the value of the `NumSets` field.
404    pub const fn numsets(self) -> u16 {
405        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111) as u16
406    }
407
408    /// Sets the value of the `NumSets` field.
409    pub const fn set_numsets(&mut self, value: u16) {
410        let offset = Self::NUMSETS_SHIFT;
411        assert!(value & (Self::NUMSETS_MASK as u16) == value);
412        *self = Self::from_bits_retain(
413            (self.bits() & !(Self::NUMSETS_MASK << offset)) | ((value as u32) << offset),
414        );
415    }
416}
417
418bitflags! {
419    /// `CCSIDR2` system register value.
420    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
421    #[repr(transparent)]
422    pub struct Ccsidr2: u32 {
423    }
424}
425
426impl Ccsidr2 {
427    /// Offset of the `NumSets` field.
428    pub const NUMSETS_SHIFT: u32 = 0;
429    /// Mask for the `NumSets` field.
430    pub const NUMSETS_MASK: u32 = 0b111111111111111111111111;
431
432    /// Returns the value of the `NumSets` field.
433    pub const fn numsets(self) -> u32 {
434        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111111111111) as u32
435    }
436
437    /// Sets the value of the `NumSets` field.
438    pub const fn set_numsets(&mut self, value: u32) {
439        let offset = Self::NUMSETS_SHIFT;
440        assert!(value & (Self::NUMSETS_MASK as u32) == value);
441        *self = Self::from_bits_retain(
442            (self.bits() & !(Self::NUMSETS_MASK << offset)) | ((value as u32) << offset),
443        );
444    }
445}
446
447#[cfg(feature = "el1")]
448bitflags! {
449    /// `CCSIDR_EL1` system register value.
450    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
451    #[repr(transparent)]
452    pub struct CcsidrEl1: u64 {
453    }
454}
455
456#[cfg(feature = "el1")]
457impl CcsidrEl1 {
458    /// Offset of the `LineSize` field.
459    pub const LINESIZE_SHIFT: u32 = 0;
460    /// Mask for the `LineSize` field.
461    pub const LINESIZE_MASK: u64 = 0b111;
462
463    /// Returns the value of the `LineSize` field.
464    pub const fn linesize(self) -> u8 {
465        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
466    }
467
468    /// Sets the value of the `LineSize` field.
469    pub const fn set_linesize(&mut self, value: u8) {
470        let offset = Self::LINESIZE_SHIFT;
471        assert!(value & (Self::LINESIZE_MASK as u8) == value);
472        *self = Self::from_bits_retain(
473            (self.bits() & !(Self::LINESIZE_MASK << offset)) | ((value as u64) << offset),
474        );
475    }
476}
477
478bitflags! {
479    /// `CLIDR` system register value.
480    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
481    #[repr(transparent)]
482    pub struct Clidr: u32 {
483    }
484}
485
486impl Clidr {
487    /// Offset of the `Ctype<n>` field.
488    pub const CTYPE_SHIFT: u32 = 0;
489    /// Mask for the `Ctype<n>` field.
490    pub const CTYPE_MASK: u32 = 0b111;
491    /// Offset of the `LoUIS` field.
492    pub const LOUIS_SHIFT: u32 = 21;
493    /// Mask for the `LoUIS` field.
494    pub const LOUIS_MASK: u32 = 0b111;
495    /// Offset of the `LoC` field.
496    pub const LOC_SHIFT: u32 = 24;
497    /// Mask for the `LoC` field.
498    pub const LOC_MASK: u32 = 0b111;
499    /// Offset of the `LoUU` field.
500    pub const LOUU_SHIFT: u32 = 27;
501    /// Mask for the `LoUU` field.
502    pub const LOUU_MASK: u32 = 0b111;
503    /// Offset of the `ICB` field.
504    pub const ICB_SHIFT: u32 = 30;
505    /// Mask for the `ICB` field.
506    pub const ICB_MASK: u32 = 0b11;
507
508    /// Returns the value of the given `Ctype<n>` field.
509    pub const fn ctype(self, n: u32) -> u8 {
510        assert!(n >= 1 && n < 8);
511        ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8
512    }
513
514    /// Sets the value of the `Ctype<n>` field.
515    pub const fn set_ctype(&mut self, n: u32, value: u8) {
516        assert!(n >= 1 && n < 8);
517        let offset = Self::CTYPE_SHIFT + (n - 1) * 3;
518        assert!(value & (Self::CTYPE_MASK as u8) == value);
519        *self = Self::from_bits_retain(
520            (self.bits() & !(Self::CTYPE_MASK << offset)) | ((value as u32) << offset),
521        );
522    }
523
524    /// Returns the value of the `LoUIS` field.
525    pub const fn louis(self) -> u8 {
526        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
527    }
528
529    /// Sets the value of the `LoUIS` field.
530    pub const fn set_louis(&mut self, value: u8) {
531        let offset = Self::LOUIS_SHIFT;
532        assert!(value & (Self::LOUIS_MASK as u8) == value);
533        *self = Self::from_bits_retain(
534            (self.bits() & !(Self::LOUIS_MASK << offset)) | ((value as u32) << offset),
535        );
536    }
537
538    /// Returns the value of the `LoC` field.
539    pub const fn loc(self) -> u8 {
540        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
541    }
542
543    /// Sets the value of the `LoC` field.
544    pub const fn set_loc(&mut self, value: u8) {
545        let offset = Self::LOC_SHIFT;
546        assert!(value & (Self::LOC_MASK as u8) == value);
547        *self = Self::from_bits_retain(
548            (self.bits() & !(Self::LOC_MASK << offset)) | ((value as u32) << offset),
549        );
550    }
551
552    /// Returns the value of the `LoUU` field.
553    pub const fn louu(self) -> u8 {
554        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
555    }
556
557    /// Sets the value of the `LoUU` field.
558    pub const fn set_louu(&mut self, value: u8) {
559        let offset = Self::LOUU_SHIFT;
560        assert!(value & (Self::LOUU_MASK as u8) == value);
561        *self = Self::from_bits_retain(
562            (self.bits() & !(Self::LOUU_MASK << offset)) | ((value as u32) << offset),
563        );
564    }
565
566    /// Returns the value of the `ICB` field.
567    pub const fn icb(self) -> u8 {
568        ((self.bits() >> Self::ICB_SHIFT) & 0b11) as u8
569    }
570
571    /// Sets the value of the `ICB` field.
572    pub const fn set_icb(&mut self, value: u8) {
573        let offset = Self::ICB_SHIFT;
574        assert!(value & (Self::ICB_MASK as u8) == value);
575        *self = Self::from_bits_retain(
576            (self.bits() & !(Self::ICB_MASK << offset)) | ((value as u32) << offset),
577        );
578    }
579}
580
581#[cfg(feature = "el1")]
582bitflags! {
583    /// `CLIDR_EL1` system register value.
584    ///
585    /// Cache Level ID.
586    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
587    #[repr(transparent)]
588    pub struct ClidrEl1: u64 {
589    }
590}
591
592#[cfg(feature = "el1")]
593impl ClidrEl1 {
594    /// Offset of the `Ctype<n>` field.
595    pub const CTYPE_SHIFT: u32 = 0;
596    /// Mask for the `Ctype<n>` field.
597    pub const CTYPE_MASK: u64 = 0b111;
598    /// Offset of the `LoUIS` field.
599    pub const LOUIS_SHIFT: u32 = 21;
600    /// Mask for the `LoUIS` field.
601    pub const LOUIS_MASK: u64 = 0b111;
602    /// Offset of the `LoC` field.
603    pub const LOC_SHIFT: u32 = 24;
604    /// Mask for the `LoC` field.
605    pub const LOC_MASK: u64 = 0b111;
606    /// Offset of the `LoUU` field.
607    pub const LOUU_SHIFT: u32 = 27;
608    /// Mask for the `LoUU` field.
609    pub const LOUU_MASK: u64 = 0b111;
610    /// Offset of the `ICB` field.
611    pub const ICB_SHIFT: u32 = 30;
612    /// Mask for the `ICB` field.
613    pub const ICB_MASK: u64 = 0b111;
614    /// Offset of the `Ttype<n>` field.
615    pub const TTYPE_SHIFT: u32 = 33;
616    /// Mask for the `Ttype<n>` field.
617    pub const TTYPE_MASK: u64 = 0b11;
618
619    /// Returns the value of the given `Ctype<n>` field.
620    pub fn ctype(self, n: u32) -> crate::manual::CacheType {
621        assert!(n >= 1 && n < 8);
622        crate::manual::CacheType::try_from(
623            ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8,
624        )
625        .unwrap()
626    }
627
628    /// Sets the value of the `Ctype<n>` field.
629    pub fn set_ctype(&mut self, n: u32, value: crate::manual::CacheType) {
630        assert!(n >= 1 && n < 8);
631        let offset = Self::CTYPE_SHIFT + (n - 1) * 3;
632        let value: u8 = value.into();
633        assert!(value & (Self::CTYPE_MASK as u8) == value);
634        *self = Self::from_bits_retain(
635            (self.bits() & !(Self::CTYPE_MASK << offset)) | ((value as u64) << offset),
636        );
637    }
638
639    /// Returns the value of the `LoUIS` field.
640    ///
641    /// Level of Unification Inner Shareable for the cache hierarchy.
642    pub const fn louis(self) -> u8 {
643        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
644    }
645
646    /// Sets the value of the `LoUIS` field.
647    ///
648    /// Level of Unification Inner Shareable for the cache hierarchy.
649    pub const fn set_louis(&mut self, value: u8) {
650        let offset = Self::LOUIS_SHIFT;
651        assert!(value & (Self::LOUIS_MASK as u8) == value);
652        *self = Self::from_bits_retain(
653            (self.bits() & !(Self::LOUIS_MASK << offset)) | ((value as u64) << offset),
654        );
655    }
656
657    /// Returns the value of the `LoC` field.
658    ///
659    /// Level of Coherence for the cache hierarchy.
660    pub const fn loc(self) -> u8 {
661        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
662    }
663
664    /// Sets the value of the `LoC` field.
665    ///
666    /// Level of Coherence for the cache hierarchy.
667    pub const fn set_loc(&mut self, value: u8) {
668        let offset = Self::LOC_SHIFT;
669        assert!(value & (Self::LOC_MASK as u8) == value);
670        *self = Self::from_bits_retain(
671            (self.bits() & !(Self::LOC_MASK << offset)) | ((value as u64) << offset),
672        );
673    }
674
675    /// Returns the value of the `LoUU` field.
676    ///
677    /// Level of Unification Uniprocessor for the cache hierarchy.
678    pub const fn louu(self) -> u8 {
679        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
680    }
681
682    /// Sets the value of the `LoUU` field.
683    ///
684    /// Level of Unification Uniprocessor for the cache hierarchy.
685    pub const fn set_louu(&mut self, value: u8) {
686        let offset = Self::LOUU_SHIFT;
687        assert!(value & (Self::LOUU_MASK as u8) == value);
688        *self = Self::from_bits_retain(
689            (self.bits() & !(Self::LOUU_MASK << offset)) | ((value as u64) << offset),
690        );
691    }
692
693    /// Returns the value of the `ICB` field.
694    ///
695    /// Inner cache boundary level.
696    pub const fn icb(self) -> u8 {
697        ((self.bits() >> Self::ICB_SHIFT) & 0b111) as u8
698    }
699
700    /// Sets the value of the `ICB` field.
701    ///
702    /// Inner cache boundary level.
703    pub const fn set_icb(&mut self, value: u8) {
704        let offset = Self::ICB_SHIFT;
705        assert!(value & (Self::ICB_MASK as u8) == value);
706        *self = Self::from_bits_retain(
707            (self.bits() & !(Self::ICB_MASK << offset)) | ((value as u64) << offset),
708        );
709    }
710
711    /// Returns the value of the given `Ttype<n>` field.
712    pub const fn ttype(self, n: u32) -> u8 {
713        assert!(n >= 1 && n < 8);
714        ((self.bits() >> (Self::TTYPE_SHIFT + (n - 1) * 2)) & 0b11) as u8
715    }
716
717    /// Sets the value of the `Ttype<n>` field.
718    pub const fn set_ttype(&mut self, n: u32, value: u8) {
719        assert!(n >= 1 && n < 8);
720        let offset = Self::TTYPE_SHIFT + (n - 1) * 2;
721        assert!(value & (Self::TTYPE_MASK as u8) == value);
722        *self = Self::from_bits_retain(
723            (self.bits() & !(Self::TTYPE_MASK << offset)) | ((value as u64) << offset),
724        );
725    }
726}
727
728bitflags! {
729    /// `CNTFRQ` system register value.
730    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
731    #[repr(transparent)]
732    pub struct Cntfrq: u32 {
733    }
734}
735
736impl Cntfrq {
737    /// Offset of the `ClockFreq` field.
738    pub const CLOCKFREQ_SHIFT: u32 = 0;
739    /// Mask for the `ClockFreq` field.
740    pub const CLOCKFREQ_MASK: u32 = 0b11111111111111111111111111111111;
741
742    /// Returns the value of the `ClockFreq` field.
743    pub const fn clockfreq(self) -> u32 {
744        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
745    }
746
747    /// Sets the value of the `ClockFreq` field.
748    pub const fn set_clockfreq(&mut self, value: u32) {
749        let offset = Self::CLOCKFREQ_SHIFT;
750        assert!(value & (Self::CLOCKFREQ_MASK as u32) == value);
751        *self = Self::from_bits_retain(
752            (self.bits() & !(Self::CLOCKFREQ_MASK << offset)) | ((value as u32) << offset),
753        );
754    }
755}
756
757bitflags! {
758    /// `CNTFRQ_EL0` system register value.
759    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
760    #[repr(transparent)]
761    pub struct CntfrqEl0: u64 {
762    }
763}
764
765impl CntfrqEl0 {
766    /// Offset of the `ClockFreq` field.
767    pub const CLOCKFREQ_SHIFT: u32 = 0;
768    /// Mask for the `ClockFreq` field.
769    pub const CLOCKFREQ_MASK: u64 = 0b11111111111111111111111111111111;
770
771    /// Returns the value of the `ClockFreq` field.
772    pub const fn clockfreq(self) -> u32 {
773        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
774    }
775
776    /// Sets the value of the `ClockFreq` field.
777    pub const fn set_clockfreq(&mut self, value: u32) {
778        let offset = Self::CLOCKFREQ_SHIFT;
779        assert!(value & (Self::CLOCKFREQ_MASK as u32) == value);
780        *self = Self::from_bits_retain(
781            (self.bits() & !(Self::CLOCKFREQ_MASK << offset)) | ((value as u64) << offset),
782        );
783    }
784}
785
786bitflags! {
787    /// `CNTHCTL` system register value.
788    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
789    #[repr(transparent)]
790    pub struct Cnthctl: u32 {
791        /// `PL1PCTEN` bit.
792        const PL1PCTEN = 1 << 0;
793        /// `PL1PCEN` bit.
794        const PL1PCEN = 1 << 1;
795        /// `EVNTEN` bit.
796        const EVNTEN = 1 << 2;
797        /// `EVNTDIR` bit.
798        const EVNTDIR = 1 << 3;
799        /// `EVNTIS` bit.
800        const EVNTIS = 1 << 17;
801    }
802}
803
804impl Cnthctl {
805    /// Offset of the `PL1PCTEN` field.
806    pub const PL1PCTEN_SHIFT: u32 = 0;
807    /// Offset of the `PL1PCEN` field.
808    pub const PL1PCEN_SHIFT: u32 = 1;
809    /// Offset of the `EVNTEN` field.
810    pub const EVNTEN_SHIFT: u32 = 2;
811    /// Offset of the `EVNTDIR` field.
812    pub const EVNTDIR_SHIFT: u32 = 3;
813    /// Offset of the `EVNTI` field.
814    pub const EVNTI_SHIFT: u32 = 4;
815    /// Mask for the `EVNTI` field.
816    pub const EVNTI_MASK: u32 = 0b1111;
817    /// Offset of the `EVNTIS` field.
818    pub const EVNTIS_SHIFT: u32 = 17;
819
820    /// Returns the value of the `EVNTI` field.
821    pub const fn evnti(self) -> u8 {
822        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
823    }
824
825    /// Sets the value of the `EVNTI` field.
826    pub const fn set_evnti(&mut self, value: u8) {
827        let offset = Self::EVNTI_SHIFT;
828        assert!(value & (Self::EVNTI_MASK as u8) == value);
829        *self = Self::from_bits_retain(
830            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u32) << offset),
831        );
832    }
833}
834
835#[cfg(feature = "el2")]
836bitflags! {
837    /// `CNTHCTL_EL2` system register value.
838    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
839    #[repr(transparent)]
840    pub struct CnthctlEl2: u64 {
841        /// `EL0PCTEN` bit.
842        const EL0PCTEN = 1 << 0;
843        /// `EL0VCTEN` bit.
844        const EL0VCTEN = 1 << 1;
845        /// `EL1PCEN` bit.
846        const EL1PCEN = 1 << 1;
847        /// `EVNTEN` bit.
848        const EVNTEN = 1 << 2;
849        /// `EVNTDIR` bit.
850        const EVNTDIR = 1 << 3;
851        /// `EL0VTEN` bit.
852        const EL0VTEN = 1 << 8;
853        /// `EL0PTEN` bit.
854        const EL0PTEN = 1 << 9;
855        /// `EL1PTEN` bit.
856        const EL1PTEN = 1 << 11;
857        /// `ECV` bit.
858        const ECV = 1 << 12;
859        /// `EL1TVT` bit.
860        const EL1TVT = 1 << 13;
861        /// `EL1TVCT` bit.
862        const EL1TVCT = 1 << 14;
863        /// `EL1NVPCT` bit.
864        const EL1NVPCT = 1 << 15;
865        /// `EL1NVVCT` bit.
866        const EL1NVVCT = 1 << 16;
867        /// `EVNTIS` bit.
868        const EVNTIS = 1 << 17;
869        /// `CNTVMASK` bit.
870        const CNTVMASK = 1 << 18;
871        /// `CNTPMASK` bit.
872        const CNTPMASK = 1 << 19;
873    }
874}
875
876#[cfg(feature = "el2")]
877impl CnthctlEl2 {
878    /// Offset of the `EL0PCTEN` field.
879    pub const EL0PCTEN_SHIFT: u32 = 0;
880    /// Offset of the `EL0VCTEN` field.
881    pub const EL0VCTEN_SHIFT: u32 = 1;
882    /// Offset of the `EL1PCEN` field.
883    pub const EL1PCEN_SHIFT: u32 = 1;
884    /// Offset of the `EVNTEN` field.
885    pub const EVNTEN_SHIFT: u32 = 2;
886    /// Offset of the `EVNTDIR` field.
887    pub const EVNTDIR_SHIFT: u32 = 3;
888    /// Offset of the `EVNTI` field.
889    pub const EVNTI_SHIFT: u32 = 4;
890    /// Mask for the `EVNTI` field.
891    pub const EVNTI_MASK: u64 = 0b1111;
892    /// Offset of the `EL0VTEN` field.
893    pub const EL0VTEN_SHIFT: u32 = 8;
894    /// Offset of the `EL0PTEN` field.
895    pub const EL0PTEN_SHIFT: u32 = 9;
896    /// Offset of the `EL1PTEN` field.
897    pub const EL1PTEN_SHIFT: u32 = 11;
898    /// Offset of the `ECV` field.
899    pub const ECV_SHIFT: u32 = 12;
900    /// Offset of the `EL1TVT` field.
901    pub const EL1TVT_SHIFT: u32 = 13;
902    /// Offset of the `EL1TVCT` field.
903    pub const EL1TVCT_SHIFT: u32 = 14;
904    /// Offset of the `EL1NVPCT` field.
905    pub const EL1NVPCT_SHIFT: u32 = 15;
906    /// Offset of the `EL1NVVCT` field.
907    pub const EL1NVVCT_SHIFT: u32 = 16;
908    /// Offset of the `EVNTIS` field.
909    pub const EVNTIS_SHIFT: u32 = 17;
910    /// Offset of the `CNTVMASK` field.
911    pub const CNTVMASK_SHIFT: u32 = 18;
912    /// Offset of the `CNTPMASK` field.
913    pub const CNTPMASK_SHIFT: u32 = 19;
914
915    /// Returns the value of the `EVNTI` field.
916    pub const fn evnti(self) -> u8 {
917        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
918    }
919
920    /// Sets the value of the `EVNTI` field.
921    pub const fn set_evnti(&mut self, value: u8) {
922        let offset = Self::EVNTI_SHIFT;
923        assert!(value & (Self::EVNTI_MASK as u8) == value);
924        *self = Self::from_bits_retain(
925            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u64) << offset),
926        );
927    }
928}
929
930bitflags! {
931    /// `CNTHPS_CTL` system register value.
932    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
933    #[repr(transparent)]
934    pub struct CnthpsCtl: u32 {
935        /// `ENABLE` bit.
936        const ENABLE = 1 << 0;
937        /// `IMASK` bit.
938        const IMASK = 1 << 1;
939        /// `ISTATUS` bit.
940        const ISTATUS = 1 << 2;
941    }
942}
943
944impl CnthpsCtl {
945    /// Offset of the `ENABLE` field.
946    pub const ENABLE_SHIFT: u32 = 0;
947    /// Offset of the `IMASK` field.
948    pub const IMASK_SHIFT: u32 = 1;
949    /// Offset of the `ISTATUS` field.
950    pub const ISTATUS_SHIFT: u32 = 2;
951}
952
953bitflags! {
954    /// `CNTHPS_CVAL` system register value.
955    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
956    #[repr(transparent)]
957    pub struct CnthpsCval: u64 {
958    }
959}
960
961impl CnthpsCval {
962    /// Offset of the `CompareValue` field.
963    pub const COMPAREVALUE_SHIFT: u32 = 0;
964    /// Mask for the `CompareValue` field.
965    pub const COMPAREVALUE_MASK: u64 =
966        0b1111111111111111111111111111111111111111111111111111111111111111;
967
968    /// Returns the value of the `CompareValue` field.
969    pub const fn comparevalue(self) -> u64 {
970        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
971            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
972    }
973
974    /// Sets the value of the `CompareValue` field.
975    pub const fn set_comparevalue(&mut self, value: u64) {
976        let offset = Self::COMPAREVALUE_SHIFT;
977        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
978        *self = Self::from_bits_retain(
979            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
980        );
981    }
982}
983
984bitflags! {
985    /// `CNTHPS_TVAL` system register value.
986    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
987    #[repr(transparent)]
988    pub struct CnthpsTval: u32 {
989    }
990}
991
992impl CnthpsTval {
993    /// Offset of the `TimerValue` field.
994    pub const TIMERVALUE_SHIFT: u32 = 0;
995    /// Mask for the `TimerValue` field.
996    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
997
998    /// Returns the value of the `TimerValue` field.
999    pub const fn timervalue(self) -> u32 {
1000        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1001    }
1002
1003    /// Sets the value of the `TimerValue` field.
1004    pub const fn set_timervalue(&mut self, value: u32) {
1005        let offset = Self::TIMERVALUE_SHIFT;
1006        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1007        *self = Self::from_bits_retain(
1008            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1009        );
1010    }
1011}
1012
1013bitflags! {
1014    /// `CNTHP_CTL` system register value.
1015    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1016    #[repr(transparent)]
1017    pub struct CnthpCtl: u32 {
1018        /// `ENABLE` bit.
1019        const ENABLE = 1 << 0;
1020        /// `IMASK` bit.
1021        const IMASK = 1 << 1;
1022        /// `ISTATUS` bit.
1023        const ISTATUS = 1 << 2;
1024    }
1025}
1026
1027impl CnthpCtl {
1028    /// Offset of the `ENABLE` field.
1029    pub const ENABLE_SHIFT: u32 = 0;
1030    /// Offset of the `IMASK` field.
1031    pub const IMASK_SHIFT: u32 = 1;
1032    /// Offset of the `ISTATUS` field.
1033    pub const ISTATUS_SHIFT: u32 = 2;
1034}
1035
1036bitflags! {
1037    /// `CNTHP_CVAL` system register value.
1038    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1039    #[repr(transparent)]
1040    pub struct CnthpCval: u64 {
1041    }
1042}
1043
1044impl CnthpCval {
1045    /// Offset of the `CompareValue` field.
1046    pub const COMPAREVALUE_SHIFT: u32 = 0;
1047    /// Mask for the `CompareValue` field.
1048    pub const COMPAREVALUE_MASK: u64 =
1049        0b1111111111111111111111111111111111111111111111111111111111111111;
1050
1051    /// Returns the value of the `CompareValue` field.
1052    pub const fn comparevalue(self) -> u64 {
1053        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1054            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1055    }
1056
1057    /// Sets the value of the `CompareValue` field.
1058    pub const fn set_comparevalue(&mut self, value: u64) {
1059        let offset = Self::COMPAREVALUE_SHIFT;
1060        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1061        *self = Self::from_bits_retain(
1062            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1063        );
1064    }
1065}
1066
1067bitflags! {
1068    /// `CNTHP_TVAL` system register value.
1069    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1070    #[repr(transparent)]
1071    pub struct CnthpTval: u32 {
1072    }
1073}
1074
1075impl CnthpTval {
1076    /// Offset of the `TimerValue` field.
1077    pub const TIMERVALUE_SHIFT: u32 = 0;
1078    /// Mask for the `TimerValue` field.
1079    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1080
1081    /// Returns the value of the `TimerValue` field.
1082    pub const fn timervalue(self) -> u32 {
1083        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1084    }
1085
1086    /// Sets the value of the `TimerValue` field.
1087    pub const fn set_timervalue(&mut self, value: u32) {
1088        let offset = Self::TIMERVALUE_SHIFT;
1089        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1090        *self = Self::from_bits_retain(
1091            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1092        );
1093    }
1094}
1095
1096bitflags! {
1097    /// `CNTHVS_CTL` system register value.
1098    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1099    #[repr(transparent)]
1100    pub struct CnthvsCtl: u32 {
1101        /// `ENABLE` bit.
1102        const ENABLE = 1 << 0;
1103        /// `IMASK` bit.
1104        const IMASK = 1 << 1;
1105        /// `ISTATUS` bit.
1106        const ISTATUS = 1 << 2;
1107    }
1108}
1109
1110impl CnthvsCtl {
1111    /// Offset of the `ENABLE` field.
1112    pub const ENABLE_SHIFT: u32 = 0;
1113    /// Offset of the `IMASK` field.
1114    pub const IMASK_SHIFT: u32 = 1;
1115    /// Offset of the `ISTATUS` field.
1116    pub const ISTATUS_SHIFT: u32 = 2;
1117}
1118
1119bitflags! {
1120    /// `CNTHVS_CVAL` system register value.
1121    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1122    #[repr(transparent)]
1123    pub struct CnthvsCval: u64 {
1124    }
1125}
1126
1127impl CnthvsCval {
1128    /// Offset of the `CompareValue` field.
1129    pub const COMPAREVALUE_SHIFT: u32 = 0;
1130    /// Mask for the `CompareValue` field.
1131    pub const COMPAREVALUE_MASK: u64 =
1132        0b1111111111111111111111111111111111111111111111111111111111111111;
1133
1134    /// Returns the value of the `CompareValue` field.
1135    pub const fn comparevalue(self) -> u64 {
1136        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1137            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1138    }
1139
1140    /// Sets the value of the `CompareValue` field.
1141    pub const fn set_comparevalue(&mut self, value: u64) {
1142        let offset = Self::COMPAREVALUE_SHIFT;
1143        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1144        *self = Self::from_bits_retain(
1145            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1146        );
1147    }
1148}
1149
1150bitflags! {
1151    /// `CNTHVS_TVAL` system register value.
1152    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1153    #[repr(transparent)]
1154    pub struct CnthvsTval: u32 {
1155    }
1156}
1157
1158impl CnthvsTval {
1159    /// Offset of the `TimerValue` field.
1160    pub const TIMERVALUE_SHIFT: u32 = 0;
1161    /// Mask for the `TimerValue` field.
1162    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1163
1164    /// Returns the value of the `TimerValue` field.
1165    pub const fn timervalue(self) -> u32 {
1166        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1167    }
1168
1169    /// Sets the value of the `TimerValue` field.
1170    pub const fn set_timervalue(&mut self, value: u32) {
1171        let offset = Self::TIMERVALUE_SHIFT;
1172        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1173        *self = Self::from_bits_retain(
1174            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1175        );
1176    }
1177}
1178
1179bitflags! {
1180    /// `CNTHV_CTL` system register value.
1181    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1182    #[repr(transparent)]
1183    pub struct CnthvCtl: u32 {
1184        /// `ENABLE` bit.
1185        const ENABLE = 1 << 0;
1186        /// `IMASK` bit.
1187        const IMASK = 1 << 1;
1188        /// `ISTATUS` bit.
1189        const ISTATUS = 1 << 2;
1190    }
1191}
1192
1193impl CnthvCtl {
1194    /// Offset of the `ENABLE` field.
1195    pub const ENABLE_SHIFT: u32 = 0;
1196    /// Offset of the `IMASK` field.
1197    pub const IMASK_SHIFT: u32 = 1;
1198    /// Offset of the `ISTATUS` field.
1199    pub const ISTATUS_SHIFT: u32 = 2;
1200}
1201
1202bitflags! {
1203    /// `CNTHV_CVAL` system register value.
1204    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1205    #[repr(transparent)]
1206    pub struct CnthvCval: u64 {
1207    }
1208}
1209
1210impl CnthvCval {
1211    /// Offset of the `CompareValue` field.
1212    pub const COMPAREVALUE_SHIFT: u32 = 0;
1213    /// Mask for the `CompareValue` field.
1214    pub const COMPAREVALUE_MASK: u64 =
1215        0b1111111111111111111111111111111111111111111111111111111111111111;
1216
1217    /// Returns the value of the `CompareValue` field.
1218    pub const fn comparevalue(self) -> u64 {
1219        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1220            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1221    }
1222
1223    /// Sets the value of the `CompareValue` field.
1224    pub const fn set_comparevalue(&mut self, value: u64) {
1225        let offset = Self::COMPAREVALUE_SHIFT;
1226        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1227        *self = Self::from_bits_retain(
1228            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1229        );
1230    }
1231}
1232
1233bitflags! {
1234    /// `CNTHV_TVAL` system register value.
1235    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1236    #[repr(transparent)]
1237    pub struct CnthvTval: u32 {
1238    }
1239}
1240
1241impl CnthvTval {
1242    /// Offset of the `TimerValue` field.
1243    pub const TIMERVALUE_SHIFT: u32 = 0;
1244    /// Mask for the `TimerValue` field.
1245    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1246
1247    /// Returns the value of the `TimerValue` field.
1248    pub const fn timervalue(self) -> u32 {
1249        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1250    }
1251
1252    /// Sets the value of the `TimerValue` field.
1253    pub const fn set_timervalue(&mut self, value: u32) {
1254        let offset = Self::TIMERVALUE_SHIFT;
1255        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1256        *self = Self::from_bits_retain(
1257            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1258        );
1259    }
1260}
1261
1262bitflags! {
1263    /// `CNTKCTL` system register value.
1264    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1265    #[repr(transparent)]
1266    pub struct Cntkctl: u32 {
1267        /// `PL0PCTEN` bit.
1268        const PL0PCTEN = 1 << 0;
1269        /// `PL0VCTEN` bit.
1270        const PL0VCTEN = 1 << 1;
1271        /// `EVNTEN` bit.
1272        const EVNTEN = 1 << 2;
1273        /// `EVNTDIR` bit.
1274        const EVNTDIR = 1 << 3;
1275        /// `PL0VTEN` bit.
1276        const PL0VTEN = 1 << 8;
1277        /// `PL0PTEN` bit.
1278        const PL0PTEN = 1 << 9;
1279        /// `EVNTIS` bit.
1280        const EVNTIS = 1 << 17;
1281    }
1282}
1283
1284impl Cntkctl {
1285    /// Offset of the `PL0PCTEN` field.
1286    pub const PL0PCTEN_SHIFT: u32 = 0;
1287    /// Offset of the `PL0VCTEN` field.
1288    pub const PL0VCTEN_SHIFT: u32 = 1;
1289    /// Offset of the `EVNTEN` field.
1290    pub const EVNTEN_SHIFT: u32 = 2;
1291    /// Offset of the `EVNTDIR` field.
1292    pub const EVNTDIR_SHIFT: u32 = 3;
1293    /// Offset of the `EVNTI` field.
1294    pub const EVNTI_SHIFT: u32 = 4;
1295    /// Mask for the `EVNTI` field.
1296    pub const EVNTI_MASK: u32 = 0b1111;
1297    /// Offset of the `PL0VTEN` field.
1298    pub const PL0VTEN_SHIFT: u32 = 8;
1299    /// Offset of the `PL0PTEN` field.
1300    pub const PL0PTEN_SHIFT: u32 = 9;
1301    /// Offset of the `EVNTIS` field.
1302    pub const EVNTIS_SHIFT: u32 = 17;
1303
1304    /// Returns the value of the `EVNTI` field.
1305    pub const fn evnti(self) -> u8 {
1306        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
1307    }
1308
1309    /// Sets the value of the `EVNTI` field.
1310    pub const fn set_evnti(&mut self, value: u8) {
1311        let offset = Self::EVNTI_SHIFT;
1312        assert!(value & (Self::EVNTI_MASK as u8) == value);
1313        *self = Self::from_bits_retain(
1314            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u32) << offset),
1315        );
1316    }
1317}
1318
1319bitflags! {
1320    /// `CNTPCT` system register value.
1321    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1322    #[repr(transparent)]
1323    pub struct Cntpct: u64 {
1324    }
1325}
1326
1327impl Cntpct {
1328    /// Offset of the `PhysicalCount` field.
1329    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
1330    /// Mask for the `PhysicalCount` field.
1331    pub const PHYSICALCOUNT_MASK: u64 =
1332        0b1111111111111111111111111111111111111111111111111111111111111111;
1333
1334    /// Returns the value of the `PhysicalCount` field.
1335    pub const fn physicalcount(self) -> u64 {
1336        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
1337            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1338    }
1339
1340    /// Sets the value of the `PhysicalCount` field.
1341    pub const fn set_physicalcount(&mut self, value: u64) {
1342        let offset = Self::PHYSICALCOUNT_SHIFT;
1343        assert!(value & (Self::PHYSICALCOUNT_MASK as u64) == value);
1344        *self = Self::from_bits_retain(
1345            (self.bits() & !(Self::PHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
1346        );
1347    }
1348}
1349
1350bitflags! {
1351    /// `CNTPCTSS` system register value.
1352    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1353    #[repr(transparent)]
1354    pub struct Cntpctss: u64 {
1355    }
1356}
1357
1358impl Cntpctss {
1359    /// Offset of the `SSPhysicalCount` field.
1360    pub const SSPHYSICALCOUNT_SHIFT: u32 = 0;
1361    /// Mask for the `SSPhysicalCount` field.
1362    pub const SSPHYSICALCOUNT_MASK: u64 =
1363        0b1111111111111111111111111111111111111111111111111111111111111111;
1364
1365    /// Returns the value of the `SSPhysicalCount` field.
1366    pub const fn ssphysicalcount(self) -> u64 {
1367        ((self.bits() >> Self::SSPHYSICALCOUNT_SHIFT)
1368            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1369    }
1370
1371    /// Sets the value of the `SSPhysicalCount` field.
1372    pub const fn set_ssphysicalcount(&mut self, value: u64) {
1373        let offset = Self::SSPHYSICALCOUNT_SHIFT;
1374        assert!(value & (Self::SSPHYSICALCOUNT_MASK as u64) == value);
1375        *self = Self::from_bits_retain(
1376            (self.bits() & !(Self::SSPHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
1377        );
1378    }
1379}
1380
1381bitflags! {
1382    /// `CNTPCT_EL0` system register value.
1383    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1384    #[repr(transparent)]
1385    pub struct CntpctEl0: u64 {
1386    }
1387}
1388
1389impl CntpctEl0 {
1390    /// Offset of the `PhysicalCount` field.
1391    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
1392    /// Mask for the `PhysicalCount` field.
1393    pub const PHYSICALCOUNT_MASK: u64 =
1394        0b1111111111111111111111111111111111111111111111111111111111111111;
1395
1396    /// Returns the value of the `PhysicalCount` field.
1397    pub const fn physicalcount(self) -> u64 {
1398        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
1399            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1400    }
1401
1402    /// Sets the value of the `PhysicalCount` field.
1403    pub const fn set_physicalcount(&mut self, value: u64) {
1404        let offset = Self::PHYSICALCOUNT_SHIFT;
1405        assert!(value & (Self::PHYSICALCOUNT_MASK as u64) == value);
1406        *self = Self::from_bits_retain(
1407            (self.bits() & !(Self::PHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
1408        );
1409    }
1410}
1411
1412bitflags! {
1413    /// `CNTP_CTL` system register value.
1414    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1415    #[repr(transparent)]
1416    pub struct CntpCtl: u32 {
1417        /// `ENABLE` bit.
1418        const ENABLE = 1 << 0;
1419        /// `IMASK` bit.
1420        const IMASK = 1 << 1;
1421        /// `ISTATUS` bit.
1422        const ISTATUS = 1 << 2;
1423    }
1424}
1425
1426impl CntpCtl {
1427    /// Offset of the `ENABLE` field.
1428    pub const ENABLE_SHIFT: u32 = 0;
1429    /// Offset of the `IMASK` field.
1430    pub const IMASK_SHIFT: u32 = 1;
1431    /// Offset of the `ISTATUS` field.
1432    pub const ISTATUS_SHIFT: u32 = 2;
1433}
1434
1435bitflags! {
1436    /// `CNTP_CVAL` system register value.
1437    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1438    #[repr(transparent)]
1439    pub struct CntpCval: u64 {
1440    }
1441}
1442
1443impl CntpCval {
1444    /// Offset of the `CompareValue` field.
1445    pub const COMPAREVALUE_SHIFT: u32 = 0;
1446    /// Mask for the `CompareValue` field.
1447    pub const COMPAREVALUE_MASK: u64 =
1448        0b1111111111111111111111111111111111111111111111111111111111111111;
1449
1450    /// Returns the value of the `CompareValue` field.
1451    pub const fn comparevalue(self) -> u64 {
1452        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1453            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1454    }
1455
1456    /// Sets the value of the `CompareValue` field.
1457    pub const fn set_comparevalue(&mut self, value: u64) {
1458        let offset = Self::COMPAREVALUE_SHIFT;
1459        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1460        *self = Self::from_bits_retain(
1461            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1462        );
1463    }
1464}
1465
1466bitflags! {
1467    /// `CNTP_TVAL` system register value.
1468    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1469    #[repr(transparent)]
1470    pub struct CntpTval: u32 {
1471    }
1472}
1473
1474impl CntpTval {
1475    /// Offset of the `TimerValue` field.
1476    pub const TIMERVALUE_SHIFT: u32 = 0;
1477    /// Mask for the `TimerValue` field.
1478    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1479
1480    /// Returns the value of the `TimerValue` field.
1481    pub const fn timervalue(self) -> u32 {
1482        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1483    }
1484
1485    /// Sets the value of the `TimerValue` field.
1486    pub const fn set_timervalue(&mut self, value: u32) {
1487        let offset = Self::TIMERVALUE_SHIFT;
1488        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1489        *self = Self::from_bits_retain(
1490            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1491        );
1492    }
1493}
1494
1495bitflags! {
1496    /// `CNTVCT` system register value.
1497    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1498    #[repr(transparent)]
1499    pub struct Cntvct: u64 {
1500    }
1501}
1502
1503impl Cntvct {
1504    /// Offset of the `VirtualCount` field.
1505    pub const VIRTUALCOUNT_SHIFT: u32 = 0;
1506    /// Mask for the `VirtualCount` field.
1507    pub const VIRTUALCOUNT_MASK: u64 =
1508        0b1111111111111111111111111111111111111111111111111111111111111111;
1509
1510    /// Returns the value of the `VirtualCount` field.
1511    pub const fn virtualcount(self) -> u64 {
1512        ((self.bits() >> Self::VIRTUALCOUNT_SHIFT)
1513            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1514    }
1515
1516    /// Sets the value of the `VirtualCount` field.
1517    pub const fn set_virtualcount(&mut self, value: u64) {
1518        let offset = Self::VIRTUALCOUNT_SHIFT;
1519        assert!(value & (Self::VIRTUALCOUNT_MASK as u64) == value);
1520        *self = Self::from_bits_retain(
1521            (self.bits() & !(Self::VIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
1522        );
1523    }
1524}
1525
1526bitflags! {
1527    /// `CNTVCTSS` system register value.
1528    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1529    #[repr(transparent)]
1530    pub struct Cntvctss: u64 {
1531    }
1532}
1533
1534impl Cntvctss {
1535    /// Offset of the `SSVirtualCount` field.
1536    pub const SSVIRTUALCOUNT_SHIFT: u32 = 0;
1537    /// Mask for the `SSVirtualCount` field.
1538    pub const SSVIRTUALCOUNT_MASK: u64 =
1539        0b1111111111111111111111111111111111111111111111111111111111111111;
1540
1541    /// Returns the value of the `SSVirtualCount` field.
1542    pub const fn ssvirtualcount(self) -> u64 {
1543        ((self.bits() >> Self::SSVIRTUALCOUNT_SHIFT)
1544            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1545    }
1546
1547    /// Sets the value of the `SSVirtualCount` field.
1548    pub const fn set_ssvirtualcount(&mut self, value: u64) {
1549        let offset = Self::SSVIRTUALCOUNT_SHIFT;
1550        assert!(value & (Self::SSVIRTUALCOUNT_MASK as u64) == value);
1551        *self = Self::from_bits_retain(
1552            (self.bits() & !(Self::SSVIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
1553        );
1554    }
1555}
1556
1557bitflags! {
1558    /// `CNTVOFF` system register value.
1559    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1560    #[repr(transparent)]
1561    pub struct Cntvoff: u64 {
1562    }
1563}
1564
1565impl Cntvoff {
1566    /// Offset of the `VOffset` field.
1567    pub const VOFFSET_SHIFT: u32 = 0;
1568    /// Mask for the `VOffset` field.
1569    pub const VOFFSET_MASK: u64 =
1570        0b1111111111111111111111111111111111111111111111111111111111111111;
1571
1572    /// Returns the value of the `VOffset` field.
1573    pub const fn voffset(self) -> u64 {
1574        ((self.bits() >> Self::VOFFSET_SHIFT)
1575            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1576    }
1577
1578    /// Sets the value of the `VOffset` field.
1579    pub const fn set_voffset(&mut self, value: u64) {
1580        let offset = Self::VOFFSET_SHIFT;
1581        assert!(value & (Self::VOFFSET_MASK as u64) == value);
1582        *self = Self::from_bits_retain(
1583            (self.bits() & !(Self::VOFFSET_MASK << offset)) | ((value as u64) << offset),
1584        );
1585    }
1586}
1587
1588#[cfg(feature = "el2")]
1589bitflags! {
1590    /// `CNTVOFF_EL2` system register value.
1591    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1592    #[repr(transparent)]
1593    pub struct CntvoffEl2: u64 {
1594    }
1595}
1596
1597#[cfg(feature = "el2")]
1598impl CntvoffEl2 {
1599    /// Offset of the `VOffset` field.
1600    pub const VOFFSET_SHIFT: u32 = 0;
1601    /// Mask for the `VOffset` field.
1602    pub const VOFFSET_MASK: u64 =
1603        0b1111111111111111111111111111111111111111111111111111111111111111;
1604
1605    /// Returns the value of the `VOffset` field.
1606    pub const fn voffset(self) -> u64 {
1607        ((self.bits() >> Self::VOFFSET_SHIFT)
1608            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1609    }
1610
1611    /// Sets the value of the `VOffset` field.
1612    pub const fn set_voffset(&mut self, value: u64) {
1613        let offset = Self::VOFFSET_SHIFT;
1614        assert!(value & (Self::VOFFSET_MASK as u64) == value);
1615        *self = Self::from_bits_retain(
1616            (self.bits() & !(Self::VOFFSET_MASK << offset)) | ((value as u64) << offset),
1617        );
1618    }
1619}
1620
1621bitflags! {
1622    /// `CNTV_CTL` system register value.
1623    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1624    #[repr(transparent)]
1625    pub struct CntvCtl: u32 {
1626        /// `ENABLE` bit.
1627        const ENABLE = 1 << 0;
1628        /// `IMASK` bit.
1629        const IMASK = 1 << 1;
1630        /// `ISTATUS` bit.
1631        const ISTATUS = 1 << 2;
1632    }
1633}
1634
1635impl CntvCtl {
1636    /// Offset of the `ENABLE` field.
1637    pub const ENABLE_SHIFT: u32 = 0;
1638    /// Offset of the `IMASK` field.
1639    pub const IMASK_SHIFT: u32 = 1;
1640    /// Offset of the `ISTATUS` field.
1641    pub const ISTATUS_SHIFT: u32 = 2;
1642}
1643
1644bitflags! {
1645    /// `CNTV_CVAL` system register value.
1646    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1647    #[repr(transparent)]
1648    pub struct CntvCval: u64 {
1649    }
1650}
1651
1652impl CntvCval {
1653    /// Offset of the `CompareValue` field.
1654    pub const COMPAREVALUE_SHIFT: u32 = 0;
1655    /// Mask for the `CompareValue` field.
1656    pub const COMPAREVALUE_MASK: u64 =
1657        0b1111111111111111111111111111111111111111111111111111111111111111;
1658
1659    /// Returns the value of the `CompareValue` field.
1660    pub const fn comparevalue(self) -> u64 {
1661        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1662            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1663    }
1664
1665    /// Sets the value of the `CompareValue` field.
1666    pub const fn set_comparevalue(&mut self, value: u64) {
1667        let offset = Self::COMPAREVALUE_SHIFT;
1668        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1669        *self = Self::from_bits_retain(
1670            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1671        );
1672    }
1673}
1674
1675bitflags! {
1676    /// `CNTV_TVAL` system register value.
1677    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1678    #[repr(transparent)]
1679    pub struct CntvTval: u32 {
1680    }
1681}
1682
1683impl CntvTval {
1684    /// Offset of the `TimerValue` field.
1685    pub const TIMERVALUE_SHIFT: u32 = 0;
1686    /// Mask for the `TimerValue` field.
1687    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1688
1689    /// Returns the value of the `TimerValue` field.
1690    pub const fn timervalue(self) -> u32 {
1691        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1692    }
1693
1694    /// Sets the value of the `TimerValue` field.
1695    pub const fn set_timervalue(&mut self, value: u32) {
1696        let offset = Self::TIMERVALUE_SHIFT;
1697        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1698        *self = Self::from_bits_retain(
1699            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1700        );
1701    }
1702}
1703
1704bitflags! {
1705    /// `CONTEXTIDR` system register value.
1706    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1707    #[repr(transparent)]
1708    pub struct Contextidr: u32 {
1709    }
1710}
1711
1712impl Contextidr {
1713    /// Offset of the `ASID` field.
1714    pub const ASID_SHIFT: u32 = 0;
1715    /// Mask for the `ASID` field.
1716    pub const ASID_MASK: u32 = 0b11111111;
1717
1718    /// Returns the value of the `ASID` field.
1719    pub const fn asid(self) -> u8 {
1720        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
1721    }
1722
1723    /// Sets the value of the `ASID` field.
1724    pub const fn set_asid(&mut self, value: u8) {
1725        let offset = Self::ASID_SHIFT;
1726        assert!(value & (Self::ASID_MASK as u8) == value);
1727        *self = Self::from_bits_retain(
1728            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u32) << offset),
1729        );
1730    }
1731}
1732
1733#[cfg(feature = "el1")]
1734bitflags! {
1735    /// `CONTEXTIDR_EL1` system register value.
1736    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1737    #[repr(transparent)]
1738    pub struct ContextidrEl1: u64 {
1739    }
1740}
1741
1742#[cfg(feature = "el1")]
1743impl ContextidrEl1 {
1744    /// Offset of the `PROCID` field.
1745    pub const PROCID_SHIFT: u32 = 0;
1746    /// Mask for the `PROCID` field.
1747    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
1748
1749    /// Returns the value of the `PROCID` field.
1750    pub const fn procid(self) -> u32 {
1751        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
1752    }
1753
1754    /// Sets the value of the `PROCID` field.
1755    pub const fn set_procid(&mut self, value: u32) {
1756        let offset = Self::PROCID_SHIFT;
1757        assert!(value & (Self::PROCID_MASK as u32) == value);
1758        *self = Self::from_bits_retain(
1759            (self.bits() & !(Self::PROCID_MASK << offset)) | ((value as u64) << offset),
1760        );
1761    }
1762}
1763
1764#[cfg(feature = "el2")]
1765bitflags! {
1766    /// `CONTEXTIDR_EL2` system register value.
1767    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1768    #[repr(transparent)]
1769    pub struct ContextidrEl2: u64 {
1770    }
1771}
1772
1773#[cfg(feature = "el2")]
1774impl ContextidrEl2 {
1775    /// Offset of the `PROCID` field.
1776    pub const PROCID_SHIFT: u32 = 0;
1777    /// Mask for the `PROCID` field.
1778    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
1779
1780    /// Returns the value of the `PROCID` field.
1781    pub const fn procid(self) -> u32 {
1782        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
1783    }
1784
1785    /// Sets the value of the `PROCID` field.
1786    pub const fn set_procid(&mut self, value: u32) {
1787        let offset = Self::PROCID_SHIFT;
1788        assert!(value & (Self::PROCID_MASK as u32) == value);
1789        *self = Self::from_bits_retain(
1790            (self.bits() & !(Self::PROCID_MASK << offset)) | ((value as u64) << offset),
1791        );
1792    }
1793}
1794
1795bitflags! {
1796    /// `CPACR` system register value.
1797    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1798    #[repr(transparent)]
1799    pub struct Cpacr: u32 {
1800        /// `TRCDIS` bit.
1801        const TRCDIS = 1 << 28;
1802        /// `ASEDIS` bit.
1803        const ASEDIS = 1 << 31;
1804    }
1805}
1806
1807impl Cpacr {
1808    /// Offset of the `cp10` field.
1809    pub const CP10_SHIFT: u32 = 20;
1810    /// Mask for the `cp10` field.
1811    pub const CP10_MASK: u32 = 0b11;
1812    /// Offset of the `cp11` field.
1813    pub const CP11_SHIFT: u32 = 22;
1814    /// Mask for the `cp11` field.
1815    pub const CP11_MASK: u32 = 0b11;
1816    /// Offset of the `TRCDIS` field.
1817    pub const TRCDIS_SHIFT: u32 = 28;
1818    /// Offset of the `ASEDIS` field.
1819    pub const ASEDIS_SHIFT: u32 = 31;
1820
1821    /// Returns the value of the `cp10` field.
1822    pub const fn cp10(self) -> u8 {
1823        ((self.bits() >> Self::CP10_SHIFT) & 0b11) as u8
1824    }
1825
1826    /// Sets the value of the `cp10` field.
1827    pub const fn set_cp10(&mut self, value: u8) {
1828        let offset = Self::CP10_SHIFT;
1829        assert!(value & (Self::CP10_MASK as u8) == value);
1830        *self = Self::from_bits_retain(
1831            (self.bits() & !(Self::CP10_MASK << offset)) | ((value as u32) << offset),
1832        );
1833    }
1834
1835    /// Returns the value of the `cp11` field.
1836    pub const fn cp11(self) -> u8 {
1837        ((self.bits() >> Self::CP11_SHIFT) & 0b11) as u8
1838    }
1839
1840    /// Sets the value of the `cp11` field.
1841    pub const fn set_cp11(&mut self, value: u8) {
1842        let offset = Self::CP11_SHIFT;
1843        assert!(value & (Self::CP11_MASK as u8) == value);
1844        *self = Self::from_bits_retain(
1845            (self.bits() & !(Self::CP11_MASK << offset)) | ((value as u32) << offset),
1846        );
1847    }
1848}
1849
1850#[cfg(feature = "el1")]
1851bitflags! {
1852    /// `CPACR_EL1` system register value.
1853    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1854    #[repr(transparent)]
1855    pub struct CpacrEl1: u64 {
1856        /// `TTA` bit.
1857        const TTA = 1 << 28;
1858        /// `E0POE` bit.
1859        const E0POE = 1 << 29;
1860        /// `TAM` bit.
1861        const TAM = 1 << 30;
1862        /// `TCPAC` bit.
1863        const TCPAC = 1 << 31;
1864        /// `E0TP0E` bit.
1865        const E0TP0E = 1 << 32;
1866        /// `E0TP1E` bit.
1867        const E0TP1E = 1 << 33;
1868    }
1869}
1870
1871#[cfg(feature = "el1")]
1872impl CpacrEl1 {
1873    /// Offset of the `ZEN` field.
1874    pub const ZEN_SHIFT: u32 = 16;
1875    /// Mask for the `ZEN` field.
1876    pub const ZEN_MASK: u64 = 0b11;
1877    /// Offset of the `FPEN` field.
1878    pub const FPEN_SHIFT: u32 = 20;
1879    /// Mask for the `FPEN` field.
1880    pub const FPEN_MASK: u64 = 0b11;
1881    /// Offset of the `SMEN` field.
1882    pub const SMEN_SHIFT: u32 = 24;
1883    /// Mask for the `SMEN` field.
1884    pub const SMEN_MASK: u64 = 0b11;
1885    /// Offset of the `TTA` field.
1886    pub const TTA_SHIFT: u32 = 28;
1887    /// Offset of the `E0POE` field.
1888    pub const E0POE_SHIFT: u32 = 29;
1889    /// Offset of the `TAM` field.
1890    pub const TAM_SHIFT: u32 = 30;
1891    /// Offset of the `TCPAC` field.
1892    pub const TCPAC_SHIFT: u32 = 31;
1893    /// Offset of the `E0TP0E` field.
1894    pub const E0TP0E_SHIFT: u32 = 32;
1895    /// Offset of the `E0TP1E` field.
1896    pub const E0TP1E_SHIFT: u32 = 33;
1897
1898    /// Returns the value of the `ZEN` field.
1899    pub const fn zen(self) -> u8 {
1900        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
1901    }
1902
1903    /// Sets the value of the `ZEN` field.
1904    pub const fn set_zen(&mut self, value: u8) {
1905        let offset = Self::ZEN_SHIFT;
1906        assert!(value & (Self::ZEN_MASK as u8) == value);
1907        *self = Self::from_bits_retain(
1908            (self.bits() & !(Self::ZEN_MASK << offset)) | ((value as u64) << offset),
1909        );
1910    }
1911
1912    /// Returns the value of the `FPEN` field.
1913    pub const fn fpen(self) -> u8 {
1914        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
1915    }
1916
1917    /// Sets the value of the `FPEN` field.
1918    pub const fn set_fpen(&mut self, value: u8) {
1919        let offset = Self::FPEN_SHIFT;
1920        assert!(value & (Self::FPEN_MASK as u8) == value);
1921        *self = Self::from_bits_retain(
1922            (self.bits() & !(Self::FPEN_MASK << offset)) | ((value as u64) << offset),
1923        );
1924    }
1925
1926    /// Returns the value of the `SMEN` field.
1927    pub const fn smen(self) -> u8 {
1928        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
1929    }
1930
1931    /// Sets the value of the `SMEN` field.
1932    pub const fn set_smen(&mut self, value: u8) {
1933        let offset = Self::SMEN_SHIFT;
1934        assert!(value & (Self::SMEN_MASK as u8) == value);
1935        *self = Self::from_bits_retain(
1936            (self.bits() & !(Self::SMEN_MASK << offset)) | ((value as u64) << offset),
1937        );
1938    }
1939}
1940
1941#[cfg(feature = "el2")]
1942bitflags! {
1943    /// `CPTR_EL2` system register value.
1944    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1945    #[repr(transparent)]
1946    pub struct CptrEl2: u64 {
1947        /// RES1 bits in the `CPTR_EL2` register.
1948        const RES1 = 0b10001011111111;
1949        /// `TZ` bit.
1950        const TZ = 1 << 8;
1951        /// `TFP` bit.
1952        const TFP = 1 << 10;
1953        /// `TSM` bit.
1954        const TSM = 1 << 12;
1955        /// `E0POE` bit.
1956        const E0POE = 1 << 29;
1957        /// `TAM` bit.
1958        const TAM = 1 << 30;
1959        /// `TCPAC` bit.
1960        const TCPAC = 1 << 31;
1961        /// `E0TP0E` bit.
1962        const E0TP0E = 1 << 32;
1963        /// `E0TP1E` bit.
1964        const E0TP1E = 1 << 33;
1965    }
1966}
1967
1968#[cfg(feature = "el2")]
1969impl CptrEl2 {
1970    /// Offset of the `TZ` field.
1971    pub const TZ_SHIFT: u32 = 8;
1972    /// Offset of the `TFP` field.
1973    pub const TFP_SHIFT: u32 = 10;
1974    /// Offset of the `TSM` field.
1975    pub const TSM_SHIFT: u32 = 12;
1976    /// Offset of the `ZEN` field.
1977    pub const ZEN_SHIFT: u32 = 16;
1978    /// Mask for the `ZEN` field.
1979    pub const ZEN_MASK: u64 = 0b11;
1980    /// Offset of the `FPEN` field.
1981    pub const FPEN_SHIFT: u32 = 20;
1982    /// Mask for the `FPEN` field.
1983    pub const FPEN_MASK: u64 = 0b11;
1984    /// Offset of the `SMEN` field.
1985    pub const SMEN_SHIFT: u32 = 24;
1986    /// Mask for the `SMEN` field.
1987    pub const SMEN_MASK: u64 = 0b11;
1988    /// Offset of the `E0POE` field.
1989    pub const E0POE_SHIFT: u32 = 29;
1990    /// Offset of the `TAM` field.
1991    pub const TAM_SHIFT: u32 = 30;
1992    /// Offset of the `TCPAC` field.
1993    pub const TCPAC_SHIFT: u32 = 31;
1994    /// Offset of the `E0TP0E` field.
1995    pub const E0TP0E_SHIFT: u32 = 32;
1996    /// Offset of the `E0TP1E` field.
1997    pub const E0TP1E_SHIFT: u32 = 33;
1998
1999    /// Returns the value of the `ZEN` field.
2000    pub const fn zen(self) -> u8 {
2001        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
2002    }
2003
2004    /// Sets the value of the `ZEN` field.
2005    pub const fn set_zen(&mut self, value: u8) {
2006        let offset = Self::ZEN_SHIFT;
2007        assert!(value & (Self::ZEN_MASK as u8) == value);
2008        *self = Self::from_bits_retain(
2009            (self.bits() & !(Self::ZEN_MASK << offset)) | ((value as u64) << offset),
2010        );
2011    }
2012
2013    /// Returns the value of the `FPEN` field.
2014    pub const fn fpen(self) -> u8 {
2015        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
2016    }
2017
2018    /// Sets the value of the `FPEN` field.
2019    pub const fn set_fpen(&mut self, value: u8) {
2020        let offset = Self::FPEN_SHIFT;
2021        assert!(value & (Self::FPEN_MASK as u8) == value);
2022        *self = Self::from_bits_retain(
2023            (self.bits() & !(Self::FPEN_MASK << offset)) | ((value as u64) << offset),
2024        );
2025    }
2026
2027    /// Returns the value of the `SMEN` field.
2028    pub const fn smen(self) -> u8 {
2029        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
2030    }
2031
2032    /// Sets the value of the `SMEN` field.
2033    pub const fn set_smen(&mut self, value: u8) {
2034        let offset = Self::SMEN_SHIFT;
2035        assert!(value & (Self::SMEN_MASK as u8) == value);
2036        *self = Self::from_bits_retain(
2037            (self.bits() & !(Self::SMEN_MASK << offset)) | ((value as u64) << offset),
2038        );
2039    }
2040}
2041
2042#[cfg(feature = "el3")]
2043bitflags! {
2044    /// `CPTR_EL3` system register value.
2045    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2046    #[repr(transparent)]
2047    pub struct CptrEl3: u64 {
2048        /// Do not trap execution of SVE instructions.
2049        const EZ = 1 << 8;
2050        /// Trap Advanced SIMD instructions execution.
2051        const TFP = 1 << 10;
2052        /// When FEAT_SME is implemented, do not trap SME instructions and system registers accesses.
2053        const ESM = 1 << 12;
2054        /// Trap trace system register accesses.
2055        const TTA = 1 << 20;
2056        /// When FEAT_AMUv1 implemented trap accesses from EL2/EL1/EL0 to AMU registers.
2057        const TAM = 1 << 30;
2058        /// Trap EL2 accesses to CPTR_EL2/HCPTR, and EL2/EL1 accesses to CPACR_EL1/CPACR.
2059        const TCPAC = 1 << 31;
2060    }
2061}
2062
2063#[cfg(feature = "el3")]
2064impl CptrEl3 {
2065    /// Offset of the `EZ` field.
2066    pub const EZ_SHIFT: u32 = 8;
2067    /// Offset of the `TFP` field.
2068    pub const TFP_SHIFT: u32 = 10;
2069    /// Offset of the `ESM` field.
2070    pub const ESM_SHIFT: u32 = 12;
2071    /// Offset of the `TTA` field.
2072    pub const TTA_SHIFT: u32 = 20;
2073    /// Offset of the `TAM` field.
2074    pub const TAM_SHIFT: u32 = 30;
2075    /// Offset of the `TCPAC` field.
2076    pub const TCPAC_SHIFT: u32 = 31;
2077}
2078
2079bitflags! {
2080    /// `CSSELR` system register value.
2081    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2082    #[repr(transparent)]
2083    pub struct Csselr: u32 {
2084        /// `InD` bit.
2085        const IND = 1 << 0;
2086    }
2087}
2088
2089impl Csselr {
2090    /// Offset of the `InD` field.
2091    pub const IND_SHIFT: u32 = 0;
2092    /// Offset of the `Level` field.
2093    pub const LEVEL_SHIFT: u32 = 1;
2094    /// Mask for the `Level` field.
2095    pub const LEVEL_MASK: u32 = 0b111;
2096
2097    /// Returns the value of the `Level` field.
2098    pub const fn level(self) -> u8 {
2099        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
2100    }
2101
2102    /// Sets the value of the `Level` field.
2103    pub const fn set_level(&mut self, value: u8) {
2104        let offset = Self::LEVEL_SHIFT;
2105        assert!(value & (Self::LEVEL_MASK as u8) == value);
2106        *self = Self::from_bits_retain(
2107            (self.bits() & !(Self::LEVEL_MASK << offset)) | ((value as u32) << offset),
2108        );
2109    }
2110}
2111
2112#[cfg(feature = "el1")]
2113bitflags! {
2114    /// `CSSELR_EL1` system register value.
2115    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2116    #[repr(transparent)]
2117    pub struct CsselrEl1: u64 {
2118        /// Instruction not Data bit.
2119        const IND = 1 << 0;
2120        /// Allocation Tag not Data bit, only valid if FEAT_MTE2 is implemented.
2121        const TND = 1 << 4;
2122    }
2123}
2124
2125#[cfg(feature = "el1")]
2126impl CsselrEl1 {
2127    /// Offset of the `InD` field.
2128    pub const IND_SHIFT: u32 = 0;
2129    /// Offset of the `Level` field.
2130    pub const LEVEL_SHIFT: u32 = 1;
2131    /// Mask for the `Level` field.
2132    pub const LEVEL_MASK: u64 = 0b111;
2133    /// Offset of the `TnD` field.
2134    pub const TND_SHIFT: u32 = 4;
2135
2136    /// Returns the value of the `Level` field.
2137    pub const fn level(self) -> u8 {
2138        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
2139    }
2140
2141    /// Sets the value of the `Level` field.
2142    pub const fn set_level(&mut self, value: u8) {
2143        let offset = Self::LEVEL_SHIFT;
2144        assert!(value & (Self::LEVEL_MASK as u8) == value);
2145        *self = Self::from_bits_retain(
2146            (self.bits() & !(Self::LEVEL_MASK << offset)) | ((value as u64) << offset),
2147        );
2148    }
2149}
2150
2151bitflags! {
2152    /// `CTR` system register value.
2153    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2154    #[repr(transparent)]
2155    pub struct Ctr: u32 {
2156        /// RES1 bits in the `CTR` register.
2157        const RES1 = 0b10000000000000000000000000000000;
2158        /// `IDC` bit.
2159        const IDC = 1 << 28;
2160        /// `DIC` bit.
2161        const DIC = 1 << 29;
2162    }
2163}
2164
2165impl Ctr {
2166    /// Offset of the `IminLine` field.
2167    pub const IMINLINE_SHIFT: u32 = 0;
2168    /// Mask for the `IminLine` field.
2169    pub const IMINLINE_MASK: u32 = 0b1111;
2170    /// Offset of the `L1Ip` field.
2171    pub const L1IP_SHIFT: u32 = 14;
2172    /// Mask for the `L1Ip` field.
2173    pub const L1IP_MASK: u32 = 0b11;
2174    /// Offset of the `DminLine` field.
2175    pub const DMINLINE_SHIFT: u32 = 16;
2176    /// Mask for the `DminLine` field.
2177    pub const DMINLINE_MASK: u32 = 0b1111;
2178    /// Offset of the `ERG` field.
2179    pub const ERG_SHIFT: u32 = 20;
2180    /// Mask for the `ERG` field.
2181    pub const ERG_MASK: u32 = 0b1111;
2182    /// Offset of the `CWG` field.
2183    pub const CWG_SHIFT: u32 = 24;
2184    /// Mask for the `CWG` field.
2185    pub const CWG_MASK: u32 = 0b1111;
2186    /// Offset of the `IDC` field.
2187    pub const IDC_SHIFT: u32 = 28;
2188    /// Offset of the `DIC` field.
2189    pub const DIC_SHIFT: u32 = 29;
2190
2191    /// Returns the value of the `IminLine` field.
2192    pub const fn iminline(self) -> u8 {
2193        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
2194    }
2195
2196    /// Sets the value of the `IminLine` field.
2197    pub const fn set_iminline(&mut self, value: u8) {
2198        let offset = Self::IMINLINE_SHIFT;
2199        assert!(value & (Self::IMINLINE_MASK as u8) == value);
2200        *self = Self::from_bits_retain(
2201            (self.bits() & !(Self::IMINLINE_MASK << offset)) | ((value as u32) << offset),
2202        );
2203    }
2204
2205    /// Returns the value of the `L1Ip` field.
2206    pub const fn l1ip(self) -> u8 {
2207        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
2208    }
2209
2210    /// Sets the value of the `L1Ip` field.
2211    pub const fn set_l1ip(&mut self, value: u8) {
2212        let offset = Self::L1IP_SHIFT;
2213        assert!(value & (Self::L1IP_MASK as u8) == value);
2214        *self = Self::from_bits_retain(
2215            (self.bits() & !(Self::L1IP_MASK << offset)) | ((value as u32) << offset),
2216        );
2217    }
2218
2219    /// Returns the value of the `DminLine` field.
2220    pub const fn dminline(self) -> u8 {
2221        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
2222    }
2223
2224    /// Sets the value of the `DminLine` field.
2225    pub const fn set_dminline(&mut self, value: u8) {
2226        let offset = Self::DMINLINE_SHIFT;
2227        assert!(value & (Self::DMINLINE_MASK as u8) == value);
2228        *self = Self::from_bits_retain(
2229            (self.bits() & !(Self::DMINLINE_MASK << offset)) | ((value as u32) << offset),
2230        );
2231    }
2232
2233    /// Returns the value of the `ERG` field.
2234    pub const fn erg(self) -> u8 {
2235        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
2236    }
2237
2238    /// Sets the value of the `ERG` field.
2239    pub const fn set_erg(&mut self, value: u8) {
2240        let offset = Self::ERG_SHIFT;
2241        assert!(value & (Self::ERG_MASK as u8) == value);
2242        *self = Self::from_bits_retain(
2243            (self.bits() & !(Self::ERG_MASK << offset)) | ((value as u32) << offset),
2244        );
2245    }
2246
2247    /// Returns the value of the `CWG` field.
2248    pub const fn cwg(self) -> u8 {
2249        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
2250    }
2251
2252    /// Sets the value of the `CWG` field.
2253    pub const fn set_cwg(&mut self, value: u8) {
2254        let offset = Self::CWG_SHIFT;
2255        assert!(value & (Self::CWG_MASK as u8) == value);
2256        *self = Self::from_bits_retain(
2257            (self.bits() & !(Self::CWG_MASK << offset)) | ((value as u32) << offset),
2258        );
2259    }
2260}
2261
2262bitflags! {
2263    /// `CTR_EL0` system register value.
2264    ///
2265    /// Cache Type Register.
2266    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2267    #[repr(transparent)]
2268    pub struct CtrEl0: u64 {
2269        /// RES1 bits in the `CTR_EL0` register.
2270        const RES1 = 0b10000000000000000000000000000000;
2271        /// `IDC` bit.
2272        const IDC = 1 << 28;
2273        /// `DIC` bit.
2274        const DIC = 1 << 29;
2275    }
2276}
2277
2278impl CtrEl0 {
2279    /// Offset of the `IminLine` field.
2280    pub const IMINLINE_SHIFT: u32 = 0;
2281    /// Mask for the `IminLine` field.
2282    pub const IMINLINE_MASK: u64 = 0b1111;
2283    /// Offset of the `L1Ip` field.
2284    pub const L1IP_SHIFT: u32 = 14;
2285    /// Mask for the `L1Ip` field.
2286    pub const L1IP_MASK: u64 = 0b11;
2287    /// Offset of the `DminLine` field.
2288    pub const DMINLINE_SHIFT: u32 = 16;
2289    /// Mask for the `DminLine` field.
2290    pub const DMINLINE_MASK: u64 = 0b1111;
2291    /// Offset of the `ERG` field.
2292    pub const ERG_SHIFT: u32 = 20;
2293    /// Mask for the `ERG` field.
2294    pub const ERG_MASK: u64 = 0b1111;
2295    /// Offset of the `CWG` field.
2296    pub const CWG_SHIFT: u32 = 24;
2297    /// Mask for the `CWG` field.
2298    pub const CWG_MASK: u64 = 0b1111;
2299    /// Offset of the `IDC` field.
2300    pub const IDC_SHIFT: u32 = 28;
2301    /// Offset of the `DIC` field.
2302    pub const DIC_SHIFT: u32 = 29;
2303    /// Offset of the `TminLine` field.
2304    pub const TMINLINE_SHIFT: u32 = 32;
2305    /// Mask for the `TminLine` field.
2306    pub const TMINLINE_MASK: u64 = 0b111111;
2307
2308    /// Returns the value of the `IminLine` field.
2309    pub const fn iminline(self) -> u8 {
2310        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
2311    }
2312
2313    /// Sets the value of the `IminLine` field.
2314    pub const fn set_iminline(&mut self, value: u8) {
2315        let offset = Self::IMINLINE_SHIFT;
2316        assert!(value & (Self::IMINLINE_MASK as u8) == value);
2317        *self = Self::from_bits_retain(
2318            (self.bits() & !(Self::IMINLINE_MASK << offset)) | ((value as u64) << offset),
2319        );
2320    }
2321
2322    /// Returns the value of the `L1Ip` field.
2323    pub const fn l1ip(self) -> u8 {
2324        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
2325    }
2326
2327    /// Sets the value of the `L1Ip` field.
2328    pub const fn set_l1ip(&mut self, value: u8) {
2329        let offset = Self::L1IP_SHIFT;
2330        assert!(value & (Self::L1IP_MASK as u8) == value);
2331        *self = Self::from_bits_retain(
2332            (self.bits() & !(Self::L1IP_MASK << offset)) | ((value as u64) << offset),
2333        );
2334    }
2335
2336    /// Returns the value of the `DminLine` field.
2337    ///
2338    /// 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.
2339    pub const fn dminline(self) -> u8 {
2340        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
2341    }
2342
2343    /// Sets the value of the `DminLine` field.
2344    ///
2345    /// 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.
2346    pub const fn set_dminline(&mut self, value: u8) {
2347        let offset = Self::DMINLINE_SHIFT;
2348        assert!(value & (Self::DMINLINE_MASK as u8) == value);
2349        *self = Self::from_bits_retain(
2350            (self.bits() & !(Self::DMINLINE_MASK << offset)) | ((value as u64) << offset),
2351        );
2352    }
2353
2354    /// Returns the value of the `ERG` field.
2355    pub const fn erg(self) -> u8 {
2356        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
2357    }
2358
2359    /// Sets the value of the `ERG` field.
2360    pub const fn set_erg(&mut self, value: u8) {
2361        let offset = Self::ERG_SHIFT;
2362        assert!(value & (Self::ERG_MASK as u8) == value);
2363        *self = Self::from_bits_retain(
2364            (self.bits() & !(Self::ERG_MASK << offset)) | ((value as u64) << offset),
2365        );
2366    }
2367
2368    /// Returns the value of the `CWG` field.
2369    pub const fn cwg(self) -> u8 {
2370        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
2371    }
2372
2373    /// Sets the value of the `CWG` field.
2374    pub const fn set_cwg(&mut self, value: u8) {
2375        let offset = Self::CWG_SHIFT;
2376        assert!(value & (Self::CWG_MASK as u8) == value);
2377        *self = Self::from_bits_retain(
2378            (self.bits() & !(Self::CWG_MASK << offset)) | ((value as u64) << offset),
2379        );
2380    }
2381
2382    /// Returns the value of the `TminLine` field.
2383    pub const fn tminline(self) -> u8 {
2384        ((self.bits() >> Self::TMINLINE_SHIFT) & 0b111111) as u8
2385    }
2386
2387    /// Sets the value of the `TminLine` field.
2388    pub const fn set_tminline(&mut self, value: u8) {
2389        let offset = Self::TMINLINE_SHIFT;
2390        assert!(value & (Self::TMINLINE_MASK as u8) == value);
2391        *self = Self::from_bits_retain(
2392            (self.bits() & !(Self::TMINLINE_MASK << offset)) | ((value as u64) << offset),
2393        );
2394    }
2395}
2396
2397bitflags! {
2398    /// `CurrentEL` system register value.
2399    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2400    #[repr(transparent)]
2401    pub struct Currentel: u64 {
2402    }
2403}
2404
2405impl Currentel {
2406    /// Offset of the `EL` field.
2407    pub const EL_SHIFT: u32 = 2;
2408    /// Mask for the `EL` field.
2409    pub const EL_MASK: u64 = 0b11;
2410
2411    /// Returns the value of the `EL` field.
2412    pub const fn el(self) -> u8 {
2413        ((self.bits() >> Self::EL_SHIFT) & 0b11) as u8
2414    }
2415
2416    /// Sets the value of the `EL` field.
2417    pub const fn set_el(&mut self, value: u8) {
2418        let offset = Self::EL_SHIFT;
2419        assert!(value & (Self::EL_MASK as u8) == value);
2420        *self = Self::from_bits_retain(
2421            (self.bits() & !(Self::EL_MASK << offset)) | ((value as u64) << offset),
2422        );
2423    }
2424}
2425
2426bitflags! {
2427    /// `DACR` system register value.
2428    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2429    #[repr(transparent)]
2430    pub struct Dacr: u32 {
2431    }
2432}
2433
2434impl Dacr {
2435    /// Offset of the `D<n>` field.
2436    pub const D_SHIFT: u32 = 0;
2437    /// Mask for the `D<n>` field.
2438    pub const D_MASK: u32 = 0b11;
2439
2440    /// Returns the value of the given `D<n>` field.
2441    pub const fn d(self, n: u32) -> u8 {
2442        assert!(n < 16);
2443        ((self.bits() >> (Self::D_SHIFT + (n - 0) * 2)) & 0b11) as u8
2444    }
2445
2446    /// Sets the value of the `D<n>` field.
2447    pub const fn set_d(&mut self, n: u32, value: u8) {
2448        assert!(n < 16);
2449        let offset = Self::D_SHIFT + (n - 0) * 2;
2450        assert!(value & (Self::D_MASK as u8) == value);
2451        *self = Self::from_bits_retain(
2452            (self.bits() & !(Self::D_MASK << offset)) | ((value as u32) << offset),
2453        );
2454    }
2455}
2456
2457bitflags! {
2458    /// `DBGAUTHSTATUS` system register value.
2459    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2460    #[repr(transparent)]
2461    pub struct Dbgauthstatus: u32 {
2462    }
2463}
2464
2465impl Dbgauthstatus {
2466    /// Offset of the `NSID` field.
2467    pub const NSID_SHIFT: u32 = 0;
2468    /// Mask for the `NSID` field.
2469    pub const NSID_MASK: u32 = 0b11;
2470    /// Offset of the `NSNID` field.
2471    pub const NSNID_SHIFT: u32 = 2;
2472    /// Mask for the `NSNID` field.
2473    pub const NSNID_MASK: u32 = 0b11;
2474    /// Offset of the `SID` field.
2475    pub const SID_SHIFT: u32 = 4;
2476    /// Mask for the `SID` field.
2477    pub const SID_MASK: u32 = 0b11;
2478    /// Offset of the `SNID` field.
2479    pub const SNID_SHIFT: u32 = 6;
2480    /// Mask for the `SNID` field.
2481    pub const SNID_MASK: u32 = 0b11;
2482
2483    /// Returns the value of the `NSID` field.
2484    pub const fn nsid(self) -> u8 {
2485        ((self.bits() >> Self::NSID_SHIFT) & 0b11) as u8
2486    }
2487
2488    /// Sets the value of the `NSID` field.
2489    pub const fn set_nsid(&mut self, value: u8) {
2490        let offset = Self::NSID_SHIFT;
2491        assert!(value & (Self::NSID_MASK as u8) == value);
2492        *self = Self::from_bits_retain(
2493            (self.bits() & !(Self::NSID_MASK << offset)) | ((value as u32) << offset),
2494        );
2495    }
2496
2497    /// Returns the value of the `NSNID` field.
2498    pub const fn nsnid(self) -> u8 {
2499        ((self.bits() >> Self::NSNID_SHIFT) & 0b11) as u8
2500    }
2501
2502    /// Sets the value of the `NSNID` field.
2503    pub const fn set_nsnid(&mut self, value: u8) {
2504        let offset = Self::NSNID_SHIFT;
2505        assert!(value & (Self::NSNID_MASK as u8) == value);
2506        *self = Self::from_bits_retain(
2507            (self.bits() & !(Self::NSNID_MASK << offset)) | ((value as u32) << offset),
2508        );
2509    }
2510
2511    /// Returns the value of the `SID` field.
2512    pub const fn sid(self) -> u8 {
2513        ((self.bits() >> Self::SID_SHIFT) & 0b11) as u8
2514    }
2515
2516    /// Sets the value of the `SID` field.
2517    pub const fn set_sid(&mut self, value: u8) {
2518        let offset = Self::SID_SHIFT;
2519        assert!(value & (Self::SID_MASK as u8) == value);
2520        *self = Self::from_bits_retain(
2521            (self.bits() & !(Self::SID_MASK << offset)) | ((value as u32) << offset),
2522        );
2523    }
2524
2525    /// Returns the value of the `SNID` field.
2526    pub const fn snid(self) -> u8 {
2527        ((self.bits() >> Self::SNID_SHIFT) & 0b11) as u8
2528    }
2529
2530    /// Sets the value of the `SNID` field.
2531    pub const fn set_snid(&mut self, value: u8) {
2532        let offset = Self::SNID_SHIFT;
2533        assert!(value & (Self::SNID_MASK as u8) == value);
2534        *self = Self::from_bits_retain(
2535            (self.bits() & !(Self::SNID_MASK << offset)) | ((value as u32) << offset),
2536        );
2537    }
2538}
2539
2540bitflags! {
2541    /// `DBGCLAIMCLR` system register value.
2542    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2543    #[repr(transparent)]
2544    pub struct Dbgclaimclr: u32 {
2545        /// `CLAIM<m>` bit 0.
2546        const CLAIM0 = 1 << 0;
2547        /// `CLAIM<m>` bit 1.
2548        const CLAIM1 = 1 << 1;
2549        /// `CLAIM<m>` bit 2.
2550        const CLAIM2 = 1 << 2;
2551        /// `CLAIM<m>` bit 3.
2552        const CLAIM3 = 1 << 3;
2553        /// `CLAIM<m>` bit 4.
2554        const CLAIM4 = 1 << 4;
2555        /// `CLAIM<m>` bit 5.
2556        const CLAIM5 = 1 << 5;
2557        /// `CLAIM<m>` bit 6.
2558        const CLAIM6 = 1 << 6;
2559        /// `CLAIM<m>` bit 7.
2560        const CLAIM7 = 1 << 7;
2561    }
2562}
2563
2564impl Dbgclaimclr {
2565    /// Offset of the `CLAIM<m>` field.
2566    pub const CLAIM_SHIFT: u32 = 0;
2567}
2568
2569bitflags! {
2570    /// `DBGCLAIMSET` system register value.
2571    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2572    #[repr(transparent)]
2573    pub struct Dbgclaimset: u32 {
2574        /// `CLAIM<m>` bit 0.
2575        const CLAIM0 = 1 << 0;
2576        /// `CLAIM<m>` bit 1.
2577        const CLAIM1 = 1 << 1;
2578        /// `CLAIM<m>` bit 2.
2579        const CLAIM2 = 1 << 2;
2580        /// `CLAIM<m>` bit 3.
2581        const CLAIM3 = 1 << 3;
2582        /// `CLAIM<m>` bit 4.
2583        const CLAIM4 = 1 << 4;
2584        /// `CLAIM<m>` bit 5.
2585        const CLAIM5 = 1 << 5;
2586        /// `CLAIM<m>` bit 6.
2587        const CLAIM6 = 1 << 6;
2588        /// `CLAIM<m>` bit 7.
2589        const CLAIM7 = 1 << 7;
2590    }
2591}
2592
2593impl Dbgclaimset {
2594    /// Offset of the `CLAIM<m>` field.
2595    pub const CLAIM_SHIFT: u32 = 0;
2596}
2597
2598bitflags! {
2599    /// `DBGDCCINT` system register value.
2600    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2601    #[repr(transparent)]
2602    pub struct Dbgdccint: u32 {
2603        /// `TX` bit.
2604        const TX = 1 << 29;
2605        /// `RX` bit.
2606        const RX = 1 << 30;
2607    }
2608}
2609
2610impl Dbgdccint {
2611    /// Offset of the `TX` field.
2612    pub const TX_SHIFT: u32 = 29;
2613    /// Offset of the `RX` field.
2614    pub const RX_SHIFT: u32 = 30;
2615}
2616
2617bitflags! {
2618    /// `DBGDEVID` system register value.
2619    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2620    #[repr(transparent)]
2621    pub struct Dbgdevid: u32 {
2622    }
2623}
2624
2625impl Dbgdevid {
2626    /// Offset of the `PCSample` field.
2627    pub const PCSAMPLE_SHIFT: u32 = 0;
2628    /// Mask for the `PCSample` field.
2629    pub const PCSAMPLE_MASK: u32 = 0b1111;
2630    /// Offset of the `WPAddrMask` field.
2631    pub const WPADDRMASK_SHIFT: u32 = 4;
2632    /// Mask for the `WPAddrMask` field.
2633    pub const WPADDRMASK_MASK: u32 = 0b1111;
2634    /// Offset of the `BPAddrMask` field.
2635    pub const BPADDRMASK_SHIFT: u32 = 8;
2636    /// Mask for the `BPAddrMask` field.
2637    pub const BPADDRMASK_MASK: u32 = 0b1111;
2638    /// Offset of the `VectorCatch` field.
2639    pub const VECTORCATCH_SHIFT: u32 = 12;
2640    /// Mask for the `VectorCatch` field.
2641    pub const VECTORCATCH_MASK: u32 = 0b1111;
2642    /// Offset of the `VirtExtns` field.
2643    pub const VIRTEXTNS_SHIFT: u32 = 16;
2644    /// Mask for the `VirtExtns` field.
2645    pub const VIRTEXTNS_MASK: u32 = 0b1111;
2646    /// Offset of the `DoubleLock` field.
2647    pub const DOUBLELOCK_SHIFT: u32 = 20;
2648    /// Mask for the `DoubleLock` field.
2649    pub const DOUBLELOCK_MASK: u32 = 0b1111;
2650    /// Offset of the `AuxRegs` field.
2651    pub const AUXREGS_SHIFT: u32 = 24;
2652    /// Mask for the `AuxRegs` field.
2653    pub const AUXREGS_MASK: u32 = 0b1111;
2654    /// Offset of the `CIDMask` field.
2655    pub const CIDMASK_SHIFT: u32 = 28;
2656    /// Mask for the `CIDMask` field.
2657    pub const CIDMASK_MASK: u32 = 0b1111;
2658
2659    /// Returns the value of the `PCSample` field.
2660    pub const fn pcsample(self) -> u8 {
2661        ((self.bits() >> Self::PCSAMPLE_SHIFT) & 0b1111) as u8
2662    }
2663
2664    /// Sets the value of the `PCSample` field.
2665    pub const fn set_pcsample(&mut self, value: u8) {
2666        let offset = Self::PCSAMPLE_SHIFT;
2667        assert!(value & (Self::PCSAMPLE_MASK as u8) == value);
2668        *self = Self::from_bits_retain(
2669            (self.bits() & !(Self::PCSAMPLE_MASK << offset)) | ((value as u32) << offset),
2670        );
2671    }
2672
2673    /// Returns the value of the `WPAddrMask` field.
2674    pub const fn wpaddrmask(self) -> u8 {
2675        ((self.bits() >> Self::WPADDRMASK_SHIFT) & 0b1111) as u8
2676    }
2677
2678    /// Sets the value of the `WPAddrMask` field.
2679    pub const fn set_wpaddrmask(&mut self, value: u8) {
2680        let offset = Self::WPADDRMASK_SHIFT;
2681        assert!(value & (Self::WPADDRMASK_MASK as u8) == value);
2682        *self = Self::from_bits_retain(
2683            (self.bits() & !(Self::WPADDRMASK_MASK << offset)) | ((value as u32) << offset),
2684        );
2685    }
2686
2687    /// Returns the value of the `BPAddrMask` field.
2688    pub const fn bpaddrmask(self) -> u8 {
2689        ((self.bits() >> Self::BPADDRMASK_SHIFT) & 0b1111) as u8
2690    }
2691
2692    /// Sets the value of the `BPAddrMask` field.
2693    pub const fn set_bpaddrmask(&mut self, value: u8) {
2694        let offset = Self::BPADDRMASK_SHIFT;
2695        assert!(value & (Self::BPADDRMASK_MASK as u8) == value);
2696        *self = Self::from_bits_retain(
2697            (self.bits() & !(Self::BPADDRMASK_MASK << offset)) | ((value as u32) << offset),
2698        );
2699    }
2700
2701    /// Returns the value of the `VectorCatch` field.
2702    pub const fn vectorcatch(self) -> u8 {
2703        ((self.bits() >> Self::VECTORCATCH_SHIFT) & 0b1111) as u8
2704    }
2705
2706    /// Sets the value of the `VectorCatch` field.
2707    pub const fn set_vectorcatch(&mut self, value: u8) {
2708        let offset = Self::VECTORCATCH_SHIFT;
2709        assert!(value & (Self::VECTORCATCH_MASK as u8) == value);
2710        *self = Self::from_bits_retain(
2711            (self.bits() & !(Self::VECTORCATCH_MASK << offset)) | ((value as u32) << offset),
2712        );
2713    }
2714
2715    /// Returns the value of the `VirtExtns` field.
2716    pub const fn virtextns(self) -> u8 {
2717        ((self.bits() >> Self::VIRTEXTNS_SHIFT) & 0b1111) as u8
2718    }
2719
2720    /// Sets the value of the `VirtExtns` field.
2721    pub const fn set_virtextns(&mut self, value: u8) {
2722        let offset = Self::VIRTEXTNS_SHIFT;
2723        assert!(value & (Self::VIRTEXTNS_MASK as u8) == value);
2724        *self = Self::from_bits_retain(
2725            (self.bits() & !(Self::VIRTEXTNS_MASK << offset)) | ((value as u32) << offset),
2726        );
2727    }
2728
2729    /// Returns the value of the `DoubleLock` field.
2730    pub const fn doublelock(self) -> u8 {
2731        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
2732    }
2733
2734    /// Sets the value of the `DoubleLock` field.
2735    pub const fn set_doublelock(&mut self, value: u8) {
2736        let offset = Self::DOUBLELOCK_SHIFT;
2737        assert!(value & (Self::DOUBLELOCK_MASK as u8) == value);
2738        *self = Self::from_bits_retain(
2739            (self.bits() & !(Self::DOUBLELOCK_MASK << offset)) | ((value as u32) << offset),
2740        );
2741    }
2742
2743    /// Returns the value of the `AuxRegs` field.
2744    pub const fn auxregs(self) -> u8 {
2745        ((self.bits() >> Self::AUXREGS_SHIFT) & 0b1111) as u8
2746    }
2747
2748    /// Sets the value of the `AuxRegs` field.
2749    pub const fn set_auxregs(&mut self, value: u8) {
2750        let offset = Self::AUXREGS_SHIFT;
2751        assert!(value & (Self::AUXREGS_MASK as u8) == value);
2752        *self = Self::from_bits_retain(
2753            (self.bits() & !(Self::AUXREGS_MASK << offset)) | ((value as u32) << offset),
2754        );
2755    }
2756
2757    /// Returns the value of the `CIDMask` field.
2758    pub const fn cidmask(self) -> u8 {
2759        ((self.bits() >> Self::CIDMASK_SHIFT) & 0b1111) as u8
2760    }
2761
2762    /// Sets the value of the `CIDMask` field.
2763    pub const fn set_cidmask(&mut self, value: u8) {
2764        let offset = Self::CIDMASK_SHIFT;
2765        assert!(value & (Self::CIDMASK_MASK as u8) == value);
2766        *self = Self::from_bits_retain(
2767            (self.bits() & !(Self::CIDMASK_MASK << offset)) | ((value as u32) << offset),
2768        );
2769    }
2770}
2771
2772bitflags! {
2773    /// `DBGDEVID1` system register value.
2774    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2775    #[repr(transparent)]
2776    pub struct Dbgdevid1: u32 {
2777    }
2778}
2779
2780impl Dbgdevid1 {
2781    /// Offset of the `PCSROffset` field.
2782    pub const PCSROFFSET_SHIFT: u32 = 0;
2783    /// Mask for the `PCSROffset` field.
2784    pub const PCSROFFSET_MASK: u32 = 0b1111;
2785
2786    /// Returns the value of the `PCSROffset` field.
2787    pub const fn pcsroffset(self) -> u8 {
2788        ((self.bits() >> Self::PCSROFFSET_SHIFT) & 0b1111) as u8
2789    }
2790
2791    /// Sets the value of the `PCSROffset` field.
2792    pub const fn set_pcsroffset(&mut self, value: u8) {
2793        let offset = Self::PCSROFFSET_SHIFT;
2794        assert!(value & (Self::PCSROFFSET_MASK as u8) == value);
2795        *self = Self::from_bits_retain(
2796            (self.bits() & !(Self::PCSROFFSET_MASK << offset)) | ((value as u32) << offset),
2797        );
2798    }
2799}
2800
2801bitflags! {
2802    /// `DBGDIDR` system register value.
2803    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2804    #[repr(transparent)]
2805    pub struct Dbgdidr: u32 {
2806        /// RES1 bits in the `DBGDIDR` register.
2807        const RES1 = 0b1000000000000000;
2808        /// `SE_imp` bit.
2809        const SE_IMP = 1 << 12;
2810        /// `nSUHD_imp` bit.
2811        const NSUHD_IMP = 1 << 14;
2812    }
2813}
2814
2815impl Dbgdidr {
2816    /// Offset of the `SE_imp` field.
2817    pub const SE_IMP_SHIFT: u32 = 12;
2818    /// Offset of the `nSUHD_imp` field.
2819    pub const NSUHD_IMP_SHIFT: u32 = 14;
2820    /// Offset of the `Version` field.
2821    pub const VERSION_SHIFT: u32 = 16;
2822    /// Mask for the `Version` field.
2823    pub const VERSION_MASK: u32 = 0b1111;
2824    /// Offset of the `CTX_CMPs` field.
2825    pub const CTX_CMPS_SHIFT: u32 = 20;
2826    /// Mask for the `CTX_CMPs` field.
2827    pub const CTX_CMPS_MASK: u32 = 0b1111;
2828    /// Offset of the `BRPs` field.
2829    pub const BRPS_SHIFT: u32 = 24;
2830    /// Mask for the `BRPs` field.
2831    pub const BRPS_MASK: u32 = 0b1111;
2832    /// Offset of the `WRPs` field.
2833    pub const WRPS_SHIFT: u32 = 28;
2834    /// Mask for the `WRPs` field.
2835    pub const WRPS_MASK: u32 = 0b1111;
2836
2837    /// Returns the value of the `Version` field.
2838    pub const fn version(self) -> u8 {
2839        ((self.bits() >> Self::VERSION_SHIFT) & 0b1111) as u8
2840    }
2841
2842    /// Sets the value of the `Version` field.
2843    pub const fn set_version(&mut self, value: u8) {
2844        let offset = Self::VERSION_SHIFT;
2845        assert!(value & (Self::VERSION_MASK as u8) == value);
2846        *self = Self::from_bits_retain(
2847            (self.bits() & !(Self::VERSION_MASK << offset)) | ((value as u32) << offset),
2848        );
2849    }
2850
2851    /// Returns the value of the `CTX_CMPs` field.
2852    pub const fn ctx_cmps(self) -> u8 {
2853        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
2854    }
2855
2856    /// Sets the value of the `CTX_CMPs` field.
2857    pub const fn set_ctx_cmps(&mut self, value: u8) {
2858        let offset = Self::CTX_CMPS_SHIFT;
2859        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
2860        *self = Self::from_bits_retain(
2861            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u32) << offset),
2862        );
2863    }
2864
2865    /// Returns the value of the `BRPs` field.
2866    pub const fn brps(self) -> u8 {
2867        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
2868    }
2869
2870    /// Sets the value of the `BRPs` field.
2871    pub const fn set_brps(&mut self, value: u8) {
2872        let offset = Self::BRPS_SHIFT;
2873        assert!(value & (Self::BRPS_MASK as u8) == value);
2874        *self = Self::from_bits_retain(
2875            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u32) << offset),
2876        );
2877    }
2878
2879    /// Returns the value of the `WRPs` field.
2880    pub const fn wrps(self) -> u8 {
2881        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
2882    }
2883
2884    /// Sets the value of the `WRPs` field.
2885    pub const fn set_wrps(&mut self, value: u8) {
2886        let offset = Self::WRPS_SHIFT;
2887        assert!(value & (Self::WRPS_MASK as u8) == value);
2888        *self = Self::from_bits_retain(
2889            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u32) << offset),
2890        );
2891    }
2892}
2893
2894bitflags! {
2895    /// `DBGDRAR` system register value.
2896    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2897    #[repr(transparent)]
2898    pub struct Dbgdrar: u64 {
2899    }
2900}
2901
2902impl Dbgdrar {
2903    /// Offset of the `Valid` field.
2904    pub const VALID_SHIFT: u32 = 0;
2905    /// Mask for the `Valid` field.
2906    pub const VALID_MASK: u64 = 0b11;
2907    /// Offset of the `ROMADDR[47:12]` field.
2908    pub const ROMADDR_47_12_SHIFT: u32 = 12;
2909    /// Mask for the `ROMADDR[47:12]` field.
2910    pub const ROMADDR_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
2911
2912    /// Returns the value of the `Valid` field.
2913    pub const fn valid(self) -> u8 {
2914        ((self.bits() >> Self::VALID_SHIFT) & 0b11) as u8
2915    }
2916
2917    /// Sets the value of the `Valid` field.
2918    pub const fn set_valid(&mut self, value: u8) {
2919        let offset = Self::VALID_SHIFT;
2920        assert!(value & (Self::VALID_MASK as u8) == value);
2921        *self = Self::from_bits_retain(
2922            (self.bits() & !(Self::VALID_MASK << offset)) | ((value as u64) << offset),
2923        );
2924    }
2925
2926    /// Returns the value of the `ROMADDR[47:12]` field.
2927    pub const fn romaddr_47_12(self) -> u64 {
2928        ((self.bits() >> Self::ROMADDR_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
2929    }
2930
2931    /// Sets the value of the `ROMADDR[47:12]` field.
2932    pub const fn set_romaddr_47_12(&mut self, value: u64) {
2933        let offset = Self::ROMADDR_47_12_SHIFT;
2934        assert!(value & (Self::ROMADDR_47_12_MASK as u64) == value);
2935        *self = Self::from_bits_retain(
2936            (self.bits() & !(Self::ROMADDR_47_12_MASK << offset)) | ((value as u64) << offset),
2937        );
2938    }
2939}
2940
2941bitflags! {
2942    /// `DBGDSCRext` system register value.
2943    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2944    #[repr(transparent)]
2945    pub struct Dbgdscrext: u32 {
2946        /// `ERR` bit.
2947        const ERR = 1 << 6;
2948        /// `UDCCdis` bit.
2949        const UDCCDIS = 1 << 12;
2950        /// `HDE` bit.
2951        const HDE = 1 << 14;
2952        /// `MDBGen` bit.
2953        const MDBGEN = 1 << 15;
2954        /// `SPIDdis` bit.
2955        const SPIDDIS = 1 << 16;
2956        /// `SPNIDdis` bit.
2957        const SPNIDDIS = 1 << 17;
2958        /// `NS` bit.
2959        const NS = 1 << 18;
2960        /// `SC2` bit.
2961        const SC2 = 1 << 19;
2962        /// `TDA` bit.
2963        const TDA = 1 << 21;
2964        /// `TXU` bit.
2965        const TXU = 1 << 26;
2966        /// `RXO` bit.
2967        const RXO = 1 << 27;
2968        /// `TXfull` bit.
2969        const TXFULL = 1 << 29;
2970        /// `RXfull` bit.
2971        const RXFULL = 1 << 30;
2972        /// `TFO` bit.
2973        const TFO = 1 << 31;
2974    }
2975}
2976
2977impl Dbgdscrext {
2978    /// Offset of the `MOE` field.
2979    pub const MOE_SHIFT: u32 = 2;
2980    /// Mask for the `MOE` field.
2981    pub const MOE_MASK: u32 = 0b1111;
2982    /// Offset of the `ERR` field.
2983    pub const ERR_SHIFT: u32 = 6;
2984    /// Offset of the `UDCCdis` field.
2985    pub const UDCCDIS_SHIFT: u32 = 12;
2986    /// Offset of the `HDE` field.
2987    pub const HDE_SHIFT: u32 = 14;
2988    /// Offset of the `MDBGen` field.
2989    pub const MDBGEN_SHIFT: u32 = 15;
2990    /// Offset of the `SPIDdis` field.
2991    pub const SPIDDIS_SHIFT: u32 = 16;
2992    /// Offset of the `SPNIDdis` field.
2993    pub const SPNIDDIS_SHIFT: u32 = 17;
2994    /// Offset of the `NS` field.
2995    pub const NS_SHIFT: u32 = 18;
2996    /// Offset of the `SC2` field.
2997    pub const SC2_SHIFT: u32 = 19;
2998    /// Offset of the `TDA` field.
2999    pub const TDA_SHIFT: u32 = 21;
3000    /// Offset of the `INTdis` field.
3001    pub const INTDIS_SHIFT: u32 = 22;
3002    /// Mask for the `INTdis` field.
3003    pub const INTDIS_MASK: u32 = 0b11;
3004    /// Offset of the `TXU` field.
3005    pub const TXU_SHIFT: u32 = 26;
3006    /// Offset of the `RXO` field.
3007    pub const RXO_SHIFT: u32 = 27;
3008    /// Offset of the `TXfull` field.
3009    pub const TXFULL_SHIFT: u32 = 29;
3010    /// Offset of the `RXfull` field.
3011    pub const RXFULL_SHIFT: u32 = 30;
3012    /// Offset of the `TFO` field.
3013    pub const TFO_SHIFT: u32 = 31;
3014
3015    /// Returns the value of the `MOE` field.
3016    pub const fn moe(self) -> u8 {
3017        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
3018    }
3019
3020    /// Sets the value of the `MOE` field.
3021    pub const fn set_moe(&mut self, value: u8) {
3022        let offset = Self::MOE_SHIFT;
3023        assert!(value & (Self::MOE_MASK as u8) == value);
3024        *self = Self::from_bits_retain(
3025            (self.bits() & !(Self::MOE_MASK << offset)) | ((value as u32) << offset),
3026        );
3027    }
3028
3029    /// Returns the value of the `INTdis` field.
3030    pub const fn intdis(self) -> u8 {
3031        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
3032    }
3033
3034    /// Sets the value of the `INTdis` field.
3035    pub const fn set_intdis(&mut self, value: u8) {
3036        let offset = Self::INTDIS_SHIFT;
3037        assert!(value & (Self::INTDIS_MASK as u8) == value);
3038        *self = Self::from_bits_retain(
3039            (self.bits() & !(Self::INTDIS_MASK << offset)) | ((value as u32) << offset),
3040        );
3041    }
3042}
3043
3044bitflags! {
3045    /// `DBGDSCRint` system register value.
3046    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3047    #[repr(transparent)]
3048    pub struct Dbgdscrint: u32 {
3049        /// `UDCCdis` bit.
3050        const UDCCDIS = 1 << 12;
3051        /// `MDBGen` bit.
3052        const MDBGEN = 1 << 15;
3053        /// `SPIDdis` bit.
3054        const SPIDDIS = 1 << 16;
3055        /// `SPNIDdis` bit.
3056        const SPNIDDIS = 1 << 17;
3057        /// `NS` bit.
3058        const NS = 1 << 18;
3059        /// `TXfull` bit.
3060        const TXFULL = 1 << 29;
3061        /// `RXfull` bit.
3062        const RXFULL = 1 << 30;
3063    }
3064}
3065
3066impl Dbgdscrint {
3067    /// Offset of the `MOE` field.
3068    pub const MOE_SHIFT: u32 = 2;
3069    /// Mask for the `MOE` field.
3070    pub const MOE_MASK: u32 = 0b1111;
3071    /// Offset of the `UDCCdis` field.
3072    pub const UDCCDIS_SHIFT: u32 = 12;
3073    /// Offset of the `MDBGen` field.
3074    pub const MDBGEN_SHIFT: u32 = 15;
3075    /// Offset of the `SPIDdis` field.
3076    pub const SPIDDIS_SHIFT: u32 = 16;
3077    /// Offset of the `SPNIDdis` field.
3078    pub const SPNIDDIS_SHIFT: u32 = 17;
3079    /// Offset of the `NS` field.
3080    pub const NS_SHIFT: u32 = 18;
3081    /// Offset of the `TXfull` field.
3082    pub const TXFULL_SHIFT: u32 = 29;
3083    /// Offset of the `RXfull` field.
3084    pub const RXFULL_SHIFT: u32 = 30;
3085
3086    /// Returns the value of the `MOE` field.
3087    pub const fn moe(self) -> u8 {
3088        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
3089    }
3090
3091    /// Sets the value of the `MOE` field.
3092    pub const fn set_moe(&mut self, value: u8) {
3093        let offset = Self::MOE_SHIFT;
3094        assert!(value & (Self::MOE_MASK as u8) == value);
3095        *self = Self::from_bits_retain(
3096            (self.bits() & !(Self::MOE_MASK << offset)) | ((value as u32) << offset),
3097        );
3098    }
3099}
3100
3101bitflags! {
3102    /// `DBGDTRRXext` system register value.
3103    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3104    #[repr(transparent)]
3105    pub struct Dbgdtrrxext: u32 {
3106    }
3107}
3108
3109impl Dbgdtrrxext {
3110    /// Offset of the `DTRRX` field.
3111    pub const DTRRX_SHIFT: u32 = 0;
3112    /// Mask for the `DTRRX` field.
3113    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
3114
3115    /// Returns the value of the `DTRRX` field.
3116    pub const fn dtrrx(self) -> u32 {
3117        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
3118    }
3119
3120    /// Sets the value of the `DTRRX` field.
3121    pub const fn set_dtrrx(&mut self, value: u32) {
3122        let offset = Self::DTRRX_SHIFT;
3123        assert!(value & (Self::DTRRX_MASK as u32) == value);
3124        *self = Self::from_bits_retain(
3125            (self.bits() & !(Self::DTRRX_MASK << offset)) | ((value as u32) << offset),
3126        );
3127    }
3128}
3129
3130bitflags! {
3131    /// `DBGDTRRXint` system register value.
3132    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3133    #[repr(transparent)]
3134    pub struct Dbgdtrrxint: u32 {
3135    }
3136}
3137
3138impl Dbgdtrrxint {
3139    /// Offset of the `DTRRX` field.
3140    pub const DTRRX_SHIFT: u32 = 0;
3141    /// Mask for the `DTRRX` field.
3142    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
3143
3144    /// Returns the value of the `DTRRX` field.
3145    pub const fn dtrrx(self) -> u32 {
3146        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
3147    }
3148
3149    /// Sets the value of the `DTRRX` field.
3150    pub const fn set_dtrrx(&mut self, value: u32) {
3151        let offset = Self::DTRRX_SHIFT;
3152        assert!(value & (Self::DTRRX_MASK as u32) == value);
3153        *self = Self::from_bits_retain(
3154            (self.bits() & !(Self::DTRRX_MASK << offset)) | ((value as u32) << offset),
3155        );
3156    }
3157}
3158
3159bitflags! {
3160    /// `DBGDTRTXext` system register value.
3161    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3162    #[repr(transparent)]
3163    pub struct Dbgdtrtxext: u32 {
3164    }
3165}
3166
3167impl Dbgdtrtxext {
3168    /// Offset of the `DTRTX` field.
3169    pub const DTRTX_SHIFT: u32 = 0;
3170    /// Mask for the `DTRTX` field.
3171    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
3172
3173    /// Returns the value of the `DTRTX` field.
3174    pub const fn dtrtx(self) -> u32 {
3175        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
3176    }
3177
3178    /// Sets the value of the `DTRTX` field.
3179    pub const fn set_dtrtx(&mut self, value: u32) {
3180        let offset = Self::DTRTX_SHIFT;
3181        assert!(value & (Self::DTRTX_MASK as u32) == value);
3182        *self = Self::from_bits_retain(
3183            (self.bits() & !(Self::DTRTX_MASK << offset)) | ((value as u32) << offset),
3184        );
3185    }
3186}
3187
3188bitflags! {
3189    /// `DBGDTRTXint` system register value.
3190    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3191    #[repr(transparent)]
3192    pub struct Dbgdtrtxint: u32 {
3193    }
3194}
3195
3196impl Dbgdtrtxint {
3197    /// Offset of the `DTRTX` field.
3198    pub const DTRTX_SHIFT: u32 = 0;
3199    /// Mask for the `DTRTX` field.
3200    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
3201
3202    /// Returns the value of the `DTRTX` field.
3203    pub const fn dtrtx(self) -> u32 {
3204        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
3205    }
3206
3207    /// Sets the value of the `DTRTX` field.
3208    pub const fn set_dtrtx(&mut self, value: u32) {
3209        let offset = Self::DTRTX_SHIFT;
3210        assert!(value & (Self::DTRTX_MASK as u32) == value);
3211        *self = Self::from_bits_retain(
3212            (self.bits() & !(Self::DTRTX_MASK << offset)) | ((value as u32) << offset),
3213        );
3214    }
3215}
3216
3217bitflags! {
3218    /// `DBGOSDLR` system register value.
3219    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3220    #[repr(transparent)]
3221    pub struct Dbgosdlr: u32 {
3222        /// `DLK` bit.
3223        const DLK = 1 << 0;
3224    }
3225}
3226
3227impl Dbgosdlr {
3228    /// Offset of the `DLK` field.
3229    pub const DLK_SHIFT: u32 = 0;
3230}
3231
3232bitflags! {
3233    /// `DBGOSECCR` system register value.
3234    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3235    #[repr(transparent)]
3236    pub struct Dbgoseccr: u32 {
3237    }
3238}
3239
3240impl Dbgoseccr {
3241    /// Offset of the `EDECCR` field.
3242    pub const EDECCR_SHIFT: u32 = 0;
3243    /// Mask for the `EDECCR` field.
3244    pub const EDECCR_MASK: u32 = 0b11111111111111111111111111111111;
3245
3246    /// Returns the value of the `EDECCR` field.
3247    pub const fn edeccr(self) -> u32 {
3248        ((self.bits() >> Self::EDECCR_SHIFT) & 0b11111111111111111111111111111111) as u32
3249    }
3250
3251    /// Sets the value of the `EDECCR` field.
3252    pub const fn set_edeccr(&mut self, value: u32) {
3253        let offset = Self::EDECCR_SHIFT;
3254        assert!(value & (Self::EDECCR_MASK as u32) == value);
3255        *self = Self::from_bits_retain(
3256            (self.bits() & !(Self::EDECCR_MASK << offset)) | ((value as u32) << offset),
3257        );
3258    }
3259}
3260
3261bitflags! {
3262    /// `DBGOSLAR` system register value.
3263    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3264    #[repr(transparent)]
3265    pub struct Dbgoslar: u32 {
3266    }
3267}
3268
3269impl Dbgoslar {
3270    /// Offset of the `OSLA` field.
3271    pub const OSLA_SHIFT: u32 = 0;
3272    /// Mask for the `OSLA` field.
3273    pub const OSLA_MASK: u32 = 0b11111111111111111111111111111111;
3274
3275    /// Returns the value of the `OSLA` field.
3276    pub const fn osla(self) -> u32 {
3277        ((self.bits() >> Self::OSLA_SHIFT) & 0b11111111111111111111111111111111) as u32
3278    }
3279
3280    /// Sets the value of the `OSLA` field.
3281    pub const fn set_osla(&mut self, value: u32) {
3282        let offset = Self::OSLA_SHIFT;
3283        assert!(value & (Self::OSLA_MASK as u32) == value);
3284        *self = Self::from_bits_retain(
3285            (self.bits() & !(Self::OSLA_MASK << offset)) | ((value as u32) << offset),
3286        );
3287    }
3288}
3289
3290bitflags! {
3291    /// `DBGOSLSR` system register value.
3292    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3293    #[repr(transparent)]
3294    pub struct Dbgoslsr: u32 {
3295        /// `OSLK` bit.
3296        const OSLK = 1 << 1;
3297        /// `nTT` bit.
3298        const NTT = 1 << 2;
3299    }
3300}
3301
3302impl Dbgoslsr {
3303    /// Offset of the `OSLK` field.
3304    pub const OSLK_SHIFT: u32 = 1;
3305    /// Offset of the `nTT` field.
3306    pub const NTT_SHIFT: u32 = 2;
3307}
3308
3309bitflags! {
3310    /// `DBGPRCR` system register value.
3311    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3312    #[repr(transparent)]
3313    pub struct Dbgprcr: u32 {
3314        /// `CORENPDRQ` bit.
3315        const CORENPDRQ = 1 << 0;
3316    }
3317}
3318
3319impl Dbgprcr {
3320    /// Offset of the `CORENPDRQ` field.
3321    pub const CORENPDRQ_SHIFT: u32 = 0;
3322}
3323
3324bitflags! {
3325    /// `DBGVCR` system register value.
3326    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3327    #[repr(transparent)]
3328    pub struct Dbgvcr: u32 {
3329        /// `SU` bit.
3330        const SU = 1 << 1;
3331        /// `U` bit.
3332        const U = 1 << 1;
3333        /// `S` bit.
3334        const S = 1 << 2;
3335        /// `SS` bit.
3336        const SS = 1 << 2;
3337        /// `P` bit.
3338        const P = 1 << 3;
3339        /// `SP` bit.
3340        const SP = 1 << 3;
3341        /// `D` bit.
3342        const D = 1 << 4;
3343        /// `SD` bit.
3344        const SD = 1 << 4;
3345        /// `I` bit.
3346        const I = 1 << 6;
3347        /// `SI` bit.
3348        const SI = 1 << 6;
3349        /// `F` bit.
3350        const F = 1 << 7;
3351        /// `SF` bit.
3352        const SF = 1 << 7;
3353        /// `MS` bit.
3354        const MS = 1 << 10;
3355        /// `MP` bit.
3356        const MP = 1 << 11;
3357        /// `MD` bit.
3358        const MD = 1 << 12;
3359        /// `MI` bit.
3360        const MI = 1 << 14;
3361        /// `MF` bit.
3362        const MF = 1 << 15;
3363        /// `NSU` bit.
3364        const NSU = 1 << 25;
3365        /// `NSS` bit.
3366        const NSS = 1 << 26;
3367        /// `NSP` bit.
3368        const NSP = 1 << 27;
3369        /// `NSD` bit.
3370        const NSD = 1 << 28;
3371        /// `NSI` bit.
3372        const NSI = 1 << 30;
3373        /// `NSF` bit.
3374        const NSF = 1 << 31;
3375    }
3376}
3377
3378impl Dbgvcr {
3379    /// Offset of the `SU` field.
3380    pub const SU_SHIFT: u32 = 1;
3381    /// Offset of the `U` field.
3382    pub const U_SHIFT: u32 = 1;
3383    /// Offset of the `S` field.
3384    pub const S_SHIFT: u32 = 2;
3385    /// Offset of the `SS` field.
3386    pub const SS_SHIFT: u32 = 2;
3387    /// Offset of the `P` field.
3388    pub const P_SHIFT: u32 = 3;
3389    /// Offset of the `SP` field.
3390    pub const SP_SHIFT: u32 = 3;
3391    /// Offset of the `D` field.
3392    pub const D_SHIFT: u32 = 4;
3393    /// Offset of the `SD` field.
3394    pub const SD_SHIFT: u32 = 4;
3395    /// Offset of the `I` field.
3396    pub const I_SHIFT: u32 = 6;
3397    /// Offset of the `SI` field.
3398    pub const SI_SHIFT: u32 = 6;
3399    /// Offset of the `F` field.
3400    pub const F_SHIFT: u32 = 7;
3401    /// Offset of the `SF` field.
3402    pub const SF_SHIFT: u32 = 7;
3403    /// Offset of the `MS` field.
3404    pub const MS_SHIFT: u32 = 10;
3405    /// Offset of the `MP` field.
3406    pub const MP_SHIFT: u32 = 11;
3407    /// Offset of the `MD` field.
3408    pub const MD_SHIFT: u32 = 12;
3409    /// Offset of the `MI` field.
3410    pub const MI_SHIFT: u32 = 14;
3411    /// Offset of the `MF` field.
3412    pub const MF_SHIFT: u32 = 15;
3413    /// Offset of the `NSU` field.
3414    pub const NSU_SHIFT: u32 = 25;
3415    /// Offset of the `NSS` field.
3416    pub const NSS_SHIFT: u32 = 26;
3417    /// Offset of the `NSP` field.
3418    pub const NSP_SHIFT: u32 = 27;
3419    /// Offset of the `NSD` field.
3420    pub const NSD_SHIFT: u32 = 28;
3421    /// Offset of the `NSI` field.
3422    pub const NSI_SHIFT: u32 = 30;
3423    /// Offset of the `NSF` field.
3424    pub const NSF_SHIFT: u32 = 31;
3425}
3426
3427bitflags! {
3428    /// `DFAR` system register value.
3429    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3430    #[repr(transparent)]
3431    pub struct Dfar: u32 {
3432    }
3433}
3434
3435impl Dfar {
3436    /// Offset of the `VA` field.
3437    pub const VA_SHIFT: u32 = 0;
3438    /// Mask for the `VA` field.
3439    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
3440
3441    /// Returns the value of the `VA` field.
3442    pub const fn va(self) -> u32 {
3443        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
3444    }
3445
3446    /// Sets the value of the `VA` field.
3447    pub const fn set_va(&mut self, value: u32) {
3448        let offset = Self::VA_SHIFT;
3449        assert!(value & (Self::VA_MASK as u32) == value);
3450        *self = Self::from_bits_retain(
3451            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
3452        );
3453    }
3454}
3455
3456bitflags! {
3457    /// `DFSR` system register value.
3458    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3459    #[repr(transparent)]
3460    pub struct Dfsr: u32 {
3461        /// `LPAE` bit.
3462        const LPAE = 1 << 9;
3463        /// `WnR` bit.
3464        const WNR = 1 << 11;
3465        /// `ExT` bit.
3466        const EXT = 1 << 12;
3467        /// `CM` bit.
3468        const CM = 1 << 13;
3469        /// `FnV` bit.
3470        const FNV = 1 << 16;
3471    }
3472}
3473
3474impl Dfsr {
3475    /// Offset of the `STATUS` field.
3476    pub const STATUS_SHIFT: u32 = 0;
3477    /// Mask for the `STATUS` field.
3478    pub const STATUS_MASK: u32 = 0b111111;
3479    /// Offset of the `Domain` field.
3480    pub const DOMAIN_SHIFT: u32 = 4;
3481    /// Mask for the `Domain` field.
3482    pub const DOMAIN_MASK: u32 = 0b1111;
3483    /// Offset of the `LPAE` field.
3484    pub const LPAE_SHIFT: u32 = 9;
3485    /// Offset of the `WnR` field.
3486    pub const WNR_SHIFT: u32 = 11;
3487    /// Offset of the `ExT` field.
3488    pub const EXT_SHIFT: u32 = 12;
3489    /// Offset of the `CM` field.
3490    pub const CM_SHIFT: u32 = 13;
3491    /// Offset of the `AET` field.
3492    pub const AET_SHIFT: u32 = 14;
3493    /// Mask for the `AET` field.
3494    pub const AET_MASK: u32 = 0b11;
3495    /// Offset of the `FnV` field.
3496    pub const FNV_SHIFT: u32 = 16;
3497
3498    /// Returns the value of the `STATUS` field.
3499    pub const fn status(self) -> u8 {
3500        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
3501    }
3502
3503    /// Sets the value of the `STATUS` field.
3504    pub const fn set_status(&mut self, value: u8) {
3505        let offset = Self::STATUS_SHIFT;
3506        assert!(value & (Self::STATUS_MASK as u8) == value);
3507        *self = Self::from_bits_retain(
3508            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
3509        );
3510    }
3511
3512    /// Returns the value of the `Domain` field.
3513    pub const fn domain(self) -> u8 {
3514        ((self.bits() >> Self::DOMAIN_SHIFT) & 0b1111) as u8
3515    }
3516
3517    /// Sets the value of the `Domain` field.
3518    pub const fn set_domain(&mut self, value: u8) {
3519        let offset = Self::DOMAIN_SHIFT;
3520        assert!(value & (Self::DOMAIN_MASK as u8) == value);
3521        *self = Self::from_bits_retain(
3522            (self.bits() & !(Self::DOMAIN_MASK << offset)) | ((value as u32) << offset),
3523        );
3524    }
3525
3526    /// Returns the value of the `AET` field.
3527    pub const fn aet(self) -> u8 {
3528        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
3529    }
3530
3531    /// Sets the value of the `AET` field.
3532    pub const fn set_aet(&mut self, value: u8) {
3533        let offset = Self::AET_SHIFT;
3534        assert!(value & (Self::AET_MASK as u8) == value);
3535        *self = Self::from_bits_retain(
3536            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
3537        );
3538    }
3539}
3540
3541bitflags! {
3542    /// `DISR` system register value.
3543    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3544    #[repr(transparent)]
3545    pub struct Disr: u32 {
3546        /// `EA` bit.
3547        const EA = 1 << 9;
3548        /// `LPAE` bit.
3549        const LPAE = 1 << 9;
3550        /// `ExT` bit.
3551        const EXT = 1 << 12;
3552        /// `A` bit.
3553        const A = 1 << 31;
3554    }
3555}
3556
3557impl Disr {
3558    /// Offset of the `DFSC` field.
3559    pub const DFSC_SHIFT: u32 = 0;
3560    /// Mask for the `DFSC` field.
3561    pub const DFSC_MASK: u32 = 0b111111;
3562    /// Offset of the `STATUS` field.
3563    pub const STATUS_SHIFT: u32 = 0;
3564    /// Mask for the `STATUS` field.
3565    pub const STATUS_MASK: u32 = 0b111111;
3566    /// Offset of the `EA` field.
3567    pub const EA_SHIFT: u32 = 9;
3568    /// Offset of the `LPAE` field.
3569    pub const LPAE_SHIFT: u32 = 9;
3570    /// Offset of the `ExT` field.
3571    pub const EXT_SHIFT: u32 = 12;
3572    /// Offset of the `A` field.
3573    pub const A_SHIFT: u32 = 31;
3574
3575    /// Returns the value of the `DFSC` field.
3576    pub const fn dfsc(self) -> u8 {
3577        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
3578    }
3579
3580    /// Sets the value of the `DFSC` field.
3581    pub const fn set_dfsc(&mut self, value: u8) {
3582        let offset = Self::DFSC_SHIFT;
3583        assert!(value & (Self::DFSC_MASK as u8) == value);
3584        *self = Self::from_bits_retain(
3585            (self.bits() & !(Self::DFSC_MASK << offset)) | ((value as u32) << offset),
3586        );
3587    }
3588
3589    /// Returns the value of the `STATUS` field.
3590    pub const fn status(self) -> u8 {
3591        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
3592    }
3593
3594    /// Sets the value of the `STATUS` field.
3595    pub const fn set_status(&mut self, value: u8) {
3596        let offset = Self::STATUS_SHIFT;
3597        assert!(value & (Self::STATUS_MASK as u8) == value);
3598        *self = Self::from_bits_retain(
3599            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
3600        );
3601    }
3602}
3603
3604#[cfg(feature = "el1")]
3605bitflags! {
3606    /// `DISR_EL1` system register value.
3607    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3608    #[repr(transparent)]
3609    pub struct DisrEl1: u64 {
3610        /// `WnR` bit.
3611        const WNR = 1 << 6;
3612        /// `WnRV` bit.
3613        const WNRV = 1 << 7;
3614        /// `EA` bit.
3615        const EA = 1 << 9;
3616        /// `IDS` bit.
3617        const IDS = 1 << 24;
3618        /// `A` bit.
3619        const A = 1 << 31;
3620    }
3621}
3622
3623#[cfg(feature = "el1")]
3624impl DisrEl1 {
3625    /// Offset of the `DFSC` field.
3626    pub const DFSC_SHIFT: u32 = 0;
3627    /// Mask for the `DFSC` field.
3628    pub const DFSC_MASK: u64 = 0b111111;
3629    /// Offset of the `WnR` field.
3630    pub const WNR_SHIFT: u32 = 6;
3631    /// Offset of the `WnRV` field.
3632    pub const WNRV_SHIFT: u32 = 7;
3633    /// Offset of the `EA` field.
3634    pub const EA_SHIFT: u32 = 9;
3635    /// Offset of the `AET` field.
3636    pub const AET_SHIFT: u32 = 10;
3637    /// Mask for the `AET` field.
3638    pub const AET_MASK: u64 = 0b111;
3639    /// Offset of the `WU` field.
3640    pub const WU_SHIFT: u32 = 16;
3641    /// Mask for the `WU` field.
3642    pub const WU_MASK: u64 = 0b11;
3643    /// Offset of the `IDS` field.
3644    pub const IDS_SHIFT: u32 = 24;
3645    /// Offset of the `A` field.
3646    pub const A_SHIFT: u32 = 31;
3647
3648    /// Returns the value of the `DFSC` field.
3649    pub const fn dfsc(self) -> u8 {
3650        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
3651    }
3652
3653    /// Sets the value of the `DFSC` field.
3654    pub const fn set_dfsc(&mut self, value: u8) {
3655        let offset = Self::DFSC_SHIFT;
3656        assert!(value & (Self::DFSC_MASK as u8) == value);
3657        *self = Self::from_bits_retain(
3658            (self.bits() & !(Self::DFSC_MASK << offset)) | ((value as u64) << offset),
3659        );
3660    }
3661
3662    /// Returns the value of the `AET` field.
3663    pub const fn aet(self) -> u8 {
3664        ((self.bits() >> Self::AET_SHIFT) & 0b111) as u8
3665    }
3666
3667    /// Sets the value of the `AET` field.
3668    pub const fn set_aet(&mut self, value: u8) {
3669        let offset = Self::AET_SHIFT;
3670        assert!(value & (Self::AET_MASK as u8) == value);
3671        *self = Self::from_bits_retain(
3672            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
3673        );
3674    }
3675
3676    /// Returns the value of the `WU` field.
3677    pub const fn wu(self) -> u8 {
3678        ((self.bits() >> Self::WU_SHIFT) & 0b11) as u8
3679    }
3680
3681    /// Sets the value of the `WU` field.
3682    pub const fn set_wu(&mut self, value: u8) {
3683        let offset = Self::WU_SHIFT;
3684        assert!(value & (Self::WU_MASK as u8) == value);
3685        *self = Self::from_bits_retain(
3686            (self.bits() & !(Self::WU_MASK << offset)) | ((value as u64) << offset),
3687        );
3688    }
3689}
3690
3691bitflags! {
3692    /// `DIT` system register value.
3693    ///
3694    /// Data Independent Timing.
3695    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3696    #[repr(transparent)]
3697    pub struct Dit: u64 {
3698        /// Enable data independent timing.
3699        const DIT = 1 << 24;
3700    }
3701}
3702
3703impl Dit {
3704    /// Offset of the `DIT` field.
3705    pub const DIT_SHIFT: u32 = 24;
3706}
3707
3708bitflags! {
3709    /// `DLR` system register value.
3710    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3711    #[repr(transparent)]
3712    pub struct Dlr: u32 {
3713    }
3714}
3715
3716impl Dlr {
3717    /// Offset of the `ADDR` field.
3718    pub const ADDR_SHIFT: u32 = 0;
3719    /// Mask for the `ADDR` field.
3720    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
3721
3722    /// Returns the value of the `ADDR` field.
3723    pub const fn addr(self) -> u32 {
3724        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
3725    }
3726
3727    /// Sets the value of the `ADDR` field.
3728    pub const fn set_addr(&mut self, value: u32) {
3729        let offset = Self::ADDR_SHIFT;
3730        assert!(value & (Self::ADDR_MASK as u32) == value);
3731        *self = Self::from_bits_retain(
3732            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u32) << offset),
3733        );
3734    }
3735}
3736
3737bitflags! {
3738    /// `DSPSR` system register value.
3739    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3740    #[repr(transparent)]
3741    pub struct Dspsr: u32 {
3742        /// `T` bit.
3743        const T = 1 << 5;
3744        /// `F` bit.
3745        const F = 1 << 6;
3746        /// `I` bit.
3747        const I = 1 << 7;
3748        /// `A` bit.
3749        const A = 1 << 8;
3750        /// `E` bit.
3751        const E = 1 << 9;
3752        /// `IL` bit.
3753        const IL = 1 << 20;
3754        /// `SS` bit.
3755        const SS = 1 << 21;
3756        /// `PAN` bit.
3757        const PAN = 1 << 22;
3758        /// `SSBS` bit.
3759        const SSBS = 1 << 23;
3760        /// `DIT` bit.
3761        const DIT = 1 << 24;
3762        /// `Q` bit.
3763        const Q = 1 << 27;
3764        /// `V` bit.
3765        const V = 1 << 28;
3766        /// `C` bit.
3767        const C = 1 << 29;
3768        /// `Z` bit.
3769        const Z = 1 << 30;
3770        /// `N` bit.
3771        const N = 1 << 31;
3772    }
3773}
3774
3775impl Dspsr {
3776    /// Offset of the `M[4:0]` field.
3777    pub const M_4_0_SHIFT: u32 = 0;
3778    /// Mask for the `M[4:0]` field.
3779    pub const M_4_0_MASK: u32 = 0b11111;
3780    /// Offset of the `T` field.
3781    pub const T_SHIFT: u32 = 5;
3782    /// Offset of the `F` field.
3783    pub const F_SHIFT: u32 = 6;
3784    /// Offset of the `I` field.
3785    pub const I_SHIFT: u32 = 7;
3786    /// Offset of the `A` field.
3787    pub const A_SHIFT: u32 = 8;
3788    /// Offset of the `E` field.
3789    pub const E_SHIFT: u32 = 9;
3790    /// Offset of the `GE` field.
3791    pub const GE_SHIFT: u32 = 16;
3792    /// Mask for the `GE` field.
3793    pub const GE_MASK: u32 = 0b1111;
3794    /// Offset of the `IL` field.
3795    pub const IL_SHIFT: u32 = 20;
3796    /// Offset of the `SS` field.
3797    pub const SS_SHIFT: u32 = 21;
3798    /// Offset of the `PAN` field.
3799    pub const PAN_SHIFT: u32 = 22;
3800    /// Offset of the `SSBS` field.
3801    pub const SSBS_SHIFT: u32 = 23;
3802    /// Offset of the `DIT` field.
3803    pub const DIT_SHIFT: u32 = 24;
3804    /// Offset of the `Q` field.
3805    pub const Q_SHIFT: u32 = 27;
3806    /// Offset of the `V` field.
3807    pub const V_SHIFT: u32 = 28;
3808    /// Offset of the `C` field.
3809    pub const C_SHIFT: u32 = 29;
3810    /// Offset of the `Z` field.
3811    pub const Z_SHIFT: u32 = 30;
3812    /// Offset of the `N` field.
3813    pub const N_SHIFT: u32 = 31;
3814
3815    /// Returns the value of the `M[4:0]` field.
3816    pub const fn m_4_0(self) -> u8 {
3817        ((self.bits() >> Self::M_4_0_SHIFT) & 0b11111) as u8
3818    }
3819
3820    /// Sets the value of the `M[4:0]` field.
3821    pub const fn set_m_4_0(&mut self, value: u8) {
3822        let offset = Self::M_4_0_SHIFT;
3823        assert!(value & (Self::M_4_0_MASK as u8) == value);
3824        *self = Self::from_bits_retain(
3825            (self.bits() & !(Self::M_4_0_MASK << offset)) | ((value as u32) << offset),
3826        );
3827    }
3828
3829    /// Returns the value of the `GE` field.
3830    pub const fn ge(self) -> u8 {
3831        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
3832    }
3833
3834    /// Sets the value of the `GE` field.
3835    pub const fn set_ge(&mut self, value: u8) {
3836        let offset = Self::GE_SHIFT;
3837        assert!(value & (Self::GE_MASK as u8) == value);
3838        *self = Self::from_bits_retain(
3839            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u32) << offset),
3840        );
3841    }
3842}
3843
3844bitflags! {
3845    /// `DSPSR2` system register value.
3846    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3847    #[repr(transparent)]
3848    pub struct Dspsr2: u32 {
3849        /// `PPEND` bit.
3850        const PPEND = 1 << 1;
3851        /// `UINJ` bit.
3852        const UINJ = 1 << 4;
3853    }
3854}
3855
3856impl Dspsr2 {
3857    /// Offset of the `PPEND` field.
3858    pub const PPEND_SHIFT: u32 = 1;
3859    /// Offset of the `UINJ` field.
3860    pub const UINJ_SHIFT: u32 = 4;
3861}
3862
3863#[cfg(feature = "el1")]
3864bitflags! {
3865    /// `ELR_EL1` system register value.
3866    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3867    #[repr(transparent)]
3868    pub struct ElrEl1: u64 {
3869    }
3870}
3871
3872#[cfg(feature = "el1")]
3873impl ElrEl1 {
3874    /// Offset of the `ADDR` field.
3875    pub const ADDR_SHIFT: u32 = 0;
3876    /// Mask for the `ADDR` field.
3877    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
3878
3879    /// Returns the value of the `ADDR` field.
3880    pub const fn addr(self) -> u64 {
3881        ((self.bits() >> Self::ADDR_SHIFT)
3882            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3883    }
3884
3885    /// Sets the value of the `ADDR` field.
3886    pub const fn set_addr(&mut self, value: u64) {
3887        let offset = Self::ADDR_SHIFT;
3888        assert!(value & (Self::ADDR_MASK as u64) == value);
3889        *self = Self::from_bits_retain(
3890            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u64) << offset),
3891        );
3892    }
3893}
3894
3895#[cfg(feature = "el2")]
3896bitflags! {
3897    /// `ELR_EL2` system register value.
3898    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3899    #[repr(transparent)]
3900    pub struct ElrEl2: u64 {
3901    }
3902}
3903
3904#[cfg(feature = "el2")]
3905impl ElrEl2 {
3906    /// Offset of the `ADDR` field.
3907    pub const ADDR_SHIFT: u32 = 0;
3908    /// Mask for the `ADDR` field.
3909    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
3910
3911    /// Returns the value of the `ADDR` field.
3912    pub const fn addr(self) -> u64 {
3913        ((self.bits() >> Self::ADDR_SHIFT)
3914            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3915    }
3916
3917    /// Sets the value of the `ADDR` field.
3918    pub const fn set_addr(&mut self, value: u64) {
3919        let offset = Self::ADDR_SHIFT;
3920        assert!(value & (Self::ADDR_MASK as u64) == value);
3921        *self = Self::from_bits_retain(
3922            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u64) << offset),
3923        );
3924    }
3925}
3926
3927#[cfg(feature = "el2")]
3928bitflags! {
3929    /// `ELR_hyp` system register value.
3930    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3931    #[repr(transparent)]
3932    pub struct ElrHyp: u32 {
3933    }
3934}
3935
3936#[cfg(feature = "el2")]
3937impl ElrHyp {
3938    /// Offset of the `ADDR` field.
3939    pub const ADDR_SHIFT: u32 = 0;
3940    /// Mask for the `ADDR` field.
3941    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
3942
3943    /// Returns the value of the `ADDR` field.
3944    pub const fn addr(self) -> u32 {
3945        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
3946    }
3947
3948    /// Sets the value of the `ADDR` field.
3949    pub const fn set_addr(&mut self, value: u32) {
3950        let offset = Self::ADDR_SHIFT;
3951        assert!(value & (Self::ADDR_MASK as u32) == value);
3952        *self = Self::from_bits_retain(
3953            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u32) << offset),
3954        );
3955    }
3956}
3957
3958bitflags! {
3959    /// `ERRIDR` system register value.
3960    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3961    #[repr(transparent)]
3962    pub struct Erridr: u32 {
3963    }
3964}
3965
3966impl Erridr {
3967    /// Offset of the `NUM` field.
3968    pub const NUM_SHIFT: u32 = 0;
3969    /// Mask for the `NUM` field.
3970    pub const NUM_MASK: u32 = 0b1111111111111111;
3971
3972    /// Returns the value of the `NUM` field.
3973    pub const fn num(self) -> u16 {
3974        ((self.bits() >> Self::NUM_SHIFT) & 0b1111111111111111) as u16
3975    }
3976
3977    /// Sets the value of the `NUM` field.
3978    pub const fn set_num(&mut self, value: u16) {
3979        let offset = Self::NUM_SHIFT;
3980        assert!(value & (Self::NUM_MASK as u16) == value);
3981        *self = Self::from_bits_retain(
3982            (self.bits() & !(Self::NUM_MASK << offset)) | ((value as u32) << offset),
3983        );
3984    }
3985}
3986
3987bitflags! {
3988    /// `ERRSELR` system register value.
3989    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3990    #[repr(transparent)]
3991    pub struct Errselr: u32 {
3992    }
3993}
3994
3995impl Errselr {
3996    /// Offset of the `SEL` field.
3997    pub const SEL_SHIFT: u32 = 0;
3998    /// Mask for the `SEL` field.
3999    pub const SEL_MASK: u32 = 0b1111111111111111;
4000
4001    /// Returns the value of the `SEL` field.
4002    pub const fn sel(self) -> u16 {
4003        ((self.bits() >> Self::SEL_SHIFT) & 0b1111111111111111) as u16
4004    }
4005
4006    /// Sets the value of the `SEL` field.
4007    pub const fn set_sel(&mut self, value: u16) {
4008        let offset = Self::SEL_SHIFT;
4009        assert!(value & (Self::SEL_MASK as u16) == value);
4010        *self = Self::from_bits_retain(
4011            (self.bits() & !(Self::SEL_MASK << offset)) | ((value as u32) << offset),
4012        );
4013    }
4014}
4015
4016bitflags! {
4017    /// `ERXADDR` system register value.
4018    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4019    #[repr(transparent)]
4020    pub struct Erxaddr: u32 {
4021    }
4022}
4023
4024impl Erxaddr {
4025    /// Offset of the `ERRnADDRlo` field.
4026    pub const ERRNADDRLO_SHIFT: u32 = 0;
4027    /// Mask for the `ERRnADDRlo` field.
4028    pub const ERRNADDRLO_MASK: u32 = 0b11111111111111111111111111111111;
4029
4030    /// Returns the value of the `ERRnADDRlo` field.
4031    pub const fn errnaddrlo(self) -> u32 {
4032        ((self.bits() >> Self::ERRNADDRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
4033    }
4034
4035    /// Sets the value of the `ERRnADDRlo` field.
4036    pub const fn set_errnaddrlo(&mut self, value: u32) {
4037        let offset = Self::ERRNADDRLO_SHIFT;
4038        assert!(value & (Self::ERRNADDRLO_MASK as u32) == value);
4039        *self = Self::from_bits_retain(
4040            (self.bits() & !(Self::ERRNADDRLO_MASK << offset)) | ((value as u32) << offset),
4041        );
4042    }
4043}
4044
4045bitflags! {
4046    /// `ERXADDR2` system register value.
4047    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4048    #[repr(transparent)]
4049    pub struct Erxaddr2: u32 {
4050    }
4051}
4052
4053impl Erxaddr2 {
4054    /// Offset of the `ERRnADDRhi` field.
4055    pub const ERRNADDRHI_SHIFT: u32 = 0;
4056    /// Mask for the `ERRnADDRhi` field.
4057    pub const ERRNADDRHI_MASK: u32 = 0b11111111111111111111111111111111;
4058
4059    /// Returns the value of the `ERRnADDRhi` field.
4060    pub const fn errnaddrhi(self) -> u32 {
4061        ((self.bits() >> Self::ERRNADDRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
4062    }
4063
4064    /// Sets the value of the `ERRnADDRhi` field.
4065    pub const fn set_errnaddrhi(&mut self, value: u32) {
4066        let offset = Self::ERRNADDRHI_SHIFT;
4067        assert!(value & (Self::ERRNADDRHI_MASK as u32) == value);
4068        *self = Self::from_bits_retain(
4069            (self.bits() & !(Self::ERRNADDRHI_MASK << offset)) | ((value as u32) << offset),
4070        );
4071    }
4072}
4073
4074bitflags! {
4075    /// `ERXCTLR` system register value.
4076    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4077    #[repr(transparent)]
4078    pub struct Erxctlr: u32 {
4079    }
4080}
4081
4082impl Erxctlr {
4083    /// Offset of the `ERRnCTLRlo` field.
4084    pub const ERRNCTLRLO_SHIFT: u32 = 0;
4085    /// Mask for the `ERRnCTLRlo` field.
4086    pub const ERRNCTLRLO_MASK: u32 = 0b11111111111111111111111111111111;
4087
4088    /// Returns the value of the `ERRnCTLRlo` field.
4089    pub const fn errnctlrlo(self) -> u32 {
4090        ((self.bits() >> Self::ERRNCTLRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
4091    }
4092
4093    /// Sets the value of the `ERRnCTLRlo` field.
4094    pub const fn set_errnctlrlo(&mut self, value: u32) {
4095        let offset = Self::ERRNCTLRLO_SHIFT;
4096        assert!(value & (Self::ERRNCTLRLO_MASK as u32) == value);
4097        *self = Self::from_bits_retain(
4098            (self.bits() & !(Self::ERRNCTLRLO_MASK << offset)) | ((value as u32) << offset),
4099        );
4100    }
4101}
4102
4103bitflags! {
4104    /// `ERXCTLR2` system register value.
4105    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4106    #[repr(transparent)]
4107    pub struct Erxctlr2: u32 {
4108    }
4109}
4110
4111impl Erxctlr2 {
4112    /// Offset of the `ERRnCTLRhi` field.
4113    pub const ERRNCTLRHI_SHIFT: u32 = 0;
4114    /// Mask for the `ERRnCTLRhi` field.
4115    pub const ERRNCTLRHI_MASK: u32 = 0b11111111111111111111111111111111;
4116
4117    /// Returns the value of the `ERRnCTLRhi` field.
4118    pub const fn errnctlrhi(self) -> u32 {
4119        ((self.bits() >> Self::ERRNCTLRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
4120    }
4121
4122    /// Sets the value of the `ERRnCTLRhi` field.
4123    pub const fn set_errnctlrhi(&mut self, value: u32) {
4124        let offset = Self::ERRNCTLRHI_SHIFT;
4125        assert!(value & (Self::ERRNCTLRHI_MASK as u32) == value);
4126        *self = Self::from_bits_retain(
4127            (self.bits() & !(Self::ERRNCTLRHI_MASK << offset)) | ((value as u32) << offset),
4128        );
4129    }
4130}
4131
4132bitflags! {
4133    /// `ERXFR` system register value.
4134    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4135    #[repr(transparent)]
4136    pub struct Erxfr: u32 {
4137    }
4138}
4139
4140impl Erxfr {
4141    /// Offset of the `ERRnFRlo` field.
4142    pub const ERRNFRLO_SHIFT: u32 = 0;
4143    /// Mask for the `ERRnFRlo` field.
4144    pub const ERRNFRLO_MASK: u32 = 0b11111111111111111111111111111111;
4145
4146    /// Returns the value of the `ERRnFRlo` field.
4147    pub const fn errnfrlo(self) -> u32 {
4148        ((self.bits() >> Self::ERRNFRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
4149    }
4150
4151    /// Sets the value of the `ERRnFRlo` field.
4152    pub const fn set_errnfrlo(&mut self, value: u32) {
4153        let offset = Self::ERRNFRLO_SHIFT;
4154        assert!(value & (Self::ERRNFRLO_MASK as u32) == value);
4155        *self = Self::from_bits_retain(
4156            (self.bits() & !(Self::ERRNFRLO_MASK << offset)) | ((value as u32) << offset),
4157        );
4158    }
4159}
4160
4161bitflags! {
4162    /// `ERXFR2` system register value.
4163    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4164    #[repr(transparent)]
4165    pub struct Erxfr2: u32 {
4166    }
4167}
4168
4169impl Erxfr2 {
4170    /// Offset of the `ERRnFRhi` field.
4171    pub const ERRNFRHI_SHIFT: u32 = 0;
4172    /// Mask for the `ERRnFRhi` field.
4173    pub const ERRNFRHI_MASK: u32 = 0b11111111111111111111111111111111;
4174
4175    /// Returns the value of the `ERRnFRhi` field.
4176    pub const fn errnfrhi(self) -> u32 {
4177        ((self.bits() >> Self::ERRNFRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
4178    }
4179
4180    /// Sets the value of the `ERRnFRhi` field.
4181    pub const fn set_errnfrhi(&mut self, value: u32) {
4182        let offset = Self::ERRNFRHI_SHIFT;
4183        assert!(value & (Self::ERRNFRHI_MASK as u32) == value);
4184        *self = Self::from_bits_retain(
4185            (self.bits() & !(Self::ERRNFRHI_MASK << offset)) | ((value as u32) << offset),
4186        );
4187    }
4188}
4189
4190bitflags! {
4191    /// `ERXMISC0` system register value.
4192    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4193    #[repr(transparent)]
4194    pub struct Erxmisc0: u32 {
4195    }
4196}
4197
4198impl Erxmisc0 {
4199    /// Offset of the `ERRnMISC0lo` field.
4200    pub const ERRNMISC0LO_SHIFT: u32 = 0;
4201    /// Mask for the `ERRnMISC0lo` field.
4202    pub const ERRNMISC0LO_MASK: u32 = 0b11111111111111111111111111111111;
4203
4204    /// Returns the value of the `ERRnMISC0lo` field.
4205    pub const fn errnmisc0lo(self) -> u32 {
4206        ((self.bits() >> Self::ERRNMISC0LO_SHIFT) & 0b11111111111111111111111111111111) as u32
4207    }
4208
4209    /// Sets the value of the `ERRnMISC0lo` field.
4210    pub const fn set_errnmisc0lo(&mut self, value: u32) {
4211        let offset = Self::ERRNMISC0LO_SHIFT;
4212        assert!(value & (Self::ERRNMISC0LO_MASK as u32) == value);
4213        *self = Self::from_bits_retain(
4214            (self.bits() & !(Self::ERRNMISC0LO_MASK << offset)) | ((value as u32) << offset),
4215        );
4216    }
4217}
4218
4219bitflags! {
4220    /// `ERXMISC1` system register value.
4221    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4222    #[repr(transparent)]
4223    pub struct Erxmisc1: u32 {
4224    }
4225}
4226
4227impl Erxmisc1 {
4228    /// Offset of the `ERRnMISC0hi` field.
4229    pub const ERRNMISC0HI_SHIFT: u32 = 0;
4230    /// Mask for the `ERRnMISC0hi` field.
4231    pub const ERRNMISC0HI_MASK: u32 = 0b11111111111111111111111111111111;
4232
4233    /// Returns the value of the `ERRnMISC0hi` field.
4234    pub const fn errnmisc0hi(self) -> u32 {
4235        ((self.bits() >> Self::ERRNMISC0HI_SHIFT) & 0b11111111111111111111111111111111) as u32
4236    }
4237
4238    /// Sets the value of the `ERRnMISC0hi` field.
4239    pub const fn set_errnmisc0hi(&mut self, value: u32) {
4240        let offset = Self::ERRNMISC0HI_SHIFT;
4241        assert!(value & (Self::ERRNMISC0HI_MASK as u32) == value);
4242        *self = Self::from_bits_retain(
4243            (self.bits() & !(Self::ERRNMISC0HI_MASK << offset)) | ((value as u32) << offset),
4244        );
4245    }
4246}
4247
4248bitflags! {
4249    /// `ERXMISC2` system register value.
4250    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4251    #[repr(transparent)]
4252    pub struct Erxmisc2: u32 {
4253    }
4254}
4255
4256impl Erxmisc2 {
4257    /// Offset of the `ERRnMISC1lo` field.
4258    pub const ERRNMISC1LO_SHIFT: u32 = 0;
4259    /// Mask for the `ERRnMISC1lo` field.
4260    pub const ERRNMISC1LO_MASK: u32 = 0b11111111111111111111111111111111;
4261
4262    /// Returns the value of the `ERRnMISC1lo` field.
4263    pub const fn errnmisc1lo(self) -> u32 {
4264        ((self.bits() >> Self::ERRNMISC1LO_SHIFT) & 0b11111111111111111111111111111111) as u32
4265    }
4266
4267    /// Sets the value of the `ERRnMISC1lo` field.
4268    pub const fn set_errnmisc1lo(&mut self, value: u32) {
4269        let offset = Self::ERRNMISC1LO_SHIFT;
4270        assert!(value & (Self::ERRNMISC1LO_MASK as u32) == value);
4271        *self = Self::from_bits_retain(
4272            (self.bits() & !(Self::ERRNMISC1LO_MASK << offset)) | ((value as u32) << offset),
4273        );
4274    }
4275}
4276
4277bitflags! {
4278    /// `ERXMISC3` system register value.
4279    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4280    #[repr(transparent)]
4281    pub struct Erxmisc3: u32 {
4282    }
4283}
4284
4285impl Erxmisc3 {
4286    /// Offset of the `ERRnMISC1hi` field.
4287    pub const ERRNMISC1HI_SHIFT: u32 = 0;
4288    /// Mask for the `ERRnMISC1hi` field.
4289    pub const ERRNMISC1HI_MASK: u32 = 0b11111111111111111111111111111111;
4290
4291    /// Returns the value of the `ERRnMISC1hi` field.
4292    pub const fn errnmisc1hi(self) -> u32 {
4293        ((self.bits() >> Self::ERRNMISC1HI_SHIFT) & 0b11111111111111111111111111111111) as u32
4294    }
4295
4296    /// Sets the value of the `ERRnMISC1hi` field.
4297    pub const fn set_errnmisc1hi(&mut self, value: u32) {
4298        let offset = Self::ERRNMISC1HI_SHIFT;
4299        assert!(value & (Self::ERRNMISC1HI_MASK as u32) == value);
4300        *self = Self::from_bits_retain(
4301            (self.bits() & !(Self::ERRNMISC1HI_MASK << offset)) | ((value as u32) << offset),
4302        );
4303    }
4304}
4305
4306bitflags! {
4307    /// `ERXMISC4` system register value.
4308    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4309    #[repr(transparent)]
4310    pub struct Erxmisc4: u32 {
4311    }
4312}
4313
4314impl Erxmisc4 {
4315    /// Offset of the `ERRnMISC2lo` field.
4316    pub const ERRNMISC2LO_SHIFT: u32 = 0;
4317    /// Mask for the `ERRnMISC2lo` field.
4318    pub const ERRNMISC2LO_MASK: u32 = 0b11111111111111111111111111111111;
4319
4320    /// Returns the value of the `ERRnMISC2lo` field.
4321    pub const fn errnmisc2lo(self) -> u32 {
4322        ((self.bits() >> Self::ERRNMISC2LO_SHIFT) & 0b11111111111111111111111111111111) as u32
4323    }
4324
4325    /// Sets the value of the `ERRnMISC2lo` field.
4326    pub const fn set_errnmisc2lo(&mut self, value: u32) {
4327        let offset = Self::ERRNMISC2LO_SHIFT;
4328        assert!(value & (Self::ERRNMISC2LO_MASK as u32) == value);
4329        *self = Self::from_bits_retain(
4330            (self.bits() & !(Self::ERRNMISC2LO_MASK << offset)) | ((value as u32) << offset),
4331        );
4332    }
4333}
4334
4335bitflags! {
4336    /// `ERXMISC5` system register value.
4337    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4338    #[repr(transparent)]
4339    pub struct Erxmisc5: u32 {
4340    }
4341}
4342
4343impl Erxmisc5 {
4344    /// Offset of the `ERRnMISC2hi` field.
4345    pub const ERRNMISC2HI_SHIFT: u32 = 0;
4346    /// Mask for the `ERRnMISC2hi` field.
4347    pub const ERRNMISC2HI_MASK: u32 = 0b11111111111111111111111111111111;
4348
4349    /// Returns the value of the `ERRnMISC2hi` field.
4350    pub const fn errnmisc2hi(self) -> u32 {
4351        ((self.bits() >> Self::ERRNMISC2HI_SHIFT) & 0b11111111111111111111111111111111) as u32
4352    }
4353
4354    /// Sets the value of the `ERRnMISC2hi` field.
4355    pub const fn set_errnmisc2hi(&mut self, value: u32) {
4356        let offset = Self::ERRNMISC2HI_SHIFT;
4357        assert!(value & (Self::ERRNMISC2HI_MASK as u32) == value);
4358        *self = Self::from_bits_retain(
4359            (self.bits() & !(Self::ERRNMISC2HI_MASK << offset)) | ((value as u32) << offset),
4360        );
4361    }
4362}
4363
4364bitflags! {
4365    /// `ERXMISC6` system register value.
4366    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4367    #[repr(transparent)]
4368    pub struct Erxmisc6: u32 {
4369    }
4370}
4371
4372impl Erxmisc6 {
4373    /// Offset of the `ERRnMISC3lo` field.
4374    pub const ERRNMISC3LO_SHIFT: u32 = 0;
4375    /// Mask for the `ERRnMISC3lo` field.
4376    pub const ERRNMISC3LO_MASK: u32 = 0b11111111111111111111111111111111;
4377
4378    /// Returns the value of the `ERRnMISC3lo` field.
4379    pub const fn errnmisc3lo(self) -> u32 {
4380        ((self.bits() >> Self::ERRNMISC3LO_SHIFT) & 0b11111111111111111111111111111111) as u32
4381    }
4382
4383    /// Sets the value of the `ERRnMISC3lo` field.
4384    pub const fn set_errnmisc3lo(&mut self, value: u32) {
4385        let offset = Self::ERRNMISC3LO_SHIFT;
4386        assert!(value & (Self::ERRNMISC3LO_MASK as u32) == value);
4387        *self = Self::from_bits_retain(
4388            (self.bits() & !(Self::ERRNMISC3LO_MASK << offset)) | ((value as u32) << offset),
4389        );
4390    }
4391}
4392
4393bitflags! {
4394    /// `ERXMISC7` system register value.
4395    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4396    #[repr(transparent)]
4397    pub struct Erxmisc7: u32 {
4398    }
4399}
4400
4401impl Erxmisc7 {
4402    /// Offset of the `ERRnMISC3hi` field.
4403    pub const ERRNMISC3HI_SHIFT: u32 = 0;
4404    /// Mask for the `ERRnMISC3hi` field.
4405    pub const ERRNMISC3HI_MASK: u32 = 0b11111111111111111111111111111111;
4406
4407    /// Returns the value of the `ERRnMISC3hi` field.
4408    pub const fn errnmisc3hi(self) -> u32 {
4409        ((self.bits() >> Self::ERRNMISC3HI_SHIFT) & 0b11111111111111111111111111111111) as u32
4410    }
4411
4412    /// Sets the value of the `ERRnMISC3hi` field.
4413    pub const fn set_errnmisc3hi(&mut self, value: u32) {
4414        let offset = Self::ERRNMISC3HI_SHIFT;
4415        assert!(value & (Self::ERRNMISC3HI_MASK as u32) == value);
4416        *self = Self::from_bits_retain(
4417            (self.bits() & !(Self::ERRNMISC3HI_MASK << offset)) | ((value as u32) << offset),
4418        );
4419    }
4420}
4421
4422bitflags! {
4423    /// `ERXSTATUS` system register value.
4424    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4425    #[repr(transparent)]
4426    pub struct Erxstatus: u32 {
4427    }
4428}
4429
4430impl Erxstatus {
4431    /// Offset of the `ERRnSTATUSlo` field.
4432    pub const ERRNSTATUSLO_SHIFT: u32 = 0;
4433    /// Mask for the `ERRnSTATUSlo` field.
4434    pub const ERRNSTATUSLO_MASK: u32 = 0b11111111111111111111111111111111;
4435
4436    /// Returns the value of the `ERRnSTATUSlo` field.
4437    pub const fn errnstatuslo(self) -> u32 {
4438        ((self.bits() >> Self::ERRNSTATUSLO_SHIFT) & 0b11111111111111111111111111111111) as u32
4439    }
4440
4441    /// Sets the value of the `ERRnSTATUSlo` field.
4442    pub const fn set_errnstatuslo(&mut self, value: u32) {
4443        let offset = Self::ERRNSTATUSLO_SHIFT;
4444        assert!(value & (Self::ERRNSTATUSLO_MASK as u32) == value);
4445        *self = Self::from_bits_retain(
4446            (self.bits() & !(Self::ERRNSTATUSLO_MASK << offset)) | ((value as u32) << offset),
4447        );
4448    }
4449}
4450
4451#[cfg(feature = "el1")]
4452bitflags! {
4453    /// `ESR_EL1` system register value.
4454    #[derive(Clone, Copy, Eq, Default, PartialEq)]
4455    #[repr(transparent)]
4456    pub struct EsrEl1: u64 {
4457        /// `IL` bit.
4458        const IL = 1 << 25;
4459    }
4460}
4461
4462#[cfg(feature = "el1")]
4463impl EsrEl1 {
4464    /// Offset of the `ISS` field.
4465    pub const ISS_SHIFT: u32 = 0;
4466    /// Mask for the `ISS` field.
4467    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
4468    /// Offset of the `IL` field.
4469    pub const IL_SHIFT: u32 = 25;
4470    /// Offset of the `EC` field.
4471    pub const EC_SHIFT: u32 = 26;
4472    /// Mask for the `EC` field.
4473    pub const EC_MASK: u64 = 0b111111;
4474    /// Offset of the `ISS2` field.
4475    pub const ISS2_SHIFT: u32 = 32;
4476    /// Mask for the `ISS2` field.
4477    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
4478
4479    /// Returns the value of the `ISS` field.
4480    pub const fn iss(self) -> u32 {
4481        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
4482    }
4483
4484    /// Sets the value of the `ISS` field.
4485    pub const fn set_iss(&mut self, value: u32) {
4486        let offset = Self::ISS_SHIFT;
4487        assert!(value & (Self::ISS_MASK as u32) == value);
4488        *self = Self::from_bits_retain(
4489            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
4490        );
4491    }
4492
4493    /// Returns the value of the `EC` field.
4494    pub const fn ec(self) -> u8 {
4495        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
4496    }
4497
4498    /// Sets the value of the `EC` field.
4499    pub const fn set_ec(&mut self, value: u8) {
4500        let offset = Self::EC_SHIFT;
4501        assert!(value & (Self::EC_MASK as u8) == value);
4502        *self = Self::from_bits_retain(
4503            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
4504        );
4505    }
4506
4507    /// Returns the value of the `ISS2` field.
4508    pub const fn iss2(self) -> u32 {
4509        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
4510    }
4511
4512    /// Sets the value of the `ISS2` field.
4513    pub const fn set_iss2(&mut self, value: u32) {
4514        let offset = Self::ISS2_SHIFT;
4515        assert!(value & (Self::ISS2_MASK as u32) == value);
4516        *self = Self::from_bits_retain(
4517            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
4518        );
4519    }
4520}
4521
4522#[cfg(feature = "el2")]
4523bitflags! {
4524    /// `ESR_EL2` system register value.
4525    #[derive(Clone, Copy, Eq, Default, PartialEq)]
4526    #[repr(transparent)]
4527    pub struct EsrEl2: u64 {
4528        /// 32-bit instruction length.
4529        const IL = 1 << 25;
4530    }
4531}
4532
4533#[cfg(feature = "el2")]
4534impl EsrEl2 {
4535    /// Offset of the `ISS` field.
4536    pub const ISS_SHIFT: u32 = 0;
4537    /// Mask for the `ISS` field.
4538    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
4539    /// Offset of the `IL` field.
4540    pub const IL_SHIFT: u32 = 25;
4541    /// Offset of the `EC` field.
4542    pub const EC_SHIFT: u32 = 26;
4543    /// Mask for the `EC` field.
4544    pub const EC_MASK: u64 = 0b111111;
4545    /// Offset of the `ISS2` field.
4546    pub const ISS2_SHIFT: u32 = 32;
4547    /// Mask for the `ISS2` field.
4548    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
4549
4550    /// Returns the value of the `ISS` field.
4551    pub const fn iss(self) -> u32 {
4552        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
4553    }
4554
4555    /// Sets the value of the `ISS` field.
4556    pub const fn set_iss(&mut self, value: u32) {
4557        let offset = Self::ISS_SHIFT;
4558        assert!(value & (Self::ISS_MASK as u32) == value);
4559        *self = Self::from_bits_retain(
4560            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
4561        );
4562    }
4563
4564    /// Returns the value of the `EC` field.
4565    pub const fn ec(self) -> u8 {
4566        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
4567    }
4568
4569    /// Sets the value of the `EC` field.
4570    pub const fn set_ec(&mut self, value: u8) {
4571        let offset = Self::EC_SHIFT;
4572        assert!(value & (Self::EC_MASK as u8) == value);
4573        *self = Self::from_bits_retain(
4574            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
4575        );
4576    }
4577
4578    /// Returns the value of the `ISS2` field.
4579    pub const fn iss2(self) -> u32 {
4580        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
4581    }
4582
4583    /// Sets the value of the `ISS2` field.
4584    pub const fn set_iss2(&mut self, value: u32) {
4585        let offset = Self::ISS2_SHIFT;
4586        assert!(value & (Self::ISS2_MASK as u32) == value);
4587        *self = Self::from_bits_retain(
4588            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
4589        );
4590    }
4591}
4592
4593#[cfg(feature = "el3")]
4594bitflags! {
4595    /// `ESR_EL3` system register value.
4596    #[derive(Clone, Copy, Eq, Default, PartialEq)]
4597    #[repr(transparent)]
4598    pub struct EsrEl3: u64 {
4599        /// 32-bit instruction length.
4600        const IL = 1 << 25;
4601    }
4602}
4603
4604#[cfg(feature = "el3")]
4605impl EsrEl3 {
4606    /// Offset of the `ISS` field.
4607    pub const ISS_SHIFT: u32 = 0;
4608    /// Mask for the `ISS` field.
4609    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
4610    /// Offset of the `IL` field.
4611    pub const IL_SHIFT: u32 = 25;
4612    /// Offset of the `EC` field.
4613    pub const EC_SHIFT: u32 = 26;
4614    /// Mask for the `EC` field.
4615    pub const EC_MASK: u64 = 0b111111;
4616    /// Offset of the `ISS2` field.
4617    pub const ISS2_SHIFT: u32 = 32;
4618    /// Mask for the `ISS2` field.
4619    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
4620
4621    /// Returns the value of the `ISS` field.
4622    pub const fn iss(self) -> u32 {
4623        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
4624    }
4625
4626    /// Sets the value of the `ISS` field.
4627    pub const fn set_iss(&mut self, value: u32) {
4628        let offset = Self::ISS_SHIFT;
4629        assert!(value & (Self::ISS_MASK as u32) == value);
4630        *self = Self::from_bits_retain(
4631            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
4632        );
4633    }
4634
4635    /// Returns the value of the `EC` field.
4636    pub const fn ec(self) -> u8 {
4637        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
4638    }
4639
4640    /// Sets the value of the `EC` field.
4641    pub const fn set_ec(&mut self, value: u8) {
4642        let offset = Self::EC_SHIFT;
4643        assert!(value & (Self::EC_MASK as u8) == value);
4644        *self = Self::from_bits_retain(
4645            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
4646        );
4647    }
4648
4649    /// Returns the value of the `ISS2` field.
4650    pub const fn iss2(self) -> u32 {
4651        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
4652    }
4653
4654    /// Sets the value of the `ISS2` field.
4655    pub const fn set_iss2(&mut self, value: u32) {
4656        let offset = Self::ISS2_SHIFT;
4657        assert!(value & (Self::ISS2_MASK as u32) == value);
4658        *self = Self::from_bits_retain(
4659            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
4660        );
4661    }
4662}
4663
4664#[cfg(feature = "el1")]
4665bitflags! {
4666    /// `FAR_EL1` system register value.
4667    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4668    #[repr(transparent)]
4669    pub struct FarEl1: u64 {
4670    }
4671}
4672
4673#[cfg(feature = "el1")]
4674impl FarEl1 {
4675    /// Offset of the `VA` field.
4676    pub const VA_SHIFT: u32 = 0;
4677    /// Mask for the `VA` field.
4678    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
4679
4680    /// Returns the value of the `VA` field.
4681    pub const fn va(self) -> u64 {
4682        ((self.bits() >> Self::VA_SHIFT)
4683            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
4684    }
4685
4686    /// Sets the value of the `VA` field.
4687    pub const fn set_va(&mut self, value: u64) {
4688        let offset = Self::VA_SHIFT;
4689        assert!(value & (Self::VA_MASK as u64) == value);
4690        *self = Self::from_bits_retain(
4691            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u64) << offset),
4692        );
4693    }
4694}
4695
4696#[cfg(feature = "el2")]
4697bitflags! {
4698    /// `FAR_EL2` system register value.
4699    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4700    #[repr(transparent)]
4701    pub struct FarEl2: u64 {
4702    }
4703}
4704
4705#[cfg(feature = "el2")]
4706impl FarEl2 {
4707    /// Offset of the `VA` field.
4708    pub const VA_SHIFT: u32 = 0;
4709    /// Mask for the `VA` field.
4710    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
4711
4712    /// Returns the value of the `VA` field.
4713    pub const fn va(self) -> u64 {
4714        ((self.bits() >> Self::VA_SHIFT)
4715            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
4716    }
4717
4718    /// Sets the value of the `VA` field.
4719    pub const fn set_va(&mut self, value: u64) {
4720        let offset = Self::VA_SHIFT;
4721        assert!(value & (Self::VA_MASK as u64) == value);
4722        *self = Self::from_bits_retain(
4723            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u64) << offset),
4724        );
4725    }
4726}
4727
4728#[cfg(feature = "el1")]
4729bitflags! {
4730    /// `GCR_EL1` system register value.
4731    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4732    #[repr(transparent)]
4733    pub struct GcrEl1: u64 {
4734        /// `RRND` bit.
4735        const RRND = 1 << 16;
4736    }
4737}
4738
4739#[cfg(feature = "el1")]
4740impl GcrEl1 {
4741    /// Offset of the `Exclude` field.
4742    pub const EXCLUDE_SHIFT: u32 = 0;
4743    /// Mask for the `Exclude` field.
4744    pub const EXCLUDE_MASK: u64 = 0b1111111111111111;
4745    /// Offset of the `RRND` field.
4746    pub const RRND_SHIFT: u32 = 16;
4747
4748    /// Returns the value of the `Exclude` field.
4749    pub const fn exclude(self) -> u16 {
4750        ((self.bits() >> Self::EXCLUDE_SHIFT) & 0b1111111111111111) as u16
4751    }
4752
4753    /// Sets the value of the `Exclude` field.
4754    pub const fn set_exclude(&mut self, value: u16) {
4755        let offset = Self::EXCLUDE_SHIFT;
4756        assert!(value & (Self::EXCLUDE_MASK as u16) == value);
4757        *self = Self::from_bits_retain(
4758            (self.bits() & !(Self::EXCLUDE_MASK << offset)) | ((value as u64) << offset),
4759        );
4760    }
4761}
4762
4763#[cfg(feature = "el1")]
4764bitflags! {
4765    /// `GCSCR_EL1` system register value.
4766    ///
4767    /// Guarded Control Stack Control register.
4768    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4769    #[repr(transparent)]
4770    pub struct GcscrEl1: u64 {
4771        /// `PCRSEL` bit.
4772        const PCRSEL = 1 << 0;
4773        /// `RVCHKEN` bit.
4774        const RVCHKEN = 1 << 5;
4775        /// Exception state lock enable.
4776        const EXLOCKEN = 1 << 6;
4777        /// `PUSHMEn` bit.
4778        const PUSHMEN = 1 << 8;
4779        /// `STREn` bit.
4780        const STREN = 1 << 9;
4781    }
4782}
4783
4784#[cfg(feature = "el1")]
4785impl GcscrEl1 {
4786    /// Offset of the `PCRSEL` field.
4787    pub const PCRSEL_SHIFT: u32 = 0;
4788    /// Offset of the `RVCHKEN` field.
4789    pub const RVCHKEN_SHIFT: u32 = 5;
4790    /// Offset of the `EXLOCKEN` field.
4791    pub const EXLOCKEN_SHIFT: u32 = 6;
4792    /// Offset of the `PUSHMEn` field.
4793    pub const PUSHMEN_SHIFT: u32 = 8;
4794    /// Offset of the `STREn` field.
4795    pub const STREN_SHIFT: u32 = 9;
4796}
4797
4798#[cfg(feature = "el2")]
4799bitflags! {
4800    /// `GCSCR_EL2` system register value.
4801    ///
4802    /// Guarded Control Stack Control register.
4803    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4804    #[repr(transparent)]
4805    pub struct GcscrEl2: u64 {
4806        /// `PCRSEL` bit.
4807        const PCRSEL = 1 << 0;
4808        /// `RVCHKEN` bit.
4809        const RVCHKEN = 1 << 5;
4810        /// Exception state lock enable.
4811        const EXLOCKEN = 1 << 6;
4812        /// `PUSHMEn` bit.
4813        const PUSHMEN = 1 << 8;
4814        /// `STREn` bit.
4815        const STREN = 1 << 9;
4816    }
4817}
4818
4819#[cfg(feature = "el2")]
4820impl GcscrEl2 {
4821    /// Offset of the `PCRSEL` field.
4822    pub const PCRSEL_SHIFT: u32 = 0;
4823    /// Offset of the `RVCHKEN` field.
4824    pub const RVCHKEN_SHIFT: u32 = 5;
4825    /// Offset of the `EXLOCKEN` field.
4826    pub const EXLOCKEN_SHIFT: u32 = 6;
4827    /// Offset of the `PUSHMEn` field.
4828    pub const PUSHMEN_SHIFT: u32 = 8;
4829    /// Offset of the `STREn` field.
4830    pub const STREN_SHIFT: u32 = 9;
4831}
4832
4833#[cfg(feature = "el3")]
4834bitflags! {
4835    /// `GPCCR_EL3` system register value.
4836    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4837    #[repr(transparent)]
4838    pub struct GpccrEl3: u64 {
4839        /// `PPS3` bit.
4840        const PPS3 = 1 << 3;
4841        /// `RLPAD` bit.
4842        const RLPAD = 1 << 5;
4843        /// `NSPAD` bit.
4844        const NSPAD = 1 << 6;
4845        /// `SPAD` bit.
4846        const SPAD = 1 << 7;
4847        /// `GPC` bit.
4848        const GPC = 1 << 16;
4849        /// `GPCP` bit.
4850        const GPCP = 1 << 17;
4851        /// `TBGPCD` bit.
4852        const TBGPCD = 1 << 18;
4853        /// `NSO` bit.
4854        const NSO = 1 << 19;
4855        /// `APPSAA` bit.
4856        const APPSAA = 1 << 24;
4857        /// `SA` bit.
4858        const SA = 1 << 25;
4859        /// `NSP` bit.
4860        const NSP = 1 << 26;
4861        /// `NA6` bit.
4862        const NA6 = 1 << 27;
4863        /// `NA7` bit.
4864        const NA7 = 1 << 28;
4865        /// `GPCBW` bit.
4866        const GPCBW = 1 << 29;
4867    }
4868}
4869
4870#[cfg(feature = "el3")]
4871impl GpccrEl3 {
4872    /// Offset of the `PPS` field.
4873    pub const PPS_SHIFT: u32 = 0;
4874    /// Mask for the `PPS` field.
4875    pub const PPS_MASK: u64 = 0b111;
4876    /// Offset of the `PPS3` field.
4877    pub const PPS3_SHIFT: u32 = 3;
4878    /// Offset of the `RLPAD` field.
4879    pub const RLPAD_SHIFT: u32 = 5;
4880    /// Offset of the `NSPAD` field.
4881    pub const NSPAD_SHIFT: u32 = 6;
4882    /// Offset of the `SPAD` field.
4883    pub const SPAD_SHIFT: u32 = 7;
4884    /// Offset of the `IRGN` field.
4885    pub const IRGN_SHIFT: u32 = 8;
4886    /// Mask for the `IRGN` field.
4887    pub const IRGN_MASK: u64 = 0b11;
4888    /// Offset of the `ORGN` field.
4889    pub const ORGN_SHIFT: u32 = 10;
4890    /// Mask for the `ORGN` field.
4891    pub const ORGN_MASK: u64 = 0b11;
4892    /// Offset of the `SH` field.
4893    pub const SH_SHIFT: u32 = 12;
4894    /// Mask for the `SH` field.
4895    pub const SH_MASK: u64 = 0b11;
4896    /// Offset of the `PGS` field.
4897    pub const PGS_SHIFT: u32 = 14;
4898    /// Mask for the `PGS` field.
4899    pub const PGS_MASK: u64 = 0b11;
4900    /// Offset of the `GPC` field.
4901    pub const GPC_SHIFT: u32 = 16;
4902    /// Offset of the `GPCP` field.
4903    pub const GPCP_SHIFT: u32 = 17;
4904    /// Offset of the `TBGPCD` field.
4905    pub const TBGPCD_SHIFT: u32 = 18;
4906    /// Offset of the `NSO` field.
4907    pub const NSO_SHIFT: u32 = 19;
4908    /// Offset of the `L0GPTSZ` field.
4909    pub const L0GPTSZ_SHIFT: u32 = 20;
4910    /// Mask for the `L0GPTSZ` field.
4911    pub const L0GPTSZ_MASK: u64 = 0b1111;
4912    /// Offset of the `APPSAA` field.
4913    pub const APPSAA_SHIFT: u32 = 24;
4914    /// Offset of the `SA` field.
4915    pub const SA_SHIFT: u32 = 25;
4916    /// Offset of the `NSP` field.
4917    pub const NSP_SHIFT: u32 = 26;
4918    /// Offset of the `NA6` field.
4919    pub const NA6_SHIFT: u32 = 27;
4920    /// Offset of the `NA7` field.
4921    pub const NA7_SHIFT: u32 = 28;
4922    /// Offset of the `GPCBW` field.
4923    pub const GPCBW_SHIFT: u32 = 29;
4924
4925    /// Returns the value of the `PPS` field.
4926    pub const fn pps(self) -> u8 {
4927        ((self.bits() >> Self::PPS_SHIFT) & 0b111) as u8
4928    }
4929
4930    /// Sets the value of the `PPS` field.
4931    pub const fn set_pps(&mut self, value: u8) {
4932        let offset = Self::PPS_SHIFT;
4933        assert!(value & (Self::PPS_MASK as u8) == value);
4934        *self = Self::from_bits_retain(
4935            (self.bits() & !(Self::PPS_MASK << offset)) | ((value as u64) << offset),
4936        );
4937    }
4938
4939    /// Returns the value of the `IRGN` field.
4940    pub fn irgn(self) -> crate::manual::Cacheability {
4941        crate::manual::Cacheability::try_from(((self.bits() >> Self::IRGN_SHIFT) & 0b11) as u8)
4942            .unwrap()
4943    }
4944
4945    /// Sets the value of the `IRGN` field.
4946    pub fn set_irgn(&mut self, value: crate::manual::Cacheability) {
4947        let offset = Self::IRGN_SHIFT;
4948        let value: u8 = value.into();
4949        assert!(value & (Self::IRGN_MASK as u8) == value);
4950        *self = Self::from_bits_retain(
4951            (self.bits() & !(Self::IRGN_MASK << offset)) | ((value as u64) << offset),
4952        );
4953    }
4954
4955    /// Returns the value of the `ORGN` field.
4956    pub fn orgn(self) -> crate::manual::Cacheability {
4957        crate::manual::Cacheability::try_from(((self.bits() >> Self::ORGN_SHIFT) & 0b11) as u8)
4958            .unwrap()
4959    }
4960
4961    /// Sets the value of the `ORGN` field.
4962    pub fn set_orgn(&mut self, value: crate::manual::Cacheability) {
4963        let offset = Self::ORGN_SHIFT;
4964        let value: u8 = value.into();
4965        assert!(value & (Self::ORGN_MASK as u8) == value);
4966        *self = Self::from_bits_retain(
4967            (self.bits() & !(Self::ORGN_MASK << offset)) | ((value as u64) << offset),
4968        );
4969    }
4970
4971    /// Returns the value of the `SH` field.
4972    pub fn sh(self) -> crate::manual::Shareability {
4973        crate::manual::Shareability::try_from(((self.bits() >> Self::SH_SHIFT) & 0b11) as u8)
4974            .unwrap()
4975    }
4976
4977    /// Sets the value of the `SH` field.
4978    pub fn set_sh(&mut self, value: crate::manual::Shareability) {
4979        let offset = Self::SH_SHIFT;
4980        let value: u8 = value.into();
4981        assert!(value & (Self::SH_MASK as u8) == value);
4982        *self = Self::from_bits_retain(
4983            (self.bits() & !(Self::SH_MASK << offset)) | ((value as u64) << offset),
4984        );
4985    }
4986
4987    /// Returns the value of the `PGS` field.
4988    pub const fn pgs(self) -> u8 {
4989        ((self.bits() >> Self::PGS_SHIFT) & 0b11) as u8
4990    }
4991
4992    /// Sets the value of the `PGS` field.
4993    pub const fn set_pgs(&mut self, value: u8) {
4994        let offset = Self::PGS_SHIFT;
4995        assert!(value & (Self::PGS_MASK as u8) == value);
4996        *self = Self::from_bits_retain(
4997            (self.bits() & !(Self::PGS_MASK << offset)) | ((value as u64) << offset),
4998        );
4999    }
5000
5001    /// Returns the value of the `L0GPTSZ` field.
5002    pub const fn l0gptsz(self) -> u8 {
5003        ((self.bits() >> Self::L0GPTSZ_SHIFT) & 0b1111) as u8
5004    }
5005
5006    /// Sets the value of the `L0GPTSZ` field.
5007    pub const fn set_l0gptsz(&mut self, value: u8) {
5008        let offset = Self::L0GPTSZ_SHIFT;
5009        assert!(value & (Self::L0GPTSZ_MASK as u8) == value);
5010        *self = Self::from_bits_retain(
5011            (self.bits() & !(Self::L0GPTSZ_MASK << offset)) | ((value as u64) << offset),
5012        );
5013    }
5014}
5015
5016#[cfg(feature = "el3")]
5017bitflags! {
5018    /// `GPTBR_EL3` system register value.
5019    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5020    #[repr(transparent)]
5021    pub struct GptbrEl3: u64 {
5022    }
5023}
5024
5025#[cfg(feature = "el3")]
5026impl GptbrEl3 {
5027    /// Offset of the `BADDR` field.
5028    pub const BADDR_SHIFT: u32 = 0;
5029    /// Mask for the `BADDR` field.
5030    pub const BADDR_MASK: u64 = 0b1111111111111111111111111111111111111111;
5031    /// Offset of the `BADDR[43:40]` field.
5032    pub const BADDR_43_40_SHIFT: u32 = 40;
5033    /// Mask for the `BADDR[43:40]` field.
5034    pub const BADDR_43_40_MASK: u64 = 0b1111;
5035
5036    /// Returns the value of the `BADDR` field.
5037    pub const fn baddr(self) -> u64 {
5038        ((self.bits() >> Self::BADDR_SHIFT) & 0b1111111111111111111111111111111111111111) as u64
5039    }
5040
5041    /// Sets the value of the `BADDR` field.
5042    pub const fn set_baddr(&mut self, value: u64) {
5043        let offset = Self::BADDR_SHIFT;
5044        assert!(value & (Self::BADDR_MASK as u64) == value);
5045        *self = Self::from_bits_retain(
5046            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
5047        );
5048    }
5049
5050    /// Returns the value of the `BADDR[43:40]` field.
5051    pub const fn baddr_43_40(self) -> u8 {
5052        ((self.bits() >> Self::BADDR_43_40_SHIFT) & 0b1111) as u8
5053    }
5054
5055    /// Sets the value of the `BADDR[43:40]` field.
5056    pub const fn set_baddr_43_40(&mut self, value: u8) {
5057        let offset = Self::BADDR_43_40_SHIFT;
5058        assert!(value & (Self::BADDR_43_40_MASK as u8) == value);
5059        *self = Self::from_bits_retain(
5060            (self.bits() & !(Self::BADDR_43_40_MASK << offset)) | ((value as u64) << offset),
5061        );
5062    }
5063}
5064
5065bitflags! {
5066    /// `HCPTR` system register value.
5067    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5068    #[repr(transparent)]
5069    pub struct Hcptr: u32 {
5070        /// RES1 bits in the `HCPTR` register.
5071        const RES1 = 0b11001111111111;
5072        /// `TCP10` bit.
5073        const TCP10 = 1 << 10;
5074        /// `TCP11` bit.
5075        const TCP11 = 1 << 11;
5076        /// `TASE` bit.
5077        const TASE = 1 << 15;
5078        /// `TTA` bit.
5079        const TTA = 1 << 20;
5080        /// `TAM` bit.
5081        const TAM = 1 << 30;
5082        /// `TCPAC` bit.
5083        const TCPAC = 1 << 31;
5084    }
5085}
5086
5087impl Hcptr {
5088    /// Offset of the `TCP10` field.
5089    pub const TCP10_SHIFT: u32 = 10;
5090    /// Offset of the `TCP11` field.
5091    pub const TCP11_SHIFT: u32 = 11;
5092    /// Offset of the `TASE` field.
5093    pub const TASE_SHIFT: u32 = 15;
5094    /// Offset of the `TTA` field.
5095    pub const TTA_SHIFT: u32 = 20;
5096    /// Offset of the `TAM` field.
5097    pub const TAM_SHIFT: u32 = 30;
5098    /// Offset of the `TCPAC` field.
5099    pub const TCPAC_SHIFT: u32 = 31;
5100}
5101
5102bitflags! {
5103    /// `HCR` system register value.
5104    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5105    #[repr(transparent)]
5106    pub struct Hcr: u32 {
5107        /// `VM` bit.
5108        const VM = 1 << 0;
5109        /// `SWIO` bit.
5110        const SWIO = 1 << 1;
5111        /// `PTW` bit.
5112        const PTW = 1 << 2;
5113        /// `FMO` bit.
5114        const FMO = 1 << 3;
5115        /// `IMO` bit.
5116        const IMO = 1 << 4;
5117        /// `AMO` bit.
5118        const AMO = 1 << 5;
5119        /// `VF` bit.
5120        const VF = 1 << 6;
5121        /// `VI` bit.
5122        const VI = 1 << 7;
5123        /// `VA` bit.
5124        const VA = 1 << 8;
5125        /// `FB` bit.
5126        const FB = 1 << 9;
5127        /// `DC` bit.
5128        const DC = 1 << 12;
5129        /// `TWI` bit.
5130        const TWI = 1 << 13;
5131        /// `TWE` bit.
5132        const TWE = 1 << 14;
5133        /// `TID0` bit.
5134        const TID0 = 1 << 15;
5135        /// `TID1` bit.
5136        const TID1 = 1 << 16;
5137        /// `TID2` bit.
5138        const TID2 = 1 << 17;
5139        /// `TID3` bit.
5140        const TID3 = 1 << 18;
5141        /// `TSC` bit.
5142        const TSC = 1 << 19;
5143        /// `TIDCP` bit.
5144        const TIDCP = 1 << 20;
5145        /// `TAC` bit.
5146        const TAC = 1 << 21;
5147        /// `TSW` bit.
5148        const TSW = 1 << 22;
5149        /// `TPC` bit.
5150        const TPC = 1 << 23;
5151        /// `TPU` bit.
5152        const TPU = 1 << 24;
5153        /// `TTLB` bit.
5154        const TTLB = 1 << 25;
5155        /// `TVM` bit.
5156        const TVM = 1 << 26;
5157        /// `TGE` bit.
5158        const TGE = 1 << 27;
5159        /// `HCD` bit.
5160        const HCD = 1 << 29;
5161        /// `TRVM` bit.
5162        const TRVM = 1 << 30;
5163    }
5164}
5165
5166impl Hcr {
5167    /// Offset of the `VM` field.
5168    pub const VM_SHIFT: u32 = 0;
5169    /// Offset of the `SWIO` field.
5170    pub const SWIO_SHIFT: u32 = 1;
5171    /// Offset of the `PTW` field.
5172    pub const PTW_SHIFT: u32 = 2;
5173    /// Offset of the `FMO` field.
5174    pub const FMO_SHIFT: u32 = 3;
5175    /// Offset of the `IMO` field.
5176    pub const IMO_SHIFT: u32 = 4;
5177    /// Offset of the `AMO` field.
5178    pub const AMO_SHIFT: u32 = 5;
5179    /// Offset of the `VF` field.
5180    pub const VF_SHIFT: u32 = 6;
5181    /// Offset of the `VI` field.
5182    pub const VI_SHIFT: u32 = 7;
5183    /// Offset of the `VA` field.
5184    pub const VA_SHIFT: u32 = 8;
5185    /// Offset of the `FB` field.
5186    pub const FB_SHIFT: u32 = 9;
5187    /// Offset of the `BSU` field.
5188    pub const BSU_SHIFT: u32 = 10;
5189    /// Mask for the `BSU` field.
5190    pub const BSU_MASK: u32 = 0b11;
5191    /// Offset of the `DC` field.
5192    pub const DC_SHIFT: u32 = 12;
5193    /// Offset of the `TWI` field.
5194    pub const TWI_SHIFT: u32 = 13;
5195    /// Offset of the `TWE` field.
5196    pub const TWE_SHIFT: u32 = 14;
5197    /// Offset of the `TID0` field.
5198    pub const TID0_SHIFT: u32 = 15;
5199    /// Offset of the `TID1` field.
5200    pub const TID1_SHIFT: u32 = 16;
5201    /// Offset of the `TID2` field.
5202    pub const TID2_SHIFT: u32 = 17;
5203    /// Offset of the `TID3` field.
5204    pub const TID3_SHIFT: u32 = 18;
5205    /// Offset of the `TSC` field.
5206    pub const TSC_SHIFT: u32 = 19;
5207    /// Offset of the `TIDCP` field.
5208    pub const TIDCP_SHIFT: u32 = 20;
5209    /// Offset of the `TAC` field.
5210    pub const TAC_SHIFT: u32 = 21;
5211    /// Offset of the `TSW` field.
5212    pub const TSW_SHIFT: u32 = 22;
5213    /// Offset of the `TPC` field.
5214    pub const TPC_SHIFT: u32 = 23;
5215    /// Offset of the `TPU` field.
5216    pub const TPU_SHIFT: u32 = 24;
5217    /// Offset of the `TTLB` field.
5218    pub const TTLB_SHIFT: u32 = 25;
5219    /// Offset of the `TVM` field.
5220    pub const TVM_SHIFT: u32 = 26;
5221    /// Offset of the `TGE` field.
5222    pub const TGE_SHIFT: u32 = 27;
5223    /// Offset of the `HCD` field.
5224    pub const HCD_SHIFT: u32 = 29;
5225    /// Offset of the `TRVM` field.
5226    pub const TRVM_SHIFT: u32 = 30;
5227
5228    /// Returns the value of the `BSU` field.
5229    pub const fn bsu(self) -> u8 {
5230        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
5231    }
5232
5233    /// Sets the value of the `BSU` field.
5234    pub const fn set_bsu(&mut self, value: u8) {
5235        let offset = Self::BSU_SHIFT;
5236        assert!(value & (Self::BSU_MASK as u8) == value);
5237        *self = Self::from_bits_retain(
5238            (self.bits() & !(Self::BSU_MASK << offset)) | ((value as u32) << offset),
5239        );
5240    }
5241}
5242
5243bitflags! {
5244    /// `HCR2` system register value.
5245    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5246    #[repr(transparent)]
5247    pub struct Hcr2: u32 {
5248        /// `CD` bit.
5249        const CD = 1 << 0;
5250        /// `ID` bit.
5251        const ID = 1 << 1;
5252        /// `TERR` bit.
5253        const TERR = 1 << 4;
5254        /// `TEA` bit.
5255        const TEA = 1 << 5;
5256        /// `TID4` bit.
5257        const TID4 = 1 << 17;
5258        /// `TICAB` bit.
5259        const TICAB = 1 << 18;
5260        /// `TOCU` bit.
5261        const TOCU = 1 << 20;
5262        /// `TTLBIS` bit.
5263        const TTLBIS = 1 << 22;
5264    }
5265}
5266
5267impl Hcr2 {
5268    /// Offset of the `CD` field.
5269    pub const CD_SHIFT: u32 = 0;
5270    /// Offset of the `ID` field.
5271    pub const ID_SHIFT: u32 = 1;
5272    /// Offset of the `TERR` field.
5273    pub const TERR_SHIFT: u32 = 4;
5274    /// Offset of the `TEA` field.
5275    pub const TEA_SHIFT: u32 = 5;
5276    /// Offset of the `TID4` field.
5277    pub const TID4_SHIFT: u32 = 17;
5278    /// Offset of the `TICAB` field.
5279    pub const TICAB_SHIFT: u32 = 18;
5280    /// Offset of the `TOCU` field.
5281    pub const TOCU_SHIFT: u32 = 20;
5282    /// Offset of the `TTLBIS` field.
5283    pub const TTLBIS_SHIFT: u32 = 22;
5284}
5285
5286#[cfg(feature = "el2")]
5287bitflags! {
5288    /// `HCRX_EL2` system register value.
5289    ///
5290    /// Extended Hypervisor Configuration Register.
5291    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5292    #[repr(transparent)]
5293    pub struct HcrxEl2: u64 {
5294        /// Do not trap execution of an ST64BV0 instruction at EL0 or EL1 to EL2.
5295        const ENAS0 = 1 << 0;
5296        /// Do not trap execution of an LD64B or ST64B instruction at EL0 or EL1 to EL2.
5297        const ENALS = 1 << 1;
5298        /// Do not trap execution of an ST64BV instruction at EL0 or EL1 to EL2.
5299        const ENASR = 1 << 2;
5300        /// Determines the behavior of TLBI instructions affected by the XS attribute.
5301        const FNXS = 1 << 3;
5302        /// Determines if the fine-grained traps in HFGITR_EL2 also apply to the corresponding TLBI maintenance instructions with the nXS qualifier.
5303        const FGTNXS = 1 << 4;
5304        /// Controls mapping of the value of SMPRI_EL1.Priority for streaming execution priority at EL0 or EL1.
5305        const SMPME = 1 << 5;
5306        /// Traps MSR writes of ALLINT at EL1 using AArch64 to EL2.
5307        const TALLINT = 1 << 6;
5308        /// Enables signaling of virtual IRQ interrupts with Superpriority.
5309        const VINMI = 1 << 7;
5310        /// Enables signaling of virtual FIQ interrupts with Superpriority.
5311        const VFNMI = 1 << 8;
5312        /// Controls the required permissions for cache maintenance instructions at EL1 or EL0.
5313        const CMOW = 1 << 9;
5314        /// Controls Memory Copy and Memory Set exceptions generated from EL1.
5315        const MCE2 = 1 << 10;
5316        /// Enables execution of Memory Set and Memory Copy instructions at EL1 or EL0.
5317        const MSCEN = 1 << 11;
5318        /// `TCR2En` bit.
5319        const TCR2EN = 1 << 14;
5320        /// `SCTLR2En` bit.
5321        const SCTLR2EN = 1 << 15;
5322        /// `PTTWI` bit.
5323        const PTTWI = 1 << 16;
5324        /// `D128En` bit.
5325        const D128EN = 1 << 17;
5326        /// `EnSNERR` bit.
5327        const ENSNERR = 1 << 18;
5328        /// `TMEA` bit.
5329        const TMEA = 1 << 19;
5330        /// `EnSDERR` bit.
5331        const ENSDERR = 1 << 20;
5332        /// `EnIDCP128` bit.
5333        const ENIDCP128 = 1 << 21;
5334        /// `GCSEn` bit.
5335        const GCSEN = 1 << 22;
5336        /// `EnFPM` bit.
5337        const ENFPM = 1 << 23;
5338        /// `PACMEn` bit.
5339        const PACMEN = 1 << 24;
5340        /// `VTLBIDEn` bit.
5341        const VTLBIDEN = 1 << 25;
5342        /// `SRMASKEn` bit.
5343        const SRMASKEN = 1 << 26;
5344        /// `NVTGE` bit.
5345        const NVTGE = 1 << 27;
5346        /// `POE2En` bit.
5347        const POE2EN = 1 << 29;
5348        /// `TPLIMEn` bit.
5349        const TPLIMEN = 1 << 30;
5350        /// `FDIT` bit.
5351        const FDIT = 1 << 31;
5352        /// `NVnTTLB` bit.
5353        const NVNTTLB = 1 << 32;
5354        /// `NVnTTLBIS` bit.
5355        const NVNTTLBIS = 1 << 33;
5356        /// `NVnTTLBOS` bit.
5357        const NVNTTLBOS = 1 << 34;
5358        /// `VTLBIDOSEn` bit.
5359        const VTLBIDOSEN = 1 << 35;
5360        /// `FNB` bit.
5361        const FNB = 1 << 36;
5362        /// `VTE` bit.
5363        const VTE = 1 << 37;
5364        /// `VTAO` bit.
5365        const VTAO = 1 << 38;
5366        /// `VTCO` bit.
5367        const VTCO = 1 << 39;
5368    }
5369}
5370
5371#[cfg(feature = "el2")]
5372impl HcrxEl2 {
5373    /// Offset of the `EnAS0` field.
5374    pub const ENAS0_SHIFT: u32 = 0;
5375    /// Offset of the `EnALS` field.
5376    pub const ENALS_SHIFT: u32 = 1;
5377    /// Offset of the `EnASR` field.
5378    pub const ENASR_SHIFT: u32 = 2;
5379    /// Offset of the `FnXS` field.
5380    pub const FNXS_SHIFT: u32 = 3;
5381    /// Offset of the `FGTnXS` field.
5382    pub const FGTNXS_SHIFT: u32 = 4;
5383    /// Offset of the `SMPME` field.
5384    pub const SMPME_SHIFT: u32 = 5;
5385    /// Offset of the `TALLINT` field.
5386    pub const TALLINT_SHIFT: u32 = 6;
5387    /// Offset of the `VINMI` field.
5388    pub const VINMI_SHIFT: u32 = 7;
5389    /// Offset of the `VFNMI` field.
5390    pub const VFNMI_SHIFT: u32 = 8;
5391    /// Offset of the `CMOW` field.
5392    pub const CMOW_SHIFT: u32 = 9;
5393    /// Offset of the `MCE2` field.
5394    pub const MCE2_SHIFT: u32 = 10;
5395    /// Offset of the `MSCEn` field.
5396    pub const MSCEN_SHIFT: u32 = 11;
5397    /// Offset of the `TCR2En` field.
5398    pub const TCR2EN_SHIFT: u32 = 14;
5399    /// Offset of the `SCTLR2En` field.
5400    pub const SCTLR2EN_SHIFT: u32 = 15;
5401    /// Offset of the `PTTWI` field.
5402    pub const PTTWI_SHIFT: u32 = 16;
5403    /// Offset of the `D128En` field.
5404    pub const D128EN_SHIFT: u32 = 17;
5405    /// Offset of the `EnSNERR` field.
5406    pub const ENSNERR_SHIFT: u32 = 18;
5407    /// Offset of the `TMEA` field.
5408    pub const TMEA_SHIFT: u32 = 19;
5409    /// Offset of the `EnSDERR` field.
5410    pub const ENSDERR_SHIFT: u32 = 20;
5411    /// Offset of the `EnIDCP128` field.
5412    pub const ENIDCP128_SHIFT: u32 = 21;
5413    /// Offset of the `GCSEn` field.
5414    pub const GCSEN_SHIFT: u32 = 22;
5415    /// Offset of the `EnFPM` field.
5416    pub const ENFPM_SHIFT: u32 = 23;
5417    /// Offset of the `PACMEn` field.
5418    pub const PACMEN_SHIFT: u32 = 24;
5419    /// Offset of the `VTLBIDEn` field.
5420    pub const VTLBIDEN_SHIFT: u32 = 25;
5421    /// Offset of the `SRMASKEn` field.
5422    pub const SRMASKEN_SHIFT: u32 = 26;
5423    /// Offset of the `NVTGE` field.
5424    pub const NVTGE_SHIFT: u32 = 27;
5425    /// Offset of the `POE2En` field.
5426    pub const POE2EN_SHIFT: u32 = 29;
5427    /// Offset of the `TPLIMEn` field.
5428    pub const TPLIMEN_SHIFT: u32 = 30;
5429    /// Offset of the `FDIT` field.
5430    pub const FDIT_SHIFT: u32 = 31;
5431    /// Offset of the `NVnTTLB` field.
5432    pub const NVNTTLB_SHIFT: u32 = 32;
5433    /// Offset of the `NVnTTLBIS` field.
5434    pub const NVNTTLBIS_SHIFT: u32 = 33;
5435    /// Offset of the `NVnTTLBOS` field.
5436    pub const NVNTTLBOS_SHIFT: u32 = 34;
5437    /// Offset of the `VTLBIDOSEn` field.
5438    pub const VTLBIDOSEN_SHIFT: u32 = 35;
5439    /// Offset of the `FNB` field.
5440    pub const FNB_SHIFT: u32 = 36;
5441    /// Offset of the `VTE` field.
5442    pub const VTE_SHIFT: u32 = 37;
5443    /// Offset of the `VTAO` field.
5444    pub const VTAO_SHIFT: u32 = 38;
5445    /// Offset of the `VTCO` field.
5446    pub const VTCO_SHIFT: u32 = 39;
5447}
5448
5449#[cfg(feature = "el2")]
5450bitflags! {
5451    /// `HCR_EL2` system register value.
5452    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5453    #[repr(transparent)]
5454    pub struct HcrEl2: u64 {
5455        /// `VM` bit.
5456        const VM = 1 << 0;
5457        /// `SWIO` bit.
5458        const SWIO = 1 << 1;
5459        /// `PTW` bit.
5460        const PTW = 1 << 2;
5461        /// `FMO` bit.
5462        const FMO = 1 << 3;
5463        /// `IMO` bit.
5464        const IMO = 1 << 4;
5465        /// `AMO` bit.
5466        const AMO = 1 << 5;
5467        /// `VF` bit.
5468        const VF = 1 << 6;
5469        /// `VI` bit.
5470        const VI = 1 << 7;
5471        /// `VSE` bit.
5472        const VSE = 1 << 8;
5473        /// `FB` bit.
5474        const FB = 1 << 9;
5475        /// `DC` bit.
5476        const DC = 1 << 12;
5477        /// `TWI` bit.
5478        const TWI = 1 << 13;
5479        /// `TWE` bit.
5480        const TWE = 1 << 14;
5481        /// `TID0` bit.
5482        const TID0 = 1 << 15;
5483        /// `TID1` bit.
5484        const TID1 = 1 << 16;
5485        /// `TID2` bit.
5486        const TID2 = 1 << 17;
5487        /// `TID3` bit.
5488        const TID3 = 1 << 18;
5489        /// `TSC` bit.
5490        const TSC = 1 << 19;
5491        /// `TIDCP` bit.
5492        const TIDCP = 1 << 20;
5493        /// `TACR` bit.
5494        const TACR = 1 << 21;
5495        /// `TSW` bit.
5496        const TSW = 1 << 22;
5497        /// `TPCP` bit.
5498        const TPCP = 1 << 23;
5499        /// `TPU` bit.
5500        const TPU = 1 << 24;
5501        /// `TTLB` bit.
5502        const TTLB = 1 << 25;
5503        /// `TVM` bit.
5504        const TVM = 1 << 26;
5505        /// Trap general exceptions to EL2.
5506        const TGE = 1 << 27;
5507        /// `TDZ` bit.
5508        const TDZ = 1 << 28;
5509        /// `HCD` bit.
5510        const HCD = 1 << 29;
5511        /// `TRVM` bit.
5512        const TRVM = 1 << 30;
5513        /// `RW` bit.
5514        const RW = 1 << 31;
5515        /// `CD` bit.
5516        const CD = 1 << 32;
5517        /// `ID` bit.
5518        const ID = 1 << 33;
5519        /// `E2H` bit.
5520        const E2H = 1 << 34;
5521        /// `TLOR` bit.
5522        const TLOR = 1 << 35;
5523        /// `TERR` bit.
5524        const TERR = 1 << 36;
5525        /// `TEA` bit.
5526        const TEA = 1 << 37;
5527        /// `APK` bit.
5528        const APK = 1 << 40;
5529        /// `API` bit.
5530        const API = 1 << 41;
5531        /// `NV` bit.
5532        const NV = 1 << 42;
5533        /// `NV1` bit.
5534        const NV1 = 1 << 43;
5535        /// `AT` bit.
5536        const AT = 1 << 44;
5537        /// `NV2` bit.
5538        const NV2 = 1 << 45;
5539        /// `FWB` bit.
5540        const FWB = 1 << 46;
5541        /// `FIEN` bit.
5542        const FIEN = 1 << 47;
5543        /// `GPF` bit.
5544        const GPF = 1 << 48;
5545        /// `TID4` bit.
5546        const TID4 = 1 << 49;
5547        /// `TICAB` bit.
5548        const TICAB = 1 << 50;
5549        /// `AMVOFFEN` bit.
5550        const AMVOFFEN = 1 << 51;
5551        /// `TOCU` bit.
5552        const TOCU = 1 << 52;
5553        /// `EnSCXT` bit.
5554        const ENSCXT = 1 << 53;
5555        /// `TTLBIS` bit.
5556        const TTLBIS = 1 << 54;
5557        /// `TTLBOS` bit.
5558        const TTLBOS = 1 << 55;
5559        /// `ATA` bit.
5560        const ATA = 1 << 56;
5561        /// `DCT` bit.
5562        const DCT = 1 << 57;
5563        /// `TID5` bit.
5564        const TID5 = 1 << 58;
5565        /// `TWEDEn` bit.
5566        const TWEDEN = 1 << 59;
5567    }
5568}
5569
5570#[cfg(feature = "el2")]
5571impl HcrEl2 {
5572    /// Offset of the `VM` field.
5573    pub const VM_SHIFT: u32 = 0;
5574    /// Offset of the `SWIO` field.
5575    pub const SWIO_SHIFT: u32 = 1;
5576    /// Offset of the `PTW` field.
5577    pub const PTW_SHIFT: u32 = 2;
5578    /// Offset of the `FMO` field.
5579    pub const FMO_SHIFT: u32 = 3;
5580    /// Offset of the `IMO` field.
5581    pub const IMO_SHIFT: u32 = 4;
5582    /// Offset of the `AMO` field.
5583    pub const AMO_SHIFT: u32 = 5;
5584    /// Offset of the `VF` field.
5585    pub const VF_SHIFT: u32 = 6;
5586    /// Offset of the `VI` field.
5587    pub const VI_SHIFT: u32 = 7;
5588    /// Offset of the `VSE` field.
5589    pub const VSE_SHIFT: u32 = 8;
5590    /// Offset of the `FB` field.
5591    pub const FB_SHIFT: u32 = 9;
5592    /// Offset of the `BSU` field.
5593    pub const BSU_SHIFT: u32 = 10;
5594    /// Mask for the `BSU` field.
5595    pub const BSU_MASK: u64 = 0b11;
5596    /// Offset of the `DC` field.
5597    pub const DC_SHIFT: u32 = 12;
5598    /// Offset of the `TWI` field.
5599    pub const TWI_SHIFT: u32 = 13;
5600    /// Offset of the `TWE` field.
5601    pub const TWE_SHIFT: u32 = 14;
5602    /// Offset of the `TID0` field.
5603    pub const TID0_SHIFT: u32 = 15;
5604    /// Offset of the `TID1` field.
5605    pub const TID1_SHIFT: u32 = 16;
5606    /// Offset of the `TID2` field.
5607    pub const TID2_SHIFT: u32 = 17;
5608    /// Offset of the `TID3` field.
5609    pub const TID3_SHIFT: u32 = 18;
5610    /// Offset of the `TSC` field.
5611    pub const TSC_SHIFT: u32 = 19;
5612    /// Offset of the `TIDCP` field.
5613    pub const TIDCP_SHIFT: u32 = 20;
5614    /// Offset of the `TACR` field.
5615    pub const TACR_SHIFT: u32 = 21;
5616    /// Offset of the `TSW` field.
5617    pub const TSW_SHIFT: u32 = 22;
5618    /// Offset of the `TPCP` field.
5619    pub const TPCP_SHIFT: u32 = 23;
5620    /// Offset of the `TPU` field.
5621    pub const TPU_SHIFT: u32 = 24;
5622    /// Offset of the `TTLB` field.
5623    pub const TTLB_SHIFT: u32 = 25;
5624    /// Offset of the `TVM` field.
5625    pub const TVM_SHIFT: u32 = 26;
5626    /// Offset of the `TGE` field.
5627    pub const TGE_SHIFT: u32 = 27;
5628    /// Offset of the `TDZ` field.
5629    pub const TDZ_SHIFT: u32 = 28;
5630    /// Offset of the `HCD` field.
5631    pub const HCD_SHIFT: u32 = 29;
5632    /// Offset of the `TRVM` field.
5633    pub const TRVM_SHIFT: u32 = 30;
5634    /// Offset of the `RW` field.
5635    pub const RW_SHIFT: u32 = 31;
5636    /// Offset of the `CD` field.
5637    pub const CD_SHIFT: u32 = 32;
5638    /// Offset of the `ID` field.
5639    pub const ID_SHIFT: u32 = 33;
5640    /// Offset of the `E2H` field.
5641    pub const E2H_SHIFT: u32 = 34;
5642    /// Offset of the `TLOR` field.
5643    pub const TLOR_SHIFT: u32 = 35;
5644    /// Offset of the `TERR` field.
5645    pub const TERR_SHIFT: u32 = 36;
5646    /// Offset of the `TEA` field.
5647    pub const TEA_SHIFT: u32 = 37;
5648    /// Offset of the `APK` field.
5649    pub const APK_SHIFT: u32 = 40;
5650    /// Offset of the `API` field.
5651    pub const API_SHIFT: u32 = 41;
5652    /// Offset of the `NV` field.
5653    pub const NV_SHIFT: u32 = 42;
5654    /// Offset of the `NV1` field.
5655    pub const NV1_SHIFT: u32 = 43;
5656    /// Offset of the `AT` field.
5657    pub const AT_SHIFT: u32 = 44;
5658    /// Offset of the `NV2` field.
5659    pub const NV2_SHIFT: u32 = 45;
5660    /// Offset of the `FWB` field.
5661    pub const FWB_SHIFT: u32 = 46;
5662    /// Offset of the `FIEN` field.
5663    pub const FIEN_SHIFT: u32 = 47;
5664    /// Offset of the `GPF` field.
5665    pub const GPF_SHIFT: u32 = 48;
5666    /// Offset of the `TID4` field.
5667    pub const TID4_SHIFT: u32 = 49;
5668    /// Offset of the `TICAB` field.
5669    pub const TICAB_SHIFT: u32 = 50;
5670    /// Offset of the `AMVOFFEN` field.
5671    pub const AMVOFFEN_SHIFT: u32 = 51;
5672    /// Offset of the `TOCU` field.
5673    pub const TOCU_SHIFT: u32 = 52;
5674    /// Offset of the `EnSCXT` field.
5675    pub const ENSCXT_SHIFT: u32 = 53;
5676    /// Offset of the `TTLBIS` field.
5677    pub const TTLBIS_SHIFT: u32 = 54;
5678    /// Offset of the `TTLBOS` field.
5679    pub const TTLBOS_SHIFT: u32 = 55;
5680    /// Offset of the `ATA` field.
5681    pub const ATA_SHIFT: u32 = 56;
5682    /// Offset of the `DCT` field.
5683    pub const DCT_SHIFT: u32 = 57;
5684    /// Offset of the `TID5` field.
5685    pub const TID5_SHIFT: u32 = 58;
5686    /// Offset of the `TWEDEn` field.
5687    pub const TWEDEN_SHIFT: u32 = 59;
5688    /// Offset of the `TWEDEL` field.
5689    pub const TWEDEL_SHIFT: u32 = 60;
5690    /// Mask for the `TWEDEL` field.
5691    pub const TWEDEL_MASK: u64 = 0b1111;
5692
5693    /// Returns the value of the `BSU` field.
5694    pub const fn bsu(self) -> u8 {
5695        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
5696    }
5697
5698    /// Sets the value of the `BSU` field.
5699    pub const fn set_bsu(&mut self, value: u8) {
5700        let offset = Self::BSU_SHIFT;
5701        assert!(value & (Self::BSU_MASK as u8) == value);
5702        *self = Self::from_bits_retain(
5703            (self.bits() & !(Self::BSU_MASK << offset)) | ((value as u64) << offset),
5704        );
5705    }
5706
5707    /// Returns the value of the `TWEDEL` field.
5708    pub const fn twedel(self) -> u8 {
5709        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
5710    }
5711
5712    /// Sets the value of the `TWEDEL` field.
5713    pub const fn set_twedel(&mut self, value: u8) {
5714        let offset = Self::TWEDEL_SHIFT;
5715        assert!(value & (Self::TWEDEL_MASK as u8) == value);
5716        *self = Self::from_bits_retain(
5717            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
5718        );
5719    }
5720}
5721
5722bitflags! {
5723    /// `HDCR` system register value.
5724    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5725    #[repr(transparent)]
5726    pub struct Hdcr: u32 {
5727        /// `TPMCR` bit.
5728        const TPMCR = 1 << 5;
5729        /// `TPM` bit.
5730        const TPM = 1 << 6;
5731        /// `HPME` bit.
5732        const HPME = 1 << 7;
5733        /// `TDE` bit.
5734        const TDE = 1 << 8;
5735        /// `TDA` bit.
5736        const TDA = 1 << 9;
5737        /// `TDOSA` bit.
5738        const TDOSA = 1 << 10;
5739        /// `TDRA` bit.
5740        const TDRA = 1 << 11;
5741        /// `HPMD` bit.
5742        const HPMD = 1 << 17;
5743        /// `TTRF` bit.
5744        const TTRF = 1 << 19;
5745        /// `HCCD` bit.
5746        const HCCD = 1 << 23;
5747        /// `HLP` bit.
5748        const HLP = 1 << 26;
5749        /// `TDCC` bit.
5750        const TDCC = 1 << 27;
5751        /// `MTPME` bit.
5752        const MTPME = 1 << 28;
5753        /// `HPMFZO` bit.
5754        const HPMFZO = 1 << 29;
5755    }
5756}
5757
5758impl Hdcr {
5759    /// Offset of the `HPMN` field.
5760    pub const HPMN_SHIFT: u32 = 0;
5761    /// Mask for the `HPMN` field.
5762    pub const HPMN_MASK: u32 = 0b11111;
5763    /// Offset of the `TPMCR` field.
5764    pub const TPMCR_SHIFT: u32 = 5;
5765    /// Offset of the `TPM` field.
5766    pub const TPM_SHIFT: u32 = 6;
5767    /// Offset of the `HPME` field.
5768    pub const HPME_SHIFT: u32 = 7;
5769    /// Offset of the `TDE` field.
5770    pub const TDE_SHIFT: u32 = 8;
5771    /// Offset of the `TDA` field.
5772    pub const TDA_SHIFT: u32 = 9;
5773    /// Offset of the `TDOSA` field.
5774    pub const TDOSA_SHIFT: u32 = 10;
5775    /// Offset of the `TDRA` field.
5776    pub const TDRA_SHIFT: u32 = 11;
5777    /// Offset of the `HPMD` field.
5778    pub const HPMD_SHIFT: u32 = 17;
5779    /// Offset of the `TTRF` field.
5780    pub const TTRF_SHIFT: u32 = 19;
5781    /// Offset of the `HCCD` field.
5782    pub const HCCD_SHIFT: u32 = 23;
5783    /// Offset of the `HLP` field.
5784    pub const HLP_SHIFT: u32 = 26;
5785    /// Offset of the `TDCC` field.
5786    pub const TDCC_SHIFT: u32 = 27;
5787    /// Offset of the `MTPME` field.
5788    pub const MTPME_SHIFT: u32 = 28;
5789    /// Offset of the `HPMFZO` field.
5790    pub const HPMFZO_SHIFT: u32 = 29;
5791
5792    /// Returns the value of the `HPMN` field.
5793    pub const fn hpmn(self) -> u8 {
5794        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
5795    }
5796
5797    /// Sets the value of the `HPMN` field.
5798    pub const fn set_hpmn(&mut self, value: u8) {
5799        let offset = Self::HPMN_SHIFT;
5800        assert!(value & (Self::HPMN_MASK as u8) == value);
5801        *self = Self::from_bits_retain(
5802            (self.bits() & !(Self::HPMN_MASK << offset)) | ((value as u32) << offset),
5803        );
5804    }
5805}
5806
5807bitflags! {
5808    /// `HDFAR` system register value.
5809    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5810    #[repr(transparent)]
5811    pub struct Hdfar: u32 {
5812    }
5813}
5814
5815impl Hdfar {
5816    /// Offset of the `VA` field.
5817    pub const VA_SHIFT: u32 = 0;
5818    /// Mask for the `VA` field.
5819    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
5820
5821    /// Returns the value of the `VA` field.
5822    pub const fn va(self) -> u32 {
5823        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
5824    }
5825
5826    /// Sets the value of the `VA` field.
5827    pub const fn set_va(&mut self, value: u32) {
5828        let offset = Self::VA_SHIFT;
5829        assert!(value & (Self::VA_MASK as u32) == value);
5830        *self = Self::from_bits_retain(
5831            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
5832        );
5833    }
5834}
5835
5836#[cfg(feature = "el2")]
5837bitflags! {
5838    /// `HDFGRTR2_EL2` system register value.
5839    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5840    #[repr(transparent)]
5841    pub struct Hdfgrtr2El2: u64 {
5842        /// `nPMECR_EL1` bit.
5843        const NPMECR_EL1 = 1 << 0;
5844        /// `nPMIAR_EL1` bit.
5845        const NPMIAR_EL1 = 1 << 1;
5846        /// `nPMICNTR_EL0` bit.
5847        const NPMICNTR_EL0 = 1 << 2;
5848        /// `nPMICFILTR_EL0` bit.
5849        const NPMICFILTR_EL0 = 1 << 3;
5850        /// `nPMUACR_EL1` bit.
5851        const NPMUACR_EL1 = 1 << 4;
5852        /// `nMDSELR_EL1` bit.
5853        const NMDSELR_EL1 = 1 << 5;
5854        /// `nPMSSDATA` bit.
5855        const NPMSSDATA = 1 << 6;
5856        /// `nPMSSCR_EL1` bit.
5857        const NPMSSCR_EL1 = 1 << 7;
5858        /// `nSPMEVCNTRn_EL0` bit.
5859        const NSPMEVCNTRN_EL0 = 1 << 8;
5860        /// `nSPMEVTYPERn_EL0` bit.
5861        const NSPMEVTYPERN_EL0 = 1 << 9;
5862        /// `nSPMSELR_EL0` bit.
5863        const NSPMSELR_EL0 = 1 << 10;
5864        /// `nSPMCNTEN` bit.
5865        const NSPMCNTEN = 1 << 11;
5866        /// `nSPMINTEN` bit.
5867        const NSPMINTEN = 1 << 12;
5868        /// `nSPMOVS` bit.
5869        const NSPMOVS = 1 << 13;
5870        /// `nSPMCR_EL0` bit.
5871        const NSPMCR_EL0 = 1 << 14;
5872        /// `nSPMACCESSR_EL1` bit.
5873        const NSPMACCESSR_EL1 = 1 << 15;
5874        /// `nSPMSCR_EL1` bit.
5875        const NSPMSCR_EL1 = 1 << 16;
5876        /// `nSPMID` bit.
5877        const NSPMID = 1 << 17;
5878        /// `nSPMDEVAFF_EL1` bit.
5879        const NSPMDEVAFF_EL1 = 1 << 18;
5880        /// `nPMSDSFR_EL1` bit.
5881        const NPMSDSFR_EL1 = 1 << 19;
5882        /// `nTRCITECR_EL1` bit.
5883        const NTRCITECR_EL1 = 1 << 20;
5884        /// `nTRBMPAM_EL1` bit.
5885        const NTRBMPAM_EL1 = 1 << 22;
5886        /// `nMDSTEPOP_EL1` bit.
5887        const NMDSTEPOP_EL1 = 1 << 23;
5888        /// `nPMBMAR_EL1` bit.
5889        const NPMBMAR_EL1 = 1 << 24;
5890    }
5891}
5892
5893#[cfg(feature = "el2")]
5894impl Hdfgrtr2El2 {
5895    /// Offset of the `nPMECR_EL1` field.
5896    pub const NPMECR_EL1_SHIFT: u32 = 0;
5897    /// Offset of the `nPMIAR_EL1` field.
5898    pub const NPMIAR_EL1_SHIFT: u32 = 1;
5899    /// Offset of the `nPMICNTR_EL0` field.
5900    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
5901    /// Offset of the `nPMICFILTR_EL0` field.
5902    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
5903    /// Offset of the `nPMUACR_EL1` field.
5904    pub const NPMUACR_EL1_SHIFT: u32 = 4;
5905    /// Offset of the `nMDSELR_EL1` field.
5906    pub const NMDSELR_EL1_SHIFT: u32 = 5;
5907    /// Offset of the `nPMSSDATA` field.
5908    pub const NPMSSDATA_SHIFT: u32 = 6;
5909    /// Offset of the `nPMSSCR_EL1` field.
5910    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
5911    /// Offset of the `nSPMEVCNTRn_EL0` field.
5912    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
5913    /// Offset of the `nSPMEVTYPERn_EL0` field.
5914    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
5915    /// Offset of the `nSPMSELR_EL0` field.
5916    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
5917    /// Offset of the `nSPMCNTEN` field.
5918    pub const NSPMCNTEN_SHIFT: u32 = 11;
5919    /// Offset of the `nSPMINTEN` field.
5920    pub const NSPMINTEN_SHIFT: u32 = 12;
5921    /// Offset of the `nSPMOVS` field.
5922    pub const NSPMOVS_SHIFT: u32 = 13;
5923    /// Offset of the `nSPMCR_EL0` field.
5924    pub const NSPMCR_EL0_SHIFT: u32 = 14;
5925    /// Offset of the `nSPMACCESSR_EL1` field.
5926    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
5927    /// Offset of the `nSPMSCR_EL1` field.
5928    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
5929    /// Offset of the `nSPMID` field.
5930    pub const NSPMID_SHIFT: u32 = 17;
5931    /// Offset of the `nSPMDEVAFF_EL1` field.
5932    pub const NSPMDEVAFF_EL1_SHIFT: u32 = 18;
5933    /// Offset of the `nPMSDSFR_EL1` field.
5934    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
5935    /// Offset of the `nTRCITECR_EL1` field.
5936    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
5937    /// Offset of the `nTRBMPAM_EL1` field.
5938    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
5939    /// Offset of the `nMDSTEPOP_EL1` field.
5940    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
5941    /// Offset of the `nPMBMAR_EL1` field.
5942    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
5943}
5944
5945#[cfg(feature = "el2")]
5946bitflags! {
5947    /// `HDFGWTR2_EL2` system register value.
5948    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5949    #[repr(transparent)]
5950    pub struct Hdfgwtr2El2: u64 {
5951        /// `nPMECR_EL1` bit.
5952        const NPMECR_EL1 = 1 << 0;
5953        /// `nPMIAR_EL1` bit.
5954        const NPMIAR_EL1 = 1 << 1;
5955        /// `nPMICNTR_EL0` bit.
5956        const NPMICNTR_EL0 = 1 << 2;
5957        /// `nPMICFILTR_EL0` bit.
5958        const NPMICFILTR_EL0 = 1 << 3;
5959        /// `nPMUACR_EL1` bit.
5960        const NPMUACR_EL1 = 1 << 4;
5961        /// `nMDSELR_EL1` bit.
5962        const NMDSELR_EL1 = 1 << 5;
5963        /// `nPMSSCR_EL1` bit.
5964        const NPMSSCR_EL1 = 1 << 7;
5965        /// `nSPMEVCNTRn_EL0` bit.
5966        const NSPMEVCNTRN_EL0 = 1 << 8;
5967        /// `nSPMEVTYPERn_EL0` bit.
5968        const NSPMEVTYPERN_EL0 = 1 << 9;
5969        /// `nSPMSELR_EL0` bit.
5970        const NSPMSELR_EL0 = 1 << 10;
5971        /// `nSPMCNTEN` bit.
5972        const NSPMCNTEN = 1 << 11;
5973        /// `nSPMINTEN` bit.
5974        const NSPMINTEN = 1 << 12;
5975        /// `nSPMOVS` bit.
5976        const NSPMOVS = 1 << 13;
5977        /// `nSPMCR_EL0` bit.
5978        const NSPMCR_EL0 = 1 << 14;
5979        /// `nSPMACCESSR_EL1` bit.
5980        const NSPMACCESSR_EL1 = 1 << 15;
5981        /// `nSPMSCR_EL1` bit.
5982        const NSPMSCR_EL1 = 1 << 16;
5983        /// `nPMSDSFR_EL1` bit.
5984        const NPMSDSFR_EL1 = 1 << 19;
5985        /// `nTRCITECR_EL1` bit.
5986        const NTRCITECR_EL1 = 1 << 20;
5987        /// `nPMZR_EL0` bit.
5988        const NPMZR_EL0 = 1 << 21;
5989        /// `nTRBMPAM_EL1` bit.
5990        const NTRBMPAM_EL1 = 1 << 22;
5991        /// `nMDSTEPOP_EL1` bit.
5992        const NMDSTEPOP_EL1 = 1 << 23;
5993        /// `nPMBMAR_EL1` bit.
5994        const NPMBMAR_EL1 = 1 << 24;
5995    }
5996}
5997
5998#[cfg(feature = "el2")]
5999impl Hdfgwtr2El2 {
6000    /// Offset of the `nPMECR_EL1` field.
6001    pub const NPMECR_EL1_SHIFT: u32 = 0;
6002    /// Offset of the `nPMIAR_EL1` field.
6003    pub const NPMIAR_EL1_SHIFT: u32 = 1;
6004    /// Offset of the `nPMICNTR_EL0` field.
6005    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
6006    /// Offset of the `nPMICFILTR_EL0` field.
6007    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
6008    /// Offset of the `nPMUACR_EL1` field.
6009    pub const NPMUACR_EL1_SHIFT: u32 = 4;
6010    /// Offset of the `nMDSELR_EL1` field.
6011    pub const NMDSELR_EL1_SHIFT: u32 = 5;
6012    /// Offset of the `nPMSSCR_EL1` field.
6013    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
6014    /// Offset of the `nSPMEVCNTRn_EL0` field.
6015    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
6016    /// Offset of the `nSPMEVTYPERn_EL0` field.
6017    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
6018    /// Offset of the `nSPMSELR_EL0` field.
6019    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
6020    /// Offset of the `nSPMCNTEN` field.
6021    pub const NSPMCNTEN_SHIFT: u32 = 11;
6022    /// Offset of the `nSPMINTEN` field.
6023    pub const NSPMINTEN_SHIFT: u32 = 12;
6024    /// Offset of the `nSPMOVS` field.
6025    pub const NSPMOVS_SHIFT: u32 = 13;
6026    /// Offset of the `nSPMCR_EL0` field.
6027    pub const NSPMCR_EL0_SHIFT: u32 = 14;
6028    /// Offset of the `nSPMACCESSR_EL1` field.
6029    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
6030    /// Offset of the `nSPMSCR_EL1` field.
6031    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
6032    /// Offset of the `nPMSDSFR_EL1` field.
6033    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
6034    /// Offset of the `nTRCITECR_EL1` field.
6035    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
6036    /// Offset of the `nPMZR_EL0` field.
6037    pub const NPMZR_EL0_SHIFT: u32 = 21;
6038    /// Offset of the `nTRBMPAM_EL1` field.
6039    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
6040    /// Offset of the `nMDSTEPOP_EL1` field.
6041    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
6042    /// Offset of the `nPMBMAR_EL1` field.
6043    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
6044}
6045
6046#[cfg(feature = "el2")]
6047bitflags! {
6048    /// `HFGITR2_EL2` system register value.
6049    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6050    #[repr(transparent)]
6051    pub struct Hfgitr2El2: u64 {
6052        /// `TSBCSYNC` bit.
6053        const TSBCSYNC = 1 << 0;
6054        /// `nDCCIVAPS` bit.
6055        const NDCCIVAPS = 1 << 1;
6056        /// `PLBIPERME1OS` bit.
6057        const PLBIPERME1OS = 1 << 2;
6058        /// `PLBIASIDE1OS` bit.
6059        const PLBIASIDE1OS = 1 << 3;
6060        /// `PLBIVMALLE1OS` bit.
6061        const PLBIVMALLE1OS = 1 << 4;
6062        /// `PLBIPERME1IS` bit.
6063        const PLBIPERME1IS = 1 << 5;
6064        /// `PLBIASIDE1IS` bit.
6065        const PLBIASIDE1IS = 1 << 6;
6066        /// `PLBIVMALLE1IS` bit.
6067        const PLBIVMALLE1IS = 1 << 7;
6068        /// `PLBIPERME1` bit.
6069        const PLBIPERME1 = 1 << 8;
6070        /// `PLBIASIDE1` bit.
6071        const PLBIASIDE1 = 1 << 9;
6072        /// `PLBIVMALLE1` bit.
6073        const PLBIVMALLE1 = 1 << 10;
6074        /// `PLBIPERMAE1OS` bit.
6075        const PLBIPERMAE1OS = 1 << 11;
6076        /// `PLBIPERMAE1IS` bit.
6077        const PLBIPERMAE1IS = 1 << 12;
6078        /// `PLBIPERMAE1` bit.
6079        const PLBIPERMAE1 = 1 << 13;
6080        /// `DCGBVA` bit.
6081        const DCGBVA = 1 << 14;
6082    }
6083}
6084
6085#[cfg(feature = "el2")]
6086impl Hfgitr2El2 {
6087    /// Offset of the `TSBCSYNC` field.
6088    pub const TSBCSYNC_SHIFT: u32 = 0;
6089    /// Offset of the `nDCCIVAPS` field.
6090    pub const NDCCIVAPS_SHIFT: u32 = 1;
6091    /// Offset of the `PLBIPERME1OS` field.
6092    pub const PLBIPERME1OS_SHIFT: u32 = 2;
6093    /// Offset of the `PLBIASIDE1OS` field.
6094    pub const PLBIASIDE1OS_SHIFT: u32 = 3;
6095    /// Offset of the `PLBIVMALLE1OS` field.
6096    pub const PLBIVMALLE1OS_SHIFT: u32 = 4;
6097    /// Offset of the `PLBIPERME1IS` field.
6098    pub const PLBIPERME1IS_SHIFT: u32 = 5;
6099    /// Offset of the `PLBIASIDE1IS` field.
6100    pub const PLBIASIDE1IS_SHIFT: u32 = 6;
6101    /// Offset of the `PLBIVMALLE1IS` field.
6102    pub const PLBIVMALLE1IS_SHIFT: u32 = 7;
6103    /// Offset of the `PLBIPERME1` field.
6104    pub const PLBIPERME1_SHIFT: u32 = 8;
6105    /// Offset of the `PLBIASIDE1` field.
6106    pub const PLBIASIDE1_SHIFT: u32 = 9;
6107    /// Offset of the `PLBIVMALLE1` field.
6108    pub const PLBIVMALLE1_SHIFT: u32 = 10;
6109    /// Offset of the `PLBIPERMAE1OS` field.
6110    pub const PLBIPERMAE1OS_SHIFT: u32 = 11;
6111    /// Offset of the `PLBIPERMAE1IS` field.
6112    pub const PLBIPERMAE1IS_SHIFT: u32 = 12;
6113    /// Offset of the `PLBIPERMAE1` field.
6114    pub const PLBIPERMAE1_SHIFT: u32 = 13;
6115    /// Offset of the `DCGBVA` field.
6116    pub const DCGBVA_SHIFT: u32 = 14;
6117}
6118
6119#[cfg(feature = "el2")]
6120bitflags! {
6121    /// `HFGRTR2_EL2` system register value.
6122    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6123    #[repr(transparent)]
6124    pub struct Hfgrtr2El2: u64 {
6125        /// `nPFAR_EL1` bit.
6126        const NPFAR_EL1 = 1 << 0;
6127        /// `nERXGSR_EL1` bit.
6128        const NERXGSR_EL1 = 1 << 1;
6129        /// `nRCWSMASK_EL1` bit.
6130        const NRCWSMASK_EL1 = 1 << 2;
6131        /// `nCPACRMASK_EL1` bit.
6132        const NCPACRMASK_EL1 = 1 << 3;
6133        /// `nSCTLRMASK_EL1` bit.
6134        const NSCTLRMASK_EL1 = 1 << 4;
6135        /// `nSCTLR2MASK_EL1` bit.
6136        const NSCTLR2MASK_EL1 = 1 << 5;
6137        /// `nTCRMASK_EL1` bit.
6138        const NTCRMASK_EL1 = 1 << 6;
6139        /// `nTCR2MASK_EL1` bit.
6140        const NTCR2MASK_EL1 = 1 << 7;
6141        /// `nCPACRALIAS_EL1` bit.
6142        const NCPACRALIAS_EL1 = 1 << 8;
6143        /// `nSCTLRALIAS_EL1` bit.
6144        const NSCTLRALIAS_EL1 = 1 << 9;
6145        /// `nSCTLR2ALIAS_EL1` bit.
6146        const NSCTLR2ALIAS_EL1 = 1 << 10;
6147        /// `nTCRALIAS_EL1` bit.
6148        const NTCRALIAS_EL1 = 1 << 11;
6149        /// `nTCR2ALIAS_EL1` bit.
6150        const NTCR2ALIAS_EL1 = 1 << 12;
6151        /// `nACTLRMASK_EL1` bit.
6152        const NACTLRMASK_EL1 = 1 << 13;
6153        /// `nACTLRALIAS_EL1` bit.
6154        const NACTLRALIAS_EL1 = 1 << 14;
6155        /// `nTINDEX_EL0` bit.
6156        const NTINDEX_EL0 = 1 << 15;
6157        /// `nTINDEX_EL1` bit.
6158        const NTINDEX_EL1 = 1 << 16;
6159        /// `nSTINDEX_EL1` bit.
6160        const NSTINDEX_EL1 = 1 << 17;
6161        /// `nTTTBRP_EL1` bit.
6162        const NTTTBRP_EL1 = 1 << 20;
6163        /// `nTTTBRU_EL1` bit.
6164        const NTTTBRU_EL1 = 1 << 21;
6165        /// `nIRTBRP_EL1` bit.
6166        const NIRTBRP_EL1 = 1 << 22;
6167        /// `nIRTBRU_EL1` bit.
6168        const NIRTBRU_EL1 = 1 << 23;
6169        /// `nDPOTBR1_EL1` bit.
6170        const NDPOTBR1_EL1 = 1 << 24;
6171        /// `nDPOTBR0_EL1` bit.
6172        const NDPOTBR0_EL1 = 1 << 25;
6173        /// `nTPMIN1_EL1` bit.
6174        const NTPMIN1_EL1 = 1 << 26;
6175        /// `nTPMIN0_EL1` bit.
6176        const NTPMIN0_EL1 = 1 << 27;
6177        /// `nTPMIN1_EL0` bit.
6178        const NTPMIN1_EL0 = 1 << 28;
6179        /// `nTPMIN0_EL0` bit.
6180        const NTPMIN0_EL0 = 1 << 29;
6181        /// `nTLBIDIDR_EL1` bit.
6182        const NTLBIDIDR_EL1 = 1 << 30;
6183        /// `TFSR_EL1` bit.
6184        const TFSR_EL1 = 1 << 33;
6185        /// `RGSR_EL1` bit.
6186        const RGSR_EL1 = 1 << 34;
6187        /// `GCR_EL1` bit.
6188        const GCR_EL1 = 1 << 35;
6189        /// `nTPIDR3_EL0` bit.
6190        const NTPIDR3_EL0 = 1 << 36;
6191        /// `nTPIDR3_EL1` bit.
6192        const NTPIDR3_EL1 = 1 << 37;
6193    }
6194}
6195
6196#[cfg(feature = "el2")]
6197impl Hfgrtr2El2 {
6198    /// Offset of the `nPFAR_EL1` field.
6199    pub const NPFAR_EL1_SHIFT: u32 = 0;
6200    /// Offset of the `nERXGSR_EL1` field.
6201    pub const NERXGSR_EL1_SHIFT: u32 = 1;
6202    /// Offset of the `nRCWSMASK_EL1` field.
6203    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
6204    /// Offset of the `nCPACRMASK_EL1` field.
6205    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
6206    /// Offset of the `nSCTLRMASK_EL1` field.
6207    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
6208    /// Offset of the `nSCTLR2MASK_EL1` field.
6209    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
6210    /// Offset of the `nTCRMASK_EL1` field.
6211    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
6212    /// Offset of the `nTCR2MASK_EL1` field.
6213    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
6214    /// Offset of the `nCPACRALIAS_EL1` field.
6215    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
6216    /// Offset of the `nSCTLRALIAS_EL1` field.
6217    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
6218    /// Offset of the `nSCTLR2ALIAS_EL1` field.
6219    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
6220    /// Offset of the `nTCRALIAS_EL1` field.
6221    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
6222    /// Offset of the `nTCR2ALIAS_EL1` field.
6223    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
6224    /// Offset of the `nACTLRMASK_EL1` field.
6225    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
6226    /// Offset of the `nACTLRALIAS_EL1` field.
6227    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
6228    /// Offset of the `nTINDEX_EL0` field.
6229    pub const NTINDEX_EL0_SHIFT: u32 = 15;
6230    /// Offset of the `nTINDEX_EL1` field.
6231    pub const NTINDEX_EL1_SHIFT: u32 = 16;
6232    /// Offset of the `nSTINDEX_EL1` field.
6233    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
6234    /// Offset of the `nFGDTn_EL1` field.
6235    pub const NFGDTN_EL1_SHIFT: u32 = 18;
6236    /// Mask for the `nFGDTn_EL1` field.
6237    pub const NFGDTN_EL1_MASK: u64 = 0b11;
6238    /// Offset of the `nTTTBRP_EL1` field.
6239    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
6240    /// Offset of the `nTTTBRU_EL1` field.
6241    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
6242    /// Offset of the `nIRTBRP_EL1` field.
6243    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
6244    /// Offset of the `nIRTBRU_EL1` field.
6245    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
6246    /// Offset of the `nDPOTBR1_EL1` field.
6247    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
6248    /// Offset of the `nDPOTBR0_EL1` field.
6249    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
6250    /// Offset of the `nTPMIN1_EL1` field.
6251    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
6252    /// Offset of the `nTPMIN0_EL1` field.
6253    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
6254    /// Offset of the `nTPMIN1_EL0` field.
6255    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
6256    /// Offset of the `nTPMIN0_EL0` field.
6257    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
6258    /// Offset of the `nTLBIDIDR_EL1` field.
6259    pub const NTLBIDIDR_EL1_SHIFT: u32 = 30;
6260    /// Offset of the `nAFGDTn_EL1` field.
6261    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
6262    /// Mask for the `nAFGDTn_EL1` field.
6263    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
6264    /// Offset of the `TFSR_EL1` field.
6265    pub const TFSR_EL1_SHIFT: u32 = 33;
6266    /// Offset of the `RGSR_EL1` field.
6267    pub const RGSR_EL1_SHIFT: u32 = 34;
6268    /// Offset of the `GCR_EL1` field.
6269    pub const GCR_EL1_SHIFT: u32 = 35;
6270    /// Offset of the `nTPIDR3_EL0` field.
6271    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
6272    /// Offset of the `nTPIDR3_EL1` field.
6273    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
6274
6275    /// Returns the value of the `nFGDTn_EL1` field.
6276    pub const fn nfgdtn_el1(self) -> u8 {
6277        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
6278    }
6279
6280    /// Sets the value of the `nFGDTn_EL1` field.
6281    pub const fn set_nfgdtn_el1(&mut self, value: u8) {
6282        let offset = Self::NFGDTN_EL1_SHIFT;
6283        assert!(value & (Self::NFGDTN_EL1_MASK as u8) == value);
6284        *self = Self::from_bits_retain(
6285            (self.bits() & !(Self::NFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
6286        );
6287    }
6288
6289    /// Returns the value of the `nAFGDTn_EL1` field.
6290    pub const fn nafgdtn_el1(self) -> u8 {
6291        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
6292    }
6293
6294    /// Sets the value of the `nAFGDTn_EL1` field.
6295    pub const fn set_nafgdtn_el1(&mut self, value: u8) {
6296        let offset = Self::NAFGDTN_EL1_SHIFT;
6297        assert!(value & (Self::NAFGDTN_EL1_MASK as u8) == value);
6298        *self = Self::from_bits_retain(
6299            (self.bits() & !(Self::NAFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
6300        );
6301    }
6302}
6303
6304#[cfg(feature = "el2")]
6305bitflags! {
6306    /// `HFGWTR2_EL2` system register value.
6307    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6308    #[repr(transparent)]
6309    pub struct Hfgwtr2El2: u64 {
6310        /// `nPFAR_EL1` bit.
6311        const NPFAR_EL1 = 1 << 0;
6312        /// `nRCWSMASK_EL1` bit.
6313        const NRCWSMASK_EL1 = 1 << 2;
6314        /// `nCPACRMASK_EL1` bit.
6315        const NCPACRMASK_EL1 = 1 << 3;
6316        /// `nSCTLRMASK_EL1` bit.
6317        const NSCTLRMASK_EL1 = 1 << 4;
6318        /// `nSCTLR2MASK_EL1` bit.
6319        const NSCTLR2MASK_EL1 = 1 << 5;
6320        /// `nTCRMASK_EL1` bit.
6321        const NTCRMASK_EL1 = 1 << 6;
6322        /// `nTCR2MASK_EL1` bit.
6323        const NTCR2MASK_EL1 = 1 << 7;
6324        /// `nCPACRALIAS_EL1` bit.
6325        const NCPACRALIAS_EL1 = 1 << 8;
6326        /// `nSCTLRALIAS_EL1` bit.
6327        const NSCTLRALIAS_EL1 = 1 << 9;
6328        /// `nSCTLR2ALIAS_EL1` bit.
6329        const NSCTLR2ALIAS_EL1 = 1 << 10;
6330        /// `nTCRALIAS_EL1` bit.
6331        const NTCRALIAS_EL1 = 1 << 11;
6332        /// `nTCR2ALIAS_EL1` bit.
6333        const NTCR2ALIAS_EL1 = 1 << 12;
6334        /// `nACTLRMASK_EL1` bit.
6335        const NACTLRMASK_EL1 = 1 << 13;
6336        /// `nACTLRALIAS_EL1` bit.
6337        const NACTLRALIAS_EL1 = 1 << 14;
6338        /// `nTINDEX_EL0` bit.
6339        const NTINDEX_EL0 = 1 << 15;
6340        /// `nTINDEX_EL1` bit.
6341        const NTINDEX_EL1 = 1 << 16;
6342        /// `nSTINDEX_EL1` bit.
6343        const NSTINDEX_EL1 = 1 << 17;
6344        /// `nTTTBRP_EL1` bit.
6345        const NTTTBRP_EL1 = 1 << 20;
6346        /// `nTTTBRU_EL1` bit.
6347        const NTTTBRU_EL1 = 1 << 21;
6348        /// `nIRTBRP_EL1` bit.
6349        const NIRTBRP_EL1 = 1 << 22;
6350        /// `nIRTBRU_EL1` bit.
6351        const NIRTBRU_EL1 = 1 << 23;
6352        /// `nDPOTBR1_EL1` bit.
6353        const NDPOTBR1_EL1 = 1 << 24;
6354        /// `nDPOTBR0_EL1` bit.
6355        const NDPOTBR0_EL1 = 1 << 25;
6356        /// `nTPMIN1_EL1` bit.
6357        const NTPMIN1_EL1 = 1 << 26;
6358        /// `nTPMIN0_EL1` bit.
6359        const NTPMIN0_EL1 = 1 << 27;
6360        /// `nTPMIN1_EL0` bit.
6361        const NTPMIN1_EL0 = 1 << 28;
6362        /// `nTPMIN0_EL0` bit.
6363        const NTPMIN0_EL0 = 1 << 29;
6364        /// `TFSR_EL1` bit.
6365        const TFSR_EL1 = 1 << 33;
6366        /// `RGSR_EL1` bit.
6367        const RGSR_EL1 = 1 << 34;
6368        /// `GCR_EL1` bit.
6369        const GCR_EL1 = 1 << 35;
6370        /// `nTPIDR3_EL0` bit.
6371        const NTPIDR3_EL0 = 1 << 36;
6372        /// `nTPIDR3_EL1` bit.
6373        const NTPIDR3_EL1 = 1 << 37;
6374    }
6375}
6376
6377#[cfg(feature = "el2")]
6378impl Hfgwtr2El2 {
6379    /// Offset of the `nPFAR_EL1` field.
6380    pub const NPFAR_EL1_SHIFT: u32 = 0;
6381    /// Offset of the `nRCWSMASK_EL1` field.
6382    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
6383    /// Offset of the `nCPACRMASK_EL1` field.
6384    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
6385    /// Offset of the `nSCTLRMASK_EL1` field.
6386    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
6387    /// Offset of the `nSCTLR2MASK_EL1` field.
6388    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
6389    /// Offset of the `nTCRMASK_EL1` field.
6390    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
6391    /// Offset of the `nTCR2MASK_EL1` field.
6392    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
6393    /// Offset of the `nCPACRALIAS_EL1` field.
6394    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
6395    /// Offset of the `nSCTLRALIAS_EL1` field.
6396    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
6397    /// Offset of the `nSCTLR2ALIAS_EL1` field.
6398    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
6399    /// Offset of the `nTCRALIAS_EL1` field.
6400    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
6401    /// Offset of the `nTCR2ALIAS_EL1` field.
6402    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
6403    /// Offset of the `nACTLRMASK_EL1` field.
6404    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
6405    /// Offset of the `nACTLRALIAS_EL1` field.
6406    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
6407    /// Offset of the `nTINDEX_EL0` field.
6408    pub const NTINDEX_EL0_SHIFT: u32 = 15;
6409    /// Offset of the `nTINDEX_EL1` field.
6410    pub const NTINDEX_EL1_SHIFT: u32 = 16;
6411    /// Offset of the `nSTINDEX_EL1` field.
6412    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
6413    /// Offset of the `nFGDTn_EL1` field.
6414    pub const NFGDTN_EL1_SHIFT: u32 = 18;
6415    /// Mask for the `nFGDTn_EL1` field.
6416    pub const NFGDTN_EL1_MASK: u64 = 0b11;
6417    /// Offset of the `nTTTBRP_EL1` field.
6418    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
6419    /// Offset of the `nTTTBRU_EL1` field.
6420    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
6421    /// Offset of the `nIRTBRP_EL1` field.
6422    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
6423    /// Offset of the `nIRTBRU_EL1` field.
6424    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
6425    /// Offset of the `nDPOTBR1_EL1` field.
6426    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
6427    /// Offset of the `nDPOTBR0_EL1` field.
6428    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
6429    /// Offset of the `nTPMIN1_EL1` field.
6430    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
6431    /// Offset of the `nTPMIN0_EL1` field.
6432    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
6433    /// Offset of the `nTPMIN1_EL0` field.
6434    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
6435    /// Offset of the `nTPMIN0_EL0` field.
6436    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
6437    /// Offset of the `nAFGDTn_EL1` field.
6438    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
6439    /// Mask for the `nAFGDTn_EL1` field.
6440    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
6441    /// Offset of the `TFSR_EL1` field.
6442    pub const TFSR_EL1_SHIFT: u32 = 33;
6443    /// Offset of the `RGSR_EL1` field.
6444    pub const RGSR_EL1_SHIFT: u32 = 34;
6445    /// Offset of the `GCR_EL1` field.
6446    pub const GCR_EL1_SHIFT: u32 = 35;
6447    /// Offset of the `nTPIDR3_EL0` field.
6448    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
6449    /// Offset of the `nTPIDR3_EL1` field.
6450    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
6451
6452    /// Returns the value of the `nFGDTn_EL1` field.
6453    pub const fn nfgdtn_el1(self) -> u8 {
6454        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
6455    }
6456
6457    /// Sets the value of the `nFGDTn_EL1` field.
6458    pub const fn set_nfgdtn_el1(&mut self, value: u8) {
6459        let offset = Self::NFGDTN_EL1_SHIFT;
6460        assert!(value & (Self::NFGDTN_EL1_MASK as u8) == value);
6461        *self = Self::from_bits_retain(
6462            (self.bits() & !(Self::NFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
6463        );
6464    }
6465
6466    /// Returns the value of the `nAFGDTn_EL1` field.
6467    pub const fn nafgdtn_el1(self) -> u8 {
6468        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
6469    }
6470
6471    /// Sets the value of the `nAFGDTn_EL1` field.
6472    pub const fn set_nafgdtn_el1(&mut self, value: u8) {
6473        let offset = Self::NAFGDTN_EL1_SHIFT;
6474        assert!(value & (Self::NAFGDTN_EL1_MASK as u8) == value);
6475        *self = Self::from_bits_retain(
6476            (self.bits() & !(Self::NAFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
6477        );
6478    }
6479}
6480
6481#[cfg(feature = "el2")]
6482bitflags! {
6483    /// `HFGWTR_EL2` system register value.
6484    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6485    #[repr(transparent)]
6486    pub struct HfgwtrEl2: u64 {
6487        /// `AFSR0_EL1` bit.
6488        const AFSR0_EL1 = 1 << 0;
6489        /// `AFSR1_EL1` bit.
6490        const AFSR1_EL1 = 1 << 1;
6491        /// `AMAIR_EL1` bit.
6492        const AMAIR_EL1 = 1 << 3;
6493        /// `APDAKey` bit.
6494        const APDAKEY = 1 << 4;
6495        /// `APDBKey` bit.
6496        const APDBKEY = 1 << 5;
6497        /// `APGAKey` bit.
6498        const APGAKEY = 1 << 6;
6499        /// `APIAKey` bit.
6500        const APIAKEY = 1 << 7;
6501        /// `APIBKey` bit.
6502        const APIBKEY = 1 << 8;
6503        /// `CONTEXTIDR_EL1` bit.
6504        const CONTEXTIDR_EL1 = 1 << 11;
6505        /// `CPACR_EL1` bit.
6506        const CPACR_EL1 = 1 << 12;
6507        /// `CSSELR_EL1` bit.
6508        const CSSELR_EL1 = 1 << 13;
6509        /// `ESR_EL1` bit.
6510        const ESR_EL1 = 1 << 16;
6511        /// `FAR_EL1` bit.
6512        const FAR_EL1 = 1 << 17;
6513        /// `LORC_EL1` bit.
6514        const LORC_EL1 = 1 << 19;
6515        /// `LOREA_EL1` bit.
6516        const LOREA_EL1 = 1 << 20;
6517        /// `LORN_EL1` bit.
6518        const LORN_EL1 = 1 << 22;
6519        /// `LORSA_EL1` bit.
6520        const LORSA_EL1 = 1 << 23;
6521        /// `MAIR_EL1` bit.
6522        const MAIR_EL1 = 1 << 24;
6523        /// `PAR_EL1` bit.
6524        const PAR_EL1 = 1 << 27;
6525        /// `SCTLR_EL1` bit.
6526        const SCTLR_EL1 = 1 << 29;
6527        /// `SCXTNUM_EL1` bit.
6528        const SCXTNUM_EL1 = 1 << 30;
6529        /// `SCXTNUM_EL0` bit.
6530        const SCXTNUM_EL0 = 1 << 31;
6531        /// `TCR_EL1` bit.
6532        const TCR_EL1 = 1 << 32;
6533        /// `TPIDR_EL1` bit.
6534        const TPIDR_EL1 = 1 << 33;
6535        /// `TPIDRRO_EL0` bit.
6536        const TPIDRRO_EL0 = 1 << 34;
6537        /// `TPIDR_EL0` bit.
6538        const TPIDR_EL0 = 1 << 35;
6539        /// `TTBR0_EL1` bit.
6540        const TTBR0_EL1 = 1 << 36;
6541        /// `TTBR1_EL1` bit.
6542        const TTBR1_EL1 = 1 << 37;
6543        /// `VBAR_EL1` bit.
6544        const VBAR_EL1 = 1 << 38;
6545        /// `ICC_IGRPENn_EL1` bit.
6546        const ICC_IGRPENN_EL1 = 1 << 39;
6547        /// `ERRSELR_EL1` bit.
6548        const ERRSELR_EL1 = 1 << 41;
6549        /// `ERXCTLR_EL1` bit.
6550        const ERXCTLR_EL1 = 1 << 43;
6551        /// `ERXSTATUS_EL1` bit.
6552        const ERXSTATUS_EL1 = 1 << 44;
6553        /// `ERXMISCn_EL1` bit.
6554        const ERXMISCN_EL1 = 1 << 45;
6555        /// `ERXPFGCTL_EL1` bit.
6556        const ERXPFGCTL_EL1 = 1 << 47;
6557        /// `ERXPFGCDN_EL1` bit.
6558        const ERXPFGCDN_EL1 = 1 << 48;
6559        /// `ERXADDR_EL1` bit.
6560        const ERXADDR_EL1 = 1 << 49;
6561        /// `nACCDATA_EL1` bit.
6562        const NACCDATA_EL1 = 1 << 50;
6563        /// `nGCS_EL0` bit.
6564        const NGCS_EL0 = 1 << 52;
6565        /// `nGCS_EL1` bit.
6566        const NGCS_EL1 = 1 << 53;
6567        /// `nSMPRI_EL1` bit.
6568        const NSMPRI_EL1 = 1 << 54;
6569        /// `nTPIDR2_EL0` bit.
6570        const NTPIDR2_EL0 = 1 << 55;
6571        /// `nRCWMASK_EL1` bit.
6572        const NRCWMASK_EL1 = 1 << 56;
6573        /// `nPIRE0_EL1` bit.
6574        const NPIRE0_EL1 = 1 << 57;
6575        /// `nPIR_EL1` bit.
6576        const NPIR_EL1 = 1 << 58;
6577        /// `nPOR_EL0` bit.
6578        const NPOR_EL0 = 1 << 59;
6579        /// `nPOR_EL1` bit.
6580        const NPOR_EL1 = 1 << 60;
6581        /// `nS2POR_EL1` bit.
6582        const NS2POR_EL1 = 1 << 61;
6583        /// `nMAIR2_EL1` bit.
6584        const NMAIR2_EL1 = 1 << 62;
6585        /// `nAMAIR2_EL1` bit.
6586        const NAMAIR2_EL1 = 1 << 63;
6587    }
6588}
6589
6590#[cfg(feature = "el2")]
6591impl HfgwtrEl2 {
6592    /// Offset of the `AFSR0_EL1` field.
6593    pub const AFSR0_EL1_SHIFT: u32 = 0;
6594    /// Offset of the `AFSR1_EL1` field.
6595    pub const AFSR1_EL1_SHIFT: u32 = 1;
6596    /// Offset of the `AMAIR_EL1` field.
6597    pub const AMAIR_EL1_SHIFT: u32 = 3;
6598    /// Offset of the `APDAKey` field.
6599    pub const APDAKEY_SHIFT: u32 = 4;
6600    /// Offset of the `APDBKey` field.
6601    pub const APDBKEY_SHIFT: u32 = 5;
6602    /// Offset of the `APGAKey` field.
6603    pub const APGAKEY_SHIFT: u32 = 6;
6604    /// Offset of the `APIAKey` field.
6605    pub const APIAKEY_SHIFT: u32 = 7;
6606    /// Offset of the `APIBKey` field.
6607    pub const APIBKEY_SHIFT: u32 = 8;
6608    /// Offset of the `CONTEXTIDR_EL1` field.
6609    pub const CONTEXTIDR_EL1_SHIFT: u32 = 11;
6610    /// Offset of the `CPACR_EL1` field.
6611    pub const CPACR_EL1_SHIFT: u32 = 12;
6612    /// Offset of the `CSSELR_EL1` field.
6613    pub const CSSELR_EL1_SHIFT: u32 = 13;
6614    /// Offset of the `ESR_EL1` field.
6615    pub const ESR_EL1_SHIFT: u32 = 16;
6616    /// Offset of the `FAR_EL1` field.
6617    pub const FAR_EL1_SHIFT: u32 = 17;
6618    /// Offset of the `LORC_EL1` field.
6619    pub const LORC_EL1_SHIFT: u32 = 19;
6620    /// Offset of the `LOREA_EL1` field.
6621    pub const LOREA_EL1_SHIFT: u32 = 20;
6622    /// Offset of the `LORN_EL1` field.
6623    pub const LORN_EL1_SHIFT: u32 = 22;
6624    /// Offset of the `LORSA_EL1` field.
6625    pub const LORSA_EL1_SHIFT: u32 = 23;
6626    /// Offset of the `MAIR_EL1` field.
6627    pub const MAIR_EL1_SHIFT: u32 = 24;
6628    /// Offset of the `PAR_EL1` field.
6629    pub const PAR_EL1_SHIFT: u32 = 27;
6630    /// Offset of the `SCTLR_EL1` field.
6631    pub const SCTLR_EL1_SHIFT: u32 = 29;
6632    /// Offset of the `SCXTNUM_EL1` field.
6633    pub const SCXTNUM_EL1_SHIFT: u32 = 30;
6634    /// Offset of the `SCXTNUM_EL0` field.
6635    pub const SCXTNUM_EL0_SHIFT: u32 = 31;
6636    /// Offset of the `TCR_EL1` field.
6637    pub const TCR_EL1_SHIFT: u32 = 32;
6638    /// Offset of the `TPIDR_EL1` field.
6639    pub const TPIDR_EL1_SHIFT: u32 = 33;
6640    /// Offset of the `TPIDRRO_EL0` field.
6641    pub const TPIDRRO_EL0_SHIFT: u32 = 34;
6642    /// Offset of the `TPIDR_EL0` field.
6643    pub const TPIDR_EL0_SHIFT: u32 = 35;
6644    /// Offset of the `TTBR0_EL1` field.
6645    pub const TTBR0_EL1_SHIFT: u32 = 36;
6646    /// Offset of the `TTBR1_EL1` field.
6647    pub const TTBR1_EL1_SHIFT: u32 = 37;
6648    /// Offset of the `VBAR_EL1` field.
6649    pub const VBAR_EL1_SHIFT: u32 = 38;
6650    /// Offset of the `ICC_IGRPENn_EL1` field.
6651    pub const ICC_IGRPENN_EL1_SHIFT: u32 = 39;
6652    /// Offset of the `ERRSELR_EL1` field.
6653    pub const ERRSELR_EL1_SHIFT: u32 = 41;
6654    /// Offset of the `ERXCTLR_EL1` field.
6655    pub const ERXCTLR_EL1_SHIFT: u32 = 43;
6656    /// Offset of the `ERXSTATUS_EL1` field.
6657    pub const ERXSTATUS_EL1_SHIFT: u32 = 44;
6658    /// Offset of the `ERXMISCn_EL1` field.
6659    pub const ERXMISCN_EL1_SHIFT: u32 = 45;
6660    /// Offset of the `ERXPFGCTL_EL1` field.
6661    pub const ERXPFGCTL_EL1_SHIFT: u32 = 47;
6662    /// Offset of the `ERXPFGCDN_EL1` field.
6663    pub const ERXPFGCDN_EL1_SHIFT: u32 = 48;
6664    /// Offset of the `ERXADDR_EL1` field.
6665    pub const ERXADDR_EL1_SHIFT: u32 = 49;
6666    /// Offset of the `nACCDATA_EL1` field.
6667    pub const NACCDATA_EL1_SHIFT: u32 = 50;
6668    /// Offset of the `nGCS_EL0` field.
6669    pub const NGCS_EL0_SHIFT: u32 = 52;
6670    /// Offset of the `nGCS_EL1` field.
6671    pub const NGCS_EL1_SHIFT: u32 = 53;
6672    /// Offset of the `nSMPRI_EL1` field.
6673    pub const NSMPRI_EL1_SHIFT: u32 = 54;
6674    /// Offset of the `nTPIDR2_EL0` field.
6675    pub const NTPIDR2_EL0_SHIFT: u32 = 55;
6676    /// Offset of the `nRCWMASK_EL1` field.
6677    pub const NRCWMASK_EL1_SHIFT: u32 = 56;
6678    /// Offset of the `nPIRE0_EL1` field.
6679    pub const NPIRE0_EL1_SHIFT: u32 = 57;
6680    /// Offset of the `nPIR_EL1` field.
6681    pub const NPIR_EL1_SHIFT: u32 = 58;
6682    /// Offset of the `nPOR_EL0` field.
6683    pub const NPOR_EL0_SHIFT: u32 = 59;
6684    /// Offset of the `nPOR_EL1` field.
6685    pub const NPOR_EL1_SHIFT: u32 = 60;
6686    /// Offset of the `nS2POR_EL1` field.
6687    pub const NS2POR_EL1_SHIFT: u32 = 61;
6688    /// Offset of the `nMAIR2_EL1` field.
6689    pub const NMAIR2_EL1_SHIFT: u32 = 62;
6690    /// Offset of the `nAMAIR2_EL1` field.
6691    pub const NAMAIR2_EL1_SHIFT: u32 = 63;
6692}
6693
6694bitflags! {
6695    /// `HIFAR` system register value.
6696    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6697    #[repr(transparent)]
6698    pub struct Hifar: u32 {
6699    }
6700}
6701
6702impl Hifar {
6703    /// Offset of the `VA` field.
6704    pub const VA_SHIFT: u32 = 0;
6705    /// Mask for the `VA` field.
6706    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
6707
6708    /// Returns the value of the `VA` field.
6709    pub const fn va(self) -> u32 {
6710        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
6711    }
6712
6713    /// Sets the value of the `VA` field.
6714    pub const fn set_va(&mut self, value: u32) {
6715        let offset = Self::VA_SHIFT;
6716        assert!(value & (Self::VA_MASK as u32) == value);
6717        *self = Self::from_bits_retain(
6718            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
6719        );
6720    }
6721}
6722
6723bitflags! {
6724    /// `HMAIR0` system register value.
6725    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6726    #[repr(transparent)]
6727    pub struct Hmair0: u32 {
6728    }
6729}
6730
6731impl Hmair0 {
6732    /// Offset of the `Attr<n>` field.
6733    pub const ATTR_SHIFT: u32 = 0;
6734    /// Mask for the `Attr<n>` field.
6735    pub const ATTR_MASK: u32 = 0b11111111;
6736
6737    /// Returns the value of the given `Attr<n>` field.
6738    pub const fn attr(self, n: u32) -> u8 {
6739        assert!(n < 4);
6740        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
6741    }
6742
6743    /// Sets the value of the `Attr<n>` field.
6744    pub const fn set_attr(&mut self, n: u32, value: u8) {
6745        assert!(n < 4);
6746        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
6747        assert!(value & (Self::ATTR_MASK as u8) == value);
6748        *self = Self::from_bits_retain(
6749            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
6750        );
6751    }
6752}
6753
6754bitflags! {
6755    /// `HMAIR1` system register value.
6756    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6757    #[repr(transparent)]
6758    pub struct Hmair1: u32 {
6759    }
6760}
6761
6762impl Hmair1 {
6763    /// Offset of the `Attr<n>` field.
6764    pub const ATTR_SHIFT: u32 = 0;
6765    /// Mask for the `Attr<n>` field.
6766    pub const ATTR_MASK: u32 = 0b11111111;
6767
6768    /// Returns the value of the given `Attr<n>` field.
6769    pub const fn attr(self, n: u32) -> u8 {
6770        assert!(n >= 4 && n < 8);
6771        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
6772    }
6773
6774    /// Sets the value of the `Attr<n>` field.
6775    pub const fn set_attr(&mut self, n: u32, value: u8) {
6776        assert!(n >= 4 && n < 8);
6777        let offset = Self::ATTR_SHIFT + (n - 4) * 8;
6778        assert!(value & (Self::ATTR_MASK as u8) == value);
6779        *self = Self::from_bits_retain(
6780            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
6781        );
6782    }
6783}
6784
6785bitflags! {
6786    /// `HPFAR` system register value.
6787    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6788    #[repr(transparent)]
6789    pub struct Hpfar: u32 {
6790    }
6791}
6792
6793impl Hpfar {
6794    /// Offset of the `FIPA[39:12]` field.
6795    pub const FIPA_39_12_SHIFT: u32 = 4;
6796    /// Mask for the `FIPA[39:12]` field.
6797    pub const FIPA_39_12_MASK: u32 = 0b1111111111111111111111111111;
6798
6799    /// Returns the value of the `FIPA[39:12]` field.
6800    pub const fn fipa_39_12(self) -> u32 {
6801        ((self.bits() >> Self::FIPA_39_12_SHIFT) & 0b1111111111111111111111111111) as u32
6802    }
6803
6804    /// Sets the value of the `FIPA[39:12]` field.
6805    pub const fn set_fipa_39_12(&mut self, value: u32) {
6806        let offset = Self::FIPA_39_12_SHIFT;
6807        assert!(value & (Self::FIPA_39_12_MASK as u32) == value);
6808        *self = Self::from_bits_retain(
6809            (self.bits() & !(Self::FIPA_39_12_MASK << offset)) | ((value as u32) << offset),
6810        );
6811    }
6812}
6813
6814#[cfg(feature = "el2")]
6815bitflags! {
6816    /// `HPFAR_EL2` system register value.
6817    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6818    #[repr(transparent)]
6819    pub struct HpfarEl2: u64 {
6820        /// `NS` bit.
6821        const NS = 1 << 63;
6822    }
6823}
6824
6825#[cfg(feature = "el2")]
6826impl HpfarEl2 {
6827    /// Offset of the `FIPA` field.
6828    pub const FIPA_SHIFT: u32 = 4;
6829    /// Mask for the `FIPA` field.
6830    pub const FIPA_MASK: u64 = 0b11111111111111111111111111111111111111111111;
6831    /// Offset of the `NS` field.
6832    pub const NS_SHIFT: u32 = 63;
6833
6834    /// Returns the value of the `FIPA` field.
6835    pub const fn fipa(self) -> u64 {
6836        ((self.bits() >> Self::FIPA_SHIFT) & 0b11111111111111111111111111111111111111111111) as u64
6837    }
6838
6839    /// Sets the value of the `FIPA` field.
6840    pub const fn set_fipa(&mut self, value: u64) {
6841        let offset = Self::FIPA_SHIFT;
6842        assert!(value & (Self::FIPA_MASK as u64) == value);
6843        *self = Self::from_bits_retain(
6844            (self.bits() & !(Self::FIPA_MASK << offset)) | ((value as u64) << offset),
6845        );
6846    }
6847}
6848
6849bitflags! {
6850    /// `HRMR` system register value.
6851    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6852    #[repr(transparent)]
6853    pub struct Hrmr: u32 {
6854        /// `AA64` bit.
6855        const AA64 = 1 << 0;
6856        /// `RR` bit.
6857        const RR = 1 << 1;
6858    }
6859}
6860
6861impl Hrmr {
6862    /// Offset of the `AA64` field.
6863    pub const AA64_SHIFT: u32 = 0;
6864    /// Offset of the `RR` field.
6865    pub const RR_SHIFT: u32 = 1;
6866}
6867
6868bitflags! {
6869    /// `HSCTLR` system register value.
6870    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6871    #[repr(transparent)]
6872    pub struct Hsctlr: u32 {
6873        /// RES1 bits in the `HSCTLR` register.
6874        const RES1 = 0b110000110001010000100000000000;
6875        /// `M` bit.
6876        const M = 1 << 0;
6877        /// `A` bit.
6878        const A = 1 << 1;
6879        /// `C` bit.
6880        const C = 1 << 2;
6881        /// `nTLSMD` bit.
6882        const NTLSMD = 1 << 3;
6883        /// `LSMAOE` bit.
6884        const LSMAOE = 1 << 4;
6885        /// `CP15BEN` bit.
6886        const CP15BEN = 1 << 5;
6887        /// `ITD` bit.
6888        const ITD = 1 << 7;
6889        /// `SED` bit.
6890        const SED = 1 << 8;
6891        /// `I` bit.
6892        const I = 1 << 12;
6893        /// `WXN` bit.
6894        const WXN = 1 << 19;
6895        /// `TE` bit.
6896        const TE = 1 << 30;
6897        /// `DSSBS` bit.
6898        const DSSBS = 1 << 31;
6899    }
6900}
6901
6902impl Hsctlr {
6903    /// Offset of the `M` field.
6904    pub const M_SHIFT: u32 = 0;
6905    /// Offset of the `A` field.
6906    pub const A_SHIFT: u32 = 1;
6907    /// Offset of the `C` field.
6908    pub const C_SHIFT: u32 = 2;
6909    /// Offset of the `nTLSMD` field.
6910    pub const NTLSMD_SHIFT: u32 = 3;
6911    /// Offset of the `LSMAOE` field.
6912    pub const LSMAOE_SHIFT: u32 = 4;
6913    /// Offset of the `CP15BEN` field.
6914    pub const CP15BEN_SHIFT: u32 = 5;
6915    /// Offset of the `ITD` field.
6916    pub const ITD_SHIFT: u32 = 7;
6917    /// Offset of the `SED` field.
6918    pub const SED_SHIFT: u32 = 8;
6919    /// Offset of the `I` field.
6920    pub const I_SHIFT: u32 = 12;
6921    /// Offset of the `WXN` field.
6922    pub const WXN_SHIFT: u32 = 19;
6923    /// Offset of the `TE` field.
6924    pub const TE_SHIFT: u32 = 30;
6925    /// Offset of the `DSSBS` field.
6926    pub const DSSBS_SHIFT: u32 = 31;
6927}
6928
6929bitflags! {
6930    /// `HSR` system register value.
6931    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6932    #[repr(transparent)]
6933    pub struct Hsr: u32 {
6934        /// `IL` bit.
6935        const IL = 1 << 25;
6936    }
6937}
6938
6939impl Hsr {
6940    /// Offset of the `ISS` field.
6941    pub const ISS_SHIFT: u32 = 0;
6942    /// Mask for the `ISS` field.
6943    pub const ISS_MASK: u32 = 0b1111111111111111111111111;
6944    /// Offset of the `IL` field.
6945    pub const IL_SHIFT: u32 = 25;
6946    /// Offset of the `EC` field.
6947    pub const EC_SHIFT: u32 = 26;
6948    /// Mask for the `EC` field.
6949    pub const EC_MASK: u32 = 0b111111;
6950
6951    /// Returns the value of the `ISS` field.
6952    pub const fn iss(self) -> u32 {
6953        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
6954    }
6955
6956    /// Sets the value of the `ISS` field.
6957    pub const fn set_iss(&mut self, value: u32) {
6958        let offset = Self::ISS_SHIFT;
6959        assert!(value & (Self::ISS_MASK as u32) == value);
6960        *self = Self::from_bits_retain(
6961            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u32) << offset),
6962        );
6963    }
6964
6965    /// Returns the value of the `EC` field.
6966    pub const fn ec(self) -> u8 {
6967        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
6968    }
6969
6970    /// Sets the value of the `EC` field.
6971    pub const fn set_ec(&mut self, value: u8) {
6972        let offset = Self::EC_SHIFT;
6973        assert!(value & (Self::EC_MASK as u8) == value);
6974        *self = Self::from_bits_retain(
6975            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u32) << offset),
6976        );
6977    }
6978}
6979
6980bitflags! {
6981    /// `HTCR` system register value.
6982    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6983    #[repr(transparent)]
6984    pub struct Htcr: u32 {
6985        /// RES1 bits in the `HTCR` register.
6986        const RES1 = 0b10000000100000000000000000000000;
6987        /// `HPD` bit.
6988        const HPD = 1 << 24;
6989        /// `HWU59` bit.
6990        const HWU59 = 1 << 25;
6991        /// `HWU60` bit.
6992        const HWU60 = 1 << 26;
6993        /// `HWU61` bit.
6994        const HWU61 = 1 << 27;
6995        /// `HWU62` bit.
6996        const HWU62 = 1 << 28;
6997    }
6998}
6999
7000impl Htcr {
7001    /// Offset of the `T0SZ` field.
7002    pub const T0SZ_SHIFT: u32 = 0;
7003    /// Mask for the `T0SZ` field.
7004    pub const T0SZ_MASK: u32 = 0b111;
7005    /// Offset of the `IRGN0` field.
7006    pub const IRGN0_SHIFT: u32 = 8;
7007    /// Mask for the `IRGN0` field.
7008    pub const IRGN0_MASK: u32 = 0b11;
7009    /// Offset of the `ORGN0` field.
7010    pub const ORGN0_SHIFT: u32 = 10;
7011    /// Mask for the `ORGN0` field.
7012    pub const ORGN0_MASK: u32 = 0b11;
7013    /// Offset of the `SH0` field.
7014    pub const SH0_SHIFT: u32 = 12;
7015    /// Mask for the `SH0` field.
7016    pub const SH0_MASK: u32 = 0b11;
7017    /// Offset of the `HPD` field.
7018    pub const HPD_SHIFT: u32 = 24;
7019    /// Offset of the `HWU59` field.
7020    pub const HWU59_SHIFT: u32 = 25;
7021    /// Offset of the `HWU60` field.
7022    pub const HWU60_SHIFT: u32 = 26;
7023    /// Offset of the `HWU61` field.
7024    pub const HWU61_SHIFT: u32 = 27;
7025    /// Offset of the `HWU62` field.
7026    pub const HWU62_SHIFT: u32 = 28;
7027
7028    /// Returns the value of the `T0SZ` field.
7029    pub const fn t0sz(self) -> u8 {
7030        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
7031    }
7032
7033    /// Sets the value of the `T0SZ` field.
7034    pub const fn set_t0sz(&mut self, value: u8) {
7035        let offset = Self::T0SZ_SHIFT;
7036        assert!(value & (Self::T0SZ_MASK as u8) == value);
7037        *self = Self::from_bits_retain(
7038            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
7039        );
7040    }
7041
7042    /// Returns the value of the `IRGN0` field.
7043    pub const fn irgn0(self) -> u8 {
7044        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
7045    }
7046
7047    /// Sets the value of the `IRGN0` field.
7048    pub const fn set_irgn0(&mut self, value: u8) {
7049        let offset = Self::IRGN0_SHIFT;
7050        assert!(value & (Self::IRGN0_MASK as u8) == value);
7051        *self = Self::from_bits_retain(
7052            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
7053        );
7054    }
7055
7056    /// Returns the value of the `ORGN0` field.
7057    pub const fn orgn0(self) -> u8 {
7058        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
7059    }
7060
7061    /// Sets the value of the `ORGN0` field.
7062    pub const fn set_orgn0(&mut self, value: u8) {
7063        let offset = Self::ORGN0_SHIFT;
7064        assert!(value & (Self::ORGN0_MASK as u8) == value);
7065        *self = Self::from_bits_retain(
7066            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
7067        );
7068    }
7069
7070    /// Returns the value of the `SH0` field.
7071    pub const fn sh0(self) -> u8 {
7072        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
7073    }
7074
7075    /// Sets the value of the `SH0` field.
7076    pub const fn set_sh0(&mut self, value: u8) {
7077        let offset = Self::SH0_SHIFT;
7078        assert!(value & (Self::SH0_MASK as u8) == value);
7079        *self = Self::from_bits_retain(
7080            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
7081        );
7082    }
7083}
7084
7085bitflags! {
7086    /// `HTPIDR` system register value.
7087    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7088    #[repr(transparent)]
7089    pub struct Htpidr: u32 {
7090    }
7091}
7092
7093impl Htpidr {
7094    /// Offset of the `TID` field.
7095    pub const TID_SHIFT: u32 = 0;
7096    /// Mask for the `TID` field.
7097    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
7098
7099    /// Returns the value of the `TID` field.
7100    pub const fn tid(self) -> u32 {
7101        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
7102    }
7103
7104    /// Sets the value of the `TID` field.
7105    pub const fn set_tid(&mut self, value: u32) {
7106        let offset = Self::TID_SHIFT;
7107        assert!(value & (Self::TID_MASK as u32) == value);
7108        *self = Self::from_bits_retain(
7109            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
7110        );
7111    }
7112}
7113
7114bitflags! {
7115    /// `HTRFCR` system register value.
7116    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7117    #[repr(transparent)]
7118    pub struct Htrfcr: u32 {
7119        /// `E0HTRE` bit.
7120        const E0HTRE = 1 << 0;
7121        /// `E2TRE` bit.
7122        const E2TRE = 1 << 1;
7123        /// `CX` bit.
7124        const CX = 1 << 3;
7125    }
7126}
7127
7128impl Htrfcr {
7129    /// Offset of the `E0HTRE` field.
7130    pub const E0HTRE_SHIFT: u32 = 0;
7131    /// Offset of the `E2TRE` field.
7132    pub const E2TRE_SHIFT: u32 = 1;
7133    /// Offset of the `CX` field.
7134    pub const CX_SHIFT: u32 = 3;
7135    /// Offset of the `TS` field.
7136    pub const TS_SHIFT: u32 = 5;
7137    /// Mask for the `TS` field.
7138    pub const TS_MASK: u32 = 0b11;
7139
7140    /// Returns the value of the `TS` field.
7141    pub const fn ts(self) -> u8 {
7142        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
7143    }
7144
7145    /// Sets the value of the `TS` field.
7146    pub const fn set_ts(&mut self, value: u8) {
7147        let offset = Self::TS_SHIFT;
7148        assert!(value & (Self::TS_MASK as u8) == value);
7149        *self = Self::from_bits_retain(
7150            (self.bits() & !(Self::TS_MASK << offset)) | ((value as u32) << offset),
7151        );
7152    }
7153}
7154
7155bitflags! {
7156    /// `HTTBR` system register value.
7157    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7158    #[repr(transparent)]
7159    pub struct Httbr: u64 {
7160        /// `CnP` bit.
7161        const CNP = 1 << 0;
7162    }
7163}
7164
7165impl Httbr {
7166    /// Offset of the `CnP` field.
7167    pub const CNP_SHIFT: u32 = 0;
7168    /// Offset of the `BADDR` field.
7169    pub const BADDR_SHIFT: u32 = 1;
7170    /// Mask for the `BADDR` field.
7171    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
7172
7173    /// Returns the value of the `BADDR` field.
7174    pub const fn baddr(self) -> u64 {
7175        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
7176            as u64
7177    }
7178
7179    /// Sets the value of the `BADDR` field.
7180    pub const fn set_baddr(&mut self, value: u64) {
7181        let offset = Self::BADDR_SHIFT;
7182        assert!(value & (Self::BADDR_MASK as u64) == value);
7183        *self = Self::from_bits_retain(
7184            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
7185        );
7186    }
7187}
7188
7189bitflags! {
7190    /// `HVBAR` system register value.
7191    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7192    #[repr(transparent)]
7193    pub struct Hvbar: u32 {
7194    }
7195}
7196
7197impl Hvbar {
7198    /// Offset of the `VBA` field.
7199    pub const VBA_SHIFT: u32 = 5;
7200    /// Mask for the `VBA` field.
7201    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
7202
7203    /// Returns the value of the `VBA` field.
7204    pub const fn vba(self) -> u32 {
7205        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
7206    }
7207
7208    /// Sets the value of the `VBA` field.
7209    pub const fn set_vba(&mut self, value: u32) {
7210        let offset = Self::VBA_SHIFT;
7211        assert!(value & (Self::VBA_MASK as u32) == value);
7212        *self = Self::from_bits_retain(
7213            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
7214        );
7215    }
7216}
7217
7218#[cfg(feature = "el1")]
7219bitflags! {
7220    /// `ICC_SRE_EL1` system register value.
7221    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7222    #[repr(transparent)]
7223    pub struct IccSreEl1: u64 {
7224        /// Enable the system register interface.
7225        const SRE = 1 << 0;
7226        /// Disable FIQ bypass.
7227        const DFB = 1 << 1;
7228        /// Disable IRQ bypass.
7229        const DIB = 1 << 2;
7230    }
7231}
7232
7233#[cfg(feature = "el1")]
7234impl IccSreEl1 {
7235    /// Offset of the `SRE` field.
7236    pub const SRE_SHIFT: u32 = 0;
7237    /// Offset of the `DFB` field.
7238    pub const DFB_SHIFT: u32 = 1;
7239    /// Offset of the `DIB` field.
7240    pub const DIB_SHIFT: u32 = 2;
7241}
7242
7243#[cfg(feature = "el2")]
7244bitflags! {
7245    /// `ICC_SRE_EL2` system register value.
7246    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7247    #[repr(transparent)]
7248    pub struct IccSreEl2: u64 {
7249        /// Enable the system register interface.
7250        const SRE = 1 << 0;
7251        /// Disable FIQ bypass.
7252        const DFB = 1 << 1;
7253        /// Disable IRQ bypass.
7254        const DIB = 1 << 2;
7255        /// Enable lower exception level access.
7256        const ENABLE = 1 << 3;
7257    }
7258}
7259
7260#[cfg(feature = "el2")]
7261impl IccSreEl2 {
7262    /// Offset of the `SRE` field.
7263    pub const SRE_SHIFT: u32 = 0;
7264    /// Offset of the `DFB` field.
7265    pub const DFB_SHIFT: u32 = 1;
7266    /// Offset of the `DIB` field.
7267    pub const DIB_SHIFT: u32 = 2;
7268    /// Offset of the `Enable` field.
7269    pub const ENABLE_SHIFT: u32 = 3;
7270}
7271
7272#[cfg(feature = "el3")]
7273bitflags! {
7274    /// `ICC_SRE_EL3` system register value.
7275    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7276    #[repr(transparent)]
7277    pub struct IccSreEl3: u64 {
7278        /// Enable the system register interface.
7279        const SRE = 1 << 0;
7280        /// Disable FIQ bypass.
7281        const DFB = 1 << 1;
7282        /// Disable IRQ bypass.
7283        const DIB = 1 << 2;
7284        /// Enable lower exception level access.
7285        const ENABLE = 1 << 3;
7286    }
7287}
7288
7289#[cfg(feature = "el3")]
7290impl IccSreEl3 {
7291    /// Offset of the `SRE` field.
7292    pub const SRE_SHIFT: u32 = 0;
7293    /// Offset of the `DFB` field.
7294    pub const DFB_SHIFT: u32 = 1;
7295    /// Offset of the `DIB` field.
7296    pub const DIB_SHIFT: u32 = 2;
7297    /// Offset of the `Enable` field.
7298    pub const ENABLE_SHIFT: u32 = 3;
7299}
7300
7301#[cfg(feature = "el2")]
7302bitflags! {
7303    /// `ICH_HCR_EL2` system register value.
7304    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7305    #[repr(transparent)]
7306    pub struct IchHcrEl2: u64 {
7307        /// `En` bit.
7308        const EN = 1 << 0;
7309        /// `UIE` bit.
7310        const UIE = 1 << 1;
7311        /// `LRENPIE` bit.
7312        const LRENPIE = 1 << 2;
7313        /// `NPIE` bit.
7314        const NPIE = 1 << 3;
7315        /// `VGrp0EIE` bit.
7316        const VGRP0EIE = 1 << 4;
7317        /// `VGrp0DIE` bit.
7318        const VGRP0DIE = 1 << 5;
7319        /// `VGrp1EIE` bit.
7320        const VGRP1EIE = 1 << 6;
7321        /// `VGrp1DIE` bit.
7322        const VGRP1DIE = 1 << 7;
7323        /// `vSGIEOICount` bit.
7324        const VSGIEOICOUNT = 1 << 8;
7325        /// `TC` bit.
7326        const TC = 1 << 10;
7327        /// `TALL0` bit.
7328        const TALL0 = 1 << 11;
7329        /// `TALL1` bit.
7330        const TALL1 = 1 << 12;
7331        /// `TSEI` bit.
7332        const TSEI = 1 << 13;
7333        /// `TDIR` bit.
7334        const TDIR = 1 << 14;
7335        /// `DVIM` bit.
7336        const DVIM = 1 << 15;
7337    }
7338}
7339
7340#[cfg(feature = "el2")]
7341impl IchHcrEl2 {
7342    /// Offset of the `En` field.
7343    pub const EN_SHIFT: u32 = 0;
7344    /// Offset of the `UIE` field.
7345    pub const UIE_SHIFT: u32 = 1;
7346    /// Offset of the `LRENPIE` field.
7347    pub const LRENPIE_SHIFT: u32 = 2;
7348    /// Offset of the `NPIE` field.
7349    pub const NPIE_SHIFT: u32 = 3;
7350    /// Offset of the `VGrp0EIE` field.
7351    pub const VGRP0EIE_SHIFT: u32 = 4;
7352    /// Offset of the `VGrp0DIE` field.
7353    pub const VGRP0DIE_SHIFT: u32 = 5;
7354    /// Offset of the `VGrp1EIE` field.
7355    pub const VGRP1EIE_SHIFT: u32 = 6;
7356    /// Offset of the `VGrp1DIE` field.
7357    pub const VGRP1DIE_SHIFT: u32 = 7;
7358    /// Offset of the `vSGIEOICount` field.
7359    pub const VSGIEOICOUNT_SHIFT: u32 = 8;
7360    /// Offset of the `TC` field.
7361    pub const TC_SHIFT: u32 = 10;
7362    /// Offset of the `TALL0` field.
7363    pub const TALL0_SHIFT: u32 = 11;
7364    /// Offset of the `TALL1` field.
7365    pub const TALL1_SHIFT: u32 = 12;
7366    /// Offset of the `TSEI` field.
7367    pub const TSEI_SHIFT: u32 = 13;
7368    /// Offset of the `TDIR` field.
7369    pub const TDIR_SHIFT: u32 = 14;
7370    /// Offset of the `DVIM` field.
7371    pub const DVIM_SHIFT: u32 = 15;
7372    /// Offset of the `EOIcount` field.
7373    pub const EOICOUNT_SHIFT: u32 = 27;
7374    /// Mask for the `EOIcount` field.
7375    pub const EOICOUNT_MASK: u64 = 0b11111;
7376
7377    /// Returns the value of the `EOIcount` field.
7378    pub const fn eoicount(self) -> u8 {
7379        ((self.bits() >> Self::EOICOUNT_SHIFT) & 0b11111) as u8
7380    }
7381
7382    /// Sets the value of the `EOIcount` field.
7383    pub const fn set_eoicount(&mut self, value: u8) {
7384        let offset = Self::EOICOUNT_SHIFT;
7385        assert!(value & (Self::EOICOUNT_MASK as u8) == value);
7386        *self = Self::from_bits_retain(
7387            (self.bits() & !(Self::EOICOUNT_MASK << offset)) | ((value as u64) << offset),
7388        );
7389    }
7390}
7391
7392#[cfg(feature = "el2")]
7393bitflags! {
7394    /// `ICH_VMCR_EL2` system register value.
7395    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7396    #[repr(transparent)]
7397    pub struct IchVmcrEl2: u64 {
7398        /// `EN` bit.
7399        const EN = 1 << 0;
7400        /// `VENG0` bit.
7401        const VENG0 = 1 << 0;
7402        /// `VENG1` bit.
7403        const VENG1 = 1 << 1;
7404        /// `VAckCtl` bit.
7405        const VACKCTL = 1 << 2;
7406        /// `VFIQEn` bit.
7407        const VFIQEN = 1 << 3;
7408        /// `VCBPR` bit.
7409        const VCBPR = 1 << 4;
7410        /// `VEOIM` bit.
7411        const VEOIM = 1 << 9;
7412    }
7413}
7414
7415#[cfg(feature = "el2")]
7416impl IchVmcrEl2 {
7417    /// Offset of the `EN` field.
7418    pub const EN_SHIFT: u32 = 0;
7419    /// Offset of the `VENG0` field.
7420    pub const VENG0_SHIFT: u32 = 0;
7421    /// Offset of the `VENG1` field.
7422    pub const VENG1_SHIFT: u32 = 1;
7423    /// Offset of the `VAckCtl` field.
7424    pub const VACKCTL_SHIFT: u32 = 2;
7425    /// Offset of the `VFIQEn` field.
7426    pub const VFIQEN_SHIFT: u32 = 3;
7427    /// Offset of the `VCBPR` field.
7428    pub const VCBPR_SHIFT: u32 = 4;
7429    /// Offset of the `VEOIM` field.
7430    pub const VEOIM_SHIFT: u32 = 9;
7431    /// Offset of the `VBPR1` field.
7432    pub const VBPR1_SHIFT: u32 = 18;
7433    /// Mask for the `VBPR1` field.
7434    pub const VBPR1_MASK: u64 = 0b111;
7435    /// Offset of the `VBPR0` field.
7436    pub const VBPR0_SHIFT: u32 = 21;
7437    /// Mask for the `VBPR0` field.
7438    pub const VBPR0_MASK: u64 = 0b111;
7439
7440    /// Returns the value of the `VBPR1` field.
7441    pub const fn vbpr1(self) -> u8 {
7442        ((self.bits() >> Self::VBPR1_SHIFT) & 0b111) as u8
7443    }
7444
7445    /// Sets the value of the `VBPR1` field.
7446    pub const fn set_vbpr1(&mut self, value: u8) {
7447        let offset = Self::VBPR1_SHIFT;
7448        assert!(value & (Self::VBPR1_MASK as u8) == value);
7449        *self = Self::from_bits_retain(
7450            (self.bits() & !(Self::VBPR1_MASK << offset)) | ((value as u64) << offset),
7451        );
7452    }
7453
7454    /// Returns the value of the `VBPR0` field.
7455    pub const fn vbpr0(self) -> u8 {
7456        ((self.bits() >> Self::VBPR0_SHIFT) & 0b111) as u8
7457    }
7458
7459    /// Sets the value of the `VBPR0` field.
7460    pub const fn set_vbpr0(&mut self, value: u8) {
7461        let offset = Self::VBPR0_SHIFT;
7462        assert!(value & (Self::VBPR0_MASK as u8) == value);
7463        *self = Self::from_bits_retain(
7464            (self.bits() & !(Self::VBPR0_MASK << offset)) | ((value as u64) << offset),
7465        );
7466    }
7467}
7468
7469#[cfg(feature = "el1")]
7470bitflags! {
7471    /// `ID_AA64DFR0_EL1` system register value.
7472    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7473    #[repr(transparent)]
7474    pub struct IdAa64dfr0El1: u64 {
7475    }
7476}
7477
7478#[cfg(feature = "el1")]
7479impl IdAa64dfr0El1 {
7480    /// Offset of the `DebugVer` field.
7481    pub const DEBUGVER_SHIFT: u32 = 0;
7482    /// Mask for the `DebugVer` field.
7483    pub const DEBUGVER_MASK: u64 = 0b1111;
7484    /// Offset of the `TraceVer` field.
7485    pub const TRACEVER_SHIFT: u32 = 4;
7486    /// Mask for the `TraceVer` field.
7487    pub const TRACEVER_MASK: u64 = 0b1111;
7488    /// Offset of the `PMUVer` field.
7489    pub const PMUVER_SHIFT: u32 = 8;
7490    /// Mask for the `PMUVer` field.
7491    pub const PMUVER_MASK: u64 = 0b1111;
7492    /// Offset of the `BRPs` field.
7493    pub const BRPS_SHIFT: u32 = 12;
7494    /// Mask for the `BRPs` field.
7495    pub const BRPS_MASK: u64 = 0b1111;
7496    /// Offset of the `PMSS` field.
7497    pub const PMSS_SHIFT: u32 = 16;
7498    /// Mask for the `PMSS` field.
7499    pub const PMSS_MASK: u64 = 0b1111;
7500    /// Offset of the `WRPs` field.
7501    pub const WRPS_SHIFT: u32 = 20;
7502    /// Mask for the `WRPs` field.
7503    pub const WRPS_MASK: u64 = 0b1111;
7504    /// Offset of the `SEBEP` field.
7505    pub const SEBEP_SHIFT: u32 = 24;
7506    /// Mask for the `SEBEP` field.
7507    pub const SEBEP_MASK: u64 = 0b1111;
7508    /// Offset of the `CTX_CMPs` field.
7509    pub const CTX_CMPS_SHIFT: u32 = 28;
7510    /// Mask for the `CTX_CMPs` field.
7511    pub const CTX_CMPS_MASK: u64 = 0b1111;
7512    /// Offset of the `PMSVer` field.
7513    pub const PMSVER_SHIFT: u32 = 32;
7514    /// Mask for the `PMSVer` field.
7515    pub const PMSVER_MASK: u64 = 0b1111;
7516    /// Offset of the `DoubleLock` field.
7517    pub const DOUBLELOCK_SHIFT: u32 = 36;
7518    /// Mask for the `DoubleLock` field.
7519    pub const DOUBLELOCK_MASK: u64 = 0b1111;
7520    /// Offset of the `TraceFilt` field.
7521    pub const TRACEFILT_SHIFT: u32 = 40;
7522    /// Mask for the `TraceFilt` field.
7523    pub const TRACEFILT_MASK: u64 = 0b1111;
7524    /// Offset of the `TraceBuffer` field.
7525    pub const TRACEBUFFER_SHIFT: u32 = 44;
7526    /// Mask for the `TraceBuffer` field.
7527    pub const TRACEBUFFER_MASK: u64 = 0b1111;
7528    /// Offset of the `MTPMU` field.
7529    pub const MTPMU_SHIFT: u32 = 48;
7530    /// Mask for the `MTPMU` field.
7531    pub const MTPMU_MASK: u64 = 0b1111;
7532    /// Offset of the `BRBE` field.
7533    pub const BRBE_SHIFT: u32 = 52;
7534    /// Mask for the `BRBE` field.
7535    pub const BRBE_MASK: u64 = 0b1111;
7536    /// Offset of the `ExtTrcBuff` field.
7537    pub const EXTTRCBUFF_SHIFT: u32 = 56;
7538    /// Mask for the `ExtTrcBuff` field.
7539    pub const EXTTRCBUFF_MASK: u64 = 0b1111;
7540    /// Offset of the `HPMN0` field.
7541    pub const HPMN0_SHIFT: u32 = 60;
7542    /// Mask for the `HPMN0` field.
7543    pub const HPMN0_MASK: u64 = 0b1111;
7544
7545    /// Returns the value of the `DebugVer` field.
7546    pub const fn debugver(self) -> u8 {
7547        ((self.bits() >> Self::DEBUGVER_SHIFT) & 0b1111) as u8
7548    }
7549
7550    /// Sets the value of the `DebugVer` field.
7551    pub const fn set_debugver(&mut self, value: u8) {
7552        let offset = Self::DEBUGVER_SHIFT;
7553        assert!(value & (Self::DEBUGVER_MASK as u8) == value);
7554        *self = Self::from_bits_retain(
7555            (self.bits() & !(Self::DEBUGVER_MASK << offset)) | ((value as u64) << offset),
7556        );
7557    }
7558
7559    /// Returns the value of the `TraceVer` field.
7560    pub const fn tracever(self) -> u8 {
7561        ((self.bits() >> Self::TRACEVER_SHIFT) & 0b1111) as u8
7562    }
7563
7564    /// Sets the value of the `TraceVer` field.
7565    pub const fn set_tracever(&mut self, value: u8) {
7566        let offset = Self::TRACEVER_SHIFT;
7567        assert!(value & (Self::TRACEVER_MASK as u8) == value);
7568        *self = Self::from_bits_retain(
7569            (self.bits() & !(Self::TRACEVER_MASK << offset)) | ((value as u64) << offset),
7570        );
7571    }
7572
7573    /// Returns the value of the `PMUVer` field.
7574    pub const fn pmuver(self) -> u8 {
7575        ((self.bits() >> Self::PMUVER_SHIFT) & 0b1111) as u8
7576    }
7577
7578    /// Sets the value of the `PMUVer` field.
7579    pub const fn set_pmuver(&mut self, value: u8) {
7580        let offset = Self::PMUVER_SHIFT;
7581        assert!(value & (Self::PMUVER_MASK as u8) == value);
7582        *self = Self::from_bits_retain(
7583            (self.bits() & !(Self::PMUVER_MASK << offset)) | ((value as u64) << offset),
7584        );
7585    }
7586
7587    /// Returns the value of the `BRPs` field.
7588    pub const fn brps(self) -> u8 {
7589        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
7590    }
7591
7592    /// Sets the value of the `BRPs` field.
7593    pub const fn set_brps(&mut self, value: u8) {
7594        let offset = Self::BRPS_SHIFT;
7595        assert!(value & (Self::BRPS_MASK as u8) == value);
7596        *self = Self::from_bits_retain(
7597            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u64) << offset),
7598        );
7599    }
7600
7601    /// Returns the value of the `PMSS` field.
7602    pub const fn pmss(self) -> u8 {
7603        ((self.bits() >> Self::PMSS_SHIFT) & 0b1111) as u8
7604    }
7605
7606    /// Sets the value of the `PMSS` field.
7607    pub const fn set_pmss(&mut self, value: u8) {
7608        let offset = Self::PMSS_SHIFT;
7609        assert!(value & (Self::PMSS_MASK as u8) == value);
7610        *self = Self::from_bits_retain(
7611            (self.bits() & !(Self::PMSS_MASK << offset)) | ((value as u64) << offset),
7612        );
7613    }
7614
7615    /// Returns the value of the `WRPs` field.
7616    pub const fn wrps(self) -> u8 {
7617        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
7618    }
7619
7620    /// Sets the value of the `WRPs` field.
7621    pub const fn set_wrps(&mut self, value: u8) {
7622        let offset = Self::WRPS_SHIFT;
7623        assert!(value & (Self::WRPS_MASK as u8) == value);
7624        *self = Self::from_bits_retain(
7625            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u64) << offset),
7626        );
7627    }
7628
7629    /// Returns the value of the `SEBEP` field.
7630    pub const fn sebep(self) -> u8 {
7631        ((self.bits() >> Self::SEBEP_SHIFT) & 0b1111) as u8
7632    }
7633
7634    /// Sets the value of the `SEBEP` field.
7635    pub const fn set_sebep(&mut self, value: u8) {
7636        let offset = Self::SEBEP_SHIFT;
7637        assert!(value & (Self::SEBEP_MASK as u8) == value);
7638        *self = Self::from_bits_retain(
7639            (self.bits() & !(Self::SEBEP_MASK << offset)) | ((value as u64) << offset),
7640        );
7641    }
7642
7643    /// Returns the value of the `CTX_CMPs` field.
7644    pub const fn ctx_cmps(self) -> u8 {
7645        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
7646    }
7647
7648    /// Sets the value of the `CTX_CMPs` field.
7649    pub const fn set_ctx_cmps(&mut self, value: u8) {
7650        let offset = Self::CTX_CMPS_SHIFT;
7651        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
7652        *self = Self::from_bits_retain(
7653            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u64) << offset),
7654        );
7655    }
7656
7657    /// Returns the value of the `PMSVer` field.
7658    pub const fn pmsver(self) -> u8 {
7659        ((self.bits() >> Self::PMSVER_SHIFT) & 0b1111) as u8
7660    }
7661
7662    /// Sets the value of the `PMSVer` field.
7663    pub const fn set_pmsver(&mut self, value: u8) {
7664        let offset = Self::PMSVER_SHIFT;
7665        assert!(value & (Self::PMSVER_MASK as u8) == value);
7666        *self = Self::from_bits_retain(
7667            (self.bits() & !(Self::PMSVER_MASK << offset)) | ((value as u64) << offset),
7668        );
7669    }
7670
7671    /// Returns the value of the `DoubleLock` field.
7672    pub const fn doublelock(self) -> u8 {
7673        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
7674    }
7675
7676    /// Sets the value of the `DoubleLock` field.
7677    pub const fn set_doublelock(&mut self, value: u8) {
7678        let offset = Self::DOUBLELOCK_SHIFT;
7679        assert!(value & (Self::DOUBLELOCK_MASK as u8) == value);
7680        *self = Self::from_bits_retain(
7681            (self.bits() & !(Self::DOUBLELOCK_MASK << offset)) | ((value as u64) << offset),
7682        );
7683    }
7684
7685    /// Returns the value of the `TraceFilt` field.
7686    pub const fn tracefilt(self) -> u8 {
7687        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
7688    }
7689
7690    /// Sets the value of the `TraceFilt` field.
7691    pub const fn set_tracefilt(&mut self, value: u8) {
7692        let offset = Self::TRACEFILT_SHIFT;
7693        assert!(value & (Self::TRACEFILT_MASK as u8) == value);
7694        *self = Self::from_bits_retain(
7695            (self.bits() & !(Self::TRACEFILT_MASK << offset)) | ((value as u64) << offset),
7696        );
7697    }
7698
7699    /// Returns the value of the `TraceBuffer` field.
7700    pub const fn tracebuffer(self) -> u8 {
7701        ((self.bits() >> Self::TRACEBUFFER_SHIFT) & 0b1111) as u8
7702    }
7703
7704    /// Sets the value of the `TraceBuffer` field.
7705    pub const fn set_tracebuffer(&mut self, value: u8) {
7706        let offset = Self::TRACEBUFFER_SHIFT;
7707        assert!(value & (Self::TRACEBUFFER_MASK as u8) == value);
7708        *self = Self::from_bits_retain(
7709            (self.bits() & !(Self::TRACEBUFFER_MASK << offset)) | ((value as u64) << offset),
7710        );
7711    }
7712
7713    /// Returns the value of the `MTPMU` field.
7714    pub const fn mtpmu(self) -> u8 {
7715        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
7716    }
7717
7718    /// Sets the value of the `MTPMU` field.
7719    pub const fn set_mtpmu(&mut self, value: u8) {
7720        let offset = Self::MTPMU_SHIFT;
7721        assert!(value & (Self::MTPMU_MASK as u8) == value);
7722        *self = Self::from_bits_retain(
7723            (self.bits() & !(Self::MTPMU_MASK << offset)) | ((value as u64) << offset),
7724        );
7725    }
7726
7727    /// Returns the value of the `BRBE` field.
7728    pub const fn brbe(self) -> u8 {
7729        ((self.bits() >> Self::BRBE_SHIFT) & 0b1111) as u8
7730    }
7731
7732    /// Sets the value of the `BRBE` field.
7733    pub const fn set_brbe(&mut self, value: u8) {
7734        let offset = Self::BRBE_SHIFT;
7735        assert!(value & (Self::BRBE_MASK as u8) == value);
7736        *self = Self::from_bits_retain(
7737            (self.bits() & !(Self::BRBE_MASK << offset)) | ((value as u64) << offset),
7738        );
7739    }
7740
7741    /// Returns the value of the `ExtTrcBuff` field.
7742    pub const fn exttrcbuff(self) -> u8 {
7743        ((self.bits() >> Self::EXTTRCBUFF_SHIFT) & 0b1111) as u8
7744    }
7745
7746    /// Sets the value of the `ExtTrcBuff` field.
7747    pub const fn set_exttrcbuff(&mut self, value: u8) {
7748        let offset = Self::EXTTRCBUFF_SHIFT;
7749        assert!(value & (Self::EXTTRCBUFF_MASK as u8) == value);
7750        *self = Self::from_bits_retain(
7751            (self.bits() & !(Self::EXTTRCBUFF_MASK << offset)) | ((value as u64) << offset),
7752        );
7753    }
7754
7755    /// Returns the value of the `HPMN0` field.
7756    pub const fn hpmn0(self) -> u8 {
7757        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
7758    }
7759
7760    /// Sets the value of the `HPMN0` field.
7761    pub const fn set_hpmn0(&mut self, value: u8) {
7762        let offset = Self::HPMN0_SHIFT;
7763        assert!(value & (Self::HPMN0_MASK as u8) == value);
7764        *self = Self::from_bits_retain(
7765            (self.bits() & !(Self::HPMN0_MASK << offset)) | ((value as u64) << offset),
7766        );
7767    }
7768}
7769
7770#[cfg(feature = "el1")]
7771bitflags! {
7772    /// `ID_AA64DFR1_EL1` system register value.
7773    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7774    #[repr(transparent)]
7775    pub struct IdAa64dfr1El1: u64 {
7776    }
7777}
7778
7779#[cfg(feature = "el1")]
7780impl IdAa64dfr1El1 {
7781    /// Offset of the `SYSPMUID` field.
7782    pub const SYSPMUID_SHIFT: u32 = 0;
7783    /// Mask for the `SYSPMUID` field.
7784    pub const SYSPMUID_MASK: u64 = 0b11111111;
7785    /// Offset of the `BRPs` field.
7786    pub const BRPS_SHIFT: u32 = 8;
7787    /// Mask for the `BRPs` field.
7788    pub const BRPS_MASK: u64 = 0b11111111;
7789    /// Offset of the `WRPs` field.
7790    pub const WRPS_SHIFT: u32 = 16;
7791    /// Mask for the `WRPs` field.
7792    pub const WRPS_MASK: u64 = 0b11111111;
7793    /// Offset of the `CTX_CMPs` field.
7794    pub const CTX_CMPS_SHIFT: u32 = 24;
7795    /// Mask for the `CTX_CMPs` field.
7796    pub const CTX_CMPS_MASK: u64 = 0b11111111;
7797    /// Offset of the `SPMU` field.
7798    pub const SPMU_SHIFT: u32 = 32;
7799    /// Mask for the `SPMU` field.
7800    pub const SPMU_MASK: u64 = 0b1111;
7801    /// Offset of the `PMICNTR` field.
7802    pub const PMICNTR_SHIFT: u32 = 36;
7803    /// Mask for the `PMICNTR` field.
7804    pub const PMICNTR_MASK: u64 = 0b1111;
7805    /// Offset of the `ABLE` field.
7806    pub const ABLE_SHIFT: u32 = 40;
7807    /// Mask for the `ABLE` field.
7808    pub const ABLE_MASK: u64 = 0b1111;
7809    /// Offset of the `ITE` field.
7810    pub const ITE_SHIFT: u32 = 44;
7811    /// Mask for the `ITE` field.
7812    pub const ITE_MASK: u64 = 0b1111;
7813    /// Offset of the `EBEP` field.
7814    pub const EBEP_SHIFT: u32 = 48;
7815    /// Mask for the `EBEP` field.
7816    pub const EBEP_MASK: u64 = 0b1111;
7817    /// Offset of the `DPFZS` field.
7818    pub const DPFZS_SHIFT: u32 = 52;
7819    /// Mask for the `DPFZS` field.
7820    pub const DPFZS_MASK: u64 = 0b1111;
7821    /// Offset of the `ABL_CMPs` field.
7822    pub const ABL_CMPS_SHIFT: u32 = 56;
7823    /// Mask for the `ABL_CMPs` field.
7824    pub const ABL_CMPS_MASK: u64 = 0b11111111;
7825
7826    /// Returns the value of the `SYSPMUID` field.
7827    pub const fn syspmuid(self) -> u8 {
7828        ((self.bits() >> Self::SYSPMUID_SHIFT) & 0b11111111) as u8
7829    }
7830
7831    /// Sets the value of the `SYSPMUID` field.
7832    pub const fn set_syspmuid(&mut self, value: u8) {
7833        let offset = Self::SYSPMUID_SHIFT;
7834        assert!(value & (Self::SYSPMUID_MASK as u8) == value);
7835        *self = Self::from_bits_retain(
7836            (self.bits() & !(Self::SYSPMUID_MASK << offset)) | ((value as u64) << offset),
7837        );
7838    }
7839
7840    /// Returns the value of the `BRPs` field.
7841    pub const fn brps(self) -> u8 {
7842        ((self.bits() >> Self::BRPS_SHIFT) & 0b11111111) as u8
7843    }
7844
7845    /// Sets the value of the `BRPs` field.
7846    pub const fn set_brps(&mut self, value: u8) {
7847        let offset = Self::BRPS_SHIFT;
7848        assert!(value & (Self::BRPS_MASK as u8) == value);
7849        *self = Self::from_bits_retain(
7850            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u64) << offset),
7851        );
7852    }
7853
7854    /// Returns the value of the `WRPs` field.
7855    pub const fn wrps(self) -> u8 {
7856        ((self.bits() >> Self::WRPS_SHIFT) & 0b11111111) as u8
7857    }
7858
7859    /// Sets the value of the `WRPs` field.
7860    pub const fn set_wrps(&mut self, value: u8) {
7861        let offset = Self::WRPS_SHIFT;
7862        assert!(value & (Self::WRPS_MASK as u8) == value);
7863        *self = Self::from_bits_retain(
7864            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u64) << offset),
7865        );
7866    }
7867
7868    /// Returns the value of the `CTX_CMPs` field.
7869    pub const fn ctx_cmps(self) -> u8 {
7870        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b11111111) as u8
7871    }
7872
7873    /// Sets the value of the `CTX_CMPs` field.
7874    pub const fn set_ctx_cmps(&mut self, value: u8) {
7875        let offset = Self::CTX_CMPS_SHIFT;
7876        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
7877        *self = Self::from_bits_retain(
7878            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u64) << offset),
7879        );
7880    }
7881
7882    /// Returns the value of the `SPMU` field.
7883    pub const fn spmu(self) -> u8 {
7884        ((self.bits() >> Self::SPMU_SHIFT) & 0b1111) as u8
7885    }
7886
7887    /// Sets the value of the `SPMU` field.
7888    pub const fn set_spmu(&mut self, value: u8) {
7889        let offset = Self::SPMU_SHIFT;
7890        assert!(value & (Self::SPMU_MASK as u8) == value);
7891        *self = Self::from_bits_retain(
7892            (self.bits() & !(Self::SPMU_MASK << offset)) | ((value as u64) << offset),
7893        );
7894    }
7895
7896    /// Returns the value of the `PMICNTR` field.
7897    pub const fn pmicntr(self) -> u8 {
7898        ((self.bits() >> Self::PMICNTR_SHIFT) & 0b1111) as u8
7899    }
7900
7901    /// Sets the value of the `PMICNTR` field.
7902    pub const fn set_pmicntr(&mut self, value: u8) {
7903        let offset = Self::PMICNTR_SHIFT;
7904        assert!(value & (Self::PMICNTR_MASK as u8) == value);
7905        *self = Self::from_bits_retain(
7906            (self.bits() & !(Self::PMICNTR_MASK << offset)) | ((value as u64) << offset),
7907        );
7908    }
7909
7910    /// Returns the value of the `ABLE` field.
7911    pub const fn able(self) -> u8 {
7912        ((self.bits() >> Self::ABLE_SHIFT) & 0b1111) as u8
7913    }
7914
7915    /// Sets the value of the `ABLE` field.
7916    pub const fn set_able(&mut self, value: u8) {
7917        let offset = Self::ABLE_SHIFT;
7918        assert!(value & (Self::ABLE_MASK as u8) == value);
7919        *self = Self::from_bits_retain(
7920            (self.bits() & !(Self::ABLE_MASK << offset)) | ((value as u64) << offset),
7921        );
7922    }
7923
7924    /// Returns the value of the `ITE` field.
7925    pub const fn ite(self) -> u8 {
7926        ((self.bits() >> Self::ITE_SHIFT) & 0b1111) as u8
7927    }
7928
7929    /// Sets the value of the `ITE` field.
7930    pub const fn set_ite(&mut self, value: u8) {
7931        let offset = Self::ITE_SHIFT;
7932        assert!(value & (Self::ITE_MASK as u8) == value);
7933        *self = Self::from_bits_retain(
7934            (self.bits() & !(Self::ITE_MASK << offset)) | ((value as u64) << offset),
7935        );
7936    }
7937
7938    /// Returns the value of the `EBEP` field.
7939    pub const fn ebep(self) -> u8 {
7940        ((self.bits() >> Self::EBEP_SHIFT) & 0b1111) as u8
7941    }
7942
7943    /// Sets the value of the `EBEP` field.
7944    pub const fn set_ebep(&mut self, value: u8) {
7945        let offset = Self::EBEP_SHIFT;
7946        assert!(value & (Self::EBEP_MASK as u8) == value);
7947        *self = Self::from_bits_retain(
7948            (self.bits() & !(Self::EBEP_MASK << offset)) | ((value as u64) << offset),
7949        );
7950    }
7951
7952    /// Returns the value of the `DPFZS` field.
7953    pub const fn dpfzs(self) -> u8 {
7954        ((self.bits() >> Self::DPFZS_SHIFT) & 0b1111) as u8
7955    }
7956
7957    /// Sets the value of the `DPFZS` field.
7958    pub const fn set_dpfzs(&mut self, value: u8) {
7959        let offset = Self::DPFZS_SHIFT;
7960        assert!(value & (Self::DPFZS_MASK as u8) == value);
7961        *self = Self::from_bits_retain(
7962            (self.bits() & !(Self::DPFZS_MASK << offset)) | ((value as u64) << offset),
7963        );
7964    }
7965
7966    /// Returns the value of the `ABL_CMPs` field.
7967    pub const fn abl_cmps(self) -> u8 {
7968        ((self.bits() >> Self::ABL_CMPS_SHIFT) & 0b11111111) as u8
7969    }
7970
7971    /// Sets the value of the `ABL_CMPs` field.
7972    pub const fn set_abl_cmps(&mut self, value: u8) {
7973        let offset = Self::ABL_CMPS_SHIFT;
7974        assert!(value & (Self::ABL_CMPS_MASK as u8) == value);
7975        *self = Self::from_bits_retain(
7976            (self.bits() & !(Self::ABL_CMPS_MASK << offset)) | ((value as u64) << offset),
7977        );
7978    }
7979}
7980
7981#[cfg(feature = "el1")]
7982bitflags! {
7983    /// `ID_AA64ISAR1_EL1` system register value.
7984    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7985    #[repr(transparent)]
7986    pub struct IdAa64isar1El1: u64 {
7987    }
7988}
7989
7990#[cfg(feature = "el1")]
7991impl IdAa64isar1El1 {
7992    /// Offset of the `DPB` field.
7993    pub const DPB_SHIFT: u32 = 0;
7994    /// Mask for the `DPB` field.
7995    pub const DPB_MASK: u64 = 0b1111;
7996    /// Offset of the `APA` field.
7997    pub const APA_SHIFT: u32 = 4;
7998    /// Mask for the `APA` field.
7999    pub const APA_MASK: u64 = 0b1111;
8000    /// Offset of the `API` field.
8001    pub const API_SHIFT: u32 = 8;
8002    /// Mask for the `API` field.
8003    pub const API_MASK: u64 = 0b1111;
8004    /// Offset of the `JSCVT` field.
8005    pub const JSCVT_SHIFT: u32 = 12;
8006    /// Mask for the `JSCVT` field.
8007    pub const JSCVT_MASK: u64 = 0b1111;
8008    /// Offset of the `FCMA` field.
8009    pub const FCMA_SHIFT: u32 = 16;
8010    /// Mask for the `FCMA` field.
8011    pub const FCMA_MASK: u64 = 0b1111;
8012    /// Offset of the `LRCPC` field.
8013    pub const LRCPC_SHIFT: u32 = 20;
8014    /// Mask for the `LRCPC` field.
8015    pub const LRCPC_MASK: u64 = 0b1111;
8016    /// Offset of the `GPA` field.
8017    pub const GPA_SHIFT: u32 = 24;
8018    /// Mask for the `GPA` field.
8019    pub const GPA_MASK: u64 = 0b1111;
8020    /// Offset of the `GPI` field.
8021    pub const GPI_SHIFT: u32 = 28;
8022    /// Mask for the `GPI` field.
8023    pub const GPI_MASK: u64 = 0b1111;
8024    /// Offset of the `FRINTTS` field.
8025    pub const FRINTTS_SHIFT: u32 = 32;
8026    /// Mask for the `FRINTTS` field.
8027    pub const FRINTTS_MASK: u64 = 0b1111;
8028    /// Offset of the `SB` field.
8029    pub const SB_SHIFT: u32 = 36;
8030    /// Mask for the `SB` field.
8031    pub const SB_MASK: u64 = 0b1111;
8032    /// Offset of the `SPECRES` field.
8033    pub const SPECRES_SHIFT: u32 = 40;
8034    /// Mask for the `SPECRES` field.
8035    pub const SPECRES_MASK: u64 = 0b1111;
8036    /// Offset of the `BF16` field.
8037    pub const BF16_SHIFT: u32 = 44;
8038    /// Mask for the `BF16` field.
8039    pub const BF16_MASK: u64 = 0b1111;
8040    /// Offset of the `DGH` field.
8041    pub const DGH_SHIFT: u32 = 48;
8042    /// Mask for the `DGH` field.
8043    pub const DGH_MASK: u64 = 0b1111;
8044    /// Offset of the `I8MM` field.
8045    pub const I8MM_SHIFT: u32 = 52;
8046    /// Mask for the `I8MM` field.
8047    pub const I8MM_MASK: u64 = 0b1111;
8048    /// Offset of the `XS` field.
8049    pub const XS_SHIFT: u32 = 56;
8050    /// Mask for the `XS` field.
8051    pub const XS_MASK: u64 = 0b1111;
8052    /// Offset of the `LS64` field.
8053    pub const LS64_SHIFT: u32 = 60;
8054    /// Mask for the `LS64` field.
8055    pub const LS64_MASK: u64 = 0b1111;
8056
8057    /// Returns the value of the `DPB` field.
8058    pub const fn dpb(self) -> u8 {
8059        ((self.bits() >> Self::DPB_SHIFT) & 0b1111) as u8
8060    }
8061
8062    /// Sets the value of the `DPB` field.
8063    pub const fn set_dpb(&mut self, value: u8) {
8064        let offset = Self::DPB_SHIFT;
8065        assert!(value & (Self::DPB_MASK as u8) == value);
8066        *self = Self::from_bits_retain(
8067            (self.bits() & !(Self::DPB_MASK << offset)) | ((value as u64) << offset),
8068        );
8069    }
8070
8071    /// Returns the value of the `APA` field.
8072    pub const fn apa(self) -> u8 {
8073        ((self.bits() >> Self::APA_SHIFT) & 0b1111) as u8
8074    }
8075
8076    /// Sets the value of the `APA` field.
8077    pub const fn set_apa(&mut self, value: u8) {
8078        let offset = Self::APA_SHIFT;
8079        assert!(value & (Self::APA_MASK as u8) == value);
8080        *self = Self::from_bits_retain(
8081            (self.bits() & !(Self::APA_MASK << offset)) | ((value as u64) << offset),
8082        );
8083    }
8084
8085    /// Returns the value of the `API` field.
8086    pub const fn api(self) -> u8 {
8087        ((self.bits() >> Self::API_SHIFT) & 0b1111) as u8
8088    }
8089
8090    /// Sets the value of the `API` field.
8091    pub const fn set_api(&mut self, value: u8) {
8092        let offset = Self::API_SHIFT;
8093        assert!(value & (Self::API_MASK as u8) == value);
8094        *self = Self::from_bits_retain(
8095            (self.bits() & !(Self::API_MASK << offset)) | ((value as u64) << offset),
8096        );
8097    }
8098
8099    /// Returns the value of the `JSCVT` field.
8100    pub const fn jscvt(self) -> u8 {
8101        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
8102    }
8103
8104    /// Sets the value of the `JSCVT` field.
8105    pub const fn set_jscvt(&mut self, value: u8) {
8106        let offset = Self::JSCVT_SHIFT;
8107        assert!(value & (Self::JSCVT_MASK as u8) == value);
8108        *self = Self::from_bits_retain(
8109            (self.bits() & !(Self::JSCVT_MASK << offset)) | ((value as u64) << offset),
8110        );
8111    }
8112
8113    /// Returns the value of the `FCMA` field.
8114    pub const fn fcma(self) -> u8 {
8115        ((self.bits() >> Self::FCMA_SHIFT) & 0b1111) as u8
8116    }
8117
8118    /// Sets the value of the `FCMA` field.
8119    pub const fn set_fcma(&mut self, value: u8) {
8120        let offset = Self::FCMA_SHIFT;
8121        assert!(value & (Self::FCMA_MASK as u8) == value);
8122        *self = Self::from_bits_retain(
8123            (self.bits() & !(Self::FCMA_MASK << offset)) | ((value as u64) << offset),
8124        );
8125    }
8126
8127    /// Returns the value of the `LRCPC` field.
8128    pub const fn lrcpc(self) -> u8 {
8129        ((self.bits() >> Self::LRCPC_SHIFT) & 0b1111) as u8
8130    }
8131
8132    /// Sets the value of the `LRCPC` field.
8133    pub const fn set_lrcpc(&mut self, value: u8) {
8134        let offset = Self::LRCPC_SHIFT;
8135        assert!(value & (Self::LRCPC_MASK as u8) == value);
8136        *self = Self::from_bits_retain(
8137            (self.bits() & !(Self::LRCPC_MASK << offset)) | ((value as u64) << offset),
8138        );
8139    }
8140
8141    /// Returns the value of the `GPA` field.
8142    pub const fn gpa(self) -> u8 {
8143        ((self.bits() >> Self::GPA_SHIFT) & 0b1111) as u8
8144    }
8145
8146    /// Sets the value of the `GPA` field.
8147    pub const fn set_gpa(&mut self, value: u8) {
8148        let offset = Self::GPA_SHIFT;
8149        assert!(value & (Self::GPA_MASK as u8) == value);
8150        *self = Self::from_bits_retain(
8151            (self.bits() & !(Self::GPA_MASK << offset)) | ((value as u64) << offset),
8152        );
8153    }
8154
8155    /// Returns the value of the `GPI` field.
8156    pub const fn gpi(self) -> u8 {
8157        ((self.bits() >> Self::GPI_SHIFT) & 0b1111) as u8
8158    }
8159
8160    /// Sets the value of the `GPI` field.
8161    pub const fn set_gpi(&mut self, value: u8) {
8162        let offset = Self::GPI_SHIFT;
8163        assert!(value & (Self::GPI_MASK as u8) == value);
8164        *self = Self::from_bits_retain(
8165            (self.bits() & !(Self::GPI_MASK << offset)) | ((value as u64) << offset),
8166        );
8167    }
8168
8169    /// Returns the value of the `FRINTTS` field.
8170    pub const fn frintts(self) -> u8 {
8171        ((self.bits() >> Self::FRINTTS_SHIFT) & 0b1111) as u8
8172    }
8173
8174    /// Sets the value of the `FRINTTS` field.
8175    pub const fn set_frintts(&mut self, value: u8) {
8176        let offset = Self::FRINTTS_SHIFT;
8177        assert!(value & (Self::FRINTTS_MASK as u8) == value);
8178        *self = Self::from_bits_retain(
8179            (self.bits() & !(Self::FRINTTS_MASK << offset)) | ((value as u64) << offset),
8180        );
8181    }
8182
8183    /// Returns the value of the `SB` field.
8184    pub const fn sb(self) -> u8 {
8185        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
8186    }
8187
8188    /// Sets the value of the `SB` field.
8189    pub const fn set_sb(&mut self, value: u8) {
8190        let offset = Self::SB_SHIFT;
8191        assert!(value & (Self::SB_MASK as u8) == value);
8192        *self = Self::from_bits_retain(
8193            (self.bits() & !(Self::SB_MASK << offset)) | ((value as u64) << offset),
8194        );
8195    }
8196
8197    /// Returns the value of the `SPECRES` field.
8198    pub const fn specres(self) -> u8 {
8199        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
8200    }
8201
8202    /// Sets the value of the `SPECRES` field.
8203    pub const fn set_specres(&mut self, value: u8) {
8204        let offset = Self::SPECRES_SHIFT;
8205        assert!(value & (Self::SPECRES_MASK as u8) == value);
8206        *self = Self::from_bits_retain(
8207            (self.bits() & !(Self::SPECRES_MASK << offset)) | ((value as u64) << offset),
8208        );
8209    }
8210
8211    /// Returns the value of the `BF16` field.
8212    pub const fn bf16(self) -> u8 {
8213        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
8214    }
8215
8216    /// Sets the value of the `BF16` field.
8217    pub const fn set_bf16(&mut self, value: u8) {
8218        let offset = Self::BF16_SHIFT;
8219        assert!(value & (Self::BF16_MASK as u8) == value);
8220        *self = Self::from_bits_retain(
8221            (self.bits() & !(Self::BF16_MASK << offset)) | ((value as u64) << offset),
8222        );
8223    }
8224
8225    /// Returns the value of the `DGH` field.
8226    pub const fn dgh(self) -> u8 {
8227        ((self.bits() >> Self::DGH_SHIFT) & 0b1111) as u8
8228    }
8229
8230    /// Sets the value of the `DGH` field.
8231    pub const fn set_dgh(&mut self, value: u8) {
8232        let offset = Self::DGH_SHIFT;
8233        assert!(value & (Self::DGH_MASK as u8) == value);
8234        *self = Self::from_bits_retain(
8235            (self.bits() & !(Self::DGH_MASK << offset)) | ((value as u64) << offset),
8236        );
8237    }
8238
8239    /// Returns the value of the `I8MM` field.
8240    pub const fn i8mm(self) -> u8 {
8241        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
8242    }
8243
8244    /// Sets the value of the `I8MM` field.
8245    pub const fn set_i8mm(&mut self, value: u8) {
8246        let offset = Self::I8MM_SHIFT;
8247        assert!(value & (Self::I8MM_MASK as u8) == value);
8248        *self = Self::from_bits_retain(
8249            (self.bits() & !(Self::I8MM_MASK << offset)) | ((value as u64) << offset),
8250        );
8251    }
8252
8253    /// Returns the value of the `XS` field.
8254    pub const fn xs(self) -> u8 {
8255        ((self.bits() >> Self::XS_SHIFT) & 0b1111) as u8
8256    }
8257
8258    /// Sets the value of the `XS` field.
8259    pub const fn set_xs(&mut self, value: u8) {
8260        let offset = Self::XS_SHIFT;
8261        assert!(value & (Self::XS_MASK as u8) == value);
8262        *self = Self::from_bits_retain(
8263            (self.bits() & !(Self::XS_MASK << offset)) | ((value as u64) << offset),
8264        );
8265    }
8266
8267    /// Returns the value of the `LS64` field.
8268    pub const fn ls64(self) -> u8 {
8269        ((self.bits() >> Self::LS64_SHIFT) & 0b1111) as u8
8270    }
8271
8272    /// Sets the value of the `LS64` field.
8273    pub const fn set_ls64(&mut self, value: u8) {
8274        let offset = Self::LS64_SHIFT;
8275        assert!(value & (Self::LS64_MASK as u8) == value);
8276        *self = Self::from_bits_retain(
8277            (self.bits() & !(Self::LS64_MASK << offset)) | ((value as u64) << offset),
8278        );
8279    }
8280}
8281
8282#[cfg(feature = "el1")]
8283bitflags! {
8284    /// `ID_AA64ISAR2_EL1` system register value.
8285    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8286    #[repr(transparent)]
8287    pub struct IdAa64isar2El1: u64 {
8288    }
8289}
8290
8291#[cfg(feature = "el1")]
8292impl IdAa64isar2El1 {
8293    /// Offset of the `WFxT` field.
8294    pub const WFXT_SHIFT: u32 = 0;
8295    /// Mask for the `WFxT` field.
8296    pub const WFXT_MASK: u64 = 0b1111;
8297    /// Offset of the `RPRES` field.
8298    pub const RPRES_SHIFT: u32 = 4;
8299    /// Mask for the `RPRES` field.
8300    pub const RPRES_MASK: u64 = 0b1111;
8301    /// Offset of the `GPA3` field.
8302    pub const GPA3_SHIFT: u32 = 8;
8303    /// Mask for the `GPA3` field.
8304    pub const GPA3_MASK: u64 = 0b1111;
8305    /// Offset of the `APA3` field.
8306    pub const APA3_SHIFT: u32 = 12;
8307    /// Mask for the `APA3` field.
8308    pub const APA3_MASK: u64 = 0b1111;
8309    /// Offset of the `MOPS` field.
8310    pub const MOPS_SHIFT: u32 = 16;
8311    /// Mask for the `MOPS` field.
8312    pub const MOPS_MASK: u64 = 0b1111;
8313    /// Offset of the `BC` field.
8314    pub const BC_SHIFT: u32 = 20;
8315    /// Mask for the `BC` field.
8316    pub const BC_MASK: u64 = 0b1111;
8317    /// Offset of the `PAC_frac` field.
8318    pub const PAC_FRAC_SHIFT: u32 = 24;
8319    /// Mask for the `PAC_frac` field.
8320    pub const PAC_FRAC_MASK: u64 = 0b1111;
8321    /// Offset of the `CLRBHB` field.
8322    pub const CLRBHB_SHIFT: u32 = 28;
8323    /// Mask for the `CLRBHB` field.
8324    pub const CLRBHB_MASK: u64 = 0b1111;
8325    /// Offset of the `SYSREG_128` field.
8326    pub const SYSREG_128_SHIFT: u32 = 32;
8327    /// Mask for the `SYSREG_128` field.
8328    pub const SYSREG_128_MASK: u64 = 0b1111;
8329    /// Offset of the `SYSINSTR_128` field.
8330    pub const SYSINSTR_128_SHIFT: u32 = 36;
8331    /// Mask for the `SYSINSTR_128` field.
8332    pub const SYSINSTR_128_MASK: u64 = 0b1111;
8333    /// Offset of the `PRFMSLC` field.
8334    pub const PRFMSLC_SHIFT: u32 = 40;
8335    /// Mask for the `PRFMSLC` field.
8336    pub const PRFMSLC_MASK: u64 = 0b1111;
8337    /// Offset of the `PCDPHINT` field.
8338    pub const PCDPHINT_SHIFT: u32 = 44;
8339    /// Mask for the `PCDPHINT` field.
8340    pub const PCDPHINT_MASK: u64 = 0b1111;
8341    /// Offset of the `RPRFM` field.
8342    pub const RPRFM_SHIFT: u32 = 48;
8343    /// Mask for the `RPRFM` field.
8344    pub const RPRFM_MASK: u64 = 0b1111;
8345    /// Offset of the `CSSC` field.
8346    pub const CSSC_SHIFT: u32 = 52;
8347    /// Mask for the `CSSC` field.
8348    pub const CSSC_MASK: u64 = 0b1111;
8349    /// Offset of the `LUT` field.
8350    pub const LUT_SHIFT: u32 = 56;
8351    /// Mask for the `LUT` field.
8352    pub const LUT_MASK: u64 = 0b1111;
8353    /// Offset of the `ATS1A` field.
8354    pub const ATS1A_SHIFT: u32 = 60;
8355    /// Mask for the `ATS1A` field.
8356    pub const ATS1A_MASK: u64 = 0b1111;
8357
8358    /// Returns the value of the `WFxT` field.
8359    pub const fn wfxt(self) -> u8 {
8360        ((self.bits() >> Self::WFXT_SHIFT) & 0b1111) as u8
8361    }
8362
8363    /// Sets the value of the `WFxT` field.
8364    pub const fn set_wfxt(&mut self, value: u8) {
8365        let offset = Self::WFXT_SHIFT;
8366        assert!(value & (Self::WFXT_MASK as u8) == value);
8367        *self = Self::from_bits_retain(
8368            (self.bits() & !(Self::WFXT_MASK << offset)) | ((value as u64) << offset),
8369        );
8370    }
8371
8372    /// Returns the value of the `RPRES` field.
8373    pub const fn rpres(self) -> u8 {
8374        ((self.bits() >> Self::RPRES_SHIFT) & 0b1111) as u8
8375    }
8376
8377    /// Sets the value of the `RPRES` field.
8378    pub const fn set_rpres(&mut self, value: u8) {
8379        let offset = Self::RPRES_SHIFT;
8380        assert!(value & (Self::RPRES_MASK as u8) == value);
8381        *self = Self::from_bits_retain(
8382            (self.bits() & !(Self::RPRES_MASK << offset)) | ((value as u64) << offset),
8383        );
8384    }
8385
8386    /// Returns the value of the `GPA3` field.
8387    pub const fn gpa3(self) -> u8 {
8388        ((self.bits() >> Self::GPA3_SHIFT) & 0b1111) as u8
8389    }
8390
8391    /// Sets the value of the `GPA3` field.
8392    pub const fn set_gpa3(&mut self, value: u8) {
8393        let offset = Self::GPA3_SHIFT;
8394        assert!(value & (Self::GPA3_MASK as u8) == value);
8395        *self = Self::from_bits_retain(
8396            (self.bits() & !(Self::GPA3_MASK << offset)) | ((value as u64) << offset),
8397        );
8398    }
8399
8400    /// Returns the value of the `APA3` field.
8401    pub const fn apa3(self) -> u8 {
8402        ((self.bits() >> Self::APA3_SHIFT) & 0b1111) as u8
8403    }
8404
8405    /// Sets the value of the `APA3` field.
8406    pub const fn set_apa3(&mut self, value: u8) {
8407        let offset = Self::APA3_SHIFT;
8408        assert!(value & (Self::APA3_MASK as u8) == value);
8409        *self = Self::from_bits_retain(
8410            (self.bits() & !(Self::APA3_MASK << offset)) | ((value as u64) << offset),
8411        );
8412    }
8413
8414    /// Returns the value of the `MOPS` field.
8415    pub const fn mops(self) -> u8 {
8416        ((self.bits() >> Self::MOPS_SHIFT) & 0b1111) as u8
8417    }
8418
8419    /// Sets the value of the `MOPS` field.
8420    pub const fn set_mops(&mut self, value: u8) {
8421        let offset = Self::MOPS_SHIFT;
8422        assert!(value & (Self::MOPS_MASK as u8) == value);
8423        *self = Self::from_bits_retain(
8424            (self.bits() & !(Self::MOPS_MASK << offset)) | ((value as u64) << offset),
8425        );
8426    }
8427
8428    /// Returns the value of the `BC` field.
8429    pub const fn bc(self) -> u8 {
8430        ((self.bits() >> Self::BC_SHIFT) & 0b1111) as u8
8431    }
8432
8433    /// Sets the value of the `BC` field.
8434    pub const fn set_bc(&mut self, value: u8) {
8435        let offset = Self::BC_SHIFT;
8436        assert!(value & (Self::BC_MASK as u8) == value);
8437        *self = Self::from_bits_retain(
8438            (self.bits() & !(Self::BC_MASK << offset)) | ((value as u64) << offset),
8439        );
8440    }
8441
8442    /// Returns the value of the `PAC_frac` field.
8443    pub const fn pac_frac(self) -> u8 {
8444        ((self.bits() >> Self::PAC_FRAC_SHIFT) & 0b1111) as u8
8445    }
8446
8447    /// Sets the value of the `PAC_frac` field.
8448    pub const fn set_pac_frac(&mut self, value: u8) {
8449        let offset = Self::PAC_FRAC_SHIFT;
8450        assert!(value & (Self::PAC_FRAC_MASK as u8) == value);
8451        *self = Self::from_bits_retain(
8452            (self.bits() & !(Self::PAC_FRAC_MASK << offset)) | ((value as u64) << offset),
8453        );
8454    }
8455
8456    /// Returns the value of the `CLRBHB` field.
8457    pub const fn clrbhb(self) -> u8 {
8458        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
8459    }
8460
8461    /// Sets the value of the `CLRBHB` field.
8462    pub const fn set_clrbhb(&mut self, value: u8) {
8463        let offset = Self::CLRBHB_SHIFT;
8464        assert!(value & (Self::CLRBHB_MASK as u8) == value);
8465        *self = Self::from_bits_retain(
8466            (self.bits() & !(Self::CLRBHB_MASK << offset)) | ((value as u64) << offset),
8467        );
8468    }
8469
8470    /// Returns the value of the `SYSREG_128` field.
8471    pub const fn sysreg_128(self) -> u8 {
8472        ((self.bits() >> Self::SYSREG_128_SHIFT) & 0b1111) as u8
8473    }
8474
8475    /// Sets the value of the `SYSREG_128` field.
8476    pub const fn set_sysreg_128(&mut self, value: u8) {
8477        let offset = Self::SYSREG_128_SHIFT;
8478        assert!(value & (Self::SYSREG_128_MASK as u8) == value);
8479        *self = Self::from_bits_retain(
8480            (self.bits() & !(Self::SYSREG_128_MASK << offset)) | ((value as u64) << offset),
8481        );
8482    }
8483
8484    /// Returns the value of the `SYSINSTR_128` field.
8485    pub const fn sysinstr_128(self) -> u8 {
8486        ((self.bits() >> Self::SYSINSTR_128_SHIFT) & 0b1111) as u8
8487    }
8488
8489    /// Sets the value of the `SYSINSTR_128` field.
8490    pub const fn set_sysinstr_128(&mut self, value: u8) {
8491        let offset = Self::SYSINSTR_128_SHIFT;
8492        assert!(value & (Self::SYSINSTR_128_MASK as u8) == value);
8493        *self = Self::from_bits_retain(
8494            (self.bits() & !(Self::SYSINSTR_128_MASK << offset)) | ((value as u64) << offset),
8495        );
8496    }
8497
8498    /// Returns the value of the `PRFMSLC` field.
8499    pub const fn prfmslc(self) -> u8 {
8500        ((self.bits() >> Self::PRFMSLC_SHIFT) & 0b1111) as u8
8501    }
8502
8503    /// Sets the value of the `PRFMSLC` field.
8504    pub const fn set_prfmslc(&mut self, value: u8) {
8505        let offset = Self::PRFMSLC_SHIFT;
8506        assert!(value & (Self::PRFMSLC_MASK as u8) == value);
8507        *self = Self::from_bits_retain(
8508            (self.bits() & !(Self::PRFMSLC_MASK << offset)) | ((value as u64) << offset),
8509        );
8510    }
8511
8512    /// Returns the value of the `PCDPHINT` field.
8513    pub const fn pcdphint(self) -> u8 {
8514        ((self.bits() >> Self::PCDPHINT_SHIFT) & 0b1111) as u8
8515    }
8516
8517    /// Sets the value of the `PCDPHINT` field.
8518    pub const fn set_pcdphint(&mut self, value: u8) {
8519        let offset = Self::PCDPHINT_SHIFT;
8520        assert!(value & (Self::PCDPHINT_MASK as u8) == value);
8521        *self = Self::from_bits_retain(
8522            (self.bits() & !(Self::PCDPHINT_MASK << offset)) | ((value as u64) << offset),
8523        );
8524    }
8525
8526    /// Returns the value of the `RPRFM` field.
8527    pub const fn rprfm(self) -> u8 {
8528        ((self.bits() >> Self::RPRFM_SHIFT) & 0b1111) as u8
8529    }
8530
8531    /// Sets the value of the `RPRFM` field.
8532    pub const fn set_rprfm(&mut self, value: u8) {
8533        let offset = Self::RPRFM_SHIFT;
8534        assert!(value & (Self::RPRFM_MASK as u8) == value);
8535        *self = Self::from_bits_retain(
8536            (self.bits() & !(Self::RPRFM_MASK << offset)) | ((value as u64) << offset),
8537        );
8538    }
8539
8540    /// Returns the value of the `CSSC` field.
8541    pub const fn cssc(self) -> u8 {
8542        ((self.bits() >> Self::CSSC_SHIFT) & 0b1111) as u8
8543    }
8544
8545    /// Sets the value of the `CSSC` field.
8546    pub const fn set_cssc(&mut self, value: u8) {
8547        let offset = Self::CSSC_SHIFT;
8548        assert!(value & (Self::CSSC_MASK as u8) == value);
8549        *self = Self::from_bits_retain(
8550            (self.bits() & !(Self::CSSC_MASK << offset)) | ((value as u64) << offset),
8551        );
8552    }
8553
8554    /// Returns the value of the `LUT` field.
8555    pub const fn lut(self) -> u8 {
8556        ((self.bits() >> Self::LUT_SHIFT) & 0b1111) as u8
8557    }
8558
8559    /// Sets the value of the `LUT` field.
8560    pub const fn set_lut(&mut self, value: u8) {
8561        let offset = Self::LUT_SHIFT;
8562        assert!(value & (Self::LUT_MASK as u8) == value);
8563        *self = Self::from_bits_retain(
8564            (self.bits() & !(Self::LUT_MASK << offset)) | ((value as u64) << offset),
8565        );
8566    }
8567
8568    /// Returns the value of the `ATS1A` field.
8569    pub const fn ats1a(self) -> u8 {
8570        ((self.bits() >> Self::ATS1A_SHIFT) & 0b1111) as u8
8571    }
8572
8573    /// Sets the value of the `ATS1A` field.
8574    pub const fn set_ats1a(&mut self, value: u8) {
8575        let offset = Self::ATS1A_SHIFT;
8576        assert!(value & (Self::ATS1A_MASK as u8) == value);
8577        *self = Self::from_bits_retain(
8578            (self.bits() & !(Self::ATS1A_MASK << offset)) | ((value as u64) << offset),
8579        );
8580    }
8581}
8582
8583#[cfg(feature = "el1")]
8584bitflags! {
8585    /// `ID_AA64MMFR0_EL1` system register value.
8586    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8587    #[repr(transparent)]
8588    pub struct IdAa64mmfr0El1: u64 {
8589    }
8590}
8591
8592#[cfg(feature = "el1")]
8593impl IdAa64mmfr0El1 {
8594    /// Offset of the `PARange` field.
8595    pub const PARANGE_SHIFT: u32 = 0;
8596    /// Mask for the `PARange` field.
8597    pub const PARANGE_MASK: u64 = 0b1111;
8598    /// Offset of the `ASIDBits` field.
8599    pub const ASIDBITS_SHIFT: u32 = 4;
8600    /// Mask for the `ASIDBits` field.
8601    pub const ASIDBITS_MASK: u64 = 0b1111;
8602    /// Offset of the `BigEnd` field.
8603    pub const BIGEND_SHIFT: u32 = 8;
8604    /// Mask for the `BigEnd` field.
8605    pub const BIGEND_MASK: u64 = 0b1111;
8606    /// Offset of the `SNSMem` field.
8607    pub const SNSMEM_SHIFT: u32 = 12;
8608    /// Mask for the `SNSMem` field.
8609    pub const SNSMEM_MASK: u64 = 0b1111;
8610    /// Offset of the `BigEndEL0` field.
8611    pub const BIGENDEL0_SHIFT: u32 = 16;
8612    /// Mask for the `BigEndEL0` field.
8613    pub const BIGENDEL0_MASK: u64 = 0b1111;
8614    /// Offset of the `TGran16` field.
8615    pub const TGRAN16_SHIFT: u32 = 20;
8616    /// Mask for the `TGran16` field.
8617    pub const TGRAN16_MASK: u64 = 0b1111;
8618    /// Offset of the `TGran64` field.
8619    pub const TGRAN64_SHIFT: u32 = 24;
8620    /// Mask for the `TGran64` field.
8621    pub const TGRAN64_MASK: u64 = 0b1111;
8622    /// Offset of the `TGran4` field.
8623    pub const TGRAN4_SHIFT: u32 = 28;
8624    /// Mask for the `TGran4` field.
8625    pub const TGRAN4_MASK: u64 = 0b1111;
8626    /// Offset of the `TGran16_2` field.
8627    pub const TGRAN16_2_SHIFT: u32 = 32;
8628    /// Mask for the `TGran16_2` field.
8629    pub const TGRAN16_2_MASK: u64 = 0b1111;
8630    /// Offset of the `TGran64_2` field.
8631    pub const TGRAN64_2_SHIFT: u32 = 36;
8632    /// Mask for the `TGran64_2` field.
8633    pub const TGRAN64_2_MASK: u64 = 0b1111;
8634    /// Offset of the `TGran4_2` field.
8635    pub const TGRAN4_2_SHIFT: u32 = 40;
8636    /// Mask for the `TGran4_2` field.
8637    pub const TGRAN4_2_MASK: u64 = 0b1111;
8638    /// Offset of the `ExS` field.
8639    pub const EXS_SHIFT: u32 = 44;
8640    /// Mask for the `ExS` field.
8641    pub const EXS_MASK: u64 = 0b1111;
8642    /// Offset of the `FGT` field.
8643    pub const FGT_SHIFT: u32 = 56;
8644    /// Mask for the `FGT` field.
8645    pub const FGT_MASK: u64 = 0b1111;
8646    /// Offset of the `ECV` field.
8647    pub const ECV_SHIFT: u32 = 60;
8648    /// Mask for the `ECV` field.
8649    pub const ECV_MASK: u64 = 0b1111;
8650
8651    /// Returns the value of the `PARange` field.
8652    pub const fn parange(self) -> u8 {
8653        ((self.bits() >> Self::PARANGE_SHIFT) & 0b1111) as u8
8654    }
8655
8656    /// Sets the value of the `PARange` field.
8657    pub const fn set_parange(&mut self, value: u8) {
8658        let offset = Self::PARANGE_SHIFT;
8659        assert!(value & (Self::PARANGE_MASK as u8) == value);
8660        *self = Self::from_bits_retain(
8661            (self.bits() & !(Self::PARANGE_MASK << offset)) | ((value as u64) << offset),
8662        );
8663    }
8664
8665    /// Returns the value of the `ASIDBits` field.
8666    pub const fn asidbits(self) -> u8 {
8667        ((self.bits() >> Self::ASIDBITS_SHIFT) & 0b1111) as u8
8668    }
8669
8670    /// Sets the value of the `ASIDBits` field.
8671    pub const fn set_asidbits(&mut self, value: u8) {
8672        let offset = Self::ASIDBITS_SHIFT;
8673        assert!(value & (Self::ASIDBITS_MASK as u8) == value);
8674        *self = Self::from_bits_retain(
8675            (self.bits() & !(Self::ASIDBITS_MASK << offset)) | ((value as u64) << offset),
8676        );
8677    }
8678
8679    /// Returns the value of the `BigEnd` field.
8680    pub const fn bigend(self) -> u8 {
8681        ((self.bits() >> Self::BIGEND_SHIFT) & 0b1111) as u8
8682    }
8683
8684    /// Sets the value of the `BigEnd` field.
8685    pub const fn set_bigend(&mut self, value: u8) {
8686        let offset = Self::BIGEND_SHIFT;
8687        assert!(value & (Self::BIGEND_MASK as u8) == value);
8688        *self = Self::from_bits_retain(
8689            (self.bits() & !(Self::BIGEND_MASK << offset)) | ((value as u64) << offset),
8690        );
8691    }
8692
8693    /// Returns the value of the `SNSMem` field.
8694    pub const fn snsmem(self) -> u8 {
8695        ((self.bits() >> Self::SNSMEM_SHIFT) & 0b1111) as u8
8696    }
8697
8698    /// Sets the value of the `SNSMem` field.
8699    pub const fn set_snsmem(&mut self, value: u8) {
8700        let offset = Self::SNSMEM_SHIFT;
8701        assert!(value & (Self::SNSMEM_MASK as u8) == value);
8702        *self = Self::from_bits_retain(
8703            (self.bits() & !(Self::SNSMEM_MASK << offset)) | ((value as u64) << offset),
8704        );
8705    }
8706
8707    /// Returns the value of the `BigEndEL0` field.
8708    pub const fn bigendel0(self) -> u8 {
8709        ((self.bits() >> Self::BIGENDEL0_SHIFT) & 0b1111) as u8
8710    }
8711
8712    /// Sets the value of the `BigEndEL0` field.
8713    pub const fn set_bigendel0(&mut self, value: u8) {
8714        let offset = Self::BIGENDEL0_SHIFT;
8715        assert!(value & (Self::BIGENDEL0_MASK as u8) == value);
8716        *self = Self::from_bits_retain(
8717            (self.bits() & !(Self::BIGENDEL0_MASK << offset)) | ((value as u64) << offset),
8718        );
8719    }
8720
8721    /// Returns the value of the `TGran16` field.
8722    pub const fn tgran16(self) -> u8 {
8723        ((self.bits() >> Self::TGRAN16_SHIFT) & 0b1111) as u8
8724    }
8725
8726    /// Sets the value of the `TGran16` field.
8727    pub const fn set_tgran16(&mut self, value: u8) {
8728        let offset = Self::TGRAN16_SHIFT;
8729        assert!(value & (Self::TGRAN16_MASK as u8) == value);
8730        *self = Self::from_bits_retain(
8731            (self.bits() & !(Self::TGRAN16_MASK << offset)) | ((value as u64) << offset),
8732        );
8733    }
8734
8735    /// Returns the value of the `TGran64` field.
8736    pub const fn tgran64(self) -> u8 {
8737        ((self.bits() >> Self::TGRAN64_SHIFT) & 0b1111) as u8
8738    }
8739
8740    /// Sets the value of the `TGran64` field.
8741    pub const fn set_tgran64(&mut self, value: u8) {
8742        let offset = Self::TGRAN64_SHIFT;
8743        assert!(value & (Self::TGRAN64_MASK as u8) == value);
8744        *self = Self::from_bits_retain(
8745            (self.bits() & !(Self::TGRAN64_MASK << offset)) | ((value as u64) << offset),
8746        );
8747    }
8748
8749    /// Returns the value of the `TGran4` field.
8750    pub const fn tgran4(self) -> u8 {
8751        ((self.bits() >> Self::TGRAN4_SHIFT) & 0b1111) as u8
8752    }
8753
8754    /// Sets the value of the `TGran4` field.
8755    pub const fn set_tgran4(&mut self, value: u8) {
8756        let offset = Self::TGRAN4_SHIFT;
8757        assert!(value & (Self::TGRAN4_MASK as u8) == value);
8758        *self = Self::from_bits_retain(
8759            (self.bits() & !(Self::TGRAN4_MASK << offset)) | ((value as u64) << offset),
8760        );
8761    }
8762
8763    /// Returns the value of the `TGran16_2` field.
8764    pub const fn tgran16_2(self) -> u8 {
8765        ((self.bits() >> Self::TGRAN16_2_SHIFT) & 0b1111) as u8
8766    }
8767
8768    /// Sets the value of the `TGran16_2` field.
8769    pub const fn set_tgran16_2(&mut self, value: u8) {
8770        let offset = Self::TGRAN16_2_SHIFT;
8771        assert!(value & (Self::TGRAN16_2_MASK as u8) == value);
8772        *self = Self::from_bits_retain(
8773            (self.bits() & !(Self::TGRAN16_2_MASK << offset)) | ((value as u64) << offset),
8774        );
8775    }
8776
8777    /// Returns the value of the `TGran64_2` field.
8778    pub const fn tgran64_2(self) -> u8 {
8779        ((self.bits() >> Self::TGRAN64_2_SHIFT) & 0b1111) as u8
8780    }
8781
8782    /// Sets the value of the `TGran64_2` field.
8783    pub const fn set_tgran64_2(&mut self, value: u8) {
8784        let offset = Self::TGRAN64_2_SHIFT;
8785        assert!(value & (Self::TGRAN64_2_MASK as u8) == value);
8786        *self = Self::from_bits_retain(
8787            (self.bits() & !(Self::TGRAN64_2_MASK << offset)) | ((value as u64) << offset),
8788        );
8789    }
8790
8791    /// Returns the value of the `TGran4_2` field.
8792    pub const fn tgran4_2(self) -> u8 {
8793        ((self.bits() >> Self::TGRAN4_2_SHIFT) & 0b1111) as u8
8794    }
8795
8796    /// Sets the value of the `TGran4_2` field.
8797    pub const fn set_tgran4_2(&mut self, value: u8) {
8798        let offset = Self::TGRAN4_2_SHIFT;
8799        assert!(value & (Self::TGRAN4_2_MASK as u8) == value);
8800        *self = Self::from_bits_retain(
8801            (self.bits() & !(Self::TGRAN4_2_MASK << offset)) | ((value as u64) << offset),
8802        );
8803    }
8804
8805    /// Returns the value of the `ExS` field.
8806    pub const fn exs(self) -> u8 {
8807        ((self.bits() >> Self::EXS_SHIFT) & 0b1111) as u8
8808    }
8809
8810    /// Sets the value of the `ExS` field.
8811    pub const fn set_exs(&mut self, value: u8) {
8812        let offset = Self::EXS_SHIFT;
8813        assert!(value & (Self::EXS_MASK as u8) == value);
8814        *self = Self::from_bits_retain(
8815            (self.bits() & !(Self::EXS_MASK << offset)) | ((value as u64) << offset),
8816        );
8817    }
8818
8819    /// Returns the value of the `FGT` field.
8820    pub const fn fgt(self) -> u8 {
8821        ((self.bits() >> Self::FGT_SHIFT) & 0b1111) as u8
8822    }
8823
8824    /// Sets the value of the `FGT` field.
8825    pub const fn set_fgt(&mut self, value: u8) {
8826        let offset = Self::FGT_SHIFT;
8827        assert!(value & (Self::FGT_MASK as u8) == value);
8828        *self = Self::from_bits_retain(
8829            (self.bits() & !(Self::FGT_MASK << offset)) | ((value as u64) << offset),
8830        );
8831    }
8832
8833    /// Returns the value of the `ECV` field.
8834    pub const fn ecv(self) -> u8 {
8835        ((self.bits() >> Self::ECV_SHIFT) & 0b1111) as u8
8836    }
8837
8838    /// Sets the value of the `ECV` field.
8839    pub const fn set_ecv(&mut self, value: u8) {
8840        let offset = Self::ECV_SHIFT;
8841        assert!(value & (Self::ECV_MASK as u8) == value);
8842        *self = Self::from_bits_retain(
8843            (self.bits() & !(Self::ECV_MASK << offset)) | ((value as u64) << offset),
8844        );
8845    }
8846}
8847
8848#[cfg(feature = "el1")]
8849bitflags! {
8850    /// `ID_AA64MMFR1_EL1` system register value.
8851    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8852    #[repr(transparent)]
8853    pub struct IdAa64mmfr1El1: u64 {
8854    }
8855}
8856
8857#[cfg(feature = "el1")]
8858impl IdAa64mmfr1El1 {
8859    /// Offset of the `HAFDBS` field.
8860    pub const HAFDBS_SHIFT: u32 = 0;
8861    /// Mask for the `HAFDBS` field.
8862    pub const HAFDBS_MASK: u64 = 0b1111;
8863    /// Offset of the `VMIDBits` field.
8864    pub const VMIDBITS_SHIFT: u32 = 4;
8865    /// Mask for the `VMIDBits` field.
8866    pub const VMIDBITS_MASK: u64 = 0b1111;
8867    /// Offset of the `VH` field.
8868    pub const VH_SHIFT: u32 = 8;
8869    /// Mask for the `VH` field.
8870    pub const VH_MASK: u64 = 0b1111;
8871    /// Offset of the `HPDS` field.
8872    pub const HPDS_SHIFT: u32 = 12;
8873    /// Mask for the `HPDS` field.
8874    pub const HPDS_MASK: u64 = 0b1111;
8875    /// Offset of the `LO` field.
8876    pub const LO_SHIFT: u32 = 16;
8877    /// Mask for the `LO` field.
8878    pub const LO_MASK: u64 = 0b1111;
8879    /// Offset of the `PAN` field.
8880    pub const PAN_SHIFT: u32 = 20;
8881    /// Mask for the `PAN` field.
8882    pub const PAN_MASK: u64 = 0b1111;
8883    /// Offset of the `SpecSEI` field.
8884    pub const SPECSEI_SHIFT: u32 = 24;
8885    /// Mask for the `SpecSEI` field.
8886    pub const SPECSEI_MASK: u64 = 0b1111;
8887    /// Offset of the `XNX` field.
8888    pub const XNX_SHIFT: u32 = 28;
8889    /// Mask for the `XNX` field.
8890    pub const XNX_MASK: u64 = 0b1111;
8891    /// Offset of the `TWED` field.
8892    pub const TWED_SHIFT: u32 = 32;
8893    /// Mask for the `TWED` field.
8894    pub const TWED_MASK: u64 = 0b1111;
8895    /// Offset of the `ETS` field.
8896    pub const ETS_SHIFT: u32 = 36;
8897    /// Mask for the `ETS` field.
8898    pub const ETS_MASK: u64 = 0b1111;
8899    /// Offset of the `HCX` field.
8900    pub const HCX_SHIFT: u32 = 40;
8901    /// Mask for the `HCX` field.
8902    pub const HCX_MASK: u64 = 0b1111;
8903    /// Offset of the `AFP` field.
8904    pub const AFP_SHIFT: u32 = 44;
8905    /// Mask for the `AFP` field.
8906    pub const AFP_MASK: u64 = 0b1111;
8907    /// Offset of the `nTLBPA` field.
8908    pub const NTLBPA_SHIFT: u32 = 48;
8909    /// Mask for the `nTLBPA` field.
8910    pub const NTLBPA_MASK: u64 = 0b1111;
8911    /// Offset of the `TIDCP1` field.
8912    pub const TIDCP1_SHIFT: u32 = 52;
8913    /// Mask for the `TIDCP1` field.
8914    pub const TIDCP1_MASK: u64 = 0b1111;
8915    /// Offset of the `CMOW` field.
8916    pub const CMOW_SHIFT: u32 = 56;
8917    /// Mask for the `CMOW` field.
8918    pub const CMOW_MASK: u64 = 0b1111;
8919    /// Offset of the `ECBHB` field.
8920    pub const ECBHB_SHIFT: u32 = 60;
8921    /// Mask for the `ECBHB` field.
8922    pub const ECBHB_MASK: u64 = 0b1111;
8923
8924    /// Returns the value of the `HAFDBS` field.
8925    pub const fn hafdbs(self) -> u8 {
8926        ((self.bits() >> Self::HAFDBS_SHIFT) & 0b1111) as u8
8927    }
8928
8929    /// Sets the value of the `HAFDBS` field.
8930    pub const fn set_hafdbs(&mut self, value: u8) {
8931        let offset = Self::HAFDBS_SHIFT;
8932        assert!(value & (Self::HAFDBS_MASK as u8) == value);
8933        *self = Self::from_bits_retain(
8934            (self.bits() & !(Self::HAFDBS_MASK << offset)) | ((value as u64) << offset),
8935        );
8936    }
8937
8938    /// Returns the value of the `VMIDBits` field.
8939    pub const fn vmidbits(self) -> u8 {
8940        ((self.bits() >> Self::VMIDBITS_SHIFT) & 0b1111) as u8
8941    }
8942
8943    /// Sets the value of the `VMIDBits` field.
8944    pub const fn set_vmidbits(&mut self, value: u8) {
8945        let offset = Self::VMIDBITS_SHIFT;
8946        assert!(value & (Self::VMIDBITS_MASK as u8) == value);
8947        *self = Self::from_bits_retain(
8948            (self.bits() & !(Self::VMIDBITS_MASK << offset)) | ((value as u64) << offset),
8949        );
8950    }
8951
8952    /// Returns the value of the `VH` field.
8953    pub const fn vh(self) -> u8 {
8954        ((self.bits() >> Self::VH_SHIFT) & 0b1111) as u8
8955    }
8956
8957    /// Sets the value of the `VH` field.
8958    pub const fn set_vh(&mut self, value: u8) {
8959        let offset = Self::VH_SHIFT;
8960        assert!(value & (Self::VH_MASK as u8) == value);
8961        *self = Self::from_bits_retain(
8962            (self.bits() & !(Self::VH_MASK << offset)) | ((value as u64) << offset),
8963        );
8964    }
8965
8966    /// Returns the value of the `HPDS` field.
8967    pub const fn hpds(self) -> u8 {
8968        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
8969    }
8970
8971    /// Sets the value of the `HPDS` field.
8972    pub const fn set_hpds(&mut self, value: u8) {
8973        let offset = Self::HPDS_SHIFT;
8974        assert!(value & (Self::HPDS_MASK as u8) == value);
8975        *self = Self::from_bits_retain(
8976            (self.bits() & !(Self::HPDS_MASK << offset)) | ((value as u64) << offset),
8977        );
8978    }
8979
8980    /// Returns the value of the `LO` field.
8981    pub const fn lo(self) -> u8 {
8982        ((self.bits() >> Self::LO_SHIFT) & 0b1111) as u8
8983    }
8984
8985    /// Sets the value of the `LO` field.
8986    pub const fn set_lo(&mut self, value: u8) {
8987        let offset = Self::LO_SHIFT;
8988        assert!(value & (Self::LO_MASK as u8) == value);
8989        *self = Self::from_bits_retain(
8990            (self.bits() & !(Self::LO_MASK << offset)) | ((value as u64) << offset),
8991        );
8992    }
8993
8994    /// Returns the value of the `PAN` field.
8995    pub const fn pan(self) -> u8 {
8996        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
8997    }
8998
8999    /// Sets the value of the `PAN` field.
9000    pub const fn set_pan(&mut self, value: u8) {
9001        let offset = Self::PAN_SHIFT;
9002        assert!(value & (Self::PAN_MASK as u8) == value);
9003        *self = Self::from_bits_retain(
9004            (self.bits() & !(Self::PAN_MASK << offset)) | ((value as u64) << offset),
9005        );
9006    }
9007
9008    /// Returns the value of the `SpecSEI` field.
9009    pub const fn specsei(self) -> u8 {
9010        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
9011    }
9012
9013    /// Sets the value of the `SpecSEI` field.
9014    pub const fn set_specsei(&mut self, value: u8) {
9015        let offset = Self::SPECSEI_SHIFT;
9016        assert!(value & (Self::SPECSEI_MASK as u8) == value);
9017        *self = Self::from_bits_retain(
9018            (self.bits() & !(Self::SPECSEI_MASK << offset)) | ((value as u64) << offset),
9019        );
9020    }
9021
9022    /// Returns the value of the `XNX` field.
9023    pub const fn xnx(self) -> u8 {
9024        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
9025    }
9026
9027    /// Sets the value of the `XNX` field.
9028    pub const fn set_xnx(&mut self, value: u8) {
9029        let offset = Self::XNX_SHIFT;
9030        assert!(value & (Self::XNX_MASK as u8) == value);
9031        *self = Self::from_bits_retain(
9032            (self.bits() & !(Self::XNX_MASK << offset)) | ((value as u64) << offset),
9033        );
9034    }
9035
9036    /// Returns the value of the `TWED` field.
9037    pub const fn twed(self) -> u8 {
9038        ((self.bits() >> Self::TWED_SHIFT) & 0b1111) as u8
9039    }
9040
9041    /// Sets the value of the `TWED` field.
9042    pub const fn set_twed(&mut self, value: u8) {
9043        let offset = Self::TWED_SHIFT;
9044        assert!(value & (Self::TWED_MASK as u8) == value);
9045        *self = Self::from_bits_retain(
9046            (self.bits() & !(Self::TWED_MASK << offset)) | ((value as u64) << offset),
9047        );
9048    }
9049
9050    /// Returns the value of the `ETS` field.
9051    pub const fn ets(self) -> u8 {
9052        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
9053    }
9054
9055    /// Sets the value of the `ETS` field.
9056    pub const fn set_ets(&mut self, value: u8) {
9057        let offset = Self::ETS_SHIFT;
9058        assert!(value & (Self::ETS_MASK as u8) == value);
9059        *self = Self::from_bits_retain(
9060            (self.bits() & !(Self::ETS_MASK << offset)) | ((value as u64) << offset),
9061        );
9062    }
9063
9064    /// Returns the value of the `HCX` field.
9065    pub const fn hcx(self) -> u8 {
9066        ((self.bits() >> Self::HCX_SHIFT) & 0b1111) as u8
9067    }
9068
9069    /// Sets the value of the `HCX` field.
9070    pub const fn set_hcx(&mut self, value: u8) {
9071        let offset = Self::HCX_SHIFT;
9072        assert!(value & (Self::HCX_MASK as u8) == value);
9073        *self = Self::from_bits_retain(
9074            (self.bits() & !(Self::HCX_MASK << offset)) | ((value as u64) << offset),
9075        );
9076    }
9077
9078    /// Returns the value of the `AFP` field.
9079    pub const fn afp(self) -> u8 {
9080        ((self.bits() >> Self::AFP_SHIFT) & 0b1111) as u8
9081    }
9082
9083    /// Sets the value of the `AFP` field.
9084    pub const fn set_afp(&mut self, value: u8) {
9085        let offset = Self::AFP_SHIFT;
9086        assert!(value & (Self::AFP_MASK as u8) == value);
9087        *self = Self::from_bits_retain(
9088            (self.bits() & !(Self::AFP_MASK << offset)) | ((value as u64) << offset),
9089        );
9090    }
9091
9092    /// Returns the value of the `nTLBPA` field.
9093    pub const fn ntlbpa(self) -> u8 {
9094        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
9095    }
9096
9097    /// Sets the value of the `nTLBPA` field.
9098    pub const fn set_ntlbpa(&mut self, value: u8) {
9099        let offset = Self::NTLBPA_SHIFT;
9100        assert!(value & (Self::NTLBPA_MASK as u8) == value);
9101        *self = Self::from_bits_retain(
9102            (self.bits() & !(Self::NTLBPA_MASK << offset)) | ((value as u64) << offset),
9103        );
9104    }
9105
9106    /// Returns the value of the `TIDCP1` field.
9107    pub const fn tidcp1(self) -> u8 {
9108        ((self.bits() >> Self::TIDCP1_SHIFT) & 0b1111) as u8
9109    }
9110
9111    /// Sets the value of the `TIDCP1` field.
9112    pub const fn set_tidcp1(&mut self, value: u8) {
9113        let offset = Self::TIDCP1_SHIFT;
9114        assert!(value & (Self::TIDCP1_MASK as u8) == value);
9115        *self = Self::from_bits_retain(
9116            (self.bits() & !(Self::TIDCP1_MASK << offset)) | ((value as u64) << offset),
9117        );
9118    }
9119
9120    /// Returns the value of the `CMOW` field.
9121    pub const fn cmow(self) -> u8 {
9122        ((self.bits() >> Self::CMOW_SHIFT) & 0b1111) as u8
9123    }
9124
9125    /// Sets the value of the `CMOW` field.
9126    pub const fn set_cmow(&mut self, value: u8) {
9127        let offset = Self::CMOW_SHIFT;
9128        assert!(value & (Self::CMOW_MASK as u8) == value);
9129        *self = Self::from_bits_retain(
9130            (self.bits() & !(Self::CMOW_MASK << offset)) | ((value as u64) << offset),
9131        );
9132    }
9133
9134    /// Returns the value of the `ECBHB` field.
9135    pub const fn ecbhb(self) -> u8 {
9136        ((self.bits() >> Self::ECBHB_SHIFT) & 0b1111) as u8
9137    }
9138
9139    /// Sets the value of the `ECBHB` field.
9140    pub const fn set_ecbhb(&mut self, value: u8) {
9141        let offset = Self::ECBHB_SHIFT;
9142        assert!(value & (Self::ECBHB_MASK as u8) == value);
9143        *self = Self::from_bits_retain(
9144            (self.bits() & !(Self::ECBHB_MASK << offset)) | ((value as u64) << offset),
9145        );
9146    }
9147}
9148
9149#[cfg(feature = "el1")]
9150bitflags! {
9151    /// `ID_AA64MMFR2_EL1` system register value.
9152    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9153    #[repr(transparent)]
9154    pub struct IdAa64mmfr2El1: u64 {
9155    }
9156}
9157
9158#[cfg(feature = "el1")]
9159impl IdAa64mmfr2El1 {
9160    /// Offset of the `CnP` field.
9161    pub const CNP_SHIFT: u32 = 0;
9162    /// Mask for the `CnP` field.
9163    pub const CNP_MASK: u64 = 0b1111;
9164    /// Offset of the `UAO` field.
9165    pub const UAO_SHIFT: u32 = 4;
9166    /// Mask for the `UAO` field.
9167    pub const UAO_MASK: u64 = 0b1111;
9168    /// Offset of the `LSM` field.
9169    pub const LSM_SHIFT: u32 = 8;
9170    /// Mask for the `LSM` field.
9171    pub const LSM_MASK: u64 = 0b1111;
9172    /// Offset of the `IESB` field.
9173    pub const IESB_SHIFT: u32 = 12;
9174    /// Mask for the `IESB` field.
9175    pub const IESB_MASK: u64 = 0b1111;
9176    /// Offset of the `VARange` field.
9177    pub const VARANGE_SHIFT: u32 = 16;
9178    /// Mask for the `VARange` field.
9179    pub const VARANGE_MASK: u64 = 0b1111;
9180    /// Offset of the `CCIDX` field.
9181    pub const CCIDX_SHIFT: u32 = 20;
9182    /// Mask for the `CCIDX` field.
9183    pub const CCIDX_MASK: u64 = 0b1111;
9184    /// Offset of the `NV` field.
9185    pub const NV_SHIFT: u32 = 24;
9186    /// Mask for the `NV` field.
9187    pub const NV_MASK: u64 = 0b1111;
9188    /// Offset of the `ST` field.
9189    pub const ST_SHIFT: u32 = 28;
9190    /// Mask for the `ST` field.
9191    pub const ST_MASK: u64 = 0b1111;
9192    /// Offset of the `AT` field.
9193    pub const AT_SHIFT: u32 = 32;
9194    /// Mask for the `AT` field.
9195    pub const AT_MASK: u64 = 0b1111;
9196    /// Offset of the `IDS` field.
9197    pub const IDS_SHIFT: u32 = 36;
9198    /// Mask for the `IDS` field.
9199    pub const IDS_MASK: u64 = 0b1111;
9200    /// Offset of the `FWB` field.
9201    pub const FWB_SHIFT: u32 = 40;
9202    /// Mask for the `FWB` field.
9203    pub const FWB_MASK: u64 = 0b1111;
9204    /// Offset of the `TTL` field.
9205    pub const TTL_SHIFT: u32 = 48;
9206    /// Mask for the `TTL` field.
9207    pub const TTL_MASK: u64 = 0b1111;
9208    /// Offset of the `BBM` field.
9209    pub const BBM_SHIFT: u32 = 52;
9210    /// Mask for the `BBM` field.
9211    pub const BBM_MASK: u64 = 0b1111;
9212    /// Offset of the `EVT` field.
9213    pub const EVT_SHIFT: u32 = 56;
9214    /// Mask for the `EVT` field.
9215    pub const EVT_MASK: u64 = 0b1111;
9216    /// Offset of the `E0PD` field.
9217    pub const E0PD_SHIFT: u32 = 60;
9218    /// Mask for the `E0PD` field.
9219    pub const E0PD_MASK: u64 = 0b1111;
9220
9221    /// Returns the value of the `CnP` field.
9222    pub const fn cnp(self) -> u8 {
9223        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
9224    }
9225
9226    /// Sets the value of the `CnP` field.
9227    pub const fn set_cnp(&mut self, value: u8) {
9228        let offset = Self::CNP_SHIFT;
9229        assert!(value & (Self::CNP_MASK as u8) == value);
9230        *self = Self::from_bits_retain(
9231            (self.bits() & !(Self::CNP_MASK << offset)) | ((value as u64) << offset),
9232        );
9233    }
9234
9235    /// Returns the value of the `UAO` field.
9236    pub const fn uao(self) -> u8 {
9237        ((self.bits() >> Self::UAO_SHIFT) & 0b1111) as u8
9238    }
9239
9240    /// Sets the value of the `UAO` field.
9241    pub const fn set_uao(&mut self, value: u8) {
9242        let offset = Self::UAO_SHIFT;
9243        assert!(value & (Self::UAO_MASK as u8) == value);
9244        *self = Self::from_bits_retain(
9245            (self.bits() & !(Self::UAO_MASK << offset)) | ((value as u64) << offset),
9246        );
9247    }
9248
9249    /// Returns the value of the `LSM` field.
9250    pub const fn lsm(self) -> u8 {
9251        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
9252    }
9253
9254    /// Sets the value of the `LSM` field.
9255    pub const fn set_lsm(&mut self, value: u8) {
9256        let offset = Self::LSM_SHIFT;
9257        assert!(value & (Self::LSM_MASK as u8) == value);
9258        *self = Self::from_bits_retain(
9259            (self.bits() & !(Self::LSM_MASK << offset)) | ((value as u64) << offset),
9260        );
9261    }
9262
9263    /// Returns the value of the `IESB` field.
9264    pub const fn iesb(self) -> u8 {
9265        ((self.bits() >> Self::IESB_SHIFT) & 0b1111) as u8
9266    }
9267
9268    /// Sets the value of the `IESB` field.
9269    pub const fn set_iesb(&mut self, value: u8) {
9270        let offset = Self::IESB_SHIFT;
9271        assert!(value & (Self::IESB_MASK as u8) == value);
9272        *self = Self::from_bits_retain(
9273            (self.bits() & !(Self::IESB_MASK << offset)) | ((value as u64) << offset),
9274        );
9275    }
9276
9277    /// Returns the value of the `VARange` field.
9278    pub const fn varange(self) -> u8 {
9279        ((self.bits() >> Self::VARANGE_SHIFT) & 0b1111) as u8
9280    }
9281
9282    /// Sets the value of the `VARange` field.
9283    pub const fn set_varange(&mut self, value: u8) {
9284        let offset = Self::VARANGE_SHIFT;
9285        assert!(value & (Self::VARANGE_MASK as u8) == value);
9286        *self = Self::from_bits_retain(
9287            (self.bits() & !(Self::VARANGE_MASK << offset)) | ((value as u64) << offset),
9288        );
9289    }
9290
9291    /// Returns the value of the `CCIDX` field.
9292    pub const fn ccidx(self) -> u8 {
9293        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
9294    }
9295
9296    /// Sets the value of the `CCIDX` field.
9297    pub const fn set_ccidx(&mut self, value: u8) {
9298        let offset = Self::CCIDX_SHIFT;
9299        assert!(value & (Self::CCIDX_MASK as u8) == value);
9300        *self = Self::from_bits_retain(
9301            (self.bits() & !(Self::CCIDX_MASK << offset)) | ((value as u64) << offset),
9302        );
9303    }
9304
9305    /// Returns the value of the `NV` field.
9306    pub const fn nv(self) -> u8 {
9307        ((self.bits() >> Self::NV_SHIFT) & 0b1111) as u8
9308    }
9309
9310    /// Sets the value of the `NV` field.
9311    pub const fn set_nv(&mut self, value: u8) {
9312        let offset = Self::NV_SHIFT;
9313        assert!(value & (Self::NV_MASK as u8) == value);
9314        *self = Self::from_bits_retain(
9315            (self.bits() & !(Self::NV_MASK << offset)) | ((value as u64) << offset),
9316        );
9317    }
9318
9319    /// Returns the value of the `ST` field.
9320    pub const fn st(self) -> u8 {
9321        ((self.bits() >> Self::ST_SHIFT) & 0b1111) as u8
9322    }
9323
9324    /// Sets the value of the `ST` field.
9325    pub const fn set_st(&mut self, value: u8) {
9326        let offset = Self::ST_SHIFT;
9327        assert!(value & (Self::ST_MASK as u8) == value);
9328        *self = Self::from_bits_retain(
9329            (self.bits() & !(Self::ST_MASK << offset)) | ((value as u64) << offset),
9330        );
9331    }
9332
9333    /// Returns the value of the `AT` field.
9334    pub const fn at(self) -> u8 {
9335        ((self.bits() >> Self::AT_SHIFT) & 0b1111) as u8
9336    }
9337
9338    /// Sets the value of the `AT` field.
9339    pub const fn set_at(&mut self, value: u8) {
9340        let offset = Self::AT_SHIFT;
9341        assert!(value & (Self::AT_MASK as u8) == value);
9342        *self = Self::from_bits_retain(
9343            (self.bits() & !(Self::AT_MASK << offset)) | ((value as u64) << offset),
9344        );
9345    }
9346
9347    /// Returns the value of the `IDS` field.
9348    pub const fn ids(self) -> u8 {
9349        ((self.bits() >> Self::IDS_SHIFT) & 0b1111) as u8
9350    }
9351
9352    /// Sets the value of the `IDS` field.
9353    pub const fn set_ids(&mut self, value: u8) {
9354        let offset = Self::IDS_SHIFT;
9355        assert!(value & (Self::IDS_MASK as u8) == value);
9356        *self = Self::from_bits_retain(
9357            (self.bits() & !(Self::IDS_MASK << offset)) | ((value as u64) << offset),
9358        );
9359    }
9360
9361    /// Returns the value of the `FWB` field.
9362    pub const fn fwb(self) -> u8 {
9363        ((self.bits() >> Self::FWB_SHIFT) & 0b1111) as u8
9364    }
9365
9366    /// Sets the value of the `FWB` field.
9367    pub const fn set_fwb(&mut self, value: u8) {
9368        let offset = Self::FWB_SHIFT;
9369        assert!(value & (Self::FWB_MASK as u8) == value);
9370        *self = Self::from_bits_retain(
9371            (self.bits() & !(Self::FWB_MASK << offset)) | ((value as u64) << offset),
9372        );
9373    }
9374
9375    /// Returns the value of the `TTL` field.
9376    pub const fn ttl(self) -> u8 {
9377        ((self.bits() >> Self::TTL_SHIFT) & 0b1111) as u8
9378    }
9379
9380    /// Sets the value of the `TTL` field.
9381    pub const fn set_ttl(&mut self, value: u8) {
9382        let offset = Self::TTL_SHIFT;
9383        assert!(value & (Self::TTL_MASK as u8) == value);
9384        *self = Self::from_bits_retain(
9385            (self.bits() & !(Self::TTL_MASK << offset)) | ((value as u64) << offset),
9386        );
9387    }
9388
9389    /// Returns the value of the `BBM` field.
9390    pub const fn bbm(self) -> u8 {
9391        ((self.bits() >> Self::BBM_SHIFT) & 0b1111) as u8
9392    }
9393
9394    /// Sets the value of the `BBM` field.
9395    pub const fn set_bbm(&mut self, value: u8) {
9396        let offset = Self::BBM_SHIFT;
9397        assert!(value & (Self::BBM_MASK as u8) == value);
9398        *self = Self::from_bits_retain(
9399            (self.bits() & !(Self::BBM_MASK << offset)) | ((value as u64) << offset),
9400        );
9401    }
9402
9403    /// Returns the value of the `EVT` field.
9404    pub const fn evt(self) -> u8 {
9405        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
9406    }
9407
9408    /// Sets the value of the `EVT` field.
9409    pub const fn set_evt(&mut self, value: u8) {
9410        let offset = Self::EVT_SHIFT;
9411        assert!(value & (Self::EVT_MASK as u8) == value);
9412        *self = Self::from_bits_retain(
9413            (self.bits() & !(Self::EVT_MASK << offset)) | ((value as u64) << offset),
9414        );
9415    }
9416
9417    /// Returns the value of the `E0PD` field.
9418    pub const fn e0pd(self) -> u8 {
9419        ((self.bits() >> Self::E0PD_SHIFT) & 0b1111) as u8
9420    }
9421
9422    /// Sets the value of the `E0PD` field.
9423    pub const fn set_e0pd(&mut self, value: u8) {
9424        let offset = Self::E0PD_SHIFT;
9425        assert!(value & (Self::E0PD_MASK as u8) == value);
9426        *self = Self::from_bits_retain(
9427            (self.bits() & !(Self::E0PD_MASK << offset)) | ((value as u64) << offset),
9428        );
9429    }
9430}
9431
9432#[cfg(feature = "el1")]
9433bitflags! {
9434    /// `ID_AA64MMFR3_EL1` system register value.
9435    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9436    #[repr(transparent)]
9437    pub struct IdAa64mmfr3El1: u64 {
9438    }
9439}
9440
9441#[cfg(feature = "el1")]
9442impl IdAa64mmfr3El1 {
9443    /// Offset of the `TCRX` field.
9444    pub const TCRX_SHIFT: u32 = 0;
9445    /// Mask for the `TCRX` field.
9446    pub const TCRX_MASK: u64 = 0b1111;
9447    /// Offset of the `SCTLRX` field.
9448    pub const SCTLRX_SHIFT: u32 = 4;
9449    /// Mask for the `SCTLRX` field.
9450    pub const SCTLRX_MASK: u64 = 0b1111;
9451    /// Offset of the `S1PIE` field.
9452    pub const S1PIE_SHIFT: u32 = 8;
9453    /// Mask for the `S1PIE` field.
9454    pub const S1PIE_MASK: u64 = 0b1111;
9455    /// Offset of the `S2PIE` field.
9456    pub const S2PIE_SHIFT: u32 = 12;
9457    /// Mask for the `S2PIE` field.
9458    pub const S2PIE_MASK: u64 = 0b1111;
9459    /// Offset of the `S1POE` field.
9460    pub const S1POE_SHIFT: u32 = 16;
9461    /// Mask for the `S1POE` field.
9462    pub const S1POE_MASK: u64 = 0b1111;
9463    /// Offset of the `S2POE` field.
9464    pub const S2POE_SHIFT: u32 = 20;
9465    /// Mask for the `S2POE` field.
9466    pub const S2POE_MASK: u64 = 0b1111;
9467    /// Offset of the `AIE` field.
9468    pub const AIE_SHIFT: u32 = 24;
9469    /// Mask for the `AIE` field.
9470    pub const AIE_MASK: u64 = 0b1111;
9471    /// Offset of the `MEC` field.
9472    pub const MEC_SHIFT: u32 = 28;
9473    /// Mask for the `MEC` field.
9474    pub const MEC_MASK: u64 = 0b1111;
9475    /// Offset of the `D128` field.
9476    pub const D128_SHIFT: u32 = 32;
9477    /// Mask for the `D128` field.
9478    pub const D128_MASK: u64 = 0b1111;
9479    /// Offset of the `D128_2` field.
9480    pub const D128_2_SHIFT: u32 = 36;
9481    /// Mask for the `D128_2` field.
9482    pub const D128_2_MASK: u64 = 0b1111;
9483    /// Offset of the `SNERR` field.
9484    pub const SNERR_SHIFT: u32 = 40;
9485    /// Mask for the `SNERR` field.
9486    pub const SNERR_MASK: u64 = 0b1111;
9487    /// Offset of the `ANERR` field.
9488    pub const ANERR_SHIFT: u32 = 44;
9489    /// Mask for the `ANERR` field.
9490    pub const ANERR_MASK: u64 = 0b1111;
9491    /// Offset of the `SDERR` field.
9492    pub const SDERR_SHIFT: u32 = 52;
9493    /// Mask for the `SDERR` field.
9494    pub const SDERR_MASK: u64 = 0b1111;
9495    /// Offset of the `ADERR` field.
9496    pub const ADERR_SHIFT: u32 = 56;
9497    /// Mask for the `ADERR` field.
9498    pub const ADERR_MASK: u64 = 0b1111;
9499    /// Offset of the `Spec_FPACC` field.
9500    pub const SPEC_FPACC_SHIFT: u32 = 60;
9501    /// Mask for the `Spec_FPACC` field.
9502    pub const SPEC_FPACC_MASK: u64 = 0b1111;
9503
9504    /// Returns the value of the `TCRX` field.
9505    pub const fn tcrx(self) -> u8 {
9506        ((self.bits() >> Self::TCRX_SHIFT) & 0b1111) as u8
9507    }
9508
9509    /// Sets the value of the `TCRX` field.
9510    pub const fn set_tcrx(&mut self, value: u8) {
9511        let offset = Self::TCRX_SHIFT;
9512        assert!(value & (Self::TCRX_MASK as u8) == value);
9513        *self = Self::from_bits_retain(
9514            (self.bits() & !(Self::TCRX_MASK << offset)) | ((value as u64) << offset),
9515        );
9516    }
9517
9518    /// Returns the value of the `SCTLRX` field.
9519    pub const fn sctlrx(self) -> u8 {
9520        ((self.bits() >> Self::SCTLRX_SHIFT) & 0b1111) as u8
9521    }
9522
9523    /// Sets the value of the `SCTLRX` field.
9524    pub const fn set_sctlrx(&mut self, value: u8) {
9525        let offset = Self::SCTLRX_SHIFT;
9526        assert!(value & (Self::SCTLRX_MASK as u8) == value);
9527        *self = Self::from_bits_retain(
9528            (self.bits() & !(Self::SCTLRX_MASK << offset)) | ((value as u64) << offset),
9529        );
9530    }
9531
9532    /// Returns the value of the `S1PIE` field.
9533    pub const fn s1pie(self) -> u8 {
9534        ((self.bits() >> Self::S1PIE_SHIFT) & 0b1111) as u8
9535    }
9536
9537    /// Sets the value of the `S1PIE` field.
9538    pub const fn set_s1pie(&mut self, value: u8) {
9539        let offset = Self::S1PIE_SHIFT;
9540        assert!(value & (Self::S1PIE_MASK as u8) == value);
9541        *self = Self::from_bits_retain(
9542            (self.bits() & !(Self::S1PIE_MASK << offset)) | ((value as u64) << offset),
9543        );
9544    }
9545
9546    /// Returns the value of the `S2PIE` field.
9547    pub const fn s2pie(self) -> u8 {
9548        ((self.bits() >> Self::S2PIE_SHIFT) & 0b1111) as u8
9549    }
9550
9551    /// Sets the value of the `S2PIE` field.
9552    pub const fn set_s2pie(&mut self, value: u8) {
9553        let offset = Self::S2PIE_SHIFT;
9554        assert!(value & (Self::S2PIE_MASK as u8) == value);
9555        *self = Self::from_bits_retain(
9556            (self.bits() & !(Self::S2PIE_MASK << offset)) | ((value as u64) << offset),
9557        );
9558    }
9559
9560    /// Returns the value of the `S1POE` field.
9561    pub const fn s1poe(self) -> u8 {
9562        ((self.bits() >> Self::S1POE_SHIFT) & 0b1111) as u8
9563    }
9564
9565    /// Sets the value of the `S1POE` field.
9566    pub const fn set_s1poe(&mut self, value: u8) {
9567        let offset = Self::S1POE_SHIFT;
9568        assert!(value & (Self::S1POE_MASK as u8) == value);
9569        *self = Self::from_bits_retain(
9570            (self.bits() & !(Self::S1POE_MASK << offset)) | ((value as u64) << offset),
9571        );
9572    }
9573
9574    /// Returns the value of the `S2POE` field.
9575    pub const fn s2poe(self) -> u8 {
9576        ((self.bits() >> Self::S2POE_SHIFT) & 0b1111) as u8
9577    }
9578
9579    /// Sets the value of the `S2POE` field.
9580    pub const fn set_s2poe(&mut self, value: u8) {
9581        let offset = Self::S2POE_SHIFT;
9582        assert!(value & (Self::S2POE_MASK as u8) == value);
9583        *self = Self::from_bits_retain(
9584            (self.bits() & !(Self::S2POE_MASK << offset)) | ((value as u64) << offset),
9585        );
9586    }
9587
9588    /// Returns the value of the `AIE` field.
9589    pub const fn aie(self) -> u8 {
9590        ((self.bits() >> Self::AIE_SHIFT) & 0b1111) as u8
9591    }
9592
9593    /// Sets the value of the `AIE` field.
9594    pub const fn set_aie(&mut self, value: u8) {
9595        let offset = Self::AIE_SHIFT;
9596        assert!(value & (Self::AIE_MASK as u8) == value);
9597        *self = Self::from_bits_retain(
9598            (self.bits() & !(Self::AIE_MASK << offset)) | ((value as u64) << offset),
9599        );
9600    }
9601
9602    /// Returns the value of the `MEC` field.
9603    pub const fn mec(self) -> u8 {
9604        ((self.bits() >> Self::MEC_SHIFT) & 0b1111) as u8
9605    }
9606
9607    /// Sets the value of the `MEC` field.
9608    pub const fn set_mec(&mut self, value: u8) {
9609        let offset = Self::MEC_SHIFT;
9610        assert!(value & (Self::MEC_MASK as u8) == value);
9611        *self = Self::from_bits_retain(
9612            (self.bits() & !(Self::MEC_MASK << offset)) | ((value as u64) << offset),
9613        );
9614    }
9615
9616    /// Returns the value of the `D128` field.
9617    pub const fn d128(self) -> u8 {
9618        ((self.bits() >> Self::D128_SHIFT) & 0b1111) as u8
9619    }
9620
9621    /// Sets the value of the `D128` field.
9622    pub const fn set_d128(&mut self, value: u8) {
9623        let offset = Self::D128_SHIFT;
9624        assert!(value & (Self::D128_MASK as u8) == value);
9625        *self = Self::from_bits_retain(
9626            (self.bits() & !(Self::D128_MASK << offset)) | ((value as u64) << offset),
9627        );
9628    }
9629
9630    /// Returns the value of the `D128_2` field.
9631    pub const fn d128_2(self) -> u8 {
9632        ((self.bits() >> Self::D128_2_SHIFT) & 0b1111) as u8
9633    }
9634
9635    /// Sets the value of the `D128_2` field.
9636    pub const fn set_d128_2(&mut self, value: u8) {
9637        let offset = Self::D128_2_SHIFT;
9638        assert!(value & (Self::D128_2_MASK as u8) == value);
9639        *self = Self::from_bits_retain(
9640            (self.bits() & !(Self::D128_2_MASK << offset)) | ((value as u64) << offset),
9641        );
9642    }
9643
9644    /// Returns the value of the `SNERR` field.
9645    pub const fn snerr(self) -> u8 {
9646        ((self.bits() >> Self::SNERR_SHIFT) & 0b1111) as u8
9647    }
9648
9649    /// Sets the value of the `SNERR` field.
9650    pub const fn set_snerr(&mut self, value: u8) {
9651        let offset = Self::SNERR_SHIFT;
9652        assert!(value & (Self::SNERR_MASK as u8) == value);
9653        *self = Self::from_bits_retain(
9654            (self.bits() & !(Self::SNERR_MASK << offset)) | ((value as u64) << offset),
9655        );
9656    }
9657
9658    /// Returns the value of the `ANERR` field.
9659    pub const fn anerr(self) -> u8 {
9660        ((self.bits() >> Self::ANERR_SHIFT) & 0b1111) as u8
9661    }
9662
9663    /// Sets the value of the `ANERR` field.
9664    pub const fn set_anerr(&mut self, value: u8) {
9665        let offset = Self::ANERR_SHIFT;
9666        assert!(value & (Self::ANERR_MASK as u8) == value);
9667        *self = Self::from_bits_retain(
9668            (self.bits() & !(Self::ANERR_MASK << offset)) | ((value as u64) << offset),
9669        );
9670    }
9671
9672    /// Returns the value of the `SDERR` field.
9673    pub const fn sderr(self) -> u8 {
9674        ((self.bits() >> Self::SDERR_SHIFT) & 0b1111) as u8
9675    }
9676
9677    /// Sets the value of the `SDERR` field.
9678    pub const fn set_sderr(&mut self, value: u8) {
9679        let offset = Self::SDERR_SHIFT;
9680        assert!(value & (Self::SDERR_MASK as u8) == value);
9681        *self = Self::from_bits_retain(
9682            (self.bits() & !(Self::SDERR_MASK << offset)) | ((value as u64) << offset),
9683        );
9684    }
9685
9686    /// Returns the value of the `ADERR` field.
9687    pub const fn aderr(self) -> u8 {
9688        ((self.bits() >> Self::ADERR_SHIFT) & 0b1111) as u8
9689    }
9690
9691    /// Sets the value of the `ADERR` field.
9692    pub const fn set_aderr(&mut self, value: u8) {
9693        let offset = Self::ADERR_SHIFT;
9694        assert!(value & (Self::ADERR_MASK as u8) == value);
9695        *self = Self::from_bits_retain(
9696            (self.bits() & !(Self::ADERR_MASK << offset)) | ((value as u64) << offset),
9697        );
9698    }
9699
9700    /// Returns the value of the `Spec_FPACC` field.
9701    pub const fn spec_fpacc(self) -> u8 {
9702        ((self.bits() >> Self::SPEC_FPACC_SHIFT) & 0b1111) as u8
9703    }
9704
9705    /// Sets the value of the `Spec_FPACC` field.
9706    pub const fn set_spec_fpacc(&mut self, value: u8) {
9707        let offset = Self::SPEC_FPACC_SHIFT;
9708        assert!(value & (Self::SPEC_FPACC_MASK as u8) == value);
9709        *self = Self::from_bits_retain(
9710            (self.bits() & !(Self::SPEC_FPACC_MASK << offset)) | ((value as u64) << offset),
9711        );
9712    }
9713}
9714
9715#[cfg(feature = "el1")]
9716bitflags! {
9717    /// `ID_AA64PFR0_EL1` system register value.
9718    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9719    #[repr(transparent)]
9720    pub struct IdAa64pfr0El1: u64 {
9721    }
9722}
9723
9724#[cfg(feature = "el1")]
9725impl IdAa64pfr0El1 {
9726    /// Offset of the `EL0` field.
9727    pub const EL0_SHIFT: u32 = 0;
9728    /// Mask for the `EL0` field.
9729    pub const EL0_MASK: u64 = 0b1111;
9730    /// Offset of the `EL1` field.
9731    pub const EL1_SHIFT: u32 = 4;
9732    /// Mask for the `EL1` field.
9733    pub const EL1_MASK: u64 = 0b1111;
9734    /// Offset of the `EL2` field.
9735    pub const EL2_SHIFT: u32 = 8;
9736    /// Mask for the `EL2` field.
9737    pub const EL2_MASK: u64 = 0b1111;
9738    /// Offset of the `EL3` field.
9739    pub const EL3_SHIFT: u32 = 12;
9740    /// Mask for the `EL3` field.
9741    pub const EL3_MASK: u64 = 0b1111;
9742    /// Offset of the `FP` field.
9743    pub const FP_SHIFT: u32 = 16;
9744    /// Mask for the `FP` field.
9745    pub const FP_MASK: u64 = 0b1111;
9746    /// Offset of the `AdvSIMD` field.
9747    pub const ADVSIMD_SHIFT: u32 = 20;
9748    /// Mask for the `AdvSIMD` field.
9749    pub const ADVSIMD_MASK: u64 = 0b1111;
9750    /// Offset of the `GIC` field.
9751    pub const GIC_SHIFT: u32 = 24;
9752    /// Mask for the `GIC` field.
9753    pub const GIC_MASK: u64 = 0b1111;
9754    /// Offset of the `RAS` field.
9755    pub const RAS_SHIFT: u32 = 28;
9756    /// Mask for the `RAS` field.
9757    pub const RAS_MASK: u64 = 0b1111;
9758    /// Offset of the `SVE` field.
9759    pub const SVE_SHIFT: u32 = 32;
9760    /// Mask for the `SVE` field.
9761    pub const SVE_MASK: u64 = 0b1111;
9762    /// Offset of the `SEL2` field.
9763    pub const SEL2_SHIFT: u32 = 36;
9764    /// Mask for the `SEL2` field.
9765    pub const SEL2_MASK: u64 = 0b1111;
9766    /// Offset of the `MPAM` field.
9767    pub const MPAM_SHIFT: u32 = 40;
9768    /// Mask for the `MPAM` field.
9769    pub const MPAM_MASK: u64 = 0b1111;
9770    /// Offset of the `AMU` field.
9771    pub const AMU_SHIFT: u32 = 44;
9772    /// Mask for the `AMU` field.
9773    pub const AMU_MASK: u64 = 0b1111;
9774    /// Offset of the `DIT` field.
9775    pub const DIT_SHIFT: u32 = 48;
9776    /// Mask for the `DIT` field.
9777    pub const DIT_MASK: u64 = 0b1111;
9778    /// Offset of the `RME` field.
9779    pub const RME_SHIFT: u32 = 52;
9780    /// Mask for the `RME` field.
9781    pub const RME_MASK: u64 = 0b1111;
9782    /// Offset of the `CSV2` field.
9783    pub const CSV2_SHIFT: u32 = 56;
9784    /// Mask for the `CSV2` field.
9785    pub const CSV2_MASK: u64 = 0b1111;
9786    /// Offset of the `CSV3` field.
9787    pub const CSV3_SHIFT: u32 = 60;
9788    /// Mask for the `CSV3` field.
9789    pub const CSV3_MASK: u64 = 0b1111;
9790
9791    /// Returns the value of the `EL0` field.
9792    pub const fn el0(self) -> u8 {
9793        ((self.bits() >> Self::EL0_SHIFT) & 0b1111) as u8
9794    }
9795
9796    /// Sets the value of the `EL0` field.
9797    pub const fn set_el0(&mut self, value: u8) {
9798        let offset = Self::EL0_SHIFT;
9799        assert!(value & (Self::EL0_MASK as u8) == value);
9800        *self = Self::from_bits_retain(
9801            (self.bits() & !(Self::EL0_MASK << offset)) | ((value as u64) << offset),
9802        );
9803    }
9804
9805    /// Returns the value of the `EL1` field.
9806    pub const fn el1(self) -> u8 {
9807        ((self.bits() >> Self::EL1_SHIFT) & 0b1111) as u8
9808    }
9809
9810    /// Sets the value of the `EL1` field.
9811    pub const fn set_el1(&mut self, value: u8) {
9812        let offset = Self::EL1_SHIFT;
9813        assert!(value & (Self::EL1_MASK as u8) == value);
9814        *self = Self::from_bits_retain(
9815            (self.bits() & !(Self::EL1_MASK << offset)) | ((value as u64) << offset),
9816        );
9817    }
9818
9819    /// Returns the value of the `EL2` field.
9820    pub const fn el2(self) -> u8 {
9821        ((self.bits() >> Self::EL2_SHIFT) & 0b1111) as u8
9822    }
9823
9824    /// Sets the value of the `EL2` field.
9825    pub const fn set_el2(&mut self, value: u8) {
9826        let offset = Self::EL2_SHIFT;
9827        assert!(value & (Self::EL2_MASK as u8) == value);
9828        *self = Self::from_bits_retain(
9829            (self.bits() & !(Self::EL2_MASK << offset)) | ((value as u64) << offset),
9830        );
9831    }
9832
9833    /// Returns the value of the `EL3` field.
9834    pub const fn el3(self) -> u8 {
9835        ((self.bits() >> Self::EL3_SHIFT) & 0b1111) as u8
9836    }
9837
9838    /// Sets the value of the `EL3` field.
9839    pub const fn set_el3(&mut self, value: u8) {
9840        let offset = Self::EL3_SHIFT;
9841        assert!(value & (Self::EL3_MASK as u8) == value);
9842        *self = Self::from_bits_retain(
9843            (self.bits() & !(Self::EL3_MASK << offset)) | ((value as u64) << offset),
9844        );
9845    }
9846
9847    /// Returns the value of the `FP` field.
9848    pub const fn fp(self) -> u8 {
9849        ((self.bits() >> Self::FP_SHIFT) & 0b1111) as u8
9850    }
9851
9852    /// Sets the value of the `FP` field.
9853    pub const fn set_fp(&mut self, value: u8) {
9854        let offset = Self::FP_SHIFT;
9855        assert!(value & (Self::FP_MASK as u8) == value);
9856        *self = Self::from_bits_retain(
9857            (self.bits() & !(Self::FP_MASK << offset)) | ((value as u64) << offset),
9858        );
9859    }
9860
9861    /// Returns the value of the `AdvSIMD` field.
9862    pub const fn advsimd(self) -> u8 {
9863        ((self.bits() >> Self::ADVSIMD_SHIFT) & 0b1111) as u8
9864    }
9865
9866    /// Sets the value of the `AdvSIMD` field.
9867    pub const fn set_advsimd(&mut self, value: u8) {
9868        let offset = Self::ADVSIMD_SHIFT;
9869        assert!(value & (Self::ADVSIMD_MASK as u8) == value);
9870        *self = Self::from_bits_retain(
9871            (self.bits() & !(Self::ADVSIMD_MASK << offset)) | ((value as u64) << offset),
9872        );
9873    }
9874
9875    /// Returns the value of the `GIC` field.
9876    pub const fn gic(self) -> u8 {
9877        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
9878    }
9879
9880    /// Sets the value of the `GIC` field.
9881    pub const fn set_gic(&mut self, value: u8) {
9882        let offset = Self::GIC_SHIFT;
9883        assert!(value & (Self::GIC_MASK as u8) == value);
9884        *self = Self::from_bits_retain(
9885            (self.bits() & !(Self::GIC_MASK << offset)) | ((value as u64) << offset),
9886        );
9887    }
9888
9889    /// Returns the value of the `RAS` field.
9890    pub const fn ras(self) -> u8 {
9891        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
9892    }
9893
9894    /// Sets the value of the `RAS` field.
9895    pub const fn set_ras(&mut self, value: u8) {
9896        let offset = Self::RAS_SHIFT;
9897        assert!(value & (Self::RAS_MASK as u8) == value);
9898        *self = Self::from_bits_retain(
9899            (self.bits() & !(Self::RAS_MASK << offset)) | ((value as u64) << offset),
9900        );
9901    }
9902
9903    /// Returns the value of the `SVE` field.
9904    pub const fn sve(self) -> u8 {
9905        ((self.bits() >> Self::SVE_SHIFT) & 0b1111) as u8
9906    }
9907
9908    /// Sets the value of the `SVE` field.
9909    pub const fn set_sve(&mut self, value: u8) {
9910        let offset = Self::SVE_SHIFT;
9911        assert!(value & (Self::SVE_MASK as u8) == value);
9912        *self = Self::from_bits_retain(
9913            (self.bits() & !(Self::SVE_MASK << offset)) | ((value as u64) << offset),
9914        );
9915    }
9916
9917    /// Returns the value of the `SEL2` field.
9918    pub const fn sel2(self) -> u8 {
9919        ((self.bits() >> Self::SEL2_SHIFT) & 0b1111) as u8
9920    }
9921
9922    /// Sets the value of the `SEL2` field.
9923    pub const fn set_sel2(&mut self, value: u8) {
9924        let offset = Self::SEL2_SHIFT;
9925        assert!(value & (Self::SEL2_MASK as u8) == value);
9926        *self = Self::from_bits_retain(
9927            (self.bits() & !(Self::SEL2_MASK << offset)) | ((value as u64) << offset),
9928        );
9929    }
9930
9931    /// Returns the value of the `MPAM` field.
9932    pub const fn mpam(self) -> u8 {
9933        ((self.bits() >> Self::MPAM_SHIFT) & 0b1111) as u8
9934    }
9935
9936    /// Sets the value of the `MPAM` field.
9937    pub const fn set_mpam(&mut self, value: u8) {
9938        let offset = Self::MPAM_SHIFT;
9939        assert!(value & (Self::MPAM_MASK as u8) == value);
9940        *self = Self::from_bits_retain(
9941            (self.bits() & !(Self::MPAM_MASK << offset)) | ((value as u64) << offset),
9942        );
9943    }
9944
9945    /// Returns the value of the `AMU` field.
9946    pub const fn amu(self) -> u8 {
9947        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
9948    }
9949
9950    /// Sets the value of the `AMU` field.
9951    pub const fn set_amu(&mut self, value: u8) {
9952        let offset = Self::AMU_SHIFT;
9953        assert!(value & (Self::AMU_MASK as u8) == value);
9954        *self = Self::from_bits_retain(
9955            (self.bits() & !(Self::AMU_MASK << offset)) | ((value as u64) << offset),
9956        );
9957    }
9958
9959    /// Returns the value of the `DIT` field.
9960    pub const fn dit(self) -> u8 {
9961        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
9962    }
9963
9964    /// Sets the value of the `DIT` field.
9965    pub const fn set_dit(&mut self, value: u8) {
9966        let offset = Self::DIT_SHIFT;
9967        assert!(value & (Self::DIT_MASK as u8) == value);
9968        *self = Self::from_bits_retain(
9969            (self.bits() & !(Self::DIT_MASK << offset)) | ((value as u64) << offset),
9970        );
9971    }
9972
9973    /// Returns the value of the `RME` field.
9974    pub const fn rme(self) -> u8 {
9975        ((self.bits() >> Self::RME_SHIFT) & 0b1111) as u8
9976    }
9977
9978    /// Sets the value of the `RME` field.
9979    pub const fn set_rme(&mut self, value: u8) {
9980        let offset = Self::RME_SHIFT;
9981        assert!(value & (Self::RME_MASK as u8) == value);
9982        *self = Self::from_bits_retain(
9983            (self.bits() & !(Self::RME_MASK << offset)) | ((value as u64) << offset),
9984        );
9985    }
9986
9987    /// Returns the value of the `CSV2` field.
9988    pub const fn csv2(self) -> u8 {
9989        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
9990    }
9991
9992    /// Sets the value of the `CSV2` field.
9993    pub const fn set_csv2(&mut self, value: u8) {
9994        let offset = Self::CSV2_SHIFT;
9995        assert!(value & (Self::CSV2_MASK as u8) == value);
9996        *self = Self::from_bits_retain(
9997            (self.bits() & !(Self::CSV2_MASK << offset)) | ((value as u64) << offset),
9998        );
9999    }
10000
10001    /// Returns the value of the `CSV3` field.
10002    pub const fn csv3(self) -> u8 {
10003        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
10004    }
10005
10006    /// Sets the value of the `CSV3` field.
10007    pub const fn set_csv3(&mut self, value: u8) {
10008        let offset = Self::CSV3_SHIFT;
10009        assert!(value & (Self::CSV3_MASK as u8) == value);
10010        *self = Self::from_bits_retain(
10011            (self.bits() & !(Self::CSV3_MASK << offset)) | ((value as u64) << offset),
10012        );
10013    }
10014}
10015
10016#[cfg(feature = "el1")]
10017bitflags! {
10018    /// `ID_AA64PFR1_EL1` system register value.
10019    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10020    #[repr(transparent)]
10021    pub struct IdAa64pfr1El1: u64 {
10022    }
10023}
10024
10025#[cfg(feature = "el1")]
10026impl IdAa64pfr1El1 {
10027    /// Offset of the `BT` field.
10028    pub const BT_SHIFT: u32 = 0;
10029    /// Mask for the `BT` field.
10030    pub const BT_MASK: u64 = 0b1111;
10031    /// Offset of the `SSBS` field.
10032    pub const SSBS_SHIFT: u32 = 4;
10033    /// Mask for the `SSBS` field.
10034    pub const SSBS_MASK: u64 = 0b1111;
10035    /// Offset of the `MTE` field.
10036    pub const MTE_SHIFT: u32 = 8;
10037    /// Mask for the `MTE` field.
10038    pub const MTE_MASK: u64 = 0b1111;
10039    /// Offset of the `RAS_frac` field.
10040    pub const RAS_FRAC_SHIFT: u32 = 12;
10041    /// Mask for the `RAS_frac` field.
10042    pub const RAS_FRAC_MASK: u64 = 0b1111;
10043    /// Offset of the `MPAM_frac` field.
10044    pub const MPAM_FRAC_SHIFT: u32 = 16;
10045    /// Mask for the `MPAM_frac` field.
10046    pub const MPAM_FRAC_MASK: u64 = 0b1111;
10047    /// Offset of the `SME` field.
10048    pub const SME_SHIFT: u32 = 24;
10049    /// Mask for the `SME` field.
10050    pub const SME_MASK: u64 = 0b1111;
10051    /// Offset of the `RNDR_trap` field.
10052    pub const RNDR_TRAP_SHIFT: u32 = 28;
10053    /// Mask for the `RNDR_trap` field.
10054    pub const RNDR_TRAP_MASK: u64 = 0b1111;
10055    /// Offset of the `CSV2_frac` field.
10056    pub const CSV2_FRAC_SHIFT: u32 = 32;
10057    /// Mask for the `CSV2_frac` field.
10058    pub const CSV2_FRAC_MASK: u64 = 0b1111;
10059    /// Offset of the `NMI` field.
10060    pub const NMI_SHIFT: u32 = 36;
10061    /// Mask for the `NMI` field.
10062    pub const NMI_MASK: u64 = 0b1111;
10063    /// Offset of the `MTE_frac` field.
10064    pub const MTE_FRAC_SHIFT: u32 = 40;
10065    /// Mask for the `MTE_frac` field.
10066    pub const MTE_FRAC_MASK: u64 = 0b1111;
10067    /// Offset of the `GCS` field.
10068    pub const GCS_SHIFT: u32 = 44;
10069    /// Mask for the `GCS` field.
10070    pub const GCS_MASK: u64 = 0b1111;
10071    /// Offset of the `THE` field.
10072    pub const THE_SHIFT: u32 = 48;
10073    /// Mask for the `THE` field.
10074    pub const THE_MASK: u64 = 0b1111;
10075    /// Offset of the `MTEX` field.
10076    pub const MTEX_SHIFT: u32 = 52;
10077    /// Mask for the `MTEX` field.
10078    pub const MTEX_MASK: u64 = 0b1111;
10079    /// Offset of the `DF2` field.
10080    pub const DF2_SHIFT: u32 = 56;
10081    /// Mask for the `DF2` field.
10082    pub const DF2_MASK: u64 = 0b1111;
10083    /// Offset of the `PFAR` field.
10084    pub const PFAR_SHIFT: u32 = 60;
10085    /// Mask for the `PFAR` field.
10086    pub const PFAR_MASK: u64 = 0b1111;
10087
10088    /// Returns the value of the `BT` field.
10089    pub const fn bt(self) -> u8 {
10090        ((self.bits() >> Self::BT_SHIFT) & 0b1111) as u8
10091    }
10092
10093    /// Sets the value of the `BT` field.
10094    pub const fn set_bt(&mut self, value: u8) {
10095        let offset = Self::BT_SHIFT;
10096        assert!(value & (Self::BT_MASK as u8) == value);
10097        *self = Self::from_bits_retain(
10098            (self.bits() & !(Self::BT_MASK << offset)) | ((value as u64) << offset),
10099        );
10100    }
10101
10102    /// Returns the value of the `SSBS` field.
10103    pub const fn ssbs(self) -> u8 {
10104        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
10105    }
10106
10107    /// Sets the value of the `SSBS` field.
10108    pub const fn set_ssbs(&mut self, value: u8) {
10109        let offset = Self::SSBS_SHIFT;
10110        assert!(value & (Self::SSBS_MASK as u8) == value);
10111        *self = Self::from_bits_retain(
10112            (self.bits() & !(Self::SSBS_MASK << offset)) | ((value as u64) << offset),
10113        );
10114    }
10115
10116    /// Returns the value of the `MTE` field.
10117    pub const fn mte(self) -> u8 {
10118        ((self.bits() >> Self::MTE_SHIFT) & 0b1111) as u8
10119    }
10120
10121    /// Sets the value of the `MTE` field.
10122    pub const fn set_mte(&mut self, value: u8) {
10123        let offset = Self::MTE_SHIFT;
10124        assert!(value & (Self::MTE_MASK as u8) == value);
10125        *self = Self::from_bits_retain(
10126            (self.bits() & !(Self::MTE_MASK << offset)) | ((value as u64) << offset),
10127        );
10128    }
10129
10130    /// Returns the value of the `RAS_frac` field.
10131    pub const fn ras_frac(self) -> u8 {
10132        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
10133    }
10134
10135    /// Sets the value of the `RAS_frac` field.
10136    pub const fn set_ras_frac(&mut self, value: u8) {
10137        let offset = Self::RAS_FRAC_SHIFT;
10138        assert!(value & (Self::RAS_FRAC_MASK as u8) == value);
10139        *self = Self::from_bits_retain(
10140            (self.bits() & !(Self::RAS_FRAC_MASK << offset)) | ((value as u64) << offset),
10141        );
10142    }
10143
10144    /// Returns the value of the `MPAM_frac` field.
10145    pub const fn mpam_frac(self) -> u8 {
10146        ((self.bits() >> Self::MPAM_FRAC_SHIFT) & 0b1111) as u8
10147    }
10148
10149    /// Sets the value of the `MPAM_frac` field.
10150    pub const fn set_mpam_frac(&mut self, value: u8) {
10151        let offset = Self::MPAM_FRAC_SHIFT;
10152        assert!(value & (Self::MPAM_FRAC_MASK as u8) == value);
10153        *self = Self::from_bits_retain(
10154            (self.bits() & !(Self::MPAM_FRAC_MASK << offset)) | ((value as u64) << offset),
10155        );
10156    }
10157
10158    /// Returns the value of the `SME` field.
10159    pub const fn sme(self) -> u8 {
10160        ((self.bits() >> Self::SME_SHIFT) & 0b1111) as u8
10161    }
10162
10163    /// Sets the value of the `SME` field.
10164    pub const fn set_sme(&mut self, value: u8) {
10165        let offset = Self::SME_SHIFT;
10166        assert!(value & (Self::SME_MASK as u8) == value);
10167        *self = Self::from_bits_retain(
10168            (self.bits() & !(Self::SME_MASK << offset)) | ((value as u64) << offset),
10169        );
10170    }
10171
10172    /// Returns the value of the `RNDR_trap` field.
10173    pub const fn rndr_trap(self) -> u8 {
10174        ((self.bits() >> Self::RNDR_TRAP_SHIFT) & 0b1111) as u8
10175    }
10176
10177    /// Sets the value of the `RNDR_trap` field.
10178    pub const fn set_rndr_trap(&mut self, value: u8) {
10179        let offset = Self::RNDR_TRAP_SHIFT;
10180        assert!(value & (Self::RNDR_TRAP_MASK as u8) == value);
10181        *self = Self::from_bits_retain(
10182            (self.bits() & !(Self::RNDR_TRAP_MASK << offset)) | ((value as u64) << offset),
10183        );
10184    }
10185
10186    /// Returns the value of the `CSV2_frac` field.
10187    pub const fn csv2_frac(self) -> u8 {
10188        ((self.bits() >> Self::CSV2_FRAC_SHIFT) & 0b1111) as u8
10189    }
10190
10191    /// Sets the value of the `CSV2_frac` field.
10192    pub const fn set_csv2_frac(&mut self, value: u8) {
10193        let offset = Self::CSV2_FRAC_SHIFT;
10194        assert!(value & (Self::CSV2_FRAC_MASK as u8) == value);
10195        *self = Self::from_bits_retain(
10196            (self.bits() & !(Self::CSV2_FRAC_MASK << offset)) | ((value as u64) << offset),
10197        );
10198    }
10199
10200    /// Returns the value of the `NMI` field.
10201    pub const fn nmi(self) -> u8 {
10202        ((self.bits() >> Self::NMI_SHIFT) & 0b1111) as u8
10203    }
10204
10205    /// Sets the value of the `NMI` field.
10206    pub const fn set_nmi(&mut self, value: u8) {
10207        let offset = Self::NMI_SHIFT;
10208        assert!(value & (Self::NMI_MASK as u8) == value);
10209        *self = Self::from_bits_retain(
10210            (self.bits() & !(Self::NMI_MASK << offset)) | ((value as u64) << offset),
10211        );
10212    }
10213
10214    /// Returns the value of the `MTE_frac` field.
10215    pub const fn mte_frac(self) -> u8 {
10216        ((self.bits() >> Self::MTE_FRAC_SHIFT) & 0b1111) as u8
10217    }
10218
10219    /// Sets the value of the `MTE_frac` field.
10220    pub const fn set_mte_frac(&mut self, value: u8) {
10221        let offset = Self::MTE_FRAC_SHIFT;
10222        assert!(value & (Self::MTE_FRAC_MASK as u8) == value);
10223        *self = Self::from_bits_retain(
10224            (self.bits() & !(Self::MTE_FRAC_MASK << offset)) | ((value as u64) << offset),
10225        );
10226    }
10227
10228    /// Returns the value of the `GCS` field.
10229    pub const fn gcs(self) -> u8 {
10230        ((self.bits() >> Self::GCS_SHIFT) & 0b1111) as u8
10231    }
10232
10233    /// Sets the value of the `GCS` field.
10234    pub const fn set_gcs(&mut self, value: u8) {
10235        let offset = Self::GCS_SHIFT;
10236        assert!(value & (Self::GCS_MASK as u8) == value);
10237        *self = Self::from_bits_retain(
10238            (self.bits() & !(Self::GCS_MASK << offset)) | ((value as u64) << offset),
10239        );
10240    }
10241
10242    /// Returns the value of the `THE` field.
10243    pub const fn the(self) -> u8 {
10244        ((self.bits() >> Self::THE_SHIFT) & 0b1111) as u8
10245    }
10246
10247    /// Sets the value of the `THE` field.
10248    pub const fn set_the(&mut self, value: u8) {
10249        let offset = Self::THE_SHIFT;
10250        assert!(value & (Self::THE_MASK as u8) == value);
10251        *self = Self::from_bits_retain(
10252            (self.bits() & !(Self::THE_MASK << offset)) | ((value as u64) << offset),
10253        );
10254    }
10255
10256    /// Returns the value of the `MTEX` field.
10257    pub const fn mtex(self) -> u8 {
10258        ((self.bits() >> Self::MTEX_SHIFT) & 0b1111) as u8
10259    }
10260
10261    /// Sets the value of the `MTEX` field.
10262    pub const fn set_mtex(&mut self, value: u8) {
10263        let offset = Self::MTEX_SHIFT;
10264        assert!(value & (Self::MTEX_MASK as u8) == value);
10265        *self = Self::from_bits_retain(
10266            (self.bits() & !(Self::MTEX_MASK << offset)) | ((value as u64) << offset),
10267        );
10268    }
10269
10270    /// Returns the value of the `DF2` field.
10271    pub const fn df2(self) -> u8 {
10272        ((self.bits() >> Self::DF2_SHIFT) & 0b1111) as u8
10273    }
10274
10275    /// Sets the value of the `DF2` field.
10276    pub const fn set_df2(&mut self, value: u8) {
10277        let offset = Self::DF2_SHIFT;
10278        assert!(value & (Self::DF2_MASK as u8) == value);
10279        *self = Self::from_bits_retain(
10280            (self.bits() & !(Self::DF2_MASK << offset)) | ((value as u64) << offset),
10281        );
10282    }
10283
10284    /// Returns the value of the `PFAR` field.
10285    pub const fn pfar(self) -> u8 {
10286        ((self.bits() >> Self::PFAR_SHIFT) & 0b1111) as u8
10287    }
10288
10289    /// Sets the value of the `PFAR` field.
10290    pub const fn set_pfar(&mut self, value: u8) {
10291        let offset = Self::PFAR_SHIFT;
10292        assert!(value & (Self::PFAR_MASK as u8) == value);
10293        *self = Self::from_bits_retain(
10294            (self.bits() & !(Self::PFAR_MASK << offset)) | ((value as u64) << offset),
10295        );
10296    }
10297}
10298
10299#[cfg(feature = "el1")]
10300bitflags! {
10301    /// `ID_AA64SMFR0_EL1` system register value.
10302    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10303    #[repr(transparent)]
10304    pub struct IdAa64smfr0El1: u64 {
10305        /// `SMOP4` bit.
10306        const SMOP4 = 1 << 0;
10307        /// `STMOP` bit.
10308        const STMOP = 1 << 16;
10309        /// `SFEXPA` bit.
10310        const SFEXPA = 1 << 23;
10311        /// `AES` bit.
10312        const AES = 1 << 24;
10313        /// `SBitPerm` bit.
10314        const SBITPERM = 1 << 25;
10315        /// `SF8DP2` bit.
10316        const SF8DP2 = 1 << 28;
10317        /// `SF8DP4` bit.
10318        const SF8DP4 = 1 << 29;
10319        /// `SF8FMA` bit.
10320        const SF8FMA = 1 << 30;
10321        /// `F32F32` bit.
10322        const F32F32 = 1 << 32;
10323        /// `BI32I32` bit.
10324        const BI32I32 = 1 << 33;
10325        /// `B16F32` bit.
10326        const B16F32 = 1 << 34;
10327        /// `F16F32` bit.
10328        const F16F32 = 1 << 35;
10329        /// `F8F32` bit.
10330        const F8F32 = 1 << 40;
10331        /// `F8F16` bit.
10332        const F8F16 = 1 << 41;
10333        /// `F16F16` bit.
10334        const F16F16 = 1 << 42;
10335        /// `B16B16` bit.
10336        const B16B16 = 1 << 43;
10337        /// `F64F64` bit.
10338        const F64F64 = 1 << 48;
10339        /// `LUTv2` bit.
10340        const LUTV2 = 1 << 60;
10341        /// `LUT6` bit.
10342        const LUT6 = 1 << 61;
10343        /// `FA64` bit.
10344        const FA64 = 1 << 63;
10345    }
10346}
10347
10348#[cfg(feature = "el1")]
10349impl IdAa64smfr0El1 {
10350    /// Offset of the `SMOP4` field.
10351    pub const SMOP4_SHIFT: u32 = 0;
10352    /// Offset of the `STMOP` field.
10353    pub const STMOP_SHIFT: u32 = 16;
10354    /// Offset of the `SFEXPA` field.
10355    pub const SFEXPA_SHIFT: u32 = 23;
10356    /// Offset of the `AES` field.
10357    pub const AES_SHIFT: u32 = 24;
10358    /// Offset of the `SBitPerm` field.
10359    pub const SBITPERM_SHIFT: u32 = 25;
10360    /// Offset of the `SF8DP2` field.
10361    pub const SF8DP2_SHIFT: u32 = 28;
10362    /// Offset of the `SF8DP4` field.
10363    pub const SF8DP4_SHIFT: u32 = 29;
10364    /// Offset of the `SF8FMA` field.
10365    pub const SF8FMA_SHIFT: u32 = 30;
10366    /// Offset of the `F32F32` field.
10367    pub const F32F32_SHIFT: u32 = 32;
10368    /// Offset of the `BI32I32` field.
10369    pub const BI32I32_SHIFT: u32 = 33;
10370    /// Offset of the `B16F32` field.
10371    pub const B16F32_SHIFT: u32 = 34;
10372    /// Offset of the `F16F32` field.
10373    pub const F16F32_SHIFT: u32 = 35;
10374    /// Offset of the `I8I32` field.
10375    pub const I8I32_SHIFT: u32 = 36;
10376    /// Mask for the `I8I32` field.
10377    pub const I8I32_MASK: u64 = 0b1111;
10378    /// Offset of the `F8F32` field.
10379    pub const F8F32_SHIFT: u32 = 40;
10380    /// Offset of the `F8F16` field.
10381    pub const F8F16_SHIFT: u32 = 41;
10382    /// Offset of the `F16F16` field.
10383    pub const F16F16_SHIFT: u32 = 42;
10384    /// Offset of the `B16B16` field.
10385    pub const B16B16_SHIFT: u32 = 43;
10386    /// Offset of the `I16I32` field.
10387    pub const I16I32_SHIFT: u32 = 44;
10388    /// Mask for the `I16I32` field.
10389    pub const I16I32_MASK: u64 = 0b1111;
10390    /// Offset of the `F64F64` field.
10391    pub const F64F64_SHIFT: u32 = 48;
10392    /// Offset of the `I16I64` field.
10393    pub const I16I64_SHIFT: u32 = 52;
10394    /// Mask for the `I16I64` field.
10395    pub const I16I64_MASK: u64 = 0b1111;
10396    /// Offset of the `SMEver` field.
10397    pub const SMEVER_SHIFT: u32 = 56;
10398    /// Mask for the `SMEver` field.
10399    pub const SMEVER_MASK: u64 = 0b1111;
10400    /// Offset of the `LUTv2` field.
10401    pub const LUTV2_SHIFT: u32 = 60;
10402    /// Offset of the `LUT6` field.
10403    pub const LUT6_SHIFT: u32 = 61;
10404    /// Offset of the `FA64` field.
10405    pub const FA64_SHIFT: u32 = 63;
10406
10407    /// Returns the value of the `I8I32` field.
10408    pub const fn i8i32(self) -> u8 {
10409        ((self.bits() >> Self::I8I32_SHIFT) & 0b1111) as u8
10410    }
10411
10412    /// Sets the value of the `I8I32` field.
10413    pub const fn set_i8i32(&mut self, value: u8) {
10414        let offset = Self::I8I32_SHIFT;
10415        assert!(value & (Self::I8I32_MASK as u8) == value);
10416        *self = Self::from_bits_retain(
10417            (self.bits() & !(Self::I8I32_MASK << offset)) | ((value as u64) << offset),
10418        );
10419    }
10420
10421    /// Returns the value of the `I16I32` field.
10422    pub const fn i16i32(self) -> u8 {
10423        ((self.bits() >> Self::I16I32_SHIFT) & 0b1111) as u8
10424    }
10425
10426    /// Sets the value of the `I16I32` field.
10427    pub const fn set_i16i32(&mut self, value: u8) {
10428        let offset = Self::I16I32_SHIFT;
10429        assert!(value & (Self::I16I32_MASK as u8) == value);
10430        *self = Self::from_bits_retain(
10431            (self.bits() & !(Self::I16I32_MASK << offset)) | ((value as u64) << offset),
10432        );
10433    }
10434
10435    /// Returns the value of the `I16I64` field.
10436    pub const fn i16i64(self) -> u8 {
10437        ((self.bits() >> Self::I16I64_SHIFT) & 0b1111) as u8
10438    }
10439
10440    /// Sets the value of the `I16I64` field.
10441    pub const fn set_i16i64(&mut self, value: u8) {
10442        let offset = Self::I16I64_SHIFT;
10443        assert!(value & (Self::I16I64_MASK as u8) == value);
10444        *self = Self::from_bits_retain(
10445            (self.bits() & !(Self::I16I64_MASK << offset)) | ((value as u64) << offset),
10446        );
10447    }
10448
10449    /// Returns the value of the `SMEver` field.
10450    pub const fn smever(self) -> u8 {
10451        ((self.bits() >> Self::SMEVER_SHIFT) & 0b1111) as u8
10452    }
10453
10454    /// Sets the value of the `SMEver` field.
10455    pub const fn set_smever(&mut self, value: u8) {
10456        let offset = Self::SMEVER_SHIFT;
10457        assert!(value & (Self::SMEVER_MASK as u8) == value);
10458        *self = Self::from_bits_retain(
10459            (self.bits() & !(Self::SMEVER_MASK << offset)) | ((value as u64) << offset),
10460        );
10461    }
10462}
10463
10464bitflags! {
10465    /// `ID_DFR0` system register value.
10466    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10467    #[repr(transparent)]
10468    pub struct IdDfr0: u32 {
10469    }
10470}
10471
10472impl IdDfr0 {
10473    /// Offset of the `CopDbg` field.
10474    pub const COPDBG_SHIFT: u32 = 0;
10475    /// Mask for the `CopDbg` field.
10476    pub const COPDBG_MASK: u32 = 0b1111;
10477    /// Offset of the `CopSDbg` field.
10478    pub const COPSDBG_SHIFT: u32 = 4;
10479    /// Mask for the `CopSDbg` field.
10480    pub const COPSDBG_MASK: u32 = 0b1111;
10481    /// Offset of the `MMapDbg` field.
10482    pub const MMAPDBG_SHIFT: u32 = 8;
10483    /// Mask for the `MMapDbg` field.
10484    pub const MMAPDBG_MASK: u32 = 0b1111;
10485    /// Offset of the `CopTrc` field.
10486    pub const COPTRC_SHIFT: u32 = 12;
10487    /// Mask for the `CopTrc` field.
10488    pub const COPTRC_MASK: u32 = 0b1111;
10489    /// Offset of the `MMapTrc` field.
10490    pub const MMAPTRC_SHIFT: u32 = 16;
10491    /// Mask for the `MMapTrc` field.
10492    pub const MMAPTRC_MASK: u32 = 0b1111;
10493    /// Offset of the `MProfDbg` field.
10494    pub const MPROFDBG_SHIFT: u32 = 20;
10495    /// Mask for the `MProfDbg` field.
10496    pub const MPROFDBG_MASK: u32 = 0b1111;
10497    /// Offset of the `PerfMon` field.
10498    pub const PERFMON_SHIFT: u32 = 24;
10499    /// Mask for the `PerfMon` field.
10500    pub const PERFMON_MASK: u32 = 0b1111;
10501    /// Offset of the `TraceFilt` field.
10502    pub const TRACEFILT_SHIFT: u32 = 28;
10503    /// Mask for the `TraceFilt` field.
10504    pub const TRACEFILT_MASK: u32 = 0b1111;
10505
10506    /// Returns the value of the `CopDbg` field.
10507    pub const fn copdbg(self) -> u8 {
10508        ((self.bits() >> Self::COPDBG_SHIFT) & 0b1111) as u8
10509    }
10510
10511    /// Sets the value of the `CopDbg` field.
10512    pub const fn set_copdbg(&mut self, value: u8) {
10513        let offset = Self::COPDBG_SHIFT;
10514        assert!(value & (Self::COPDBG_MASK as u8) == value);
10515        *self = Self::from_bits_retain(
10516            (self.bits() & !(Self::COPDBG_MASK << offset)) | ((value as u32) << offset),
10517        );
10518    }
10519
10520    /// Returns the value of the `CopSDbg` field.
10521    pub const fn copsdbg(self) -> u8 {
10522        ((self.bits() >> Self::COPSDBG_SHIFT) & 0b1111) as u8
10523    }
10524
10525    /// Sets the value of the `CopSDbg` field.
10526    pub const fn set_copsdbg(&mut self, value: u8) {
10527        let offset = Self::COPSDBG_SHIFT;
10528        assert!(value & (Self::COPSDBG_MASK as u8) == value);
10529        *self = Self::from_bits_retain(
10530            (self.bits() & !(Self::COPSDBG_MASK << offset)) | ((value as u32) << offset),
10531        );
10532    }
10533
10534    /// Returns the value of the `MMapDbg` field.
10535    pub const fn mmapdbg(self) -> u8 {
10536        ((self.bits() >> Self::MMAPDBG_SHIFT) & 0b1111) as u8
10537    }
10538
10539    /// Sets the value of the `MMapDbg` field.
10540    pub const fn set_mmapdbg(&mut self, value: u8) {
10541        let offset = Self::MMAPDBG_SHIFT;
10542        assert!(value & (Self::MMAPDBG_MASK as u8) == value);
10543        *self = Self::from_bits_retain(
10544            (self.bits() & !(Self::MMAPDBG_MASK << offset)) | ((value as u32) << offset),
10545        );
10546    }
10547
10548    /// Returns the value of the `CopTrc` field.
10549    pub const fn coptrc(self) -> u8 {
10550        ((self.bits() >> Self::COPTRC_SHIFT) & 0b1111) as u8
10551    }
10552
10553    /// Sets the value of the `CopTrc` field.
10554    pub const fn set_coptrc(&mut self, value: u8) {
10555        let offset = Self::COPTRC_SHIFT;
10556        assert!(value & (Self::COPTRC_MASK as u8) == value);
10557        *self = Self::from_bits_retain(
10558            (self.bits() & !(Self::COPTRC_MASK << offset)) | ((value as u32) << offset),
10559        );
10560    }
10561
10562    /// Returns the value of the `MMapTrc` field.
10563    pub const fn mmaptrc(self) -> u8 {
10564        ((self.bits() >> Self::MMAPTRC_SHIFT) & 0b1111) as u8
10565    }
10566
10567    /// Sets the value of the `MMapTrc` field.
10568    pub const fn set_mmaptrc(&mut self, value: u8) {
10569        let offset = Self::MMAPTRC_SHIFT;
10570        assert!(value & (Self::MMAPTRC_MASK as u8) == value);
10571        *self = Self::from_bits_retain(
10572            (self.bits() & !(Self::MMAPTRC_MASK << offset)) | ((value as u32) << offset),
10573        );
10574    }
10575
10576    /// Returns the value of the `MProfDbg` field.
10577    pub const fn mprofdbg(self) -> u8 {
10578        ((self.bits() >> Self::MPROFDBG_SHIFT) & 0b1111) as u8
10579    }
10580
10581    /// Sets the value of the `MProfDbg` field.
10582    pub const fn set_mprofdbg(&mut self, value: u8) {
10583        let offset = Self::MPROFDBG_SHIFT;
10584        assert!(value & (Self::MPROFDBG_MASK as u8) == value);
10585        *self = Self::from_bits_retain(
10586            (self.bits() & !(Self::MPROFDBG_MASK << offset)) | ((value as u32) << offset),
10587        );
10588    }
10589
10590    /// Returns the value of the `PerfMon` field.
10591    pub const fn perfmon(self) -> u8 {
10592        ((self.bits() >> Self::PERFMON_SHIFT) & 0b1111) as u8
10593    }
10594
10595    /// Sets the value of the `PerfMon` field.
10596    pub const fn set_perfmon(&mut self, value: u8) {
10597        let offset = Self::PERFMON_SHIFT;
10598        assert!(value & (Self::PERFMON_MASK as u8) == value);
10599        *self = Self::from_bits_retain(
10600            (self.bits() & !(Self::PERFMON_MASK << offset)) | ((value as u32) << offset),
10601        );
10602    }
10603
10604    /// Returns the value of the `TraceFilt` field.
10605    pub const fn tracefilt(self) -> u8 {
10606        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
10607    }
10608
10609    /// Sets the value of the `TraceFilt` field.
10610    pub const fn set_tracefilt(&mut self, value: u8) {
10611        let offset = Self::TRACEFILT_SHIFT;
10612        assert!(value & (Self::TRACEFILT_MASK as u8) == value);
10613        *self = Self::from_bits_retain(
10614            (self.bits() & !(Self::TRACEFILT_MASK << offset)) | ((value as u32) << offset),
10615        );
10616    }
10617}
10618
10619bitflags! {
10620    /// `ID_DFR1` system register value.
10621    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10622    #[repr(transparent)]
10623    pub struct IdDfr1: u32 {
10624    }
10625}
10626
10627impl IdDfr1 {
10628    /// Offset of the `MTPMU` field.
10629    pub const MTPMU_SHIFT: u32 = 0;
10630    /// Mask for the `MTPMU` field.
10631    pub const MTPMU_MASK: u32 = 0b1111;
10632    /// Offset of the `HPMN0` field.
10633    pub const HPMN0_SHIFT: u32 = 4;
10634    /// Mask for the `HPMN0` field.
10635    pub const HPMN0_MASK: u32 = 0b1111;
10636
10637    /// Returns the value of the `MTPMU` field.
10638    pub const fn mtpmu(self) -> u8 {
10639        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
10640    }
10641
10642    /// Sets the value of the `MTPMU` field.
10643    pub const fn set_mtpmu(&mut self, value: u8) {
10644        let offset = Self::MTPMU_SHIFT;
10645        assert!(value & (Self::MTPMU_MASK as u8) == value);
10646        *self = Self::from_bits_retain(
10647            (self.bits() & !(Self::MTPMU_MASK << offset)) | ((value as u32) << offset),
10648        );
10649    }
10650
10651    /// Returns the value of the `HPMN0` field.
10652    pub const fn hpmn0(self) -> u8 {
10653        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
10654    }
10655
10656    /// Sets the value of the `HPMN0` field.
10657    pub const fn set_hpmn0(&mut self, value: u8) {
10658        let offset = Self::HPMN0_SHIFT;
10659        assert!(value & (Self::HPMN0_MASK as u8) == value);
10660        *self = Self::from_bits_retain(
10661            (self.bits() & !(Self::HPMN0_MASK << offset)) | ((value as u32) << offset),
10662        );
10663    }
10664}
10665
10666bitflags! {
10667    /// `ID_ISAR0` system register value.
10668    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10669    #[repr(transparent)]
10670    pub struct IdIsar0: u32 {
10671    }
10672}
10673
10674impl IdIsar0 {
10675    /// Offset of the `Swap` field.
10676    pub const SWAP_SHIFT: u32 = 0;
10677    /// Mask for the `Swap` field.
10678    pub const SWAP_MASK: u32 = 0b1111;
10679    /// Offset of the `BitCount` field.
10680    pub const BITCOUNT_SHIFT: u32 = 4;
10681    /// Mask for the `BitCount` field.
10682    pub const BITCOUNT_MASK: u32 = 0b1111;
10683    /// Offset of the `BitField` field.
10684    pub const BITFIELD_SHIFT: u32 = 8;
10685    /// Mask for the `BitField` field.
10686    pub const BITFIELD_MASK: u32 = 0b1111;
10687    /// Offset of the `CmpBranch` field.
10688    pub const CMPBRANCH_SHIFT: u32 = 12;
10689    /// Mask for the `CmpBranch` field.
10690    pub const CMPBRANCH_MASK: u32 = 0b1111;
10691    /// Offset of the `Coproc` field.
10692    pub const COPROC_SHIFT: u32 = 16;
10693    /// Mask for the `Coproc` field.
10694    pub const COPROC_MASK: u32 = 0b1111;
10695    /// Offset of the `Debug` field.
10696    pub const DEBUG_SHIFT: u32 = 20;
10697    /// Mask for the `Debug` field.
10698    pub const DEBUG_MASK: u32 = 0b1111;
10699    /// Offset of the `Divide` field.
10700    pub const DIVIDE_SHIFT: u32 = 24;
10701    /// Mask for the `Divide` field.
10702    pub const DIVIDE_MASK: u32 = 0b1111;
10703
10704    /// Returns the value of the `Swap` field.
10705    pub const fn swap(self) -> u8 {
10706        ((self.bits() >> Self::SWAP_SHIFT) & 0b1111) as u8
10707    }
10708
10709    /// Sets the value of the `Swap` field.
10710    pub const fn set_swap(&mut self, value: u8) {
10711        let offset = Self::SWAP_SHIFT;
10712        assert!(value & (Self::SWAP_MASK as u8) == value);
10713        *self = Self::from_bits_retain(
10714            (self.bits() & !(Self::SWAP_MASK << offset)) | ((value as u32) << offset),
10715        );
10716    }
10717
10718    /// Returns the value of the `BitCount` field.
10719    pub const fn bitcount(self) -> u8 {
10720        ((self.bits() >> Self::BITCOUNT_SHIFT) & 0b1111) as u8
10721    }
10722
10723    /// Sets the value of the `BitCount` field.
10724    pub const fn set_bitcount(&mut self, value: u8) {
10725        let offset = Self::BITCOUNT_SHIFT;
10726        assert!(value & (Self::BITCOUNT_MASK as u8) == value);
10727        *self = Self::from_bits_retain(
10728            (self.bits() & !(Self::BITCOUNT_MASK << offset)) | ((value as u32) << offset),
10729        );
10730    }
10731
10732    /// Returns the value of the `BitField` field.
10733    pub const fn bitfield(self) -> u8 {
10734        ((self.bits() >> Self::BITFIELD_SHIFT) & 0b1111) as u8
10735    }
10736
10737    /// Sets the value of the `BitField` field.
10738    pub const fn set_bitfield(&mut self, value: u8) {
10739        let offset = Self::BITFIELD_SHIFT;
10740        assert!(value & (Self::BITFIELD_MASK as u8) == value);
10741        *self = Self::from_bits_retain(
10742            (self.bits() & !(Self::BITFIELD_MASK << offset)) | ((value as u32) << offset),
10743        );
10744    }
10745
10746    /// Returns the value of the `CmpBranch` field.
10747    pub const fn cmpbranch(self) -> u8 {
10748        ((self.bits() >> Self::CMPBRANCH_SHIFT) & 0b1111) as u8
10749    }
10750
10751    /// Sets the value of the `CmpBranch` field.
10752    pub const fn set_cmpbranch(&mut self, value: u8) {
10753        let offset = Self::CMPBRANCH_SHIFT;
10754        assert!(value & (Self::CMPBRANCH_MASK as u8) == value);
10755        *self = Self::from_bits_retain(
10756            (self.bits() & !(Self::CMPBRANCH_MASK << offset)) | ((value as u32) << offset),
10757        );
10758    }
10759
10760    /// Returns the value of the `Coproc` field.
10761    pub const fn coproc(self) -> u8 {
10762        ((self.bits() >> Self::COPROC_SHIFT) & 0b1111) as u8
10763    }
10764
10765    /// Sets the value of the `Coproc` field.
10766    pub const fn set_coproc(&mut self, value: u8) {
10767        let offset = Self::COPROC_SHIFT;
10768        assert!(value & (Self::COPROC_MASK as u8) == value);
10769        *self = Self::from_bits_retain(
10770            (self.bits() & !(Self::COPROC_MASK << offset)) | ((value as u32) << offset),
10771        );
10772    }
10773
10774    /// Returns the value of the `Debug` field.
10775    pub const fn debug(self) -> u8 {
10776        ((self.bits() >> Self::DEBUG_SHIFT) & 0b1111) as u8
10777    }
10778
10779    /// Sets the value of the `Debug` field.
10780    pub const fn set_debug(&mut self, value: u8) {
10781        let offset = Self::DEBUG_SHIFT;
10782        assert!(value & (Self::DEBUG_MASK as u8) == value);
10783        *self = Self::from_bits_retain(
10784            (self.bits() & !(Self::DEBUG_MASK << offset)) | ((value as u32) << offset),
10785        );
10786    }
10787
10788    /// Returns the value of the `Divide` field.
10789    pub const fn divide(self) -> u8 {
10790        ((self.bits() >> Self::DIVIDE_SHIFT) & 0b1111) as u8
10791    }
10792
10793    /// Sets the value of the `Divide` field.
10794    pub const fn set_divide(&mut self, value: u8) {
10795        let offset = Self::DIVIDE_SHIFT;
10796        assert!(value & (Self::DIVIDE_MASK as u8) == value);
10797        *self = Self::from_bits_retain(
10798            (self.bits() & !(Self::DIVIDE_MASK << offset)) | ((value as u32) << offset),
10799        );
10800    }
10801}
10802
10803bitflags! {
10804    /// `ID_ISAR1` system register value.
10805    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10806    #[repr(transparent)]
10807    pub struct IdIsar1: u32 {
10808    }
10809}
10810
10811impl IdIsar1 {
10812    /// Offset of the `Endian` field.
10813    pub const ENDIAN_SHIFT: u32 = 0;
10814    /// Mask for the `Endian` field.
10815    pub const ENDIAN_MASK: u32 = 0b1111;
10816    /// Offset of the `Except` field.
10817    pub const EXCEPT_SHIFT: u32 = 4;
10818    /// Mask for the `Except` field.
10819    pub const EXCEPT_MASK: u32 = 0b1111;
10820    /// Offset of the `Except_AR` field.
10821    pub const EXCEPT_AR_SHIFT: u32 = 8;
10822    /// Mask for the `Except_AR` field.
10823    pub const EXCEPT_AR_MASK: u32 = 0b1111;
10824    /// Offset of the `Extend` field.
10825    pub const EXTEND_SHIFT: u32 = 12;
10826    /// Mask for the `Extend` field.
10827    pub const EXTEND_MASK: u32 = 0b1111;
10828    /// Offset of the `IfThen` field.
10829    pub const IFTHEN_SHIFT: u32 = 16;
10830    /// Mask for the `IfThen` field.
10831    pub const IFTHEN_MASK: u32 = 0b1111;
10832    /// Offset of the `Immediate` field.
10833    pub const IMMEDIATE_SHIFT: u32 = 20;
10834    /// Mask for the `Immediate` field.
10835    pub const IMMEDIATE_MASK: u32 = 0b1111;
10836    /// Offset of the `Interwork` field.
10837    pub const INTERWORK_SHIFT: u32 = 24;
10838    /// Mask for the `Interwork` field.
10839    pub const INTERWORK_MASK: u32 = 0b1111;
10840    /// Offset of the `Jazelle` field.
10841    pub const JAZELLE_SHIFT: u32 = 28;
10842    /// Mask for the `Jazelle` field.
10843    pub const JAZELLE_MASK: u32 = 0b1111;
10844
10845    /// Returns the value of the `Endian` field.
10846    pub const fn endian(self) -> u8 {
10847        ((self.bits() >> Self::ENDIAN_SHIFT) & 0b1111) as u8
10848    }
10849
10850    /// Sets the value of the `Endian` field.
10851    pub const fn set_endian(&mut self, value: u8) {
10852        let offset = Self::ENDIAN_SHIFT;
10853        assert!(value & (Self::ENDIAN_MASK as u8) == value);
10854        *self = Self::from_bits_retain(
10855            (self.bits() & !(Self::ENDIAN_MASK << offset)) | ((value as u32) << offset),
10856        );
10857    }
10858
10859    /// Returns the value of the `Except` field.
10860    pub const fn except(self) -> u8 {
10861        ((self.bits() >> Self::EXCEPT_SHIFT) & 0b1111) as u8
10862    }
10863
10864    /// Sets the value of the `Except` field.
10865    pub const fn set_except(&mut self, value: u8) {
10866        let offset = Self::EXCEPT_SHIFT;
10867        assert!(value & (Self::EXCEPT_MASK as u8) == value);
10868        *self = Self::from_bits_retain(
10869            (self.bits() & !(Self::EXCEPT_MASK << offset)) | ((value as u32) << offset),
10870        );
10871    }
10872
10873    /// Returns the value of the `Except_AR` field.
10874    pub const fn except_ar(self) -> u8 {
10875        ((self.bits() >> Self::EXCEPT_AR_SHIFT) & 0b1111) as u8
10876    }
10877
10878    /// Sets the value of the `Except_AR` field.
10879    pub const fn set_except_ar(&mut self, value: u8) {
10880        let offset = Self::EXCEPT_AR_SHIFT;
10881        assert!(value & (Self::EXCEPT_AR_MASK as u8) == value);
10882        *self = Self::from_bits_retain(
10883            (self.bits() & !(Self::EXCEPT_AR_MASK << offset)) | ((value as u32) << offset),
10884        );
10885    }
10886
10887    /// Returns the value of the `Extend` field.
10888    pub const fn extend_(self) -> u8 {
10889        ((self.bits() >> Self::EXTEND_SHIFT) & 0b1111) as u8
10890    }
10891
10892    /// Sets the value of the `Extend` field.
10893    pub const fn set_extend_(&mut self, value: u8) {
10894        let offset = Self::EXTEND_SHIFT;
10895        assert!(value & (Self::EXTEND_MASK as u8) == value);
10896        *self = Self::from_bits_retain(
10897            (self.bits() & !(Self::EXTEND_MASK << offset)) | ((value as u32) << offset),
10898        );
10899    }
10900
10901    /// Returns the value of the `IfThen` field.
10902    pub const fn ifthen(self) -> u8 {
10903        ((self.bits() >> Self::IFTHEN_SHIFT) & 0b1111) as u8
10904    }
10905
10906    /// Sets the value of the `IfThen` field.
10907    pub const fn set_ifthen(&mut self, value: u8) {
10908        let offset = Self::IFTHEN_SHIFT;
10909        assert!(value & (Self::IFTHEN_MASK as u8) == value);
10910        *self = Self::from_bits_retain(
10911            (self.bits() & !(Self::IFTHEN_MASK << offset)) | ((value as u32) << offset),
10912        );
10913    }
10914
10915    /// Returns the value of the `Immediate` field.
10916    pub const fn immediate(self) -> u8 {
10917        ((self.bits() >> Self::IMMEDIATE_SHIFT) & 0b1111) as u8
10918    }
10919
10920    /// Sets the value of the `Immediate` field.
10921    pub const fn set_immediate(&mut self, value: u8) {
10922        let offset = Self::IMMEDIATE_SHIFT;
10923        assert!(value & (Self::IMMEDIATE_MASK as u8) == value);
10924        *self = Self::from_bits_retain(
10925            (self.bits() & !(Self::IMMEDIATE_MASK << offset)) | ((value as u32) << offset),
10926        );
10927    }
10928
10929    /// Returns the value of the `Interwork` field.
10930    pub const fn interwork(self) -> u8 {
10931        ((self.bits() >> Self::INTERWORK_SHIFT) & 0b1111) as u8
10932    }
10933
10934    /// Sets the value of the `Interwork` field.
10935    pub const fn set_interwork(&mut self, value: u8) {
10936        let offset = Self::INTERWORK_SHIFT;
10937        assert!(value & (Self::INTERWORK_MASK as u8) == value);
10938        *self = Self::from_bits_retain(
10939            (self.bits() & !(Self::INTERWORK_MASK << offset)) | ((value as u32) << offset),
10940        );
10941    }
10942
10943    /// Returns the value of the `Jazelle` field.
10944    pub const fn jazelle(self) -> u8 {
10945        ((self.bits() >> Self::JAZELLE_SHIFT) & 0b1111) as u8
10946    }
10947
10948    /// Sets the value of the `Jazelle` field.
10949    pub const fn set_jazelle(&mut self, value: u8) {
10950        let offset = Self::JAZELLE_SHIFT;
10951        assert!(value & (Self::JAZELLE_MASK as u8) == value);
10952        *self = Self::from_bits_retain(
10953            (self.bits() & !(Self::JAZELLE_MASK << offset)) | ((value as u32) << offset),
10954        );
10955    }
10956}
10957
10958bitflags! {
10959    /// `ID_ISAR2` system register value.
10960    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10961    #[repr(transparent)]
10962    pub struct IdIsar2: u32 {
10963    }
10964}
10965
10966impl IdIsar2 {
10967    /// Offset of the `LoadStore` field.
10968    pub const LOADSTORE_SHIFT: u32 = 0;
10969    /// Mask for the `LoadStore` field.
10970    pub const LOADSTORE_MASK: u32 = 0b1111;
10971    /// Offset of the `MemHint` field.
10972    pub const MEMHINT_SHIFT: u32 = 4;
10973    /// Mask for the `MemHint` field.
10974    pub const MEMHINT_MASK: u32 = 0b1111;
10975    /// Offset of the `MultiAccessInt` field.
10976    pub const MULTIACCESSINT_SHIFT: u32 = 8;
10977    /// Mask for the `MultiAccessInt` field.
10978    pub const MULTIACCESSINT_MASK: u32 = 0b1111;
10979    /// Offset of the `Mult` field.
10980    pub const MULT_SHIFT: u32 = 12;
10981    /// Mask for the `Mult` field.
10982    pub const MULT_MASK: u32 = 0b1111;
10983    /// Offset of the `MultS` field.
10984    pub const MULTS_SHIFT: u32 = 16;
10985    /// Mask for the `MultS` field.
10986    pub const MULTS_MASK: u32 = 0b1111;
10987    /// Offset of the `MultU` field.
10988    pub const MULTU_SHIFT: u32 = 20;
10989    /// Mask for the `MultU` field.
10990    pub const MULTU_MASK: u32 = 0b1111;
10991    /// Offset of the `PSR_AR` field.
10992    pub const PSR_AR_SHIFT: u32 = 24;
10993    /// Mask for the `PSR_AR` field.
10994    pub const PSR_AR_MASK: u32 = 0b1111;
10995    /// Offset of the `Reversal` field.
10996    pub const REVERSAL_SHIFT: u32 = 28;
10997    /// Mask for the `Reversal` field.
10998    pub const REVERSAL_MASK: u32 = 0b1111;
10999
11000    /// Returns the value of the `LoadStore` field.
11001    pub const fn loadstore(self) -> u8 {
11002        ((self.bits() >> Self::LOADSTORE_SHIFT) & 0b1111) as u8
11003    }
11004
11005    /// Sets the value of the `LoadStore` field.
11006    pub const fn set_loadstore(&mut self, value: u8) {
11007        let offset = Self::LOADSTORE_SHIFT;
11008        assert!(value & (Self::LOADSTORE_MASK as u8) == value);
11009        *self = Self::from_bits_retain(
11010            (self.bits() & !(Self::LOADSTORE_MASK << offset)) | ((value as u32) << offset),
11011        );
11012    }
11013
11014    /// Returns the value of the `MemHint` field.
11015    pub const fn memhint(self) -> u8 {
11016        ((self.bits() >> Self::MEMHINT_SHIFT) & 0b1111) as u8
11017    }
11018
11019    /// Sets the value of the `MemHint` field.
11020    pub const fn set_memhint(&mut self, value: u8) {
11021        let offset = Self::MEMHINT_SHIFT;
11022        assert!(value & (Self::MEMHINT_MASK as u8) == value);
11023        *self = Self::from_bits_retain(
11024            (self.bits() & !(Self::MEMHINT_MASK << offset)) | ((value as u32) << offset),
11025        );
11026    }
11027
11028    /// Returns the value of the `MultiAccessInt` field.
11029    pub const fn multiaccessint(self) -> u8 {
11030        ((self.bits() >> Self::MULTIACCESSINT_SHIFT) & 0b1111) as u8
11031    }
11032
11033    /// Sets the value of the `MultiAccessInt` field.
11034    pub const fn set_multiaccessint(&mut self, value: u8) {
11035        let offset = Self::MULTIACCESSINT_SHIFT;
11036        assert!(value & (Self::MULTIACCESSINT_MASK as u8) == value);
11037        *self = Self::from_bits_retain(
11038            (self.bits() & !(Self::MULTIACCESSINT_MASK << offset)) | ((value as u32) << offset),
11039        );
11040    }
11041
11042    /// Returns the value of the `Mult` field.
11043    pub const fn mult(self) -> u8 {
11044        ((self.bits() >> Self::MULT_SHIFT) & 0b1111) as u8
11045    }
11046
11047    /// Sets the value of the `Mult` field.
11048    pub const fn set_mult(&mut self, value: u8) {
11049        let offset = Self::MULT_SHIFT;
11050        assert!(value & (Self::MULT_MASK as u8) == value);
11051        *self = Self::from_bits_retain(
11052            (self.bits() & !(Self::MULT_MASK << offset)) | ((value as u32) << offset),
11053        );
11054    }
11055
11056    /// Returns the value of the `MultS` field.
11057    pub const fn mults(self) -> u8 {
11058        ((self.bits() >> Self::MULTS_SHIFT) & 0b1111) as u8
11059    }
11060
11061    /// Sets the value of the `MultS` field.
11062    pub const fn set_mults(&mut self, value: u8) {
11063        let offset = Self::MULTS_SHIFT;
11064        assert!(value & (Self::MULTS_MASK as u8) == value);
11065        *self = Self::from_bits_retain(
11066            (self.bits() & !(Self::MULTS_MASK << offset)) | ((value as u32) << offset),
11067        );
11068    }
11069
11070    /// Returns the value of the `MultU` field.
11071    pub const fn multu(self) -> u8 {
11072        ((self.bits() >> Self::MULTU_SHIFT) & 0b1111) as u8
11073    }
11074
11075    /// Sets the value of the `MultU` field.
11076    pub const fn set_multu(&mut self, value: u8) {
11077        let offset = Self::MULTU_SHIFT;
11078        assert!(value & (Self::MULTU_MASK as u8) == value);
11079        *self = Self::from_bits_retain(
11080            (self.bits() & !(Self::MULTU_MASK << offset)) | ((value as u32) << offset),
11081        );
11082    }
11083
11084    /// Returns the value of the `PSR_AR` field.
11085    pub const fn psr_ar(self) -> u8 {
11086        ((self.bits() >> Self::PSR_AR_SHIFT) & 0b1111) as u8
11087    }
11088
11089    /// Sets the value of the `PSR_AR` field.
11090    pub const fn set_psr_ar(&mut self, value: u8) {
11091        let offset = Self::PSR_AR_SHIFT;
11092        assert!(value & (Self::PSR_AR_MASK as u8) == value);
11093        *self = Self::from_bits_retain(
11094            (self.bits() & !(Self::PSR_AR_MASK << offset)) | ((value as u32) << offset),
11095        );
11096    }
11097
11098    /// Returns the value of the `Reversal` field.
11099    pub const fn reversal(self) -> u8 {
11100        ((self.bits() >> Self::REVERSAL_SHIFT) & 0b1111) as u8
11101    }
11102
11103    /// Sets the value of the `Reversal` field.
11104    pub const fn set_reversal(&mut self, value: u8) {
11105        let offset = Self::REVERSAL_SHIFT;
11106        assert!(value & (Self::REVERSAL_MASK as u8) == value);
11107        *self = Self::from_bits_retain(
11108            (self.bits() & !(Self::REVERSAL_MASK << offset)) | ((value as u32) << offset),
11109        );
11110    }
11111}
11112
11113bitflags! {
11114    /// `ID_ISAR3` system register value.
11115    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11116    #[repr(transparent)]
11117    pub struct IdIsar3: u32 {
11118    }
11119}
11120
11121impl IdIsar3 {
11122    /// Offset of the `Saturate` field.
11123    pub const SATURATE_SHIFT: u32 = 0;
11124    /// Mask for the `Saturate` field.
11125    pub const SATURATE_MASK: u32 = 0b1111;
11126    /// Offset of the `SIMD` field.
11127    pub const SIMD_SHIFT: u32 = 4;
11128    /// Mask for the `SIMD` field.
11129    pub const SIMD_MASK: u32 = 0b1111;
11130    /// Offset of the `SVC` field.
11131    pub const SVC_SHIFT: u32 = 8;
11132    /// Mask for the `SVC` field.
11133    pub const SVC_MASK: u32 = 0b1111;
11134    /// Offset of the `SynchPrim` field.
11135    pub const SYNCHPRIM_SHIFT: u32 = 12;
11136    /// Mask for the `SynchPrim` field.
11137    pub const SYNCHPRIM_MASK: u32 = 0b1111;
11138    /// Offset of the `TabBranch` field.
11139    pub const TABBRANCH_SHIFT: u32 = 16;
11140    /// Mask for the `TabBranch` field.
11141    pub const TABBRANCH_MASK: u32 = 0b1111;
11142    /// Offset of the `T32Copy` field.
11143    pub const T32COPY_SHIFT: u32 = 20;
11144    /// Mask for the `T32Copy` field.
11145    pub const T32COPY_MASK: u32 = 0b1111;
11146    /// Offset of the `TrueNOP` field.
11147    pub const TRUENOP_SHIFT: u32 = 24;
11148    /// Mask for the `TrueNOP` field.
11149    pub const TRUENOP_MASK: u32 = 0b1111;
11150    /// Offset of the `T32EE` field.
11151    pub const T32EE_SHIFT: u32 = 28;
11152    /// Mask for the `T32EE` field.
11153    pub const T32EE_MASK: u32 = 0b1111;
11154
11155    /// Returns the value of the `Saturate` field.
11156    pub const fn saturate(self) -> u8 {
11157        ((self.bits() >> Self::SATURATE_SHIFT) & 0b1111) as u8
11158    }
11159
11160    /// Sets the value of the `Saturate` field.
11161    pub const fn set_saturate(&mut self, value: u8) {
11162        let offset = Self::SATURATE_SHIFT;
11163        assert!(value & (Self::SATURATE_MASK as u8) == value);
11164        *self = Self::from_bits_retain(
11165            (self.bits() & !(Self::SATURATE_MASK << offset)) | ((value as u32) << offset),
11166        );
11167    }
11168
11169    /// Returns the value of the `SIMD` field.
11170    pub const fn simd(self) -> u8 {
11171        ((self.bits() >> Self::SIMD_SHIFT) & 0b1111) as u8
11172    }
11173
11174    /// Sets the value of the `SIMD` field.
11175    pub const fn set_simd(&mut self, value: u8) {
11176        let offset = Self::SIMD_SHIFT;
11177        assert!(value & (Self::SIMD_MASK as u8) == value);
11178        *self = Self::from_bits_retain(
11179            (self.bits() & !(Self::SIMD_MASK << offset)) | ((value as u32) << offset),
11180        );
11181    }
11182
11183    /// Returns the value of the `SVC` field.
11184    pub const fn svc(self) -> u8 {
11185        ((self.bits() >> Self::SVC_SHIFT) & 0b1111) as u8
11186    }
11187
11188    /// Sets the value of the `SVC` field.
11189    pub const fn set_svc(&mut self, value: u8) {
11190        let offset = Self::SVC_SHIFT;
11191        assert!(value & (Self::SVC_MASK as u8) == value);
11192        *self = Self::from_bits_retain(
11193            (self.bits() & !(Self::SVC_MASK << offset)) | ((value as u32) << offset),
11194        );
11195    }
11196
11197    /// Returns the value of the `SynchPrim` field.
11198    pub const fn synchprim(self) -> u8 {
11199        ((self.bits() >> Self::SYNCHPRIM_SHIFT) & 0b1111) as u8
11200    }
11201
11202    /// Sets the value of the `SynchPrim` field.
11203    pub const fn set_synchprim(&mut self, value: u8) {
11204        let offset = Self::SYNCHPRIM_SHIFT;
11205        assert!(value & (Self::SYNCHPRIM_MASK as u8) == value);
11206        *self = Self::from_bits_retain(
11207            (self.bits() & !(Self::SYNCHPRIM_MASK << offset)) | ((value as u32) << offset),
11208        );
11209    }
11210
11211    /// Returns the value of the `TabBranch` field.
11212    pub const fn tabbranch(self) -> u8 {
11213        ((self.bits() >> Self::TABBRANCH_SHIFT) & 0b1111) as u8
11214    }
11215
11216    /// Sets the value of the `TabBranch` field.
11217    pub const fn set_tabbranch(&mut self, value: u8) {
11218        let offset = Self::TABBRANCH_SHIFT;
11219        assert!(value & (Self::TABBRANCH_MASK as u8) == value);
11220        *self = Self::from_bits_retain(
11221            (self.bits() & !(Self::TABBRANCH_MASK << offset)) | ((value as u32) << offset),
11222        );
11223    }
11224
11225    /// Returns the value of the `T32Copy` field.
11226    pub const fn t32copy(self) -> u8 {
11227        ((self.bits() >> Self::T32COPY_SHIFT) & 0b1111) as u8
11228    }
11229
11230    /// Sets the value of the `T32Copy` field.
11231    pub const fn set_t32copy(&mut self, value: u8) {
11232        let offset = Self::T32COPY_SHIFT;
11233        assert!(value & (Self::T32COPY_MASK as u8) == value);
11234        *self = Self::from_bits_retain(
11235            (self.bits() & !(Self::T32COPY_MASK << offset)) | ((value as u32) << offset),
11236        );
11237    }
11238
11239    /// Returns the value of the `TrueNOP` field.
11240    pub const fn truenop(self) -> u8 {
11241        ((self.bits() >> Self::TRUENOP_SHIFT) & 0b1111) as u8
11242    }
11243
11244    /// Sets the value of the `TrueNOP` field.
11245    pub const fn set_truenop(&mut self, value: u8) {
11246        let offset = Self::TRUENOP_SHIFT;
11247        assert!(value & (Self::TRUENOP_MASK as u8) == value);
11248        *self = Self::from_bits_retain(
11249            (self.bits() & !(Self::TRUENOP_MASK << offset)) | ((value as u32) << offset),
11250        );
11251    }
11252
11253    /// Returns the value of the `T32EE` field.
11254    pub const fn t32ee(self) -> u8 {
11255        ((self.bits() >> Self::T32EE_SHIFT) & 0b1111) as u8
11256    }
11257
11258    /// Sets the value of the `T32EE` field.
11259    pub const fn set_t32ee(&mut self, value: u8) {
11260        let offset = Self::T32EE_SHIFT;
11261        assert!(value & (Self::T32EE_MASK as u8) == value);
11262        *self = Self::from_bits_retain(
11263            (self.bits() & !(Self::T32EE_MASK << offset)) | ((value as u32) << offset),
11264        );
11265    }
11266}
11267
11268bitflags! {
11269    /// `ID_ISAR4` system register value.
11270    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11271    #[repr(transparent)]
11272    pub struct IdIsar4: u32 {
11273    }
11274}
11275
11276impl IdIsar4 {
11277    /// Offset of the `Unpriv` field.
11278    pub const UNPRIV_SHIFT: u32 = 0;
11279    /// Mask for the `Unpriv` field.
11280    pub const UNPRIV_MASK: u32 = 0b1111;
11281    /// Offset of the `WithShifts` field.
11282    pub const WITHSHIFTS_SHIFT: u32 = 4;
11283    /// Mask for the `WithShifts` field.
11284    pub const WITHSHIFTS_MASK: u32 = 0b1111;
11285    /// Offset of the `Writeback` field.
11286    pub const WRITEBACK_SHIFT: u32 = 8;
11287    /// Mask for the `Writeback` field.
11288    pub const WRITEBACK_MASK: u32 = 0b1111;
11289    /// Offset of the `SMC` field.
11290    pub const SMC_SHIFT: u32 = 12;
11291    /// Mask for the `SMC` field.
11292    pub const SMC_MASK: u32 = 0b1111;
11293    /// Offset of the `Barrier` field.
11294    pub const BARRIER_SHIFT: u32 = 16;
11295    /// Mask for the `Barrier` field.
11296    pub const BARRIER_MASK: u32 = 0b1111;
11297    /// Offset of the `SynchPrim_frac` field.
11298    pub const SYNCHPRIM_FRAC_SHIFT: u32 = 20;
11299    /// Mask for the `SynchPrim_frac` field.
11300    pub const SYNCHPRIM_FRAC_MASK: u32 = 0b1111;
11301    /// Offset of the `PSR_M` field.
11302    pub const PSR_M_SHIFT: u32 = 24;
11303    /// Mask for the `PSR_M` field.
11304    pub const PSR_M_MASK: u32 = 0b1111;
11305    /// Offset of the `SWP_frac` field.
11306    pub const SWP_FRAC_SHIFT: u32 = 28;
11307    /// Mask for the `SWP_frac` field.
11308    pub const SWP_FRAC_MASK: u32 = 0b1111;
11309
11310    /// Returns the value of the `Unpriv` field.
11311    pub const fn unpriv(self) -> u8 {
11312        ((self.bits() >> Self::UNPRIV_SHIFT) & 0b1111) as u8
11313    }
11314
11315    /// Sets the value of the `Unpriv` field.
11316    pub const fn set_unpriv(&mut self, value: u8) {
11317        let offset = Self::UNPRIV_SHIFT;
11318        assert!(value & (Self::UNPRIV_MASK as u8) == value);
11319        *self = Self::from_bits_retain(
11320            (self.bits() & !(Self::UNPRIV_MASK << offset)) | ((value as u32) << offset),
11321        );
11322    }
11323
11324    /// Returns the value of the `WithShifts` field.
11325    pub const fn withshifts(self) -> u8 {
11326        ((self.bits() >> Self::WITHSHIFTS_SHIFT) & 0b1111) as u8
11327    }
11328
11329    /// Sets the value of the `WithShifts` field.
11330    pub const fn set_withshifts(&mut self, value: u8) {
11331        let offset = Self::WITHSHIFTS_SHIFT;
11332        assert!(value & (Self::WITHSHIFTS_MASK as u8) == value);
11333        *self = Self::from_bits_retain(
11334            (self.bits() & !(Self::WITHSHIFTS_MASK << offset)) | ((value as u32) << offset),
11335        );
11336    }
11337
11338    /// Returns the value of the `Writeback` field.
11339    pub const fn writeback(self) -> u8 {
11340        ((self.bits() >> Self::WRITEBACK_SHIFT) & 0b1111) as u8
11341    }
11342
11343    /// Sets the value of the `Writeback` field.
11344    pub const fn set_writeback(&mut self, value: u8) {
11345        let offset = Self::WRITEBACK_SHIFT;
11346        assert!(value & (Self::WRITEBACK_MASK as u8) == value);
11347        *self = Self::from_bits_retain(
11348            (self.bits() & !(Self::WRITEBACK_MASK << offset)) | ((value as u32) << offset),
11349        );
11350    }
11351
11352    /// Returns the value of the `SMC` field.
11353    pub const fn smc(self) -> u8 {
11354        ((self.bits() >> Self::SMC_SHIFT) & 0b1111) as u8
11355    }
11356
11357    /// Sets the value of the `SMC` field.
11358    pub const fn set_smc(&mut self, value: u8) {
11359        let offset = Self::SMC_SHIFT;
11360        assert!(value & (Self::SMC_MASK as u8) == value);
11361        *self = Self::from_bits_retain(
11362            (self.bits() & !(Self::SMC_MASK << offset)) | ((value as u32) << offset),
11363        );
11364    }
11365
11366    /// Returns the value of the `Barrier` field.
11367    pub const fn barrier(self) -> u8 {
11368        ((self.bits() >> Self::BARRIER_SHIFT) & 0b1111) as u8
11369    }
11370
11371    /// Sets the value of the `Barrier` field.
11372    pub const fn set_barrier(&mut self, value: u8) {
11373        let offset = Self::BARRIER_SHIFT;
11374        assert!(value & (Self::BARRIER_MASK as u8) == value);
11375        *self = Self::from_bits_retain(
11376            (self.bits() & !(Self::BARRIER_MASK << offset)) | ((value as u32) << offset),
11377        );
11378    }
11379
11380    /// Returns the value of the `SynchPrim_frac` field.
11381    pub const fn synchprim_frac(self) -> u8 {
11382        ((self.bits() >> Self::SYNCHPRIM_FRAC_SHIFT) & 0b1111) as u8
11383    }
11384
11385    /// Sets the value of the `SynchPrim_frac` field.
11386    pub const fn set_synchprim_frac(&mut self, value: u8) {
11387        let offset = Self::SYNCHPRIM_FRAC_SHIFT;
11388        assert!(value & (Self::SYNCHPRIM_FRAC_MASK as u8) == value);
11389        *self = Self::from_bits_retain(
11390            (self.bits() & !(Self::SYNCHPRIM_FRAC_MASK << offset)) | ((value as u32) << offset),
11391        );
11392    }
11393
11394    /// Returns the value of the `PSR_M` field.
11395    pub const fn psr_m(self) -> u8 {
11396        ((self.bits() >> Self::PSR_M_SHIFT) & 0b1111) as u8
11397    }
11398
11399    /// Sets the value of the `PSR_M` field.
11400    pub const fn set_psr_m(&mut self, value: u8) {
11401        let offset = Self::PSR_M_SHIFT;
11402        assert!(value & (Self::PSR_M_MASK as u8) == value);
11403        *self = Self::from_bits_retain(
11404            (self.bits() & !(Self::PSR_M_MASK << offset)) | ((value as u32) << offset),
11405        );
11406    }
11407
11408    /// Returns the value of the `SWP_frac` field.
11409    pub const fn swp_frac(self) -> u8 {
11410        ((self.bits() >> Self::SWP_FRAC_SHIFT) & 0b1111) as u8
11411    }
11412
11413    /// Sets the value of the `SWP_frac` field.
11414    pub const fn set_swp_frac(&mut self, value: u8) {
11415        let offset = Self::SWP_FRAC_SHIFT;
11416        assert!(value & (Self::SWP_FRAC_MASK as u8) == value);
11417        *self = Self::from_bits_retain(
11418            (self.bits() & !(Self::SWP_FRAC_MASK << offset)) | ((value as u32) << offset),
11419        );
11420    }
11421}
11422
11423bitflags! {
11424    /// `ID_ISAR5` system register value.
11425    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11426    #[repr(transparent)]
11427    pub struct IdIsar5: u32 {
11428    }
11429}
11430
11431impl IdIsar5 {
11432    /// Offset of the `SEVL` field.
11433    pub const SEVL_SHIFT: u32 = 0;
11434    /// Mask for the `SEVL` field.
11435    pub const SEVL_MASK: u32 = 0b1111;
11436    /// Offset of the `AES` field.
11437    pub const AES_SHIFT: u32 = 4;
11438    /// Mask for the `AES` field.
11439    pub const AES_MASK: u32 = 0b1111;
11440    /// Offset of the `SHA1` field.
11441    pub const SHA1_SHIFT: u32 = 8;
11442    /// Mask for the `SHA1` field.
11443    pub const SHA1_MASK: u32 = 0b1111;
11444    /// Offset of the `SHA2` field.
11445    pub const SHA2_SHIFT: u32 = 12;
11446    /// Mask for the `SHA2` field.
11447    pub const SHA2_MASK: u32 = 0b1111;
11448    /// Offset of the `CRC32` field.
11449    pub const CRC32_SHIFT: u32 = 16;
11450    /// Mask for the `CRC32` field.
11451    pub const CRC32_MASK: u32 = 0b1111;
11452    /// Offset of the `RDM` field.
11453    pub const RDM_SHIFT: u32 = 24;
11454    /// Mask for the `RDM` field.
11455    pub const RDM_MASK: u32 = 0b1111;
11456    /// Offset of the `VCMA` field.
11457    pub const VCMA_SHIFT: u32 = 28;
11458    /// Mask for the `VCMA` field.
11459    pub const VCMA_MASK: u32 = 0b1111;
11460
11461    /// Returns the value of the `SEVL` field.
11462    pub const fn sevl(self) -> u8 {
11463        ((self.bits() >> Self::SEVL_SHIFT) & 0b1111) as u8
11464    }
11465
11466    /// Sets the value of the `SEVL` field.
11467    pub const fn set_sevl(&mut self, value: u8) {
11468        let offset = Self::SEVL_SHIFT;
11469        assert!(value & (Self::SEVL_MASK as u8) == value);
11470        *self = Self::from_bits_retain(
11471            (self.bits() & !(Self::SEVL_MASK << offset)) | ((value as u32) << offset),
11472        );
11473    }
11474
11475    /// Returns the value of the `AES` field.
11476    pub const fn aes(self) -> u8 {
11477        ((self.bits() >> Self::AES_SHIFT) & 0b1111) as u8
11478    }
11479
11480    /// Sets the value of the `AES` field.
11481    pub const fn set_aes(&mut self, value: u8) {
11482        let offset = Self::AES_SHIFT;
11483        assert!(value & (Self::AES_MASK as u8) == value);
11484        *self = Self::from_bits_retain(
11485            (self.bits() & !(Self::AES_MASK << offset)) | ((value as u32) << offset),
11486        );
11487    }
11488
11489    /// Returns the value of the `SHA1` field.
11490    pub const fn sha1(self) -> u8 {
11491        ((self.bits() >> Self::SHA1_SHIFT) & 0b1111) as u8
11492    }
11493
11494    /// Sets the value of the `SHA1` field.
11495    pub const fn set_sha1(&mut self, value: u8) {
11496        let offset = Self::SHA1_SHIFT;
11497        assert!(value & (Self::SHA1_MASK as u8) == value);
11498        *self = Self::from_bits_retain(
11499            (self.bits() & !(Self::SHA1_MASK << offset)) | ((value as u32) << offset),
11500        );
11501    }
11502
11503    /// Returns the value of the `SHA2` field.
11504    pub const fn sha2(self) -> u8 {
11505        ((self.bits() >> Self::SHA2_SHIFT) & 0b1111) as u8
11506    }
11507
11508    /// Sets the value of the `SHA2` field.
11509    pub const fn set_sha2(&mut self, value: u8) {
11510        let offset = Self::SHA2_SHIFT;
11511        assert!(value & (Self::SHA2_MASK as u8) == value);
11512        *self = Self::from_bits_retain(
11513            (self.bits() & !(Self::SHA2_MASK << offset)) | ((value as u32) << offset),
11514        );
11515    }
11516
11517    /// Returns the value of the `CRC32` field.
11518    pub const fn crc32(self) -> u8 {
11519        ((self.bits() >> Self::CRC32_SHIFT) & 0b1111) as u8
11520    }
11521
11522    /// Sets the value of the `CRC32` field.
11523    pub const fn set_crc32(&mut self, value: u8) {
11524        let offset = Self::CRC32_SHIFT;
11525        assert!(value & (Self::CRC32_MASK as u8) == value);
11526        *self = Self::from_bits_retain(
11527            (self.bits() & !(Self::CRC32_MASK << offset)) | ((value as u32) << offset),
11528        );
11529    }
11530
11531    /// Returns the value of the `RDM` field.
11532    pub const fn rdm(self) -> u8 {
11533        ((self.bits() >> Self::RDM_SHIFT) & 0b1111) as u8
11534    }
11535
11536    /// Sets the value of the `RDM` field.
11537    pub const fn set_rdm(&mut self, value: u8) {
11538        let offset = Self::RDM_SHIFT;
11539        assert!(value & (Self::RDM_MASK as u8) == value);
11540        *self = Self::from_bits_retain(
11541            (self.bits() & !(Self::RDM_MASK << offset)) | ((value as u32) << offset),
11542        );
11543    }
11544
11545    /// Returns the value of the `VCMA` field.
11546    pub const fn vcma(self) -> u8 {
11547        ((self.bits() >> Self::VCMA_SHIFT) & 0b1111) as u8
11548    }
11549
11550    /// Sets the value of the `VCMA` field.
11551    pub const fn set_vcma(&mut self, value: u8) {
11552        let offset = Self::VCMA_SHIFT;
11553        assert!(value & (Self::VCMA_MASK as u8) == value);
11554        *self = Self::from_bits_retain(
11555            (self.bits() & !(Self::VCMA_MASK << offset)) | ((value as u32) << offset),
11556        );
11557    }
11558}
11559
11560bitflags! {
11561    /// `ID_ISAR6` system register value.
11562    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11563    #[repr(transparent)]
11564    pub struct IdIsar6: u32 {
11565    }
11566}
11567
11568impl IdIsar6 {
11569    /// Offset of the `JSCVT` field.
11570    pub const JSCVT_SHIFT: u32 = 0;
11571    /// Mask for the `JSCVT` field.
11572    pub const JSCVT_MASK: u32 = 0b1111;
11573    /// Offset of the `DP` field.
11574    pub const DP_SHIFT: u32 = 4;
11575    /// Mask for the `DP` field.
11576    pub const DP_MASK: u32 = 0b1111;
11577    /// Offset of the `FHM` field.
11578    pub const FHM_SHIFT: u32 = 8;
11579    /// Mask for the `FHM` field.
11580    pub const FHM_MASK: u32 = 0b1111;
11581    /// Offset of the `SB` field.
11582    pub const SB_SHIFT: u32 = 12;
11583    /// Mask for the `SB` field.
11584    pub const SB_MASK: u32 = 0b1111;
11585    /// Offset of the `SPECRES` field.
11586    pub const SPECRES_SHIFT: u32 = 16;
11587    /// Mask for the `SPECRES` field.
11588    pub const SPECRES_MASK: u32 = 0b1111;
11589    /// Offset of the `BF16` field.
11590    pub const BF16_SHIFT: u32 = 20;
11591    /// Mask for the `BF16` field.
11592    pub const BF16_MASK: u32 = 0b1111;
11593    /// Offset of the `I8MM` field.
11594    pub const I8MM_SHIFT: u32 = 24;
11595    /// Mask for the `I8MM` field.
11596    pub const I8MM_MASK: u32 = 0b1111;
11597    /// Offset of the `CLRBHB` field.
11598    pub const CLRBHB_SHIFT: u32 = 28;
11599    /// Mask for the `CLRBHB` field.
11600    pub const CLRBHB_MASK: u32 = 0b1111;
11601
11602    /// Returns the value of the `JSCVT` field.
11603    pub const fn jscvt(self) -> u8 {
11604        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
11605    }
11606
11607    /// Sets the value of the `JSCVT` field.
11608    pub const fn set_jscvt(&mut self, value: u8) {
11609        let offset = Self::JSCVT_SHIFT;
11610        assert!(value & (Self::JSCVT_MASK as u8) == value);
11611        *self = Self::from_bits_retain(
11612            (self.bits() & !(Self::JSCVT_MASK << offset)) | ((value as u32) << offset),
11613        );
11614    }
11615
11616    /// Returns the value of the `DP` field.
11617    pub const fn dp(self) -> u8 {
11618        ((self.bits() >> Self::DP_SHIFT) & 0b1111) as u8
11619    }
11620
11621    /// Sets the value of the `DP` field.
11622    pub const fn set_dp(&mut self, value: u8) {
11623        let offset = Self::DP_SHIFT;
11624        assert!(value & (Self::DP_MASK as u8) == value);
11625        *self = Self::from_bits_retain(
11626            (self.bits() & !(Self::DP_MASK << offset)) | ((value as u32) << offset),
11627        );
11628    }
11629
11630    /// Returns the value of the `FHM` field.
11631    pub const fn fhm(self) -> u8 {
11632        ((self.bits() >> Self::FHM_SHIFT) & 0b1111) as u8
11633    }
11634
11635    /// Sets the value of the `FHM` field.
11636    pub const fn set_fhm(&mut self, value: u8) {
11637        let offset = Self::FHM_SHIFT;
11638        assert!(value & (Self::FHM_MASK as u8) == value);
11639        *self = Self::from_bits_retain(
11640            (self.bits() & !(Self::FHM_MASK << offset)) | ((value as u32) << offset),
11641        );
11642    }
11643
11644    /// Returns the value of the `SB` field.
11645    pub const fn sb(self) -> u8 {
11646        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
11647    }
11648
11649    /// Sets the value of the `SB` field.
11650    pub const fn set_sb(&mut self, value: u8) {
11651        let offset = Self::SB_SHIFT;
11652        assert!(value & (Self::SB_MASK as u8) == value);
11653        *self = Self::from_bits_retain(
11654            (self.bits() & !(Self::SB_MASK << offset)) | ((value as u32) << offset),
11655        );
11656    }
11657
11658    /// Returns the value of the `SPECRES` field.
11659    pub const fn specres(self) -> u8 {
11660        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
11661    }
11662
11663    /// Sets the value of the `SPECRES` field.
11664    pub const fn set_specres(&mut self, value: u8) {
11665        let offset = Self::SPECRES_SHIFT;
11666        assert!(value & (Self::SPECRES_MASK as u8) == value);
11667        *self = Self::from_bits_retain(
11668            (self.bits() & !(Self::SPECRES_MASK << offset)) | ((value as u32) << offset),
11669        );
11670    }
11671
11672    /// Returns the value of the `BF16` field.
11673    pub const fn bf16(self) -> u8 {
11674        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
11675    }
11676
11677    /// Sets the value of the `BF16` field.
11678    pub const fn set_bf16(&mut self, value: u8) {
11679        let offset = Self::BF16_SHIFT;
11680        assert!(value & (Self::BF16_MASK as u8) == value);
11681        *self = Self::from_bits_retain(
11682            (self.bits() & !(Self::BF16_MASK << offset)) | ((value as u32) << offset),
11683        );
11684    }
11685
11686    /// Returns the value of the `I8MM` field.
11687    pub const fn i8mm(self) -> u8 {
11688        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
11689    }
11690
11691    /// Sets the value of the `I8MM` field.
11692    pub const fn set_i8mm(&mut self, value: u8) {
11693        let offset = Self::I8MM_SHIFT;
11694        assert!(value & (Self::I8MM_MASK as u8) == value);
11695        *self = Self::from_bits_retain(
11696            (self.bits() & !(Self::I8MM_MASK << offset)) | ((value as u32) << offset),
11697        );
11698    }
11699
11700    /// Returns the value of the `CLRBHB` field.
11701    pub const fn clrbhb(self) -> u8 {
11702        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
11703    }
11704
11705    /// Sets the value of the `CLRBHB` field.
11706    pub const fn set_clrbhb(&mut self, value: u8) {
11707        let offset = Self::CLRBHB_SHIFT;
11708        assert!(value & (Self::CLRBHB_MASK as u8) == value);
11709        *self = Self::from_bits_retain(
11710            (self.bits() & !(Self::CLRBHB_MASK << offset)) | ((value as u32) << offset),
11711        );
11712    }
11713}
11714
11715bitflags! {
11716    /// `ID_MMFR0` system register value.
11717    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11718    #[repr(transparent)]
11719    pub struct IdMmfr0: u32 {
11720    }
11721}
11722
11723impl IdMmfr0 {
11724    /// Offset of the `VMSA` field.
11725    pub const VMSA_SHIFT: u32 = 0;
11726    /// Mask for the `VMSA` field.
11727    pub const VMSA_MASK: u32 = 0b1111;
11728    /// Offset of the `PMSA` field.
11729    pub const PMSA_SHIFT: u32 = 4;
11730    /// Mask for the `PMSA` field.
11731    pub const PMSA_MASK: u32 = 0b1111;
11732    /// Offset of the `OuterShr` field.
11733    pub const OUTERSHR_SHIFT: u32 = 8;
11734    /// Mask for the `OuterShr` field.
11735    pub const OUTERSHR_MASK: u32 = 0b1111;
11736    /// Offset of the `ShareLvl` field.
11737    pub const SHARELVL_SHIFT: u32 = 12;
11738    /// Mask for the `ShareLvl` field.
11739    pub const SHARELVL_MASK: u32 = 0b1111;
11740    /// Offset of the `TCM` field.
11741    pub const TCM_SHIFT: u32 = 16;
11742    /// Mask for the `TCM` field.
11743    pub const TCM_MASK: u32 = 0b1111;
11744    /// Offset of the `AuxReg` field.
11745    pub const AUXREG_SHIFT: u32 = 20;
11746    /// Mask for the `AuxReg` field.
11747    pub const AUXREG_MASK: u32 = 0b1111;
11748    /// Offset of the `FCSE` field.
11749    pub const FCSE_SHIFT: u32 = 24;
11750    /// Mask for the `FCSE` field.
11751    pub const FCSE_MASK: u32 = 0b1111;
11752    /// Offset of the `InnerShr` field.
11753    pub const INNERSHR_SHIFT: u32 = 28;
11754    /// Mask for the `InnerShr` field.
11755    pub const INNERSHR_MASK: u32 = 0b1111;
11756
11757    /// Returns the value of the `VMSA` field.
11758    pub const fn vmsa(self) -> u8 {
11759        ((self.bits() >> Self::VMSA_SHIFT) & 0b1111) as u8
11760    }
11761
11762    /// Sets the value of the `VMSA` field.
11763    pub const fn set_vmsa(&mut self, value: u8) {
11764        let offset = Self::VMSA_SHIFT;
11765        assert!(value & (Self::VMSA_MASK as u8) == value);
11766        *self = Self::from_bits_retain(
11767            (self.bits() & !(Self::VMSA_MASK << offset)) | ((value as u32) << offset),
11768        );
11769    }
11770
11771    /// Returns the value of the `PMSA` field.
11772    pub const fn pmsa(self) -> u8 {
11773        ((self.bits() >> Self::PMSA_SHIFT) & 0b1111) as u8
11774    }
11775
11776    /// Sets the value of the `PMSA` field.
11777    pub const fn set_pmsa(&mut self, value: u8) {
11778        let offset = Self::PMSA_SHIFT;
11779        assert!(value & (Self::PMSA_MASK as u8) == value);
11780        *self = Self::from_bits_retain(
11781            (self.bits() & !(Self::PMSA_MASK << offset)) | ((value as u32) << offset),
11782        );
11783    }
11784
11785    /// Returns the value of the `OuterShr` field.
11786    pub const fn outershr(self) -> u8 {
11787        ((self.bits() >> Self::OUTERSHR_SHIFT) & 0b1111) as u8
11788    }
11789
11790    /// Sets the value of the `OuterShr` field.
11791    pub const fn set_outershr(&mut self, value: u8) {
11792        let offset = Self::OUTERSHR_SHIFT;
11793        assert!(value & (Self::OUTERSHR_MASK as u8) == value);
11794        *self = Self::from_bits_retain(
11795            (self.bits() & !(Self::OUTERSHR_MASK << offset)) | ((value as u32) << offset),
11796        );
11797    }
11798
11799    /// Returns the value of the `ShareLvl` field.
11800    pub const fn sharelvl(self) -> u8 {
11801        ((self.bits() >> Self::SHARELVL_SHIFT) & 0b1111) as u8
11802    }
11803
11804    /// Sets the value of the `ShareLvl` field.
11805    pub const fn set_sharelvl(&mut self, value: u8) {
11806        let offset = Self::SHARELVL_SHIFT;
11807        assert!(value & (Self::SHARELVL_MASK as u8) == value);
11808        *self = Self::from_bits_retain(
11809            (self.bits() & !(Self::SHARELVL_MASK << offset)) | ((value as u32) << offset),
11810        );
11811    }
11812
11813    /// Returns the value of the `TCM` field.
11814    pub const fn tcm(self) -> u8 {
11815        ((self.bits() >> Self::TCM_SHIFT) & 0b1111) as u8
11816    }
11817
11818    /// Sets the value of the `TCM` field.
11819    pub const fn set_tcm(&mut self, value: u8) {
11820        let offset = Self::TCM_SHIFT;
11821        assert!(value & (Self::TCM_MASK as u8) == value);
11822        *self = Self::from_bits_retain(
11823            (self.bits() & !(Self::TCM_MASK << offset)) | ((value as u32) << offset),
11824        );
11825    }
11826
11827    /// Returns the value of the `AuxReg` field.
11828    pub const fn auxreg(self) -> u8 {
11829        ((self.bits() >> Self::AUXREG_SHIFT) & 0b1111) as u8
11830    }
11831
11832    /// Sets the value of the `AuxReg` field.
11833    pub const fn set_auxreg(&mut self, value: u8) {
11834        let offset = Self::AUXREG_SHIFT;
11835        assert!(value & (Self::AUXREG_MASK as u8) == value);
11836        *self = Self::from_bits_retain(
11837            (self.bits() & !(Self::AUXREG_MASK << offset)) | ((value as u32) << offset),
11838        );
11839    }
11840
11841    /// Returns the value of the `FCSE` field.
11842    pub const fn fcse(self) -> u8 {
11843        ((self.bits() >> Self::FCSE_SHIFT) & 0b1111) as u8
11844    }
11845
11846    /// Sets the value of the `FCSE` field.
11847    pub const fn set_fcse(&mut self, value: u8) {
11848        let offset = Self::FCSE_SHIFT;
11849        assert!(value & (Self::FCSE_MASK as u8) == value);
11850        *self = Self::from_bits_retain(
11851            (self.bits() & !(Self::FCSE_MASK << offset)) | ((value as u32) << offset),
11852        );
11853    }
11854
11855    /// Returns the value of the `InnerShr` field.
11856    pub const fn innershr(self) -> u8 {
11857        ((self.bits() >> Self::INNERSHR_SHIFT) & 0b1111) as u8
11858    }
11859
11860    /// Sets the value of the `InnerShr` field.
11861    pub const fn set_innershr(&mut self, value: u8) {
11862        let offset = Self::INNERSHR_SHIFT;
11863        assert!(value & (Self::INNERSHR_MASK as u8) == value);
11864        *self = Self::from_bits_retain(
11865            (self.bits() & !(Self::INNERSHR_MASK << offset)) | ((value as u32) << offset),
11866        );
11867    }
11868}
11869
11870bitflags! {
11871    /// `ID_MMFR1` system register value.
11872    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11873    #[repr(transparent)]
11874    pub struct IdMmfr1: u32 {
11875    }
11876}
11877
11878impl IdMmfr1 {
11879    /// Offset of the `L1HvdVA` field.
11880    pub const L1HVDVA_SHIFT: u32 = 0;
11881    /// Mask for the `L1HvdVA` field.
11882    pub const L1HVDVA_MASK: u32 = 0b1111;
11883    /// Offset of the `L1UniVA` field.
11884    pub const L1UNIVA_SHIFT: u32 = 4;
11885    /// Mask for the `L1UniVA` field.
11886    pub const L1UNIVA_MASK: u32 = 0b1111;
11887    /// Offset of the `L1HvdSW` field.
11888    pub const L1HVDSW_SHIFT: u32 = 8;
11889    /// Mask for the `L1HvdSW` field.
11890    pub const L1HVDSW_MASK: u32 = 0b1111;
11891    /// Offset of the `L1UniSW` field.
11892    pub const L1UNISW_SHIFT: u32 = 12;
11893    /// Mask for the `L1UniSW` field.
11894    pub const L1UNISW_MASK: u32 = 0b1111;
11895    /// Offset of the `L1Hvd` field.
11896    pub const L1HVD_SHIFT: u32 = 16;
11897    /// Mask for the `L1Hvd` field.
11898    pub const L1HVD_MASK: u32 = 0b1111;
11899    /// Offset of the `L1Uni` field.
11900    pub const L1UNI_SHIFT: u32 = 20;
11901    /// Mask for the `L1Uni` field.
11902    pub const L1UNI_MASK: u32 = 0b1111;
11903    /// Offset of the `L1TstCln` field.
11904    pub const L1TSTCLN_SHIFT: u32 = 24;
11905    /// Mask for the `L1TstCln` field.
11906    pub const L1TSTCLN_MASK: u32 = 0b1111;
11907    /// Offset of the `BPred` field.
11908    pub const BPRED_SHIFT: u32 = 28;
11909    /// Mask for the `BPred` field.
11910    pub const BPRED_MASK: u32 = 0b1111;
11911
11912    /// Returns the value of the `L1HvdVA` field.
11913    pub const fn l1hvdva(self) -> u8 {
11914        ((self.bits() >> Self::L1HVDVA_SHIFT) & 0b1111) as u8
11915    }
11916
11917    /// Sets the value of the `L1HvdVA` field.
11918    pub const fn set_l1hvdva(&mut self, value: u8) {
11919        let offset = Self::L1HVDVA_SHIFT;
11920        assert!(value & (Self::L1HVDVA_MASK as u8) == value);
11921        *self = Self::from_bits_retain(
11922            (self.bits() & !(Self::L1HVDVA_MASK << offset)) | ((value as u32) << offset),
11923        );
11924    }
11925
11926    /// Returns the value of the `L1UniVA` field.
11927    pub const fn l1univa(self) -> u8 {
11928        ((self.bits() >> Self::L1UNIVA_SHIFT) & 0b1111) as u8
11929    }
11930
11931    /// Sets the value of the `L1UniVA` field.
11932    pub const fn set_l1univa(&mut self, value: u8) {
11933        let offset = Self::L1UNIVA_SHIFT;
11934        assert!(value & (Self::L1UNIVA_MASK as u8) == value);
11935        *self = Self::from_bits_retain(
11936            (self.bits() & !(Self::L1UNIVA_MASK << offset)) | ((value as u32) << offset),
11937        );
11938    }
11939
11940    /// Returns the value of the `L1HvdSW` field.
11941    pub const fn l1hvdsw(self) -> u8 {
11942        ((self.bits() >> Self::L1HVDSW_SHIFT) & 0b1111) as u8
11943    }
11944
11945    /// Sets the value of the `L1HvdSW` field.
11946    pub const fn set_l1hvdsw(&mut self, value: u8) {
11947        let offset = Self::L1HVDSW_SHIFT;
11948        assert!(value & (Self::L1HVDSW_MASK as u8) == value);
11949        *self = Self::from_bits_retain(
11950            (self.bits() & !(Self::L1HVDSW_MASK << offset)) | ((value as u32) << offset),
11951        );
11952    }
11953
11954    /// Returns the value of the `L1UniSW` field.
11955    pub const fn l1unisw(self) -> u8 {
11956        ((self.bits() >> Self::L1UNISW_SHIFT) & 0b1111) as u8
11957    }
11958
11959    /// Sets the value of the `L1UniSW` field.
11960    pub const fn set_l1unisw(&mut self, value: u8) {
11961        let offset = Self::L1UNISW_SHIFT;
11962        assert!(value & (Self::L1UNISW_MASK as u8) == value);
11963        *self = Self::from_bits_retain(
11964            (self.bits() & !(Self::L1UNISW_MASK << offset)) | ((value as u32) << offset),
11965        );
11966    }
11967
11968    /// Returns the value of the `L1Hvd` field.
11969    pub const fn l1hvd(self) -> u8 {
11970        ((self.bits() >> Self::L1HVD_SHIFT) & 0b1111) as u8
11971    }
11972
11973    /// Sets the value of the `L1Hvd` field.
11974    pub const fn set_l1hvd(&mut self, value: u8) {
11975        let offset = Self::L1HVD_SHIFT;
11976        assert!(value & (Self::L1HVD_MASK as u8) == value);
11977        *self = Self::from_bits_retain(
11978            (self.bits() & !(Self::L1HVD_MASK << offset)) | ((value as u32) << offset),
11979        );
11980    }
11981
11982    /// Returns the value of the `L1Uni` field.
11983    pub const fn l1uni(self) -> u8 {
11984        ((self.bits() >> Self::L1UNI_SHIFT) & 0b1111) as u8
11985    }
11986
11987    /// Sets the value of the `L1Uni` field.
11988    pub const fn set_l1uni(&mut self, value: u8) {
11989        let offset = Self::L1UNI_SHIFT;
11990        assert!(value & (Self::L1UNI_MASK as u8) == value);
11991        *self = Self::from_bits_retain(
11992            (self.bits() & !(Self::L1UNI_MASK << offset)) | ((value as u32) << offset),
11993        );
11994    }
11995
11996    /// Returns the value of the `L1TstCln` field.
11997    pub const fn l1tstcln(self) -> u8 {
11998        ((self.bits() >> Self::L1TSTCLN_SHIFT) & 0b1111) as u8
11999    }
12000
12001    /// Sets the value of the `L1TstCln` field.
12002    pub const fn set_l1tstcln(&mut self, value: u8) {
12003        let offset = Self::L1TSTCLN_SHIFT;
12004        assert!(value & (Self::L1TSTCLN_MASK as u8) == value);
12005        *self = Self::from_bits_retain(
12006            (self.bits() & !(Self::L1TSTCLN_MASK << offset)) | ((value as u32) << offset),
12007        );
12008    }
12009
12010    /// Returns the value of the `BPred` field.
12011    pub const fn bpred(self) -> u8 {
12012        ((self.bits() >> Self::BPRED_SHIFT) & 0b1111) as u8
12013    }
12014
12015    /// Sets the value of the `BPred` field.
12016    pub const fn set_bpred(&mut self, value: u8) {
12017        let offset = Self::BPRED_SHIFT;
12018        assert!(value & (Self::BPRED_MASK as u8) == value);
12019        *self = Self::from_bits_retain(
12020            (self.bits() & !(Self::BPRED_MASK << offset)) | ((value as u32) << offset),
12021        );
12022    }
12023}
12024
12025bitflags! {
12026    /// `ID_MMFR2` system register value.
12027    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12028    #[repr(transparent)]
12029    pub struct IdMmfr2: u32 {
12030    }
12031}
12032
12033impl IdMmfr2 {
12034    /// Offset of the `L1HvdFG` field.
12035    pub const L1HVDFG_SHIFT: u32 = 0;
12036    /// Mask for the `L1HvdFG` field.
12037    pub const L1HVDFG_MASK: u32 = 0b1111;
12038    /// Offset of the `L1HvdBG` field.
12039    pub const L1HVDBG_SHIFT: u32 = 4;
12040    /// Mask for the `L1HvdBG` field.
12041    pub const L1HVDBG_MASK: u32 = 0b1111;
12042    /// Offset of the `L1HvdRng` field.
12043    pub const L1HVDRNG_SHIFT: u32 = 8;
12044    /// Mask for the `L1HvdRng` field.
12045    pub const L1HVDRNG_MASK: u32 = 0b1111;
12046    /// Offset of the `HvdTLB` field.
12047    pub const HVDTLB_SHIFT: u32 = 12;
12048    /// Mask for the `HvdTLB` field.
12049    pub const HVDTLB_MASK: u32 = 0b1111;
12050    /// Offset of the `UniTLB` field.
12051    pub const UNITLB_SHIFT: u32 = 16;
12052    /// Mask for the `UniTLB` field.
12053    pub const UNITLB_MASK: u32 = 0b1111;
12054    /// Offset of the `MemBarr` field.
12055    pub const MEMBARR_SHIFT: u32 = 20;
12056    /// Mask for the `MemBarr` field.
12057    pub const MEMBARR_MASK: u32 = 0b1111;
12058    /// Offset of the `WFIStall` field.
12059    pub const WFISTALL_SHIFT: u32 = 24;
12060    /// Mask for the `WFIStall` field.
12061    pub const WFISTALL_MASK: u32 = 0b1111;
12062    /// Offset of the `HWAccFlg` field.
12063    pub const HWACCFLG_SHIFT: u32 = 28;
12064    /// Mask for the `HWAccFlg` field.
12065    pub const HWACCFLG_MASK: u32 = 0b1111;
12066
12067    /// Returns the value of the `L1HvdFG` field.
12068    pub const fn l1hvdfg(self) -> u8 {
12069        ((self.bits() >> Self::L1HVDFG_SHIFT) & 0b1111) as u8
12070    }
12071
12072    /// Sets the value of the `L1HvdFG` field.
12073    pub const fn set_l1hvdfg(&mut self, value: u8) {
12074        let offset = Self::L1HVDFG_SHIFT;
12075        assert!(value & (Self::L1HVDFG_MASK as u8) == value);
12076        *self = Self::from_bits_retain(
12077            (self.bits() & !(Self::L1HVDFG_MASK << offset)) | ((value as u32) << offset),
12078        );
12079    }
12080
12081    /// Returns the value of the `L1HvdBG` field.
12082    pub const fn l1hvdbg(self) -> u8 {
12083        ((self.bits() >> Self::L1HVDBG_SHIFT) & 0b1111) as u8
12084    }
12085
12086    /// Sets the value of the `L1HvdBG` field.
12087    pub const fn set_l1hvdbg(&mut self, value: u8) {
12088        let offset = Self::L1HVDBG_SHIFT;
12089        assert!(value & (Self::L1HVDBG_MASK as u8) == value);
12090        *self = Self::from_bits_retain(
12091            (self.bits() & !(Self::L1HVDBG_MASK << offset)) | ((value as u32) << offset),
12092        );
12093    }
12094
12095    /// Returns the value of the `L1HvdRng` field.
12096    pub const fn l1hvdrng(self) -> u8 {
12097        ((self.bits() >> Self::L1HVDRNG_SHIFT) & 0b1111) as u8
12098    }
12099
12100    /// Sets the value of the `L1HvdRng` field.
12101    pub const fn set_l1hvdrng(&mut self, value: u8) {
12102        let offset = Self::L1HVDRNG_SHIFT;
12103        assert!(value & (Self::L1HVDRNG_MASK as u8) == value);
12104        *self = Self::from_bits_retain(
12105            (self.bits() & !(Self::L1HVDRNG_MASK << offset)) | ((value as u32) << offset),
12106        );
12107    }
12108
12109    /// Returns the value of the `HvdTLB` field.
12110    pub const fn hvdtlb(self) -> u8 {
12111        ((self.bits() >> Self::HVDTLB_SHIFT) & 0b1111) as u8
12112    }
12113
12114    /// Sets the value of the `HvdTLB` field.
12115    pub const fn set_hvdtlb(&mut self, value: u8) {
12116        let offset = Self::HVDTLB_SHIFT;
12117        assert!(value & (Self::HVDTLB_MASK as u8) == value);
12118        *self = Self::from_bits_retain(
12119            (self.bits() & !(Self::HVDTLB_MASK << offset)) | ((value as u32) << offset),
12120        );
12121    }
12122
12123    /// Returns the value of the `UniTLB` field.
12124    pub const fn unitlb(self) -> u8 {
12125        ((self.bits() >> Self::UNITLB_SHIFT) & 0b1111) as u8
12126    }
12127
12128    /// Sets the value of the `UniTLB` field.
12129    pub const fn set_unitlb(&mut self, value: u8) {
12130        let offset = Self::UNITLB_SHIFT;
12131        assert!(value & (Self::UNITLB_MASK as u8) == value);
12132        *self = Self::from_bits_retain(
12133            (self.bits() & !(Self::UNITLB_MASK << offset)) | ((value as u32) << offset),
12134        );
12135    }
12136
12137    /// Returns the value of the `MemBarr` field.
12138    pub const fn membarr(self) -> u8 {
12139        ((self.bits() >> Self::MEMBARR_SHIFT) & 0b1111) as u8
12140    }
12141
12142    /// Sets the value of the `MemBarr` field.
12143    pub const fn set_membarr(&mut self, value: u8) {
12144        let offset = Self::MEMBARR_SHIFT;
12145        assert!(value & (Self::MEMBARR_MASK as u8) == value);
12146        *self = Self::from_bits_retain(
12147            (self.bits() & !(Self::MEMBARR_MASK << offset)) | ((value as u32) << offset),
12148        );
12149    }
12150
12151    /// Returns the value of the `WFIStall` field.
12152    pub const fn wfistall(self) -> u8 {
12153        ((self.bits() >> Self::WFISTALL_SHIFT) & 0b1111) as u8
12154    }
12155
12156    /// Sets the value of the `WFIStall` field.
12157    pub const fn set_wfistall(&mut self, value: u8) {
12158        let offset = Self::WFISTALL_SHIFT;
12159        assert!(value & (Self::WFISTALL_MASK as u8) == value);
12160        *self = Self::from_bits_retain(
12161            (self.bits() & !(Self::WFISTALL_MASK << offset)) | ((value as u32) << offset),
12162        );
12163    }
12164
12165    /// Returns the value of the `HWAccFlg` field.
12166    pub const fn hwaccflg(self) -> u8 {
12167        ((self.bits() >> Self::HWACCFLG_SHIFT) & 0b1111) as u8
12168    }
12169
12170    /// Sets the value of the `HWAccFlg` field.
12171    pub const fn set_hwaccflg(&mut self, value: u8) {
12172        let offset = Self::HWACCFLG_SHIFT;
12173        assert!(value & (Self::HWACCFLG_MASK as u8) == value);
12174        *self = Self::from_bits_retain(
12175            (self.bits() & !(Self::HWACCFLG_MASK << offset)) | ((value as u32) << offset),
12176        );
12177    }
12178}
12179
12180bitflags! {
12181    /// `ID_MMFR3` system register value.
12182    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12183    #[repr(transparent)]
12184    pub struct IdMmfr3: u32 {
12185    }
12186}
12187
12188impl IdMmfr3 {
12189    /// Offset of the `CMaintVA` field.
12190    pub const CMAINTVA_SHIFT: u32 = 0;
12191    /// Mask for the `CMaintVA` field.
12192    pub const CMAINTVA_MASK: u32 = 0b1111;
12193    /// Offset of the `CMaintSW` field.
12194    pub const CMAINTSW_SHIFT: u32 = 4;
12195    /// Mask for the `CMaintSW` field.
12196    pub const CMAINTSW_MASK: u32 = 0b1111;
12197    /// Offset of the `BPMaint` field.
12198    pub const BPMAINT_SHIFT: u32 = 8;
12199    /// Mask for the `BPMaint` field.
12200    pub const BPMAINT_MASK: u32 = 0b1111;
12201    /// Offset of the `MaintBcst` field.
12202    pub const MAINTBCST_SHIFT: u32 = 12;
12203    /// Mask for the `MaintBcst` field.
12204    pub const MAINTBCST_MASK: u32 = 0b1111;
12205    /// Offset of the `PAN` field.
12206    pub const PAN_SHIFT: u32 = 16;
12207    /// Mask for the `PAN` field.
12208    pub const PAN_MASK: u32 = 0b1111;
12209    /// Offset of the `CohWalk` field.
12210    pub const COHWALK_SHIFT: u32 = 20;
12211    /// Mask for the `CohWalk` field.
12212    pub const COHWALK_MASK: u32 = 0b1111;
12213    /// Offset of the `CMemSz` field.
12214    pub const CMEMSZ_SHIFT: u32 = 24;
12215    /// Mask for the `CMemSz` field.
12216    pub const CMEMSZ_MASK: u32 = 0b1111;
12217    /// Offset of the `Supersec` field.
12218    pub const SUPERSEC_SHIFT: u32 = 28;
12219    /// Mask for the `Supersec` field.
12220    pub const SUPERSEC_MASK: u32 = 0b1111;
12221
12222    /// Returns the value of the `CMaintVA` field.
12223    pub const fn cmaintva(self) -> u8 {
12224        ((self.bits() >> Self::CMAINTVA_SHIFT) & 0b1111) as u8
12225    }
12226
12227    /// Sets the value of the `CMaintVA` field.
12228    pub const fn set_cmaintva(&mut self, value: u8) {
12229        let offset = Self::CMAINTVA_SHIFT;
12230        assert!(value & (Self::CMAINTVA_MASK as u8) == value);
12231        *self = Self::from_bits_retain(
12232            (self.bits() & !(Self::CMAINTVA_MASK << offset)) | ((value as u32) << offset),
12233        );
12234    }
12235
12236    /// Returns the value of the `CMaintSW` field.
12237    pub const fn cmaintsw(self) -> u8 {
12238        ((self.bits() >> Self::CMAINTSW_SHIFT) & 0b1111) as u8
12239    }
12240
12241    /// Sets the value of the `CMaintSW` field.
12242    pub const fn set_cmaintsw(&mut self, value: u8) {
12243        let offset = Self::CMAINTSW_SHIFT;
12244        assert!(value & (Self::CMAINTSW_MASK as u8) == value);
12245        *self = Self::from_bits_retain(
12246            (self.bits() & !(Self::CMAINTSW_MASK << offset)) | ((value as u32) << offset),
12247        );
12248    }
12249
12250    /// Returns the value of the `BPMaint` field.
12251    pub const fn bpmaint(self) -> u8 {
12252        ((self.bits() >> Self::BPMAINT_SHIFT) & 0b1111) as u8
12253    }
12254
12255    /// Sets the value of the `BPMaint` field.
12256    pub const fn set_bpmaint(&mut self, value: u8) {
12257        let offset = Self::BPMAINT_SHIFT;
12258        assert!(value & (Self::BPMAINT_MASK as u8) == value);
12259        *self = Self::from_bits_retain(
12260            (self.bits() & !(Self::BPMAINT_MASK << offset)) | ((value as u32) << offset),
12261        );
12262    }
12263
12264    /// Returns the value of the `MaintBcst` field.
12265    pub const fn maintbcst(self) -> u8 {
12266        ((self.bits() >> Self::MAINTBCST_SHIFT) & 0b1111) as u8
12267    }
12268
12269    /// Sets the value of the `MaintBcst` field.
12270    pub const fn set_maintbcst(&mut self, value: u8) {
12271        let offset = Self::MAINTBCST_SHIFT;
12272        assert!(value & (Self::MAINTBCST_MASK as u8) == value);
12273        *self = Self::from_bits_retain(
12274            (self.bits() & !(Self::MAINTBCST_MASK << offset)) | ((value as u32) << offset),
12275        );
12276    }
12277
12278    /// Returns the value of the `PAN` field.
12279    pub const fn pan(self) -> u8 {
12280        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
12281    }
12282
12283    /// Sets the value of the `PAN` field.
12284    pub const fn set_pan(&mut self, value: u8) {
12285        let offset = Self::PAN_SHIFT;
12286        assert!(value & (Self::PAN_MASK as u8) == value);
12287        *self = Self::from_bits_retain(
12288            (self.bits() & !(Self::PAN_MASK << offset)) | ((value as u32) << offset),
12289        );
12290    }
12291
12292    /// Returns the value of the `CohWalk` field.
12293    pub const fn cohwalk(self) -> u8 {
12294        ((self.bits() >> Self::COHWALK_SHIFT) & 0b1111) as u8
12295    }
12296
12297    /// Sets the value of the `CohWalk` field.
12298    pub const fn set_cohwalk(&mut self, value: u8) {
12299        let offset = Self::COHWALK_SHIFT;
12300        assert!(value & (Self::COHWALK_MASK as u8) == value);
12301        *self = Self::from_bits_retain(
12302            (self.bits() & !(Self::COHWALK_MASK << offset)) | ((value as u32) << offset),
12303        );
12304    }
12305
12306    /// Returns the value of the `CMemSz` field.
12307    pub const fn cmemsz(self) -> u8 {
12308        ((self.bits() >> Self::CMEMSZ_SHIFT) & 0b1111) as u8
12309    }
12310
12311    /// Sets the value of the `CMemSz` field.
12312    pub const fn set_cmemsz(&mut self, value: u8) {
12313        let offset = Self::CMEMSZ_SHIFT;
12314        assert!(value & (Self::CMEMSZ_MASK as u8) == value);
12315        *self = Self::from_bits_retain(
12316            (self.bits() & !(Self::CMEMSZ_MASK << offset)) | ((value as u32) << offset),
12317        );
12318    }
12319
12320    /// Returns the value of the `Supersec` field.
12321    pub const fn supersec(self) -> u8 {
12322        ((self.bits() >> Self::SUPERSEC_SHIFT) & 0b1111) as u8
12323    }
12324
12325    /// Sets the value of the `Supersec` field.
12326    pub const fn set_supersec(&mut self, value: u8) {
12327        let offset = Self::SUPERSEC_SHIFT;
12328        assert!(value & (Self::SUPERSEC_MASK as u8) == value);
12329        *self = Self::from_bits_retain(
12330            (self.bits() & !(Self::SUPERSEC_MASK << offset)) | ((value as u32) << offset),
12331        );
12332    }
12333}
12334
12335bitflags! {
12336    /// `ID_MMFR4` system register value.
12337    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12338    #[repr(transparent)]
12339    pub struct IdMmfr4: u32 {
12340    }
12341}
12342
12343impl IdMmfr4 {
12344    /// Offset of the `SpecSEI` field.
12345    pub const SPECSEI_SHIFT: u32 = 0;
12346    /// Mask for the `SpecSEI` field.
12347    pub const SPECSEI_MASK: u32 = 0b1111;
12348    /// Offset of the `AC2` field.
12349    pub const AC2_SHIFT: u32 = 4;
12350    /// Mask for the `AC2` field.
12351    pub const AC2_MASK: u32 = 0b1111;
12352    /// Offset of the `XNX` field.
12353    pub const XNX_SHIFT: u32 = 8;
12354    /// Mask for the `XNX` field.
12355    pub const XNX_MASK: u32 = 0b1111;
12356    /// Offset of the `CnP` field.
12357    pub const CNP_SHIFT: u32 = 12;
12358    /// Mask for the `CnP` field.
12359    pub const CNP_MASK: u32 = 0b1111;
12360    /// Offset of the `HPDS` field.
12361    pub const HPDS_SHIFT: u32 = 16;
12362    /// Mask for the `HPDS` field.
12363    pub const HPDS_MASK: u32 = 0b1111;
12364    /// Offset of the `LSM` field.
12365    pub const LSM_SHIFT: u32 = 20;
12366    /// Mask for the `LSM` field.
12367    pub const LSM_MASK: u32 = 0b1111;
12368    /// Offset of the `CCIDX` field.
12369    pub const CCIDX_SHIFT: u32 = 24;
12370    /// Mask for the `CCIDX` field.
12371    pub const CCIDX_MASK: u32 = 0b1111;
12372    /// Offset of the `EVT` field.
12373    pub const EVT_SHIFT: u32 = 28;
12374    /// Mask for the `EVT` field.
12375    pub const EVT_MASK: u32 = 0b1111;
12376
12377    /// Returns the value of the `SpecSEI` field.
12378    pub const fn specsei(self) -> u8 {
12379        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
12380    }
12381
12382    /// Sets the value of the `SpecSEI` field.
12383    pub const fn set_specsei(&mut self, value: u8) {
12384        let offset = Self::SPECSEI_SHIFT;
12385        assert!(value & (Self::SPECSEI_MASK as u8) == value);
12386        *self = Self::from_bits_retain(
12387            (self.bits() & !(Self::SPECSEI_MASK << offset)) | ((value as u32) << offset),
12388        );
12389    }
12390
12391    /// Returns the value of the `AC2` field.
12392    pub const fn ac2(self) -> u8 {
12393        ((self.bits() >> Self::AC2_SHIFT) & 0b1111) as u8
12394    }
12395
12396    /// Sets the value of the `AC2` field.
12397    pub const fn set_ac2(&mut self, value: u8) {
12398        let offset = Self::AC2_SHIFT;
12399        assert!(value & (Self::AC2_MASK as u8) == value);
12400        *self = Self::from_bits_retain(
12401            (self.bits() & !(Self::AC2_MASK << offset)) | ((value as u32) << offset),
12402        );
12403    }
12404
12405    /// Returns the value of the `XNX` field.
12406    pub const fn xnx(self) -> u8 {
12407        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
12408    }
12409
12410    /// Sets the value of the `XNX` field.
12411    pub const fn set_xnx(&mut self, value: u8) {
12412        let offset = Self::XNX_SHIFT;
12413        assert!(value & (Self::XNX_MASK as u8) == value);
12414        *self = Self::from_bits_retain(
12415            (self.bits() & !(Self::XNX_MASK << offset)) | ((value as u32) << offset),
12416        );
12417    }
12418
12419    /// Returns the value of the `CnP` field.
12420    pub const fn cnp(self) -> u8 {
12421        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
12422    }
12423
12424    /// Sets the value of the `CnP` field.
12425    pub const fn set_cnp(&mut self, value: u8) {
12426        let offset = Self::CNP_SHIFT;
12427        assert!(value & (Self::CNP_MASK as u8) == value);
12428        *self = Self::from_bits_retain(
12429            (self.bits() & !(Self::CNP_MASK << offset)) | ((value as u32) << offset),
12430        );
12431    }
12432
12433    /// Returns the value of the `HPDS` field.
12434    pub const fn hpds(self) -> u8 {
12435        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
12436    }
12437
12438    /// Sets the value of the `HPDS` field.
12439    pub const fn set_hpds(&mut self, value: u8) {
12440        let offset = Self::HPDS_SHIFT;
12441        assert!(value & (Self::HPDS_MASK as u8) == value);
12442        *self = Self::from_bits_retain(
12443            (self.bits() & !(Self::HPDS_MASK << offset)) | ((value as u32) << offset),
12444        );
12445    }
12446
12447    /// Returns the value of the `LSM` field.
12448    pub const fn lsm(self) -> u8 {
12449        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
12450    }
12451
12452    /// Sets the value of the `LSM` field.
12453    pub const fn set_lsm(&mut self, value: u8) {
12454        let offset = Self::LSM_SHIFT;
12455        assert!(value & (Self::LSM_MASK as u8) == value);
12456        *self = Self::from_bits_retain(
12457            (self.bits() & !(Self::LSM_MASK << offset)) | ((value as u32) << offset),
12458        );
12459    }
12460
12461    /// Returns the value of the `CCIDX` field.
12462    pub const fn ccidx(self) -> u8 {
12463        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
12464    }
12465
12466    /// Sets the value of the `CCIDX` field.
12467    pub const fn set_ccidx(&mut self, value: u8) {
12468        let offset = Self::CCIDX_SHIFT;
12469        assert!(value & (Self::CCIDX_MASK as u8) == value);
12470        *self = Self::from_bits_retain(
12471            (self.bits() & !(Self::CCIDX_MASK << offset)) | ((value as u32) << offset),
12472        );
12473    }
12474
12475    /// Returns the value of the `EVT` field.
12476    pub const fn evt(self) -> u8 {
12477        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
12478    }
12479
12480    /// Sets the value of the `EVT` field.
12481    pub const fn set_evt(&mut self, value: u8) {
12482        let offset = Self::EVT_SHIFT;
12483        assert!(value & (Self::EVT_MASK as u8) == value);
12484        *self = Self::from_bits_retain(
12485            (self.bits() & !(Self::EVT_MASK << offset)) | ((value as u32) << offset),
12486        );
12487    }
12488}
12489
12490bitflags! {
12491    /// `ID_MMFR5` system register value.
12492    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12493    #[repr(transparent)]
12494    pub struct IdMmfr5: u32 {
12495    }
12496}
12497
12498impl IdMmfr5 {
12499    /// Offset of the `ETS` field.
12500    pub const ETS_SHIFT: u32 = 0;
12501    /// Mask for the `ETS` field.
12502    pub const ETS_MASK: u32 = 0b1111;
12503    /// Offset of the `nTLBPA` field.
12504    pub const NTLBPA_SHIFT: u32 = 4;
12505    /// Mask for the `nTLBPA` field.
12506    pub const NTLBPA_MASK: u32 = 0b1111;
12507
12508    /// Returns the value of the `ETS` field.
12509    pub const fn ets(self) -> u8 {
12510        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
12511    }
12512
12513    /// Sets the value of the `ETS` field.
12514    pub const fn set_ets(&mut self, value: u8) {
12515        let offset = Self::ETS_SHIFT;
12516        assert!(value & (Self::ETS_MASK as u8) == value);
12517        *self = Self::from_bits_retain(
12518            (self.bits() & !(Self::ETS_MASK << offset)) | ((value as u32) << offset),
12519        );
12520    }
12521
12522    /// Returns the value of the `nTLBPA` field.
12523    pub const fn ntlbpa(self) -> u8 {
12524        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
12525    }
12526
12527    /// Sets the value of the `nTLBPA` field.
12528    pub const fn set_ntlbpa(&mut self, value: u8) {
12529        let offset = Self::NTLBPA_SHIFT;
12530        assert!(value & (Self::NTLBPA_MASK as u8) == value);
12531        *self = Self::from_bits_retain(
12532            (self.bits() & !(Self::NTLBPA_MASK << offset)) | ((value as u32) << offset),
12533        );
12534    }
12535}
12536
12537bitflags! {
12538    /// `ID_PFR0` system register value.
12539    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12540    #[repr(transparent)]
12541    pub struct IdPfr0: u32 {
12542    }
12543}
12544
12545impl IdPfr0 {
12546    /// Offset of the `State0` field.
12547    pub const STATE0_SHIFT: u32 = 0;
12548    /// Mask for the `State0` field.
12549    pub const STATE0_MASK: u32 = 0b1111;
12550    /// Offset of the `State1` field.
12551    pub const STATE1_SHIFT: u32 = 4;
12552    /// Mask for the `State1` field.
12553    pub const STATE1_MASK: u32 = 0b1111;
12554    /// Offset of the `State2` field.
12555    pub const STATE2_SHIFT: u32 = 8;
12556    /// Mask for the `State2` field.
12557    pub const STATE2_MASK: u32 = 0b1111;
12558    /// Offset of the `State3` field.
12559    pub const STATE3_SHIFT: u32 = 12;
12560    /// Mask for the `State3` field.
12561    pub const STATE3_MASK: u32 = 0b1111;
12562    /// Offset of the `CSV2` field.
12563    pub const CSV2_SHIFT: u32 = 16;
12564    /// Mask for the `CSV2` field.
12565    pub const CSV2_MASK: u32 = 0b1111;
12566    /// Offset of the `AMU` field.
12567    pub const AMU_SHIFT: u32 = 20;
12568    /// Mask for the `AMU` field.
12569    pub const AMU_MASK: u32 = 0b1111;
12570    /// Offset of the `DIT` field.
12571    pub const DIT_SHIFT: u32 = 24;
12572    /// Mask for the `DIT` field.
12573    pub const DIT_MASK: u32 = 0b1111;
12574    /// Offset of the `RAS` field.
12575    pub const RAS_SHIFT: u32 = 28;
12576    /// Mask for the `RAS` field.
12577    pub const RAS_MASK: u32 = 0b1111;
12578
12579    /// Returns the value of the `State0` field.
12580    pub const fn state0(self) -> u8 {
12581        ((self.bits() >> Self::STATE0_SHIFT) & 0b1111) as u8
12582    }
12583
12584    /// Sets the value of the `State0` field.
12585    pub const fn set_state0(&mut self, value: u8) {
12586        let offset = Self::STATE0_SHIFT;
12587        assert!(value & (Self::STATE0_MASK as u8) == value);
12588        *self = Self::from_bits_retain(
12589            (self.bits() & !(Self::STATE0_MASK << offset)) | ((value as u32) << offset),
12590        );
12591    }
12592
12593    /// Returns the value of the `State1` field.
12594    pub const fn state1(self) -> u8 {
12595        ((self.bits() >> Self::STATE1_SHIFT) & 0b1111) as u8
12596    }
12597
12598    /// Sets the value of the `State1` field.
12599    pub const fn set_state1(&mut self, value: u8) {
12600        let offset = Self::STATE1_SHIFT;
12601        assert!(value & (Self::STATE1_MASK as u8) == value);
12602        *self = Self::from_bits_retain(
12603            (self.bits() & !(Self::STATE1_MASK << offset)) | ((value as u32) << offset),
12604        );
12605    }
12606
12607    /// Returns the value of the `State2` field.
12608    pub const fn state2(self) -> u8 {
12609        ((self.bits() >> Self::STATE2_SHIFT) & 0b1111) as u8
12610    }
12611
12612    /// Sets the value of the `State2` field.
12613    pub const fn set_state2(&mut self, value: u8) {
12614        let offset = Self::STATE2_SHIFT;
12615        assert!(value & (Self::STATE2_MASK as u8) == value);
12616        *self = Self::from_bits_retain(
12617            (self.bits() & !(Self::STATE2_MASK << offset)) | ((value as u32) << offset),
12618        );
12619    }
12620
12621    /// Returns the value of the `State3` field.
12622    pub const fn state3(self) -> u8 {
12623        ((self.bits() >> Self::STATE3_SHIFT) & 0b1111) as u8
12624    }
12625
12626    /// Sets the value of the `State3` field.
12627    pub const fn set_state3(&mut self, value: u8) {
12628        let offset = Self::STATE3_SHIFT;
12629        assert!(value & (Self::STATE3_MASK as u8) == value);
12630        *self = Self::from_bits_retain(
12631            (self.bits() & !(Self::STATE3_MASK << offset)) | ((value as u32) << offset),
12632        );
12633    }
12634
12635    /// Returns the value of the `CSV2` field.
12636    pub const fn csv2(self) -> u8 {
12637        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
12638    }
12639
12640    /// Sets the value of the `CSV2` field.
12641    pub const fn set_csv2(&mut self, value: u8) {
12642        let offset = Self::CSV2_SHIFT;
12643        assert!(value & (Self::CSV2_MASK as u8) == value);
12644        *self = Self::from_bits_retain(
12645            (self.bits() & !(Self::CSV2_MASK << offset)) | ((value as u32) << offset),
12646        );
12647    }
12648
12649    /// Returns the value of the `AMU` field.
12650    pub const fn amu(self) -> u8 {
12651        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
12652    }
12653
12654    /// Sets the value of the `AMU` field.
12655    pub const fn set_amu(&mut self, value: u8) {
12656        let offset = Self::AMU_SHIFT;
12657        assert!(value & (Self::AMU_MASK as u8) == value);
12658        *self = Self::from_bits_retain(
12659            (self.bits() & !(Self::AMU_MASK << offset)) | ((value as u32) << offset),
12660        );
12661    }
12662
12663    /// Returns the value of the `DIT` field.
12664    pub const fn dit(self) -> u8 {
12665        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
12666    }
12667
12668    /// Sets the value of the `DIT` field.
12669    pub const fn set_dit(&mut self, value: u8) {
12670        let offset = Self::DIT_SHIFT;
12671        assert!(value & (Self::DIT_MASK as u8) == value);
12672        *self = Self::from_bits_retain(
12673            (self.bits() & !(Self::DIT_MASK << offset)) | ((value as u32) << offset),
12674        );
12675    }
12676
12677    /// Returns the value of the `RAS` field.
12678    pub const fn ras(self) -> u8 {
12679        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
12680    }
12681
12682    /// Sets the value of the `RAS` field.
12683    pub const fn set_ras(&mut self, value: u8) {
12684        let offset = Self::RAS_SHIFT;
12685        assert!(value & (Self::RAS_MASK as u8) == value);
12686        *self = Self::from_bits_retain(
12687            (self.bits() & !(Self::RAS_MASK << offset)) | ((value as u32) << offset),
12688        );
12689    }
12690}
12691
12692bitflags! {
12693    /// `ID_PFR1` system register value.
12694    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12695    #[repr(transparent)]
12696    pub struct IdPfr1: u32 {
12697    }
12698}
12699
12700impl IdPfr1 {
12701    /// Offset of the `ProgMod` field.
12702    pub const PROGMOD_SHIFT: u32 = 0;
12703    /// Mask for the `ProgMod` field.
12704    pub const PROGMOD_MASK: u32 = 0b1111;
12705    /// Offset of the `Security` field.
12706    pub const SECURITY_SHIFT: u32 = 4;
12707    /// Mask for the `Security` field.
12708    pub const SECURITY_MASK: u32 = 0b1111;
12709    /// Offset of the `MProgMod` field.
12710    pub const MPROGMOD_SHIFT: u32 = 8;
12711    /// Mask for the `MProgMod` field.
12712    pub const MPROGMOD_MASK: u32 = 0b1111;
12713    /// Offset of the `Virtualization` field.
12714    pub const VIRTUALIZATION_SHIFT: u32 = 12;
12715    /// Mask for the `Virtualization` field.
12716    pub const VIRTUALIZATION_MASK: u32 = 0b1111;
12717    /// Offset of the `GenTimer` field.
12718    pub const GENTIMER_SHIFT: u32 = 16;
12719    /// Mask for the `GenTimer` field.
12720    pub const GENTIMER_MASK: u32 = 0b1111;
12721    /// Offset of the `Sec_frac` field.
12722    pub const SEC_FRAC_SHIFT: u32 = 20;
12723    /// Mask for the `Sec_frac` field.
12724    pub const SEC_FRAC_MASK: u32 = 0b1111;
12725    /// Offset of the `Virt_frac` field.
12726    pub const VIRT_FRAC_SHIFT: u32 = 24;
12727    /// Mask for the `Virt_frac` field.
12728    pub const VIRT_FRAC_MASK: u32 = 0b1111;
12729    /// Offset of the `GIC` field.
12730    pub const GIC_SHIFT: u32 = 28;
12731    /// Mask for the `GIC` field.
12732    pub const GIC_MASK: u32 = 0b1111;
12733
12734    /// Returns the value of the `ProgMod` field.
12735    pub const fn progmod(self) -> u8 {
12736        ((self.bits() >> Self::PROGMOD_SHIFT) & 0b1111) as u8
12737    }
12738
12739    /// Sets the value of the `ProgMod` field.
12740    pub const fn set_progmod(&mut self, value: u8) {
12741        let offset = Self::PROGMOD_SHIFT;
12742        assert!(value & (Self::PROGMOD_MASK as u8) == value);
12743        *self = Self::from_bits_retain(
12744            (self.bits() & !(Self::PROGMOD_MASK << offset)) | ((value as u32) << offset),
12745        );
12746    }
12747
12748    /// Returns the value of the `Security` field.
12749    pub const fn security(self) -> u8 {
12750        ((self.bits() >> Self::SECURITY_SHIFT) & 0b1111) as u8
12751    }
12752
12753    /// Sets the value of the `Security` field.
12754    pub const fn set_security(&mut self, value: u8) {
12755        let offset = Self::SECURITY_SHIFT;
12756        assert!(value & (Self::SECURITY_MASK as u8) == value);
12757        *self = Self::from_bits_retain(
12758            (self.bits() & !(Self::SECURITY_MASK << offset)) | ((value as u32) << offset),
12759        );
12760    }
12761
12762    /// Returns the value of the `MProgMod` field.
12763    pub const fn mprogmod(self) -> u8 {
12764        ((self.bits() >> Self::MPROGMOD_SHIFT) & 0b1111) as u8
12765    }
12766
12767    /// Sets the value of the `MProgMod` field.
12768    pub const fn set_mprogmod(&mut self, value: u8) {
12769        let offset = Self::MPROGMOD_SHIFT;
12770        assert!(value & (Self::MPROGMOD_MASK as u8) == value);
12771        *self = Self::from_bits_retain(
12772            (self.bits() & !(Self::MPROGMOD_MASK << offset)) | ((value as u32) << offset),
12773        );
12774    }
12775
12776    /// Returns the value of the `Virtualization` field.
12777    pub const fn virtualization(self) -> u8 {
12778        ((self.bits() >> Self::VIRTUALIZATION_SHIFT) & 0b1111) as u8
12779    }
12780
12781    /// Sets the value of the `Virtualization` field.
12782    pub const fn set_virtualization(&mut self, value: u8) {
12783        let offset = Self::VIRTUALIZATION_SHIFT;
12784        assert!(value & (Self::VIRTUALIZATION_MASK as u8) == value);
12785        *self = Self::from_bits_retain(
12786            (self.bits() & !(Self::VIRTUALIZATION_MASK << offset)) | ((value as u32) << offset),
12787        );
12788    }
12789
12790    /// Returns the value of the `GenTimer` field.
12791    pub const fn gentimer(self) -> u8 {
12792        ((self.bits() >> Self::GENTIMER_SHIFT) & 0b1111) as u8
12793    }
12794
12795    /// Sets the value of the `GenTimer` field.
12796    pub const fn set_gentimer(&mut self, value: u8) {
12797        let offset = Self::GENTIMER_SHIFT;
12798        assert!(value & (Self::GENTIMER_MASK as u8) == value);
12799        *self = Self::from_bits_retain(
12800            (self.bits() & !(Self::GENTIMER_MASK << offset)) | ((value as u32) << offset),
12801        );
12802    }
12803
12804    /// Returns the value of the `Sec_frac` field.
12805    pub const fn sec_frac(self) -> u8 {
12806        ((self.bits() >> Self::SEC_FRAC_SHIFT) & 0b1111) as u8
12807    }
12808
12809    /// Sets the value of the `Sec_frac` field.
12810    pub const fn set_sec_frac(&mut self, value: u8) {
12811        let offset = Self::SEC_FRAC_SHIFT;
12812        assert!(value & (Self::SEC_FRAC_MASK as u8) == value);
12813        *self = Self::from_bits_retain(
12814            (self.bits() & !(Self::SEC_FRAC_MASK << offset)) | ((value as u32) << offset),
12815        );
12816    }
12817
12818    /// Returns the value of the `Virt_frac` field.
12819    pub const fn virt_frac(self) -> u8 {
12820        ((self.bits() >> Self::VIRT_FRAC_SHIFT) & 0b1111) as u8
12821    }
12822
12823    /// Sets the value of the `Virt_frac` field.
12824    pub const fn set_virt_frac(&mut self, value: u8) {
12825        let offset = Self::VIRT_FRAC_SHIFT;
12826        assert!(value & (Self::VIRT_FRAC_MASK as u8) == value);
12827        *self = Self::from_bits_retain(
12828            (self.bits() & !(Self::VIRT_FRAC_MASK << offset)) | ((value as u32) << offset),
12829        );
12830    }
12831
12832    /// Returns the value of the `GIC` field.
12833    pub const fn gic(self) -> u8 {
12834        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
12835    }
12836
12837    /// Sets the value of the `GIC` field.
12838    pub const fn set_gic(&mut self, value: u8) {
12839        let offset = Self::GIC_SHIFT;
12840        assert!(value & (Self::GIC_MASK as u8) == value);
12841        *self = Self::from_bits_retain(
12842            (self.bits() & !(Self::GIC_MASK << offset)) | ((value as u32) << offset),
12843        );
12844    }
12845}
12846
12847bitflags! {
12848    /// `ID_PFR2` system register value.
12849    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12850    #[repr(transparent)]
12851    pub struct IdPfr2: u32 {
12852    }
12853}
12854
12855impl IdPfr2 {
12856    /// Offset of the `CSV3` field.
12857    pub const CSV3_SHIFT: u32 = 0;
12858    /// Mask for the `CSV3` field.
12859    pub const CSV3_MASK: u32 = 0b1111;
12860    /// Offset of the `SSBS` field.
12861    pub const SSBS_SHIFT: u32 = 4;
12862    /// Mask for the `SSBS` field.
12863    pub const SSBS_MASK: u32 = 0b1111;
12864    /// Offset of the `RAS_frac` field.
12865    pub const RAS_FRAC_SHIFT: u32 = 8;
12866    /// Mask for the `RAS_frac` field.
12867    pub const RAS_FRAC_MASK: u32 = 0b1111;
12868
12869    /// Returns the value of the `CSV3` field.
12870    pub const fn csv3(self) -> u8 {
12871        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
12872    }
12873
12874    /// Sets the value of the `CSV3` field.
12875    pub const fn set_csv3(&mut self, value: u8) {
12876        let offset = Self::CSV3_SHIFT;
12877        assert!(value & (Self::CSV3_MASK as u8) == value);
12878        *self = Self::from_bits_retain(
12879            (self.bits() & !(Self::CSV3_MASK << offset)) | ((value as u32) << offset),
12880        );
12881    }
12882
12883    /// Returns the value of the `SSBS` field.
12884    pub const fn ssbs(self) -> u8 {
12885        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
12886    }
12887
12888    /// Sets the value of the `SSBS` field.
12889    pub const fn set_ssbs(&mut self, value: u8) {
12890        let offset = Self::SSBS_SHIFT;
12891        assert!(value & (Self::SSBS_MASK as u8) == value);
12892        *self = Self::from_bits_retain(
12893            (self.bits() & !(Self::SSBS_MASK << offset)) | ((value as u32) << offset),
12894        );
12895    }
12896
12897    /// Returns the value of the `RAS_frac` field.
12898    pub const fn ras_frac(self) -> u8 {
12899        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
12900    }
12901
12902    /// Sets the value of the `RAS_frac` field.
12903    pub const fn set_ras_frac(&mut self, value: u8) {
12904        let offset = Self::RAS_FRAC_SHIFT;
12905        assert!(value & (Self::RAS_FRAC_MASK as u8) == value);
12906        *self = Self::from_bits_retain(
12907            (self.bits() & !(Self::RAS_FRAC_MASK << offset)) | ((value as u32) << offset),
12908        );
12909    }
12910}
12911
12912bitflags! {
12913    /// `IFAR` system register value.
12914    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12915    #[repr(transparent)]
12916    pub struct Ifar: u32 {
12917    }
12918}
12919
12920impl Ifar {
12921    /// Offset of the `VA` field.
12922    pub const VA_SHIFT: u32 = 0;
12923    /// Mask for the `VA` field.
12924    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
12925
12926    /// Returns the value of the `VA` field.
12927    pub const fn va(self) -> u32 {
12928        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
12929    }
12930
12931    /// Sets the value of the `VA` field.
12932    pub const fn set_va(&mut self, value: u32) {
12933        let offset = Self::VA_SHIFT;
12934        assert!(value & (Self::VA_MASK as u32) == value);
12935        *self = Self::from_bits_retain(
12936            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
12937        );
12938    }
12939}
12940
12941bitflags! {
12942    /// `IFSR` system register value.
12943    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12944    #[repr(transparent)]
12945    pub struct Ifsr: u32 {
12946        /// `LPAE` bit.
12947        const LPAE = 1 << 9;
12948        /// `ExT` bit.
12949        const EXT = 1 << 12;
12950        /// `FnV` bit.
12951        const FNV = 1 << 16;
12952    }
12953}
12954
12955impl Ifsr {
12956    /// Offset of the `STATUS` field.
12957    pub const STATUS_SHIFT: u32 = 0;
12958    /// Mask for the `STATUS` field.
12959    pub const STATUS_MASK: u32 = 0b111111;
12960    /// Offset of the `LPAE` field.
12961    pub const LPAE_SHIFT: u32 = 9;
12962    /// Offset of the `ExT` field.
12963    pub const EXT_SHIFT: u32 = 12;
12964    /// Offset of the `FnV` field.
12965    pub const FNV_SHIFT: u32 = 16;
12966
12967    /// Returns the value of the `STATUS` field.
12968    pub const fn status(self) -> u8 {
12969        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
12970    }
12971
12972    /// Sets the value of the `STATUS` field.
12973    pub const fn set_status(&mut self, value: u8) {
12974        let offset = Self::STATUS_SHIFT;
12975        assert!(value & (Self::STATUS_MASK as u8) == value);
12976        *self = Self::from_bits_retain(
12977            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
12978        );
12979    }
12980}
12981
12982bitflags! {
12983    /// `ISR` system register value.
12984    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12985    #[repr(transparent)]
12986    pub struct Isr: u32 {
12987        /// `F` bit.
12988        const F = 1 << 6;
12989        /// `I` bit.
12990        const I = 1 << 7;
12991        /// `A` bit.
12992        const A = 1 << 8;
12993    }
12994}
12995
12996impl Isr {
12997    /// Offset of the `F` field.
12998    pub const F_SHIFT: u32 = 6;
12999    /// Offset of the `I` field.
13000    pub const I_SHIFT: u32 = 7;
13001    /// Offset of the `A` field.
13002    pub const A_SHIFT: u32 = 8;
13003}
13004
13005#[cfg(feature = "el1")]
13006bitflags! {
13007    /// `ISR_EL1` system register value.
13008    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13009    #[repr(transparent)]
13010    pub struct IsrEl1: u64 {
13011        /// `F` bit.
13012        const F = 1 << 6;
13013        /// `I` bit.
13014        const I = 1 << 7;
13015        /// `A` bit.
13016        const A = 1 << 8;
13017        /// `FS` bit.
13018        const FS = 1 << 9;
13019        /// `IS` bit.
13020        const IS = 1 << 10;
13021    }
13022}
13023
13024#[cfg(feature = "el1")]
13025impl IsrEl1 {
13026    /// Offset of the `F` field.
13027    pub const F_SHIFT: u32 = 6;
13028    /// Offset of the `I` field.
13029    pub const I_SHIFT: u32 = 7;
13030    /// Offset of the `A` field.
13031    pub const A_SHIFT: u32 = 8;
13032    /// Offset of the `FS` field.
13033    pub const FS_SHIFT: u32 = 9;
13034    /// Offset of the `IS` field.
13035    pub const IS_SHIFT: u32 = 10;
13036}
13037
13038bitflags! {
13039    /// `MAIR0` system register value.
13040    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13041    #[repr(transparent)]
13042    pub struct Mair0: u32 {
13043    }
13044}
13045
13046impl Mair0 {
13047    /// Offset of the `Attr<n>` field.
13048    pub const ATTR_SHIFT: u32 = 0;
13049    /// Mask for the `Attr<n>` field.
13050    pub const ATTR_MASK: u32 = 0b11111111;
13051
13052    /// Returns the value of the given `Attr<n>` field.
13053    pub const fn attr(self, n: u32) -> u8 {
13054        assert!(n < 4);
13055        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
13056    }
13057
13058    /// Sets the value of the `Attr<n>` field.
13059    pub const fn set_attr(&mut self, n: u32, value: u8) {
13060        assert!(n < 4);
13061        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
13062        assert!(value & (Self::ATTR_MASK as u8) == value);
13063        *self = Self::from_bits_retain(
13064            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
13065        );
13066    }
13067}
13068
13069bitflags! {
13070    /// `MAIR1` system register value.
13071    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13072    #[repr(transparent)]
13073    pub struct Mair1: u32 {
13074    }
13075}
13076
13077impl Mair1 {
13078    /// Offset of the `Attr<n>` field.
13079    pub const ATTR_SHIFT: u32 = 0;
13080    /// Mask for the `Attr<n>` field.
13081    pub const ATTR_MASK: u32 = 0b11111111;
13082
13083    /// Returns the value of the given `Attr<n>` field.
13084    pub const fn attr(self, n: u32) -> u8 {
13085        assert!(n >= 4 && n < 8);
13086        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
13087    }
13088
13089    /// Sets the value of the `Attr<n>` field.
13090    pub const fn set_attr(&mut self, n: u32, value: u8) {
13091        assert!(n >= 4 && n < 8);
13092        let offset = Self::ATTR_SHIFT + (n - 4) * 8;
13093        assert!(value & (Self::ATTR_MASK as u8) == value);
13094        *self = Self::from_bits_retain(
13095            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
13096        );
13097    }
13098}
13099
13100#[cfg(feature = "el1")]
13101bitflags! {
13102    /// `MAIR_EL1` system register value.
13103    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13104    #[repr(transparent)]
13105    pub struct MairEl1: u64 {
13106    }
13107}
13108
13109#[cfg(feature = "el1")]
13110impl MairEl1 {
13111    /// Offset of the `Attr<n>` field.
13112    pub const ATTR_SHIFT: u32 = 0;
13113    /// Mask for the `Attr<n>` field.
13114    pub const ATTR_MASK: u64 = 0b11111111;
13115
13116    /// Returns the value of the given `Attr<n>` field.
13117    pub const fn attr(self, n: u32) -> u8 {
13118        assert!(n < 8);
13119        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
13120    }
13121
13122    /// Sets the value of the `Attr<n>` field.
13123    pub const fn set_attr(&mut self, n: u32, value: u8) {
13124        assert!(n < 8);
13125        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
13126        assert!(value & (Self::ATTR_MASK as u8) == value);
13127        *self = Self::from_bits_retain(
13128            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
13129        );
13130    }
13131}
13132
13133#[cfg(feature = "el2")]
13134bitflags! {
13135    /// `MAIR_EL2` system register value.
13136    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13137    #[repr(transparent)]
13138    pub struct MairEl2: u64 {
13139    }
13140}
13141
13142#[cfg(feature = "el2")]
13143impl MairEl2 {
13144    /// Offset of the `Attr<n>` field.
13145    pub const ATTR_SHIFT: u32 = 0;
13146    /// Mask for the `Attr<n>` field.
13147    pub const ATTR_MASK: u64 = 0b11111111;
13148
13149    /// Returns the value of the given `Attr<n>` field.
13150    pub const fn attr(self, n: u32) -> u8 {
13151        assert!(n < 8);
13152        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
13153    }
13154
13155    /// Sets the value of the `Attr<n>` field.
13156    pub const fn set_attr(&mut self, n: u32, value: u8) {
13157        assert!(n < 8);
13158        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
13159        assert!(value & (Self::ATTR_MASK as u8) == value);
13160        *self = Self::from_bits_retain(
13161            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
13162        );
13163    }
13164}
13165
13166#[cfg(feature = "el3")]
13167bitflags! {
13168    /// `MAIR_EL3` system register value.
13169    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13170    #[repr(transparent)]
13171    pub struct MairEl3: u64 {
13172    }
13173}
13174
13175#[cfg(feature = "el3")]
13176impl MairEl3 {
13177    /// Offset of the `Attr<n>` field.
13178    pub const ATTR_SHIFT: u32 = 0;
13179    /// Mask for the `Attr<n>` field.
13180    pub const ATTR_MASK: u64 = 0b11111111;
13181
13182    /// Returns the value of the given `Attr<n>` field.
13183    pub const fn attr(self, n: u32) -> u8 {
13184        assert!(n < 8);
13185        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
13186    }
13187
13188    /// Sets the value of the `Attr<n>` field.
13189    pub const fn set_attr(&mut self, n: u32, value: u8) {
13190        assert!(n < 8);
13191        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
13192        assert!(value & (Self::ATTR_MASK as u8) == value);
13193        *self = Self::from_bits_retain(
13194            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
13195        );
13196    }
13197}
13198
13199#[cfg(feature = "el1")]
13200bitflags! {
13201    /// `MDCCINT_EL1` system register value.
13202    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13203    #[repr(transparent)]
13204    pub struct MdccintEl1: u64 {
13205        /// `TX` bit.
13206        const TX = 1 << 29;
13207        /// `RX` bit.
13208        const RX = 1 << 30;
13209    }
13210}
13211
13212#[cfg(feature = "el1")]
13213impl MdccintEl1 {
13214    /// Offset of the `TX` field.
13215    pub const TX_SHIFT: u32 = 29;
13216    /// Offset of the `RX` field.
13217    pub const RX_SHIFT: u32 = 30;
13218}
13219
13220#[cfg(feature = "el2")]
13221bitflags! {
13222    /// `MDCR_EL2` system register value.
13223    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13224    #[repr(transparent)]
13225    pub struct MdcrEl2: u64 {
13226        /// `TPMCR` bit.
13227        const TPMCR = 1 << 5;
13228        /// `TPM` bit.
13229        const TPM = 1 << 6;
13230        /// `HPME` bit.
13231        const HPME = 1 << 7;
13232        /// `TDE` bit.
13233        const TDE = 1 << 8;
13234        /// `TDA` bit.
13235        const TDA = 1 << 9;
13236        /// `TDOSA` bit.
13237        const TDOSA = 1 << 10;
13238        /// `TDRA` bit.
13239        const TDRA = 1 << 11;
13240        /// `TPMS` bit.
13241        const TPMS = 1 << 14;
13242        /// `EnSPM` bit.
13243        const ENSPM = 1 << 15;
13244        /// `HPMD` bit.
13245        const HPMD = 1 << 17;
13246        /// `TTRF` bit.
13247        const TTRF = 1 << 19;
13248        /// `HCCD` bit.
13249        const HCCD = 1 << 23;
13250        /// `HLP` bit.
13251        const HLP = 1 << 26;
13252        /// `TDCC` bit.
13253        const TDCC = 1 << 27;
13254        /// `MTPME` bit.
13255        const MTPME = 1 << 28;
13256        /// `HPMFZO` bit.
13257        const HPMFZO = 1 << 29;
13258        /// `HPMFZS` bit.
13259        const HPMFZS = 1 << 36;
13260        /// `EBWE` bit.
13261        const EBWE = 1 << 43;
13262        /// `EnSTEPOP` bit.
13263        const ENSTEPOP = 1 << 50;
13264    }
13265}
13266
13267#[cfg(feature = "el2")]
13268impl MdcrEl2 {
13269    /// Offset of the `HPMN` field.
13270    pub const HPMN_SHIFT: u32 = 0;
13271    /// Mask for the `HPMN` field.
13272    pub const HPMN_MASK: u64 = 0b11111;
13273    /// Offset of the `TPMCR` field.
13274    pub const TPMCR_SHIFT: u32 = 5;
13275    /// Offset of the `TPM` field.
13276    pub const TPM_SHIFT: u32 = 6;
13277    /// Offset of the `HPME` field.
13278    pub const HPME_SHIFT: u32 = 7;
13279    /// Offset of the `TDE` field.
13280    pub const TDE_SHIFT: u32 = 8;
13281    /// Offset of the `TDA` field.
13282    pub const TDA_SHIFT: u32 = 9;
13283    /// Offset of the `TDOSA` field.
13284    pub const TDOSA_SHIFT: u32 = 10;
13285    /// Offset of the `TDRA` field.
13286    pub const TDRA_SHIFT: u32 = 11;
13287    /// Offset of the `E2PB` field.
13288    pub const E2PB_SHIFT: u32 = 12;
13289    /// Mask for the `E2PB` field.
13290    pub const E2PB_MASK: u64 = 0b11;
13291    /// Offset of the `TPMS` field.
13292    pub const TPMS_SHIFT: u32 = 14;
13293    /// Offset of the `EnSPM` field.
13294    pub const ENSPM_SHIFT: u32 = 15;
13295    /// Offset of the `HPMD` field.
13296    pub const HPMD_SHIFT: u32 = 17;
13297    /// Offset of the `TTRF` field.
13298    pub const TTRF_SHIFT: u32 = 19;
13299    /// Offset of the `HCCD` field.
13300    pub const HCCD_SHIFT: u32 = 23;
13301    /// Offset of the `E2TB` field.
13302    pub const E2TB_SHIFT: u32 = 24;
13303    /// Mask for the `E2TB` field.
13304    pub const E2TB_MASK: u64 = 0b11;
13305    /// Offset of the `HLP` field.
13306    pub const HLP_SHIFT: u32 = 26;
13307    /// Offset of the `TDCC` field.
13308    pub const TDCC_SHIFT: u32 = 27;
13309    /// Offset of the `MTPME` field.
13310    pub const MTPME_SHIFT: u32 = 28;
13311    /// Offset of the `HPMFZO` field.
13312    pub const HPMFZO_SHIFT: u32 = 29;
13313    /// Offset of the `PMSSE` field.
13314    pub const PMSSE_SHIFT: u32 = 30;
13315    /// Mask for the `PMSSE` field.
13316    pub const PMSSE_MASK: u64 = 0b11;
13317    /// Offset of the `HPMFZS` field.
13318    pub const HPMFZS_SHIFT: u32 = 36;
13319    /// Offset of the `PMEE` field.
13320    pub const PMEE_SHIFT: u32 = 40;
13321    /// Mask for the `PMEE` field.
13322    pub const PMEE_MASK: u64 = 0b11;
13323    /// Offset of the `EBWE` field.
13324    pub const EBWE_SHIFT: u32 = 43;
13325    /// Offset of the `EnSTEPOP` field.
13326    pub const ENSTEPOP_SHIFT: u32 = 50;
13327
13328    /// Returns the value of the `HPMN` field.
13329    pub const fn hpmn(self) -> u8 {
13330        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
13331    }
13332
13333    /// Sets the value of the `HPMN` field.
13334    pub const fn set_hpmn(&mut self, value: u8) {
13335        let offset = Self::HPMN_SHIFT;
13336        assert!(value & (Self::HPMN_MASK as u8) == value);
13337        *self = Self::from_bits_retain(
13338            (self.bits() & !(Self::HPMN_MASK << offset)) | ((value as u64) << offset),
13339        );
13340    }
13341
13342    /// Returns the value of the `E2PB` field.
13343    pub const fn e2pb(self) -> u8 {
13344        ((self.bits() >> Self::E2PB_SHIFT) & 0b11) as u8
13345    }
13346
13347    /// Sets the value of the `E2PB` field.
13348    pub const fn set_e2pb(&mut self, value: u8) {
13349        let offset = Self::E2PB_SHIFT;
13350        assert!(value & (Self::E2PB_MASK as u8) == value);
13351        *self = Self::from_bits_retain(
13352            (self.bits() & !(Self::E2PB_MASK << offset)) | ((value as u64) << offset),
13353        );
13354    }
13355
13356    /// Returns the value of the `E2TB` field.
13357    pub const fn e2tb(self) -> u8 {
13358        ((self.bits() >> Self::E2TB_SHIFT) & 0b11) as u8
13359    }
13360
13361    /// Sets the value of the `E2TB` field.
13362    pub const fn set_e2tb(&mut self, value: u8) {
13363        let offset = Self::E2TB_SHIFT;
13364        assert!(value & (Self::E2TB_MASK as u8) == value);
13365        *self = Self::from_bits_retain(
13366            (self.bits() & !(Self::E2TB_MASK << offset)) | ((value as u64) << offset),
13367        );
13368    }
13369
13370    /// Returns the value of the `PMSSE` field.
13371    pub const fn pmsse(self) -> u8 {
13372        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
13373    }
13374
13375    /// Sets the value of the `PMSSE` field.
13376    pub const fn set_pmsse(&mut self, value: u8) {
13377        let offset = Self::PMSSE_SHIFT;
13378        assert!(value & (Self::PMSSE_MASK as u8) == value);
13379        *self = Self::from_bits_retain(
13380            (self.bits() & !(Self::PMSSE_MASK << offset)) | ((value as u64) << offset),
13381        );
13382    }
13383
13384    /// Returns the value of the `PMEE` field.
13385    pub const fn pmee(self) -> u8 {
13386        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
13387    }
13388
13389    /// Sets the value of the `PMEE` field.
13390    pub const fn set_pmee(&mut self, value: u8) {
13391        let offset = Self::PMEE_SHIFT;
13392        assert!(value & (Self::PMEE_MASK as u8) == value);
13393        *self = Self::from_bits_retain(
13394            (self.bits() & !(Self::PMEE_MASK << offset)) | ((value as u64) << offset),
13395        );
13396    }
13397}
13398
13399#[cfg(feature = "el3")]
13400bitflags! {
13401    /// `MDCR_EL3` system register value.
13402    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13403    #[repr(transparent)]
13404    pub struct MdcrEl3: u64 {
13405        /// Realm Trace enable. Enables tracing in Realm state.
13406        const RLTE = 1 << 0;
13407        /// `EPMADE` bit.
13408        const EPMADE = 1 << 2;
13409        /// `ETADE` bit.
13410        const ETADE = 1 << 3;
13411        /// `EDADE` bit.
13412        const EDADE = 1 << 4;
13413        /// Trap Performance Monitor register accesses
13414        const TPM = 1 << 6;
13415        /// Do not trap various PMUv3p9 related system register accesses to EL3.
13416        const ENPM2 = 1 << 7;
13417        /// `TDA` bit.
13418        const TDA = 1 << 9;
13419        /// `TDOSA` bit.
13420        const TDOSA = 1 << 10;
13421        /// 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.
13422        const NSPBE = 1 << 11;
13423        /// 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.
13424        const SDD = 1 << 16;
13425        /// Secure Performance Monitors Enable. Controls event counting in Secure state and EL3.
13426        const SPME = 1 << 17;
13427        /// Secure Trace enable. Enables tracing in Secure state.
13428        const STE = 1 << 18;
13429        /// Trap Trace Filter controls. Traps use of the Trace Filter control registers at EL2 and EL1 to EL3.
13430        const TTRF = 1 << 19;
13431        /// `EDAD` bit.
13432        const EDAD = 1 << 20;
13433        /// `EPMAD` bit.
13434        const EPMAD = 1 << 21;
13435        /// `ETAD` bit.
13436        const ETAD = 1 << 22;
13437        /// Secure Cycle Counter Disable. Prohibits PMCCNTR_EL0 from counting in Secure state.
13438        const SCCD = 1 << 23;
13439        /// 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.
13440        const NSTBE = 1 << 26;
13441        /// `TDCC` bit.
13442        const TDCC = 1 << 27;
13443        /// Multi-threaded PMU Enable. Enables use of the PMEVTYPER<n>_EL0.MT bits.
13444        const MTPME = 1 << 28;
13445        /// Monitor Cycle Counter Disable. Prohibits the Cycle Counter, PMCCNTR_EL0, from counting at EL3.
13446        const MCCD = 1 << 34;
13447        /// 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.
13448        const MPMX = 1 << 35;
13449        /// Trap accesses to PMSNEVFR_EL1. Controls access to Statistical Profiling PMSNEVFR_EL1 System register from EL2 and EL1.
13450        const ENPMSN = 1 << 36;
13451        /// `E3BREW` bit.
13452        const E3BREW = 1 << 37;
13453        /// `E3BREC` bit.
13454        const E3BREC = 1 << 38;
13455        /// `EnTB2` bit.
13456        const ENTB2 = 1 << 39;
13457        /// Enable access to SPE registers. When disabled, accesses to SPE registers generate a trap to EL3.
13458        const ENPMS3 = 1 << 42;
13459        /// `EBWE` bit.
13460        const EBWE = 1 << 43;
13461        /// `EnPMSS` bit.
13462        const ENPMSS = 1 << 44;
13463        /// `EnITE` bit.
13464        const ENITE = 1 << 47;
13465        /// `EnSTEPOP` bit.
13466        const ENSTEPOP = 1 << 50;
13467        /// `EnPMS4` bit.
13468        const ENPMS4 = 1 << 55;
13469    }
13470}
13471
13472#[cfg(feature = "el3")]
13473impl MdcrEl3 {
13474    /// Offset of the `RLTE` field.
13475    pub const RLTE_SHIFT: u32 = 0;
13476    /// Offset of the `EPMADE` field.
13477    pub const EPMADE_SHIFT: u32 = 2;
13478    /// Offset of the `ETADE` field.
13479    pub const ETADE_SHIFT: u32 = 3;
13480    /// Offset of the `EDADE` field.
13481    pub const EDADE_SHIFT: u32 = 4;
13482    /// Offset of the `TPM` field.
13483    pub const TPM_SHIFT: u32 = 6;
13484    /// Offset of the `EnPM2` field.
13485    pub const ENPM2_SHIFT: u32 = 7;
13486    /// Offset of the `TDA` field.
13487    pub const TDA_SHIFT: u32 = 9;
13488    /// Offset of the `TDOSA` field.
13489    pub const TDOSA_SHIFT: u32 = 10;
13490    /// Offset of the `NSPBE` field.
13491    pub const NSPBE_SHIFT: u32 = 11;
13492    /// Offset of the `NSPB` field.
13493    pub const NSPB_SHIFT: u32 = 12;
13494    /// Mask for the `NSPB` field.
13495    pub const NSPB_MASK: u64 = 0b11;
13496    /// Offset of the `SPD32` field.
13497    pub const SPD32_SHIFT: u32 = 14;
13498    /// Mask for the `SPD32` field.
13499    pub const SPD32_MASK: u64 = 0b11;
13500    /// Offset of the `SDD` field.
13501    pub const SDD_SHIFT: u32 = 16;
13502    /// Offset of the `SPME` field.
13503    pub const SPME_SHIFT: u32 = 17;
13504    /// Offset of the `STE` field.
13505    pub const STE_SHIFT: u32 = 18;
13506    /// Offset of the `TTRF` field.
13507    pub const TTRF_SHIFT: u32 = 19;
13508    /// Offset of the `EDAD` field.
13509    pub const EDAD_SHIFT: u32 = 20;
13510    /// Offset of the `EPMAD` field.
13511    pub const EPMAD_SHIFT: u32 = 21;
13512    /// Offset of the `ETAD` field.
13513    pub const ETAD_SHIFT: u32 = 22;
13514    /// Offset of the `SCCD` field.
13515    pub const SCCD_SHIFT: u32 = 23;
13516    /// Offset of the `NSTB` field.
13517    pub const NSTB_SHIFT: u32 = 24;
13518    /// Mask for the `NSTB` field.
13519    pub const NSTB_MASK: u64 = 0b11;
13520    /// Offset of the `NSTBE` field.
13521    pub const NSTBE_SHIFT: u32 = 26;
13522    /// Offset of the `TDCC` field.
13523    pub const TDCC_SHIFT: u32 = 27;
13524    /// Offset of the `MTPME` field.
13525    pub const MTPME_SHIFT: u32 = 28;
13526    /// Offset of the `PMSSE` field.
13527    pub const PMSSE_SHIFT: u32 = 30;
13528    /// Mask for the `PMSSE` field.
13529    pub const PMSSE_MASK: u64 = 0b11;
13530    /// Offset of the `SBRBE` field.
13531    pub const SBRBE_SHIFT: u32 = 32;
13532    /// Mask for the `SBRBE` field.
13533    pub const SBRBE_MASK: u64 = 0b11;
13534    /// Offset of the `MCCD` field.
13535    pub const MCCD_SHIFT: u32 = 34;
13536    /// Offset of the `MPMX` field.
13537    pub const MPMX_SHIFT: u32 = 35;
13538    /// Offset of the `EnPMSN` field.
13539    pub const ENPMSN_SHIFT: u32 = 36;
13540    /// Offset of the `E3BREW` field.
13541    pub const E3BREW_SHIFT: u32 = 37;
13542    /// Offset of the `E3BREC` field.
13543    pub const E3BREC_SHIFT: u32 = 38;
13544    /// Offset of the `EnTB2` field.
13545    pub const ENTB2_SHIFT: u32 = 39;
13546    /// Offset of the `PMEE` field.
13547    pub const PMEE_SHIFT: u32 = 40;
13548    /// Mask for the `PMEE` field.
13549    pub const PMEE_MASK: u64 = 0b11;
13550    /// Offset of the `EnPMS3` field.
13551    pub const ENPMS3_SHIFT: u32 = 42;
13552    /// Offset of the `EBWE` field.
13553    pub const EBWE_SHIFT: u32 = 43;
13554    /// Offset of the `EnPMSS` field.
13555    pub const ENPMSS_SHIFT: u32 = 44;
13556    /// Offset of the `EPMSSAD` field.
13557    pub const EPMSSAD_SHIFT: u32 = 45;
13558    /// Mask for the `EPMSSAD` field.
13559    pub const EPMSSAD_MASK: u64 = 0b11;
13560    /// Offset of the `EnITE` field.
13561    pub const ENITE_SHIFT: u32 = 47;
13562    /// Offset of the `ETBAD` field.
13563    pub const ETBAD_SHIFT: u32 = 48;
13564    /// Mask for the `ETBAD` field.
13565    pub const ETBAD_MASK: u64 = 0b11;
13566    /// Offset of the `EnSTEPOP` field.
13567    pub const ENSTEPOP_SHIFT: u32 = 50;
13568    /// Offset of the `PMSEE` field.
13569    pub const PMSEE_SHIFT: u32 = 51;
13570    /// Mask for the `PMSEE` field.
13571    pub const PMSEE_MASK: u64 = 0b11;
13572    /// Offset of the `TRBEE` field.
13573    pub const TRBEE_SHIFT: u32 = 53;
13574    /// Mask for the `TRBEE` field.
13575    pub const TRBEE_MASK: u64 = 0b11;
13576    /// Offset of the `EnPMS4` field.
13577    pub const ENPMS4_SHIFT: u32 = 55;
13578
13579    /// Returns the value of the `NSPB` field.
13580    pub const fn nspb(self) -> u8 {
13581        ((self.bits() >> Self::NSPB_SHIFT) & 0b11) as u8
13582    }
13583
13584    /// Sets the value of the `NSPB` field.
13585    pub const fn set_nspb(&mut self, value: u8) {
13586        let offset = Self::NSPB_SHIFT;
13587        assert!(value & (Self::NSPB_MASK as u8) == value);
13588        *self = Self::from_bits_retain(
13589            (self.bits() & !(Self::NSPB_MASK << offset)) | ((value as u64) << offset),
13590        );
13591    }
13592
13593    /// Returns the value of the `SPD32` field.
13594    pub const fn spd32(self) -> u8 {
13595        ((self.bits() >> Self::SPD32_SHIFT) & 0b11) as u8
13596    }
13597
13598    /// Sets the value of the `SPD32` field.
13599    pub const fn set_spd32(&mut self, value: u8) {
13600        let offset = Self::SPD32_SHIFT;
13601        assert!(value & (Self::SPD32_MASK as u8) == value);
13602        *self = Self::from_bits_retain(
13603            (self.bits() & !(Self::SPD32_MASK << offset)) | ((value as u64) << offset),
13604        );
13605    }
13606
13607    /// Returns the value of the `NSTB` field.
13608    pub const fn nstb(self) -> u8 {
13609        ((self.bits() >> Self::NSTB_SHIFT) & 0b11) as u8
13610    }
13611
13612    /// Sets the value of the `NSTB` field.
13613    pub const fn set_nstb(&mut self, value: u8) {
13614        let offset = Self::NSTB_SHIFT;
13615        assert!(value & (Self::NSTB_MASK as u8) == value);
13616        *self = Self::from_bits_retain(
13617            (self.bits() & !(Self::NSTB_MASK << offset)) | ((value as u64) << offset),
13618        );
13619    }
13620
13621    /// Returns the value of the `PMSSE` field.
13622    pub const fn pmsse(self) -> u8 {
13623        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
13624    }
13625
13626    /// Sets the value of the `PMSSE` field.
13627    pub const fn set_pmsse(&mut self, value: u8) {
13628        let offset = Self::PMSSE_SHIFT;
13629        assert!(value & (Self::PMSSE_MASK as u8) == value);
13630        *self = Self::from_bits_retain(
13631            (self.bits() & !(Self::PMSSE_MASK << offset)) | ((value as u64) << offset),
13632        );
13633    }
13634
13635    /// Returns the value of the `SBRBE` field.
13636    pub const fn sbrbe(self) -> u8 {
13637        ((self.bits() >> Self::SBRBE_SHIFT) & 0b11) as u8
13638    }
13639
13640    /// Sets the value of the `SBRBE` field.
13641    pub const fn set_sbrbe(&mut self, value: u8) {
13642        let offset = Self::SBRBE_SHIFT;
13643        assert!(value & (Self::SBRBE_MASK as u8) == value);
13644        *self = Self::from_bits_retain(
13645            (self.bits() & !(Self::SBRBE_MASK << offset)) | ((value as u64) << offset),
13646        );
13647    }
13648
13649    /// Returns the value of the `PMEE` field.
13650    pub const fn pmee(self) -> u8 {
13651        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
13652    }
13653
13654    /// Sets the value of the `PMEE` field.
13655    pub const fn set_pmee(&mut self, value: u8) {
13656        let offset = Self::PMEE_SHIFT;
13657        assert!(value & (Self::PMEE_MASK as u8) == value);
13658        *self = Self::from_bits_retain(
13659            (self.bits() & !(Self::PMEE_MASK << offset)) | ((value as u64) << offset),
13660        );
13661    }
13662
13663    /// Returns the value of the `EPMSSAD` field.
13664    pub const fn epmssad(self) -> u8 {
13665        ((self.bits() >> Self::EPMSSAD_SHIFT) & 0b11) as u8
13666    }
13667
13668    /// Sets the value of the `EPMSSAD` field.
13669    pub const fn set_epmssad(&mut self, value: u8) {
13670        let offset = Self::EPMSSAD_SHIFT;
13671        assert!(value & (Self::EPMSSAD_MASK as u8) == value);
13672        *self = Self::from_bits_retain(
13673            (self.bits() & !(Self::EPMSSAD_MASK << offset)) | ((value as u64) << offset),
13674        );
13675    }
13676
13677    /// Returns the value of the `ETBAD` field.
13678    pub const fn etbad(self) -> u8 {
13679        ((self.bits() >> Self::ETBAD_SHIFT) & 0b11) as u8
13680    }
13681
13682    /// Sets the value of the `ETBAD` field.
13683    pub const fn set_etbad(&mut self, value: u8) {
13684        let offset = Self::ETBAD_SHIFT;
13685        assert!(value & (Self::ETBAD_MASK as u8) == value);
13686        *self = Self::from_bits_retain(
13687            (self.bits() & !(Self::ETBAD_MASK << offset)) | ((value as u64) << offset),
13688        );
13689    }
13690
13691    /// Returns the value of the `PMSEE` field.
13692    pub const fn pmsee(self) -> u8 {
13693        ((self.bits() >> Self::PMSEE_SHIFT) & 0b11) as u8
13694    }
13695
13696    /// Sets the value of the `PMSEE` field.
13697    pub const fn set_pmsee(&mut self, value: u8) {
13698        let offset = Self::PMSEE_SHIFT;
13699        assert!(value & (Self::PMSEE_MASK as u8) == value);
13700        *self = Self::from_bits_retain(
13701            (self.bits() & !(Self::PMSEE_MASK << offset)) | ((value as u64) << offset),
13702        );
13703    }
13704
13705    /// Returns the value of the `TRBEE` field.
13706    pub const fn trbee(self) -> u8 {
13707        ((self.bits() >> Self::TRBEE_SHIFT) & 0b11) as u8
13708    }
13709
13710    /// Sets the value of the `TRBEE` field.
13711    pub const fn set_trbee(&mut self, value: u8) {
13712        let offset = Self::TRBEE_SHIFT;
13713        assert!(value & (Self::TRBEE_MASK as u8) == value);
13714        *self = Self::from_bits_retain(
13715            (self.bits() & !(Self::TRBEE_MASK << offset)) | ((value as u64) << offset),
13716        );
13717    }
13718}
13719
13720#[cfg(feature = "el1")]
13721bitflags! {
13722    /// `MDSCR_EL1` system register value.
13723    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13724    #[repr(transparent)]
13725    pub struct MdscrEl1: u64 {
13726        /// `SS` bit.
13727        const SS = 1 << 0;
13728        /// `ERR` bit.
13729        const ERR = 1 << 6;
13730        /// `TDCC` bit.
13731        const TDCC = 1 << 12;
13732        /// `KDE` bit.
13733        const KDE = 1 << 13;
13734        /// `HDE` bit.
13735        const HDE = 1 << 14;
13736        /// `MDE` bit.
13737        const MDE = 1 << 15;
13738        /// `SC2` bit.
13739        const SC2 = 1 << 19;
13740        /// `TDA` bit.
13741        const TDA = 1 << 21;
13742        /// `TXU` bit.
13743        const TXU = 1 << 26;
13744        /// `RXO` bit.
13745        const RXO = 1 << 27;
13746        /// `TXfull` bit.
13747        const TXFULL = 1 << 29;
13748        /// `RXfull` bit.
13749        const RXFULL = 1 << 30;
13750        /// `TFO` bit.
13751        const TFO = 1 << 31;
13752        /// `EMBWE` bit.
13753        const EMBWE = 1 << 32;
13754        /// `TTA` bit.
13755        const TTA = 1 << 33;
13756        /// `EnSPM` bit.
13757        const ENSPM = 1 << 34;
13758        /// `EHBWE` bit.
13759        const EHBWE = 1 << 35;
13760        /// `EnSTEPOP` bit.
13761        const ENSTEPOP = 1 << 50;
13762    }
13763}
13764
13765#[cfg(feature = "el1")]
13766impl MdscrEl1 {
13767    /// Offset of the `SS` field.
13768    pub const SS_SHIFT: u32 = 0;
13769    /// Offset of the `ERR` field.
13770    pub const ERR_SHIFT: u32 = 6;
13771    /// Offset of the `TDCC` field.
13772    pub const TDCC_SHIFT: u32 = 12;
13773    /// Offset of the `KDE` field.
13774    pub const KDE_SHIFT: u32 = 13;
13775    /// Offset of the `HDE` field.
13776    pub const HDE_SHIFT: u32 = 14;
13777    /// Offset of the `MDE` field.
13778    pub const MDE_SHIFT: u32 = 15;
13779    /// Offset of the `SC2` field.
13780    pub const SC2_SHIFT: u32 = 19;
13781    /// Offset of the `TDA` field.
13782    pub const TDA_SHIFT: u32 = 21;
13783    /// Offset of the `INTdis` field.
13784    pub const INTDIS_SHIFT: u32 = 22;
13785    /// Mask for the `INTdis` field.
13786    pub const INTDIS_MASK: u64 = 0b11;
13787    /// Offset of the `TXU` field.
13788    pub const TXU_SHIFT: u32 = 26;
13789    /// Offset of the `RXO` field.
13790    pub const RXO_SHIFT: u32 = 27;
13791    /// Offset of the `TXfull` field.
13792    pub const TXFULL_SHIFT: u32 = 29;
13793    /// Offset of the `RXfull` field.
13794    pub const RXFULL_SHIFT: u32 = 30;
13795    /// Offset of the `TFO` field.
13796    pub const TFO_SHIFT: u32 = 31;
13797    /// Offset of the `EMBWE` field.
13798    pub const EMBWE_SHIFT: u32 = 32;
13799    /// Offset of the `TTA` field.
13800    pub const TTA_SHIFT: u32 = 33;
13801    /// Offset of the `EnSPM` field.
13802    pub const ENSPM_SHIFT: u32 = 34;
13803    /// Offset of the `EHBWE` field.
13804    pub const EHBWE_SHIFT: u32 = 35;
13805    /// Offset of the `EnSTEPOP` field.
13806    pub const ENSTEPOP_SHIFT: u32 = 50;
13807
13808    /// Returns the value of the `INTdis` field.
13809    pub const fn intdis(self) -> u8 {
13810        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
13811    }
13812
13813    /// Sets the value of the `INTdis` field.
13814    pub const fn set_intdis(&mut self, value: u8) {
13815        let offset = Self::INTDIS_SHIFT;
13816        assert!(value & (Self::INTDIS_MASK as u8) == value);
13817        *self = Self::from_bits_retain(
13818            (self.bits() & !(Self::INTDIS_MASK << offset)) | ((value as u64) << offset),
13819        );
13820    }
13821}
13822
13823bitflags! {
13824    /// `MIDR` system register value.
13825    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13826    #[repr(transparent)]
13827    pub struct Midr: u32 {
13828    }
13829}
13830
13831impl Midr {
13832    /// Offset of the `Revision` field.
13833    pub const REVISION_SHIFT: u32 = 0;
13834    /// Mask for the `Revision` field.
13835    pub const REVISION_MASK: u32 = 0b1111;
13836    /// Offset of the `PartNum` field.
13837    pub const PARTNUM_SHIFT: u32 = 4;
13838    /// Mask for the `PartNum` field.
13839    pub const PARTNUM_MASK: u32 = 0b111111111111;
13840    /// Offset of the `Architecture` field.
13841    pub const ARCHITECTURE_SHIFT: u32 = 16;
13842    /// Mask for the `Architecture` field.
13843    pub const ARCHITECTURE_MASK: u32 = 0b1111;
13844    /// Offset of the `Variant` field.
13845    pub const VARIANT_SHIFT: u32 = 20;
13846    /// Mask for the `Variant` field.
13847    pub const VARIANT_MASK: u32 = 0b1111;
13848    /// Offset of the `Implementer` field.
13849    pub const IMPLEMENTER_SHIFT: u32 = 24;
13850    /// Mask for the `Implementer` field.
13851    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
13852
13853    /// Returns the value of the `Revision` field.
13854    pub const fn revision(self) -> u8 {
13855        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
13856    }
13857
13858    /// Sets the value of the `Revision` field.
13859    pub const fn set_revision(&mut self, value: u8) {
13860        let offset = Self::REVISION_SHIFT;
13861        assert!(value & (Self::REVISION_MASK as u8) == value);
13862        *self = Self::from_bits_retain(
13863            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u32) << offset),
13864        );
13865    }
13866
13867    /// Returns the value of the `PartNum` field.
13868    pub const fn partnum(self) -> u16 {
13869        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
13870    }
13871
13872    /// Sets the value of the `PartNum` field.
13873    pub const fn set_partnum(&mut self, value: u16) {
13874        let offset = Self::PARTNUM_SHIFT;
13875        assert!(value & (Self::PARTNUM_MASK as u16) == value);
13876        *self = Self::from_bits_retain(
13877            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u32) << offset),
13878        );
13879    }
13880
13881    /// Returns the value of the `Architecture` field.
13882    pub const fn architecture(self) -> u8 {
13883        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
13884    }
13885
13886    /// Sets the value of the `Architecture` field.
13887    pub const fn set_architecture(&mut self, value: u8) {
13888        let offset = Self::ARCHITECTURE_SHIFT;
13889        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
13890        *self = Self::from_bits_retain(
13891            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u32) << offset),
13892        );
13893    }
13894
13895    /// Returns the value of the `Variant` field.
13896    pub const fn variant(self) -> u8 {
13897        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
13898    }
13899
13900    /// Sets the value of the `Variant` field.
13901    pub const fn set_variant(&mut self, value: u8) {
13902        let offset = Self::VARIANT_SHIFT;
13903        assert!(value & (Self::VARIANT_MASK as u8) == value);
13904        *self = Self::from_bits_retain(
13905            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u32) << offset),
13906        );
13907    }
13908
13909    /// Returns the value of the `Implementer` field.
13910    pub const fn implementer(self) -> u8 {
13911        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
13912    }
13913
13914    /// Sets the value of the `Implementer` field.
13915    pub const fn set_implementer(&mut self, value: u8) {
13916        let offset = Self::IMPLEMENTER_SHIFT;
13917        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
13918        *self = Self::from_bits_retain(
13919            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u32) << offset),
13920        );
13921    }
13922}
13923
13924#[cfg(feature = "el1")]
13925bitflags! {
13926    /// `MIDR_EL1` system register value.
13927    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13928    #[repr(transparent)]
13929    pub struct MidrEl1: u64 {
13930    }
13931}
13932
13933#[cfg(feature = "el1")]
13934impl MidrEl1 {
13935    /// Offset of the `Revision` field.
13936    pub const REVISION_SHIFT: u32 = 0;
13937    /// Mask for the `Revision` field.
13938    pub const REVISION_MASK: u64 = 0b1111;
13939    /// Offset of the `PartNum` field.
13940    pub const PARTNUM_SHIFT: u32 = 4;
13941    /// Mask for the `PartNum` field.
13942    pub const PARTNUM_MASK: u64 = 0b111111111111;
13943    /// Offset of the `Architecture` field.
13944    pub const ARCHITECTURE_SHIFT: u32 = 16;
13945    /// Mask for the `Architecture` field.
13946    pub const ARCHITECTURE_MASK: u64 = 0b1111;
13947    /// Offset of the `Variant` field.
13948    pub const VARIANT_SHIFT: u32 = 20;
13949    /// Mask for the `Variant` field.
13950    pub const VARIANT_MASK: u64 = 0b1111;
13951    /// Offset of the `Implementer` field.
13952    pub const IMPLEMENTER_SHIFT: u32 = 24;
13953    /// Mask for the `Implementer` field.
13954    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
13955
13956    /// Returns the value of the `Revision` field.
13957    pub const fn revision(self) -> u8 {
13958        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
13959    }
13960
13961    /// Sets the value of the `Revision` field.
13962    pub const fn set_revision(&mut self, value: u8) {
13963        let offset = Self::REVISION_SHIFT;
13964        assert!(value & (Self::REVISION_MASK as u8) == value);
13965        *self = Self::from_bits_retain(
13966            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u64) << offset),
13967        );
13968    }
13969
13970    /// Returns the value of the `PartNum` field.
13971    pub const fn partnum(self) -> u16 {
13972        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
13973    }
13974
13975    /// Sets the value of the `PartNum` field.
13976    pub const fn set_partnum(&mut self, value: u16) {
13977        let offset = Self::PARTNUM_SHIFT;
13978        assert!(value & (Self::PARTNUM_MASK as u16) == value);
13979        *self = Self::from_bits_retain(
13980            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u64) << offset),
13981        );
13982    }
13983
13984    /// Returns the value of the `Architecture` field.
13985    pub const fn architecture(self) -> u8 {
13986        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
13987    }
13988
13989    /// Sets the value of the `Architecture` field.
13990    pub const fn set_architecture(&mut self, value: u8) {
13991        let offset = Self::ARCHITECTURE_SHIFT;
13992        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
13993        *self = Self::from_bits_retain(
13994            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u64) << offset),
13995        );
13996    }
13997
13998    /// Returns the value of the `Variant` field.
13999    pub const fn variant(self) -> u8 {
14000        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
14001    }
14002
14003    /// Sets the value of the `Variant` field.
14004    pub const fn set_variant(&mut self, value: u8) {
14005        let offset = Self::VARIANT_SHIFT;
14006        assert!(value & (Self::VARIANT_MASK as u8) == value);
14007        *self = Self::from_bits_retain(
14008            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u64) << offset),
14009        );
14010    }
14011
14012    /// Returns the value of the `Implementer` field.
14013    pub const fn implementer(self) -> u8 {
14014        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
14015    }
14016
14017    /// Sets the value of the `Implementer` field.
14018    pub const fn set_implementer(&mut self, value: u8) {
14019        let offset = Self::IMPLEMENTER_SHIFT;
14020        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
14021        *self = Self::from_bits_retain(
14022            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u64) << offset),
14023        );
14024    }
14025}
14026
14027#[cfg(feature = "el2")]
14028bitflags! {
14029    /// `MPAM2_EL2` system register value.
14030    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14031    #[repr(transparent)]
14032    pub struct Mpam2El2: u64 {
14033        /// `TRAPMPAM1EL1` bit.
14034        const TRAPMPAM1EL1 = 1 << 48;
14035        /// `TRAPMPAM0EL1` bit.
14036        const TRAPMPAM0EL1 = 1 << 49;
14037        /// `EnMPAMSM` bit.
14038        const ENMPAMSM = 1 << 50;
14039        /// `ALTSP_FRCD` bit.
14040        const ALTSP_FRCD = 1 << 54;
14041        /// `ALTSP_EL2` bit.
14042        const ALTSP_EL2 = 1 << 55;
14043        /// `ALTSP_HFC` bit.
14044        const ALTSP_HFC = 1 << 56;
14045        /// `TIDR` bit.
14046        const TIDR = 1 << 58;
14047        /// `MPAMEN` bit.
14048        const MPAMEN = 1 << 63;
14049    }
14050}
14051
14052#[cfg(feature = "el2")]
14053impl Mpam2El2 {
14054    /// Offset of the `PARTID` field.
14055    pub const PARTID_SHIFT: u32 = 0;
14056    /// Mask for the `PARTID` field.
14057    pub const PARTID_MASK: u64 = 0b1111111111111111;
14058    /// Offset of the `PARTID_I` field.
14059    pub const PARTID_I_SHIFT: u32 = 0;
14060    /// Mask for the `PARTID_I` field.
14061    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
14062    /// Offset of the `PARTID_D` field.
14063    pub const PARTID_D_SHIFT: u32 = 16;
14064    /// Mask for the `PARTID_D` field.
14065    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
14066    /// Offset of the `altPARTID` field.
14067    pub const ALTPARTID_SHIFT: u32 = 16;
14068    /// Mask for the `altPARTID` field.
14069    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
14070    /// Offset of the `PMG` field.
14071    pub const PMG_SHIFT: u32 = 32;
14072    /// Mask for the `PMG` field.
14073    pub const PMG_MASK: u64 = 0b1111111111111111;
14074    /// Offset of the `PMG_I` field.
14075    pub const PMG_I_SHIFT: u32 = 32;
14076    /// Mask for the `PMG_I` field.
14077    pub const PMG_I_MASK: u64 = 0b11111111;
14078    /// Offset of the `PMG_D` field.
14079    pub const PMG_D_SHIFT: u32 = 40;
14080    /// Mask for the `PMG_D` field.
14081    pub const PMG_D_MASK: u64 = 0b11111111;
14082    /// Offset of the `TRAPMPAM1EL1` field.
14083    pub const TRAPMPAM1EL1_SHIFT: u32 = 48;
14084    /// Offset of the `altPMG` field.
14085    pub const ALTPMG_SHIFT: u32 = 48;
14086    /// Mask for the `altPMG` field.
14087    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
14088    /// Offset of the `TRAPMPAM0EL1` field.
14089    pub const TRAPMPAM0EL1_SHIFT: u32 = 49;
14090    /// Offset of the `EnMPAMSM` field.
14091    pub const ENMPAMSM_SHIFT: u32 = 50;
14092    /// Offset of the `ALTSP_FRCD` field.
14093    pub const ALTSP_FRCD_SHIFT: u32 = 54;
14094    /// Offset of the `ALTSP_EL2` field.
14095    pub const ALTSP_EL2_SHIFT: u32 = 55;
14096    /// Offset of the `ALTSP_HFC` field.
14097    pub const ALTSP_HFC_SHIFT: u32 = 56;
14098    /// Offset of the `TIDR` field.
14099    pub const TIDR_SHIFT: u32 = 58;
14100    /// Offset of the `MPAMEN` field.
14101    pub const MPAMEN_SHIFT: u32 = 63;
14102
14103    /// Returns the value of the `PARTID` field.
14104    pub const fn partid(self) -> u16 {
14105        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
14106    }
14107
14108    /// Sets the value of the `PARTID` field.
14109    pub const fn set_partid(&mut self, value: u16) {
14110        let offset = Self::PARTID_SHIFT;
14111        assert!(value & (Self::PARTID_MASK as u16) == value);
14112        *self = Self::from_bits_retain(
14113            (self.bits() & !(Self::PARTID_MASK << offset)) | ((value as u64) << offset),
14114        );
14115    }
14116
14117    /// Returns the value of the `PARTID_I` field.
14118    pub const fn partid_i(self) -> u16 {
14119        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
14120    }
14121
14122    /// Sets the value of the `PARTID_I` field.
14123    pub const fn set_partid_i(&mut self, value: u16) {
14124        let offset = Self::PARTID_I_SHIFT;
14125        assert!(value & (Self::PARTID_I_MASK as u16) == value);
14126        *self = Self::from_bits_retain(
14127            (self.bits() & !(Self::PARTID_I_MASK << offset)) | ((value as u64) << offset),
14128        );
14129    }
14130
14131    /// Returns the value of the `PARTID_D` field.
14132    pub const fn partid_d(self) -> u16 {
14133        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
14134    }
14135
14136    /// Sets the value of the `PARTID_D` field.
14137    pub const fn set_partid_d(&mut self, value: u16) {
14138        let offset = Self::PARTID_D_SHIFT;
14139        assert!(value & (Self::PARTID_D_MASK as u16) == value);
14140        *self = Self::from_bits_retain(
14141            (self.bits() & !(Self::PARTID_D_MASK << offset)) | ((value as u64) << offset),
14142        );
14143    }
14144
14145    /// Returns the value of the `altPARTID` field.
14146    pub const fn altpartid(self) -> u16 {
14147        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
14148    }
14149
14150    /// Sets the value of the `altPARTID` field.
14151    pub const fn set_altpartid(&mut self, value: u16) {
14152        let offset = Self::ALTPARTID_SHIFT;
14153        assert!(value & (Self::ALTPARTID_MASK as u16) == value);
14154        *self = Self::from_bits_retain(
14155            (self.bits() & !(Self::ALTPARTID_MASK << offset)) | ((value as u64) << offset),
14156        );
14157    }
14158
14159    /// Returns the value of the `PMG` field.
14160    pub const fn pmg(self) -> u16 {
14161        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
14162    }
14163
14164    /// Sets the value of the `PMG` field.
14165    pub const fn set_pmg(&mut self, value: u16) {
14166        let offset = Self::PMG_SHIFT;
14167        assert!(value & (Self::PMG_MASK as u16) == value);
14168        *self = Self::from_bits_retain(
14169            (self.bits() & !(Self::PMG_MASK << offset)) | ((value as u64) << offset),
14170        );
14171    }
14172
14173    /// Returns the value of the `PMG_I` field.
14174    pub const fn pmg_i(self) -> u8 {
14175        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
14176    }
14177
14178    /// Sets the value of the `PMG_I` field.
14179    pub const fn set_pmg_i(&mut self, value: u8) {
14180        let offset = Self::PMG_I_SHIFT;
14181        assert!(value & (Self::PMG_I_MASK as u8) == value);
14182        *self = Self::from_bits_retain(
14183            (self.bits() & !(Self::PMG_I_MASK << offset)) | ((value as u64) << offset),
14184        );
14185    }
14186
14187    /// Returns the value of the `PMG_D` field.
14188    pub const fn pmg_d(self) -> u8 {
14189        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
14190    }
14191
14192    /// Sets the value of the `PMG_D` field.
14193    pub const fn set_pmg_d(&mut self, value: u8) {
14194        let offset = Self::PMG_D_SHIFT;
14195        assert!(value & (Self::PMG_D_MASK as u8) == value);
14196        *self = Self::from_bits_retain(
14197            (self.bits() & !(Self::PMG_D_MASK << offset)) | ((value as u64) << offset),
14198        );
14199    }
14200
14201    /// Returns the value of the `altPMG` field.
14202    pub const fn altpmg(self) -> u16 {
14203        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
14204    }
14205
14206    /// Sets the value of the `altPMG` field.
14207    pub const fn set_altpmg(&mut self, value: u16) {
14208        let offset = Self::ALTPMG_SHIFT;
14209        assert!(value & (Self::ALTPMG_MASK as u16) == value);
14210        *self = Self::from_bits_retain(
14211            (self.bits() & !(Self::ALTPMG_MASK << offset)) | ((value as u64) << offset),
14212        );
14213    }
14214}
14215
14216#[cfg(feature = "el3")]
14217bitflags! {
14218    /// `MPAM3_EL3` system register value.
14219    ///
14220    /// Holds information to generate MPAM labels for memory requests when executing at EL3.
14221    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14222    #[repr(transparent)]
14223    pub struct Mpam3El3: u64 {
14224        /// `RT_ALTSP_NS` bit.
14225        const RT_ALTSP_NS = 1 << 52;
14226        /// `ALTSP_EL3` bit.
14227        const ALTSP_EL3 = 1 << 55;
14228        /// `ALTSP_HFC` bit.
14229        const ALTSP_HFC = 1 << 56;
14230        /// `ALTSP_HEN` bit.
14231        const ALTSP_HEN = 1 << 57;
14232        /// `FORCE_NS` bit.
14233        const FORCE_NS = 1 << 60;
14234        /// `SDEFLT` bit.
14235        const SDEFLT = 1 << 61;
14236        /// Trap direct accesses to MPAM System registers that are not UNDEFINED from all ELn lower than EL3.
14237        const TRAPLOWER = 1 << 62;
14238        /// 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.
14239        const MPAMEN = 1 << 63;
14240    }
14241}
14242
14243#[cfg(feature = "el3")]
14244impl Mpam3El3 {
14245    /// Offset of the `PARTID` field.
14246    pub const PARTID_SHIFT: u32 = 0;
14247    /// Mask for the `PARTID` field.
14248    pub const PARTID_MASK: u64 = 0b1111111111111111;
14249    /// Offset of the `PARTID_I` field.
14250    pub const PARTID_I_SHIFT: u32 = 0;
14251    /// Mask for the `PARTID_I` field.
14252    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
14253    /// Offset of the `PARTID_D` field.
14254    pub const PARTID_D_SHIFT: u32 = 16;
14255    /// Mask for the `PARTID_D` field.
14256    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
14257    /// Offset of the `altPARTID` field.
14258    pub const ALTPARTID_SHIFT: u32 = 16;
14259    /// Mask for the `altPARTID` field.
14260    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
14261    /// Offset of the `PMG` field.
14262    pub const PMG_SHIFT: u32 = 32;
14263    /// Mask for the `PMG` field.
14264    pub const PMG_MASK: u64 = 0b1111111111111111;
14265    /// Offset of the `PMG_I` field.
14266    pub const PMG_I_SHIFT: u32 = 32;
14267    /// Mask for the `PMG_I` field.
14268    pub const PMG_I_MASK: u64 = 0b11111111;
14269    /// Offset of the `PMG_D` field.
14270    pub const PMG_D_SHIFT: u32 = 40;
14271    /// Mask for the `PMG_D` field.
14272    pub const PMG_D_MASK: u64 = 0b11111111;
14273    /// Offset of the `altPMG` field.
14274    pub const ALTPMG_SHIFT: u32 = 48;
14275    /// Mask for the `altPMG` field.
14276    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
14277    /// Offset of the `RT_ALTSP_NS` field.
14278    pub const RT_ALTSP_NS_SHIFT: u32 = 52;
14279    /// Offset of the `ALTSP_EL3` field.
14280    pub const ALTSP_EL3_SHIFT: u32 = 55;
14281    /// Offset of the `ALTSP_HFC` field.
14282    pub const ALTSP_HFC_SHIFT: u32 = 56;
14283    /// Offset of the `ALTSP_HEN` field.
14284    pub const ALTSP_HEN_SHIFT: u32 = 57;
14285    /// Offset of the `FORCE_NS` field.
14286    pub const FORCE_NS_SHIFT: u32 = 60;
14287    /// Offset of the `SDEFLT` field.
14288    pub const SDEFLT_SHIFT: u32 = 61;
14289    /// Offset of the `TRAPLOWER` field.
14290    pub const TRAPLOWER_SHIFT: u32 = 62;
14291    /// Offset of the `MPAMEN` field.
14292    pub const MPAMEN_SHIFT: u32 = 63;
14293
14294    /// Returns the value of the `PARTID` field.
14295    pub const fn partid(self) -> u16 {
14296        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
14297    }
14298
14299    /// Sets the value of the `PARTID` field.
14300    pub const fn set_partid(&mut self, value: u16) {
14301        let offset = Self::PARTID_SHIFT;
14302        assert!(value & (Self::PARTID_MASK as u16) == value);
14303        *self = Self::from_bits_retain(
14304            (self.bits() & !(Self::PARTID_MASK << offset)) | ((value as u64) << offset),
14305        );
14306    }
14307
14308    /// Returns the value of the `PARTID_I` field.
14309    pub const fn partid_i(self) -> u16 {
14310        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
14311    }
14312
14313    /// Sets the value of the `PARTID_I` field.
14314    pub const fn set_partid_i(&mut self, value: u16) {
14315        let offset = Self::PARTID_I_SHIFT;
14316        assert!(value & (Self::PARTID_I_MASK as u16) == value);
14317        *self = Self::from_bits_retain(
14318            (self.bits() & !(Self::PARTID_I_MASK << offset)) | ((value as u64) << offset),
14319        );
14320    }
14321
14322    /// Returns the value of the `PARTID_D` field.
14323    pub const fn partid_d(self) -> u16 {
14324        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
14325    }
14326
14327    /// Sets the value of the `PARTID_D` field.
14328    pub const fn set_partid_d(&mut self, value: u16) {
14329        let offset = Self::PARTID_D_SHIFT;
14330        assert!(value & (Self::PARTID_D_MASK as u16) == value);
14331        *self = Self::from_bits_retain(
14332            (self.bits() & !(Self::PARTID_D_MASK << offset)) | ((value as u64) << offset),
14333        );
14334    }
14335
14336    /// Returns the value of the `altPARTID` field.
14337    pub const fn altpartid(self) -> u16 {
14338        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
14339    }
14340
14341    /// Sets the value of the `altPARTID` field.
14342    pub const fn set_altpartid(&mut self, value: u16) {
14343        let offset = Self::ALTPARTID_SHIFT;
14344        assert!(value & (Self::ALTPARTID_MASK as u16) == value);
14345        *self = Self::from_bits_retain(
14346            (self.bits() & !(Self::ALTPARTID_MASK << offset)) | ((value as u64) << offset),
14347        );
14348    }
14349
14350    /// Returns the value of the `PMG` field.
14351    pub const fn pmg(self) -> u16 {
14352        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
14353    }
14354
14355    /// Sets the value of the `PMG` field.
14356    pub const fn set_pmg(&mut self, value: u16) {
14357        let offset = Self::PMG_SHIFT;
14358        assert!(value & (Self::PMG_MASK as u16) == value);
14359        *self = Self::from_bits_retain(
14360            (self.bits() & !(Self::PMG_MASK << offset)) | ((value as u64) << offset),
14361        );
14362    }
14363
14364    /// Returns the value of the `PMG_I` field.
14365    pub const fn pmg_i(self) -> u8 {
14366        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
14367    }
14368
14369    /// Sets the value of the `PMG_I` field.
14370    pub const fn set_pmg_i(&mut self, value: u8) {
14371        let offset = Self::PMG_I_SHIFT;
14372        assert!(value & (Self::PMG_I_MASK as u8) == value);
14373        *self = Self::from_bits_retain(
14374            (self.bits() & !(Self::PMG_I_MASK << offset)) | ((value as u64) << offset),
14375        );
14376    }
14377
14378    /// Returns the value of the `PMG_D` field.
14379    pub const fn pmg_d(self) -> u8 {
14380        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
14381    }
14382
14383    /// Sets the value of the `PMG_D` field.
14384    pub const fn set_pmg_d(&mut self, value: u8) {
14385        let offset = Self::PMG_D_SHIFT;
14386        assert!(value & (Self::PMG_D_MASK as u8) == value);
14387        *self = Self::from_bits_retain(
14388            (self.bits() & !(Self::PMG_D_MASK << offset)) | ((value as u64) << offset),
14389        );
14390    }
14391
14392    /// Returns the value of the `altPMG` field.
14393    pub const fn altpmg(self) -> u16 {
14394        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
14395    }
14396
14397    /// Sets the value of the `altPMG` field.
14398    pub const fn set_altpmg(&mut self, value: u16) {
14399        let offset = Self::ALTPMG_SHIFT;
14400        assert!(value & (Self::ALTPMG_MASK as u16) == value);
14401        *self = Self::from_bits_retain(
14402            (self.bits() & !(Self::ALTPMG_MASK << offset)) | ((value as u64) << offset),
14403        );
14404    }
14405}
14406
14407#[cfg(feature = "el2")]
14408bitflags! {
14409    /// `MPAMHCR_EL2` system register value.
14410    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14411    #[repr(transparent)]
14412    pub struct MpamhcrEl2: u64 {
14413        /// `EL0_VPMEN` bit.
14414        const EL0_VPMEN = 1 << 0;
14415        /// `EL1_VPMEN` bit.
14416        const EL1_VPMEN = 1 << 1;
14417        /// `VPMEN` bit.
14418        const VPMEN = 1 << 2;
14419        /// `VMMEN` bit.
14420        const VMMEN = 1 << 3;
14421        /// `SMVPMEN` bit.
14422        const SMVPMEN = 1 << 4;
14423        /// `SMVMMEN` bit.
14424        const SMVMMEN = 1 << 5;
14425        /// `GSTAPP_PLK` bit.
14426        const GSTAPP_PLK = 1 << 8;
14427        /// `TRAP_MPAMIDR_EL1` bit.
14428        const TRAP_MPAMIDR_EL1 = 1 << 31;
14429    }
14430}
14431
14432#[cfg(feature = "el2")]
14433impl MpamhcrEl2 {
14434    /// Offset of the `EL0_VPMEN` field.
14435    pub const EL0_VPMEN_SHIFT: u32 = 0;
14436    /// Offset of the `EL1_VPMEN` field.
14437    pub const EL1_VPMEN_SHIFT: u32 = 1;
14438    /// Offset of the `VPMEN` field.
14439    pub const VPMEN_SHIFT: u32 = 2;
14440    /// Offset of the `VMMEN` field.
14441    pub const VMMEN_SHIFT: u32 = 3;
14442    /// Offset of the `SMVPMEN` field.
14443    pub const SMVPMEN_SHIFT: u32 = 4;
14444    /// Offset of the `SMVMMEN` field.
14445    pub const SMVMMEN_SHIFT: u32 = 5;
14446    /// Offset of the `GSTAPP_PLK` field.
14447    pub const GSTAPP_PLK_SHIFT: u32 = 8;
14448    /// Offset of the `TRAP_MPAMIDR_EL1` field.
14449    pub const TRAP_MPAMIDR_EL1_SHIFT: u32 = 31;
14450}
14451
14452#[cfg(feature = "el1")]
14453bitflags! {
14454    /// `MPAMIDR_EL1` system register value.
14455    ///
14456    /// Indicates the maximum PARTID and PMG values supported in the implementation and the support for other optional features.
14457    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14458    #[repr(transparent)]
14459    pub struct MpamidrEl1: u64 {
14460        /// Indicates support for MPAM virtualization.
14461        const HAS_HCR = 1 << 17;
14462        /// `HAS_ALT_ID` bit.
14463        const HAS_ALT_ID = 1 << 21;
14464        /// `HAS_INSTR_ALT_ID` bit.
14465        const HAS_INSTR_ALT_ID = 1 << 22;
14466        /// `HAS_BW_CTRL` bit.
14467        const HAS_BW_CTRL = 1 << 56;
14468        /// `HAS_ALTSP` bit.
14469        const HAS_ALTSP = 1 << 57;
14470        /// `HAS_TIDR` bit.
14471        const HAS_TIDR = 1 << 58;
14472        /// `SP4` bit.
14473        const SP4 = 1 << 59;
14474        /// `HAS_FORCE_NS` bit.
14475        const HAS_FORCE_NS = 1 << 60;
14476        /// `HAS_SDEFLT` bit.
14477        const HAS_SDEFLT = 1 << 61;
14478    }
14479}
14480
14481#[cfg(feature = "el1")]
14482impl MpamidrEl1 {
14483    /// Offset of the `PARTID_MAX` field.
14484    pub const PARTID_MAX_SHIFT: u32 = 0;
14485    /// Mask for the `PARTID_MAX` field.
14486    pub const PARTID_MAX_MASK: u64 = 0b1111111111111111;
14487    /// Offset of the `HAS_HCR` field.
14488    pub const HAS_HCR_SHIFT: u32 = 17;
14489    /// Offset of the `VPMR_MAX` field.
14490    pub const VPMR_MAX_SHIFT: u32 = 18;
14491    /// Mask for the `VPMR_MAX` field.
14492    pub const VPMR_MAX_MASK: u64 = 0b111;
14493    /// Offset of the `HAS_ALT_ID` field.
14494    pub const HAS_ALT_ID_SHIFT: u32 = 21;
14495    /// Offset of the `HAS_INSTR_ALT_ID` field.
14496    pub const HAS_INSTR_ALT_ID_SHIFT: u32 = 22;
14497    /// Offset of the `HAS_BW_CTRL` field.
14498    pub const HAS_BW_CTRL_SHIFT: u32 = 56;
14499    /// Offset of the `HAS_ALTSP` field.
14500    pub const HAS_ALTSP_SHIFT: u32 = 57;
14501    /// Offset of the `HAS_TIDR` field.
14502    pub const HAS_TIDR_SHIFT: u32 = 58;
14503    /// Offset of the `SP4` field.
14504    pub const SP4_SHIFT: u32 = 59;
14505    /// Offset of the `HAS_FORCE_NS` field.
14506    pub const HAS_FORCE_NS_SHIFT: u32 = 60;
14507    /// Offset of the `HAS_SDEFLT` field.
14508    pub const HAS_SDEFLT_SHIFT: u32 = 61;
14509
14510    /// Returns the value of the `PARTID_MAX` field.
14511    pub const fn partid_max(self) -> u16 {
14512        ((self.bits() >> Self::PARTID_MAX_SHIFT) & 0b1111111111111111) as u16
14513    }
14514
14515    /// Sets the value of the `PARTID_MAX` field.
14516    pub const fn set_partid_max(&mut self, value: u16) {
14517        let offset = Self::PARTID_MAX_SHIFT;
14518        assert!(value & (Self::PARTID_MAX_MASK as u16) == value);
14519        *self = Self::from_bits_retain(
14520            (self.bits() & !(Self::PARTID_MAX_MASK << offset)) | ((value as u64) << offset),
14521        );
14522    }
14523
14524    /// Returns the value of the `VPMR_MAX` field.
14525    ///
14526    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
14527    pub const fn vpmr_max(self) -> u8 {
14528        ((self.bits() >> Self::VPMR_MAX_SHIFT) & 0b111) as u8
14529    }
14530
14531    /// Sets the value of the `VPMR_MAX` field.
14532    ///
14533    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
14534    pub const fn set_vpmr_max(&mut self, value: u8) {
14535        let offset = Self::VPMR_MAX_SHIFT;
14536        assert!(value & (Self::VPMR_MAX_MASK as u8) == value);
14537        *self = Self::from_bits_retain(
14538            (self.bits() & !(Self::VPMR_MAX_MASK << offset)) | ((value as u64) << offset),
14539        );
14540    }
14541}
14542
14543#[cfg(feature = "el2")]
14544bitflags! {
14545    /// `MPAMVPM0_EL2` system register value.
14546    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14547    #[repr(transparent)]
14548    pub struct Mpamvpm0El2: u64 {
14549    }
14550}
14551
14552#[cfg(feature = "el2")]
14553impl Mpamvpm0El2 {
14554    /// Offset of the `PhyPARTID0` field.
14555    pub const PHYPARTID0_SHIFT: u32 = 0;
14556    /// Mask for the `PhyPARTID0` field.
14557    pub const PHYPARTID0_MASK: u64 = 0b1111111111111111;
14558    /// Offset of the `PhyPARTID1` field.
14559    pub const PHYPARTID1_SHIFT: u32 = 16;
14560    /// Mask for the `PhyPARTID1` field.
14561    pub const PHYPARTID1_MASK: u64 = 0b1111111111111111;
14562    /// Offset of the `PhyPARTID2` field.
14563    pub const PHYPARTID2_SHIFT: u32 = 32;
14564    /// Mask for the `PhyPARTID2` field.
14565    pub const PHYPARTID2_MASK: u64 = 0b1111111111111111;
14566    /// Offset of the `PhyPARTID3` field.
14567    pub const PHYPARTID3_SHIFT: u32 = 48;
14568    /// Mask for the `PhyPARTID3` field.
14569    pub const PHYPARTID3_MASK: u64 = 0b1111111111111111;
14570
14571    /// Returns the value of the `PhyPARTID0` field.
14572    pub const fn phypartid0(self) -> u16 {
14573        ((self.bits() >> Self::PHYPARTID0_SHIFT) & 0b1111111111111111) as u16
14574    }
14575
14576    /// Sets the value of the `PhyPARTID0` field.
14577    pub const fn set_phypartid0(&mut self, value: u16) {
14578        let offset = Self::PHYPARTID0_SHIFT;
14579        assert!(value & (Self::PHYPARTID0_MASK as u16) == value);
14580        *self = Self::from_bits_retain(
14581            (self.bits() & !(Self::PHYPARTID0_MASK << offset)) | ((value as u64) << offset),
14582        );
14583    }
14584
14585    /// Returns the value of the `PhyPARTID1` field.
14586    pub const fn phypartid1(self) -> u16 {
14587        ((self.bits() >> Self::PHYPARTID1_SHIFT) & 0b1111111111111111) as u16
14588    }
14589
14590    /// Sets the value of the `PhyPARTID1` field.
14591    pub const fn set_phypartid1(&mut self, value: u16) {
14592        let offset = Self::PHYPARTID1_SHIFT;
14593        assert!(value & (Self::PHYPARTID1_MASK as u16) == value);
14594        *self = Self::from_bits_retain(
14595            (self.bits() & !(Self::PHYPARTID1_MASK << offset)) | ((value as u64) << offset),
14596        );
14597    }
14598
14599    /// Returns the value of the `PhyPARTID2` field.
14600    pub const fn phypartid2(self) -> u16 {
14601        ((self.bits() >> Self::PHYPARTID2_SHIFT) & 0b1111111111111111) as u16
14602    }
14603
14604    /// Sets the value of the `PhyPARTID2` field.
14605    pub const fn set_phypartid2(&mut self, value: u16) {
14606        let offset = Self::PHYPARTID2_SHIFT;
14607        assert!(value & (Self::PHYPARTID2_MASK as u16) == value);
14608        *self = Self::from_bits_retain(
14609            (self.bits() & !(Self::PHYPARTID2_MASK << offset)) | ((value as u64) << offset),
14610        );
14611    }
14612
14613    /// Returns the value of the `PhyPARTID3` field.
14614    pub const fn phypartid3(self) -> u16 {
14615        ((self.bits() >> Self::PHYPARTID3_SHIFT) & 0b1111111111111111) as u16
14616    }
14617
14618    /// Sets the value of the `PhyPARTID3` field.
14619    pub const fn set_phypartid3(&mut self, value: u16) {
14620        let offset = Self::PHYPARTID3_SHIFT;
14621        assert!(value & (Self::PHYPARTID3_MASK as u16) == value);
14622        *self = Self::from_bits_retain(
14623            (self.bits() & !(Self::PHYPARTID3_MASK << offset)) | ((value as u64) << offset),
14624        );
14625    }
14626}
14627
14628#[cfg(feature = "el2")]
14629bitflags! {
14630    /// `MPAMVPM1_EL2` system register value.
14631    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14632    #[repr(transparent)]
14633    pub struct Mpamvpm1El2: u64 {
14634    }
14635}
14636
14637#[cfg(feature = "el2")]
14638impl Mpamvpm1El2 {
14639    /// Offset of the `PhyPARTID4` field.
14640    pub const PHYPARTID4_SHIFT: u32 = 0;
14641    /// Mask for the `PhyPARTID4` field.
14642    pub const PHYPARTID4_MASK: u64 = 0b1111111111111111;
14643    /// Offset of the `PhyPARTID5` field.
14644    pub const PHYPARTID5_SHIFT: u32 = 16;
14645    /// Mask for the `PhyPARTID5` field.
14646    pub const PHYPARTID5_MASK: u64 = 0b1111111111111111;
14647    /// Offset of the `PhyPARTID6` field.
14648    pub const PHYPARTID6_SHIFT: u32 = 32;
14649    /// Mask for the `PhyPARTID6` field.
14650    pub const PHYPARTID6_MASK: u64 = 0b1111111111111111;
14651    /// Offset of the `PhyPARTID7` field.
14652    pub const PHYPARTID7_SHIFT: u32 = 48;
14653    /// Mask for the `PhyPARTID7` field.
14654    pub const PHYPARTID7_MASK: u64 = 0b1111111111111111;
14655
14656    /// Returns the value of the `PhyPARTID4` field.
14657    pub const fn phypartid4(self) -> u16 {
14658        ((self.bits() >> Self::PHYPARTID4_SHIFT) & 0b1111111111111111) as u16
14659    }
14660
14661    /// Sets the value of the `PhyPARTID4` field.
14662    pub const fn set_phypartid4(&mut self, value: u16) {
14663        let offset = Self::PHYPARTID4_SHIFT;
14664        assert!(value & (Self::PHYPARTID4_MASK as u16) == value);
14665        *self = Self::from_bits_retain(
14666            (self.bits() & !(Self::PHYPARTID4_MASK << offset)) | ((value as u64) << offset),
14667        );
14668    }
14669
14670    /// Returns the value of the `PhyPARTID5` field.
14671    pub const fn phypartid5(self) -> u16 {
14672        ((self.bits() >> Self::PHYPARTID5_SHIFT) & 0b1111111111111111) as u16
14673    }
14674
14675    /// Sets the value of the `PhyPARTID5` field.
14676    pub const fn set_phypartid5(&mut self, value: u16) {
14677        let offset = Self::PHYPARTID5_SHIFT;
14678        assert!(value & (Self::PHYPARTID5_MASK as u16) == value);
14679        *self = Self::from_bits_retain(
14680            (self.bits() & !(Self::PHYPARTID5_MASK << offset)) | ((value as u64) << offset),
14681        );
14682    }
14683
14684    /// Returns the value of the `PhyPARTID6` field.
14685    pub const fn phypartid6(self) -> u16 {
14686        ((self.bits() >> Self::PHYPARTID6_SHIFT) & 0b1111111111111111) as u16
14687    }
14688
14689    /// Sets the value of the `PhyPARTID6` field.
14690    pub const fn set_phypartid6(&mut self, value: u16) {
14691        let offset = Self::PHYPARTID6_SHIFT;
14692        assert!(value & (Self::PHYPARTID6_MASK as u16) == value);
14693        *self = Self::from_bits_retain(
14694            (self.bits() & !(Self::PHYPARTID6_MASK << offset)) | ((value as u64) << offset),
14695        );
14696    }
14697
14698    /// Returns the value of the `PhyPARTID7` field.
14699    pub const fn phypartid7(self) -> u16 {
14700        ((self.bits() >> Self::PHYPARTID7_SHIFT) & 0b1111111111111111) as u16
14701    }
14702
14703    /// Sets the value of the `PhyPARTID7` field.
14704    pub const fn set_phypartid7(&mut self, value: u16) {
14705        let offset = Self::PHYPARTID7_SHIFT;
14706        assert!(value & (Self::PHYPARTID7_MASK as u16) == value);
14707        *self = Self::from_bits_retain(
14708            (self.bits() & !(Self::PHYPARTID7_MASK << offset)) | ((value as u64) << offset),
14709        );
14710    }
14711}
14712
14713#[cfg(feature = "el2")]
14714bitflags! {
14715    /// `MPAMVPM2_EL2` system register value.
14716    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14717    #[repr(transparent)]
14718    pub struct Mpamvpm2El2: u64 {
14719    }
14720}
14721
14722#[cfg(feature = "el2")]
14723impl Mpamvpm2El2 {
14724    /// Offset of the `PhyPARTID8` field.
14725    pub const PHYPARTID8_SHIFT: u32 = 0;
14726    /// Mask for the `PhyPARTID8` field.
14727    pub const PHYPARTID8_MASK: u64 = 0b1111111111111111;
14728    /// Offset of the `PhyPARTID9` field.
14729    pub const PHYPARTID9_SHIFT: u32 = 16;
14730    /// Mask for the `PhyPARTID9` field.
14731    pub const PHYPARTID9_MASK: u64 = 0b1111111111111111;
14732    /// Offset of the `PhyPARTID10` field.
14733    pub const PHYPARTID10_SHIFT: u32 = 32;
14734    /// Mask for the `PhyPARTID10` field.
14735    pub const PHYPARTID10_MASK: u64 = 0b1111111111111111;
14736    /// Offset of the `PhyPARTID11` field.
14737    pub const PHYPARTID11_SHIFT: u32 = 48;
14738    /// Mask for the `PhyPARTID11` field.
14739    pub const PHYPARTID11_MASK: u64 = 0b1111111111111111;
14740
14741    /// Returns the value of the `PhyPARTID8` field.
14742    pub const fn phypartid8(self) -> u16 {
14743        ((self.bits() >> Self::PHYPARTID8_SHIFT) & 0b1111111111111111) as u16
14744    }
14745
14746    /// Sets the value of the `PhyPARTID8` field.
14747    pub const fn set_phypartid8(&mut self, value: u16) {
14748        let offset = Self::PHYPARTID8_SHIFT;
14749        assert!(value & (Self::PHYPARTID8_MASK as u16) == value);
14750        *self = Self::from_bits_retain(
14751            (self.bits() & !(Self::PHYPARTID8_MASK << offset)) | ((value as u64) << offset),
14752        );
14753    }
14754
14755    /// Returns the value of the `PhyPARTID9` field.
14756    pub const fn phypartid9(self) -> u16 {
14757        ((self.bits() >> Self::PHYPARTID9_SHIFT) & 0b1111111111111111) as u16
14758    }
14759
14760    /// Sets the value of the `PhyPARTID9` field.
14761    pub const fn set_phypartid9(&mut self, value: u16) {
14762        let offset = Self::PHYPARTID9_SHIFT;
14763        assert!(value & (Self::PHYPARTID9_MASK as u16) == value);
14764        *self = Self::from_bits_retain(
14765            (self.bits() & !(Self::PHYPARTID9_MASK << offset)) | ((value as u64) << offset),
14766        );
14767    }
14768
14769    /// Returns the value of the `PhyPARTID10` field.
14770    pub const fn phypartid10(self) -> u16 {
14771        ((self.bits() >> Self::PHYPARTID10_SHIFT) & 0b1111111111111111) as u16
14772    }
14773
14774    /// Sets the value of the `PhyPARTID10` field.
14775    pub const fn set_phypartid10(&mut self, value: u16) {
14776        let offset = Self::PHYPARTID10_SHIFT;
14777        assert!(value & (Self::PHYPARTID10_MASK as u16) == value);
14778        *self = Self::from_bits_retain(
14779            (self.bits() & !(Self::PHYPARTID10_MASK << offset)) | ((value as u64) << offset),
14780        );
14781    }
14782
14783    /// Returns the value of the `PhyPARTID11` field.
14784    pub const fn phypartid11(self) -> u16 {
14785        ((self.bits() >> Self::PHYPARTID11_SHIFT) & 0b1111111111111111) as u16
14786    }
14787
14788    /// Sets the value of the `PhyPARTID11` field.
14789    pub const fn set_phypartid11(&mut self, value: u16) {
14790        let offset = Self::PHYPARTID11_SHIFT;
14791        assert!(value & (Self::PHYPARTID11_MASK as u16) == value);
14792        *self = Self::from_bits_retain(
14793            (self.bits() & !(Self::PHYPARTID11_MASK << offset)) | ((value as u64) << offset),
14794        );
14795    }
14796}
14797
14798#[cfg(feature = "el2")]
14799bitflags! {
14800    /// `MPAMVPM3_EL2` system register value.
14801    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14802    #[repr(transparent)]
14803    pub struct Mpamvpm3El2: u64 {
14804    }
14805}
14806
14807#[cfg(feature = "el2")]
14808impl Mpamvpm3El2 {
14809    /// Offset of the `PhyPARTID12` field.
14810    pub const PHYPARTID12_SHIFT: u32 = 0;
14811    /// Mask for the `PhyPARTID12` field.
14812    pub const PHYPARTID12_MASK: u64 = 0b1111111111111111;
14813    /// Offset of the `PhyPARTID13` field.
14814    pub const PHYPARTID13_SHIFT: u32 = 16;
14815    /// Mask for the `PhyPARTID13` field.
14816    pub const PHYPARTID13_MASK: u64 = 0b1111111111111111;
14817    /// Offset of the `PhyPARTID14` field.
14818    pub const PHYPARTID14_SHIFT: u32 = 32;
14819    /// Mask for the `PhyPARTID14` field.
14820    pub const PHYPARTID14_MASK: u64 = 0b1111111111111111;
14821    /// Offset of the `PhyPARTID15` field.
14822    pub const PHYPARTID15_SHIFT: u32 = 48;
14823    /// Mask for the `PhyPARTID15` field.
14824    pub const PHYPARTID15_MASK: u64 = 0b1111111111111111;
14825
14826    /// Returns the value of the `PhyPARTID12` field.
14827    pub const fn phypartid12(self) -> u16 {
14828        ((self.bits() >> Self::PHYPARTID12_SHIFT) & 0b1111111111111111) as u16
14829    }
14830
14831    /// Sets the value of the `PhyPARTID12` field.
14832    pub const fn set_phypartid12(&mut self, value: u16) {
14833        let offset = Self::PHYPARTID12_SHIFT;
14834        assert!(value & (Self::PHYPARTID12_MASK as u16) == value);
14835        *self = Self::from_bits_retain(
14836            (self.bits() & !(Self::PHYPARTID12_MASK << offset)) | ((value as u64) << offset),
14837        );
14838    }
14839
14840    /// Returns the value of the `PhyPARTID13` field.
14841    pub const fn phypartid13(self) -> u16 {
14842        ((self.bits() >> Self::PHYPARTID13_SHIFT) & 0b1111111111111111) as u16
14843    }
14844
14845    /// Sets the value of the `PhyPARTID13` field.
14846    pub const fn set_phypartid13(&mut self, value: u16) {
14847        let offset = Self::PHYPARTID13_SHIFT;
14848        assert!(value & (Self::PHYPARTID13_MASK as u16) == value);
14849        *self = Self::from_bits_retain(
14850            (self.bits() & !(Self::PHYPARTID13_MASK << offset)) | ((value as u64) << offset),
14851        );
14852    }
14853
14854    /// Returns the value of the `PhyPARTID14` field.
14855    pub const fn phypartid14(self) -> u16 {
14856        ((self.bits() >> Self::PHYPARTID14_SHIFT) & 0b1111111111111111) as u16
14857    }
14858
14859    /// Sets the value of the `PhyPARTID14` field.
14860    pub const fn set_phypartid14(&mut self, value: u16) {
14861        let offset = Self::PHYPARTID14_SHIFT;
14862        assert!(value & (Self::PHYPARTID14_MASK as u16) == value);
14863        *self = Self::from_bits_retain(
14864            (self.bits() & !(Self::PHYPARTID14_MASK << offset)) | ((value as u64) << offset),
14865        );
14866    }
14867
14868    /// Returns the value of the `PhyPARTID15` field.
14869    pub const fn phypartid15(self) -> u16 {
14870        ((self.bits() >> Self::PHYPARTID15_SHIFT) & 0b1111111111111111) as u16
14871    }
14872
14873    /// Sets the value of the `PhyPARTID15` field.
14874    pub const fn set_phypartid15(&mut self, value: u16) {
14875        let offset = Self::PHYPARTID15_SHIFT;
14876        assert!(value & (Self::PHYPARTID15_MASK as u16) == value);
14877        *self = Self::from_bits_retain(
14878            (self.bits() & !(Self::PHYPARTID15_MASK << offset)) | ((value as u64) << offset),
14879        );
14880    }
14881}
14882
14883#[cfg(feature = "el2")]
14884bitflags! {
14885    /// `MPAMVPM4_EL2` system register value.
14886    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14887    #[repr(transparent)]
14888    pub struct Mpamvpm4El2: u64 {
14889    }
14890}
14891
14892#[cfg(feature = "el2")]
14893impl Mpamvpm4El2 {
14894    /// Offset of the `PhyPARTID16` field.
14895    pub const PHYPARTID16_SHIFT: u32 = 0;
14896    /// Mask for the `PhyPARTID16` field.
14897    pub const PHYPARTID16_MASK: u64 = 0b1111111111111111;
14898    /// Offset of the `PhyPARTID17` field.
14899    pub const PHYPARTID17_SHIFT: u32 = 16;
14900    /// Mask for the `PhyPARTID17` field.
14901    pub const PHYPARTID17_MASK: u64 = 0b1111111111111111;
14902    /// Offset of the `PhyPARTID18` field.
14903    pub const PHYPARTID18_SHIFT: u32 = 32;
14904    /// Mask for the `PhyPARTID18` field.
14905    pub const PHYPARTID18_MASK: u64 = 0b1111111111111111;
14906    /// Offset of the `PhyPARTID19` field.
14907    pub const PHYPARTID19_SHIFT: u32 = 48;
14908    /// Mask for the `PhyPARTID19` field.
14909    pub const PHYPARTID19_MASK: u64 = 0b1111111111111111;
14910
14911    /// Returns the value of the `PhyPARTID16` field.
14912    pub const fn phypartid16(self) -> u16 {
14913        ((self.bits() >> Self::PHYPARTID16_SHIFT) & 0b1111111111111111) as u16
14914    }
14915
14916    /// Sets the value of the `PhyPARTID16` field.
14917    pub const fn set_phypartid16(&mut self, value: u16) {
14918        let offset = Self::PHYPARTID16_SHIFT;
14919        assert!(value & (Self::PHYPARTID16_MASK as u16) == value);
14920        *self = Self::from_bits_retain(
14921            (self.bits() & !(Self::PHYPARTID16_MASK << offset)) | ((value as u64) << offset),
14922        );
14923    }
14924
14925    /// Returns the value of the `PhyPARTID17` field.
14926    pub const fn phypartid17(self) -> u16 {
14927        ((self.bits() >> Self::PHYPARTID17_SHIFT) & 0b1111111111111111) as u16
14928    }
14929
14930    /// Sets the value of the `PhyPARTID17` field.
14931    pub const fn set_phypartid17(&mut self, value: u16) {
14932        let offset = Self::PHYPARTID17_SHIFT;
14933        assert!(value & (Self::PHYPARTID17_MASK as u16) == value);
14934        *self = Self::from_bits_retain(
14935            (self.bits() & !(Self::PHYPARTID17_MASK << offset)) | ((value as u64) << offset),
14936        );
14937    }
14938
14939    /// Returns the value of the `PhyPARTID18` field.
14940    pub const fn phypartid18(self) -> u16 {
14941        ((self.bits() >> Self::PHYPARTID18_SHIFT) & 0b1111111111111111) as u16
14942    }
14943
14944    /// Sets the value of the `PhyPARTID18` field.
14945    pub const fn set_phypartid18(&mut self, value: u16) {
14946        let offset = Self::PHYPARTID18_SHIFT;
14947        assert!(value & (Self::PHYPARTID18_MASK as u16) == value);
14948        *self = Self::from_bits_retain(
14949            (self.bits() & !(Self::PHYPARTID18_MASK << offset)) | ((value as u64) << offset),
14950        );
14951    }
14952
14953    /// Returns the value of the `PhyPARTID19` field.
14954    pub const fn phypartid19(self) -> u16 {
14955        ((self.bits() >> Self::PHYPARTID19_SHIFT) & 0b1111111111111111) as u16
14956    }
14957
14958    /// Sets the value of the `PhyPARTID19` field.
14959    pub const fn set_phypartid19(&mut self, value: u16) {
14960        let offset = Self::PHYPARTID19_SHIFT;
14961        assert!(value & (Self::PHYPARTID19_MASK as u16) == value);
14962        *self = Self::from_bits_retain(
14963            (self.bits() & !(Self::PHYPARTID19_MASK << offset)) | ((value as u64) << offset),
14964        );
14965    }
14966}
14967
14968#[cfg(feature = "el2")]
14969bitflags! {
14970    /// `MPAMVPM5_EL2` system register value.
14971    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14972    #[repr(transparent)]
14973    pub struct Mpamvpm5El2: u64 {
14974    }
14975}
14976
14977#[cfg(feature = "el2")]
14978impl Mpamvpm5El2 {
14979    /// Offset of the `PhyPARTID20` field.
14980    pub const PHYPARTID20_SHIFT: u32 = 0;
14981    /// Mask for the `PhyPARTID20` field.
14982    pub const PHYPARTID20_MASK: u64 = 0b1111111111111111;
14983    /// Offset of the `PhyPARTID21` field.
14984    pub const PHYPARTID21_SHIFT: u32 = 16;
14985    /// Mask for the `PhyPARTID21` field.
14986    pub const PHYPARTID21_MASK: u64 = 0b1111111111111111;
14987    /// Offset of the `PhyPARTID22` field.
14988    pub const PHYPARTID22_SHIFT: u32 = 32;
14989    /// Mask for the `PhyPARTID22` field.
14990    pub const PHYPARTID22_MASK: u64 = 0b1111111111111111;
14991    /// Offset of the `PhyPARTID23` field.
14992    pub const PHYPARTID23_SHIFT: u32 = 48;
14993    /// Mask for the `PhyPARTID23` field.
14994    pub const PHYPARTID23_MASK: u64 = 0b1111111111111111;
14995
14996    /// Returns the value of the `PhyPARTID20` field.
14997    pub const fn phypartid20(self) -> u16 {
14998        ((self.bits() >> Self::PHYPARTID20_SHIFT) & 0b1111111111111111) as u16
14999    }
15000
15001    /// Sets the value of the `PhyPARTID20` field.
15002    pub const fn set_phypartid20(&mut self, value: u16) {
15003        let offset = Self::PHYPARTID20_SHIFT;
15004        assert!(value & (Self::PHYPARTID20_MASK as u16) == value);
15005        *self = Self::from_bits_retain(
15006            (self.bits() & !(Self::PHYPARTID20_MASK << offset)) | ((value as u64) << offset),
15007        );
15008    }
15009
15010    /// Returns the value of the `PhyPARTID21` field.
15011    pub const fn phypartid21(self) -> u16 {
15012        ((self.bits() >> Self::PHYPARTID21_SHIFT) & 0b1111111111111111) as u16
15013    }
15014
15015    /// Sets the value of the `PhyPARTID21` field.
15016    pub const fn set_phypartid21(&mut self, value: u16) {
15017        let offset = Self::PHYPARTID21_SHIFT;
15018        assert!(value & (Self::PHYPARTID21_MASK as u16) == value);
15019        *self = Self::from_bits_retain(
15020            (self.bits() & !(Self::PHYPARTID21_MASK << offset)) | ((value as u64) << offset),
15021        );
15022    }
15023
15024    /// Returns the value of the `PhyPARTID22` field.
15025    pub const fn phypartid22(self) -> u16 {
15026        ((self.bits() >> Self::PHYPARTID22_SHIFT) & 0b1111111111111111) as u16
15027    }
15028
15029    /// Sets the value of the `PhyPARTID22` field.
15030    pub const fn set_phypartid22(&mut self, value: u16) {
15031        let offset = Self::PHYPARTID22_SHIFT;
15032        assert!(value & (Self::PHYPARTID22_MASK as u16) == value);
15033        *self = Self::from_bits_retain(
15034            (self.bits() & !(Self::PHYPARTID22_MASK << offset)) | ((value as u64) << offset),
15035        );
15036    }
15037
15038    /// Returns the value of the `PhyPARTID23` field.
15039    pub const fn phypartid23(self) -> u16 {
15040        ((self.bits() >> Self::PHYPARTID23_SHIFT) & 0b1111111111111111) as u16
15041    }
15042
15043    /// Sets the value of the `PhyPARTID23` field.
15044    pub const fn set_phypartid23(&mut self, value: u16) {
15045        let offset = Self::PHYPARTID23_SHIFT;
15046        assert!(value & (Self::PHYPARTID23_MASK as u16) == value);
15047        *self = Self::from_bits_retain(
15048            (self.bits() & !(Self::PHYPARTID23_MASK << offset)) | ((value as u64) << offset),
15049        );
15050    }
15051}
15052
15053#[cfg(feature = "el2")]
15054bitflags! {
15055    /// `MPAMVPM6_EL2` system register value.
15056    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15057    #[repr(transparent)]
15058    pub struct Mpamvpm6El2: u64 {
15059    }
15060}
15061
15062#[cfg(feature = "el2")]
15063impl Mpamvpm6El2 {
15064    /// Offset of the `PhyPARTID24` field.
15065    pub const PHYPARTID24_SHIFT: u32 = 0;
15066    /// Mask for the `PhyPARTID24` field.
15067    pub const PHYPARTID24_MASK: u64 = 0b1111111111111111;
15068    /// Offset of the `PhyPARTID25` field.
15069    pub const PHYPARTID25_SHIFT: u32 = 16;
15070    /// Mask for the `PhyPARTID25` field.
15071    pub const PHYPARTID25_MASK: u64 = 0b1111111111111111;
15072    /// Offset of the `PhyPARTID26` field.
15073    pub const PHYPARTID26_SHIFT: u32 = 32;
15074    /// Mask for the `PhyPARTID26` field.
15075    pub const PHYPARTID26_MASK: u64 = 0b1111111111111111;
15076    /// Offset of the `PhyPARTID27` field.
15077    pub const PHYPARTID27_SHIFT: u32 = 48;
15078    /// Mask for the `PhyPARTID27` field.
15079    pub const PHYPARTID27_MASK: u64 = 0b1111111111111111;
15080
15081    /// Returns the value of the `PhyPARTID24` field.
15082    pub const fn phypartid24(self) -> u16 {
15083        ((self.bits() >> Self::PHYPARTID24_SHIFT) & 0b1111111111111111) as u16
15084    }
15085
15086    /// Sets the value of the `PhyPARTID24` field.
15087    pub const fn set_phypartid24(&mut self, value: u16) {
15088        let offset = Self::PHYPARTID24_SHIFT;
15089        assert!(value & (Self::PHYPARTID24_MASK as u16) == value);
15090        *self = Self::from_bits_retain(
15091            (self.bits() & !(Self::PHYPARTID24_MASK << offset)) | ((value as u64) << offset),
15092        );
15093    }
15094
15095    /// Returns the value of the `PhyPARTID25` field.
15096    pub const fn phypartid25(self) -> u16 {
15097        ((self.bits() >> Self::PHYPARTID25_SHIFT) & 0b1111111111111111) as u16
15098    }
15099
15100    /// Sets the value of the `PhyPARTID25` field.
15101    pub const fn set_phypartid25(&mut self, value: u16) {
15102        let offset = Self::PHYPARTID25_SHIFT;
15103        assert!(value & (Self::PHYPARTID25_MASK as u16) == value);
15104        *self = Self::from_bits_retain(
15105            (self.bits() & !(Self::PHYPARTID25_MASK << offset)) | ((value as u64) << offset),
15106        );
15107    }
15108
15109    /// Returns the value of the `PhyPARTID26` field.
15110    pub const fn phypartid26(self) -> u16 {
15111        ((self.bits() >> Self::PHYPARTID26_SHIFT) & 0b1111111111111111) as u16
15112    }
15113
15114    /// Sets the value of the `PhyPARTID26` field.
15115    pub const fn set_phypartid26(&mut self, value: u16) {
15116        let offset = Self::PHYPARTID26_SHIFT;
15117        assert!(value & (Self::PHYPARTID26_MASK as u16) == value);
15118        *self = Self::from_bits_retain(
15119            (self.bits() & !(Self::PHYPARTID26_MASK << offset)) | ((value as u64) << offset),
15120        );
15121    }
15122
15123    /// Returns the value of the `PhyPARTID27` field.
15124    pub const fn phypartid27(self) -> u16 {
15125        ((self.bits() >> Self::PHYPARTID27_SHIFT) & 0b1111111111111111) as u16
15126    }
15127
15128    /// Sets the value of the `PhyPARTID27` field.
15129    pub const fn set_phypartid27(&mut self, value: u16) {
15130        let offset = Self::PHYPARTID27_SHIFT;
15131        assert!(value & (Self::PHYPARTID27_MASK as u16) == value);
15132        *self = Self::from_bits_retain(
15133            (self.bits() & !(Self::PHYPARTID27_MASK << offset)) | ((value as u64) << offset),
15134        );
15135    }
15136}
15137
15138#[cfg(feature = "el2")]
15139bitflags! {
15140    /// `MPAMVPM7_EL2` system register value.
15141    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15142    #[repr(transparent)]
15143    pub struct Mpamvpm7El2: u64 {
15144    }
15145}
15146
15147#[cfg(feature = "el2")]
15148impl Mpamvpm7El2 {
15149    /// Offset of the `PhyPARTID28` field.
15150    pub const PHYPARTID28_SHIFT: u32 = 0;
15151    /// Mask for the `PhyPARTID28` field.
15152    pub const PHYPARTID28_MASK: u64 = 0b1111111111111111;
15153    /// Offset of the `PhyPARTID29` field.
15154    pub const PHYPARTID29_SHIFT: u32 = 16;
15155    /// Mask for the `PhyPARTID29` field.
15156    pub const PHYPARTID29_MASK: u64 = 0b1111111111111111;
15157    /// Offset of the `PhyPARTID30` field.
15158    pub const PHYPARTID30_SHIFT: u32 = 32;
15159    /// Mask for the `PhyPARTID30` field.
15160    pub const PHYPARTID30_MASK: u64 = 0b1111111111111111;
15161    /// Offset of the `PhyPARTID31` field.
15162    pub const PHYPARTID31_SHIFT: u32 = 48;
15163    /// Mask for the `PhyPARTID31` field.
15164    pub const PHYPARTID31_MASK: u64 = 0b1111111111111111;
15165
15166    /// Returns the value of the `PhyPARTID28` field.
15167    pub const fn phypartid28(self) -> u16 {
15168        ((self.bits() >> Self::PHYPARTID28_SHIFT) & 0b1111111111111111) as u16
15169    }
15170
15171    /// Sets the value of the `PhyPARTID28` field.
15172    pub const fn set_phypartid28(&mut self, value: u16) {
15173        let offset = Self::PHYPARTID28_SHIFT;
15174        assert!(value & (Self::PHYPARTID28_MASK as u16) == value);
15175        *self = Self::from_bits_retain(
15176            (self.bits() & !(Self::PHYPARTID28_MASK << offset)) | ((value as u64) << offset),
15177        );
15178    }
15179
15180    /// Returns the value of the `PhyPARTID29` field.
15181    pub const fn phypartid29(self) -> u16 {
15182        ((self.bits() >> Self::PHYPARTID29_SHIFT) & 0b1111111111111111) as u16
15183    }
15184
15185    /// Sets the value of the `PhyPARTID29` field.
15186    pub const fn set_phypartid29(&mut self, value: u16) {
15187        let offset = Self::PHYPARTID29_SHIFT;
15188        assert!(value & (Self::PHYPARTID29_MASK as u16) == value);
15189        *self = Self::from_bits_retain(
15190            (self.bits() & !(Self::PHYPARTID29_MASK << offset)) | ((value as u64) << offset),
15191        );
15192    }
15193
15194    /// Returns the value of the `PhyPARTID30` field.
15195    pub const fn phypartid30(self) -> u16 {
15196        ((self.bits() >> Self::PHYPARTID30_SHIFT) & 0b1111111111111111) as u16
15197    }
15198
15199    /// Sets the value of the `PhyPARTID30` field.
15200    pub const fn set_phypartid30(&mut self, value: u16) {
15201        let offset = Self::PHYPARTID30_SHIFT;
15202        assert!(value & (Self::PHYPARTID30_MASK as u16) == value);
15203        *self = Self::from_bits_retain(
15204            (self.bits() & !(Self::PHYPARTID30_MASK << offset)) | ((value as u64) << offset),
15205        );
15206    }
15207
15208    /// Returns the value of the `PhyPARTID31` field.
15209    pub const fn phypartid31(self) -> u16 {
15210        ((self.bits() >> Self::PHYPARTID31_SHIFT) & 0b1111111111111111) as u16
15211    }
15212
15213    /// Sets the value of the `PhyPARTID31` field.
15214    pub const fn set_phypartid31(&mut self, value: u16) {
15215        let offset = Self::PHYPARTID31_SHIFT;
15216        assert!(value & (Self::PHYPARTID31_MASK as u16) == value);
15217        *self = Self::from_bits_retain(
15218            (self.bits() & !(Self::PHYPARTID31_MASK << offset)) | ((value as u64) << offset),
15219        );
15220    }
15221}
15222
15223#[cfg(feature = "el2")]
15224bitflags! {
15225    /// `MPAMVPMV_EL2` system register value.
15226    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15227    #[repr(transparent)]
15228    pub struct MpamvpmvEl2: u64 {
15229        /// `VPM_V<m>` bit 0.
15230        const VPM_V0 = 1 << 0;
15231        /// `VPM_V<m>` bit 1.
15232        const VPM_V1 = 1 << 1;
15233        /// `VPM_V<m>` bit 2.
15234        const VPM_V2 = 1 << 2;
15235        /// `VPM_V<m>` bit 3.
15236        const VPM_V3 = 1 << 3;
15237        /// `VPM_V<m>` bit 4.
15238        const VPM_V4 = 1 << 4;
15239        /// `VPM_V<m>` bit 5.
15240        const VPM_V5 = 1 << 5;
15241        /// `VPM_V<m>` bit 6.
15242        const VPM_V6 = 1 << 6;
15243        /// `VPM_V<m>` bit 7.
15244        const VPM_V7 = 1 << 7;
15245        /// `VPM_V<m>` bit 8.
15246        const VPM_V8 = 1 << 8;
15247        /// `VPM_V<m>` bit 9.
15248        const VPM_V9 = 1 << 9;
15249        /// `VPM_V<m>` bit 10.
15250        const VPM_V10 = 1 << 10;
15251        /// `VPM_V<m>` bit 11.
15252        const VPM_V11 = 1 << 11;
15253        /// `VPM_V<m>` bit 12.
15254        const VPM_V12 = 1 << 12;
15255        /// `VPM_V<m>` bit 13.
15256        const VPM_V13 = 1 << 13;
15257        /// `VPM_V<m>` bit 14.
15258        const VPM_V14 = 1 << 14;
15259        /// `VPM_V<m>` bit 15.
15260        const VPM_V15 = 1 << 15;
15261        /// `VPM_V<m>` bit 16.
15262        const VPM_V16 = 1 << 16;
15263        /// `VPM_V<m>` bit 17.
15264        const VPM_V17 = 1 << 17;
15265        /// `VPM_V<m>` bit 18.
15266        const VPM_V18 = 1 << 18;
15267        /// `VPM_V<m>` bit 19.
15268        const VPM_V19 = 1 << 19;
15269        /// `VPM_V<m>` bit 20.
15270        const VPM_V20 = 1 << 20;
15271        /// `VPM_V<m>` bit 21.
15272        const VPM_V21 = 1 << 21;
15273        /// `VPM_V<m>` bit 22.
15274        const VPM_V22 = 1 << 22;
15275        /// `VPM_V<m>` bit 23.
15276        const VPM_V23 = 1 << 23;
15277        /// `VPM_V<m>` bit 24.
15278        const VPM_V24 = 1 << 24;
15279        /// `VPM_V<m>` bit 25.
15280        const VPM_V25 = 1 << 25;
15281        /// `VPM_V<m>` bit 26.
15282        const VPM_V26 = 1 << 26;
15283        /// `VPM_V<m>` bit 27.
15284        const VPM_V27 = 1 << 27;
15285        /// `VPM_V<m>` bit 28.
15286        const VPM_V28 = 1 << 28;
15287        /// `VPM_V<m>` bit 29.
15288        const VPM_V29 = 1 << 29;
15289        /// `VPM_V<m>` bit 30.
15290        const VPM_V30 = 1 << 30;
15291        /// `VPM_V<m>` bit 31.
15292        const VPM_V31 = 1 << 31;
15293    }
15294}
15295
15296#[cfg(feature = "el2")]
15297impl MpamvpmvEl2 {
15298    /// Offset of the `VPM_V<m>` field.
15299    pub const VPM_V_SHIFT: u32 = 0;
15300}
15301
15302bitflags! {
15303    /// `MPIDR` system register value.
15304    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15305    #[repr(transparent)]
15306    pub struct Mpidr: u32 {
15307        /// `MT` bit.
15308        const MT = 1 << 24;
15309        /// `U` bit.
15310        const U = 1 << 30;
15311        /// `M` bit.
15312        const M = 1 << 31;
15313    }
15314}
15315
15316impl Mpidr {
15317    /// Offset of the `Aff0` field.
15318    pub const AFF0_SHIFT: u32 = 0;
15319    /// Mask for the `Aff0` field.
15320    pub const AFF0_MASK: u32 = 0b11111111;
15321    /// Offset of the `Aff1` field.
15322    pub const AFF1_SHIFT: u32 = 8;
15323    /// Mask for the `Aff1` field.
15324    pub const AFF1_MASK: u32 = 0b11111111;
15325    /// Offset of the `Aff2` field.
15326    pub const AFF2_SHIFT: u32 = 16;
15327    /// Mask for the `Aff2` field.
15328    pub const AFF2_MASK: u32 = 0b11111111;
15329    /// Offset of the `MT` field.
15330    pub const MT_SHIFT: u32 = 24;
15331    /// Offset of the `U` field.
15332    pub const U_SHIFT: u32 = 30;
15333    /// Offset of the `M` field.
15334    pub const M_SHIFT: u32 = 31;
15335
15336    /// Returns the value of the `Aff0` field.
15337    pub const fn aff0(self) -> u8 {
15338        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
15339    }
15340
15341    /// Sets the value of the `Aff0` field.
15342    pub const fn set_aff0(&mut self, value: u8) {
15343        let offset = Self::AFF0_SHIFT;
15344        assert!(value & (Self::AFF0_MASK as u8) == value);
15345        *self = Self::from_bits_retain(
15346            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u32) << offset),
15347        );
15348    }
15349
15350    /// Returns the value of the `Aff1` field.
15351    pub const fn aff1(self) -> u8 {
15352        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
15353    }
15354
15355    /// Sets the value of the `Aff1` field.
15356    pub const fn set_aff1(&mut self, value: u8) {
15357        let offset = Self::AFF1_SHIFT;
15358        assert!(value & (Self::AFF1_MASK as u8) == value);
15359        *self = Self::from_bits_retain(
15360            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u32) << offset),
15361        );
15362    }
15363
15364    /// Returns the value of the `Aff2` field.
15365    pub const fn aff2(self) -> u8 {
15366        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
15367    }
15368
15369    /// Sets the value of the `Aff2` field.
15370    pub const fn set_aff2(&mut self, value: u8) {
15371        let offset = Self::AFF2_SHIFT;
15372        assert!(value & (Self::AFF2_MASK as u8) == value);
15373        *self = Self::from_bits_retain(
15374            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u32) << offset),
15375        );
15376    }
15377}
15378
15379#[cfg(feature = "el1")]
15380bitflags! {
15381    /// `MPIDR_EL1` system register value.
15382    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15383    #[repr(transparent)]
15384    pub struct MpidrEl1: u64 {
15385        /// RES1 bits in the `MPIDR_EL1` register.
15386        const RES1 = 0b10000000000000000000000000000000;
15387        /// `MT` bit.
15388        const MT = 1 << 24;
15389        /// `U` bit.
15390        const U = 1 << 30;
15391    }
15392}
15393
15394#[cfg(feature = "el1")]
15395impl MpidrEl1 {
15396    /// Offset of the `Aff0` field.
15397    pub const AFF0_SHIFT: u32 = 0;
15398    /// Mask for the `Aff0` field.
15399    pub const AFF0_MASK: u64 = 0b11111111;
15400    /// Offset of the `Aff1` field.
15401    pub const AFF1_SHIFT: u32 = 8;
15402    /// Mask for the `Aff1` field.
15403    pub const AFF1_MASK: u64 = 0b11111111;
15404    /// Offset of the `Aff2` field.
15405    pub const AFF2_SHIFT: u32 = 16;
15406    /// Mask for the `Aff2` field.
15407    pub const AFF2_MASK: u64 = 0b11111111;
15408    /// Offset of the `MT` field.
15409    pub const MT_SHIFT: u32 = 24;
15410    /// Offset of the `U` field.
15411    pub const U_SHIFT: u32 = 30;
15412    /// Offset of the `Aff3` field.
15413    pub const AFF3_SHIFT: u32 = 32;
15414    /// Mask for the `Aff3` field.
15415    pub const AFF3_MASK: u64 = 0b11111111;
15416
15417    /// Returns the value of the `Aff0` field.
15418    pub const fn aff0(self) -> u8 {
15419        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
15420    }
15421
15422    /// Sets the value of the `Aff0` field.
15423    pub const fn set_aff0(&mut self, value: u8) {
15424        let offset = Self::AFF0_SHIFT;
15425        assert!(value & (Self::AFF0_MASK as u8) == value);
15426        *self = Self::from_bits_retain(
15427            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u64) << offset),
15428        );
15429    }
15430
15431    /// Returns the value of the `Aff1` field.
15432    pub const fn aff1(self) -> u8 {
15433        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
15434    }
15435
15436    /// Sets the value of the `Aff1` field.
15437    pub const fn set_aff1(&mut self, value: u8) {
15438        let offset = Self::AFF1_SHIFT;
15439        assert!(value & (Self::AFF1_MASK as u8) == value);
15440        *self = Self::from_bits_retain(
15441            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
15442        );
15443    }
15444
15445    /// Returns the value of the `Aff2` field.
15446    pub const fn aff2(self) -> u8 {
15447        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
15448    }
15449
15450    /// Sets the value of the `Aff2` field.
15451    pub const fn set_aff2(&mut self, value: u8) {
15452        let offset = Self::AFF2_SHIFT;
15453        assert!(value & (Self::AFF2_MASK as u8) == value);
15454        *self = Self::from_bits_retain(
15455            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
15456        );
15457    }
15458
15459    /// Returns the value of the `Aff3` field.
15460    pub const fn aff3(self) -> u8 {
15461        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
15462    }
15463
15464    /// Sets the value of the `Aff3` field.
15465    pub const fn set_aff3(&mut self, value: u8) {
15466        let offset = Self::AFF3_SHIFT;
15467        assert!(value & (Self::AFF3_MASK as u8) == value);
15468        *self = Self::from_bits_retain(
15469            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
15470        );
15471    }
15472}
15473
15474bitflags! {
15475    /// `MVBAR` system register value.
15476    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15477    #[repr(transparent)]
15478    pub struct Mvbar: u32 {
15479    }
15480}
15481
15482impl Mvbar {
15483    /// Offset of the `Reserved` field.
15484    pub const RESERVED_SHIFT: u32 = 0;
15485    /// Mask for the `Reserved` field.
15486    pub const RESERVED_MASK: u32 = 0b11111;
15487    /// Offset of the `VBA` field.
15488    pub const VBA_SHIFT: u32 = 5;
15489    /// Mask for the `VBA` field.
15490    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
15491
15492    /// Returns the value of the `Reserved` field.
15493    pub const fn reserved(self) -> u8 {
15494        ((self.bits() >> Self::RESERVED_SHIFT) & 0b11111) as u8
15495    }
15496
15497    /// Sets the value of the `Reserved` field.
15498    pub const fn set_reserved(&mut self, value: u8) {
15499        let offset = Self::RESERVED_SHIFT;
15500        assert!(value & (Self::RESERVED_MASK as u8) == value);
15501        *self = Self::from_bits_retain(
15502            (self.bits() & !(Self::RESERVED_MASK << offset)) | ((value as u32) << offset),
15503        );
15504    }
15505
15506    /// Returns the value of the `VBA` field.
15507    pub const fn vba(self) -> u32 {
15508        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
15509    }
15510
15511    /// Sets the value of the `VBA` field.
15512    pub const fn set_vba(&mut self, value: u32) {
15513        let offset = Self::VBA_SHIFT;
15514        assert!(value & (Self::VBA_MASK as u32) == value);
15515        *self = Self::from_bits_retain(
15516            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
15517        );
15518    }
15519}
15520
15521bitflags! {
15522    /// `NMRR` system register value.
15523    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15524    #[repr(transparent)]
15525    pub struct Nmrr: u32 {
15526    }
15527}
15528
15529impl Nmrr {
15530    /// Offset of the `IR<n>` field.
15531    pub const IR_SHIFT: u32 = 0;
15532    /// Mask for the `IR<n>` field.
15533    pub const IR_MASK: u32 = 0b11;
15534    /// Offset of the `OR<n>` field.
15535    pub const OR_SHIFT: u32 = 16;
15536    /// Mask for the `OR<n>` field.
15537    pub const OR_MASK: u32 = 0b11;
15538
15539    /// Returns the value of the given `IR<n>` field.
15540    pub const fn ir(self, n: u32) -> u8 {
15541        assert!(n < 8);
15542        ((self.bits() >> (Self::IR_SHIFT + (n - 0) * 2)) & 0b11) as u8
15543    }
15544
15545    /// Sets the value of the `IR<n>` field.
15546    pub const fn set_ir(&mut self, n: u32, value: u8) {
15547        assert!(n < 8);
15548        let offset = Self::IR_SHIFT + (n - 0) * 2;
15549        assert!(value & (Self::IR_MASK as u8) == value);
15550        *self = Self::from_bits_retain(
15551            (self.bits() & !(Self::IR_MASK << offset)) | ((value as u32) << offset),
15552        );
15553    }
15554
15555    /// Returns the value of the given `OR<n>` field.
15556    pub const fn or(self, n: u32) -> u8 {
15557        assert!(n < 8);
15558        ((self.bits() >> (Self::OR_SHIFT + (n - 0) * 2)) & 0b11) as u8
15559    }
15560
15561    /// Sets the value of the `OR<n>` field.
15562    pub const fn set_or(&mut self, n: u32, value: u8) {
15563        assert!(n < 8);
15564        let offset = Self::OR_SHIFT + (n - 0) * 2;
15565        assert!(value & (Self::OR_MASK as u8) == value);
15566        *self = Self::from_bits_retain(
15567            (self.bits() & !(Self::OR_MASK << offset)) | ((value as u32) << offset),
15568        );
15569    }
15570}
15571
15572bitflags! {
15573    /// `NSACR` system register value.
15574    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15575    #[repr(transparent)]
15576    pub struct Nsacr: u32 {
15577        /// `cp10` bit.
15578        const CP10 = 1 << 10;
15579        /// `cp11` bit.
15580        const CP11 = 1 << 11;
15581        /// `NSASEDIS` bit.
15582        const NSASEDIS = 1 << 15;
15583        /// `NSTRCDIS` bit.
15584        const NSTRCDIS = 1 << 20;
15585    }
15586}
15587
15588impl Nsacr {
15589    /// Offset of the `cp10` field.
15590    pub const CP10_SHIFT: u32 = 10;
15591    /// Offset of the `cp11` field.
15592    pub const CP11_SHIFT: u32 = 11;
15593    /// Offset of the `NSASEDIS` field.
15594    pub const NSASEDIS_SHIFT: u32 = 15;
15595    /// Offset of the `NSTRCDIS` field.
15596    pub const NSTRCDIS_SHIFT: u32 = 20;
15597}
15598
15599bitflags! {
15600    /// `PAR` system register value.
15601    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15602    #[repr(transparent)]
15603    pub struct Par: u64 {
15604        /// `F` bit.
15605        const F = 1 << 0;
15606        /// `SS` bit.
15607        const SS = 1 << 1;
15608        /// `FS[5]` bit.
15609        const FS_5 = 1 << 6;
15610        /// `S2WLK` bit.
15611        const S2WLK = 1 << 8;
15612        /// `FSTAGE` bit.
15613        const FSTAGE = 1 << 9;
15614        /// `NS` bit.
15615        const NS = 1 << 9;
15616        /// `NOS` bit.
15617        const NOS = 1 << 10;
15618        /// `LPAE` bit.
15619        const LPAE = 1 << 11;
15620    }
15621}
15622
15623impl Par {
15624    /// Offset of the `F` field.
15625    pub const F_SHIFT: u32 = 0;
15626    /// Offset of the `FST` field.
15627    pub const FST_SHIFT: u32 = 1;
15628    /// Mask for the `FST` field.
15629    pub const FST_MASK: u64 = 0b111111;
15630    /// Offset of the `FS[4:0]` field.
15631    pub const FS_4_0_SHIFT: u32 = 1;
15632    /// Mask for the `FS[4:0]` field.
15633    pub const FS_4_0_MASK: u64 = 0b11111;
15634    /// Offset of the `SS` field.
15635    pub const SS_SHIFT: u32 = 1;
15636    /// Offset of the `Outer[1:0]` field.
15637    pub const OUTER_1_0_SHIFT: u32 = 2;
15638    /// Mask for the `Outer[1:0]` field.
15639    pub const OUTER_1_0_MASK: u64 = 0b11;
15640    /// Offset of the `Inner[2:0]` field.
15641    pub const INNER_2_0_SHIFT: u32 = 4;
15642    /// Mask for the `Inner[2:0]` field.
15643    pub const INNER_2_0_MASK: u64 = 0b111;
15644    /// Offset of the `FS[5]` field.
15645    pub const FS_5_SHIFT: u32 = 6;
15646    /// Offset of the `S2WLK` field.
15647    pub const S2WLK_SHIFT: u32 = 8;
15648    /// Offset of the `FSTAGE` field.
15649    pub const FSTAGE_SHIFT: u32 = 9;
15650    /// Offset of the `NS` field.
15651    pub const NS_SHIFT: u32 = 9;
15652    /// Offset of the `NOS` field.
15653    pub const NOS_SHIFT: u32 = 10;
15654    /// Offset of the `LPAE` field.
15655    pub const LPAE_SHIFT: u32 = 11;
15656    /// Offset of the `ATTR` field.
15657    pub const ATTR_SHIFT: u32 = 56;
15658    /// Mask for the `ATTR` field.
15659    pub const ATTR_MASK: u64 = 0b11111111;
15660
15661    /// Returns the value of the `FST` field.
15662    pub const fn fst(self) -> u8 {
15663        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
15664    }
15665
15666    /// Sets the value of the `FST` field.
15667    pub const fn set_fst(&mut self, value: u8) {
15668        let offset = Self::FST_SHIFT;
15669        assert!(value & (Self::FST_MASK as u8) == value);
15670        *self = Self::from_bits_retain(
15671            (self.bits() & !(Self::FST_MASK << offset)) | ((value as u64) << offset),
15672        );
15673    }
15674
15675    /// Returns the value of the `FS[4:0]` field.
15676    pub const fn fs_4_0(self) -> u8 {
15677        ((self.bits() >> Self::FS_4_0_SHIFT) & 0b11111) as u8
15678    }
15679
15680    /// Sets the value of the `FS[4:0]` field.
15681    pub const fn set_fs_4_0(&mut self, value: u8) {
15682        let offset = Self::FS_4_0_SHIFT;
15683        assert!(value & (Self::FS_4_0_MASK as u8) == value);
15684        *self = Self::from_bits_retain(
15685            (self.bits() & !(Self::FS_4_0_MASK << offset)) | ((value as u64) << offset),
15686        );
15687    }
15688
15689    /// Returns the value of the `Outer[1:0]` field.
15690    pub const fn outer_1_0(self) -> u8 {
15691        ((self.bits() >> Self::OUTER_1_0_SHIFT) & 0b11) as u8
15692    }
15693
15694    /// Sets the value of the `Outer[1:0]` field.
15695    pub const fn set_outer_1_0(&mut self, value: u8) {
15696        let offset = Self::OUTER_1_0_SHIFT;
15697        assert!(value & (Self::OUTER_1_0_MASK as u8) == value);
15698        *self = Self::from_bits_retain(
15699            (self.bits() & !(Self::OUTER_1_0_MASK << offset)) | ((value as u64) << offset),
15700        );
15701    }
15702
15703    /// Returns the value of the `Inner[2:0]` field.
15704    pub const fn inner_2_0(self) -> u8 {
15705        ((self.bits() >> Self::INNER_2_0_SHIFT) & 0b111) as u8
15706    }
15707
15708    /// Sets the value of the `Inner[2:0]` field.
15709    pub const fn set_inner_2_0(&mut self, value: u8) {
15710        let offset = Self::INNER_2_0_SHIFT;
15711        assert!(value & (Self::INNER_2_0_MASK as u8) == value);
15712        *self = Self::from_bits_retain(
15713            (self.bits() & !(Self::INNER_2_0_MASK << offset)) | ((value as u64) << offset),
15714        );
15715    }
15716
15717    /// Returns the value of the `ATTR` field.
15718    pub const fn attr(self) -> u8 {
15719        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
15720    }
15721
15722    /// Sets the value of the `ATTR` field.
15723    pub const fn set_attr(&mut self, value: u8) {
15724        let offset = Self::ATTR_SHIFT;
15725        assert!(value & (Self::ATTR_MASK as u8) == value);
15726        *self = Self::from_bits_retain(
15727            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
15728        );
15729    }
15730}
15731
15732#[cfg(feature = "el1")]
15733bitflags! {
15734    /// `PAR_EL1` system register value.
15735    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15736    #[repr(transparent)]
15737    pub struct ParEl1: u64 {
15738        /// RES1 bits in the `PAR_EL1` register.
15739        const RES1 = 0b100000000000;
15740        /// `F` bit.
15741        const F = 1 << 0;
15742        /// `PTW` bit.
15743        const PTW = 1 << 8;
15744        /// `NS` bit.
15745        const NS = 1 << 9;
15746        /// `S` bit.
15747        const S = 1 << 9;
15748        /// `NSE` bit.
15749        const NSE = 1 << 11;
15750        /// `AssuredOnly` bit.
15751        const ASSUREDONLY = 1 << 12;
15752        /// `TopLevel` bit.
15753        const TOPLEVEL = 1 << 13;
15754        /// `Overlay` bit.
15755        const OVERLAY = 1 << 14;
15756        /// `DirtyBit` bit.
15757        const DIRTYBIT = 1 << 15;
15758    }
15759}
15760
15761#[cfg(feature = "el1")]
15762impl ParEl1 {
15763    /// Offset of the `F` field.
15764    pub const F_SHIFT: u32 = 0;
15765    /// Offset of the `FST` field.
15766    pub const FST_SHIFT: u32 = 1;
15767    /// Mask for the `FST` field.
15768    pub const FST_MASK: u64 = 0b111111;
15769    /// Offset of the `SH` field.
15770    pub const SH_SHIFT: u32 = 7;
15771    /// Mask for the `SH` field.
15772    pub const SH_MASK: u64 = 0b11;
15773    /// Offset of the `PTW` field.
15774    pub const PTW_SHIFT: u32 = 8;
15775    /// Offset of the `NS` field.
15776    pub const NS_SHIFT: u32 = 9;
15777    /// Offset of the `S` field.
15778    pub const S_SHIFT: u32 = 9;
15779    /// Offset of the `NSE` field.
15780    pub const NSE_SHIFT: u32 = 11;
15781    /// Offset of the `AssuredOnly` field.
15782    pub const ASSUREDONLY_SHIFT: u32 = 12;
15783    /// Offset of the `PA[47:12]` field.
15784    pub const PA_47_12_SHIFT: u32 = 12;
15785    /// Mask for the `PA[47:12]` field.
15786    pub const PA_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
15787    /// Offset of the `TopLevel` field.
15788    pub const TOPLEVEL_SHIFT: u32 = 13;
15789    /// Offset of the `Overlay` field.
15790    pub const OVERLAY_SHIFT: u32 = 14;
15791    /// Offset of the `DirtyBit` field.
15792    pub const DIRTYBIT_SHIFT: u32 = 15;
15793    /// Offset of the `PA[51:48]` field.
15794    pub const PA_51_48_SHIFT: u32 = 48;
15795    /// Mask for the `PA[51:48]` field.
15796    pub const PA_51_48_MASK: u64 = 0b1111;
15797    /// Offset of the `ATTR` field.
15798    pub const ATTR_SHIFT: u32 = 56;
15799    /// Mask for the `ATTR` field.
15800    pub const ATTR_MASK: u64 = 0b11111111;
15801
15802    /// Returns the value of the `FST` field.
15803    pub const fn fst(self) -> u8 {
15804        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
15805    }
15806
15807    /// Sets the value of the `FST` field.
15808    pub const fn set_fst(&mut self, value: u8) {
15809        let offset = Self::FST_SHIFT;
15810        assert!(value & (Self::FST_MASK as u8) == value);
15811        *self = Self::from_bits_retain(
15812            (self.bits() & !(Self::FST_MASK << offset)) | ((value as u64) << offset),
15813        );
15814    }
15815
15816    /// Returns the value of the `SH` field.
15817    pub const fn sh(self) -> u8 {
15818        ((self.bits() >> Self::SH_SHIFT) & 0b11) as u8
15819    }
15820
15821    /// Sets the value of the `SH` field.
15822    pub const fn set_sh(&mut self, value: u8) {
15823        let offset = Self::SH_SHIFT;
15824        assert!(value & (Self::SH_MASK as u8) == value);
15825        *self = Self::from_bits_retain(
15826            (self.bits() & !(Self::SH_MASK << offset)) | ((value as u64) << offset),
15827        );
15828    }
15829
15830    /// Returns the value of the `PA[47:12]` field.
15831    pub const fn pa_47_12(self) -> u64 {
15832        ((self.bits() >> Self::PA_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
15833    }
15834
15835    /// Sets the value of the `PA[47:12]` field.
15836    pub const fn set_pa_47_12(&mut self, value: u64) {
15837        let offset = Self::PA_47_12_SHIFT;
15838        assert!(value & (Self::PA_47_12_MASK as u64) == value);
15839        *self = Self::from_bits_retain(
15840            (self.bits() & !(Self::PA_47_12_MASK << offset)) | ((value as u64) << offset),
15841        );
15842    }
15843
15844    /// Returns the value of the `PA[51:48]` field.
15845    pub const fn pa_51_48(self) -> u8 {
15846        ((self.bits() >> Self::PA_51_48_SHIFT) & 0b1111) as u8
15847    }
15848
15849    /// Sets the value of the `PA[51:48]` field.
15850    pub const fn set_pa_51_48(&mut self, value: u8) {
15851        let offset = Self::PA_51_48_SHIFT;
15852        assert!(value & (Self::PA_51_48_MASK as u8) == value);
15853        *self = Self::from_bits_retain(
15854            (self.bits() & !(Self::PA_51_48_MASK << offset)) | ((value as u64) << offset),
15855        );
15856    }
15857
15858    /// Returns the value of the `ATTR` field.
15859    pub const fn attr(self) -> u8 {
15860        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
15861    }
15862
15863    /// Sets the value of the `ATTR` field.
15864    pub const fn set_attr(&mut self, value: u8) {
15865        let offset = Self::ATTR_SHIFT;
15866        assert!(value & (Self::ATTR_MASK as u8) == value);
15867        *self = Self::from_bits_retain(
15868            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
15869        );
15870    }
15871}
15872
15873bitflags! {
15874    /// `PMCCFILTR` system register value.
15875    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15876    #[repr(transparent)]
15877    pub struct Pmccfiltr: u32 {
15878        /// `RLU` bit.
15879        const RLU = 1 << 21;
15880        /// `NSH` bit.
15881        const NSH = 1 << 27;
15882        /// `NSU` bit.
15883        const NSU = 1 << 28;
15884        /// `NSK` bit.
15885        const NSK = 1 << 29;
15886        /// `U` bit.
15887        const U = 1 << 30;
15888        /// `P` bit.
15889        const P = 1 << 31;
15890    }
15891}
15892
15893impl Pmccfiltr {
15894    /// Offset of the `RLU` field.
15895    pub const RLU_SHIFT: u32 = 21;
15896    /// Offset of the `NSH` field.
15897    pub const NSH_SHIFT: u32 = 27;
15898    /// Offset of the `NSU` field.
15899    pub const NSU_SHIFT: u32 = 28;
15900    /// Offset of the `NSK` field.
15901    pub const NSK_SHIFT: u32 = 29;
15902    /// Offset of the `U` field.
15903    pub const U_SHIFT: u32 = 30;
15904    /// Offset of the `P` field.
15905    pub const P_SHIFT: u32 = 31;
15906}
15907
15908bitflags! {
15909    /// `PMCCNTR` system register value.
15910    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15911    #[repr(transparent)]
15912    pub struct Pmccntr: u64 {
15913    }
15914}
15915
15916impl Pmccntr {
15917    /// Offset of the `CCNT` field.
15918    pub const CCNT_SHIFT: u32 = 0;
15919    /// Mask for the `CCNT` field.
15920    pub const CCNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
15921
15922    /// Returns the value of the `CCNT` field.
15923    pub const fn ccnt(self) -> u64 {
15924        ((self.bits() >> Self::CCNT_SHIFT)
15925            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
15926    }
15927
15928    /// Sets the value of the `CCNT` field.
15929    pub const fn set_ccnt(&mut self, value: u64) {
15930        let offset = Self::CCNT_SHIFT;
15931        assert!(value & (Self::CCNT_MASK as u64) == value);
15932        *self = Self::from_bits_retain(
15933            (self.bits() & !(Self::CCNT_MASK << offset)) | ((value as u64) << offset),
15934        );
15935    }
15936}
15937
15938bitflags! {
15939    /// `PMCEID0` system register value.
15940    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15941    #[repr(transparent)]
15942    pub struct Pmceid0: u32 {
15943        /// `ID<n>` bit 0.
15944        const ID0 = 1 << 0;
15945        /// `ID<n>` bit 1.
15946        const ID1 = 1 << 1;
15947        /// `ID<n>` bit 2.
15948        const ID2 = 1 << 2;
15949        /// `ID<n>` bit 3.
15950        const ID3 = 1 << 3;
15951        /// `ID<n>` bit 4.
15952        const ID4 = 1 << 4;
15953        /// `ID<n>` bit 5.
15954        const ID5 = 1 << 5;
15955        /// `ID<n>` bit 6.
15956        const ID6 = 1 << 6;
15957        /// `ID<n>` bit 7.
15958        const ID7 = 1 << 7;
15959        /// `ID<n>` bit 8.
15960        const ID8 = 1 << 8;
15961        /// `ID<n>` bit 9.
15962        const ID9 = 1 << 9;
15963        /// `ID<n>` bit 10.
15964        const ID10 = 1 << 10;
15965        /// `ID<n>` bit 11.
15966        const ID11 = 1 << 11;
15967        /// `ID<n>` bit 12.
15968        const ID12 = 1 << 12;
15969        /// `ID<n>` bit 13.
15970        const ID13 = 1 << 13;
15971        /// `ID<n>` bit 14.
15972        const ID14 = 1 << 14;
15973        /// `ID<n>` bit 15.
15974        const ID15 = 1 << 15;
15975        /// `ID<n>` bit 16.
15976        const ID16 = 1 << 16;
15977        /// `ID<n>` bit 17.
15978        const ID17 = 1 << 17;
15979        /// `ID<n>` bit 18.
15980        const ID18 = 1 << 18;
15981        /// `ID<n>` bit 19.
15982        const ID19 = 1 << 19;
15983        /// `ID<n>` bit 20.
15984        const ID20 = 1 << 20;
15985        /// `ID<n>` bit 21.
15986        const ID21 = 1 << 21;
15987        /// `ID<n>` bit 22.
15988        const ID22 = 1 << 22;
15989        /// `ID<n>` bit 23.
15990        const ID23 = 1 << 23;
15991        /// `ID<n>` bit 24.
15992        const ID24 = 1 << 24;
15993        /// `ID<n>` bit 25.
15994        const ID25 = 1 << 25;
15995        /// `ID<n>` bit 26.
15996        const ID26 = 1 << 26;
15997        /// `ID<n>` bit 27.
15998        const ID27 = 1 << 27;
15999        /// `ID<n>` bit 28.
16000        const ID28 = 1 << 28;
16001        /// `ID<n>` bit 29.
16002        const ID29 = 1 << 29;
16003        /// `ID<n>` bit 30.
16004        const ID30 = 1 << 30;
16005        /// `ID<n>` bit 31.
16006        const ID31 = 1 << 31;
16007    }
16008}
16009
16010impl Pmceid0 {
16011    /// Offset of the `ID<n>` field.
16012    pub const ID_SHIFT: u32 = 0;
16013}
16014
16015bitflags! {
16016    /// `PMCEID1` system register value.
16017    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16018    #[repr(transparent)]
16019    pub struct Pmceid1: u32 {
16020        /// `ID<n>` bit 0.
16021        const ID0 = 1 << 0;
16022        /// `ID<n>` bit 1.
16023        const ID1 = 1 << 1;
16024        /// `ID<n>` bit 2.
16025        const ID2 = 1 << 2;
16026        /// `ID<n>` bit 3.
16027        const ID3 = 1 << 3;
16028        /// `ID<n>` bit 4.
16029        const ID4 = 1 << 4;
16030        /// `ID<n>` bit 5.
16031        const ID5 = 1 << 5;
16032        /// `ID<n>` bit 6.
16033        const ID6 = 1 << 6;
16034        /// `ID<n>` bit 7.
16035        const ID7 = 1 << 7;
16036        /// `ID<n>` bit 8.
16037        const ID8 = 1 << 8;
16038        /// `ID<n>` bit 9.
16039        const ID9 = 1 << 9;
16040        /// `ID<n>` bit 10.
16041        const ID10 = 1 << 10;
16042        /// `ID<n>` bit 11.
16043        const ID11 = 1 << 11;
16044        /// `ID<n>` bit 12.
16045        const ID12 = 1 << 12;
16046        /// `ID<n>` bit 13.
16047        const ID13 = 1 << 13;
16048        /// `ID<n>` bit 14.
16049        const ID14 = 1 << 14;
16050        /// `ID<n>` bit 15.
16051        const ID15 = 1 << 15;
16052        /// `ID<n>` bit 16.
16053        const ID16 = 1 << 16;
16054        /// `ID<n>` bit 17.
16055        const ID17 = 1 << 17;
16056        /// `ID<n>` bit 18.
16057        const ID18 = 1 << 18;
16058        /// `ID<n>` bit 19.
16059        const ID19 = 1 << 19;
16060        /// `ID<n>` bit 20.
16061        const ID20 = 1 << 20;
16062        /// `ID<n>` bit 21.
16063        const ID21 = 1 << 21;
16064        /// `ID<n>` bit 22.
16065        const ID22 = 1 << 22;
16066        /// `ID<n>` bit 23.
16067        const ID23 = 1 << 23;
16068        /// `ID<n>` bit 24.
16069        const ID24 = 1 << 24;
16070        /// `ID<n>` bit 25.
16071        const ID25 = 1 << 25;
16072        /// `ID<n>` bit 26.
16073        const ID26 = 1 << 26;
16074        /// `ID<n>` bit 27.
16075        const ID27 = 1 << 27;
16076        /// `ID<n>` bit 28.
16077        const ID28 = 1 << 28;
16078        /// `ID<n>` bit 29.
16079        const ID29 = 1 << 29;
16080        /// `ID<n>` bit 30.
16081        const ID30 = 1 << 30;
16082        /// `ID<n>` bit 31.
16083        const ID31 = 1 << 31;
16084    }
16085}
16086
16087impl Pmceid1 {
16088    /// Offset of the `ID<n>` field.
16089    pub const ID_SHIFT: u32 = 0;
16090}
16091
16092bitflags! {
16093    /// `PMCEID2` system register value.
16094    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16095    #[repr(transparent)]
16096    pub struct Pmceid2: u32 {
16097        /// `IDhi<n>` bit 0.
16098        const IDHI0 = 1 << 0;
16099        /// `IDhi<n>` bit 1.
16100        const IDHI1 = 1 << 1;
16101        /// `IDhi<n>` bit 2.
16102        const IDHI2 = 1 << 2;
16103        /// `IDhi<n>` bit 3.
16104        const IDHI3 = 1 << 3;
16105        /// `IDhi<n>` bit 4.
16106        const IDHI4 = 1 << 4;
16107        /// `IDhi<n>` bit 5.
16108        const IDHI5 = 1 << 5;
16109        /// `IDhi<n>` bit 6.
16110        const IDHI6 = 1 << 6;
16111        /// `IDhi<n>` bit 7.
16112        const IDHI7 = 1 << 7;
16113        /// `IDhi<n>` bit 8.
16114        const IDHI8 = 1 << 8;
16115        /// `IDhi<n>` bit 9.
16116        const IDHI9 = 1 << 9;
16117        /// `IDhi<n>` bit 10.
16118        const IDHI10 = 1 << 10;
16119        /// `IDhi<n>` bit 11.
16120        const IDHI11 = 1 << 11;
16121        /// `IDhi<n>` bit 12.
16122        const IDHI12 = 1 << 12;
16123        /// `IDhi<n>` bit 13.
16124        const IDHI13 = 1 << 13;
16125        /// `IDhi<n>` bit 14.
16126        const IDHI14 = 1 << 14;
16127        /// `IDhi<n>` bit 15.
16128        const IDHI15 = 1 << 15;
16129        /// `IDhi<n>` bit 16.
16130        const IDHI16 = 1 << 16;
16131        /// `IDhi<n>` bit 17.
16132        const IDHI17 = 1 << 17;
16133        /// `IDhi<n>` bit 18.
16134        const IDHI18 = 1 << 18;
16135        /// `IDhi<n>` bit 19.
16136        const IDHI19 = 1 << 19;
16137        /// `IDhi<n>` bit 20.
16138        const IDHI20 = 1 << 20;
16139        /// `IDhi<n>` bit 21.
16140        const IDHI21 = 1 << 21;
16141        /// `IDhi<n>` bit 22.
16142        const IDHI22 = 1 << 22;
16143        /// `IDhi<n>` bit 23.
16144        const IDHI23 = 1 << 23;
16145        /// `IDhi<n>` bit 24.
16146        const IDHI24 = 1 << 24;
16147        /// `IDhi<n>` bit 25.
16148        const IDHI25 = 1 << 25;
16149        /// `IDhi<n>` bit 26.
16150        const IDHI26 = 1 << 26;
16151        /// `IDhi<n>` bit 27.
16152        const IDHI27 = 1 << 27;
16153        /// `IDhi<n>` bit 28.
16154        const IDHI28 = 1 << 28;
16155        /// `IDhi<n>` bit 29.
16156        const IDHI29 = 1 << 29;
16157        /// `IDhi<n>` bit 30.
16158        const IDHI30 = 1 << 30;
16159        /// `IDhi<n>` bit 31.
16160        const IDHI31 = 1 << 31;
16161    }
16162}
16163
16164impl Pmceid2 {
16165    /// Offset of the `IDhi<n>` field.
16166    pub const IDHI_SHIFT: u32 = 0;
16167}
16168
16169bitflags! {
16170    /// `PMCEID3` system register value.
16171    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16172    #[repr(transparent)]
16173    pub struct Pmceid3: u32 {
16174        /// `IDhi<n>` bit 0.
16175        const IDHI0 = 1 << 0;
16176        /// `IDhi<n>` bit 1.
16177        const IDHI1 = 1 << 1;
16178        /// `IDhi<n>` bit 2.
16179        const IDHI2 = 1 << 2;
16180        /// `IDhi<n>` bit 3.
16181        const IDHI3 = 1 << 3;
16182        /// `IDhi<n>` bit 4.
16183        const IDHI4 = 1 << 4;
16184        /// `IDhi<n>` bit 5.
16185        const IDHI5 = 1 << 5;
16186        /// `IDhi<n>` bit 6.
16187        const IDHI6 = 1 << 6;
16188        /// `IDhi<n>` bit 7.
16189        const IDHI7 = 1 << 7;
16190        /// `IDhi<n>` bit 8.
16191        const IDHI8 = 1 << 8;
16192        /// `IDhi<n>` bit 9.
16193        const IDHI9 = 1 << 9;
16194        /// `IDhi<n>` bit 10.
16195        const IDHI10 = 1 << 10;
16196        /// `IDhi<n>` bit 11.
16197        const IDHI11 = 1 << 11;
16198        /// `IDhi<n>` bit 12.
16199        const IDHI12 = 1 << 12;
16200        /// `IDhi<n>` bit 13.
16201        const IDHI13 = 1 << 13;
16202        /// `IDhi<n>` bit 14.
16203        const IDHI14 = 1 << 14;
16204        /// `IDhi<n>` bit 15.
16205        const IDHI15 = 1 << 15;
16206        /// `IDhi<n>` bit 16.
16207        const IDHI16 = 1 << 16;
16208        /// `IDhi<n>` bit 17.
16209        const IDHI17 = 1 << 17;
16210        /// `IDhi<n>` bit 18.
16211        const IDHI18 = 1 << 18;
16212        /// `IDhi<n>` bit 19.
16213        const IDHI19 = 1 << 19;
16214        /// `IDhi<n>` bit 20.
16215        const IDHI20 = 1 << 20;
16216        /// `IDhi<n>` bit 21.
16217        const IDHI21 = 1 << 21;
16218        /// `IDhi<n>` bit 22.
16219        const IDHI22 = 1 << 22;
16220        /// `IDhi<n>` bit 23.
16221        const IDHI23 = 1 << 23;
16222        /// `IDhi<n>` bit 24.
16223        const IDHI24 = 1 << 24;
16224        /// `IDhi<n>` bit 25.
16225        const IDHI25 = 1 << 25;
16226        /// `IDhi<n>` bit 26.
16227        const IDHI26 = 1 << 26;
16228        /// `IDhi<n>` bit 27.
16229        const IDHI27 = 1 << 27;
16230        /// `IDhi<n>` bit 28.
16231        const IDHI28 = 1 << 28;
16232        /// `IDhi<n>` bit 29.
16233        const IDHI29 = 1 << 29;
16234        /// `IDhi<n>` bit 30.
16235        const IDHI30 = 1 << 30;
16236        /// `IDhi<n>` bit 31.
16237        const IDHI31 = 1 << 31;
16238    }
16239}
16240
16241impl Pmceid3 {
16242    /// Offset of the `IDhi<n>` field.
16243    pub const IDHI_SHIFT: u32 = 0;
16244}
16245
16246bitflags! {
16247    /// `PMCNTENCLR` system register value.
16248    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16249    #[repr(transparent)]
16250    pub struct Pmcntenclr: u32 {
16251        /// `P<m>` bit 0.
16252        const P0 = 1 << 0;
16253        /// `P<m>` bit 1.
16254        const P1 = 1 << 1;
16255        /// `P<m>` bit 2.
16256        const P2 = 1 << 2;
16257        /// `P<m>` bit 3.
16258        const P3 = 1 << 3;
16259        /// `P<m>` bit 4.
16260        const P4 = 1 << 4;
16261        /// `P<m>` bit 5.
16262        const P5 = 1 << 5;
16263        /// `P<m>` bit 6.
16264        const P6 = 1 << 6;
16265        /// `P<m>` bit 7.
16266        const P7 = 1 << 7;
16267        /// `P<m>` bit 8.
16268        const P8 = 1 << 8;
16269        /// `P<m>` bit 9.
16270        const P9 = 1 << 9;
16271        /// `P<m>` bit 10.
16272        const P10 = 1 << 10;
16273        /// `P<m>` bit 11.
16274        const P11 = 1 << 11;
16275        /// `P<m>` bit 12.
16276        const P12 = 1 << 12;
16277        /// `P<m>` bit 13.
16278        const P13 = 1 << 13;
16279        /// `P<m>` bit 14.
16280        const P14 = 1 << 14;
16281        /// `P<m>` bit 15.
16282        const P15 = 1 << 15;
16283        /// `P<m>` bit 16.
16284        const P16 = 1 << 16;
16285        /// `P<m>` bit 17.
16286        const P17 = 1 << 17;
16287        /// `P<m>` bit 18.
16288        const P18 = 1 << 18;
16289        /// `P<m>` bit 19.
16290        const P19 = 1 << 19;
16291        /// `P<m>` bit 20.
16292        const P20 = 1 << 20;
16293        /// `P<m>` bit 21.
16294        const P21 = 1 << 21;
16295        /// `P<m>` bit 22.
16296        const P22 = 1 << 22;
16297        /// `P<m>` bit 23.
16298        const P23 = 1 << 23;
16299        /// `P<m>` bit 24.
16300        const P24 = 1 << 24;
16301        /// `P<m>` bit 25.
16302        const P25 = 1 << 25;
16303        /// `P<m>` bit 26.
16304        const P26 = 1 << 26;
16305        /// `P<m>` bit 27.
16306        const P27 = 1 << 27;
16307        /// `P<m>` bit 28.
16308        const P28 = 1 << 28;
16309        /// `P<m>` bit 29.
16310        const P29 = 1 << 29;
16311        /// `P<m>` bit 30.
16312        const P30 = 1 << 30;
16313        /// `C` bit.
16314        const C = 1 << 31;
16315    }
16316}
16317
16318impl Pmcntenclr {
16319    /// Offset of the `P<m>` field.
16320    pub const P_SHIFT: u32 = 0;
16321    /// Offset of the `C` field.
16322    pub const C_SHIFT: u32 = 31;
16323}
16324
16325bitflags! {
16326    /// `PMCNTENSET` system register value.
16327    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16328    #[repr(transparent)]
16329    pub struct Pmcntenset: u32 {
16330        /// `P<m>` bit 0.
16331        const P0 = 1 << 0;
16332        /// `P<m>` bit 1.
16333        const P1 = 1 << 1;
16334        /// `P<m>` bit 2.
16335        const P2 = 1 << 2;
16336        /// `P<m>` bit 3.
16337        const P3 = 1 << 3;
16338        /// `P<m>` bit 4.
16339        const P4 = 1 << 4;
16340        /// `P<m>` bit 5.
16341        const P5 = 1 << 5;
16342        /// `P<m>` bit 6.
16343        const P6 = 1 << 6;
16344        /// `P<m>` bit 7.
16345        const P7 = 1 << 7;
16346        /// `P<m>` bit 8.
16347        const P8 = 1 << 8;
16348        /// `P<m>` bit 9.
16349        const P9 = 1 << 9;
16350        /// `P<m>` bit 10.
16351        const P10 = 1 << 10;
16352        /// `P<m>` bit 11.
16353        const P11 = 1 << 11;
16354        /// `P<m>` bit 12.
16355        const P12 = 1 << 12;
16356        /// `P<m>` bit 13.
16357        const P13 = 1 << 13;
16358        /// `P<m>` bit 14.
16359        const P14 = 1 << 14;
16360        /// `P<m>` bit 15.
16361        const P15 = 1 << 15;
16362        /// `P<m>` bit 16.
16363        const P16 = 1 << 16;
16364        /// `P<m>` bit 17.
16365        const P17 = 1 << 17;
16366        /// `P<m>` bit 18.
16367        const P18 = 1 << 18;
16368        /// `P<m>` bit 19.
16369        const P19 = 1 << 19;
16370        /// `P<m>` bit 20.
16371        const P20 = 1 << 20;
16372        /// `P<m>` bit 21.
16373        const P21 = 1 << 21;
16374        /// `P<m>` bit 22.
16375        const P22 = 1 << 22;
16376        /// `P<m>` bit 23.
16377        const P23 = 1 << 23;
16378        /// `P<m>` bit 24.
16379        const P24 = 1 << 24;
16380        /// `P<m>` bit 25.
16381        const P25 = 1 << 25;
16382        /// `P<m>` bit 26.
16383        const P26 = 1 << 26;
16384        /// `P<m>` bit 27.
16385        const P27 = 1 << 27;
16386        /// `P<m>` bit 28.
16387        const P28 = 1 << 28;
16388        /// `P<m>` bit 29.
16389        const P29 = 1 << 29;
16390        /// `P<m>` bit 30.
16391        const P30 = 1 << 30;
16392        /// `C` bit.
16393        const C = 1 << 31;
16394    }
16395}
16396
16397impl Pmcntenset {
16398    /// Offset of the `P<m>` field.
16399    pub const P_SHIFT: u32 = 0;
16400    /// Offset of the `C` field.
16401    pub const C_SHIFT: u32 = 31;
16402}
16403
16404bitflags! {
16405    /// `PMCR` system register value.
16406    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16407    #[repr(transparent)]
16408    pub struct Pmcr: u32 {
16409        /// `E` bit.
16410        const E = 1 << 0;
16411        /// `P` bit.
16412        const P = 1 << 1;
16413        /// `C` bit.
16414        const C = 1 << 2;
16415        /// `D` bit.
16416        const D = 1 << 3;
16417        /// `X` bit.
16418        const X = 1 << 4;
16419        /// `DP` bit.
16420        const DP = 1 << 5;
16421        /// `LC` bit.
16422        const LC = 1 << 6;
16423        /// `LP` bit.
16424        const LP = 1 << 7;
16425        /// `FZO` bit.
16426        const FZO = 1 << 9;
16427    }
16428}
16429
16430impl Pmcr {
16431    /// Offset of the `E` field.
16432    pub const E_SHIFT: u32 = 0;
16433    /// Offset of the `P` field.
16434    pub const P_SHIFT: u32 = 1;
16435    /// Offset of the `C` field.
16436    pub const C_SHIFT: u32 = 2;
16437    /// Offset of the `D` field.
16438    pub const D_SHIFT: u32 = 3;
16439    /// Offset of the `X` field.
16440    pub const X_SHIFT: u32 = 4;
16441    /// Offset of the `DP` field.
16442    pub const DP_SHIFT: u32 = 5;
16443    /// Offset of the `LC` field.
16444    pub const LC_SHIFT: u32 = 6;
16445    /// Offset of the `LP` field.
16446    pub const LP_SHIFT: u32 = 7;
16447    /// Offset of the `FZO` field.
16448    pub const FZO_SHIFT: u32 = 9;
16449    /// Offset of the `N` field.
16450    pub const N_SHIFT: u32 = 11;
16451    /// Mask for the `N` field.
16452    pub const N_MASK: u32 = 0b11111;
16453    /// Offset of the `IDCODE` field.
16454    pub const IDCODE_SHIFT: u32 = 16;
16455    /// Mask for the `IDCODE` field.
16456    pub const IDCODE_MASK: u32 = 0b11111111;
16457    /// Offset of the `IMP` field.
16458    pub const IMP_SHIFT: u32 = 24;
16459    /// Mask for the `IMP` field.
16460    pub const IMP_MASK: u32 = 0b11111111;
16461
16462    /// Returns the value of the `N` field.
16463    pub const fn n(self) -> u8 {
16464        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
16465    }
16466
16467    /// Sets the value of the `N` field.
16468    pub const fn set_n(&mut self, value: u8) {
16469        let offset = Self::N_SHIFT;
16470        assert!(value & (Self::N_MASK as u8) == value);
16471        *self = Self::from_bits_retain(
16472            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
16473        );
16474    }
16475
16476    /// Returns the value of the `IDCODE` field.
16477    pub const fn idcode(self) -> u8 {
16478        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
16479    }
16480
16481    /// Sets the value of the `IDCODE` field.
16482    pub const fn set_idcode(&mut self, value: u8) {
16483        let offset = Self::IDCODE_SHIFT;
16484        assert!(value & (Self::IDCODE_MASK as u8) == value);
16485        *self = Self::from_bits_retain(
16486            (self.bits() & !(Self::IDCODE_MASK << offset)) | ((value as u32) << offset),
16487        );
16488    }
16489
16490    /// Returns the value of the `IMP` field.
16491    pub const fn imp(self) -> u8 {
16492        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
16493    }
16494
16495    /// Sets the value of the `IMP` field.
16496    pub const fn set_imp(&mut self, value: u8) {
16497        let offset = Self::IMP_SHIFT;
16498        assert!(value & (Self::IMP_MASK as u8) == value);
16499        *self = Self::from_bits_retain(
16500            (self.bits() & !(Self::IMP_MASK << offset)) | ((value as u32) << offset),
16501        );
16502    }
16503}
16504
16505bitflags! {
16506    /// `PMCR_EL0` system register value.
16507    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16508    #[repr(transparent)]
16509    pub struct PmcrEl0: u64 {
16510        /// Enable. Affected counters are enabled by PMCNTENSET_EL0.
16511        const E = 1 << 0;
16512        /// Event counter reset. Reset all affected event counters PMEVCNTR<n>_EL0 to zero.
16513        const P = 1 << 1;
16514        /// Cycle counter reset. Reset PMCCNTR_EL0 to zero.
16515        const C = 1 << 2;
16516        /// Clock divider. If set PMCCNTR_EL0 counts once every 64 clock cycles.
16517        const D = 1 << 3;
16518        /// Enable export of events in an IMPLEMENTATION DEFINED PMU event export bus. If set, export events where not prohibited.
16519        const X = 1 << 4;
16520        /// If set, cycle counting by PMCCNTR_EL0 is disabled in prohibited regions.
16521        const DP = 1 << 5;
16522        /// `LC` bit.
16523        const LC = 1 << 6;
16524        /// `LP` bit.
16525        const LP = 1 << 7;
16526        /// `FZO` bit.
16527        const FZO = 1 << 9;
16528        /// `FZS` bit.
16529        const FZS = 1 << 32;
16530    }
16531}
16532
16533impl PmcrEl0 {
16534    /// Offset of the `E` field.
16535    pub const E_SHIFT: u32 = 0;
16536    /// Offset of the `P` field.
16537    pub const P_SHIFT: u32 = 1;
16538    /// Offset of the `C` field.
16539    pub const C_SHIFT: u32 = 2;
16540    /// Offset of the `D` field.
16541    pub const D_SHIFT: u32 = 3;
16542    /// Offset of the `X` field.
16543    pub const X_SHIFT: u32 = 4;
16544    /// Offset of the `DP` field.
16545    pub const DP_SHIFT: u32 = 5;
16546    /// Offset of the `LC` field.
16547    pub const LC_SHIFT: u32 = 6;
16548    /// Offset of the `LP` field.
16549    pub const LP_SHIFT: u32 = 7;
16550    /// Offset of the `FZO` field.
16551    pub const FZO_SHIFT: u32 = 9;
16552    /// Offset of the `N` field.
16553    pub const N_SHIFT: u32 = 11;
16554    /// Mask for the `N` field.
16555    pub const N_MASK: u64 = 0b11111;
16556    /// Offset of the `IDCODE` field.
16557    pub const IDCODE_SHIFT: u32 = 16;
16558    /// Mask for the `IDCODE` field.
16559    pub const IDCODE_MASK: u64 = 0b11111111;
16560    /// Offset of the `IMP` field.
16561    pub const IMP_SHIFT: u32 = 24;
16562    /// Mask for the `IMP` field.
16563    pub const IMP_MASK: u64 = 0b11111111;
16564    /// Offset of the `FZS` field.
16565    pub const FZS_SHIFT: u32 = 32;
16566
16567    /// Returns the value of the `N` field.
16568    pub const fn n(self) -> u8 {
16569        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
16570    }
16571
16572    /// Sets the value of the `N` field.
16573    pub const fn set_n(&mut self, value: u8) {
16574        let offset = Self::N_SHIFT;
16575        assert!(value & (Self::N_MASK as u8) == value);
16576        *self = Self::from_bits_retain(
16577            (self.bits() & !(Self::N_MASK << offset)) | ((value as u64) << offset),
16578        );
16579    }
16580
16581    /// Returns the value of the `IDCODE` field.
16582    pub const fn idcode(self) -> u8 {
16583        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
16584    }
16585
16586    /// Sets the value of the `IDCODE` field.
16587    pub const fn set_idcode(&mut self, value: u8) {
16588        let offset = Self::IDCODE_SHIFT;
16589        assert!(value & (Self::IDCODE_MASK as u8) == value);
16590        *self = Self::from_bits_retain(
16591            (self.bits() & !(Self::IDCODE_MASK << offset)) | ((value as u64) << offset),
16592        );
16593    }
16594
16595    /// Returns the value of the `IMP` field.
16596    pub const fn imp(self) -> u8 {
16597        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
16598    }
16599
16600    /// Sets the value of the `IMP` field.
16601    pub const fn set_imp(&mut self, value: u8) {
16602        let offset = Self::IMP_SHIFT;
16603        assert!(value & (Self::IMP_MASK as u8) == value);
16604        *self = Self::from_bits_retain(
16605            (self.bits() & !(Self::IMP_MASK << offset)) | ((value as u64) << offset),
16606        );
16607    }
16608}
16609
16610bitflags! {
16611    /// `PMINTENCLR` system register value.
16612    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16613    #[repr(transparent)]
16614    pub struct Pmintenclr: u32 {
16615        /// `P<m>` bit 0.
16616        const P0 = 1 << 0;
16617        /// `P<m>` bit 1.
16618        const P1 = 1 << 1;
16619        /// `P<m>` bit 2.
16620        const P2 = 1 << 2;
16621        /// `P<m>` bit 3.
16622        const P3 = 1 << 3;
16623        /// `P<m>` bit 4.
16624        const P4 = 1 << 4;
16625        /// `P<m>` bit 5.
16626        const P5 = 1 << 5;
16627        /// `P<m>` bit 6.
16628        const P6 = 1 << 6;
16629        /// `P<m>` bit 7.
16630        const P7 = 1 << 7;
16631        /// `P<m>` bit 8.
16632        const P8 = 1 << 8;
16633        /// `P<m>` bit 9.
16634        const P9 = 1 << 9;
16635        /// `P<m>` bit 10.
16636        const P10 = 1 << 10;
16637        /// `P<m>` bit 11.
16638        const P11 = 1 << 11;
16639        /// `P<m>` bit 12.
16640        const P12 = 1 << 12;
16641        /// `P<m>` bit 13.
16642        const P13 = 1 << 13;
16643        /// `P<m>` bit 14.
16644        const P14 = 1 << 14;
16645        /// `P<m>` bit 15.
16646        const P15 = 1 << 15;
16647        /// `P<m>` bit 16.
16648        const P16 = 1 << 16;
16649        /// `P<m>` bit 17.
16650        const P17 = 1 << 17;
16651        /// `P<m>` bit 18.
16652        const P18 = 1 << 18;
16653        /// `P<m>` bit 19.
16654        const P19 = 1 << 19;
16655        /// `P<m>` bit 20.
16656        const P20 = 1 << 20;
16657        /// `P<m>` bit 21.
16658        const P21 = 1 << 21;
16659        /// `P<m>` bit 22.
16660        const P22 = 1 << 22;
16661        /// `P<m>` bit 23.
16662        const P23 = 1 << 23;
16663        /// `P<m>` bit 24.
16664        const P24 = 1 << 24;
16665        /// `P<m>` bit 25.
16666        const P25 = 1 << 25;
16667        /// `P<m>` bit 26.
16668        const P26 = 1 << 26;
16669        /// `P<m>` bit 27.
16670        const P27 = 1 << 27;
16671        /// `P<m>` bit 28.
16672        const P28 = 1 << 28;
16673        /// `P<m>` bit 29.
16674        const P29 = 1 << 29;
16675        /// `P<m>` bit 30.
16676        const P30 = 1 << 30;
16677        /// `C` bit.
16678        const C = 1 << 31;
16679    }
16680}
16681
16682impl Pmintenclr {
16683    /// Offset of the `P<m>` field.
16684    pub const P_SHIFT: u32 = 0;
16685    /// Offset of the `C` field.
16686    pub const C_SHIFT: u32 = 31;
16687}
16688
16689bitflags! {
16690    /// `PMINTENSET` system register value.
16691    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16692    #[repr(transparent)]
16693    pub struct Pmintenset: u32 {
16694        /// `P<m>` bit 0.
16695        const P0 = 1 << 0;
16696        /// `P<m>` bit 1.
16697        const P1 = 1 << 1;
16698        /// `P<m>` bit 2.
16699        const P2 = 1 << 2;
16700        /// `P<m>` bit 3.
16701        const P3 = 1 << 3;
16702        /// `P<m>` bit 4.
16703        const P4 = 1 << 4;
16704        /// `P<m>` bit 5.
16705        const P5 = 1 << 5;
16706        /// `P<m>` bit 6.
16707        const P6 = 1 << 6;
16708        /// `P<m>` bit 7.
16709        const P7 = 1 << 7;
16710        /// `P<m>` bit 8.
16711        const P8 = 1 << 8;
16712        /// `P<m>` bit 9.
16713        const P9 = 1 << 9;
16714        /// `P<m>` bit 10.
16715        const P10 = 1 << 10;
16716        /// `P<m>` bit 11.
16717        const P11 = 1 << 11;
16718        /// `P<m>` bit 12.
16719        const P12 = 1 << 12;
16720        /// `P<m>` bit 13.
16721        const P13 = 1 << 13;
16722        /// `P<m>` bit 14.
16723        const P14 = 1 << 14;
16724        /// `P<m>` bit 15.
16725        const P15 = 1 << 15;
16726        /// `P<m>` bit 16.
16727        const P16 = 1 << 16;
16728        /// `P<m>` bit 17.
16729        const P17 = 1 << 17;
16730        /// `P<m>` bit 18.
16731        const P18 = 1 << 18;
16732        /// `P<m>` bit 19.
16733        const P19 = 1 << 19;
16734        /// `P<m>` bit 20.
16735        const P20 = 1 << 20;
16736        /// `P<m>` bit 21.
16737        const P21 = 1 << 21;
16738        /// `P<m>` bit 22.
16739        const P22 = 1 << 22;
16740        /// `P<m>` bit 23.
16741        const P23 = 1 << 23;
16742        /// `P<m>` bit 24.
16743        const P24 = 1 << 24;
16744        /// `P<m>` bit 25.
16745        const P25 = 1 << 25;
16746        /// `P<m>` bit 26.
16747        const P26 = 1 << 26;
16748        /// `P<m>` bit 27.
16749        const P27 = 1 << 27;
16750        /// `P<m>` bit 28.
16751        const P28 = 1 << 28;
16752        /// `P<m>` bit 29.
16753        const P29 = 1 << 29;
16754        /// `P<m>` bit 30.
16755        const P30 = 1 << 30;
16756        /// `C` bit.
16757        const C = 1 << 31;
16758    }
16759}
16760
16761impl Pmintenset {
16762    /// Offset of the `P<m>` field.
16763    pub const P_SHIFT: u32 = 0;
16764    /// Offset of the `C` field.
16765    pub const C_SHIFT: u32 = 31;
16766}
16767
16768bitflags! {
16769    /// `PMMIR` system register value.
16770    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16771    #[repr(transparent)]
16772    pub struct Pmmir: u32 {
16773    }
16774}
16775
16776impl Pmmir {
16777    /// Offset of the `SLOTS` field.
16778    pub const SLOTS_SHIFT: u32 = 0;
16779    /// Mask for the `SLOTS` field.
16780    pub const SLOTS_MASK: u32 = 0b11111111;
16781    /// Offset of the `BUS_SLOTS` field.
16782    pub const BUS_SLOTS_SHIFT: u32 = 8;
16783    /// Mask for the `BUS_SLOTS` field.
16784    pub const BUS_SLOTS_MASK: u32 = 0b11111111;
16785    /// Offset of the `BUS_WIDTH` field.
16786    pub const BUS_WIDTH_SHIFT: u32 = 16;
16787    /// Mask for the `BUS_WIDTH` field.
16788    pub const BUS_WIDTH_MASK: u32 = 0b1111;
16789    /// Offset of the `THWIDTH` field.
16790    pub const THWIDTH_SHIFT: u32 = 20;
16791    /// Mask for the `THWIDTH` field.
16792    pub const THWIDTH_MASK: u32 = 0b1111;
16793    /// Offset of the `EDGE` field.
16794    pub const EDGE_SHIFT: u32 = 24;
16795    /// Mask for the `EDGE` field.
16796    pub const EDGE_MASK: u32 = 0b1111;
16797
16798    /// Returns the value of the `SLOTS` field.
16799    pub const fn slots(self) -> u8 {
16800        ((self.bits() >> Self::SLOTS_SHIFT) & 0b11111111) as u8
16801    }
16802
16803    /// Sets the value of the `SLOTS` field.
16804    pub const fn set_slots(&mut self, value: u8) {
16805        let offset = Self::SLOTS_SHIFT;
16806        assert!(value & (Self::SLOTS_MASK as u8) == value);
16807        *self = Self::from_bits_retain(
16808            (self.bits() & !(Self::SLOTS_MASK << offset)) | ((value as u32) << offset),
16809        );
16810    }
16811
16812    /// Returns the value of the `BUS_SLOTS` field.
16813    pub const fn bus_slots(self) -> u8 {
16814        ((self.bits() >> Self::BUS_SLOTS_SHIFT) & 0b11111111) as u8
16815    }
16816
16817    /// Sets the value of the `BUS_SLOTS` field.
16818    pub const fn set_bus_slots(&mut self, value: u8) {
16819        let offset = Self::BUS_SLOTS_SHIFT;
16820        assert!(value & (Self::BUS_SLOTS_MASK as u8) == value);
16821        *self = Self::from_bits_retain(
16822            (self.bits() & !(Self::BUS_SLOTS_MASK << offset)) | ((value as u32) << offset),
16823        );
16824    }
16825
16826    /// Returns the value of the `BUS_WIDTH` field.
16827    pub const fn bus_width(self) -> u8 {
16828        ((self.bits() >> Self::BUS_WIDTH_SHIFT) & 0b1111) as u8
16829    }
16830
16831    /// Sets the value of the `BUS_WIDTH` field.
16832    pub const fn set_bus_width(&mut self, value: u8) {
16833        let offset = Self::BUS_WIDTH_SHIFT;
16834        assert!(value & (Self::BUS_WIDTH_MASK as u8) == value);
16835        *self = Self::from_bits_retain(
16836            (self.bits() & !(Self::BUS_WIDTH_MASK << offset)) | ((value as u32) << offset),
16837        );
16838    }
16839
16840    /// Returns the value of the `THWIDTH` field.
16841    pub const fn thwidth(self) -> u8 {
16842        ((self.bits() >> Self::THWIDTH_SHIFT) & 0b1111) as u8
16843    }
16844
16845    /// Sets the value of the `THWIDTH` field.
16846    pub const fn set_thwidth(&mut self, value: u8) {
16847        let offset = Self::THWIDTH_SHIFT;
16848        assert!(value & (Self::THWIDTH_MASK as u8) == value);
16849        *self = Self::from_bits_retain(
16850            (self.bits() & !(Self::THWIDTH_MASK << offset)) | ((value as u32) << offset),
16851        );
16852    }
16853
16854    /// Returns the value of the `EDGE` field.
16855    pub const fn edge(self) -> u8 {
16856        ((self.bits() >> Self::EDGE_SHIFT) & 0b1111) as u8
16857    }
16858
16859    /// Sets the value of the `EDGE` field.
16860    pub const fn set_edge(&mut self, value: u8) {
16861        let offset = Self::EDGE_SHIFT;
16862        assert!(value & (Self::EDGE_MASK as u8) == value);
16863        *self = Self::from_bits_retain(
16864            (self.bits() & !(Self::EDGE_MASK << offset)) | ((value as u32) << offset),
16865        );
16866    }
16867}
16868
16869bitflags! {
16870    /// `PMOVSR` system register value.
16871    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16872    #[repr(transparent)]
16873    pub struct Pmovsr: u32 {
16874        /// `P<m>` bit 0.
16875        const P0 = 1 << 0;
16876        /// `P<m>` bit 1.
16877        const P1 = 1 << 1;
16878        /// `P<m>` bit 2.
16879        const P2 = 1 << 2;
16880        /// `P<m>` bit 3.
16881        const P3 = 1 << 3;
16882        /// `P<m>` bit 4.
16883        const P4 = 1 << 4;
16884        /// `P<m>` bit 5.
16885        const P5 = 1 << 5;
16886        /// `P<m>` bit 6.
16887        const P6 = 1 << 6;
16888        /// `P<m>` bit 7.
16889        const P7 = 1 << 7;
16890        /// `P<m>` bit 8.
16891        const P8 = 1 << 8;
16892        /// `P<m>` bit 9.
16893        const P9 = 1 << 9;
16894        /// `P<m>` bit 10.
16895        const P10 = 1 << 10;
16896        /// `P<m>` bit 11.
16897        const P11 = 1 << 11;
16898        /// `P<m>` bit 12.
16899        const P12 = 1 << 12;
16900        /// `P<m>` bit 13.
16901        const P13 = 1 << 13;
16902        /// `P<m>` bit 14.
16903        const P14 = 1 << 14;
16904        /// `P<m>` bit 15.
16905        const P15 = 1 << 15;
16906        /// `P<m>` bit 16.
16907        const P16 = 1 << 16;
16908        /// `P<m>` bit 17.
16909        const P17 = 1 << 17;
16910        /// `P<m>` bit 18.
16911        const P18 = 1 << 18;
16912        /// `P<m>` bit 19.
16913        const P19 = 1 << 19;
16914        /// `P<m>` bit 20.
16915        const P20 = 1 << 20;
16916        /// `P<m>` bit 21.
16917        const P21 = 1 << 21;
16918        /// `P<m>` bit 22.
16919        const P22 = 1 << 22;
16920        /// `P<m>` bit 23.
16921        const P23 = 1 << 23;
16922        /// `P<m>` bit 24.
16923        const P24 = 1 << 24;
16924        /// `P<m>` bit 25.
16925        const P25 = 1 << 25;
16926        /// `P<m>` bit 26.
16927        const P26 = 1 << 26;
16928        /// `P<m>` bit 27.
16929        const P27 = 1 << 27;
16930        /// `P<m>` bit 28.
16931        const P28 = 1 << 28;
16932        /// `P<m>` bit 29.
16933        const P29 = 1 << 29;
16934        /// `P<m>` bit 30.
16935        const P30 = 1 << 30;
16936        /// `C` bit.
16937        const C = 1 << 31;
16938    }
16939}
16940
16941impl Pmovsr {
16942    /// Offset of the `P<m>` field.
16943    pub const P_SHIFT: u32 = 0;
16944    /// Offset of the `C` field.
16945    pub const C_SHIFT: u32 = 31;
16946}
16947
16948bitflags! {
16949    /// `PMOVSSET` system register value.
16950    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16951    #[repr(transparent)]
16952    pub struct Pmovsset: u32 {
16953        /// `P<m>` bit 0.
16954        const P0 = 1 << 0;
16955        /// `P<m>` bit 1.
16956        const P1 = 1 << 1;
16957        /// `P<m>` bit 2.
16958        const P2 = 1 << 2;
16959        /// `P<m>` bit 3.
16960        const P3 = 1 << 3;
16961        /// `P<m>` bit 4.
16962        const P4 = 1 << 4;
16963        /// `P<m>` bit 5.
16964        const P5 = 1 << 5;
16965        /// `P<m>` bit 6.
16966        const P6 = 1 << 6;
16967        /// `P<m>` bit 7.
16968        const P7 = 1 << 7;
16969        /// `P<m>` bit 8.
16970        const P8 = 1 << 8;
16971        /// `P<m>` bit 9.
16972        const P9 = 1 << 9;
16973        /// `P<m>` bit 10.
16974        const P10 = 1 << 10;
16975        /// `P<m>` bit 11.
16976        const P11 = 1 << 11;
16977        /// `P<m>` bit 12.
16978        const P12 = 1 << 12;
16979        /// `P<m>` bit 13.
16980        const P13 = 1 << 13;
16981        /// `P<m>` bit 14.
16982        const P14 = 1 << 14;
16983        /// `P<m>` bit 15.
16984        const P15 = 1 << 15;
16985        /// `P<m>` bit 16.
16986        const P16 = 1 << 16;
16987        /// `P<m>` bit 17.
16988        const P17 = 1 << 17;
16989        /// `P<m>` bit 18.
16990        const P18 = 1 << 18;
16991        /// `P<m>` bit 19.
16992        const P19 = 1 << 19;
16993        /// `P<m>` bit 20.
16994        const P20 = 1 << 20;
16995        /// `P<m>` bit 21.
16996        const P21 = 1 << 21;
16997        /// `P<m>` bit 22.
16998        const P22 = 1 << 22;
16999        /// `P<m>` bit 23.
17000        const P23 = 1 << 23;
17001        /// `P<m>` bit 24.
17002        const P24 = 1 << 24;
17003        /// `P<m>` bit 25.
17004        const P25 = 1 << 25;
17005        /// `P<m>` bit 26.
17006        const P26 = 1 << 26;
17007        /// `P<m>` bit 27.
17008        const P27 = 1 << 27;
17009        /// `P<m>` bit 28.
17010        const P28 = 1 << 28;
17011        /// `P<m>` bit 29.
17012        const P29 = 1 << 29;
17013        /// `P<m>` bit 30.
17014        const P30 = 1 << 30;
17015        /// `C` bit.
17016        const C = 1 << 31;
17017    }
17018}
17019
17020impl Pmovsset {
17021    /// Offset of the `P<m>` field.
17022    pub const P_SHIFT: u32 = 0;
17023    /// Offset of the `C` field.
17024    pub const C_SHIFT: u32 = 31;
17025}
17026
17027bitflags! {
17028    /// `PMSELR` system register value.
17029    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17030    #[repr(transparent)]
17031    pub struct Pmselr: u32 {
17032    }
17033}
17034
17035impl Pmselr {
17036    /// Offset of the `SEL` field.
17037    pub const SEL_SHIFT: u32 = 0;
17038    /// Mask for the `SEL` field.
17039    pub const SEL_MASK: u32 = 0b11111;
17040
17041    /// Returns the value of the `SEL` field.
17042    pub const fn sel(self) -> u8 {
17043        ((self.bits() >> Self::SEL_SHIFT) & 0b11111) as u8
17044    }
17045
17046    /// Sets the value of the `SEL` field.
17047    pub const fn set_sel(&mut self, value: u8) {
17048        let offset = Self::SEL_SHIFT;
17049        assert!(value & (Self::SEL_MASK as u8) == value);
17050        *self = Self::from_bits_retain(
17051            (self.bits() & !(Self::SEL_MASK << offset)) | ((value as u32) << offset),
17052        );
17053    }
17054}
17055
17056bitflags! {
17057    /// `PMSWINC` system register value.
17058    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17059    #[repr(transparent)]
17060    pub struct Pmswinc: u32 {
17061        /// `P<m>` bit 0.
17062        const P0 = 1 << 0;
17063        /// `P<m>` bit 1.
17064        const P1 = 1 << 1;
17065        /// `P<m>` bit 2.
17066        const P2 = 1 << 2;
17067        /// `P<m>` bit 3.
17068        const P3 = 1 << 3;
17069        /// `P<m>` bit 4.
17070        const P4 = 1 << 4;
17071        /// `P<m>` bit 5.
17072        const P5 = 1 << 5;
17073        /// `P<m>` bit 6.
17074        const P6 = 1 << 6;
17075        /// `P<m>` bit 7.
17076        const P7 = 1 << 7;
17077        /// `P<m>` bit 8.
17078        const P8 = 1 << 8;
17079        /// `P<m>` bit 9.
17080        const P9 = 1 << 9;
17081        /// `P<m>` bit 10.
17082        const P10 = 1 << 10;
17083        /// `P<m>` bit 11.
17084        const P11 = 1 << 11;
17085        /// `P<m>` bit 12.
17086        const P12 = 1 << 12;
17087        /// `P<m>` bit 13.
17088        const P13 = 1 << 13;
17089        /// `P<m>` bit 14.
17090        const P14 = 1 << 14;
17091        /// `P<m>` bit 15.
17092        const P15 = 1 << 15;
17093        /// `P<m>` bit 16.
17094        const P16 = 1 << 16;
17095        /// `P<m>` bit 17.
17096        const P17 = 1 << 17;
17097        /// `P<m>` bit 18.
17098        const P18 = 1 << 18;
17099        /// `P<m>` bit 19.
17100        const P19 = 1 << 19;
17101        /// `P<m>` bit 20.
17102        const P20 = 1 << 20;
17103        /// `P<m>` bit 21.
17104        const P21 = 1 << 21;
17105        /// `P<m>` bit 22.
17106        const P22 = 1 << 22;
17107        /// `P<m>` bit 23.
17108        const P23 = 1 << 23;
17109        /// `P<m>` bit 24.
17110        const P24 = 1 << 24;
17111        /// `P<m>` bit 25.
17112        const P25 = 1 << 25;
17113        /// `P<m>` bit 26.
17114        const P26 = 1 << 26;
17115        /// `P<m>` bit 27.
17116        const P27 = 1 << 27;
17117        /// `P<m>` bit 28.
17118        const P28 = 1 << 28;
17119        /// `P<m>` bit 29.
17120        const P29 = 1 << 29;
17121        /// `P<m>` bit 30.
17122        const P30 = 1 << 30;
17123    }
17124}
17125
17126impl Pmswinc {
17127    /// Offset of the `P<m>` field.
17128    pub const P_SHIFT: u32 = 0;
17129}
17130
17131bitflags! {
17132    /// `PMUSERENR` system register value.
17133    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17134    #[repr(transparent)]
17135    pub struct Pmuserenr: u32 {
17136        /// `EN` bit.
17137        const EN = 1 << 0;
17138        /// `SW` bit.
17139        const SW = 1 << 1;
17140        /// `CR` bit.
17141        const CR = 1 << 2;
17142        /// `ER` bit.
17143        const ER = 1 << 3;
17144        /// `TID` bit.
17145        const TID = 1 << 6;
17146    }
17147}
17148
17149impl Pmuserenr {
17150    /// Offset of the `EN` field.
17151    pub const EN_SHIFT: u32 = 0;
17152    /// Offset of the `SW` field.
17153    pub const SW_SHIFT: u32 = 1;
17154    /// Offset of the `CR` field.
17155    pub const CR_SHIFT: u32 = 2;
17156    /// Offset of the `ER` field.
17157    pub const ER_SHIFT: u32 = 3;
17158    /// Offset of the `TID` field.
17159    pub const TID_SHIFT: u32 = 6;
17160}
17161
17162bitflags! {
17163    /// `PMXEVTYPER` system register value.
17164    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17165    #[repr(transparent)]
17166    pub struct Pmxevtyper: u32 {
17167    }
17168}
17169
17170impl Pmxevtyper {
17171    /// Offset of the `ETR` field.
17172    pub const ETR_SHIFT: u32 = 0;
17173    /// Mask for the `ETR` field.
17174    pub const ETR_MASK: u32 = 0b11111111111111111111111111111111;
17175
17176    /// Returns the value of the `ETR` field.
17177    pub const fn etr(self) -> u32 {
17178        ((self.bits() >> Self::ETR_SHIFT) & 0b11111111111111111111111111111111) as u32
17179    }
17180
17181    /// Sets the value of the `ETR` field.
17182    pub const fn set_etr(&mut self, value: u32) {
17183        let offset = Self::ETR_SHIFT;
17184        assert!(value & (Self::ETR_MASK as u32) == value);
17185        *self = Self::from_bits_retain(
17186            (self.bits() & !(Self::ETR_MASK << offset)) | ((value as u32) << offset),
17187        );
17188    }
17189}
17190
17191bitflags! {
17192    /// `PRRR` system register value.
17193    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17194    #[repr(transparent)]
17195    pub struct Prrr: u32 {
17196        /// `DS0` bit.
17197        const DS0 = 1 << 16;
17198        /// `DS1` bit.
17199        const DS1 = 1 << 17;
17200        /// `NS0` bit.
17201        const NS0 = 1 << 18;
17202        /// `NS1` bit.
17203        const NS1 = 1 << 19;
17204        /// `NOS<n>` bit 0.
17205        const NOS0 = 1 << 24;
17206        /// `NOS<n>` bit 1.
17207        const NOS1 = 1 << 25;
17208        /// `NOS<n>` bit 2.
17209        const NOS2 = 1 << 26;
17210        /// `NOS<n>` bit 3.
17211        const NOS3 = 1 << 27;
17212        /// `NOS<n>` bit 4.
17213        const NOS4 = 1 << 28;
17214        /// `NOS<n>` bit 5.
17215        const NOS5 = 1 << 29;
17216        /// `NOS<n>` bit 6.
17217        const NOS6 = 1 << 30;
17218        /// `NOS<n>` bit 7.
17219        const NOS7 = 1 << 31;
17220    }
17221}
17222
17223impl Prrr {
17224    /// Offset of the `TR<n>` field.
17225    pub const TR_SHIFT: u32 = 0;
17226    /// Mask for the `TR<n>` field.
17227    pub const TR_MASK: u32 = 0b11;
17228    /// Offset of the `DS0` field.
17229    pub const DS0_SHIFT: u32 = 16;
17230    /// Offset of the `DS1` field.
17231    pub const DS1_SHIFT: u32 = 17;
17232    /// Offset of the `NS0` field.
17233    pub const NS0_SHIFT: u32 = 18;
17234    /// Offset of the `NS1` field.
17235    pub const NS1_SHIFT: u32 = 19;
17236    /// Offset of the `NOS<n>` field.
17237    pub const NOS_SHIFT: u32 = 24;
17238
17239    /// Returns the value of the given `TR<n>` field.
17240    pub const fn tr(self, n: u32) -> u8 {
17241        assert!(n < 8);
17242        ((self.bits() >> (Self::TR_SHIFT + (n - 0) * 2)) & 0b11) as u8
17243    }
17244
17245    /// Sets the value of the `TR<n>` field.
17246    pub const fn set_tr(&mut self, n: u32, value: u8) {
17247        assert!(n < 8);
17248        let offset = Self::TR_SHIFT + (n - 0) * 2;
17249        assert!(value & (Self::TR_MASK as u8) == value);
17250        *self = Self::from_bits_retain(
17251            (self.bits() & !(Self::TR_MASK << offset)) | ((value as u32) << offset),
17252        );
17253    }
17254}
17255
17256#[cfg(feature = "el1")]
17257bitflags! {
17258    /// `RGSR_EL1` system register value.
17259    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17260    #[repr(transparent)]
17261    pub struct RgsrEl1: u64 {
17262    }
17263}
17264
17265#[cfg(feature = "el1")]
17266impl RgsrEl1 {
17267    /// Offset of the `TAG` field.
17268    pub const TAG_SHIFT: u32 = 0;
17269    /// Mask for the `TAG` field.
17270    pub const TAG_MASK: u64 = 0b1111;
17271    /// Offset of the `SEED` field.
17272    pub const SEED_SHIFT: u32 = 8;
17273    /// Mask for the `SEED` field.
17274    pub const SEED_MASK: u64 = 0b1111111111111111;
17275
17276    /// Returns the value of the `TAG` field.
17277    pub const fn tag(self) -> u8 {
17278        ((self.bits() >> Self::TAG_SHIFT) & 0b1111) as u8
17279    }
17280
17281    /// Sets the value of the `TAG` field.
17282    pub const fn set_tag(&mut self, value: u8) {
17283        let offset = Self::TAG_SHIFT;
17284        assert!(value & (Self::TAG_MASK as u8) == value);
17285        *self = Self::from_bits_retain(
17286            (self.bits() & !(Self::TAG_MASK << offset)) | ((value as u64) << offset),
17287        );
17288    }
17289
17290    /// Returns the value of the `SEED` field.
17291    pub const fn seed(self) -> u16 {
17292        ((self.bits() >> Self::SEED_SHIFT) & 0b1111111111111111) as u16
17293    }
17294
17295    /// Sets the value of the `SEED` field.
17296    pub const fn set_seed(&mut self, value: u16) {
17297        let offset = Self::SEED_SHIFT;
17298        assert!(value & (Self::SEED_MASK as u16) == value);
17299        *self = Self::from_bits_retain(
17300            (self.bits() & !(Self::SEED_MASK << offset)) | ((value as u64) << offset),
17301        );
17302    }
17303}
17304
17305bitflags! {
17306    /// `RMR` system register value.
17307    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17308    #[repr(transparent)]
17309    pub struct Rmr: u32 {
17310        /// `AA64` bit.
17311        const AA64 = 1 << 0;
17312        /// `RR` bit.
17313        const RR = 1 << 1;
17314    }
17315}
17316
17317impl Rmr {
17318    /// Offset of the `AA64` field.
17319    pub const AA64_SHIFT: u32 = 0;
17320    /// Offset of the `RR` field.
17321    pub const RR_SHIFT: u32 = 1;
17322}
17323
17324bitflags! {
17325    /// `RVBAR` system register value.
17326    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17327    #[repr(transparent)]
17328    pub struct Rvbar: u32 {
17329        /// RES1 bits in the `RVBAR` register.
17330        const RES1 = 0b1;
17331    }
17332}
17333
17334impl Rvbar {
17335    /// Offset of the `ResetAddress` field.
17336    pub const RESETADDRESS_SHIFT: u32 = 1;
17337    /// Mask for the `ResetAddress` field.
17338    pub const RESETADDRESS_MASK: u32 = 0b1111111111111111111111111111111;
17339
17340    /// Returns the value of the `ResetAddress` field.
17341    pub const fn resetaddress(self) -> u32 {
17342        ((self.bits() >> Self::RESETADDRESS_SHIFT) & 0b1111111111111111111111111111111) as u32
17343    }
17344
17345    /// Sets the value of the `ResetAddress` field.
17346    pub const fn set_resetaddress(&mut self, value: u32) {
17347        let offset = Self::RESETADDRESS_SHIFT;
17348        assert!(value & (Self::RESETADDRESS_MASK as u32) == value);
17349        *self = Self::from_bits_retain(
17350            (self.bits() & !(Self::RESETADDRESS_MASK << offset)) | ((value as u32) << offset),
17351        );
17352    }
17353}
17354
17355bitflags! {
17356    /// `SCR` system register value.
17357    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17358    #[repr(transparent)]
17359    pub struct Scr: u32 {
17360        /// `NS` bit.
17361        const NS = 1 << 0;
17362        /// `IRQ` bit.
17363        const IRQ = 1 << 1;
17364        /// `FIQ` bit.
17365        const FIQ = 1 << 2;
17366        /// `EA` bit.
17367        const EA = 1 << 3;
17368        /// `FW` bit.
17369        const FW = 1 << 4;
17370        /// `AW` bit.
17371        const AW = 1 << 5;
17372        /// `nET` bit.
17373        const NET = 1 << 6;
17374        /// `SCD` bit.
17375        const SCD = 1 << 7;
17376        /// `HCE` bit.
17377        const HCE = 1 << 8;
17378        /// `SIF` bit.
17379        const SIF = 1 << 9;
17380        /// `TWI` bit.
17381        const TWI = 1 << 12;
17382        /// `TWE` bit.
17383        const TWE = 1 << 13;
17384        /// `TERR` bit.
17385        const TERR = 1 << 15;
17386    }
17387}
17388
17389impl Scr {
17390    /// Offset of the `NS` field.
17391    pub const NS_SHIFT: u32 = 0;
17392    /// Offset of the `IRQ` field.
17393    pub const IRQ_SHIFT: u32 = 1;
17394    /// Offset of the `FIQ` field.
17395    pub const FIQ_SHIFT: u32 = 2;
17396    /// Offset of the `EA` field.
17397    pub const EA_SHIFT: u32 = 3;
17398    /// Offset of the `FW` field.
17399    pub const FW_SHIFT: u32 = 4;
17400    /// Offset of the `AW` field.
17401    pub const AW_SHIFT: u32 = 5;
17402    /// Offset of the `nET` field.
17403    pub const NET_SHIFT: u32 = 6;
17404    /// Offset of the `SCD` field.
17405    pub const SCD_SHIFT: u32 = 7;
17406    /// Offset of the `HCE` field.
17407    pub const HCE_SHIFT: u32 = 8;
17408    /// Offset of the `SIF` field.
17409    pub const SIF_SHIFT: u32 = 9;
17410    /// Offset of the `TWI` field.
17411    pub const TWI_SHIFT: u32 = 12;
17412    /// Offset of the `TWE` field.
17413    pub const TWE_SHIFT: u32 = 13;
17414    /// Offset of the `TERR` field.
17415    pub const TERR_SHIFT: u32 = 15;
17416}
17417
17418#[cfg(feature = "el3")]
17419bitflags! {
17420    /// `SCR_EL3` system register value.
17421    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17422    #[repr(transparent)]
17423    pub struct ScrEl3: u64 {
17424        /// RES1 bits in the `SCR_EL3` register.
17425        const RES1 = 0b110000;
17426        /// Non-secure.
17427        const NS = 1 << 0;
17428        /// Take physical IRQs at EL3.
17429        const IRQ = 1 << 1;
17430        /// Take physical FIQs at EL3.
17431        const FIQ = 1 << 2;
17432        /// Take external abort and SError exceptions at EL3.
17433        const EA = 1 << 3;
17434        /// Disable SMC instructions.
17435        const SMD = 1 << 7;
17436        /// Enable HVC instructions.
17437        const HCE = 1 << 8;
17438        /// Disable execution from non-secure memory.
17439        const SIF = 1 << 9;
17440        /// Enable AArch64 in lower ELs.
17441        const RW = 1 << 10;
17442        /// Trap physical secure timer to EL3.
17443        const ST = 1 << 11;
17444        /// Trap WFI to EL3.
17445        const TWI = 1 << 12;
17446        /// Trap WFE to EL3.
17447        const TWE = 1 << 13;
17448        /// Trap LOR register access to EL3.
17449        const TLOR = 1 << 14;
17450        /// Trap error record register access to EL3.
17451        const TERR = 1 << 15;
17452        /// Don't trap PAC key registers to EL3.
17453        const APK = 1 << 16;
17454        /// Don't trap PAuth instructions to EL3.
17455        const API = 1 << 17;
17456        /// Enable Secure EL2.
17457        const EEL2 = 1 << 18;
17458        /// Synchronous external aborts are taken as SErrors.
17459        const EASE = 1 << 19;
17460        /// Take SError exceptions at EL3.
17461        const NMEA = 1 << 20;
17462        /// Enable fault injection at lower ELs.
17463        const FIEN = 1 << 21;
17464        /// Trap ID group 3 registers to EL3.
17465        const TID3 = 1 << 22;
17466        /// Trap ID group 5 register to EL3.
17467        const TID5 = 1 << 23;
17468        /// `POE2En` bit.
17469        const POE2EN = 1 << 24;
17470        /// Enable SCXT at lower ELs.
17471        const ENSCXT = 1 << 25;
17472        /// Enable memory tagging at lower ELs.
17473        const ATA = 1 << 26;
17474        /// Enable fine-grained traps to EL2.
17475        const FGTEN = 1 << 27;
17476        /// Enable access to CNTPOFF_EL2.
17477        const ECVEN = 1 << 28;
17478        /// Enable a configurable delay for WFE traps.
17479        const TWEDEN = 1 << 29;
17480        /// Enable activity monitors virtual offsets.
17481        const AMVOFFEN = 1 << 35;
17482        /// Enable ST64BV0 at lower ELs.
17483        const ENAS0 = 1 << 36;
17484        /// Enable ACCDATA_EL1 at lower ELs.
17485        const ADEN = 1 << 37;
17486        /// Enable HCRX_EL2.
17487        const HXEN = 1 << 38;
17488        /// Enable guarded control stack.
17489        const GCSEN = 1 << 39;
17490        /// Trap RNDR and RNDRRS to EL3.
17491        const TRNDR = 1 << 40;
17492        /// Enable TPIDR2_EL0 at lower ELs.
17493        const ENTP2 = 1 << 41;
17494        /// Enable RCW and RCWS mask registers at lower ELs.
17495        const RCWMASKEN = 1 << 42;
17496        /// Enable TCR2_ELx registers at lower ELs.
17497        const TCR2EN = 1 << 43;
17498        /// Enable SCTLR2_ELx registers at lower ELs.
17499        const SCTLR2EN = 1 << 44;
17500        /// Enable permission indirection and overlay registers at lower ELs.
17501        const PIEN = 1 << 45;
17502        /// Enable MAIR2_ELx and AMAIR2_ELx at lower ELs.
17503        const AIEN = 1 << 46;
17504        /// Enable 128-bit system registers at  lower ELs.
17505        const D128EN = 1 << 47;
17506        /// Route GPFs to EL3.
17507        const GPF = 1 << 48;
17508        /// Enable MECID registers at EL2.
17509        const MECEN = 1 << 49;
17510        /// Enable access to FPMR at lower ELs.
17511        const ENFPM = 1 << 50;
17512        /// Take synchronous external abort and physical SError exception to EL3.
17513        const TMEA = 1 << 51;
17514        /// Trap writes to Error Record registers to EL3.
17515        const TWERR = 1 << 52;
17516        /// Enable access to physical fault address registers at lower ELs.
17517        const PFAREN = 1 << 53;
17518        /// Enable access to mask registers at lower ELs.
17519        const SRMASKEN = 1 << 54;
17520        /// Enable implementation-defined 128-bit system registers.
17521        const ENIDCP128 = 1 << 55;
17522        /// `VTLBIDEn` bit.
17523        const VTLBIDEN = 1 << 56;
17524        /// A delegated SError exception is pending.
17525        const DSE = 1 << 57;
17526        /// Enable delegated SError exceptions.
17527        const ENDSE = 1 << 58;
17528        /// Enable fine-grained traps to EL2.
17529        const FGTEN2 = 1 << 59;
17530        /// Enable HDBSSBR_EL2 and HDBSSPROD_EL2 registers at EL2.
17531        const HDBSSEN = 1 << 60;
17532        /// Enable HACDBSBR_EL2 and HACDBSCONS_EL2 registers at EL2.
17533        const HACDBSEN = 1 << 61;
17534        /// Non-secure realm world bit.
17535        const NSE = 1 << 62;
17536        /// `TPLIMEn` bit.
17537        const TPLIMEN = 1 << 63;
17538    }
17539}
17540
17541#[cfg(feature = "el3")]
17542impl ScrEl3 {
17543    /// Offset of the `NS` field.
17544    pub const NS_SHIFT: u32 = 0;
17545    /// Offset of the `IRQ` field.
17546    pub const IRQ_SHIFT: u32 = 1;
17547    /// Offset of the `FIQ` field.
17548    pub const FIQ_SHIFT: u32 = 2;
17549    /// Offset of the `EA` field.
17550    pub const EA_SHIFT: u32 = 3;
17551    /// Offset of the `SMD` field.
17552    pub const SMD_SHIFT: u32 = 7;
17553    /// Offset of the `HCE` field.
17554    pub const HCE_SHIFT: u32 = 8;
17555    /// Offset of the `SIF` field.
17556    pub const SIF_SHIFT: u32 = 9;
17557    /// Offset of the `RW` field.
17558    pub const RW_SHIFT: u32 = 10;
17559    /// Offset of the `ST` field.
17560    pub const ST_SHIFT: u32 = 11;
17561    /// Offset of the `TWI` field.
17562    pub const TWI_SHIFT: u32 = 12;
17563    /// Offset of the `TWE` field.
17564    pub const TWE_SHIFT: u32 = 13;
17565    /// Offset of the `TLOR` field.
17566    pub const TLOR_SHIFT: u32 = 14;
17567    /// Offset of the `TERR` field.
17568    pub const TERR_SHIFT: u32 = 15;
17569    /// Offset of the `APK` field.
17570    pub const APK_SHIFT: u32 = 16;
17571    /// Offset of the `API` field.
17572    pub const API_SHIFT: u32 = 17;
17573    /// Offset of the `EEL2` field.
17574    pub const EEL2_SHIFT: u32 = 18;
17575    /// Offset of the `EASE` field.
17576    pub const EASE_SHIFT: u32 = 19;
17577    /// Offset of the `NMEA` field.
17578    pub const NMEA_SHIFT: u32 = 20;
17579    /// Offset of the `FIEN` field.
17580    pub const FIEN_SHIFT: u32 = 21;
17581    /// Offset of the `TID3` field.
17582    pub const TID3_SHIFT: u32 = 22;
17583    /// Offset of the `TID5` field.
17584    pub const TID5_SHIFT: u32 = 23;
17585    /// Offset of the `POE2En` field.
17586    pub const POE2EN_SHIFT: u32 = 24;
17587    /// Offset of the `EnSCXT` field.
17588    pub const ENSCXT_SHIFT: u32 = 25;
17589    /// Offset of the `ATA` field.
17590    pub const ATA_SHIFT: u32 = 26;
17591    /// Offset of the `FGTEn` field.
17592    pub const FGTEN_SHIFT: u32 = 27;
17593    /// Offset of the `ECVEn` field.
17594    pub const ECVEN_SHIFT: u32 = 28;
17595    /// Offset of the `TWEDEn` field.
17596    pub const TWEDEN_SHIFT: u32 = 29;
17597    /// Offset of the `TWEDEL` field.
17598    pub const TWEDEL_SHIFT: u32 = 30;
17599    /// Mask for the `TWEDEL` field.
17600    pub const TWEDEL_MASK: u64 = 0b1111;
17601    /// Offset of the `AMVOFFEN` field.
17602    pub const AMVOFFEN_SHIFT: u32 = 35;
17603    /// Offset of the `EnAS0` field.
17604    pub const ENAS0_SHIFT: u32 = 36;
17605    /// Offset of the `ADEn` field.
17606    pub const ADEN_SHIFT: u32 = 37;
17607    /// Offset of the `HXEn` field.
17608    pub const HXEN_SHIFT: u32 = 38;
17609    /// Offset of the `GCSEn` field.
17610    pub const GCSEN_SHIFT: u32 = 39;
17611    /// Offset of the `TRNDR` field.
17612    pub const TRNDR_SHIFT: u32 = 40;
17613    /// Offset of the `EnTP2` field.
17614    pub const ENTP2_SHIFT: u32 = 41;
17615    /// Offset of the `RCWMASKEn` field.
17616    pub const RCWMASKEN_SHIFT: u32 = 42;
17617    /// Offset of the `TCR2En` field.
17618    pub const TCR2EN_SHIFT: u32 = 43;
17619    /// Offset of the `SCTLR2En` field.
17620    pub const SCTLR2EN_SHIFT: u32 = 44;
17621    /// Offset of the `PIEn` field.
17622    pub const PIEN_SHIFT: u32 = 45;
17623    /// Offset of the `AIEn` field.
17624    pub const AIEN_SHIFT: u32 = 46;
17625    /// Offset of the `D128En` field.
17626    pub const D128EN_SHIFT: u32 = 47;
17627    /// Offset of the `GPF` field.
17628    pub const GPF_SHIFT: u32 = 48;
17629    /// Offset of the `MECEn` field.
17630    pub const MECEN_SHIFT: u32 = 49;
17631    /// Offset of the `EnFPM` field.
17632    pub const ENFPM_SHIFT: u32 = 50;
17633    /// Offset of the `TMEA` field.
17634    pub const TMEA_SHIFT: u32 = 51;
17635    /// Offset of the `TWERR` field.
17636    pub const TWERR_SHIFT: u32 = 52;
17637    /// Offset of the `PFAREn` field.
17638    pub const PFAREN_SHIFT: u32 = 53;
17639    /// Offset of the `SRMASKEn` field.
17640    pub const SRMASKEN_SHIFT: u32 = 54;
17641    /// Offset of the `EnIDCP128` field.
17642    pub const ENIDCP128_SHIFT: u32 = 55;
17643    /// Offset of the `VTLBIDEn` field.
17644    pub const VTLBIDEN_SHIFT: u32 = 56;
17645    /// Offset of the `DSE` field.
17646    pub const DSE_SHIFT: u32 = 57;
17647    /// Offset of the `EnDSE` field.
17648    pub const ENDSE_SHIFT: u32 = 58;
17649    /// Offset of the `FGTEn2` field.
17650    pub const FGTEN2_SHIFT: u32 = 59;
17651    /// Offset of the `HDBSSEn` field.
17652    pub const HDBSSEN_SHIFT: u32 = 60;
17653    /// Offset of the `HACDBSEn` field.
17654    pub const HACDBSEN_SHIFT: u32 = 61;
17655    /// Offset of the `NSE` field.
17656    pub const NSE_SHIFT: u32 = 62;
17657    /// Offset of the `TPLIMEn` field.
17658    pub const TPLIMEN_SHIFT: u32 = 63;
17659
17660    /// Returns the value of the `TWEDEL` field.
17661    pub const fn twedel(self) -> u8 {
17662        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
17663    }
17664
17665    /// Sets the value of the `TWEDEL` field.
17666    pub const fn set_twedel(&mut self, value: u8) {
17667        let offset = Self::TWEDEL_SHIFT;
17668        assert!(value & (Self::TWEDEL_MASK as u8) == value);
17669        *self = Self::from_bits_retain(
17670            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
17671        );
17672    }
17673}
17674
17675bitflags! {
17676    /// `SCTLR` system register value.
17677    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17678    #[repr(transparent)]
17679    pub struct Sctlr: u32 {
17680        /// RES1 bits in the `SCTLR` register.
17681        const RES1 = 0b10000000000100000000000;
17682        /// `M` bit.
17683        const M = 1 << 0;
17684        /// `A` bit.
17685        const A = 1 << 1;
17686        /// `C` bit.
17687        const C = 1 << 2;
17688        /// `nTLSMD` bit.
17689        const NTLSMD = 1 << 3;
17690        /// `LSMAOE` bit.
17691        const LSMAOE = 1 << 4;
17692        /// `CP15BEN` bit.
17693        const CP15BEN = 1 << 5;
17694        /// `UNK` bit.
17695        const UNK = 1 << 6;
17696        /// `ITD` bit.
17697        const ITD = 1 << 7;
17698        /// `SED` bit.
17699        const SED = 1 << 8;
17700        /// `EnRCTX` bit.
17701        const ENRCTX = 1 << 10;
17702        /// `I` bit.
17703        const I = 1 << 12;
17704        /// `V` bit.
17705        const V = 1 << 13;
17706        /// `nTWI` bit.
17707        const NTWI = 1 << 16;
17708        /// `nTWE` bit.
17709        const NTWE = 1 << 18;
17710        /// `WXN` bit.
17711        const WXN = 1 << 19;
17712        /// `UWXN` bit.
17713        const UWXN = 1 << 20;
17714        /// `SPAN` bit.
17715        const SPAN = 1 << 23;
17716        /// `EE` bit.
17717        const EE = 1 << 25;
17718        /// `TRE` bit.
17719        const TRE = 1 << 28;
17720        /// `AFE` bit.
17721        const AFE = 1 << 29;
17722        /// `TE` bit.
17723        const TE = 1 << 30;
17724        /// `DSSBS` bit.
17725        const DSSBS = 1 << 31;
17726    }
17727}
17728
17729impl Sctlr {
17730    /// Offset of the `M` field.
17731    pub const M_SHIFT: u32 = 0;
17732    /// Offset of the `A` field.
17733    pub const A_SHIFT: u32 = 1;
17734    /// Offset of the `C` field.
17735    pub const C_SHIFT: u32 = 2;
17736    /// Offset of the `nTLSMD` field.
17737    pub const NTLSMD_SHIFT: u32 = 3;
17738    /// Offset of the `LSMAOE` field.
17739    pub const LSMAOE_SHIFT: u32 = 4;
17740    /// Offset of the `CP15BEN` field.
17741    pub const CP15BEN_SHIFT: u32 = 5;
17742    /// Offset of the `UNK` field.
17743    pub const UNK_SHIFT: u32 = 6;
17744    /// Offset of the `ITD` field.
17745    pub const ITD_SHIFT: u32 = 7;
17746    /// Offset of the `SED` field.
17747    pub const SED_SHIFT: u32 = 8;
17748    /// Offset of the `EnRCTX` field.
17749    pub const ENRCTX_SHIFT: u32 = 10;
17750    /// Offset of the `I` field.
17751    pub const I_SHIFT: u32 = 12;
17752    /// Offset of the `V` field.
17753    pub const V_SHIFT: u32 = 13;
17754    /// Offset of the `nTWI` field.
17755    pub const NTWI_SHIFT: u32 = 16;
17756    /// Offset of the `nTWE` field.
17757    pub const NTWE_SHIFT: u32 = 18;
17758    /// Offset of the `WXN` field.
17759    pub const WXN_SHIFT: u32 = 19;
17760    /// Offset of the `UWXN` field.
17761    pub const UWXN_SHIFT: u32 = 20;
17762    /// Offset of the `SPAN` field.
17763    pub const SPAN_SHIFT: u32 = 23;
17764    /// Offset of the `EE` field.
17765    pub const EE_SHIFT: u32 = 25;
17766    /// Offset of the `TRE` field.
17767    pub const TRE_SHIFT: u32 = 28;
17768    /// Offset of the `AFE` field.
17769    pub const AFE_SHIFT: u32 = 29;
17770    /// Offset of the `TE` field.
17771    pub const TE_SHIFT: u32 = 30;
17772    /// Offset of the `DSSBS` field.
17773    pub const DSSBS_SHIFT: u32 = 31;
17774}
17775
17776#[cfg(feature = "el3")]
17777bitflags! {
17778    /// `SCTLR2_EL3` system register value.
17779    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17780    #[repr(transparent)]
17781    pub struct Sctlr2El3: u64 {
17782        /// `EMEC` bit.
17783        const EMEC = 1 << 1;
17784        /// `EnADERR` bit.
17785        const ENADERR = 1 << 3;
17786        /// `EnANERR` bit.
17787        const ENANERR = 1 << 4;
17788        /// `EnPACM` bit.
17789        const ENPACM = 1 << 7;
17790        /// `CPTA` bit.
17791        const CPTA = 1 << 9;
17792        /// `CPTM` bit.
17793        const CPTM = 1 << 11;
17794        /// `DTZ` bit.
17795        const DTZ = 1 << 14;
17796        /// `TEIS` bit.
17797        const TEIS = 1 << 15;
17798        /// `TEOS` bit.
17799        const TEOS = 1 << 16;
17800        /// `VT` bit.
17801        const VT = 1 << 17;
17802        /// `BTD` bit.
17803        const BTD = 1 << 24;
17804    }
17805}
17806
17807#[cfg(feature = "el3")]
17808impl Sctlr2El3 {
17809    /// Offset of the `EMEC` field.
17810    pub const EMEC_SHIFT: u32 = 1;
17811    /// Offset of the `EnADERR` field.
17812    pub const ENADERR_SHIFT: u32 = 3;
17813    /// Offset of the `EnANERR` field.
17814    pub const ENANERR_SHIFT: u32 = 4;
17815    /// Offset of the `EnPACM` field.
17816    pub const ENPACM_SHIFT: u32 = 7;
17817    /// Offset of the `CPTA` field.
17818    pub const CPTA_SHIFT: u32 = 9;
17819    /// Offset of the `CPTM` field.
17820    pub const CPTM_SHIFT: u32 = 11;
17821    /// Offset of the `DTZ` field.
17822    pub const DTZ_SHIFT: u32 = 14;
17823    /// Offset of the `TEIS` field.
17824    pub const TEIS_SHIFT: u32 = 15;
17825    /// Offset of the `TEOS` field.
17826    pub const TEOS_SHIFT: u32 = 16;
17827    /// Offset of the `VT` field.
17828    pub const VT_SHIFT: u32 = 17;
17829    /// Offset of the `BTD` field.
17830    pub const BTD_SHIFT: u32 = 24;
17831}
17832
17833#[cfg(feature = "el1")]
17834bitflags! {
17835    /// `SCTLR_EL1` system register value.
17836    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17837    #[repr(transparent)]
17838    pub struct SctlrEl1: u64 {
17839        /// `M` bit.
17840        const M = 1 << 0;
17841        /// `A` bit.
17842        const A = 1 << 1;
17843        /// `C` bit.
17844        const C = 1 << 2;
17845        /// `SA` bit.
17846        const SA = 1 << 3;
17847        /// `SA0` bit.
17848        const SA0 = 1 << 4;
17849        /// `CP15BEN` bit.
17850        const CP15BEN = 1 << 5;
17851        /// `nAA` bit.
17852        const NAA = 1 << 6;
17853        /// `ITD` bit.
17854        const ITD = 1 << 7;
17855        /// `SED` bit.
17856        const SED = 1 << 8;
17857        /// `UMA` bit.
17858        const UMA = 1 << 9;
17859        /// `EnRCTX` bit.
17860        const ENRCTX = 1 << 10;
17861        /// `EOS` bit.
17862        const EOS = 1 << 11;
17863        /// `I` bit.
17864        const I = 1 << 12;
17865        /// `EnDB` bit.
17866        const ENDB = 1 << 13;
17867        /// `DZE` bit.
17868        const DZE = 1 << 14;
17869        /// `UCT` bit.
17870        const UCT = 1 << 15;
17871        /// `nTWI` bit.
17872        const NTWI = 1 << 16;
17873        /// `nTWE` bit.
17874        const NTWE = 1 << 18;
17875        /// `WXN` bit.
17876        const WXN = 1 << 19;
17877        /// `TSCXT` bit.
17878        const TSCXT = 1 << 20;
17879        /// `IESB` bit.
17880        const IESB = 1 << 21;
17881        /// `EIS` bit.
17882        const EIS = 1 << 22;
17883        /// Do not set Privileged Access Never, on taking an exception to EL1.
17884        const SPAN = 1 << 23;
17885        /// `UCI` bit.
17886        const UCI = 1 << 26;
17887        /// `EnDA` bit.
17888        const ENDA = 1 << 27;
17889        /// `nTLSMD` bit.
17890        const NTLSMD = 1 << 28;
17891        /// `LSMAOE` bit.
17892        const LSMAOE = 1 << 29;
17893        /// Enable pointer authentication using APIBKey_EL1.
17894        const ENIB = 1 << 30;
17895        /// Enable pointer authentication using APIAKey_EL1.
17896        const ENIA = 1 << 31;
17897        /// `CMOW` bit.
17898        const CMOW = 1 << 32;
17899        /// `MSCEn` bit.
17900        const MSCEN = 1 << 33;
17901        /// `EnFPM` bit.
17902        const ENFPM = 1 << 34;
17903        /// `BT0` bit.
17904        const BT0 = 1 << 35;
17905        /// `BT1` bit.
17906        const BT1 = 1 << 36;
17907        /// `ITFSB` bit.
17908        const ITFSB = 1 << 37;
17909        /// `ATA0` bit.
17910        const ATA0 = 1 << 42;
17911        /// `ATA` bit.
17912        const ATA = 1 << 43;
17913        /// Default PSTATE.SSBS value on Exception Entry.
17914        const DSSBS = 1 << 44;
17915        /// `TWEDEn` bit.
17916        const TWEDEN = 1 << 45;
17917        /// `EnASR` bit.
17918        const ENASR = 1 << 54;
17919        /// `EnAS0` bit.
17920        const ENAS0 = 1 << 55;
17921        /// `EnALS` bit.
17922        const ENALS = 1 << 56;
17923        /// `EPAN` bit.
17924        const EPAN = 1 << 57;
17925        /// `TCSO0` bit.
17926        const TCSO0 = 1 << 58;
17927        /// `TCSO` bit.
17928        const TCSO = 1 << 59;
17929        /// `EnTP2` bit.
17930        const ENTP2 = 1 << 60;
17931        /// `NMI` bit.
17932        const NMI = 1 << 61;
17933        /// SP Interrupt Mask enable.
17934        const SPINTMASK = 1 << 62;
17935        /// `TIDCP` bit.
17936        const TIDCP = 1 << 63;
17937    }
17938}
17939
17940#[cfg(feature = "el1")]
17941impl SctlrEl1 {
17942    /// Offset of the `M` field.
17943    pub const M_SHIFT: u32 = 0;
17944    /// Offset of the `A` field.
17945    pub const A_SHIFT: u32 = 1;
17946    /// Offset of the `C` field.
17947    pub const C_SHIFT: u32 = 2;
17948    /// Offset of the `SA` field.
17949    pub const SA_SHIFT: u32 = 3;
17950    /// Offset of the `SA0` field.
17951    pub const SA0_SHIFT: u32 = 4;
17952    /// Offset of the `CP15BEN` field.
17953    pub const CP15BEN_SHIFT: u32 = 5;
17954    /// Offset of the `nAA` field.
17955    pub const NAA_SHIFT: u32 = 6;
17956    /// Offset of the `ITD` field.
17957    pub const ITD_SHIFT: u32 = 7;
17958    /// Offset of the `SED` field.
17959    pub const SED_SHIFT: u32 = 8;
17960    /// Offset of the `UMA` field.
17961    pub const UMA_SHIFT: u32 = 9;
17962    /// Offset of the `EnRCTX` field.
17963    pub const ENRCTX_SHIFT: u32 = 10;
17964    /// Offset of the `EOS` field.
17965    pub const EOS_SHIFT: u32 = 11;
17966    /// Offset of the `I` field.
17967    pub const I_SHIFT: u32 = 12;
17968    /// Offset of the `EnDB` field.
17969    pub const ENDB_SHIFT: u32 = 13;
17970    /// Offset of the `DZE` field.
17971    pub const DZE_SHIFT: u32 = 14;
17972    /// Offset of the `UCT` field.
17973    pub const UCT_SHIFT: u32 = 15;
17974    /// Offset of the `nTWI` field.
17975    pub const NTWI_SHIFT: u32 = 16;
17976    /// Offset of the `nTWE` field.
17977    pub const NTWE_SHIFT: u32 = 18;
17978    /// Offset of the `WXN` field.
17979    pub const WXN_SHIFT: u32 = 19;
17980    /// Offset of the `TSCXT` field.
17981    pub const TSCXT_SHIFT: u32 = 20;
17982    /// Offset of the `IESB` field.
17983    pub const IESB_SHIFT: u32 = 21;
17984    /// Offset of the `EIS` field.
17985    pub const EIS_SHIFT: u32 = 22;
17986    /// Offset of the `SPAN` field.
17987    pub const SPAN_SHIFT: u32 = 23;
17988    /// Offset of the `UCI` field.
17989    pub const UCI_SHIFT: u32 = 26;
17990    /// Offset of the `EnDA` field.
17991    pub const ENDA_SHIFT: u32 = 27;
17992    /// Offset of the `nTLSMD` field.
17993    pub const NTLSMD_SHIFT: u32 = 28;
17994    /// Offset of the `LSMAOE` field.
17995    pub const LSMAOE_SHIFT: u32 = 29;
17996    /// Offset of the `EnIB` field.
17997    pub const ENIB_SHIFT: u32 = 30;
17998    /// Offset of the `EnIA` field.
17999    pub const ENIA_SHIFT: u32 = 31;
18000    /// Offset of the `CMOW` field.
18001    pub const CMOW_SHIFT: u32 = 32;
18002    /// Offset of the `MSCEn` field.
18003    pub const MSCEN_SHIFT: u32 = 33;
18004    /// Offset of the `EnFPM` field.
18005    pub const ENFPM_SHIFT: u32 = 34;
18006    /// Offset of the `BT0` field.
18007    pub const BT0_SHIFT: u32 = 35;
18008    /// Offset of the `BT1` field.
18009    pub const BT1_SHIFT: u32 = 36;
18010    /// Offset of the `ITFSB` field.
18011    pub const ITFSB_SHIFT: u32 = 37;
18012    /// Offset of the `TCF0` field.
18013    pub const TCF0_SHIFT: u32 = 38;
18014    /// Mask for the `TCF0` field.
18015    pub const TCF0_MASK: u64 = 0b11;
18016    /// Offset of the `TCF` field.
18017    pub const TCF_SHIFT: u32 = 40;
18018    /// Mask for the `TCF` field.
18019    pub const TCF_MASK: u64 = 0b11;
18020    /// Offset of the `ATA0` field.
18021    pub const ATA0_SHIFT: u32 = 42;
18022    /// Offset of the `ATA` field.
18023    pub const ATA_SHIFT: u32 = 43;
18024    /// Offset of the `DSSBS` field.
18025    pub const DSSBS_SHIFT: u32 = 44;
18026    /// Offset of the `TWEDEn` field.
18027    pub const TWEDEN_SHIFT: u32 = 45;
18028    /// Offset of the `TWEDEL` field.
18029    pub const TWEDEL_SHIFT: u32 = 46;
18030    /// Mask for the `TWEDEL` field.
18031    pub const TWEDEL_MASK: u64 = 0b1111;
18032    /// Offset of the `EnASR` field.
18033    pub const ENASR_SHIFT: u32 = 54;
18034    /// Offset of the `EnAS0` field.
18035    pub const ENAS0_SHIFT: u32 = 55;
18036    /// Offset of the `EnALS` field.
18037    pub const ENALS_SHIFT: u32 = 56;
18038    /// Offset of the `EPAN` field.
18039    pub const EPAN_SHIFT: u32 = 57;
18040    /// Offset of the `TCSO0` field.
18041    pub const TCSO0_SHIFT: u32 = 58;
18042    /// Offset of the `TCSO` field.
18043    pub const TCSO_SHIFT: u32 = 59;
18044    /// Offset of the `EnTP2` field.
18045    pub const ENTP2_SHIFT: u32 = 60;
18046    /// Offset of the `NMI` field.
18047    pub const NMI_SHIFT: u32 = 61;
18048    /// Offset of the `SPINTMASK` field.
18049    pub const SPINTMASK_SHIFT: u32 = 62;
18050    /// Offset of the `TIDCP` field.
18051    pub const TIDCP_SHIFT: u32 = 63;
18052
18053    /// Returns the value of the `TCF0` field.
18054    pub const fn tcf0(self) -> u8 {
18055        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
18056    }
18057
18058    /// Sets the value of the `TCF0` field.
18059    pub const fn set_tcf0(&mut self, value: u8) {
18060        let offset = Self::TCF0_SHIFT;
18061        assert!(value & (Self::TCF0_MASK as u8) == value);
18062        *self = Self::from_bits_retain(
18063            (self.bits() & !(Self::TCF0_MASK << offset)) | ((value as u64) << offset),
18064        );
18065    }
18066
18067    /// Returns the value of the `TCF` field.
18068    pub const fn tcf(self) -> u8 {
18069        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
18070    }
18071
18072    /// Sets the value of the `TCF` field.
18073    pub const fn set_tcf(&mut self, value: u8) {
18074        let offset = Self::TCF_SHIFT;
18075        assert!(value & (Self::TCF_MASK as u8) == value);
18076        *self = Self::from_bits_retain(
18077            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
18078        );
18079    }
18080
18081    /// Returns the value of the `TWEDEL` field.
18082    pub const fn twedel(self) -> u8 {
18083        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
18084    }
18085
18086    /// Sets the value of the `TWEDEL` field.
18087    pub const fn set_twedel(&mut self, value: u8) {
18088        let offset = Self::TWEDEL_SHIFT;
18089        assert!(value & (Self::TWEDEL_MASK as u8) == value);
18090        *self = Self::from_bits_retain(
18091            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
18092        );
18093    }
18094}
18095
18096#[cfg(feature = "el2")]
18097bitflags! {
18098    /// `SCTLR_EL2` system register value.
18099    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18100    #[repr(transparent)]
18101    pub struct SctlrEl2: u64 {
18102        /// `M` bit.
18103        const M = 1 << 0;
18104        /// `A` bit.
18105        const A = 1 << 1;
18106        /// `C` bit.
18107        const C = 1 << 2;
18108        /// `SA` bit.
18109        const SA = 1 << 3;
18110        /// `SA0` bit.
18111        const SA0 = 1 << 4;
18112        /// `CP15BEN` bit.
18113        const CP15BEN = 1 << 5;
18114        /// `nAA` bit.
18115        const NAA = 1 << 6;
18116        /// `SED` bit.
18117        const SED = 1 << 8;
18118        /// `UMA` bit.
18119        const UMA = 1 << 9;
18120        /// `EnRCTX` bit.
18121        const ENRCTX = 1 << 10;
18122        /// `EOS` bit.
18123        const EOS = 1 << 11;
18124        /// `I` bit.
18125        const I = 1 << 12;
18126        /// `EnDB` bit.
18127        const ENDB = 1 << 13;
18128        /// `DZE` bit.
18129        const DZE = 1 << 14;
18130        /// `UCT` bit.
18131        const UCT = 1 << 15;
18132        /// `nTWI` bit.
18133        const NTWI = 1 << 16;
18134        /// `nTWE` bit.
18135        const NTWE = 1 << 18;
18136        /// `WXN` bit.
18137        const WXN = 1 << 19;
18138        /// `IESB` bit.
18139        const IESB = 1 << 21;
18140        /// `EIS` bit.
18141        const EIS = 1 << 22;
18142        /// Do not set Privileged Access Never, on taking an exception to EL2.
18143        const SPAN = 1 << 23;
18144        /// `UCI` bit.
18145        const UCI = 1 << 26;
18146        /// `EnDA` bit.
18147        const ENDA = 1 << 27;
18148        /// `nTLSMD` bit.
18149        const NTLSMD = 1 << 28;
18150        /// `LSMAOE` bit.
18151        const LSMAOE = 1 << 29;
18152        /// Enable pointer authentication using APIBKey_EL1.
18153        const ENIB = 1 << 30;
18154        /// Enable pointer authentication using APIAKey_EL1.
18155        const ENIA = 1 << 31;
18156        /// `CMOW` bit.
18157        const CMOW = 1 << 32;
18158        /// `MSCEn` bit.
18159        const MSCEN = 1 << 33;
18160        /// `EnFPM` bit.
18161        const ENFPM = 1 << 34;
18162        /// `BT0` bit.
18163        const BT0 = 1 << 35;
18164        /// `BT` bit.
18165        const BT = 1 << 36;
18166        /// `ITFSB` bit.
18167        const ITFSB = 1 << 37;
18168        /// `ATA0` bit.
18169        const ATA0 = 1 << 42;
18170        /// `ATA` bit.
18171        const ATA = 1 << 43;
18172        /// Default PSTATE.SSBS value on Exception Entry.
18173        const DSSBS = 1 << 44;
18174        /// `TWEDEn` bit.
18175        const TWEDEN = 1 << 45;
18176        /// `EnASR` bit.
18177        const ENASR = 1 << 54;
18178        /// `EnAS0` bit.
18179        const ENAS0 = 1 << 55;
18180        /// `EnALS` bit.
18181        const ENALS = 1 << 56;
18182        /// `EPAN` bit.
18183        const EPAN = 1 << 57;
18184        /// `TCSO0` bit.
18185        const TCSO0 = 1 << 58;
18186        /// `TCSO` bit.
18187        const TCSO = 1 << 59;
18188        /// `EnTP2` bit.
18189        const ENTP2 = 1 << 60;
18190        /// `NMI` bit.
18191        const NMI = 1 << 61;
18192        /// SP Interrupt Mask enable.
18193        const SPINTMASK = 1 << 62;
18194        /// `TIDCP` bit.
18195        const TIDCP = 1 << 63;
18196    }
18197}
18198
18199#[cfg(feature = "el2")]
18200impl SctlrEl2 {
18201    /// Offset of the `M` field.
18202    pub const M_SHIFT: u32 = 0;
18203    /// Offset of the `A` field.
18204    pub const A_SHIFT: u32 = 1;
18205    /// Offset of the `C` field.
18206    pub const C_SHIFT: u32 = 2;
18207    /// Offset of the `SA` field.
18208    pub const SA_SHIFT: u32 = 3;
18209    /// Offset of the `SA0` field.
18210    pub const SA0_SHIFT: u32 = 4;
18211    /// Offset of the `CP15BEN` field.
18212    pub const CP15BEN_SHIFT: u32 = 5;
18213    /// Offset of the `nAA` field.
18214    pub const NAA_SHIFT: u32 = 6;
18215    /// Offset of the `SED` field.
18216    pub const SED_SHIFT: u32 = 8;
18217    /// Offset of the `UMA` field.
18218    pub const UMA_SHIFT: u32 = 9;
18219    /// Offset of the `EnRCTX` field.
18220    pub const ENRCTX_SHIFT: u32 = 10;
18221    /// Offset of the `EOS` field.
18222    pub const EOS_SHIFT: u32 = 11;
18223    /// Offset of the `I` field.
18224    pub const I_SHIFT: u32 = 12;
18225    /// Offset of the `EnDB` field.
18226    pub const ENDB_SHIFT: u32 = 13;
18227    /// Offset of the `DZE` field.
18228    pub const DZE_SHIFT: u32 = 14;
18229    /// Offset of the `UCT` field.
18230    pub const UCT_SHIFT: u32 = 15;
18231    /// Offset of the `nTWI` field.
18232    pub const NTWI_SHIFT: u32 = 16;
18233    /// Offset of the `nTWE` field.
18234    pub const NTWE_SHIFT: u32 = 18;
18235    /// Offset of the `WXN` field.
18236    pub const WXN_SHIFT: u32 = 19;
18237    /// Offset of the `IESB` field.
18238    pub const IESB_SHIFT: u32 = 21;
18239    /// Offset of the `EIS` field.
18240    pub const EIS_SHIFT: u32 = 22;
18241    /// Offset of the `SPAN` field.
18242    pub const SPAN_SHIFT: u32 = 23;
18243    /// Offset of the `UCI` field.
18244    pub const UCI_SHIFT: u32 = 26;
18245    /// Offset of the `EnDA` field.
18246    pub const ENDA_SHIFT: u32 = 27;
18247    /// Offset of the `nTLSMD` field.
18248    pub const NTLSMD_SHIFT: u32 = 28;
18249    /// Offset of the `LSMAOE` field.
18250    pub const LSMAOE_SHIFT: u32 = 29;
18251    /// Offset of the `EnIB` field.
18252    pub const ENIB_SHIFT: u32 = 30;
18253    /// Offset of the `EnIA` field.
18254    pub const ENIA_SHIFT: u32 = 31;
18255    /// Offset of the `CMOW` field.
18256    pub const CMOW_SHIFT: u32 = 32;
18257    /// Offset of the `MSCEn` field.
18258    pub const MSCEN_SHIFT: u32 = 33;
18259    /// Offset of the `EnFPM` field.
18260    pub const ENFPM_SHIFT: u32 = 34;
18261    /// Offset of the `BT0` field.
18262    pub const BT0_SHIFT: u32 = 35;
18263    /// Offset of the `BT` field.
18264    pub const BT_SHIFT: u32 = 36;
18265    /// Offset of the `ITFSB` field.
18266    pub const ITFSB_SHIFT: u32 = 37;
18267    /// Offset of the `TCF0` field.
18268    pub const TCF0_SHIFT: u32 = 38;
18269    /// Mask for the `TCF0` field.
18270    pub const TCF0_MASK: u64 = 0b11;
18271    /// Offset of the `TCF` field.
18272    pub const TCF_SHIFT: u32 = 40;
18273    /// Mask for the `TCF` field.
18274    pub const TCF_MASK: u64 = 0b11;
18275    /// Offset of the `ATA0` field.
18276    pub const ATA0_SHIFT: u32 = 42;
18277    /// Offset of the `ATA` field.
18278    pub const ATA_SHIFT: u32 = 43;
18279    /// Offset of the `DSSBS` field.
18280    pub const DSSBS_SHIFT: u32 = 44;
18281    /// Offset of the `TWEDEn` field.
18282    pub const TWEDEN_SHIFT: u32 = 45;
18283    /// Offset of the `TWEDEL` field.
18284    pub const TWEDEL_SHIFT: u32 = 46;
18285    /// Mask for the `TWEDEL` field.
18286    pub const TWEDEL_MASK: u64 = 0b1111;
18287    /// Offset of the `EnASR` field.
18288    pub const ENASR_SHIFT: u32 = 54;
18289    /// Offset of the `EnAS0` field.
18290    pub const ENAS0_SHIFT: u32 = 55;
18291    /// Offset of the `EnALS` field.
18292    pub const ENALS_SHIFT: u32 = 56;
18293    /// Offset of the `EPAN` field.
18294    pub const EPAN_SHIFT: u32 = 57;
18295    /// Offset of the `TCSO0` field.
18296    pub const TCSO0_SHIFT: u32 = 58;
18297    /// Offset of the `TCSO` field.
18298    pub const TCSO_SHIFT: u32 = 59;
18299    /// Offset of the `EnTP2` field.
18300    pub const ENTP2_SHIFT: u32 = 60;
18301    /// Offset of the `NMI` field.
18302    pub const NMI_SHIFT: u32 = 61;
18303    /// Offset of the `SPINTMASK` field.
18304    pub const SPINTMASK_SHIFT: u32 = 62;
18305    /// Offset of the `TIDCP` field.
18306    pub const TIDCP_SHIFT: u32 = 63;
18307
18308    /// Returns the value of the `TCF0` field.
18309    pub const fn tcf0(self) -> u8 {
18310        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
18311    }
18312
18313    /// Sets the value of the `TCF0` field.
18314    pub const fn set_tcf0(&mut self, value: u8) {
18315        let offset = Self::TCF0_SHIFT;
18316        assert!(value & (Self::TCF0_MASK as u8) == value);
18317        *self = Self::from_bits_retain(
18318            (self.bits() & !(Self::TCF0_MASK << offset)) | ((value as u64) << offset),
18319        );
18320    }
18321
18322    /// Returns the value of the `TCF` field.
18323    pub const fn tcf(self) -> u8 {
18324        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
18325    }
18326
18327    /// Sets the value of the `TCF` field.
18328    pub const fn set_tcf(&mut self, value: u8) {
18329        let offset = Self::TCF_SHIFT;
18330        assert!(value & (Self::TCF_MASK as u8) == value);
18331        *self = Self::from_bits_retain(
18332            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
18333        );
18334    }
18335
18336    /// Returns the value of the `TWEDEL` field.
18337    pub const fn twedel(self) -> u8 {
18338        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
18339    }
18340
18341    /// Sets the value of the `TWEDEL` field.
18342    pub const fn set_twedel(&mut self, value: u8) {
18343        let offset = Self::TWEDEL_SHIFT;
18344        assert!(value & (Self::TWEDEL_MASK as u8) == value);
18345        *self = Self::from_bits_retain(
18346            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
18347        );
18348    }
18349}
18350
18351#[cfg(feature = "el3")]
18352bitflags! {
18353    /// `SCTLR_EL3` system register value.
18354    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18355    #[repr(transparent)]
18356    pub struct SctlrEl3: u64 {
18357        /// RES1 bits in the `SCTLR_EL3` register.
18358        const RES1 = 0b110000100001010000000000110000;
18359        /// MMU enable for EL3 stage 1 address translation.
18360        const M = 1 << 0;
18361        /// Alignment check enable.
18362        const A = 1 << 1;
18363        /// Cacheability control, for data accesses at EL3.
18364        const C = 1 << 2;
18365        /// SP alignment check enable.
18366        const SA = 1 << 3;
18367        /// `nAA` bit.
18368        const NAA = 1 << 6;
18369        /// `EOS` bit.
18370        const EOS = 1 << 11;
18371        /// Cacheability control, for instruction accesses at EL3.
18372        const I = 1 << 12;
18373        /// `EnDB` bit.
18374        const ENDB = 1 << 13;
18375        /// 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.
18376        const WXN = 1 << 19;
18377        /// Enable Implicit Error Synchronization events.
18378        const IESB = 1 << 21;
18379        /// `EIS` bit.
18380        const EIS = 1 << 22;
18381        /// `EnDA` bit.
18382        const ENDA = 1 << 27;
18383        /// Enable pointer authentication using APIBKey_EL1.
18384        const ENIB = 1 << 30;
18385        /// Enable pointer authentication using APIAKey_EL1.
18386        const ENIA = 1 << 31;
18387        /// `BT` bit.
18388        const BT = 1 << 36;
18389        /// `ITFSB` bit.
18390        const ITFSB = 1 << 37;
18391        /// `ATA` bit.
18392        const ATA = 1 << 43;
18393        /// `DSSBS` bit.
18394        const DSSBS = 1 << 44;
18395        /// `TCSO` bit.
18396        const TCSO = 1 << 59;
18397        /// `NMI` bit.
18398        const NMI = 1 << 61;
18399        /// `SPINTMASK` bit.
18400        const SPINTMASK = 1 << 62;
18401    }
18402}
18403
18404#[cfg(feature = "el3")]
18405impl SctlrEl3 {
18406    /// Offset of the `M` field.
18407    pub const M_SHIFT: u32 = 0;
18408    /// Offset of the `A` field.
18409    pub const A_SHIFT: u32 = 1;
18410    /// Offset of the `C` field.
18411    pub const C_SHIFT: u32 = 2;
18412    /// Offset of the `SA` field.
18413    pub const SA_SHIFT: u32 = 3;
18414    /// Offset of the `nAA` field.
18415    pub const NAA_SHIFT: u32 = 6;
18416    /// Offset of the `EOS` field.
18417    pub const EOS_SHIFT: u32 = 11;
18418    /// Offset of the `I` field.
18419    pub const I_SHIFT: u32 = 12;
18420    /// Offset of the `EnDB` field.
18421    pub const ENDB_SHIFT: u32 = 13;
18422    /// Offset of the `WXN` field.
18423    pub const WXN_SHIFT: u32 = 19;
18424    /// Offset of the `IESB` field.
18425    pub const IESB_SHIFT: u32 = 21;
18426    /// Offset of the `EIS` field.
18427    pub const EIS_SHIFT: u32 = 22;
18428    /// Offset of the `EnDA` field.
18429    pub const ENDA_SHIFT: u32 = 27;
18430    /// Offset of the `EnIB` field.
18431    pub const ENIB_SHIFT: u32 = 30;
18432    /// Offset of the `EnIA` field.
18433    pub const ENIA_SHIFT: u32 = 31;
18434    /// Offset of the `BT` field.
18435    pub const BT_SHIFT: u32 = 36;
18436    /// Offset of the `ITFSB` field.
18437    pub const ITFSB_SHIFT: u32 = 37;
18438    /// Offset of the `TCF` field.
18439    pub const TCF_SHIFT: u32 = 40;
18440    /// Mask for the `TCF` field.
18441    pub const TCF_MASK: u64 = 0b11;
18442    /// Offset of the `ATA` field.
18443    pub const ATA_SHIFT: u32 = 43;
18444    /// Offset of the `DSSBS` field.
18445    pub const DSSBS_SHIFT: u32 = 44;
18446    /// Offset of the `TCSO` field.
18447    pub const TCSO_SHIFT: u32 = 59;
18448    /// Offset of the `NMI` field.
18449    pub const NMI_SHIFT: u32 = 61;
18450    /// Offset of the `SPINTMASK` field.
18451    pub const SPINTMASK_SHIFT: u32 = 62;
18452
18453    /// Returns the value of the `TCF` field.
18454    pub const fn tcf(self) -> u8 {
18455        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
18456    }
18457
18458    /// Sets the value of the `TCF` field.
18459    pub const fn set_tcf(&mut self, value: u8) {
18460        let offset = Self::TCF_SHIFT;
18461        assert!(value & (Self::TCF_MASK as u8) == value);
18462        *self = Self::from_bits_retain(
18463            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
18464        );
18465    }
18466}
18467
18468bitflags! {
18469    /// `SDCR` system register value.
18470    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18471    #[repr(transparent)]
18472    pub struct Sdcr: u32 {
18473        /// `SPME` bit.
18474        const SPME = 1 << 17;
18475        /// `STE` bit.
18476        const STE = 1 << 18;
18477        /// `TTRF` bit.
18478        const TTRF = 1 << 19;
18479        /// `EDAD` bit.
18480        const EDAD = 1 << 20;
18481        /// `EPMAD` bit.
18482        const EPMAD = 1 << 21;
18483        /// `SCCD` bit.
18484        const SCCD = 1 << 23;
18485        /// `TDCC` bit.
18486        const TDCC = 1 << 27;
18487        /// `MTPME` bit.
18488        const MTPME = 1 << 28;
18489    }
18490}
18491
18492impl Sdcr {
18493    /// Offset of the `SPD` field.
18494    pub const SPD_SHIFT: u32 = 14;
18495    /// Mask for the `SPD` field.
18496    pub const SPD_MASK: u32 = 0b11;
18497    /// Offset of the `SPME` field.
18498    pub const SPME_SHIFT: u32 = 17;
18499    /// Offset of the `STE` field.
18500    pub const STE_SHIFT: u32 = 18;
18501    /// Offset of the `TTRF` field.
18502    pub const TTRF_SHIFT: u32 = 19;
18503    /// Offset of the `EDAD` field.
18504    pub const EDAD_SHIFT: u32 = 20;
18505    /// Offset of the `EPMAD` field.
18506    pub const EPMAD_SHIFT: u32 = 21;
18507    /// Offset of the `SCCD` field.
18508    pub const SCCD_SHIFT: u32 = 23;
18509    /// Offset of the `TDCC` field.
18510    pub const TDCC_SHIFT: u32 = 27;
18511    /// Offset of the `MTPME` field.
18512    pub const MTPME_SHIFT: u32 = 28;
18513
18514    /// Returns the value of the `SPD` field.
18515    pub const fn spd(self) -> u8 {
18516        ((self.bits() >> Self::SPD_SHIFT) & 0b11) as u8
18517    }
18518
18519    /// Sets the value of the `SPD` field.
18520    pub const fn set_spd(&mut self, value: u8) {
18521        let offset = Self::SPD_SHIFT;
18522        assert!(value & (Self::SPD_MASK as u8) == value);
18523        *self = Self::from_bits_retain(
18524            (self.bits() & !(Self::SPD_MASK << offset)) | ((value as u32) << offset),
18525        );
18526    }
18527}
18528
18529bitflags! {
18530    /// `SDER` system register value.
18531    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18532    #[repr(transparent)]
18533    pub struct Sder: u32 {
18534        /// `SUIDEN` bit.
18535        const SUIDEN = 1 << 0;
18536        /// `SUNIDEN` bit.
18537        const SUNIDEN = 1 << 1;
18538    }
18539}
18540
18541impl Sder {
18542    /// Offset of the `SUIDEN` field.
18543    pub const SUIDEN_SHIFT: u32 = 0;
18544    /// Offset of the `SUNIDEN` field.
18545    pub const SUNIDEN_SHIFT: u32 = 1;
18546}
18547
18548#[cfg(feature = "el3")]
18549bitflags! {
18550    /// `SMCR_EL3` system register value.
18551    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18552    #[repr(transparent)]
18553    pub struct SmcrEl3: u64 {
18554        /// `EZT0` bit.
18555        const EZT0 = 1 << 30;
18556        /// `FA64` bit.
18557        const FA64 = 1 << 31;
18558    }
18559}
18560
18561#[cfg(feature = "el3")]
18562impl SmcrEl3 {
18563    /// Offset of the `LEN` field.
18564    pub const LEN_SHIFT: u32 = 0;
18565    /// Mask for the `LEN` field.
18566    pub const LEN_MASK: u64 = 0b1111;
18567    /// Offset of the `EZT0` field.
18568    pub const EZT0_SHIFT: u32 = 30;
18569    /// Offset of the `FA64` field.
18570    pub const FA64_SHIFT: u32 = 31;
18571
18572    /// Returns the value of the `LEN` field.
18573    pub const fn len(self) -> u8 {
18574        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
18575    }
18576
18577    /// Sets the value of the `LEN` field.
18578    pub const fn set_len(&mut self, value: u8) {
18579        let offset = Self::LEN_SHIFT;
18580        assert!(value & (Self::LEN_MASK as u8) == value);
18581        *self = Self::from_bits_retain(
18582            (self.bits() & !(Self::LEN_MASK << offset)) | ((value as u64) << offset),
18583        );
18584    }
18585}
18586
18587#[cfg(feature = "el1")]
18588bitflags! {
18589    /// `SPSR_EL1` system register value.
18590    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18591    #[repr(transparent)]
18592    pub struct SpsrEl1: u64 {
18593        /// `M[4]` bit.
18594        const M_4 = 1 << 4;
18595        /// `T` bit.
18596        const T = 1 << 5;
18597        /// `F` bit.
18598        const F = 1 << 6;
18599        /// `I` bit.
18600        const I = 1 << 7;
18601        /// `A` bit.
18602        const A = 1 << 8;
18603        /// `D` bit.
18604        const D = 1 << 9;
18605        /// `E` bit.
18606        const E = 1 << 9;
18607        /// `ALLINT` bit.
18608        const ALLINT = 1 << 13;
18609        /// `BTYPE2` bit.
18610        const BTYPE2 = 1 << 14;
18611        /// `IL` bit.
18612        const IL = 1 << 20;
18613        /// `SS` bit.
18614        const SS = 1 << 21;
18615        /// `PAN` bit.
18616        const PAN = 1 << 22;
18617        /// `UAO` bit.
18618        const UAO = 1 << 23;
18619        /// `DIT` bit.
18620        const DIT = 1 << 24;
18621        /// `TCO` bit.
18622        const TCO = 1 << 25;
18623        /// `Q` bit.
18624        const Q = 1 << 27;
18625        /// `V` bit.
18626        const V = 1 << 28;
18627        /// `C` bit.
18628        const C = 1 << 29;
18629        /// `Z` bit.
18630        const Z = 1 << 30;
18631        /// `N` bit.
18632        const N = 1 << 31;
18633        /// `PM` bit.
18634        const PM = 1 << 32;
18635        /// `PPEND` bit.
18636        const PPEND = 1 << 33;
18637        /// `EXLOCK` bit.
18638        const EXLOCK = 1 << 34;
18639        /// `PACM` bit.
18640        const PACM = 1 << 35;
18641        /// `UINJ` bit.
18642        const UINJ = 1 << 36;
18643    }
18644}
18645
18646#[cfg(feature = "el1")]
18647impl SpsrEl1 {
18648    /// Offset of the `M[3:0]` field.
18649    pub const M_3_0_SHIFT: u32 = 0;
18650    /// Mask for the `M[3:0]` field.
18651    pub const M_3_0_MASK: u64 = 0b1111;
18652    /// Offset of the `M[4]` field.
18653    pub const M_4_SHIFT: u32 = 4;
18654    /// Offset of the `T` field.
18655    pub const T_SHIFT: u32 = 5;
18656    /// Offset of the `F` field.
18657    pub const F_SHIFT: u32 = 6;
18658    /// Offset of the `I` field.
18659    pub const I_SHIFT: u32 = 7;
18660    /// Offset of the `A` field.
18661    pub const A_SHIFT: u32 = 8;
18662    /// Offset of the `D` field.
18663    pub const D_SHIFT: u32 = 9;
18664    /// Offset of the `E` field.
18665    pub const E_SHIFT: u32 = 9;
18666    /// Offset of the `BTYPE` field.
18667    pub const BTYPE_SHIFT: u32 = 10;
18668    /// Mask for the `BTYPE` field.
18669    pub const BTYPE_MASK: u64 = 0b11;
18670    /// Offset of the `ALLINT` field.
18671    pub const ALLINT_SHIFT: u32 = 13;
18672    /// Offset of the `BTYPE2` field.
18673    pub const BTYPE2_SHIFT: u32 = 14;
18674    /// Offset of the `GE` field.
18675    pub const GE_SHIFT: u32 = 16;
18676    /// Mask for the `GE` field.
18677    pub const GE_MASK: u64 = 0b1111;
18678    /// Offset of the `IL` field.
18679    pub const IL_SHIFT: u32 = 20;
18680    /// Offset of the `SS` field.
18681    pub const SS_SHIFT: u32 = 21;
18682    /// Offset of the `PAN` field.
18683    pub const PAN_SHIFT: u32 = 22;
18684    /// Offset of the `UAO` field.
18685    pub const UAO_SHIFT: u32 = 23;
18686    /// Offset of the `DIT` field.
18687    pub const DIT_SHIFT: u32 = 24;
18688    /// Offset of the `TCO` field.
18689    pub const TCO_SHIFT: u32 = 25;
18690    /// Offset of the `Q` field.
18691    pub const Q_SHIFT: u32 = 27;
18692    /// Offset of the `V` field.
18693    pub const V_SHIFT: u32 = 28;
18694    /// Offset of the `C` field.
18695    pub const C_SHIFT: u32 = 29;
18696    /// Offset of the `Z` field.
18697    pub const Z_SHIFT: u32 = 30;
18698    /// Offset of the `N` field.
18699    pub const N_SHIFT: u32 = 31;
18700    /// Offset of the `PM` field.
18701    pub const PM_SHIFT: u32 = 32;
18702    /// Offset of the `PPEND` field.
18703    pub const PPEND_SHIFT: u32 = 33;
18704    /// Offset of the `EXLOCK` field.
18705    pub const EXLOCK_SHIFT: u32 = 34;
18706    /// Offset of the `PACM` field.
18707    pub const PACM_SHIFT: u32 = 35;
18708    /// Offset of the `UINJ` field.
18709    pub const UINJ_SHIFT: u32 = 36;
18710
18711    /// Returns the value of the `M[3:0]` field.
18712    pub const fn m_3_0(self) -> u8 {
18713        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
18714    }
18715
18716    /// Sets the value of the `M[3:0]` field.
18717    pub const fn set_m_3_0(&mut self, value: u8) {
18718        let offset = Self::M_3_0_SHIFT;
18719        assert!(value & (Self::M_3_0_MASK as u8) == value);
18720        *self = Self::from_bits_retain(
18721            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
18722        );
18723    }
18724
18725    /// Returns the value of the `BTYPE` field.
18726    pub const fn btype(self) -> u8 {
18727        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
18728    }
18729
18730    /// Sets the value of the `BTYPE` field.
18731    pub const fn set_btype(&mut self, value: u8) {
18732        let offset = Self::BTYPE_SHIFT;
18733        assert!(value & (Self::BTYPE_MASK as u8) == value);
18734        *self = Self::from_bits_retain(
18735            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
18736        );
18737    }
18738
18739    /// Returns the value of the `GE` field.
18740    pub const fn ge(self) -> u8 {
18741        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
18742    }
18743
18744    /// Sets the value of the `GE` field.
18745    pub const fn set_ge(&mut self, value: u8) {
18746        let offset = Self::GE_SHIFT;
18747        assert!(value & (Self::GE_MASK as u8) == value);
18748        *self = Self::from_bits_retain(
18749            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
18750        );
18751    }
18752}
18753
18754#[cfg(feature = "el2")]
18755bitflags! {
18756    /// `SPSR_EL2` system register value.
18757    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18758    #[repr(transparent)]
18759    pub struct SpsrEl2: u64 {
18760        /// `M[4]` bit.
18761        const M_4 = 1 << 4;
18762        /// `T` bit.
18763        const T = 1 << 5;
18764        /// `F` bit.
18765        const F = 1 << 6;
18766        /// `I` bit.
18767        const I = 1 << 7;
18768        /// `A` bit.
18769        const A = 1 << 8;
18770        /// `D` bit.
18771        const D = 1 << 9;
18772        /// `E` bit.
18773        const E = 1 << 9;
18774        /// `ALLINT` bit.
18775        const ALLINT = 1 << 13;
18776        /// `BTYPE2` bit.
18777        const BTYPE2 = 1 << 14;
18778        /// `IL` bit.
18779        const IL = 1 << 20;
18780        /// `SS` bit.
18781        const SS = 1 << 21;
18782        /// `PAN` bit.
18783        const PAN = 1 << 22;
18784        /// `UAO` bit.
18785        const UAO = 1 << 23;
18786        /// `DIT` bit.
18787        const DIT = 1 << 24;
18788        /// `TCO` bit.
18789        const TCO = 1 << 25;
18790        /// `Q` bit.
18791        const Q = 1 << 27;
18792        /// `V` bit.
18793        const V = 1 << 28;
18794        /// `C` bit.
18795        const C = 1 << 29;
18796        /// `Z` bit.
18797        const Z = 1 << 30;
18798        /// `N` bit.
18799        const N = 1 << 31;
18800        /// `PM` bit.
18801        const PM = 1 << 32;
18802        /// `PPEND` bit.
18803        const PPEND = 1 << 33;
18804        /// `EXLOCK` bit.
18805        const EXLOCK = 1 << 34;
18806        /// `PACM` bit.
18807        const PACM = 1 << 35;
18808        /// `UINJ` bit.
18809        const UINJ = 1 << 36;
18810    }
18811}
18812
18813#[cfg(feature = "el2")]
18814impl SpsrEl2 {
18815    /// Offset of the `M[3:0]` field.
18816    pub const M_3_0_SHIFT: u32 = 0;
18817    /// Mask for the `M[3:0]` field.
18818    pub const M_3_0_MASK: u64 = 0b1111;
18819    /// Offset of the `M[4]` field.
18820    pub const M_4_SHIFT: u32 = 4;
18821    /// Offset of the `T` field.
18822    pub const T_SHIFT: u32 = 5;
18823    /// Offset of the `F` field.
18824    pub const F_SHIFT: u32 = 6;
18825    /// Offset of the `I` field.
18826    pub const I_SHIFT: u32 = 7;
18827    /// Offset of the `A` field.
18828    pub const A_SHIFT: u32 = 8;
18829    /// Offset of the `D` field.
18830    pub const D_SHIFT: u32 = 9;
18831    /// Offset of the `E` field.
18832    pub const E_SHIFT: u32 = 9;
18833    /// Offset of the `BTYPE` field.
18834    pub const BTYPE_SHIFT: u32 = 10;
18835    /// Mask for the `BTYPE` field.
18836    pub const BTYPE_MASK: u64 = 0b11;
18837    /// Offset of the `ALLINT` field.
18838    pub const ALLINT_SHIFT: u32 = 13;
18839    /// Offset of the `BTYPE2` field.
18840    pub const BTYPE2_SHIFT: u32 = 14;
18841    /// Offset of the `GE` field.
18842    pub const GE_SHIFT: u32 = 16;
18843    /// Mask for the `GE` field.
18844    pub const GE_MASK: u64 = 0b1111;
18845    /// Offset of the `IL` field.
18846    pub const IL_SHIFT: u32 = 20;
18847    /// Offset of the `SS` field.
18848    pub const SS_SHIFT: u32 = 21;
18849    /// Offset of the `PAN` field.
18850    pub const PAN_SHIFT: u32 = 22;
18851    /// Offset of the `UAO` field.
18852    pub const UAO_SHIFT: u32 = 23;
18853    /// Offset of the `DIT` field.
18854    pub const DIT_SHIFT: u32 = 24;
18855    /// Offset of the `TCO` field.
18856    pub const TCO_SHIFT: u32 = 25;
18857    /// Offset of the `Q` field.
18858    pub const Q_SHIFT: u32 = 27;
18859    /// Offset of the `V` field.
18860    pub const V_SHIFT: u32 = 28;
18861    /// Offset of the `C` field.
18862    pub const C_SHIFT: u32 = 29;
18863    /// Offset of the `Z` field.
18864    pub const Z_SHIFT: u32 = 30;
18865    /// Offset of the `N` field.
18866    pub const N_SHIFT: u32 = 31;
18867    /// Offset of the `PM` field.
18868    pub const PM_SHIFT: u32 = 32;
18869    /// Offset of the `PPEND` field.
18870    pub const PPEND_SHIFT: u32 = 33;
18871    /// Offset of the `EXLOCK` field.
18872    pub const EXLOCK_SHIFT: u32 = 34;
18873    /// Offset of the `PACM` field.
18874    pub const PACM_SHIFT: u32 = 35;
18875    /// Offset of the `UINJ` field.
18876    pub const UINJ_SHIFT: u32 = 36;
18877
18878    /// Returns the value of the `M[3:0]` field.
18879    pub const fn m_3_0(self) -> u8 {
18880        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
18881    }
18882
18883    /// Sets the value of the `M[3:0]` field.
18884    pub const fn set_m_3_0(&mut self, value: u8) {
18885        let offset = Self::M_3_0_SHIFT;
18886        assert!(value & (Self::M_3_0_MASK as u8) == value);
18887        *self = Self::from_bits_retain(
18888            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
18889        );
18890    }
18891
18892    /// Returns the value of the `BTYPE` field.
18893    pub const fn btype(self) -> u8 {
18894        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
18895    }
18896
18897    /// Sets the value of the `BTYPE` field.
18898    pub const fn set_btype(&mut self, value: u8) {
18899        let offset = Self::BTYPE_SHIFT;
18900        assert!(value & (Self::BTYPE_MASK as u8) == value);
18901        *self = Self::from_bits_retain(
18902            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
18903        );
18904    }
18905
18906    /// Returns the value of the `GE` field.
18907    pub const fn ge(self) -> u8 {
18908        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
18909    }
18910
18911    /// Sets the value of the `GE` field.
18912    pub const fn set_ge(&mut self, value: u8) {
18913        let offset = Self::GE_SHIFT;
18914        assert!(value & (Self::GE_MASK as u8) == value);
18915        *self = Self::from_bits_retain(
18916            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
18917        );
18918    }
18919}
18920
18921#[cfg(feature = "el3")]
18922bitflags! {
18923    /// `SPSR_EL3` system register value.
18924    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18925    #[repr(transparent)]
18926    pub struct SpsrEl3: u64 {
18927        /// `M[4]` bit.
18928        const M_4 = 1 << 4;
18929        /// `T` bit.
18930        const T = 1 << 5;
18931        /// `F` bit.
18932        const F = 1 << 6;
18933        /// `I` bit.
18934        const I = 1 << 7;
18935        /// `A` bit.
18936        const A = 1 << 8;
18937        /// `D` bit.
18938        const D = 1 << 9;
18939        /// `E` bit.
18940        const E = 1 << 9;
18941        /// `ALLINT` bit.
18942        const ALLINT = 1 << 13;
18943        /// `BTYPE2` bit.
18944        const BTYPE2 = 1 << 14;
18945        /// `IL` bit.
18946        const IL = 1 << 20;
18947        /// `SS` bit.
18948        const SS = 1 << 21;
18949        /// `PAN` bit.
18950        const PAN = 1 << 22;
18951        /// `UAO` bit.
18952        const UAO = 1 << 23;
18953        /// `DIT` bit.
18954        const DIT = 1 << 24;
18955        /// `TCO` bit.
18956        const TCO = 1 << 25;
18957        /// `Q` bit.
18958        const Q = 1 << 27;
18959        /// `V` bit.
18960        const V = 1 << 28;
18961        /// `C` bit.
18962        const C = 1 << 29;
18963        /// `Z` bit.
18964        const Z = 1 << 30;
18965        /// `N` bit.
18966        const N = 1 << 31;
18967        /// `PM` bit.
18968        const PM = 1 << 32;
18969        /// `PPEND` bit.
18970        const PPEND = 1 << 33;
18971        /// `EXLOCK` bit.
18972        const EXLOCK = 1 << 34;
18973        /// `PACM` bit.
18974        const PACM = 1 << 35;
18975        /// `UINJ` bit.
18976        const UINJ = 1 << 36;
18977    }
18978}
18979
18980#[cfg(feature = "el3")]
18981impl SpsrEl3 {
18982    /// Offset of the `M[3:0]` field.
18983    pub const M_3_0_SHIFT: u32 = 0;
18984    /// Mask for the `M[3:0]` field.
18985    pub const M_3_0_MASK: u64 = 0b1111;
18986    /// Offset of the `M[4]` field.
18987    pub const M_4_SHIFT: u32 = 4;
18988    /// Offset of the `T` field.
18989    pub const T_SHIFT: u32 = 5;
18990    /// Offset of the `F` field.
18991    pub const F_SHIFT: u32 = 6;
18992    /// Offset of the `I` field.
18993    pub const I_SHIFT: u32 = 7;
18994    /// Offset of the `A` field.
18995    pub const A_SHIFT: u32 = 8;
18996    /// Offset of the `D` field.
18997    pub const D_SHIFT: u32 = 9;
18998    /// Offset of the `E` field.
18999    pub const E_SHIFT: u32 = 9;
19000    /// Offset of the `BTYPE` field.
19001    pub const BTYPE_SHIFT: u32 = 10;
19002    /// Mask for the `BTYPE` field.
19003    pub const BTYPE_MASK: u64 = 0b11;
19004    /// Offset of the `ALLINT` field.
19005    pub const ALLINT_SHIFT: u32 = 13;
19006    /// Offset of the `BTYPE2` field.
19007    pub const BTYPE2_SHIFT: u32 = 14;
19008    /// Offset of the `GE` field.
19009    pub const GE_SHIFT: u32 = 16;
19010    /// Mask for the `GE` field.
19011    pub const GE_MASK: u64 = 0b1111;
19012    /// Offset of the `IL` field.
19013    pub const IL_SHIFT: u32 = 20;
19014    /// Offset of the `SS` field.
19015    pub const SS_SHIFT: u32 = 21;
19016    /// Offset of the `PAN` field.
19017    pub const PAN_SHIFT: u32 = 22;
19018    /// Offset of the `UAO` field.
19019    pub const UAO_SHIFT: u32 = 23;
19020    /// Offset of the `DIT` field.
19021    pub const DIT_SHIFT: u32 = 24;
19022    /// Offset of the `TCO` field.
19023    pub const TCO_SHIFT: u32 = 25;
19024    /// Offset of the `Q` field.
19025    pub const Q_SHIFT: u32 = 27;
19026    /// Offset of the `V` field.
19027    pub const V_SHIFT: u32 = 28;
19028    /// Offset of the `C` field.
19029    pub const C_SHIFT: u32 = 29;
19030    /// Offset of the `Z` field.
19031    pub const Z_SHIFT: u32 = 30;
19032    /// Offset of the `N` field.
19033    pub const N_SHIFT: u32 = 31;
19034    /// Offset of the `PM` field.
19035    pub const PM_SHIFT: u32 = 32;
19036    /// Offset of the `PPEND` field.
19037    pub const PPEND_SHIFT: u32 = 33;
19038    /// Offset of the `EXLOCK` field.
19039    pub const EXLOCK_SHIFT: u32 = 34;
19040    /// Offset of the `PACM` field.
19041    pub const PACM_SHIFT: u32 = 35;
19042    /// Offset of the `UINJ` field.
19043    pub const UINJ_SHIFT: u32 = 36;
19044
19045    /// Returns the value of the `M[3:0]` field.
19046    pub const fn m_3_0(self) -> u8 {
19047        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
19048    }
19049
19050    /// Sets the value of the `M[3:0]` field.
19051    pub const fn set_m_3_0(&mut self, value: u8) {
19052        let offset = Self::M_3_0_SHIFT;
19053        assert!(value & (Self::M_3_0_MASK as u8) == value);
19054        *self = Self::from_bits_retain(
19055            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
19056        );
19057    }
19058
19059    /// Returns the value of the `BTYPE` field.
19060    pub const fn btype(self) -> u8 {
19061        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
19062    }
19063
19064    /// Sets the value of the `BTYPE` field.
19065    pub const fn set_btype(&mut self, value: u8) {
19066        let offset = Self::BTYPE_SHIFT;
19067        assert!(value & (Self::BTYPE_MASK as u8) == value);
19068        *self = Self::from_bits_retain(
19069            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
19070        );
19071    }
19072
19073    /// Returns the value of the `GE` field.
19074    pub const fn ge(self) -> u8 {
19075        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
19076    }
19077
19078    /// Sets the value of the `GE` field.
19079    pub const fn set_ge(&mut self, value: u8) {
19080        let offset = Self::GE_SHIFT;
19081        assert!(value & (Self::GE_MASK as u8) == value);
19082        *self = Self::from_bits_retain(
19083            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
19084        );
19085    }
19086}
19087
19088#[cfg(feature = "el1")]
19089bitflags! {
19090    /// `SP_EL1` system register value.
19091    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19092    #[repr(transparent)]
19093    pub struct SpEl1: u64 {
19094    }
19095}
19096
19097#[cfg(feature = "el1")]
19098impl SpEl1 {
19099    /// Offset of the `StackPointer` field.
19100    pub const STACKPOINTER_SHIFT: u32 = 0;
19101    /// Mask for the `StackPointer` field.
19102    pub const STACKPOINTER_MASK: u64 =
19103        0b1111111111111111111111111111111111111111111111111111111111111111;
19104
19105    /// Returns the value of the `StackPointer` field.
19106    pub const fn stackpointer(self) -> u64 {
19107        ((self.bits() >> Self::STACKPOINTER_SHIFT)
19108            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
19109    }
19110
19111    /// Sets the value of the `StackPointer` field.
19112    pub const fn set_stackpointer(&mut self, value: u64) {
19113        let offset = Self::STACKPOINTER_SHIFT;
19114        assert!(value & (Self::STACKPOINTER_MASK as u64) == value);
19115        *self = Self::from_bits_retain(
19116            (self.bits() & !(Self::STACKPOINTER_MASK << offset)) | ((value as u64) << offset),
19117        );
19118    }
19119}
19120
19121#[cfg(feature = "el2")]
19122bitflags! {
19123    /// `SP_EL2` system register value.
19124    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19125    #[repr(transparent)]
19126    pub struct SpEl2: u64 {
19127    }
19128}
19129
19130#[cfg(feature = "el2")]
19131impl SpEl2 {
19132    /// Offset of the `StackPointer` field.
19133    pub const STACKPOINTER_SHIFT: u32 = 0;
19134    /// Mask for the `StackPointer` field.
19135    pub const STACKPOINTER_MASK: u64 =
19136        0b1111111111111111111111111111111111111111111111111111111111111111;
19137
19138    /// Returns the value of the `StackPointer` field.
19139    pub const fn stackpointer(self) -> u64 {
19140        ((self.bits() >> Self::STACKPOINTER_SHIFT)
19141            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
19142    }
19143
19144    /// Sets the value of the `StackPointer` field.
19145    pub const fn set_stackpointer(&mut self, value: u64) {
19146        let offset = Self::STACKPOINTER_SHIFT;
19147        assert!(value & (Self::STACKPOINTER_MASK as u64) == value);
19148        *self = Self::from_bits_retain(
19149            (self.bits() & !(Self::STACKPOINTER_MASK << offset)) | ((value as u64) << offset),
19150        );
19151    }
19152}
19153
19154#[cfg(feature = "el1")]
19155bitflags! {
19156    /// `TCR2_EL1` system register value.
19157    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19158    #[repr(transparent)]
19159    pub struct Tcr2El1: u64 {
19160        /// `PnCH` bit.
19161        const PNCH = 1 << 0;
19162        /// `PIE` bit.
19163        const PIE = 1 << 1;
19164        /// `E0POE` bit.
19165        const E0POE = 1 << 2;
19166        /// `POE` bit.
19167        const POE = 1 << 3;
19168        /// `AIE` bit.
19169        const AIE = 1 << 4;
19170        /// `D128` bit.
19171        const D128 = 1 << 5;
19172        /// `PTTWI` bit.
19173        const PTTWI = 1 << 10;
19174        /// `HAFT` bit.
19175        const HAFT = 1 << 11;
19176        /// `DisCH0` bit.
19177        const DISCH0 = 1 << 14;
19178        /// `DisCH1` bit.
19179        const DISCH1 = 1 << 15;
19180        /// `A2` bit.
19181        const A2 = 1 << 16;
19182        /// `FNG0` bit.
19183        const FNG0 = 1 << 17;
19184        /// `FNG1` bit.
19185        const FNG1 = 1 << 18;
19186        /// `POE2F` bit.
19187        const POE2F = 1 << 19;
19188        /// `FNGNA0` bit.
19189        const FNGNA0 = 1 << 20;
19190        /// `FNGNA1` bit.
19191        const FNGNA1 = 1 << 21;
19192        /// `TVAD0` bit.
19193        const TVAD0 = 1 << 35;
19194        /// `TVAD1` bit.
19195        const TVAD1 = 1 << 36;
19196    }
19197}
19198
19199#[cfg(feature = "el1")]
19200impl Tcr2El1 {
19201    /// Offset of the `PnCH` field.
19202    pub const PNCH_SHIFT: u32 = 0;
19203    /// Offset of the `PIE` field.
19204    pub const PIE_SHIFT: u32 = 1;
19205    /// Offset of the `E0POE` field.
19206    pub const E0POE_SHIFT: u32 = 2;
19207    /// Offset of the `POE` field.
19208    pub const POE_SHIFT: u32 = 3;
19209    /// Offset of the `AIE` field.
19210    pub const AIE_SHIFT: u32 = 4;
19211    /// Offset of the `D128` field.
19212    pub const D128_SHIFT: u32 = 5;
19213    /// Offset of the `PTTWI` field.
19214    pub const PTTWI_SHIFT: u32 = 10;
19215    /// Offset of the `HAFT` field.
19216    pub const HAFT_SHIFT: u32 = 11;
19217    /// Offset of the `DisCH0` field.
19218    pub const DISCH0_SHIFT: u32 = 14;
19219    /// Offset of the `DisCH1` field.
19220    pub const DISCH1_SHIFT: u32 = 15;
19221    /// Offset of the `A2` field.
19222    pub const A2_SHIFT: u32 = 16;
19223    /// Offset of the `FNG0` field.
19224    pub const FNG0_SHIFT: u32 = 17;
19225    /// Offset of the `FNG1` field.
19226    pub const FNG1_SHIFT: u32 = 18;
19227    /// Offset of the `POE2F` field.
19228    pub const POE2F_SHIFT: u32 = 19;
19229    /// Offset of the `FNGNA0` field.
19230    pub const FNGNA0_SHIFT: u32 = 20;
19231    /// Offset of the `FNGNA1` field.
19232    pub const FNGNA1_SHIFT: u32 = 21;
19233    /// Offset of the `POIW` field.
19234    pub const POIW_SHIFT: u32 = 22;
19235    /// Mask for the `POIW` field.
19236    pub const POIW_MASK: u64 = 0b111;
19237    /// Offset of the `VTB0` field.
19238    pub const VTB0_SHIFT: u32 = 25;
19239    /// Mask for the `VTB0` field.
19240    pub const VTB0_MASK: u64 = 0b11111;
19241    /// Offset of the `VTB1` field.
19242    pub const VTB1_SHIFT: u32 = 30;
19243    /// Mask for the `VTB1` field.
19244    pub const VTB1_MASK: u64 = 0b11111;
19245    /// Offset of the `TVAD0` field.
19246    pub const TVAD0_SHIFT: u32 = 35;
19247    /// Offset of the `TVAD1` field.
19248    pub const TVAD1_SHIFT: u32 = 36;
19249
19250    /// Returns the value of the `POIW` field.
19251    pub const fn poiw(self) -> u8 {
19252        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
19253    }
19254
19255    /// Sets the value of the `POIW` field.
19256    pub const fn set_poiw(&mut self, value: u8) {
19257        let offset = Self::POIW_SHIFT;
19258        assert!(value & (Self::POIW_MASK as u8) == value);
19259        *self = Self::from_bits_retain(
19260            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
19261        );
19262    }
19263
19264    /// Returns the value of the `VTB0` field.
19265    pub const fn vtb0(self) -> u8 {
19266        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
19267    }
19268
19269    /// Sets the value of the `VTB0` field.
19270    pub const fn set_vtb0(&mut self, value: u8) {
19271        let offset = Self::VTB0_SHIFT;
19272        assert!(value & (Self::VTB0_MASK as u8) == value);
19273        *self = Self::from_bits_retain(
19274            (self.bits() & !(Self::VTB0_MASK << offset)) | ((value as u64) << offset),
19275        );
19276    }
19277
19278    /// Returns the value of the `VTB1` field.
19279    pub const fn vtb1(self) -> u8 {
19280        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
19281    }
19282
19283    /// Sets the value of the `VTB1` field.
19284    pub const fn set_vtb1(&mut self, value: u8) {
19285        let offset = Self::VTB1_SHIFT;
19286        assert!(value & (Self::VTB1_MASK as u8) == value);
19287        *self = Self::from_bits_retain(
19288            (self.bits() & !(Self::VTB1_MASK << offset)) | ((value as u64) << offset),
19289        );
19290    }
19291}
19292
19293#[cfg(feature = "el2")]
19294bitflags! {
19295    /// `TCR2_EL2` system register value.
19296    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19297    #[repr(transparent)]
19298    pub struct Tcr2El2: u64 {
19299        /// `PnCH` bit.
19300        const PNCH = 1 << 0;
19301        /// `PIE` bit.
19302        const PIE = 1 << 1;
19303        /// `E0POE` bit.
19304        const E0POE = 1 << 2;
19305        /// `POE` bit.
19306        const POE = 1 << 3;
19307        /// `AIE` bit.
19308        const AIE = 1 << 4;
19309        /// `D128` bit.
19310        const D128 = 1 << 5;
19311        /// `PTTWI` bit.
19312        const PTTWI = 1 << 10;
19313        /// `HAFT` bit.
19314        const HAFT = 1 << 11;
19315        /// `AMEC0` bit.
19316        const AMEC0 = 1 << 12;
19317        /// `AMEC1` bit.
19318        const AMEC1 = 1 << 13;
19319        /// `DisCH0` bit.
19320        const DISCH0 = 1 << 14;
19321        /// `DisCH1` bit.
19322        const DISCH1 = 1 << 15;
19323        /// `A2` bit.
19324        const A2 = 1 << 16;
19325        /// `FNG0` bit.
19326        const FNG0 = 1 << 17;
19327        /// `FNG1` bit.
19328        const FNG1 = 1 << 18;
19329        /// `POE2F` bit.
19330        const POE2F = 1 << 19;
19331        /// `TVAD0` bit.
19332        const TVAD0 = 1 << 35;
19333        /// `TVAD1` bit.
19334        const TVAD1 = 1 << 36;
19335    }
19336}
19337
19338#[cfg(feature = "el2")]
19339impl Tcr2El2 {
19340    /// Offset of the `PnCH` field.
19341    pub const PNCH_SHIFT: u32 = 0;
19342    /// Offset of the `PIE` field.
19343    pub const PIE_SHIFT: u32 = 1;
19344    /// Offset of the `E0POE` field.
19345    pub const E0POE_SHIFT: u32 = 2;
19346    /// Offset of the `POE` field.
19347    pub const POE_SHIFT: u32 = 3;
19348    /// Offset of the `AIE` field.
19349    pub const AIE_SHIFT: u32 = 4;
19350    /// Offset of the `D128` field.
19351    pub const D128_SHIFT: u32 = 5;
19352    /// Offset of the `PTTWI` field.
19353    pub const PTTWI_SHIFT: u32 = 10;
19354    /// Offset of the `HAFT` field.
19355    pub const HAFT_SHIFT: u32 = 11;
19356    /// Offset of the `AMEC0` field.
19357    pub const AMEC0_SHIFT: u32 = 12;
19358    /// Offset of the `AMEC1` field.
19359    pub const AMEC1_SHIFT: u32 = 13;
19360    /// Offset of the `DisCH0` field.
19361    pub const DISCH0_SHIFT: u32 = 14;
19362    /// Offset of the `DisCH1` field.
19363    pub const DISCH1_SHIFT: u32 = 15;
19364    /// Offset of the `A2` field.
19365    pub const A2_SHIFT: u32 = 16;
19366    /// Offset of the `FNG0` field.
19367    pub const FNG0_SHIFT: u32 = 17;
19368    /// Offset of the `FNG1` field.
19369    pub const FNG1_SHIFT: u32 = 18;
19370    /// Offset of the `POE2F` field.
19371    pub const POE2F_SHIFT: u32 = 19;
19372    /// Offset of the `POIW` field.
19373    pub const POIW_SHIFT: u32 = 22;
19374    /// Mask for the `POIW` field.
19375    pub const POIW_MASK: u64 = 0b111;
19376    /// Offset of the `VTB0` field.
19377    pub const VTB0_SHIFT: u32 = 25;
19378    /// Mask for the `VTB0` field.
19379    pub const VTB0_MASK: u64 = 0b11111;
19380    /// Offset of the `VTB1` field.
19381    pub const VTB1_SHIFT: u32 = 30;
19382    /// Mask for the `VTB1` field.
19383    pub const VTB1_MASK: u64 = 0b11111;
19384    /// Offset of the `TVAD0` field.
19385    pub const TVAD0_SHIFT: u32 = 35;
19386    /// Offset of the `TVAD1` field.
19387    pub const TVAD1_SHIFT: u32 = 36;
19388
19389    /// Returns the value of the `POIW` field.
19390    pub const fn poiw(self) -> u8 {
19391        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
19392    }
19393
19394    /// Sets the value of the `POIW` field.
19395    pub const fn set_poiw(&mut self, value: u8) {
19396        let offset = Self::POIW_SHIFT;
19397        assert!(value & (Self::POIW_MASK as u8) == value);
19398        *self = Self::from_bits_retain(
19399            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
19400        );
19401    }
19402
19403    /// Returns the value of the `VTB0` field.
19404    pub const fn vtb0(self) -> u8 {
19405        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
19406    }
19407
19408    /// Sets the value of the `VTB0` field.
19409    pub const fn set_vtb0(&mut self, value: u8) {
19410        let offset = Self::VTB0_SHIFT;
19411        assert!(value & (Self::VTB0_MASK as u8) == value);
19412        *self = Self::from_bits_retain(
19413            (self.bits() & !(Self::VTB0_MASK << offset)) | ((value as u64) << offset),
19414        );
19415    }
19416
19417    /// Returns the value of the `VTB1` field.
19418    pub const fn vtb1(self) -> u8 {
19419        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
19420    }
19421
19422    /// Sets the value of the `VTB1` field.
19423    pub const fn set_vtb1(&mut self, value: u8) {
19424        let offset = Self::VTB1_SHIFT;
19425        assert!(value & (Self::VTB1_MASK as u8) == value);
19426        *self = Self::from_bits_retain(
19427            (self.bits() & !(Self::VTB1_MASK << offset)) | ((value as u64) << offset),
19428        );
19429    }
19430}
19431
19432#[cfg(feature = "el1")]
19433bitflags! {
19434    /// `TCR_EL1` system register value.
19435    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19436    #[repr(transparent)]
19437    pub struct TcrEl1: u64 {
19438        /// `EPD0` bit.
19439        const EPD0 = 1 << 7;
19440        /// `A1` bit.
19441        const A1 = 1 << 22;
19442        /// `EPD1` bit.
19443        const EPD1 = 1 << 23;
19444        /// `AS` bit.
19445        const AS = 1 << 36;
19446        /// `TBI0` bit.
19447        const TBI0 = 1 << 37;
19448        /// `TBI1` bit.
19449        const TBI1 = 1 << 38;
19450        /// `HA` bit.
19451        const HA = 1 << 39;
19452        /// `HD` bit.
19453        const HD = 1 << 40;
19454        /// `HPD0` bit.
19455        const HPD0 = 1 << 41;
19456        /// `HPD1` bit.
19457        const HPD1 = 1 << 42;
19458        /// `HWU059` bit.
19459        const HWU059 = 1 << 43;
19460        /// `HWU060` bit.
19461        const HWU060 = 1 << 44;
19462        /// `HWU061` bit.
19463        const HWU061 = 1 << 45;
19464        /// `HWU062` bit.
19465        const HWU062 = 1 << 46;
19466        /// `HWU159` bit.
19467        const HWU159 = 1 << 47;
19468        /// `HWU160` bit.
19469        const HWU160 = 1 << 48;
19470        /// `HWU161` bit.
19471        const HWU161 = 1 << 49;
19472        /// `HWU162` bit.
19473        const HWU162 = 1 << 50;
19474        /// `TBID0` bit.
19475        const TBID0 = 1 << 51;
19476        /// `TBID1` bit.
19477        const TBID1 = 1 << 52;
19478        /// `NFD0` bit.
19479        const NFD0 = 1 << 53;
19480        /// `NFD1` bit.
19481        const NFD1 = 1 << 54;
19482        /// `E0PD0` bit.
19483        const E0PD0 = 1 << 55;
19484        /// `E0PD1` bit.
19485        const E0PD1 = 1 << 56;
19486        /// `TCMA0` bit.
19487        const TCMA0 = 1 << 57;
19488        /// `TCMA1` bit.
19489        const TCMA1 = 1 << 58;
19490        /// `DS` bit.
19491        const DS = 1 << 59;
19492        /// `MTX0` bit.
19493        const MTX0 = 1 << 60;
19494        /// `MTX1` bit.
19495        const MTX1 = 1 << 61;
19496    }
19497}
19498
19499#[cfg(feature = "el1")]
19500impl TcrEl1 {
19501    /// Offset of the `T0SZ` field.
19502    pub const T0SZ_SHIFT: u32 = 0;
19503    /// Mask for the `T0SZ` field.
19504    pub const T0SZ_MASK: u64 = 0b111111;
19505    /// Offset of the `EPD0` field.
19506    pub const EPD0_SHIFT: u32 = 7;
19507    /// Offset of the `IRGN0` field.
19508    pub const IRGN0_SHIFT: u32 = 8;
19509    /// Mask for the `IRGN0` field.
19510    pub const IRGN0_MASK: u64 = 0b11;
19511    /// Offset of the `ORGN0` field.
19512    pub const ORGN0_SHIFT: u32 = 10;
19513    /// Mask for the `ORGN0` field.
19514    pub const ORGN0_MASK: u64 = 0b11;
19515    /// Offset of the `SH0` field.
19516    pub const SH0_SHIFT: u32 = 12;
19517    /// Mask for the `SH0` field.
19518    pub const SH0_MASK: u64 = 0b11;
19519    /// Offset of the `TG0` field.
19520    pub const TG0_SHIFT: u32 = 14;
19521    /// Mask for the `TG0` field.
19522    pub const TG0_MASK: u64 = 0b11;
19523    /// Offset of the `T1SZ` field.
19524    pub const T1SZ_SHIFT: u32 = 16;
19525    /// Mask for the `T1SZ` field.
19526    pub const T1SZ_MASK: u64 = 0b111111;
19527    /// Offset of the `A1` field.
19528    pub const A1_SHIFT: u32 = 22;
19529    /// Offset of the `EPD1` field.
19530    pub const EPD1_SHIFT: u32 = 23;
19531    /// Offset of the `IRGN1` field.
19532    pub const IRGN1_SHIFT: u32 = 24;
19533    /// Mask for the `IRGN1` field.
19534    pub const IRGN1_MASK: u64 = 0b11;
19535    /// Offset of the `ORGN1` field.
19536    pub const ORGN1_SHIFT: u32 = 26;
19537    /// Mask for the `ORGN1` field.
19538    pub const ORGN1_MASK: u64 = 0b11;
19539    /// Offset of the `SH1` field.
19540    pub const SH1_SHIFT: u32 = 28;
19541    /// Mask for the `SH1` field.
19542    pub const SH1_MASK: u64 = 0b11;
19543    /// Offset of the `TG1` field.
19544    pub const TG1_SHIFT: u32 = 30;
19545    /// Mask for the `TG1` field.
19546    pub const TG1_MASK: u64 = 0b11;
19547    /// Offset of the `IPS` field.
19548    pub const IPS_SHIFT: u32 = 32;
19549    /// Mask for the `IPS` field.
19550    pub const IPS_MASK: u64 = 0b111;
19551    /// Offset of the `AS` field.
19552    pub const AS_SHIFT: u32 = 36;
19553    /// Offset of the `TBI0` field.
19554    pub const TBI0_SHIFT: u32 = 37;
19555    /// Offset of the `TBI1` field.
19556    pub const TBI1_SHIFT: u32 = 38;
19557    /// Offset of the `HA` field.
19558    pub const HA_SHIFT: u32 = 39;
19559    /// Offset of the `HD` field.
19560    pub const HD_SHIFT: u32 = 40;
19561    /// Offset of the `HPD0` field.
19562    pub const HPD0_SHIFT: u32 = 41;
19563    /// Offset of the `HPD1` field.
19564    pub const HPD1_SHIFT: u32 = 42;
19565    /// Offset of the `HWU059` field.
19566    pub const HWU059_SHIFT: u32 = 43;
19567    /// Offset of the `HWU060` field.
19568    pub const HWU060_SHIFT: u32 = 44;
19569    /// Offset of the `HWU061` field.
19570    pub const HWU061_SHIFT: u32 = 45;
19571    /// Offset of the `HWU062` field.
19572    pub const HWU062_SHIFT: u32 = 46;
19573    /// Offset of the `HWU159` field.
19574    pub const HWU159_SHIFT: u32 = 47;
19575    /// Offset of the `HWU160` field.
19576    pub const HWU160_SHIFT: u32 = 48;
19577    /// Offset of the `HWU161` field.
19578    pub const HWU161_SHIFT: u32 = 49;
19579    /// Offset of the `HWU162` field.
19580    pub const HWU162_SHIFT: u32 = 50;
19581    /// Offset of the `TBID0` field.
19582    pub const TBID0_SHIFT: u32 = 51;
19583    /// Offset of the `TBID1` field.
19584    pub const TBID1_SHIFT: u32 = 52;
19585    /// Offset of the `NFD0` field.
19586    pub const NFD0_SHIFT: u32 = 53;
19587    /// Offset of the `NFD1` field.
19588    pub const NFD1_SHIFT: u32 = 54;
19589    /// Offset of the `E0PD0` field.
19590    pub const E0PD0_SHIFT: u32 = 55;
19591    /// Offset of the `E0PD1` field.
19592    pub const E0PD1_SHIFT: u32 = 56;
19593    /// Offset of the `TCMA0` field.
19594    pub const TCMA0_SHIFT: u32 = 57;
19595    /// Offset of the `TCMA1` field.
19596    pub const TCMA1_SHIFT: u32 = 58;
19597    /// Offset of the `DS` field.
19598    pub const DS_SHIFT: u32 = 59;
19599    /// Offset of the `MTX0` field.
19600    pub const MTX0_SHIFT: u32 = 60;
19601    /// Offset of the `MTX1` field.
19602    pub const MTX1_SHIFT: u32 = 61;
19603
19604    /// Returns the value of the `T0SZ` field.
19605    pub const fn t0sz(self) -> u8 {
19606        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
19607    }
19608
19609    /// Sets the value of the `T0SZ` field.
19610    pub const fn set_t0sz(&mut self, value: u8) {
19611        let offset = Self::T0SZ_SHIFT;
19612        assert!(value & (Self::T0SZ_MASK as u8) == value);
19613        *self = Self::from_bits_retain(
19614            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
19615        );
19616    }
19617
19618    /// Returns the value of the `IRGN0` field.
19619    pub const fn irgn0(self) -> u8 {
19620        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
19621    }
19622
19623    /// Sets the value of the `IRGN0` field.
19624    pub const fn set_irgn0(&mut self, value: u8) {
19625        let offset = Self::IRGN0_SHIFT;
19626        assert!(value & (Self::IRGN0_MASK as u8) == value);
19627        *self = Self::from_bits_retain(
19628            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
19629        );
19630    }
19631
19632    /// Returns the value of the `ORGN0` field.
19633    pub const fn orgn0(self) -> u8 {
19634        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
19635    }
19636
19637    /// Sets the value of the `ORGN0` field.
19638    pub const fn set_orgn0(&mut self, value: u8) {
19639        let offset = Self::ORGN0_SHIFT;
19640        assert!(value & (Self::ORGN0_MASK as u8) == value);
19641        *self = Self::from_bits_retain(
19642            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
19643        );
19644    }
19645
19646    /// Returns the value of the `SH0` field.
19647    pub const fn sh0(self) -> u8 {
19648        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
19649    }
19650
19651    /// Sets the value of the `SH0` field.
19652    pub const fn set_sh0(&mut self, value: u8) {
19653        let offset = Self::SH0_SHIFT;
19654        assert!(value & (Self::SH0_MASK as u8) == value);
19655        *self = Self::from_bits_retain(
19656            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
19657        );
19658    }
19659
19660    /// Returns the value of the `TG0` field.
19661    pub const fn tg0(self) -> u8 {
19662        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
19663    }
19664
19665    /// Sets the value of the `TG0` field.
19666    pub const fn set_tg0(&mut self, value: u8) {
19667        let offset = Self::TG0_SHIFT;
19668        assert!(value & (Self::TG0_MASK as u8) == value);
19669        *self = Self::from_bits_retain(
19670            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
19671        );
19672    }
19673
19674    /// Returns the value of the `T1SZ` field.
19675    pub const fn t1sz(self) -> u8 {
19676        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
19677    }
19678
19679    /// Sets the value of the `T1SZ` field.
19680    pub const fn set_t1sz(&mut self, value: u8) {
19681        let offset = Self::T1SZ_SHIFT;
19682        assert!(value & (Self::T1SZ_MASK as u8) == value);
19683        *self = Self::from_bits_retain(
19684            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u64) << offset),
19685        );
19686    }
19687
19688    /// Returns the value of the `IRGN1` field.
19689    pub const fn irgn1(self) -> u8 {
19690        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
19691    }
19692
19693    /// Sets the value of the `IRGN1` field.
19694    pub const fn set_irgn1(&mut self, value: u8) {
19695        let offset = Self::IRGN1_SHIFT;
19696        assert!(value & (Self::IRGN1_MASK as u8) == value);
19697        *self = Self::from_bits_retain(
19698            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u64) << offset),
19699        );
19700    }
19701
19702    /// Returns the value of the `ORGN1` field.
19703    pub const fn orgn1(self) -> u8 {
19704        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
19705    }
19706
19707    /// Sets the value of the `ORGN1` field.
19708    pub const fn set_orgn1(&mut self, value: u8) {
19709        let offset = Self::ORGN1_SHIFT;
19710        assert!(value & (Self::ORGN1_MASK as u8) == value);
19711        *self = Self::from_bits_retain(
19712            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u64) << offset),
19713        );
19714    }
19715
19716    /// Returns the value of the `SH1` field.
19717    pub const fn sh1(self) -> u8 {
19718        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
19719    }
19720
19721    /// Sets the value of the `SH1` field.
19722    pub const fn set_sh1(&mut self, value: u8) {
19723        let offset = Self::SH1_SHIFT;
19724        assert!(value & (Self::SH1_MASK as u8) == value);
19725        *self = Self::from_bits_retain(
19726            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u64) << offset),
19727        );
19728    }
19729
19730    /// Returns the value of the `TG1` field.
19731    pub const fn tg1(self) -> u8 {
19732        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
19733    }
19734
19735    /// Sets the value of the `TG1` field.
19736    pub const fn set_tg1(&mut self, value: u8) {
19737        let offset = Self::TG1_SHIFT;
19738        assert!(value & (Self::TG1_MASK as u8) == value);
19739        *self = Self::from_bits_retain(
19740            (self.bits() & !(Self::TG1_MASK << offset)) | ((value as u64) << offset),
19741        );
19742    }
19743
19744    /// Returns the value of the `IPS` field.
19745    pub const fn ips(self) -> u8 {
19746        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
19747    }
19748
19749    /// Sets the value of the `IPS` field.
19750    pub const fn set_ips(&mut self, value: u8) {
19751        let offset = Self::IPS_SHIFT;
19752        assert!(value & (Self::IPS_MASK as u8) == value);
19753        *self = Self::from_bits_retain(
19754            (self.bits() & !(Self::IPS_MASK << offset)) | ((value as u64) << offset),
19755        );
19756    }
19757}
19758
19759#[cfg(feature = "el2")]
19760bitflags! {
19761    /// `TCR_EL2` system register value.
19762    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19763    #[repr(transparent)]
19764    pub struct TcrEl2: u64 {
19765        /// RES1 bits in the `TCR_EL2` register.
19766        const RES1 = 0b10000000100000000000000000000000;
19767        /// `EPD0` bit.
19768        const EPD0 = 1 << 7;
19769        /// `TBI` bit.
19770        const TBI = 1 << 20;
19771        /// `A1` bit.
19772        const A1 = 1 << 22;
19773        /// `EPD1` bit.
19774        const EPD1 = 1 << 23;
19775        /// `HPD` bit.
19776        const HPD = 1 << 24;
19777        /// `HWU59` bit.
19778        const HWU59 = 1 << 25;
19779        /// `HWU60` bit.
19780        const HWU60 = 1 << 26;
19781        /// `HWU61` bit.
19782        const HWU61 = 1 << 27;
19783        /// `HWU62` bit.
19784        const HWU62 = 1 << 28;
19785        /// `TBID` bit.
19786        const TBID = 1 << 29;
19787        /// `TCMA` bit.
19788        const TCMA = 1 << 30;
19789        /// `MTX` bit.
19790        const MTX = 1 << 33;
19791        /// `AS` bit.
19792        const AS = 1 << 36;
19793        /// `TBI0` bit.
19794        const TBI0 = 1 << 37;
19795        /// `TBI1` bit.
19796        const TBI1 = 1 << 38;
19797        /// `HPD0` bit.
19798        const HPD0 = 1 << 41;
19799        /// `HPD1` bit.
19800        const HPD1 = 1 << 42;
19801        /// `HWU059` bit.
19802        const HWU059 = 1 << 43;
19803        /// `HWU060` bit.
19804        const HWU060 = 1 << 44;
19805        /// `HWU061` bit.
19806        const HWU061 = 1 << 45;
19807        /// `HWU062` bit.
19808        const HWU062 = 1 << 46;
19809        /// `HWU159` bit.
19810        const HWU159 = 1 << 47;
19811        /// `HWU160` bit.
19812        const HWU160 = 1 << 48;
19813        /// `HWU161` bit.
19814        const HWU161 = 1 << 49;
19815        /// `HWU162` bit.
19816        const HWU162 = 1 << 50;
19817        /// `TBID0` bit.
19818        const TBID0 = 1 << 51;
19819        /// `TBID1` bit.
19820        const TBID1 = 1 << 52;
19821        /// `NFD0` bit.
19822        const NFD0 = 1 << 53;
19823        /// `TVAD` bit.
19824        const TVAD = 1 << 53;
19825        /// `NFD1` bit.
19826        const NFD1 = 1 << 54;
19827        /// `E0PD0` bit.
19828        const E0PD0 = 1 << 55;
19829        /// `E0PD1` bit.
19830        const E0PD1 = 1 << 56;
19831        /// `TCMA0` bit.
19832        const TCMA0 = 1 << 57;
19833        /// `TCMA1` bit.
19834        const TCMA1 = 1 << 58;
19835        /// `MTX0` bit.
19836        const MTX0 = 1 << 60;
19837        /// `MTX1` bit.
19838        const MTX1 = 1 << 61;
19839    }
19840}
19841
19842#[cfg(feature = "el2")]
19843impl TcrEl2 {
19844    /// Offset of the `T0SZ` field.
19845    pub const T0SZ_SHIFT: u32 = 0;
19846    /// Mask for the `T0SZ` field.
19847    pub const T0SZ_MASK: u64 = 0b111111;
19848    /// Offset of the `EPD0` field.
19849    pub const EPD0_SHIFT: u32 = 7;
19850    /// Offset of the `IRGN0` field.
19851    pub const IRGN0_SHIFT: u32 = 8;
19852    /// Mask for the `IRGN0` field.
19853    pub const IRGN0_MASK: u64 = 0b11;
19854    /// Offset of the `ORGN0` field.
19855    pub const ORGN0_SHIFT: u32 = 10;
19856    /// Mask for the `ORGN0` field.
19857    pub const ORGN0_MASK: u64 = 0b11;
19858    /// Offset of the `SH0` field.
19859    pub const SH0_SHIFT: u32 = 12;
19860    /// Mask for the `SH0` field.
19861    pub const SH0_MASK: u64 = 0b11;
19862    /// Offset of the `TG0` field.
19863    pub const TG0_SHIFT: u32 = 14;
19864    /// Mask for the `TG0` field.
19865    pub const TG0_MASK: u64 = 0b11;
19866    /// Offset of the `PS` field.
19867    pub const PS_SHIFT: u32 = 16;
19868    /// Mask for the `PS` field.
19869    pub const PS_MASK: u64 = 0b111;
19870    /// Offset of the `T1SZ` field.
19871    pub const T1SZ_SHIFT: u32 = 16;
19872    /// Mask for the `T1SZ` field.
19873    pub const T1SZ_MASK: u64 = 0b111111;
19874    /// Offset of the `TBI` field.
19875    pub const TBI_SHIFT: u32 = 20;
19876    /// Offset of the `A1` field.
19877    pub const A1_SHIFT: u32 = 22;
19878    /// Offset of the `EPD1` field.
19879    pub const EPD1_SHIFT: u32 = 23;
19880    /// Offset of the `HPD` field.
19881    pub const HPD_SHIFT: u32 = 24;
19882    /// Offset of the `IRGN1` field.
19883    pub const IRGN1_SHIFT: u32 = 24;
19884    /// Mask for the `IRGN1` field.
19885    pub const IRGN1_MASK: u64 = 0b11;
19886    /// Offset of the `HWU59` field.
19887    pub const HWU59_SHIFT: u32 = 25;
19888    /// Offset of the `HWU60` field.
19889    pub const HWU60_SHIFT: u32 = 26;
19890    /// Offset of the `ORGN1` field.
19891    pub const ORGN1_SHIFT: u32 = 26;
19892    /// Mask for the `ORGN1` field.
19893    pub const ORGN1_MASK: u64 = 0b11;
19894    /// Offset of the `HWU61` field.
19895    pub const HWU61_SHIFT: u32 = 27;
19896    /// Offset of the `HWU62` field.
19897    pub const HWU62_SHIFT: u32 = 28;
19898    /// Offset of the `SH1` field.
19899    pub const SH1_SHIFT: u32 = 28;
19900    /// Mask for the `SH1` field.
19901    pub const SH1_MASK: u64 = 0b11;
19902    /// Offset of the `TBID` field.
19903    pub const TBID_SHIFT: u32 = 29;
19904    /// Offset of the `TCMA` field.
19905    pub const TCMA_SHIFT: u32 = 30;
19906    /// Offset of the `TG1` field.
19907    pub const TG1_SHIFT: u32 = 30;
19908    /// Mask for the `TG1` field.
19909    pub const TG1_MASK: u64 = 0b11;
19910    /// Offset of the `IPS` field.
19911    pub const IPS_SHIFT: u32 = 32;
19912    /// Mask for the `IPS` field.
19913    pub const IPS_MASK: u64 = 0b111;
19914    /// Offset of the `MTX` field.
19915    pub const MTX_SHIFT: u32 = 33;
19916    /// Offset of the `AS` field.
19917    pub const AS_SHIFT: u32 = 36;
19918    /// Offset of the `TBI0` field.
19919    pub const TBI0_SHIFT: u32 = 37;
19920    /// Offset of the `TBI1` field.
19921    pub const TBI1_SHIFT: u32 = 38;
19922    /// Offset of the `HPD0` field.
19923    pub const HPD0_SHIFT: u32 = 41;
19924    /// Offset of the `HPD1` field.
19925    pub const HPD1_SHIFT: u32 = 42;
19926    /// Offset of the `HWU059` field.
19927    pub const HWU059_SHIFT: u32 = 43;
19928    /// Offset of the `HWU060` field.
19929    pub const HWU060_SHIFT: u32 = 44;
19930    /// Offset of the `HWU061` field.
19931    pub const HWU061_SHIFT: u32 = 45;
19932    /// Offset of the `HWU062` field.
19933    pub const HWU062_SHIFT: u32 = 46;
19934    /// Offset of the `HWU159` field.
19935    pub const HWU159_SHIFT: u32 = 47;
19936    /// Offset of the `HWU160` field.
19937    pub const HWU160_SHIFT: u32 = 48;
19938    /// Offset of the `VTB` field.
19939    pub const VTB_SHIFT: u32 = 48;
19940    /// Mask for the `VTB` field.
19941    pub const VTB_MASK: u64 = 0b11111;
19942    /// Offset of the `HWU161` field.
19943    pub const HWU161_SHIFT: u32 = 49;
19944    /// Offset of the `HWU162` field.
19945    pub const HWU162_SHIFT: u32 = 50;
19946    /// Offset of the `TBID0` field.
19947    pub const TBID0_SHIFT: u32 = 51;
19948    /// Offset of the `TBID1` field.
19949    pub const TBID1_SHIFT: u32 = 52;
19950    /// Offset of the `NFD0` field.
19951    pub const NFD0_SHIFT: u32 = 53;
19952    /// Offset of the `TVAD` field.
19953    pub const TVAD_SHIFT: u32 = 53;
19954    /// Offset of the `NFD1` field.
19955    pub const NFD1_SHIFT: u32 = 54;
19956    /// Offset of the `E0PD0` field.
19957    pub const E0PD0_SHIFT: u32 = 55;
19958    /// Offset of the `E0PD1` field.
19959    pub const E0PD1_SHIFT: u32 = 56;
19960    /// Offset of the `TCMA0` field.
19961    pub const TCMA0_SHIFT: u32 = 57;
19962    /// Offset of the `TCMA1` field.
19963    pub const TCMA1_SHIFT: u32 = 58;
19964    /// Offset of the `MTX0` field.
19965    pub const MTX0_SHIFT: u32 = 60;
19966    /// Offset of the `MTX1` field.
19967    pub const MTX1_SHIFT: u32 = 61;
19968
19969    /// Returns the value of the `T0SZ` field.
19970    pub const fn t0sz(self) -> u8 {
19971        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
19972    }
19973
19974    /// Sets the value of the `T0SZ` field.
19975    pub const fn set_t0sz(&mut self, value: u8) {
19976        let offset = Self::T0SZ_SHIFT;
19977        assert!(value & (Self::T0SZ_MASK as u8) == value);
19978        *self = Self::from_bits_retain(
19979            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
19980        );
19981    }
19982
19983    /// Returns the value of the `IRGN0` field.
19984    pub const fn irgn0(self) -> u8 {
19985        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
19986    }
19987
19988    /// Sets the value of the `IRGN0` field.
19989    pub const fn set_irgn0(&mut self, value: u8) {
19990        let offset = Self::IRGN0_SHIFT;
19991        assert!(value & (Self::IRGN0_MASK as u8) == value);
19992        *self = Self::from_bits_retain(
19993            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
19994        );
19995    }
19996
19997    /// Returns the value of the `ORGN0` field.
19998    pub const fn orgn0(self) -> u8 {
19999        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
20000    }
20001
20002    /// Sets the value of the `ORGN0` field.
20003    pub const fn set_orgn0(&mut self, value: u8) {
20004        let offset = Self::ORGN0_SHIFT;
20005        assert!(value & (Self::ORGN0_MASK as u8) == value);
20006        *self = Self::from_bits_retain(
20007            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
20008        );
20009    }
20010
20011    /// Returns the value of the `SH0` field.
20012    pub const fn sh0(self) -> u8 {
20013        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
20014    }
20015
20016    /// Sets the value of the `SH0` field.
20017    pub const fn set_sh0(&mut self, value: u8) {
20018        let offset = Self::SH0_SHIFT;
20019        assert!(value & (Self::SH0_MASK as u8) == value);
20020        *self = Self::from_bits_retain(
20021            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
20022        );
20023    }
20024
20025    /// Returns the value of the `TG0` field.
20026    pub const fn tg0(self) -> u8 {
20027        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
20028    }
20029
20030    /// Sets the value of the `TG0` field.
20031    pub const fn set_tg0(&mut self, value: u8) {
20032        let offset = Self::TG0_SHIFT;
20033        assert!(value & (Self::TG0_MASK as u8) == value);
20034        *self = Self::from_bits_retain(
20035            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
20036        );
20037    }
20038
20039    /// Returns the value of the `PS` field.
20040    pub const fn ps(self) -> u8 {
20041        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
20042    }
20043
20044    /// Sets the value of the `PS` field.
20045    pub const fn set_ps(&mut self, value: u8) {
20046        let offset = Self::PS_SHIFT;
20047        assert!(value & (Self::PS_MASK as u8) == value);
20048        *self = Self::from_bits_retain(
20049            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
20050        );
20051    }
20052
20053    /// Returns the value of the `T1SZ` field.
20054    pub const fn t1sz(self) -> u8 {
20055        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
20056    }
20057
20058    /// Sets the value of the `T1SZ` field.
20059    pub const fn set_t1sz(&mut self, value: u8) {
20060        let offset = Self::T1SZ_SHIFT;
20061        assert!(value & (Self::T1SZ_MASK as u8) == value);
20062        *self = Self::from_bits_retain(
20063            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u64) << offset),
20064        );
20065    }
20066
20067    /// Returns the value of the `IRGN1` field.
20068    pub const fn irgn1(self) -> u8 {
20069        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
20070    }
20071
20072    /// Sets the value of the `IRGN1` field.
20073    pub const fn set_irgn1(&mut self, value: u8) {
20074        let offset = Self::IRGN1_SHIFT;
20075        assert!(value & (Self::IRGN1_MASK as u8) == value);
20076        *self = Self::from_bits_retain(
20077            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u64) << offset),
20078        );
20079    }
20080
20081    /// Returns the value of the `ORGN1` field.
20082    pub const fn orgn1(self) -> u8 {
20083        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
20084    }
20085
20086    /// Sets the value of the `ORGN1` field.
20087    pub const fn set_orgn1(&mut self, value: u8) {
20088        let offset = Self::ORGN1_SHIFT;
20089        assert!(value & (Self::ORGN1_MASK as u8) == value);
20090        *self = Self::from_bits_retain(
20091            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u64) << offset),
20092        );
20093    }
20094
20095    /// Returns the value of the `SH1` field.
20096    pub const fn sh1(self) -> u8 {
20097        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
20098    }
20099
20100    /// Sets the value of the `SH1` field.
20101    pub const fn set_sh1(&mut self, value: u8) {
20102        let offset = Self::SH1_SHIFT;
20103        assert!(value & (Self::SH1_MASK as u8) == value);
20104        *self = Self::from_bits_retain(
20105            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u64) << offset),
20106        );
20107    }
20108
20109    /// Returns the value of the `TG1` field.
20110    pub const fn tg1(self) -> u8 {
20111        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
20112    }
20113
20114    /// Sets the value of the `TG1` field.
20115    pub const fn set_tg1(&mut self, value: u8) {
20116        let offset = Self::TG1_SHIFT;
20117        assert!(value & (Self::TG1_MASK as u8) == value);
20118        *self = Self::from_bits_retain(
20119            (self.bits() & !(Self::TG1_MASK << offset)) | ((value as u64) << offset),
20120        );
20121    }
20122
20123    /// Returns the value of the `IPS` field.
20124    pub const fn ips(self) -> u8 {
20125        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
20126    }
20127
20128    /// Sets the value of the `IPS` field.
20129    pub const fn set_ips(&mut self, value: u8) {
20130        let offset = Self::IPS_SHIFT;
20131        assert!(value & (Self::IPS_MASK as u8) == value);
20132        *self = Self::from_bits_retain(
20133            (self.bits() & !(Self::IPS_MASK << offset)) | ((value as u64) << offset),
20134        );
20135    }
20136
20137    /// Returns the value of the `VTB` field.
20138    pub const fn vtb(self) -> u8 {
20139        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
20140    }
20141
20142    /// Sets the value of the `VTB` field.
20143    pub const fn set_vtb(&mut self, value: u8) {
20144        let offset = Self::VTB_SHIFT;
20145        assert!(value & (Self::VTB_MASK as u8) == value);
20146        *self = Self::from_bits_retain(
20147            (self.bits() & !(Self::VTB_MASK << offset)) | ((value as u64) << offset),
20148        );
20149    }
20150}
20151
20152#[cfg(feature = "el3")]
20153bitflags! {
20154    /// `TCR_EL3` system register value.
20155    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20156    #[repr(transparent)]
20157    pub struct TcrEl3: u64 {
20158        /// RES1 bits in the `TCR_EL3` register.
20159        const RES1 = 0b10000000100000000000000000000000;
20160        /// `TBI` bit.
20161        const TBI = 1 << 20;
20162        /// `HA` bit.
20163        const HA = 1 << 21;
20164        /// `HD` bit.
20165        const HD = 1 << 22;
20166        /// `HPD` bit.
20167        const HPD = 1 << 24;
20168        /// `HWU59` bit.
20169        const HWU59 = 1 << 25;
20170        /// `HWU60` bit.
20171        const HWU60 = 1 << 26;
20172        /// `HWU61` bit.
20173        const HWU61 = 1 << 27;
20174        /// `HWU62` bit.
20175        const HWU62 = 1 << 28;
20176        /// `TBID` bit.
20177        const TBID = 1 << 29;
20178        /// `TCMA` bit.
20179        const TCMA = 1 << 30;
20180        /// `DS` bit.
20181        const DS = 1 << 32;
20182        /// `MTX` bit.
20183        const MTX = 1 << 33;
20184        /// `PnCH` bit.
20185        const PNCH = 1 << 34;
20186        /// `PIE` bit.
20187        const PIE = 1 << 35;
20188        /// `POE` bit.
20189        const POE = 1 << 36;
20190        /// `AIE` bit.
20191        const AIE = 1 << 37;
20192        /// `D128` bit.
20193        const D128 = 1 << 38;
20194        /// `PTTWI` bit.
20195        const PTTWI = 1 << 41;
20196        /// `HAFT` bit.
20197        const HAFT = 1 << 42;
20198        /// `DisCH0` bit.
20199        const DISCH0 = 1 << 43;
20200        /// `POE2F` bit.
20201        const POE2F = 1 << 44;
20202        /// `TVAD` bit.
20203        const TVAD = 1 << 53;
20204    }
20205}
20206
20207#[cfg(feature = "el3")]
20208impl TcrEl3 {
20209    /// Offset of the `T0SZ` field.
20210    pub const T0SZ_SHIFT: u32 = 0;
20211    /// Mask for the `T0SZ` field.
20212    pub const T0SZ_MASK: u64 = 0b111111;
20213    /// Offset of the `IRGN0` field.
20214    pub const IRGN0_SHIFT: u32 = 8;
20215    /// Mask for the `IRGN0` field.
20216    pub const IRGN0_MASK: u64 = 0b11;
20217    /// Offset of the `ORGN0` field.
20218    pub const ORGN0_SHIFT: u32 = 10;
20219    /// Mask for the `ORGN0` field.
20220    pub const ORGN0_MASK: u64 = 0b11;
20221    /// Offset of the `SH0` field.
20222    pub const SH0_SHIFT: u32 = 12;
20223    /// Mask for the `SH0` field.
20224    pub const SH0_MASK: u64 = 0b11;
20225    /// Offset of the `TG0` field.
20226    pub const TG0_SHIFT: u32 = 14;
20227    /// Mask for the `TG0` field.
20228    pub const TG0_MASK: u64 = 0b11;
20229    /// Offset of the `PS` field.
20230    pub const PS_SHIFT: u32 = 16;
20231    /// Mask for the `PS` field.
20232    pub const PS_MASK: u64 = 0b111;
20233    /// Offset of the `TBI` field.
20234    pub const TBI_SHIFT: u32 = 20;
20235    /// Offset of the `HA` field.
20236    pub const HA_SHIFT: u32 = 21;
20237    /// Offset of the `HD` field.
20238    pub const HD_SHIFT: u32 = 22;
20239    /// Offset of the `HPD` field.
20240    pub const HPD_SHIFT: u32 = 24;
20241    /// Offset of the `HWU59` field.
20242    pub const HWU59_SHIFT: u32 = 25;
20243    /// Offset of the `HWU60` field.
20244    pub const HWU60_SHIFT: u32 = 26;
20245    /// Offset of the `HWU61` field.
20246    pub const HWU61_SHIFT: u32 = 27;
20247    /// Offset of the `HWU62` field.
20248    pub const HWU62_SHIFT: u32 = 28;
20249    /// Offset of the `TBID` field.
20250    pub const TBID_SHIFT: u32 = 29;
20251    /// Offset of the `TCMA` field.
20252    pub const TCMA_SHIFT: u32 = 30;
20253    /// Offset of the `DS` field.
20254    pub const DS_SHIFT: u32 = 32;
20255    /// Offset of the `MTX` field.
20256    pub const MTX_SHIFT: u32 = 33;
20257    /// Offset of the `PnCH` field.
20258    pub const PNCH_SHIFT: u32 = 34;
20259    /// Offset of the `PIE` field.
20260    pub const PIE_SHIFT: u32 = 35;
20261    /// Offset of the `POE` field.
20262    pub const POE_SHIFT: u32 = 36;
20263    /// Offset of the `AIE` field.
20264    pub const AIE_SHIFT: u32 = 37;
20265    /// Offset of the `D128` field.
20266    pub const D128_SHIFT: u32 = 38;
20267    /// Offset of the `PTTWI` field.
20268    pub const PTTWI_SHIFT: u32 = 41;
20269    /// Offset of the `HAFT` field.
20270    pub const HAFT_SHIFT: u32 = 42;
20271    /// Offset of the `DisCH0` field.
20272    pub const DISCH0_SHIFT: u32 = 43;
20273    /// Offset of the `POE2F` field.
20274    pub const POE2F_SHIFT: u32 = 44;
20275    /// Offset of the `POIW` field.
20276    pub const POIW_SHIFT: u32 = 45;
20277    /// Mask for the `POIW` field.
20278    pub const POIW_MASK: u64 = 0b111;
20279    /// Offset of the `VTB` field.
20280    pub const VTB_SHIFT: u32 = 48;
20281    /// Mask for the `VTB` field.
20282    pub const VTB_MASK: u64 = 0b11111;
20283    /// Offset of the `TVAD` field.
20284    pub const TVAD_SHIFT: u32 = 53;
20285
20286    /// Returns the value of the `T0SZ` field.
20287    pub const fn t0sz(self) -> u8 {
20288        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
20289    }
20290
20291    /// Sets the value of the `T0SZ` field.
20292    pub const fn set_t0sz(&mut self, value: u8) {
20293        let offset = Self::T0SZ_SHIFT;
20294        assert!(value & (Self::T0SZ_MASK as u8) == value);
20295        *self = Self::from_bits_retain(
20296            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
20297        );
20298    }
20299
20300    /// Returns the value of the `IRGN0` field.
20301    pub const fn irgn0(self) -> u8 {
20302        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
20303    }
20304
20305    /// Sets the value of the `IRGN0` field.
20306    pub const fn set_irgn0(&mut self, value: u8) {
20307        let offset = Self::IRGN0_SHIFT;
20308        assert!(value & (Self::IRGN0_MASK as u8) == value);
20309        *self = Self::from_bits_retain(
20310            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
20311        );
20312    }
20313
20314    /// Returns the value of the `ORGN0` field.
20315    pub const fn orgn0(self) -> u8 {
20316        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
20317    }
20318
20319    /// Sets the value of the `ORGN0` field.
20320    pub const fn set_orgn0(&mut self, value: u8) {
20321        let offset = Self::ORGN0_SHIFT;
20322        assert!(value & (Self::ORGN0_MASK as u8) == value);
20323        *self = Self::from_bits_retain(
20324            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
20325        );
20326    }
20327
20328    /// Returns the value of the `SH0` field.
20329    pub const fn sh0(self) -> u8 {
20330        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
20331    }
20332
20333    /// Sets the value of the `SH0` field.
20334    pub const fn set_sh0(&mut self, value: u8) {
20335        let offset = Self::SH0_SHIFT;
20336        assert!(value & (Self::SH0_MASK as u8) == value);
20337        *self = Self::from_bits_retain(
20338            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
20339        );
20340    }
20341
20342    /// Returns the value of the `TG0` field.
20343    pub const fn tg0(self) -> u8 {
20344        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
20345    }
20346
20347    /// Sets the value of the `TG0` field.
20348    pub const fn set_tg0(&mut self, value: u8) {
20349        let offset = Self::TG0_SHIFT;
20350        assert!(value & (Self::TG0_MASK as u8) == value);
20351        *self = Self::from_bits_retain(
20352            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
20353        );
20354    }
20355
20356    /// Returns the value of the `PS` field.
20357    pub const fn ps(self) -> u8 {
20358        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
20359    }
20360
20361    /// Sets the value of the `PS` field.
20362    pub const fn set_ps(&mut self, value: u8) {
20363        let offset = Self::PS_SHIFT;
20364        assert!(value & (Self::PS_MASK as u8) == value);
20365        *self = Self::from_bits_retain(
20366            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
20367        );
20368    }
20369
20370    /// Returns the value of the `POIW` field.
20371    pub const fn poiw(self) -> u8 {
20372        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
20373    }
20374
20375    /// Sets the value of the `POIW` field.
20376    pub const fn set_poiw(&mut self, value: u8) {
20377        let offset = Self::POIW_SHIFT;
20378        assert!(value & (Self::POIW_MASK as u8) == value);
20379        *self = Self::from_bits_retain(
20380            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
20381        );
20382    }
20383
20384    /// Returns the value of the `VTB` field.
20385    pub const fn vtb(self) -> u8 {
20386        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
20387    }
20388
20389    /// Sets the value of the `VTB` field.
20390    pub const fn set_vtb(&mut self, value: u8) {
20391        let offset = Self::VTB_SHIFT;
20392        assert!(value & (Self::VTB_MASK as u8) == value);
20393        *self = Self::from_bits_retain(
20394            (self.bits() & !(Self::VTB_MASK << offset)) | ((value as u64) << offset),
20395        );
20396    }
20397}
20398
20399#[cfg(feature = "el1")]
20400bitflags! {
20401    /// `TFSRE0_EL1` system register value.
20402    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20403    #[repr(transparent)]
20404    pub struct Tfsre0El1: u64 {
20405        /// `TF0` bit.
20406        const TF0 = 1 << 0;
20407        /// `TF1` bit.
20408        const TF1 = 1 << 1;
20409    }
20410}
20411
20412#[cfg(feature = "el1")]
20413impl Tfsre0El1 {
20414    /// Offset of the `TF0` field.
20415    pub const TF0_SHIFT: u32 = 0;
20416    /// Offset of the `TF1` field.
20417    pub const TF1_SHIFT: u32 = 1;
20418}
20419
20420#[cfg(feature = "el1")]
20421bitflags! {
20422    /// `TFSR_EL1` system register value.
20423    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20424    #[repr(transparent)]
20425    pub struct TfsrEl1: u64 {
20426        /// `TF0` bit.
20427        const TF0 = 1 << 0;
20428        /// `TF1` bit.
20429        const TF1 = 1 << 1;
20430    }
20431}
20432
20433#[cfg(feature = "el1")]
20434impl TfsrEl1 {
20435    /// Offset of the `TF0` field.
20436    pub const TF0_SHIFT: u32 = 0;
20437    /// Offset of the `TF1` field.
20438    pub const TF1_SHIFT: u32 = 1;
20439}
20440
20441#[cfg(feature = "el2")]
20442bitflags! {
20443    /// `TFSR_EL2` system register value.
20444    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20445    #[repr(transparent)]
20446    pub struct TfsrEl2: u64 {
20447        /// `TF0` bit.
20448        const TF0 = 1 << 0;
20449        /// `TF1` bit.
20450        const TF1 = 1 << 1;
20451    }
20452}
20453
20454#[cfg(feature = "el2")]
20455impl TfsrEl2 {
20456    /// Offset of the `TF0` field.
20457    pub const TF0_SHIFT: u32 = 0;
20458    /// Offset of the `TF1` field.
20459    pub const TF1_SHIFT: u32 = 1;
20460}
20461
20462bitflags! {
20463    /// `TLBTR` system register value.
20464    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20465    #[repr(transparent)]
20466    pub struct Tlbtr: u32 {
20467        /// `nU` bit.
20468        const NU = 1 << 0;
20469    }
20470}
20471
20472impl Tlbtr {
20473    /// Offset of the `nU` field.
20474    pub const NU_SHIFT: u32 = 0;
20475}
20476
20477bitflags! {
20478    /// `TPIDRPRW` system register value.
20479    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20480    #[repr(transparent)]
20481    pub struct Tpidrprw: u32 {
20482    }
20483}
20484
20485impl Tpidrprw {
20486    /// Offset of the `TID` field.
20487    pub const TID_SHIFT: u32 = 0;
20488    /// Mask for the `TID` field.
20489    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
20490
20491    /// Returns the value of the `TID` field.
20492    pub const fn tid(self) -> u32 {
20493        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
20494    }
20495
20496    /// Sets the value of the `TID` field.
20497    pub const fn set_tid(&mut self, value: u32) {
20498        let offset = Self::TID_SHIFT;
20499        assert!(value & (Self::TID_MASK as u32) == value);
20500        *self = Self::from_bits_retain(
20501            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
20502        );
20503    }
20504}
20505
20506bitflags! {
20507    /// `TPIDRRO_EL0` system register value.
20508    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20509    #[repr(transparent)]
20510    pub struct TpidrroEl0: u64 {
20511    }
20512}
20513
20514impl TpidrroEl0 {
20515    /// Offset of the `ThreadID` field.
20516    pub const THREADID_SHIFT: u32 = 0;
20517    /// Mask for the `ThreadID` field.
20518    pub const THREADID_MASK: u64 =
20519        0b1111111111111111111111111111111111111111111111111111111111111111;
20520
20521    /// Returns the value of the `ThreadID` field.
20522    pub const fn threadid(self) -> u64 {
20523        ((self.bits() >> Self::THREADID_SHIFT)
20524            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
20525    }
20526
20527    /// Sets the value of the `ThreadID` field.
20528    pub const fn set_threadid(&mut self, value: u64) {
20529        let offset = Self::THREADID_SHIFT;
20530        assert!(value & (Self::THREADID_MASK as u64) == value);
20531        *self = Self::from_bits_retain(
20532            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
20533        );
20534    }
20535}
20536
20537bitflags! {
20538    /// `TPIDRURO` system register value.
20539    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20540    #[repr(transparent)]
20541    pub struct Tpidruro: u32 {
20542    }
20543}
20544
20545impl Tpidruro {
20546    /// Offset of the `TID` field.
20547    pub const TID_SHIFT: u32 = 0;
20548    /// Mask for the `TID` field.
20549    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
20550
20551    /// Returns the value of the `TID` field.
20552    pub const fn tid(self) -> u32 {
20553        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
20554    }
20555
20556    /// Sets the value of the `TID` field.
20557    pub const fn set_tid(&mut self, value: u32) {
20558        let offset = Self::TID_SHIFT;
20559        assert!(value & (Self::TID_MASK as u32) == value);
20560        *self = Self::from_bits_retain(
20561            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
20562        );
20563    }
20564}
20565
20566bitflags! {
20567    /// `TPIDRURW` system register value.
20568    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20569    #[repr(transparent)]
20570    pub struct Tpidrurw: u32 {
20571    }
20572}
20573
20574impl Tpidrurw {
20575    /// Offset of the `TID` field.
20576    pub const TID_SHIFT: u32 = 0;
20577    /// Mask for the `TID` field.
20578    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
20579
20580    /// Returns the value of the `TID` field.
20581    pub const fn tid(self) -> u32 {
20582        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
20583    }
20584
20585    /// Sets the value of the `TID` field.
20586    pub const fn set_tid(&mut self, value: u32) {
20587        let offset = Self::TID_SHIFT;
20588        assert!(value & (Self::TID_MASK as u32) == value);
20589        *self = Self::from_bits_retain(
20590            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
20591        );
20592    }
20593}
20594
20595bitflags! {
20596    /// `TPIDR_EL0` system register value.
20597    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20598    #[repr(transparent)]
20599    pub struct TpidrEl0: u64 {
20600    }
20601}
20602
20603impl TpidrEl0 {
20604    /// Offset of the `ThreadID` field.
20605    pub const THREADID_SHIFT: u32 = 0;
20606    /// Mask for the `ThreadID` field.
20607    pub const THREADID_MASK: u64 =
20608        0b1111111111111111111111111111111111111111111111111111111111111111;
20609
20610    /// Returns the value of the `ThreadID` field.
20611    pub const fn threadid(self) -> u64 {
20612        ((self.bits() >> Self::THREADID_SHIFT)
20613            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
20614    }
20615
20616    /// Sets the value of the `ThreadID` field.
20617    pub const fn set_threadid(&mut self, value: u64) {
20618        let offset = Self::THREADID_SHIFT;
20619        assert!(value & (Self::THREADID_MASK as u64) == value);
20620        *self = Self::from_bits_retain(
20621            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
20622        );
20623    }
20624}
20625
20626#[cfg(feature = "el1")]
20627bitflags! {
20628    /// `TPIDR_EL1` system register value.
20629    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20630    #[repr(transparent)]
20631    pub struct TpidrEl1: u64 {
20632    }
20633}
20634
20635#[cfg(feature = "el1")]
20636impl TpidrEl1 {
20637    /// Offset of the `ThreadID` field.
20638    pub const THREADID_SHIFT: u32 = 0;
20639    /// Mask for the `ThreadID` field.
20640    pub const THREADID_MASK: u64 =
20641        0b1111111111111111111111111111111111111111111111111111111111111111;
20642
20643    /// Returns the value of the `ThreadID` field.
20644    pub const fn threadid(self) -> u64 {
20645        ((self.bits() >> Self::THREADID_SHIFT)
20646            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
20647    }
20648
20649    /// Sets the value of the `ThreadID` field.
20650    pub const fn set_threadid(&mut self, value: u64) {
20651        let offset = Self::THREADID_SHIFT;
20652        assert!(value & (Self::THREADID_MASK as u64) == value);
20653        *self = Self::from_bits_retain(
20654            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
20655        );
20656    }
20657}
20658
20659#[cfg(feature = "el2")]
20660bitflags! {
20661    /// `TPIDR_EL2` system register value.
20662    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20663    #[repr(transparent)]
20664    pub struct TpidrEl2: u64 {
20665    }
20666}
20667
20668#[cfg(feature = "el2")]
20669impl TpidrEl2 {
20670    /// Offset of the `ThreadID` field.
20671    pub const THREADID_SHIFT: u32 = 0;
20672    /// Mask for the `ThreadID` field.
20673    pub const THREADID_MASK: u64 =
20674        0b1111111111111111111111111111111111111111111111111111111111111111;
20675
20676    /// Returns the value of the `ThreadID` field.
20677    pub const fn threadid(self) -> u64 {
20678        ((self.bits() >> Self::THREADID_SHIFT)
20679            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
20680    }
20681
20682    /// Sets the value of the `ThreadID` field.
20683    pub const fn set_threadid(&mut self, value: u64) {
20684        let offset = Self::THREADID_SHIFT;
20685        assert!(value & (Self::THREADID_MASK as u64) == value);
20686        *self = Self::from_bits_retain(
20687            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
20688        );
20689    }
20690}
20691
20692bitflags! {
20693    /// `TRFCR` system register value.
20694    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20695    #[repr(transparent)]
20696    pub struct Trfcr: u32 {
20697        /// `E0TRE` bit.
20698        const E0TRE = 1 << 0;
20699        /// `E1TRE` bit.
20700        const E1TRE = 1 << 1;
20701    }
20702}
20703
20704impl Trfcr {
20705    /// Offset of the `E0TRE` field.
20706    pub const E0TRE_SHIFT: u32 = 0;
20707    /// Offset of the `E1TRE` field.
20708    pub const E1TRE_SHIFT: u32 = 1;
20709    /// Offset of the `TS` field.
20710    pub const TS_SHIFT: u32 = 5;
20711    /// Mask for the `TS` field.
20712    pub const TS_MASK: u32 = 0b11;
20713
20714    /// Returns the value of the `TS` field.
20715    pub const fn ts(self) -> u8 {
20716        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
20717    }
20718
20719    /// Sets the value of the `TS` field.
20720    pub const fn set_ts(&mut self, value: u8) {
20721        let offset = Self::TS_SHIFT;
20722        assert!(value & (Self::TS_MASK as u8) == value);
20723        *self = Self::from_bits_retain(
20724            (self.bits() & !(Self::TS_MASK << offset)) | ((value as u32) << offset),
20725        );
20726    }
20727}
20728
20729bitflags! {
20730    /// `TTBCR` system register value.
20731    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20732    #[repr(transparent)]
20733    pub struct Ttbcr: u32 {
20734        /// `PD0` bit.
20735        const PD0 = 1 << 4;
20736        /// `PD1` bit.
20737        const PD1 = 1 << 5;
20738        /// `T2E` bit.
20739        const T2E = 1 << 6;
20740        /// `EPD0` bit.
20741        const EPD0 = 1 << 7;
20742        /// `A1` bit.
20743        const A1 = 1 << 22;
20744        /// `EPD1` bit.
20745        const EPD1 = 1 << 23;
20746        /// `EAE` bit.
20747        const EAE = 1 << 31;
20748    }
20749}
20750
20751impl Ttbcr {
20752    /// Offset of the `N` field.
20753    pub const N_SHIFT: u32 = 0;
20754    /// Mask for the `N` field.
20755    pub const N_MASK: u32 = 0b111;
20756    /// Offset of the `T0SZ` field.
20757    pub const T0SZ_SHIFT: u32 = 0;
20758    /// Mask for the `T0SZ` field.
20759    pub const T0SZ_MASK: u32 = 0b111;
20760    /// Offset of the `PD0` field.
20761    pub const PD0_SHIFT: u32 = 4;
20762    /// Offset of the `PD1` field.
20763    pub const PD1_SHIFT: u32 = 5;
20764    /// Offset of the `T2E` field.
20765    pub const T2E_SHIFT: u32 = 6;
20766    /// Offset of the `EPD0` field.
20767    pub const EPD0_SHIFT: u32 = 7;
20768    /// Offset of the `IRGN0` field.
20769    pub const IRGN0_SHIFT: u32 = 8;
20770    /// Mask for the `IRGN0` field.
20771    pub const IRGN0_MASK: u32 = 0b11;
20772    /// Offset of the `ORGN0` field.
20773    pub const ORGN0_SHIFT: u32 = 10;
20774    /// Mask for the `ORGN0` field.
20775    pub const ORGN0_MASK: u32 = 0b11;
20776    /// Offset of the `SH0` field.
20777    pub const SH0_SHIFT: u32 = 12;
20778    /// Mask for the `SH0` field.
20779    pub const SH0_MASK: u32 = 0b11;
20780    /// Offset of the `T1SZ` field.
20781    pub const T1SZ_SHIFT: u32 = 16;
20782    /// Mask for the `T1SZ` field.
20783    pub const T1SZ_MASK: u32 = 0b111;
20784    /// Offset of the `A1` field.
20785    pub const A1_SHIFT: u32 = 22;
20786    /// Offset of the `EPD1` field.
20787    pub const EPD1_SHIFT: u32 = 23;
20788    /// Offset of the `IRGN1` field.
20789    pub const IRGN1_SHIFT: u32 = 24;
20790    /// Mask for the `IRGN1` field.
20791    pub const IRGN1_MASK: u32 = 0b11;
20792    /// Offset of the `ORGN1` field.
20793    pub const ORGN1_SHIFT: u32 = 26;
20794    /// Mask for the `ORGN1` field.
20795    pub const ORGN1_MASK: u32 = 0b11;
20796    /// Offset of the `SH1` field.
20797    pub const SH1_SHIFT: u32 = 28;
20798    /// Mask for the `SH1` field.
20799    pub const SH1_MASK: u32 = 0b11;
20800    /// Offset of the `EAE` field.
20801    pub const EAE_SHIFT: u32 = 31;
20802
20803    /// Returns the value of the `N` field.
20804    pub const fn n(self) -> u8 {
20805        ((self.bits() >> Self::N_SHIFT) & 0b111) as u8
20806    }
20807
20808    /// Sets the value of the `N` field.
20809    pub const fn set_n(&mut self, value: u8) {
20810        let offset = Self::N_SHIFT;
20811        assert!(value & (Self::N_MASK as u8) == value);
20812        *self = Self::from_bits_retain(
20813            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
20814        );
20815    }
20816
20817    /// Returns the value of the `T0SZ` field.
20818    pub const fn t0sz(self) -> u8 {
20819        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
20820    }
20821
20822    /// Sets the value of the `T0SZ` field.
20823    pub const fn set_t0sz(&mut self, value: u8) {
20824        let offset = Self::T0SZ_SHIFT;
20825        assert!(value & (Self::T0SZ_MASK as u8) == value);
20826        *self = Self::from_bits_retain(
20827            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
20828        );
20829    }
20830
20831    /// Returns the value of the `IRGN0` field.
20832    pub const fn irgn0(self) -> u8 {
20833        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
20834    }
20835
20836    /// Sets the value of the `IRGN0` field.
20837    pub const fn set_irgn0(&mut self, value: u8) {
20838        let offset = Self::IRGN0_SHIFT;
20839        assert!(value & (Self::IRGN0_MASK as u8) == value);
20840        *self = Self::from_bits_retain(
20841            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
20842        );
20843    }
20844
20845    /// Returns the value of the `ORGN0` field.
20846    pub const fn orgn0(self) -> u8 {
20847        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
20848    }
20849
20850    /// Sets the value of the `ORGN0` field.
20851    pub const fn set_orgn0(&mut self, value: u8) {
20852        let offset = Self::ORGN0_SHIFT;
20853        assert!(value & (Self::ORGN0_MASK as u8) == value);
20854        *self = Self::from_bits_retain(
20855            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
20856        );
20857    }
20858
20859    /// Returns the value of the `SH0` field.
20860    pub const fn sh0(self) -> u8 {
20861        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
20862    }
20863
20864    /// Sets the value of the `SH0` field.
20865    pub const fn set_sh0(&mut self, value: u8) {
20866        let offset = Self::SH0_SHIFT;
20867        assert!(value & (Self::SH0_MASK as u8) == value);
20868        *self = Self::from_bits_retain(
20869            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
20870        );
20871    }
20872
20873    /// Returns the value of the `T1SZ` field.
20874    pub const fn t1sz(self) -> u8 {
20875        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111) as u8
20876    }
20877
20878    /// Sets the value of the `T1SZ` field.
20879    pub const fn set_t1sz(&mut self, value: u8) {
20880        let offset = Self::T1SZ_SHIFT;
20881        assert!(value & (Self::T1SZ_MASK as u8) == value);
20882        *self = Self::from_bits_retain(
20883            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u32) << offset),
20884        );
20885    }
20886
20887    /// Returns the value of the `IRGN1` field.
20888    pub const fn irgn1(self) -> u8 {
20889        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
20890    }
20891
20892    /// Sets the value of the `IRGN1` field.
20893    pub const fn set_irgn1(&mut self, value: u8) {
20894        let offset = Self::IRGN1_SHIFT;
20895        assert!(value & (Self::IRGN1_MASK as u8) == value);
20896        *self = Self::from_bits_retain(
20897            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u32) << offset),
20898        );
20899    }
20900
20901    /// Returns the value of the `ORGN1` field.
20902    pub const fn orgn1(self) -> u8 {
20903        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
20904    }
20905
20906    /// Sets the value of the `ORGN1` field.
20907    pub const fn set_orgn1(&mut self, value: u8) {
20908        let offset = Self::ORGN1_SHIFT;
20909        assert!(value & (Self::ORGN1_MASK as u8) == value);
20910        *self = Self::from_bits_retain(
20911            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u32) << offset),
20912        );
20913    }
20914
20915    /// Returns the value of the `SH1` field.
20916    pub const fn sh1(self) -> u8 {
20917        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
20918    }
20919
20920    /// Sets the value of the `SH1` field.
20921    pub const fn set_sh1(&mut self, value: u8) {
20922        let offset = Self::SH1_SHIFT;
20923        assert!(value & (Self::SH1_MASK as u8) == value);
20924        *self = Self::from_bits_retain(
20925            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u32) << offset),
20926        );
20927    }
20928}
20929
20930bitflags! {
20931    /// `TTBCR2` system register value.
20932    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20933    #[repr(transparent)]
20934    pub struct Ttbcr2: u32 {
20935        /// `HPD0` bit.
20936        const HPD0 = 1 << 9;
20937        /// `HPD1` bit.
20938        const HPD1 = 1 << 10;
20939        /// `HWU059` bit.
20940        const HWU059 = 1 << 11;
20941        /// `HWU060` bit.
20942        const HWU060 = 1 << 12;
20943        /// `HWU061` bit.
20944        const HWU061 = 1 << 13;
20945        /// `HWU062` bit.
20946        const HWU062 = 1 << 14;
20947        /// `HWU159` bit.
20948        const HWU159 = 1 << 15;
20949        /// `HWU160` bit.
20950        const HWU160 = 1 << 16;
20951        /// `HWU161` bit.
20952        const HWU161 = 1 << 17;
20953        /// `HWU162` bit.
20954        const HWU162 = 1 << 18;
20955    }
20956}
20957
20958impl Ttbcr2 {
20959    /// Offset of the `HPD0` field.
20960    pub const HPD0_SHIFT: u32 = 9;
20961    /// Offset of the `HPD1` field.
20962    pub const HPD1_SHIFT: u32 = 10;
20963    /// Offset of the `HWU059` field.
20964    pub const HWU059_SHIFT: u32 = 11;
20965    /// Offset of the `HWU060` field.
20966    pub const HWU060_SHIFT: u32 = 12;
20967    /// Offset of the `HWU061` field.
20968    pub const HWU061_SHIFT: u32 = 13;
20969    /// Offset of the `HWU062` field.
20970    pub const HWU062_SHIFT: u32 = 14;
20971    /// Offset of the `HWU159` field.
20972    pub const HWU159_SHIFT: u32 = 15;
20973    /// Offset of the `HWU160` field.
20974    pub const HWU160_SHIFT: u32 = 16;
20975    /// Offset of the `HWU161` field.
20976    pub const HWU161_SHIFT: u32 = 17;
20977    /// Offset of the `HWU162` field.
20978    pub const HWU162_SHIFT: u32 = 18;
20979}
20980
20981bitflags! {
20982    /// `TTBR0` system register value.
20983    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20984    #[repr(transparent)]
20985    pub struct Ttbr0: u64 {
20986        /// `CnP` bit.
20987        const CNP = 1 << 0;
20988        /// `S` bit.
20989        const S = 1 << 1;
20990        /// `IMP` bit.
20991        const IMP = 1 << 2;
20992        /// `NOS` bit.
20993        const NOS = 1 << 5;
20994    }
20995}
20996
20997impl Ttbr0 {
20998    /// Offset of the `CnP` field.
20999    pub const CNP_SHIFT: u32 = 0;
21000    /// Offset of the `BADDR` field.
21001    pub const BADDR_SHIFT: u32 = 1;
21002    /// Mask for the `BADDR` field.
21003    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
21004    /// Offset of the `S` field.
21005    pub const S_SHIFT: u32 = 1;
21006    /// Offset of the `IMP` field.
21007    pub const IMP_SHIFT: u32 = 2;
21008    /// Offset of the `RGN` field.
21009    pub const RGN_SHIFT: u32 = 3;
21010    /// Mask for the `RGN` field.
21011    pub const RGN_MASK: u64 = 0b11;
21012    /// Offset of the `NOS` field.
21013    pub const NOS_SHIFT: u32 = 5;
21014    /// Offset of the `TTB0` field.
21015    pub const TTB0_SHIFT: u32 = 7;
21016    /// Mask for the `TTB0` field.
21017    pub const TTB0_MASK: u64 = 0b1111111111111111111111111;
21018    /// Offset of the `ASID` field.
21019    pub const ASID_SHIFT: u32 = 48;
21020    /// Mask for the `ASID` field.
21021    pub const ASID_MASK: u64 = 0b11111111;
21022
21023    /// Returns the value of the `BADDR` field.
21024    pub const fn baddr(self) -> u64 {
21025        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
21026            as u64
21027    }
21028
21029    /// Sets the value of the `BADDR` field.
21030    pub const fn set_baddr(&mut self, value: u64) {
21031        let offset = Self::BADDR_SHIFT;
21032        assert!(value & (Self::BADDR_MASK as u64) == value);
21033        *self = Self::from_bits_retain(
21034            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
21035        );
21036    }
21037
21038    /// Returns the value of the `RGN` field.
21039    pub const fn rgn(self) -> u8 {
21040        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
21041    }
21042
21043    /// Sets the value of the `RGN` field.
21044    pub const fn set_rgn(&mut self, value: u8) {
21045        let offset = Self::RGN_SHIFT;
21046        assert!(value & (Self::RGN_MASK as u8) == value);
21047        *self = Self::from_bits_retain(
21048            (self.bits() & !(Self::RGN_MASK << offset)) | ((value as u64) << offset),
21049        );
21050    }
21051
21052    /// Returns the value of the `TTB0` field.
21053    pub const fn ttb0(self) -> u32 {
21054        ((self.bits() >> Self::TTB0_SHIFT) & 0b1111111111111111111111111) as u32
21055    }
21056
21057    /// Sets the value of the `TTB0` field.
21058    pub const fn set_ttb0(&mut self, value: u32) {
21059        let offset = Self::TTB0_SHIFT;
21060        assert!(value & (Self::TTB0_MASK as u32) == value);
21061        *self = Self::from_bits_retain(
21062            (self.bits() & !(Self::TTB0_MASK << offset)) | ((value as u64) << offset),
21063        );
21064    }
21065
21066    /// Returns the value of the `ASID` field.
21067    pub const fn asid(self) -> u8 {
21068        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
21069    }
21070
21071    /// Sets the value of the `ASID` field.
21072    pub const fn set_asid(&mut self, value: u8) {
21073        let offset = Self::ASID_SHIFT;
21074        assert!(value & (Self::ASID_MASK as u8) == value);
21075        *self = Self::from_bits_retain(
21076            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
21077        );
21078    }
21079}
21080
21081#[cfg(feature = "el1")]
21082bitflags! {
21083    /// `TTBR0_EL1` system register value.
21084    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21085    #[repr(transparent)]
21086    pub struct Ttbr0El1: u64 {
21087        /// `CnP` bit.
21088        const CNP = 1 << 0;
21089    }
21090}
21091
21092#[cfg(feature = "el1")]
21093impl Ttbr0El1 {
21094    /// Offset of the `CnP` field.
21095    pub const CNP_SHIFT: u32 = 0;
21096    /// Offset of the `BADDR[47:1]` field.
21097    pub const BADDR_47_1_SHIFT: u32 = 1;
21098    /// Mask for the `BADDR[47:1]` field.
21099    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
21100    /// Offset of the `SKL` field.
21101    pub const SKL_SHIFT: u32 = 1;
21102    /// Mask for the `SKL` field.
21103    pub const SKL_MASK: u64 = 0b11;
21104    /// Offset of the `ASID` field.
21105    pub const ASID_SHIFT: u32 = 48;
21106    /// Mask for the `ASID` field.
21107    pub const ASID_MASK: u64 = 0b1111111111111111;
21108
21109    /// Returns the value of the `BADDR[47:1]` field.
21110    pub const fn baddr_47_1(self) -> u64 {
21111        ((self.bits() >> Self::BADDR_47_1_SHIFT)
21112            & 0b11111111111111111111111111111111111111111111111) as u64
21113    }
21114
21115    /// Sets the value of the `BADDR[47:1]` field.
21116    pub const fn set_baddr_47_1(&mut self, value: u64) {
21117        let offset = Self::BADDR_47_1_SHIFT;
21118        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
21119        *self = Self::from_bits_retain(
21120            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
21121        );
21122    }
21123
21124    /// Returns the value of the `SKL` field.
21125    pub const fn skl(self) -> u8 {
21126        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
21127    }
21128
21129    /// Sets the value of the `SKL` field.
21130    pub const fn set_skl(&mut self, value: u8) {
21131        let offset = Self::SKL_SHIFT;
21132        assert!(value & (Self::SKL_MASK as u8) == value);
21133        *self = Self::from_bits_retain(
21134            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
21135        );
21136    }
21137
21138    /// Returns the value of the `ASID` field.
21139    pub const fn asid(self) -> u16 {
21140        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
21141    }
21142
21143    /// Sets the value of the `ASID` field.
21144    pub const fn set_asid(&mut self, value: u16) {
21145        let offset = Self::ASID_SHIFT;
21146        assert!(value & (Self::ASID_MASK as u16) == value);
21147        *self = Self::from_bits_retain(
21148            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
21149        );
21150    }
21151}
21152
21153#[cfg(feature = "el2")]
21154bitflags! {
21155    /// `TTBR0_EL2` system register value.
21156    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21157    #[repr(transparent)]
21158    pub struct Ttbr0El2: u64 {
21159        /// `CnP` bit.
21160        const CNP = 1 << 0;
21161    }
21162}
21163
21164#[cfg(feature = "el2")]
21165impl Ttbr0El2 {
21166    /// Offset of the `CnP` field.
21167    pub const CNP_SHIFT: u32 = 0;
21168    /// Offset of the `BADDR[47:1]` field.
21169    pub const BADDR_47_1_SHIFT: u32 = 1;
21170    /// Mask for the `BADDR[47:1]` field.
21171    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
21172    /// Offset of the `SKL` field.
21173    pub const SKL_SHIFT: u32 = 1;
21174    /// Mask for the `SKL` field.
21175    pub const SKL_MASK: u64 = 0b11;
21176    /// Offset of the `ASID` field.
21177    pub const ASID_SHIFT: u32 = 48;
21178    /// Mask for the `ASID` field.
21179    pub const ASID_MASK: u64 = 0b1111111111111111;
21180
21181    /// Returns the value of the `BADDR[47:1]` field.
21182    pub const fn baddr_47_1(self) -> u64 {
21183        ((self.bits() >> Self::BADDR_47_1_SHIFT)
21184            & 0b11111111111111111111111111111111111111111111111) as u64
21185    }
21186
21187    /// Sets the value of the `BADDR[47:1]` field.
21188    pub const fn set_baddr_47_1(&mut self, value: u64) {
21189        let offset = Self::BADDR_47_1_SHIFT;
21190        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
21191        *self = Self::from_bits_retain(
21192            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
21193        );
21194    }
21195
21196    /// Returns the value of the `SKL` field.
21197    pub const fn skl(self) -> u8 {
21198        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
21199    }
21200
21201    /// Sets the value of the `SKL` field.
21202    pub const fn set_skl(&mut self, value: u8) {
21203        let offset = Self::SKL_SHIFT;
21204        assert!(value & (Self::SKL_MASK as u8) == value);
21205        *self = Self::from_bits_retain(
21206            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
21207        );
21208    }
21209
21210    /// Returns the value of the `ASID` field.
21211    pub const fn asid(self) -> u16 {
21212        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
21213    }
21214
21215    /// Sets the value of the `ASID` field.
21216    pub const fn set_asid(&mut self, value: u16) {
21217        let offset = Self::ASID_SHIFT;
21218        assert!(value & (Self::ASID_MASK as u16) == value);
21219        *self = Self::from_bits_retain(
21220            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
21221        );
21222    }
21223}
21224
21225#[cfg(feature = "el3")]
21226bitflags! {
21227    /// `TTBR0_EL3` system register value.
21228    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21229    #[repr(transparent)]
21230    pub struct Ttbr0El3: u64 {
21231        /// `CnP` bit.
21232        const CNP = 1 << 0;
21233    }
21234}
21235
21236#[cfg(feature = "el3")]
21237impl Ttbr0El3 {
21238    /// Offset of the `CnP` field.
21239    pub const CNP_SHIFT: u32 = 0;
21240    /// Offset of the `SKL` field.
21241    pub const SKL_SHIFT: u32 = 1;
21242    /// Mask for the `SKL` field.
21243    pub const SKL_MASK: u64 = 0b11;
21244
21245    /// Returns the value of the `SKL` field.
21246    pub const fn skl(self) -> u8 {
21247        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
21248    }
21249
21250    /// Sets the value of the `SKL` field.
21251    pub const fn set_skl(&mut self, value: u8) {
21252        let offset = Self::SKL_SHIFT;
21253        assert!(value & (Self::SKL_MASK as u8) == value);
21254        *self = Self::from_bits_retain(
21255            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
21256        );
21257    }
21258}
21259
21260bitflags! {
21261    /// `TTBR1` system register value.
21262    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21263    #[repr(transparent)]
21264    pub struct Ttbr1: u64 {
21265        /// `CnP` bit.
21266        const CNP = 1 << 0;
21267        /// `S` bit.
21268        const S = 1 << 1;
21269        /// `IMP` bit.
21270        const IMP = 1 << 2;
21271        /// `NOS` bit.
21272        const NOS = 1 << 5;
21273    }
21274}
21275
21276impl Ttbr1 {
21277    /// Offset of the `CnP` field.
21278    pub const CNP_SHIFT: u32 = 0;
21279    /// Offset of the `BADDR` field.
21280    pub const BADDR_SHIFT: u32 = 1;
21281    /// Mask for the `BADDR` field.
21282    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
21283    /// Offset of the `S` field.
21284    pub const S_SHIFT: u32 = 1;
21285    /// Offset of the `IMP` field.
21286    pub const IMP_SHIFT: u32 = 2;
21287    /// Offset of the `RGN` field.
21288    pub const RGN_SHIFT: u32 = 3;
21289    /// Mask for the `RGN` field.
21290    pub const RGN_MASK: u64 = 0b11;
21291    /// Offset of the `NOS` field.
21292    pub const NOS_SHIFT: u32 = 5;
21293    /// Offset of the `TTB1` field.
21294    pub const TTB1_SHIFT: u32 = 7;
21295    /// Mask for the `TTB1` field.
21296    pub const TTB1_MASK: u64 = 0b1111111111111111111111111;
21297    /// Offset of the `ASID` field.
21298    pub const ASID_SHIFT: u32 = 48;
21299    /// Mask for the `ASID` field.
21300    pub const ASID_MASK: u64 = 0b11111111;
21301
21302    /// Returns the value of the `BADDR` field.
21303    pub const fn baddr(self) -> u64 {
21304        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
21305            as u64
21306    }
21307
21308    /// Sets the value of the `BADDR` field.
21309    pub const fn set_baddr(&mut self, value: u64) {
21310        let offset = Self::BADDR_SHIFT;
21311        assert!(value & (Self::BADDR_MASK as u64) == value);
21312        *self = Self::from_bits_retain(
21313            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
21314        );
21315    }
21316
21317    /// Returns the value of the `RGN` field.
21318    pub const fn rgn(self) -> u8 {
21319        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
21320    }
21321
21322    /// Sets the value of the `RGN` field.
21323    pub const fn set_rgn(&mut self, value: u8) {
21324        let offset = Self::RGN_SHIFT;
21325        assert!(value & (Self::RGN_MASK as u8) == value);
21326        *self = Self::from_bits_retain(
21327            (self.bits() & !(Self::RGN_MASK << offset)) | ((value as u64) << offset),
21328        );
21329    }
21330
21331    /// Returns the value of the `TTB1` field.
21332    pub const fn ttb1(self) -> u32 {
21333        ((self.bits() >> Self::TTB1_SHIFT) & 0b1111111111111111111111111) as u32
21334    }
21335
21336    /// Sets the value of the `TTB1` field.
21337    pub const fn set_ttb1(&mut self, value: u32) {
21338        let offset = Self::TTB1_SHIFT;
21339        assert!(value & (Self::TTB1_MASK as u32) == value);
21340        *self = Self::from_bits_retain(
21341            (self.bits() & !(Self::TTB1_MASK << offset)) | ((value as u64) << offset),
21342        );
21343    }
21344
21345    /// Returns the value of the `ASID` field.
21346    pub const fn asid(self) -> u8 {
21347        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
21348    }
21349
21350    /// Sets the value of the `ASID` field.
21351    pub const fn set_asid(&mut self, value: u8) {
21352        let offset = Self::ASID_SHIFT;
21353        assert!(value & (Self::ASID_MASK as u8) == value);
21354        *self = Self::from_bits_retain(
21355            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
21356        );
21357    }
21358}
21359
21360#[cfg(feature = "el1")]
21361bitflags! {
21362    /// `TTBR1_EL1` system register value.
21363    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21364    #[repr(transparent)]
21365    pub struct Ttbr1El1: u64 {
21366        /// `CnP` bit.
21367        const CNP = 1 << 0;
21368    }
21369}
21370
21371#[cfg(feature = "el1")]
21372impl Ttbr1El1 {
21373    /// Offset of the `CnP` field.
21374    pub const CNP_SHIFT: u32 = 0;
21375    /// Offset of the `BADDR[47:1]` field.
21376    pub const BADDR_47_1_SHIFT: u32 = 1;
21377    /// Mask for the `BADDR[47:1]` field.
21378    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
21379    /// Offset of the `SKL` field.
21380    pub const SKL_SHIFT: u32 = 1;
21381    /// Mask for the `SKL` field.
21382    pub const SKL_MASK: u64 = 0b11;
21383    /// Offset of the `ASID` field.
21384    pub const ASID_SHIFT: u32 = 48;
21385    /// Mask for the `ASID` field.
21386    pub const ASID_MASK: u64 = 0b1111111111111111;
21387
21388    /// Returns the value of the `BADDR[47:1]` field.
21389    pub const fn baddr_47_1(self) -> u64 {
21390        ((self.bits() >> Self::BADDR_47_1_SHIFT)
21391            & 0b11111111111111111111111111111111111111111111111) as u64
21392    }
21393
21394    /// Sets the value of the `BADDR[47:1]` field.
21395    pub const fn set_baddr_47_1(&mut self, value: u64) {
21396        let offset = Self::BADDR_47_1_SHIFT;
21397        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
21398        *self = Self::from_bits_retain(
21399            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
21400        );
21401    }
21402
21403    /// Returns the value of the `SKL` field.
21404    pub const fn skl(self) -> u8 {
21405        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
21406    }
21407
21408    /// Sets the value of the `SKL` field.
21409    pub const fn set_skl(&mut self, value: u8) {
21410        let offset = Self::SKL_SHIFT;
21411        assert!(value & (Self::SKL_MASK as u8) == value);
21412        *self = Self::from_bits_retain(
21413            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
21414        );
21415    }
21416
21417    /// Returns the value of the `ASID` field.
21418    pub const fn asid(self) -> u16 {
21419        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
21420    }
21421
21422    /// Sets the value of the `ASID` field.
21423    pub const fn set_asid(&mut self, value: u16) {
21424        let offset = Self::ASID_SHIFT;
21425        assert!(value & (Self::ASID_MASK as u16) == value);
21426        *self = Self::from_bits_retain(
21427            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
21428        );
21429    }
21430}
21431
21432#[cfg(feature = "el2")]
21433bitflags! {
21434    /// `TTBR1_EL2` system register value.
21435    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21436    #[repr(transparent)]
21437    pub struct Ttbr1El2: u64 {
21438        /// `CnP` bit.
21439        const CNP = 1 << 0;
21440    }
21441}
21442
21443#[cfg(feature = "el2")]
21444impl Ttbr1El2 {
21445    /// Offset of the `CnP` field.
21446    pub const CNP_SHIFT: u32 = 0;
21447    /// Offset of the `BADDR[47:1]` field.
21448    pub const BADDR_47_1_SHIFT: u32 = 1;
21449    /// Mask for the `BADDR[47:1]` field.
21450    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
21451    /// Offset of the `SKL` field.
21452    pub const SKL_SHIFT: u32 = 1;
21453    /// Mask for the `SKL` field.
21454    pub const SKL_MASK: u64 = 0b11;
21455    /// Offset of the `ASID` field.
21456    pub const ASID_SHIFT: u32 = 48;
21457    /// Mask for the `ASID` field.
21458    pub const ASID_MASK: u64 = 0b1111111111111111;
21459
21460    /// Returns the value of the `BADDR[47:1]` field.
21461    pub const fn baddr_47_1(self) -> u64 {
21462        ((self.bits() >> Self::BADDR_47_1_SHIFT)
21463            & 0b11111111111111111111111111111111111111111111111) as u64
21464    }
21465
21466    /// Sets the value of the `BADDR[47:1]` field.
21467    pub const fn set_baddr_47_1(&mut self, value: u64) {
21468        let offset = Self::BADDR_47_1_SHIFT;
21469        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
21470        *self = Self::from_bits_retain(
21471            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
21472        );
21473    }
21474
21475    /// Returns the value of the `SKL` field.
21476    pub const fn skl(self) -> u8 {
21477        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
21478    }
21479
21480    /// Sets the value of the `SKL` field.
21481    pub const fn set_skl(&mut self, value: u8) {
21482        let offset = Self::SKL_SHIFT;
21483        assert!(value & (Self::SKL_MASK as u8) == value);
21484        *self = Self::from_bits_retain(
21485            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
21486        );
21487    }
21488
21489    /// Returns the value of the `ASID` field.
21490    pub const fn asid(self) -> u16 {
21491        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
21492    }
21493
21494    /// Sets the value of the `ASID` field.
21495    pub const fn set_asid(&mut self, value: u16) {
21496        let offset = Self::ASID_SHIFT;
21497        assert!(value & (Self::ASID_MASK as u16) == value);
21498        *self = Self::from_bits_retain(
21499            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
21500        );
21501    }
21502}
21503
21504bitflags! {
21505    /// `VBAR` system register value.
21506    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21507    #[repr(transparent)]
21508    pub struct Vbar: u32 {
21509    }
21510}
21511
21512impl Vbar {
21513    /// Offset of the `VBA` field.
21514    pub const VBA_SHIFT: u32 = 5;
21515    /// Mask for the `VBA` field.
21516    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
21517
21518    /// Returns the value of the `VBA` field.
21519    pub const fn vba(self) -> u32 {
21520        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
21521    }
21522
21523    /// Sets the value of the `VBA` field.
21524    pub const fn set_vba(&mut self, value: u32) {
21525        let offset = Self::VBA_SHIFT;
21526        assert!(value & (Self::VBA_MASK as u32) == value);
21527        *self = Self::from_bits_retain(
21528            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
21529        );
21530    }
21531}
21532
21533#[cfg(feature = "el1")]
21534bitflags! {
21535    /// `VBAR_EL1` system register value.
21536    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21537    #[repr(transparent)]
21538    pub struct VbarEl1: u64 {
21539        /// `UT` bit.
21540        const UT = 1 << 0;
21541    }
21542}
21543
21544#[cfg(feature = "el1")]
21545impl VbarEl1 {
21546    /// Offset of the `UT` field.
21547    pub const UT_SHIFT: u32 = 0;
21548    /// Offset of the `VBA` field.
21549    pub const VBA_SHIFT: u32 = 11;
21550    /// Mask for the `VBA` field.
21551    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
21552
21553    /// Returns the value of the `VBA` field.
21554    pub const fn vba(self) -> u64 {
21555        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
21556            as u64
21557    }
21558
21559    /// Sets the value of the `VBA` field.
21560    pub const fn set_vba(&mut self, value: u64) {
21561        let offset = Self::VBA_SHIFT;
21562        assert!(value & (Self::VBA_MASK as u64) == value);
21563        *self = Self::from_bits_retain(
21564            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u64) << offset),
21565        );
21566    }
21567}
21568
21569#[cfg(feature = "el2")]
21570bitflags! {
21571    /// `VBAR_EL2` system register value.
21572    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21573    #[repr(transparent)]
21574    pub struct VbarEl2: u64 {
21575        /// `UT` bit.
21576        const UT = 1 << 0;
21577    }
21578}
21579
21580#[cfg(feature = "el2")]
21581impl VbarEl2 {
21582    /// Offset of the `UT` field.
21583    pub const UT_SHIFT: u32 = 0;
21584    /// Offset of the `VBA` field.
21585    pub const VBA_SHIFT: u32 = 11;
21586    /// Mask for the `VBA` field.
21587    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
21588
21589    /// Returns the value of the `VBA` field.
21590    pub const fn vba(self) -> u64 {
21591        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
21592            as u64
21593    }
21594
21595    /// Sets the value of the `VBA` field.
21596    pub const fn set_vba(&mut self, value: u64) {
21597        let offset = Self::VBA_SHIFT;
21598        assert!(value & (Self::VBA_MASK as u64) == value);
21599        *self = Self::from_bits_retain(
21600            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u64) << offset),
21601        );
21602    }
21603}
21604
21605bitflags! {
21606    /// `VDFSR` system register value.
21607    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21608    #[repr(transparent)]
21609    pub struct Vdfsr: u32 {
21610        /// `ExT` bit.
21611        const EXT = 1 << 12;
21612    }
21613}
21614
21615impl Vdfsr {
21616    /// Offset of the `ExT` field.
21617    pub const EXT_SHIFT: u32 = 12;
21618    /// Offset of the `AET` field.
21619    pub const AET_SHIFT: u32 = 14;
21620    /// Mask for the `AET` field.
21621    pub const AET_MASK: u32 = 0b11;
21622
21623    /// Returns the value of the `AET` field.
21624    pub const fn aet(self) -> u8 {
21625        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
21626    }
21627
21628    /// Sets the value of the `AET` field.
21629    pub const fn set_aet(&mut self, value: u8) {
21630        let offset = Self::AET_SHIFT;
21631        assert!(value & (Self::AET_MASK as u8) == value);
21632        *self = Self::from_bits_retain(
21633            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
21634        );
21635    }
21636}
21637
21638bitflags! {
21639    /// `VDISR` system register value.
21640    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21641    #[repr(transparent)]
21642    pub struct Vdisr: u32 {
21643        /// `LPAE` bit.
21644        const LPAE = 1 << 9;
21645        /// `ExT` bit.
21646        const EXT = 1 << 12;
21647        /// `A` bit.
21648        const A = 1 << 31;
21649    }
21650}
21651
21652impl Vdisr {
21653    /// Offset of the `STATUS` field.
21654    pub const STATUS_SHIFT: u32 = 0;
21655    /// Mask for the `STATUS` field.
21656    pub const STATUS_MASK: u32 = 0b111111;
21657    /// Offset of the `LPAE` field.
21658    pub const LPAE_SHIFT: u32 = 9;
21659    /// Offset of the `ExT` field.
21660    pub const EXT_SHIFT: u32 = 12;
21661    /// Offset of the `AET` field.
21662    pub const AET_SHIFT: u32 = 14;
21663    /// Mask for the `AET` field.
21664    pub const AET_MASK: u32 = 0b11;
21665    /// Offset of the `A` field.
21666    pub const A_SHIFT: u32 = 31;
21667
21668    /// Returns the value of the `STATUS` field.
21669    pub const fn status(self) -> u8 {
21670        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
21671    }
21672
21673    /// Sets the value of the `STATUS` field.
21674    pub const fn set_status(&mut self, value: u8) {
21675        let offset = Self::STATUS_SHIFT;
21676        assert!(value & (Self::STATUS_MASK as u8) == value);
21677        *self = Self::from_bits_retain(
21678            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
21679        );
21680    }
21681
21682    /// Returns the value of the `AET` field.
21683    pub const fn aet(self) -> u8 {
21684        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
21685    }
21686
21687    /// Sets the value of the `AET` field.
21688    pub const fn set_aet(&mut self, value: u8) {
21689        let offset = Self::AET_SHIFT;
21690        assert!(value & (Self::AET_MASK as u8) == value);
21691        *self = Self::from_bits_retain(
21692            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
21693        );
21694    }
21695}
21696
21697#[cfg(feature = "el2")]
21698bitflags! {
21699    /// `VDISR_EL2` system register value.
21700    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21701    #[repr(transparent)]
21702    pub struct VdisrEl2: u64 {
21703        /// `LPAE` bit.
21704        const LPAE = 1 << 9;
21705        /// `ExT` bit.
21706        const EXT = 1 << 12;
21707        /// `IDS` bit.
21708        const IDS = 1 << 24;
21709        /// `A` bit.
21710        const A = 1 << 31;
21711    }
21712}
21713
21714#[cfg(feature = "el2")]
21715impl VdisrEl2 {
21716    /// Offset of the `ISS` field.
21717    pub const ISS_SHIFT: u32 = 0;
21718    /// Mask for the `ISS` field.
21719    pub const ISS_MASK: u64 = 0b111111111111111111111111;
21720    /// Offset of the `STATUS` field.
21721    pub const STATUS_SHIFT: u32 = 0;
21722    /// Mask for the `STATUS` field.
21723    pub const STATUS_MASK: u64 = 0b111111;
21724    /// Offset of the `LPAE` field.
21725    pub const LPAE_SHIFT: u32 = 9;
21726    /// Offset of the `ExT` field.
21727    pub const EXT_SHIFT: u32 = 12;
21728    /// Offset of the `AET` field.
21729    pub const AET_SHIFT: u32 = 14;
21730    /// Mask for the `AET` field.
21731    pub const AET_MASK: u64 = 0b11;
21732    /// Offset of the `IDS` field.
21733    pub const IDS_SHIFT: u32 = 24;
21734    /// Offset of the `A` field.
21735    pub const A_SHIFT: u32 = 31;
21736
21737    /// Returns the value of the `ISS` field.
21738    pub const fn iss(self) -> u32 {
21739        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
21740    }
21741
21742    /// Sets the value of the `ISS` field.
21743    pub const fn set_iss(&mut self, value: u32) {
21744        let offset = Self::ISS_SHIFT;
21745        assert!(value & (Self::ISS_MASK as u32) == value);
21746        *self = Self::from_bits_retain(
21747            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
21748        );
21749    }
21750
21751    /// Returns the value of the `STATUS` field.
21752    pub const fn status(self) -> u8 {
21753        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
21754    }
21755
21756    /// Sets the value of the `STATUS` field.
21757    pub const fn set_status(&mut self, value: u8) {
21758        let offset = Self::STATUS_SHIFT;
21759        assert!(value & (Self::STATUS_MASK as u8) == value);
21760        *self = Self::from_bits_retain(
21761            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u64) << offset),
21762        );
21763    }
21764
21765    /// Returns the value of the `AET` field.
21766    pub const fn aet(self) -> u8 {
21767        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
21768    }
21769
21770    /// Sets the value of the `AET` field.
21771    pub const fn set_aet(&mut self, value: u8) {
21772        let offset = Self::AET_SHIFT;
21773        assert!(value & (Self::AET_MASK as u8) == value);
21774        *self = Self::from_bits_retain(
21775            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
21776        );
21777    }
21778}
21779
21780bitflags! {
21781    /// `VMPIDR` system register value.
21782    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21783    #[repr(transparent)]
21784    pub struct Vmpidr: u32 {
21785        /// `MT` bit.
21786        const MT = 1 << 24;
21787        /// `U` bit.
21788        const U = 1 << 30;
21789        /// `M` bit.
21790        const M = 1 << 31;
21791    }
21792}
21793
21794impl Vmpidr {
21795    /// Offset of the `Aff0` field.
21796    pub const AFF0_SHIFT: u32 = 0;
21797    /// Mask for the `Aff0` field.
21798    pub const AFF0_MASK: u32 = 0b11111111;
21799    /// Offset of the `Aff1` field.
21800    pub const AFF1_SHIFT: u32 = 8;
21801    /// Mask for the `Aff1` field.
21802    pub const AFF1_MASK: u32 = 0b11111111;
21803    /// Offset of the `Aff2` field.
21804    pub const AFF2_SHIFT: u32 = 16;
21805    /// Mask for the `Aff2` field.
21806    pub const AFF2_MASK: u32 = 0b11111111;
21807    /// Offset of the `MT` field.
21808    pub const MT_SHIFT: u32 = 24;
21809    /// Offset of the `U` field.
21810    pub const U_SHIFT: u32 = 30;
21811    /// Offset of the `M` field.
21812    pub const M_SHIFT: u32 = 31;
21813
21814    /// Returns the value of the `Aff0` field.
21815    pub const fn aff0(self) -> u8 {
21816        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
21817    }
21818
21819    /// Sets the value of the `Aff0` field.
21820    pub const fn set_aff0(&mut self, value: u8) {
21821        let offset = Self::AFF0_SHIFT;
21822        assert!(value & (Self::AFF0_MASK as u8) == value);
21823        *self = Self::from_bits_retain(
21824            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u32) << offset),
21825        );
21826    }
21827
21828    /// Returns the value of the `Aff1` field.
21829    pub const fn aff1(self) -> u8 {
21830        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
21831    }
21832
21833    /// Sets the value of the `Aff1` field.
21834    pub const fn set_aff1(&mut self, value: u8) {
21835        let offset = Self::AFF1_SHIFT;
21836        assert!(value & (Self::AFF1_MASK as u8) == value);
21837        *self = Self::from_bits_retain(
21838            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u32) << offset),
21839        );
21840    }
21841
21842    /// Returns the value of the `Aff2` field.
21843    pub const fn aff2(self) -> u8 {
21844        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
21845    }
21846
21847    /// Sets the value of the `Aff2` field.
21848    pub const fn set_aff2(&mut self, value: u8) {
21849        let offset = Self::AFF2_SHIFT;
21850        assert!(value & (Self::AFF2_MASK as u8) == value);
21851        *self = Self::from_bits_retain(
21852            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u32) << offset),
21853        );
21854    }
21855}
21856
21857#[cfg(feature = "el2")]
21858bitflags! {
21859    /// `VMPIDR_EL2` system register value.
21860    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21861    #[repr(transparent)]
21862    pub struct VmpidrEl2: u64 {
21863        /// RES1 bits in the `VMPIDR_EL2` register.
21864        const RES1 = 0b10000000000000000000000000000000;
21865        /// `MT` bit.
21866        const MT = 1 << 24;
21867        /// `U` bit.
21868        const U = 1 << 30;
21869    }
21870}
21871
21872#[cfg(feature = "el2")]
21873impl VmpidrEl2 {
21874    /// Offset of the `Aff0` field.
21875    pub const AFF0_SHIFT: u32 = 0;
21876    /// Mask for the `Aff0` field.
21877    pub const AFF0_MASK: u64 = 0b11111111;
21878    /// Offset of the `Aff1` field.
21879    pub const AFF1_SHIFT: u32 = 8;
21880    /// Mask for the `Aff1` field.
21881    pub const AFF1_MASK: u64 = 0b11111111;
21882    /// Offset of the `Aff2` field.
21883    pub const AFF2_SHIFT: u32 = 16;
21884    /// Mask for the `Aff2` field.
21885    pub const AFF2_MASK: u64 = 0b11111111;
21886    /// Offset of the `MT` field.
21887    pub const MT_SHIFT: u32 = 24;
21888    /// Offset of the `U` field.
21889    pub const U_SHIFT: u32 = 30;
21890    /// Offset of the `Aff3` field.
21891    pub const AFF3_SHIFT: u32 = 32;
21892    /// Mask for the `Aff3` field.
21893    pub const AFF3_MASK: u64 = 0b11111111;
21894
21895    /// Returns the value of the `Aff0` field.
21896    pub const fn aff0(self) -> u8 {
21897        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
21898    }
21899
21900    /// Sets the value of the `Aff0` field.
21901    pub const fn set_aff0(&mut self, value: u8) {
21902        let offset = Self::AFF0_SHIFT;
21903        assert!(value & (Self::AFF0_MASK as u8) == value);
21904        *self = Self::from_bits_retain(
21905            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u64) << offset),
21906        );
21907    }
21908
21909    /// Returns the value of the `Aff1` field.
21910    pub const fn aff1(self) -> u8 {
21911        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
21912    }
21913
21914    /// Sets the value of the `Aff1` field.
21915    pub const fn set_aff1(&mut self, value: u8) {
21916        let offset = Self::AFF1_SHIFT;
21917        assert!(value & (Self::AFF1_MASK as u8) == value);
21918        *self = Self::from_bits_retain(
21919            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
21920        );
21921    }
21922
21923    /// Returns the value of the `Aff2` field.
21924    pub const fn aff2(self) -> u8 {
21925        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
21926    }
21927
21928    /// Sets the value of the `Aff2` field.
21929    pub const fn set_aff2(&mut self, value: u8) {
21930        let offset = Self::AFF2_SHIFT;
21931        assert!(value & (Self::AFF2_MASK as u8) == value);
21932        *self = Self::from_bits_retain(
21933            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
21934        );
21935    }
21936
21937    /// Returns the value of the `Aff3` field.
21938    pub const fn aff3(self) -> u8 {
21939        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
21940    }
21941
21942    /// Sets the value of the `Aff3` field.
21943    pub const fn set_aff3(&mut self, value: u8) {
21944        let offset = Self::AFF3_SHIFT;
21945        assert!(value & (Self::AFF3_MASK as u8) == value);
21946        *self = Self::from_bits_retain(
21947            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
21948        );
21949    }
21950}
21951
21952bitflags! {
21953    /// `VPIDR` system register value.
21954    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21955    #[repr(transparent)]
21956    pub struct Vpidr: u32 {
21957    }
21958}
21959
21960impl Vpidr {
21961    /// Offset of the `Revision` field.
21962    pub const REVISION_SHIFT: u32 = 0;
21963    /// Mask for the `Revision` field.
21964    pub const REVISION_MASK: u32 = 0b1111;
21965    /// Offset of the `PartNum` field.
21966    pub const PARTNUM_SHIFT: u32 = 4;
21967    /// Mask for the `PartNum` field.
21968    pub const PARTNUM_MASK: u32 = 0b111111111111;
21969    /// Offset of the `Architecture` field.
21970    pub const ARCHITECTURE_SHIFT: u32 = 16;
21971    /// Mask for the `Architecture` field.
21972    pub const ARCHITECTURE_MASK: u32 = 0b1111;
21973    /// Offset of the `Variant` field.
21974    pub const VARIANT_SHIFT: u32 = 20;
21975    /// Mask for the `Variant` field.
21976    pub const VARIANT_MASK: u32 = 0b1111;
21977    /// Offset of the `Implementer` field.
21978    pub const IMPLEMENTER_SHIFT: u32 = 24;
21979    /// Mask for the `Implementer` field.
21980    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
21981
21982    /// Returns the value of the `Revision` field.
21983    pub const fn revision(self) -> u8 {
21984        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
21985    }
21986
21987    /// Sets the value of the `Revision` field.
21988    pub const fn set_revision(&mut self, value: u8) {
21989        let offset = Self::REVISION_SHIFT;
21990        assert!(value & (Self::REVISION_MASK as u8) == value);
21991        *self = Self::from_bits_retain(
21992            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u32) << offset),
21993        );
21994    }
21995
21996    /// Returns the value of the `PartNum` field.
21997    pub const fn partnum(self) -> u16 {
21998        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
21999    }
22000
22001    /// Sets the value of the `PartNum` field.
22002    pub const fn set_partnum(&mut self, value: u16) {
22003        let offset = Self::PARTNUM_SHIFT;
22004        assert!(value & (Self::PARTNUM_MASK as u16) == value);
22005        *self = Self::from_bits_retain(
22006            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u32) << offset),
22007        );
22008    }
22009
22010    /// Returns the value of the `Architecture` field.
22011    pub const fn architecture(self) -> u8 {
22012        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
22013    }
22014
22015    /// Sets the value of the `Architecture` field.
22016    pub const fn set_architecture(&mut self, value: u8) {
22017        let offset = Self::ARCHITECTURE_SHIFT;
22018        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
22019        *self = Self::from_bits_retain(
22020            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u32) << offset),
22021        );
22022    }
22023
22024    /// Returns the value of the `Variant` field.
22025    pub const fn variant(self) -> u8 {
22026        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
22027    }
22028
22029    /// Sets the value of the `Variant` field.
22030    pub const fn set_variant(&mut self, value: u8) {
22031        let offset = Self::VARIANT_SHIFT;
22032        assert!(value & (Self::VARIANT_MASK as u8) == value);
22033        *self = Self::from_bits_retain(
22034            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u32) << offset),
22035        );
22036    }
22037
22038    /// Returns the value of the `Implementer` field.
22039    pub const fn implementer(self) -> u8 {
22040        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
22041    }
22042
22043    /// Sets the value of the `Implementer` field.
22044    pub const fn set_implementer(&mut self, value: u8) {
22045        let offset = Self::IMPLEMENTER_SHIFT;
22046        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
22047        *self = Self::from_bits_retain(
22048            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u32) << offset),
22049        );
22050    }
22051}
22052
22053#[cfg(feature = "el2")]
22054bitflags! {
22055    /// `VPIDR_EL2` system register value.
22056    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22057    #[repr(transparent)]
22058    pub struct VpidrEl2: u64 {
22059    }
22060}
22061
22062#[cfg(feature = "el2")]
22063impl VpidrEl2 {
22064    /// Offset of the `Revision` field.
22065    pub const REVISION_SHIFT: u32 = 0;
22066    /// Mask for the `Revision` field.
22067    pub const REVISION_MASK: u64 = 0b1111;
22068    /// Offset of the `PartNum` field.
22069    pub const PARTNUM_SHIFT: u32 = 4;
22070    /// Mask for the `PartNum` field.
22071    pub const PARTNUM_MASK: u64 = 0b111111111111;
22072    /// Offset of the `Architecture` field.
22073    pub const ARCHITECTURE_SHIFT: u32 = 16;
22074    /// Mask for the `Architecture` field.
22075    pub const ARCHITECTURE_MASK: u64 = 0b1111;
22076    /// Offset of the `Variant` field.
22077    pub const VARIANT_SHIFT: u32 = 20;
22078    /// Mask for the `Variant` field.
22079    pub const VARIANT_MASK: u64 = 0b1111;
22080    /// Offset of the `Implementer` field.
22081    pub const IMPLEMENTER_SHIFT: u32 = 24;
22082    /// Mask for the `Implementer` field.
22083    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
22084
22085    /// Returns the value of the `Revision` field.
22086    pub const fn revision(self) -> u8 {
22087        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
22088    }
22089
22090    /// Sets the value of the `Revision` field.
22091    pub const fn set_revision(&mut self, value: u8) {
22092        let offset = Self::REVISION_SHIFT;
22093        assert!(value & (Self::REVISION_MASK as u8) == value);
22094        *self = Self::from_bits_retain(
22095            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u64) << offset),
22096        );
22097    }
22098
22099    /// Returns the value of the `PartNum` field.
22100    pub const fn partnum(self) -> u16 {
22101        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
22102    }
22103
22104    /// Sets the value of the `PartNum` field.
22105    pub const fn set_partnum(&mut self, value: u16) {
22106        let offset = Self::PARTNUM_SHIFT;
22107        assert!(value & (Self::PARTNUM_MASK as u16) == value);
22108        *self = Self::from_bits_retain(
22109            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u64) << offset),
22110        );
22111    }
22112
22113    /// Returns the value of the `Architecture` field.
22114    pub const fn architecture(self) -> u8 {
22115        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
22116    }
22117
22118    /// Sets the value of the `Architecture` field.
22119    pub const fn set_architecture(&mut self, value: u8) {
22120        let offset = Self::ARCHITECTURE_SHIFT;
22121        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
22122        *self = Self::from_bits_retain(
22123            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u64) << offset),
22124        );
22125    }
22126
22127    /// Returns the value of the `Variant` field.
22128    pub const fn variant(self) -> u8 {
22129        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
22130    }
22131
22132    /// Sets the value of the `Variant` field.
22133    pub const fn set_variant(&mut self, value: u8) {
22134        let offset = Self::VARIANT_SHIFT;
22135        assert!(value & (Self::VARIANT_MASK as u8) == value);
22136        *self = Self::from_bits_retain(
22137            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u64) << offset),
22138        );
22139    }
22140
22141    /// Returns the value of the `Implementer` field.
22142    pub const fn implementer(self) -> u8 {
22143        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
22144    }
22145
22146    /// Sets the value of the `Implementer` field.
22147    pub const fn set_implementer(&mut self, value: u8) {
22148        let offset = Self::IMPLEMENTER_SHIFT;
22149        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
22150        *self = Self::from_bits_retain(
22151            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u64) << offset),
22152        );
22153    }
22154}
22155
22156#[cfg(feature = "el2")]
22157bitflags! {
22158    /// `VSESR_EL2` system register value.
22159    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22160    #[repr(transparent)]
22161    pub struct VsesrEl2: u64 {
22162        /// `ExT` bit.
22163        const EXT = 1 << 12;
22164        /// `IDS` bit.
22165        const IDS = 1 << 24;
22166    }
22167}
22168
22169#[cfg(feature = "el2")]
22170impl VsesrEl2 {
22171    /// Offset of the `ISS` field.
22172    pub const ISS_SHIFT: u32 = 0;
22173    /// Mask for the `ISS` field.
22174    pub const ISS_MASK: u64 = 0b111111111111111111111111;
22175    /// Offset of the `ExT` field.
22176    pub const EXT_SHIFT: u32 = 12;
22177    /// Offset of the `AET` field.
22178    pub const AET_SHIFT: u32 = 14;
22179    /// Mask for the `AET` field.
22180    pub const AET_MASK: u64 = 0b11;
22181    /// Offset of the `IDS` field.
22182    pub const IDS_SHIFT: u32 = 24;
22183
22184    /// Returns the value of the `ISS` field.
22185    pub const fn iss(self) -> u32 {
22186        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
22187    }
22188
22189    /// Sets the value of the `ISS` field.
22190    pub const fn set_iss(&mut self, value: u32) {
22191        let offset = Self::ISS_SHIFT;
22192        assert!(value & (Self::ISS_MASK as u32) == value);
22193        *self = Self::from_bits_retain(
22194            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
22195        );
22196    }
22197
22198    /// Returns the value of the `AET` field.
22199    pub const fn aet(self) -> u8 {
22200        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
22201    }
22202
22203    /// Sets the value of the `AET` field.
22204    pub const fn set_aet(&mut self, value: u8) {
22205        let offset = Self::AET_SHIFT;
22206        assert!(value & (Self::AET_MASK as u8) == value);
22207        *self = Self::from_bits_retain(
22208            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
22209        );
22210    }
22211}
22212
22213bitflags! {
22214    /// `VTCR` system register value.
22215    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22216    #[repr(transparent)]
22217    pub struct Vtcr: u32 {
22218        /// RES1 bits in the `VTCR` register.
22219        const RES1 = 0b10000000000000000000000000000000;
22220        /// `S` bit.
22221        const S = 1 << 4;
22222        /// `HWU59` bit.
22223        const HWU59 = 1 << 25;
22224        /// `HWU60` bit.
22225        const HWU60 = 1 << 26;
22226        /// `HWU61` bit.
22227        const HWU61 = 1 << 27;
22228        /// `HWU62` bit.
22229        const HWU62 = 1 << 28;
22230    }
22231}
22232
22233impl Vtcr {
22234    /// Offset of the `T0SZ` field.
22235    pub const T0SZ_SHIFT: u32 = 0;
22236    /// Mask for the `T0SZ` field.
22237    pub const T0SZ_MASK: u32 = 0b1111;
22238    /// Offset of the `S` field.
22239    pub const S_SHIFT: u32 = 4;
22240    /// Offset of the `SL0` field.
22241    pub const SL0_SHIFT: u32 = 6;
22242    /// Mask for the `SL0` field.
22243    pub const SL0_MASK: u32 = 0b11;
22244    /// Offset of the `IRGN0` field.
22245    pub const IRGN0_SHIFT: u32 = 8;
22246    /// Mask for the `IRGN0` field.
22247    pub const IRGN0_MASK: u32 = 0b11;
22248    /// Offset of the `ORGN0` field.
22249    pub const ORGN0_SHIFT: u32 = 10;
22250    /// Mask for the `ORGN0` field.
22251    pub const ORGN0_MASK: u32 = 0b11;
22252    /// Offset of the `SH0` field.
22253    pub const SH0_SHIFT: u32 = 12;
22254    /// Mask for the `SH0` field.
22255    pub const SH0_MASK: u32 = 0b11;
22256    /// Offset of the `HWU59` field.
22257    pub const HWU59_SHIFT: u32 = 25;
22258    /// Offset of the `HWU60` field.
22259    pub const HWU60_SHIFT: u32 = 26;
22260    /// Offset of the `HWU61` field.
22261    pub const HWU61_SHIFT: u32 = 27;
22262    /// Offset of the `HWU62` field.
22263    pub const HWU62_SHIFT: u32 = 28;
22264
22265    /// Returns the value of the `T0SZ` field.
22266    pub const fn t0sz(self) -> u8 {
22267        ((self.bits() >> Self::T0SZ_SHIFT) & 0b1111) as u8
22268    }
22269
22270    /// Sets the value of the `T0SZ` field.
22271    pub const fn set_t0sz(&mut self, value: u8) {
22272        let offset = Self::T0SZ_SHIFT;
22273        assert!(value & (Self::T0SZ_MASK as u8) == value);
22274        *self = Self::from_bits_retain(
22275            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
22276        );
22277    }
22278
22279    /// Returns the value of the `SL0` field.
22280    pub const fn sl0(self) -> u8 {
22281        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
22282    }
22283
22284    /// Sets the value of the `SL0` field.
22285    pub const fn set_sl0(&mut self, value: u8) {
22286        let offset = Self::SL0_SHIFT;
22287        assert!(value & (Self::SL0_MASK as u8) == value);
22288        *self = Self::from_bits_retain(
22289            (self.bits() & !(Self::SL0_MASK << offset)) | ((value as u32) << offset),
22290        );
22291    }
22292
22293    /// Returns the value of the `IRGN0` field.
22294    pub const fn irgn0(self) -> u8 {
22295        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
22296    }
22297
22298    /// Sets the value of the `IRGN0` field.
22299    pub const fn set_irgn0(&mut self, value: u8) {
22300        let offset = Self::IRGN0_SHIFT;
22301        assert!(value & (Self::IRGN0_MASK as u8) == value);
22302        *self = Self::from_bits_retain(
22303            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
22304        );
22305    }
22306
22307    /// Returns the value of the `ORGN0` field.
22308    pub const fn orgn0(self) -> u8 {
22309        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
22310    }
22311
22312    /// Sets the value of the `ORGN0` field.
22313    pub const fn set_orgn0(&mut self, value: u8) {
22314        let offset = Self::ORGN0_SHIFT;
22315        assert!(value & (Self::ORGN0_MASK as u8) == value);
22316        *self = Self::from_bits_retain(
22317            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
22318        );
22319    }
22320
22321    /// Returns the value of the `SH0` field.
22322    pub const fn sh0(self) -> u8 {
22323        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
22324    }
22325
22326    /// Sets the value of the `SH0` field.
22327    pub const fn set_sh0(&mut self, value: u8) {
22328        let offset = Self::SH0_SHIFT;
22329        assert!(value & (Self::SH0_MASK as u8) == value);
22330        *self = Self::from_bits_retain(
22331            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
22332        );
22333    }
22334}
22335
22336#[cfg(feature = "el2")]
22337bitflags! {
22338    /// `VTCR_EL2` system register value.
22339    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22340    #[repr(transparent)]
22341    pub struct VtcrEl2: u64 {
22342        /// RES1 bits in the `VTCR_EL2` register.
22343        const RES1 = 0b10000000000000000000000000000000;
22344        /// `VS` bit.
22345        const VS = 1 << 19;
22346        /// `HA` bit.
22347        const HA = 1 << 21;
22348        /// `HD` bit.
22349        const HD = 1 << 22;
22350        /// `HWU59` bit.
22351        const HWU59 = 1 << 25;
22352        /// `HWU60` bit.
22353        const HWU60 = 1 << 26;
22354        /// `HWU61` bit.
22355        const HWU61 = 1 << 27;
22356        /// `HWU62` bit.
22357        const HWU62 = 1 << 28;
22358        /// `NSW` bit.
22359        const NSW = 1 << 29;
22360        /// `NSA` bit.
22361        const NSA = 1 << 30;
22362        /// `DS` bit.
22363        const DS = 1 << 32;
22364        /// `SL2` bit.
22365        const SL2 = 1 << 33;
22366        /// `AssuredOnly` bit.
22367        const ASSUREDONLY = 1 << 34;
22368        /// `TL1` bit.
22369        const TL1 = 1 << 35;
22370        /// `S2PIE` bit.
22371        const S2PIE = 1 << 36;
22372        /// `S2POE` bit.
22373        const S2POE = 1 << 37;
22374        /// `D128` bit.
22375        const D128 = 1 << 38;
22376        /// `GCSH` bit.
22377        const GCSH = 1 << 40;
22378        /// `TL0` bit.
22379        const TL0 = 1 << 41;
22380        /// `HAFT` bit.
22381        const HAFT = 1 << 44;
22382        /// `HDBSS` bit.
22383        const HDBSS = 1 << 45;
22384    }
22385}
22386
22387#[cfg(feature = "el2")]
22388impl VtcrEl2 {
22389    /// Offset of the `T0SZ` field.
22390    pub const T0SZ_SHIFT: u32 = 0;
22391    /// Mask for the `T0SZ` field.
22392    pub const T0SZ_MASK: u64 = 0b111111;
22393    /// Offset of the `SL0` field.
22394    pub const SL0_SHIFT: u32 = 6;
22395    /// Mask for the `SL0` field.
22396    pub const SL0_MASK: u64 = 0b11;
22397    /// Offset of the `IRGN0` field.
22398    pub const IRGN0_SHIFT: u32 = 8;
22399    /// Mask for the `IRGN0` field.
22400    pub const IRGN0_MASK: u64 = 0b11;
22401    /// Offset of the `ORGN0` field.
22402    pub const ORGN0_SHIFT: u32 = 10;
22403    /// Mask for the `ORGN0` field.
22404    pub const ORGN0_MASK: u64 = 0b11;
22405    /// Offset of the `SH0` field.
22406    pub const SH0_SHIFT: u32 = 12;
22407    /// Mask for the `SH0` field.
22408    pub const SH0_MASK: u64 = 0b11;
22409    /// Offset of the `TG0` field.
22410    pub const TG0_SHIFT: u32 = 14;
22411    /// Mask for the `TG0` field.
22412    pub const TG0_MASK: u64 = 0b11;
22413    /// Offset of the `PS` field.
22414    pub const PS_SHIFT: u32 = 16;
22415    /// Mask for the `PS` field.
22416    pub const PS_MASK: u64 = 0b111;
22417    /// Offset of the `VS` field.
22418    pub const VS_SHIFT: u32 = 19;
22419    /// Offset of the `HA` field.
22420    pub const HA_SHIFT: u32 = 21;
22421    /// Offset of the `HD` field.
22422    pub const HD_SHIFT: u32 = 22;
22423    /// Offset of the `HWU59` field.
22424    pub const HWU59_SHIFT: u32 = 25;
22425    /// Offset of the `HWU60` field.
22426    pub const HWU60_SHIFT: u32 = 26;
22427    /// Offset of the `HWU61` field.
22428    pub const HWU61_SHIFT: u32 = 27;
22429    /// Offset of the `HWU62` field.
22430    pub const HWU62_SHIFT: u32 = 28;
22431    /// Offset of the `NSW` field.
22432    pub const NSW_SHIFT: u32 = 29;
22433    /// Offset of the `NSA` field.
22434    pub const NSA_SHIFT: u32 = 30;
22435    /// Offset of the `DS` field.
22436    pub const DS_SHIFT: u32 = 32;
22437    /// Offset of the `SL2` field.
22438    pub const SL2_SHIFT: u32 = 33;
22439    /// Offset of the `AssuredOnly` field.
22440    pub const ASSUREDONLY_SHIFT: u32 = 34;
22441    /// Offset of the `TL1` field.
22442    pub const TL1_SHIFT: u32 = 35;
22443    /// Offset of the `S2PIE` field.
22444    pub const S2PIE_SHIFT: u32 = 36;
22445    /// Offset of the `S2POE` field.
22446    pub const S2POE_SHIFT: u32 = 37;
22447    /// Offset of the `D128` field.
22448    pub const D128_SHIFT: u32 = 38;
22449    /// Offset of the `GCSH` field.
22450    pub const GCSH_SHIFT: u32 = 40;
22451    /// Offset of the `TL0` field.
22452    pub const TL0_SHIFT: u32 = 41;
22453    /// Offset of the `HAFT` field.
22454    pub const HAFT_SHIFT: u32 = 44;
22455    /// Offset of the `HDBSS` field.
22456    pub const HDBSS_SHIFT: u32 = 45;
22457
22458    /// Returns the value of the `T0SZ` field.
22459    pub const fn t0sz(self) -> u8 {
22460        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
22461    }
22462
22463    /// Sets the value of the `T0SZ` field.
22464    pub const fn set_t0sz(&mut self, value: u8) {
22465        let offset = Self::T0SZ_SHIFT;
22466        assert!(value & (Self::T0SZ_MASK as u8) == value);
22467        *self = Self::from_bits_retain(
22468            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
22469        );
22470    }
22471
22472    /// Returns the value of the `SL0` field.
22473    pub const fn sl0(self) -> u8 {
22474        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
22475    }
22476
22477    /// Sets the value of the `SL0` field.
22478    pub const fn set_sl0(&mut self, value: u8) {
22479        let offset = Self::SL0_SHIFT;
22480        assert!(value & (Self::SL0_MASK as u8) == value);
22481        *self = Self::from_bits_retain(
22482            (self.bits() & !(Self::SL0_MASK << offset)) | ((value as u64) << offset),
22483        );
22484    }
22485
22486    /// Returns the value of the `IRGN0` field.
22487    pub const fn irgn0(self) -> u8 {
22488        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
22489    }
22490
22491    /// Sets the value of the `IRGN0` field.
22492    pub const fn set_irgn0(&mut self, value: u8) {
22493        let offset = Self::IRGN0_SHIFT;
22494        assert!(value & (Self::IRGN0_MASK as u8) == value);
22495        *self = Self::from_bits_retain(
22496            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
22497        );
22498    }
22499
22500    /// Returns the value of the `ORGN0` field.
22501    pub const fn orgn0(self) -> u8 {
22502        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
22503    }
22504
22505    /// Sets the value of the `ORGN0` field.
22506    pub const fn set_orgn0(&mut self, value: u8) {
22507        let offset = Self::ORGN0_SHIFT;
22508        assert!(value & (Self::ORGN0_MASK as u8) == value);
22509        *self = Self::from_bits_retain(
22510            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
22511        );
22512    }
22513
22514    /// Returns the value of the `SH0` field.
22515    pub const fn sh0(self) -> u8 {
22516        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
22517    }
22518
22519    /// Sets the value of the `SH0` field.
22520    pub const fn set_sh0(&mut self, value: u8) {
22521        let offset = Self::SH0_SHIFT;
22522        assert!(value & (Self::SH0_MASK as u8) == value);
22523        *self = Self::from_bits_retain(
22524            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
22525        );
22526    }
22527
22528    /// Returns the value of the `TG0` field.
22529    pub const fn tg0(self) -> u8 {
22530        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
22531    }
22532
22533    /// Sets the value of the `TG0` field.
22534    pub const fn set_tg0(&mut self, value: u8) {
22535        let offset = Self::TG0_SHIFT;
22536        assert!(value & (Self::TG0_MASK as u8) == value);
22537        *self = Self::from_bits_retain(
22538            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
22539        );
22540    }
22541
22542    /// Returns the value of the `PS` field.
22543    pub const fn ps(self) -> u8 {
22544        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
22545    }
22546
22547    /// Sets the value of the `PS` field.
22548    pub const fn set_ps(&mut self, value: u8) {
22549        let offset = Self::PS_SHIFT;
22550        assert!(value & (Self::PS_MASK as u8) == value);
22551        *self = Self::from_bits_retain(
22552            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
22553        );
22554    }
22555}
22556
22557bitflags! {
22558    /// `VTTBR` system register value.
22559    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22560    #[repr(transparent)]
22561    pub struct Vttbr: u64 {
22562        /// `CnP` bit.
22563        const CNP = 1 << 0;
22564    }
22565}
22566
22567impl Vttbr {
22568    /// Offset of the `CnP` field.
22569    pub const CNP_SHIFT: u32 = 0;
22570    /// Offset of the `BADDR` field.
22571    pub const BADDR_SHIFT: u32 = 1;
22572    /// Mask for the `BADDR` field.
22573    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
22574    /// Offset of the `VMID` field.
22575    pub const VMID_SHIFT: u32 = 48;
22576    /// Mask for the `VMID` field.
22577    pub const VMID_MASK: u64 = 0b11111111;
22578
22579    /// Returns the value of the `BADDR` field.
22580    pub const fn baddr(self) -> u64 {
22581        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
22582            as u64
22583    }
22584
22585    /// Sets the value of the `BADDR` field.
22586    pub const fn set_baddr(&mut self, value: u64) {
22587        let offset = Self::BADDR_SHIFT;
22588        assert!(value & (Self::BADDR_MASK as u64) == value);
22589        *self = Self::from_bits_retain(
22590            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
22591        );
22592    }
22593
22594    /// Returns the value of the `VMID` field.
22595    pub const fn vmid(self) -> u8 {
22596        ((self.bits() >> Self::VMID_SHIFT) & 0b11111111) as u8
22597    }
22598
22599    /// Sets the value of the `VMID` field.
22600    pub const fn set_vmid(&mut self, value: u8) {
22601        let offset = Self::VMID_SHIFT;
22602        assert!(value & (Self::VMID_MASK as u8) == value);
22603        *self = Self::from_bits_retain(
22604            (self.bits() & !(Self::VMID_MASK << offset)) | ((value as u64) << offset),
22605        );
22606    }
22607}
22608
22609#[cfg(feature = "el2")]
22610bitflags! {
22611    /// `VTTBR_EL2` system register value.
22612    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22613    #[repr(transparent)]
22614    pub struct VttbrEl2: u64 {
22615        /// `CnP` bit.
22616        const CNP = 1 << 0;
22617    }
22618}
22619
22620#[cfg(feature = "el2")]
22621impl VttbrEl2 {
22622    /// Offset of the `CnP` field.
22623    pub const CNP_SHIFT: u32 = 0;
22624    /// Offset of the `BADDR` field.
22625    pub const BADDR_SHIFT: u32 = 1;
22626    /// Mask for the `BADDR` field.
22627    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
22628    /// Offset of the `SKL` field.
22629    pub const SKL_SHIFT: u32 = 1;
22630    /// Mask for the `SKL` field.
22631    pub const SKL_MASK: u64 = 0b11;
22632    /// Offset of the `VMID` field.
22633    pub const VMID_SHIFT: u32 = 48;
22634    /// Mask for the `VMID` field.
22635    pub const VMID_MASK: u64 = 0b1111111111111111;
22636
22637    /// Returns the value of the `BADDR` field.
22638    pub const fn baddr(self) -> u64 {
22639        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
22640            as u64
22641    }
22642
22643    /// Sets the value of the `BADDR` field.
22644    pub const fn set_baddr(&mut self, value: u64) {
22645        let offset = Self::BADDR_SHIFT;
22646        assert!(value & (Self::BADDR_MASK as u64) == value);
22647        *self = Self::from_bits_retain(
22648            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
22649        );
22650    }
22651
22652    /// Returns the value of the `SKL` field.
22653    pub const fn skl(self) -> u8 {
22654        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
22655    }
22656
22657    /// Sets the value of the `SKL` field.
22658    pub const fn set_skl(&mut self, value: u8) {
22659        let offset = Self::SKL_SHIFT;
22660        assert!(value & (Self::SKL_MASK as u8) == value);
22661        *self = Self::from_bits_retain(
22662            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
22663        );
22664    }
22665
22666    /// Returns the value of the `VMID` field.
22667    pub const fn vmid(self) -> u16 {
22668        ((self.bits() >> Self::VMID_SHIFT) & 0b1111111111111111) as u16
22669    }
22670
22671    /// Sets the value of the `VMID` field.
22672    pub const fn set_vmid(&mut self, value: u16) {
22673        let offset = Self::VMID_SHIFT;
22674        assert!(value & (Self::VMID_MASK as u16) == value);
22675        *self = Self::from_bits_retain(
22676            (self.bits() & !(Self::VMID_MASK << offset)) | ((value as u64) << offset),
22677        );
22678    }
22679}
22680
22681#[cfg(feature = "el3")]
22682bitflags! {
22683    /// `ZCR_EL3` system register value.
22684    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22685    #[repr(transparent)]
22686    pub struct ZcrEl3: u64 {
22687    }
22688}
22689
22690#[cfg(feature = "el3")]
22691impl ZcrEl3 {
22692    /// Offset of the `LEN` field.
22693    pub const LEN_SHIFT: u32 = 0;
22694    /// Mask for the `LEN` field.
22695    pub const LEN_MASK: u64 = 0b1111;
22696
22697    /// Returns the value of the `LEN` field.
22698    pub const fn len(self) -> u8 {
22699        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
22700    }
22701
22702    /// Sets the value of the `LEN` field.
22703    pub const fn set_len(&mut self, value: u8) {
22704        let offset = Self::LEN_SHIFT;
22705        assert!(value & (Self::LEN_MASK as u8) == value);
22706        *self = Self::from_bits_retain(
22707            (self.bits() & !(Self::LEN_MASK << offset)) | ((value as u64) << offset),
22708        );
22709    }
22710}
22711
22712#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22713read_write_sysreg!(actlr: (p15, 0, c0, c1, 1), u32, safe_read, fake::SYSREGS);
22714#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22715read_write_sysreg!(actlr2: (p15, 0, c0, c1, 3), u32, safe_read, fake::SYSREGS);
22716#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22717read_write_sysreg!(actlr_el1, u64, safe_read, fake::SYSREGS);
22718#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22719read_write_sysreg!(actlr_el2, u64, safe_read, fake::SYSREGS);
22720#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22721read_write_sysreg!(adfsr: (p15, 0, c1, c5, 0), u32, safe_read, fake::SYSREGS);
22722#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22723read_write_sysreg!(afsr0_el1, u64, safe_read, fake::SYSREGS);
22724#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22725read_write_sysreg!(afsr0_el2, u64, safe_read, fake::SYSREGS);
22726#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22727read_write_sysreg!(afsr1_el1, u64, safe_read, fake::SYSREGS);
22728#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22729read_write_sysreg!(afsr1_el2, u64, safe_read, fake::SYSREGS);
22730#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22731read_sysreg!(aidr: (p15, 1, c0, c0, 7), u32, safe, fake::SYSREGS);
22732#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22733read_write_sysreg!(aifsr: (p15, 0, c1, c5, 1), u32, safe_read, fake::SYSREGS);
22734#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22735read_write_sysreg!(amair0: (p15, 0, c3, c10, 0), u32, safe_read, fake::SYSREGS);
22736#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22737read_write_sysreg!(amair1: (p15, 0, c3, c10, 1), u32, safe_read, fake::SYSREGS);
22738#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22739read_write_sysreg!(amair_el1, u64, safe_read, fake::SYSREGS);
22740#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22741read_write_sysreg!(amair_el2, u64, safe_read, fake::SYSREGS);
22742#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22743read_sysreg!(amcfgr: (p15, 0, c2, c13, 1), u32: Amcfgr, safe, fake::SYSREGS);
22744#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22745read_sysreg!(amcgcr: (p15, 0, c2, c13, 2), u32: Amcgcr, safe, fake::SYSREGS);
22746#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22747read_write_sysreg!(amcntenclr0: (p15, 0, c2, c13, 4), u32: Amcntenclr0, safe_read, fake::SYSREGS);
22748#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22749read_write_sysreg!(amcntenclr1: (p15, 0, c3, c13, 0), u32: Amcntenclr1, safe_read, fake::SYSREGS);
22750#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22751read_write_sysreg!(amcntenset0: (p15, 0, c2, c13, 5), u32: Amcntenset0, safe_read, fake::SYSREGS);
22752#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22753read_write_sysreg!(amcntenset1: (p15, 0, c3, c13, 1), u32: Amcntenset1, safe_read, fake::SYSREGS);
22754#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22755read_write_sysreg!(amcr: (p15, 0, c2, c13, 0), u32: Amcr, safe_read, fake::SYSREGS);
22756#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22757read_write_sysreg!(amuserenr: (p15, 0, c2, c13, 3), u32: Amuserenr, safe_read, fake::SYSREGS);
22758#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22759read_write_sysreg!(apiakeyhi_el1: s3_0_c2_c1_1, u64: ApiakeyhiEl1, safe_read, fake::SYSREGS);
22760#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22761read_write_sysreg!(apiakeylo_el1: s3_0_c2_c1_0, u64: ApiakeyloEl1, safe_read, fake::SYSREGS);
22762#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22763read_sysreg!(ccsidr: (p15, 1, c0, c0, 0), u32: Ccsidr, safe, fake::SYSREGS);
22764#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22765read_sysreg!(ccsidr2: (p15, 1, c0, c0, 2), u32: Ccsidr2, safe, fake::SYSREGS);
22766#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22767read_sysreg!(ccsidr_el1, u64: CcsidrEl1, safe, fake::SYSREGS);
22768#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22769read_sysreg!(clidr: (p15, 1, c0, c0, 1), u32: Clidr, safe, fake::SYSREGS);
22770#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22771read_sysreg!(clidr_el1, u64: ClidrEl1, safe, fake::SYSREGS);
22772#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22773read_write_sysreg!(cntfrq: (p15, 0, c0, c14, 0), u32: Cntfrq, safe_read, fake::SYSREGS);
22774#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
22775read_write_sysreg!(cntfrq_el0, u64: CntfrqEl0, safe_read, safe_write, fake::SYSREGS);
22776#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22777read_write_sysreg!(cnthctl: (p15, 4, c1, c14, 0), u32: Cnthctl, safe_read, fake::SYSREGS);
22778#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22779read_write_sysreg!(cnthctl_el2, u64: CnthctlEl2, safe_read, safe_write, fake::SYSREGS);
22780#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22781read_write_sysreg!(cnthps_ctl: (p15, 0, c2, c14, 1), u32: CnthpsCtl, safe_read, fake::SYSREGS);
22782#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22783read_write_sysreg!(cnthps_cval: (p15, 2, c14), u64: CnthpsCval, safe_read, fake::SYSREGS);
22784#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22785read_write_sysreg!(cnthps_tval: (p15, 0, c2, c14, 0), u32: CnthpsTval, safe_read, fake::SYSREGS);
22786#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22787read_write_sysreg!(cnthp_ctl: (p15, 0, c2, c14, 1), u32: CnthpCtl, safe_read, fake::SYSREGS);
22788#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22789read_write_sysreg!(cnthp_cval: (p15, 2, c14), u64: CnthpCval, safe_read, fake::SYSREGS);
22790#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22791read_write_sysreg!(cnthp_tval: (p15, 0, c2, c14, 0), u32: CnthpTval, safe_read, fake::SYSREGS);
22792#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22793read_write_sysreg!(cnthvs_ctl: (p15, 0, c3, c14, 1), u32: CnthvsCtl, safe_read, fake::SYSREGS);
22794#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22795read_write_sysreg!(cnthvs_cval: (p15, 3, c14), u64: CnthvsCval, safe_read, fake::SYSREGS);
22796#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22797read_write_sysreg!(cnthvs_tval: (p15, 0, c3, c14, 0), u32: CnthvsTval, safe_read, fake::SYSREGS);
22798#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22799read_write_sysreg!(cnthv_ctl: (p15, 0, c3, c14, 1), u32: CnthvCtl, safe_read, fake::SYSREGS);
22800#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22801read_write_sysreg!(cnthv_cval: (p15, 3, c14), u64: CnthvCval, safe_read, fake::SYSREGS);
22802#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22803read_write_sysreg!(cnthv_tval: (p15, 0, c3, c14, 0), u32: CnthvTval, safe_read, fake::SYSREGS);
22804#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22805read_write_sysreg!(cntkctl: (p15, 0, c1, c14, 0), u32: Cntkctl, safe_read, fake::SYSREGS);
22806#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22807read_sysreg!(cntpct: (p15, 0, c14), u64: Cntpct, safe, fake::SYSREGS);
22808#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22809read_sysreg!(cntpctss: (p15, 8, c14), u64: Cntpctss, safe, fake::SYSREGS);
22810#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
22811read_sysreg!(cntpct_el0, u64: CntpctEl0, safe, fake::SYSREGS);
22812#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22813read_write_sysreg!(cntp_ctl: (p15, 0, c2, c14, 1), u32: CntpCtl, safe_read, fake::SYSREGS);
22814#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22815read_write_sysreg!(cntp_cval: (p15, 2, c14), u64: CntpCval, safe_read, fake::SYSREGS);
22816#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22817read_write_sysreg!(cntp_tval: (p15, 0, c2, c14, 0), u32: CntpTval, safe_read, fake::SYSREGS);
22818#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22819read_sysreg!(cntvct: (p15, 1, c14), u64: Cntvct, safe, fake::SYSREGS);
22820#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22821read_sysreg!(cntvctss: (p15, 9, c14), u64: Cntvctss, safe, fake::SYSREGS);
22822#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22823read_write_sysreg!(cntvoff: (p15, 4, c14), u64: Cntvoff, safe_read, fake::SYSREGS);
22824#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22825read_write_sysreg!(cntvoff_el2, u64: CntvoffEl2, safe_read, safe_write, fake::SYSREGS);
22826#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22827read_write_sysreg!(cntv_ctl: (p15, 0, c3, c14, 1), u32: CntvCtl, safe_read, fake::SYSREGS);
22828#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22829read_write_sysreg!(cntv_cval: (p15, 3, c14), u64: CntvCval, safe_read, fake::SYSREGS);
22830#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22831read_write_sysreg!(cntv_tval: (p15, 0, c3, c14, 0), u32: CntvTval, safe_read, fake::SYSREGS);
22832#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22833read_write_sysreg!(contextidr: (p15, 0, c0, c13, 1), u32: Contextidr, safe_read, fake::SYSREGS);
22834#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22835read_write_sysreg!(contextidr_el1, u64: ContextidrEl1, safe_read, safe_write, fake::SYSREGS);
22836#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22837read_write_sysreg!(contextidr_el2: s3_4_c13_c0_1, u64: ContextidrEl2, safe_read, safe_write, fake::SYSREGS);
22838#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22839read_write_sysreg!(cpacr: (p15, 0, c0, c1, 2), u32: Cpacr, safe_read, fake::SYSREGS);
22840#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22841read_write_sysreg!(cpacr_el1, u64: CpacrEl1, safe_read, fake::SYSREGS);
22842#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22843read_write_sysreg!(cptr_el2, u64: CptrEl2, safe_read, fake::SYSREGS);
22844#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
22845read_write_sysreg!(cptr_el3, u64: CptrEl3, safe_read, fake::SYSREGS);
22846#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22847read_write_sysreg!(csselr: (p15, 2, c0, c0, 0), u32: Csselr, safe_read, fake::SYSREGS);
22848#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22849read_write_sysreg!(csselr_el1, u64: CsselrEl1, safe_read, safe_write, fake::SYSREGS);
22850#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22851read_sysreg!(ctr: (p15, 0, c0, c0, 1), u32: Ctr, safe, fake::SYSREGS);
22852#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
22853read_sysreg!(ctr_el0, u64: CtrEl0, safe, fake::SYSREGS);
22854#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
22855read_sysreg!(currentel, u64: Currentel, safe, fake::SYSREGS);
22856#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22857read_write_sysreg!(dacr: (p15, 0, c0, c3, 0), u32: Dacr, safe_read, fake::SYSREGS);
22858#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22859read_sysreg!(dbgauthstatus: (p14, 0, c14, c7, 6), u32: Dbgauthstatus, safe, fake::SYSREGS);
22860#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22861read_write_sysreg!(dbgclaimclr: (p14, 0, c9, c7, 6), u32: Dbgclaimclr, safe_read, fake::SYSREGS);
22862#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22863read_write_sysreg!(dbgclaimset: (p14, 0, c8, c7, 6), u32: Dbgclaimset, safe_read, fake::SYSREGS);
22864#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22865read_write_sysreg!(dbgdccint: (p14, 0, c2, c0, 0), u32: Dbgdccint, safe_read, fake::SYSREGS);
22866#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22867read_sysreg!(dbgdevid: (p14, 0, c2, c7, 7), u32: Dbgdevid, safe, fake::SYSREGS);
22868#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22869read_sysreg!(dbgdevid1: (p14, 0, c1, c7, 7), u32: Dbgdevid1, safe, fake::SYSREGS);
22870#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22871read_sysreg!(dbgdevid2: (p14, 0, c0, c7, 7), u32, safe, fake::SYSREGS);
22872#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22873read_sysreg!(dbgdidr: (p14, 0, c0, c0, 0), u32: Dbgdidr, safe, fake::SYSREGS);
22874#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22875read_sysreg!(dbgdrar: (p14, 0, c1), u64: Dbgdrar, safe, fake::SYSREGS);
22876#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22877read_sysreg!(dbgdsar: (p14, 0, c2), u64, safe, fake::SYSREGS);
22878#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22879read_write_sysreg!(dbgdscrext: (p14, 0, c2, c0, 2), u32: Dbgdscrext, safe_read, fake::SYSREGS);
22880#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22881read_sysreg!(dbgdscrint: (p14, 0, c1, c0, 0), u32: Dbgdscrint, safe, fake::SYSREGS);
22882#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22883read_write_sysreg!(dbgdtrrxext: (p14, 0, c0, c0, 2), u32: Dbgdtrrxext, safe_read, fake::SYSREGS);
22884#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22885read_sysreg!(dbgdtrrxint: (p14, 0, c5, c0, 0), u32: Dbgdtrrxint, safe, fake::SYSREGS);
22886#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22887read_write_sysreg!(dbgdtrtxext: (p14, 0, c3, c0, 2), u32: Dbgdtrtxext, safe_read, fake::SYSREGS);
22888#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22889write_sysreg!(dbgdtrtxint: (p14, 0, c5, c0, 0), u32: Dbgdtrtxint, fake::SYSREGS);
22890#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22891read_write_sysreg!(dbgosdlr: (p14, 0, c3, c1, 4), u32: Dbgosdlr, safe_read, fake::SYSREGS);
22892#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22893read_write_sysreg!(dbgoseccr: (p14, 0, c6, c0, 2), u32: Dbgoseccr, safe_read, fake::SYSREGS);
22894#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22895write_sysreg!(dbgoslar: (p14, 0, c0, c1, 4), u32: Dbgoslar, fake::SYSREGS);
22896#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22897read_sysreg!(dbgoslsr: (p14, 0, c1, c1, 4), u32: Dbgoslsr, safe, fake::SYSREGS);
22898#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22899read_write_sysreg!(dbgprcr: (p14, 0, c4, c1, 4), u32: Dbgprcr, safe_read, fake::SYSREGS);
22900#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22901read_write_sysreg!(dbgvcr: (p14, 0, c7, c0, 0), u32: Dbgvcr, safe_read, fake::SYSREGS);
22902#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22903read_write_sysreg!(dbgwfar: (p14, 0, c6, c0, 0), u32, safe_read, fake::SYSREGS);
22904#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22905read_write_sysreg!(dfar: (p15, 0, c0, c6, 0), u32: Dfar, safe_read, fake::SYSREGS);
22906#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22907read_write_sysreg!(dfsr: (p15, 0, c0, c5, 0), u32: Dfsr, safe_read, fake::SYSREGS);
22908#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22909read_write_sysreg!(disr: (p15, 0, c1, c12, 1), u32: Disr, safe_read, fake::SYSREGS);
22910#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22911read_write_sysreg!(disr_el1: s3_0_c12_c1_1, u64: DisrEl1, safe_read, safe_write, fake::SYSREGS);
22912#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
22913read_write_sysreg!(dit: s3_3_c4_c2_5, u64: Dit, safe_read, safe_write, fake::SYSREGS);
22914#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22915read_write_sysreg!(dlr: (p15, 3, c5, c4, 1), u32: Dlr, safe_read, fake::SYSREGS);
22916#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22917read_write_sysreg!(dspsr: (p15, 3, c5, c4, 0), u32: Dspsr, safe_read, fake::SYSREGS);
22918#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22919read_write_sysreg!(dspsr2: (p15, 3, c5, c4, 2), u32: Dspsr2, safe_read, fake::SYSREGS);
22920#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22921read_write_sysreg!(elr_el1, u64: ElrEl1, safe_read, fake::SYSREGS);
22922#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22923read_write_sysreg!(elr_el2, u64: ElrEl2, safe_read, fake::SYSREGS);
22924#[cfg(all(any(test, feature = "fakes", target_arch = "arm"), feature = "el2"))]
22925read_write_sysreg!(elr_hyp, u32: ElrHyp, safe_read, fake::SYSREGS);
22926#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22927read_sysreg!(erridr: (p15, 0, c3, c5, 0), u32: Erridr, safe, fake::SYSREGS);
22928#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22929read_write_sysreg!(errselr: (p15, 0, c3, c5, 1), u32: Errselr, safe_read, fake::SYSREGS);
22930#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22931read_write_sysreg!(erxaddr: (p15, 0, c4, c5, 3), u32: Erxaddr, safe_read, fake::SYSREGS);
22932#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22933read_write_sysreg!(erxaddr2: (p15, 0, c4, c5, 7), u32: Erxaddr2, safe_read, fake::SYSREGS);
22934#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22935read_write_sysreg!(erxctlr: (p15, 0, c4, c5, 1), u32: Erxctlr, safe_read, fake::SYSREGS);
22936#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22937read_write_sysreg!(erxctlr2: (p15, 0, c4, c5, 5), u32: Erxctlr2, safe_read, fake::SYSREGS);
22938#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22939read_sysreg!(erxfr: (p15, 0, c4, c5, 0), u32: Erxfr, safe, fake::SYSREGS);
22940#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22941read_sysreg!(erxfr2: (p15, 0, c4, c5, 4), u32: Erxfr2, safe, fake::SYSREGS);
22942#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22943read_write_sysreg!(erxmisc0: (p15, 0, c5, c5, 0), u32: Erxmisc0, safe_read, fake::SYSREGS);
22944#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22945read_write_sysreg!(erxmisc1: (p15, 0, c5, c5, 1), u32: Erxmisc1, safe_read, fake::SYSREGS);
22946#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22947read_write_sysreg!(erxmisc2: (p15, 0, c5, c5, 4), u32: Erxmisc2, safe_read, fake::SYSREGS);
22948#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22949read_write_sysreg!(erxmisc3: (p15, 0, c5, c5, 5), u32: Erxmisc3, safe_read, fake::SYSREGS);
22950#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22951read_write_sysreg!(erxmisc4: (p15, 0, c5, c5, 2), u32: Erxmisc4, safe_read, fake::SYSREGS);
22952#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22953read_write_sysreg!(erxmisc5: (p15, 0, c5, c5, 3), u32: Erxmisc5, safe_read, fake::SYSREGS);
22954#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22955read_write_sysreg!(erxmisc6: (p15, 0, c5, c5, 6), u32: Erxmisc6, safe_read, fake::SYSREGS);
22956#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22957read_write_sysreg!(erxmisc7: (p15, 0, c5, c5, 7), u32: Erxmisc7, safe_read, fake::SYSREGS);
22958#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22959read_write_sysreg!(erxstatus: (p15, 0, c4, c5, 2), u32: Erxstatus, safe_read, fake::SYSREGS);
22960#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22961read_write_sysreg!(esr_el1, u64: EsrEl1, safe_read, safe_write, fake::SYSREGS);
22962#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22963read_write_sysreg!(esr_el2, u64: EsrEl2, safe_read, safe_write, fake::SYSREGS);
22964#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
22965read_write_sysreg!(esr_el3, u64: EsrEl3, safe_read, safe_write, fake::SYSREGS);
22966#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22967read_write_sysreg!(far_el1, u64: FarEl1, safe_read, fake::SYSREGS);
22968#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22969read_write_sysreg!(far_el2, u64: FarEl2, safe_read, fake::SYSREGS);
22970#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22971read_write_sysreg!(fcseidr: (p15, 0, c0, c13, 0), u32, safe_read, fake::SYSREGS);
22972#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22973read_write_sysreg!(gcr_el1: s3_0_c1_c0_6, u64: GcrEl1, safe_read, fake::SYSREGS);
22974#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
22975read_write_sysreg!(gcscr_el1: s3_0_c2_c5_0, u64: GcscrEl1, safe_read, fake::SYSREGS);
22976#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22977read_write_sysreg!(gcscr_el2: s3_4_c2_c5_0, u64: GcscrEl2, safe_read, fake::SYSREGS);
22978#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
22979read_write_sysreg!(gpccr_el3: s3_6_c2_c1_6, u64: GpccrEl3, safe_read, fake::SYSREGS);
22980#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
22981read_write_sysreg!(gptbr_el3: s3_6_c2_c1_4, u64: GptbrEl3, safe_read, fake::SYSREGS);
22982#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22983read_write_sysreg!(hacr: (p15, 4, c1, c1, 7), u32, safe_read, fake::SYSREGS);
22984#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
22985read_write_sysreg!(hacr_el2, u64, safe_read, fake::SYSREGS);
22986#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22987read_write_sysreg!(hactlr: (p15, 4, c0, c1, 1), u32, safe_read, fake::SYSREGS);
22988#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22989read_write_sysreg!(hactlr2: (p15, 4, c0, c1, 3), u32, safe_read, fake::SYSREGS);
22990#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22991read_write_sysreg!(hadfsr: (p15, 4, c1, c5, 0), u32, safe_read, fake::SYSREGS);
22992#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22993read_write_sysreg!(haifsr: (p15, 4, c1, c5, 1), u32, safe_read, fake::SYSREGS);
22994#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22995read_write_sysreg!(hamair0: (p15, 4, c3, c10, 0), u32, safe_read, fake::SYSREGS);
22996#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22997read_write_sysreg!(hamair1: (p15, 4, c3, c10, 1), u32, safe_read, fake::SYSREGS);
22998#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
22999read_write_sysreg!(hcptr: (p15, 4, c1, c1, 2), u32: Hcptr, safe_read, fake::SYSREGS);
23000#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23001read_write_sysreg!(hcr: (p15, 4, c1, c1, 0), u32: Hcr, safe_read, fake::SYSREGS);
23002#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23003read_write_sysreg!(hcr2: (p15, 4, c1, c1, 4), u32: Hcr2, safe_read, fake::SYSREGS);
23004#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23005read_write_sysreg!(hcrx_el2: s3_4_c1_c2_2, u64: HcrxEl2, safe_read, fake::SYSREGS);
23006#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23007read_write_sysreg!(hcr_el2, u64: HcrEl2, safe_read, fake::SYSREGS);
23008#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23009read_write_sysreg!(hdcr: (p15, 4, c1, c1, 1), u32: Hdcr, safe_read, fake::SYSREGS);
23010#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23011read_write_sysreg!(hdfar: (p15, 4, c0, c6, 0), u32: Hdfar, safe_read, fake::SYSREGS);
23012#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23013read_write_sysreg!(hdfgrtr2_el2: s3_4_c3_c1_0, u64: Hdfgrtr2El2, safe_read, fake::SYSREGS);
23014#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23015read_write_sysreg!(hdfgwtr2_el2: s3_4_c3_c1_1, u64: Hdfgwtr2El2, safe_read, fake::SYSREGS);
23016#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23017read_write_sysreg!(hfgitr2_el2: s3_4_c3_c1_7, u64: Hfgitr2El2, safe_read, fake::SYSREGS);
23018#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23019read_write_sysreg!(hfgrtr2_el2: s3_4_c3_c1_2, u64: Hfgrtr2El2, safe_read, fake::SYSREGS);
23020#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23021read_write_sysreg!(hfgwtr2_el2: s3_4_c3_c1_3, u64: Hfgwtr2El2, safe_read, fake::SYSREGS);
23022#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23023read_write_sysreg!(hfgwtr_el2: s3_4_c1_c1_5, u64: HfgwtrEl2, safe_read, fake::SYSREGS);
23024#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23025read_write_sysreg!(hifar: (p15, 4, c0, c6, 2), u32: Hifar, safe_read, fake::SYSREGS);
23026#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23027read_write_sysreg!(hmair0: (p15, 4, c2, c10, 0), u32: Hmair0, safe_read, fake::SYSREGS);
23028#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23029read_write_sysreg!(hmair1: (p15, 4, c2, c10, 1), u32: Hmair1, safe_read, fake::SYSREGS);
23030#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23031read_write_sysreg!(hpfar: (p15, 4, c0, c6, 4), u32: Hpfar, safe_read, fake::SYSREGS);
23032#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23033read_write_sysreg!(hpfar_el2, u64: HpfarEl2, safe_read, fake::SYSREGS);
23034#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23035read_write_sysreg!(hrmr: (p15, 4, c0, c12, 2), u32: Hrmr, safe_read, fake::SYSREGS);
23036#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23037read_write_sysreg!(hsctlr: (p15, 4, c0, c1, 0), u32: Hsctlr, safe_read, fake::SYSREGS);
23038#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23039read_write_sysreg!(hsr: (p15, 4, c2, c5, 0), u32: Hsr, safe_read, fake::SYSREGS);
23040#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23041read_write_sysreg!(hstr: (p15, 4, c1, c1, 3), u32, safe_read, fake::SYSREGS);
23042#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23043read_write_sysreg!(hstr_el2, u64, safe_read, safe_write, fake::SYSREGS);
23044#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23045read_write_sysreg!(htcr: (p15, 4, c0, c2, 2), u32: Htcr, safe_read, fake::SYSREGS);
23046#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23047read_write_sysreg!(htpidr: (p15, 4, c0, c13, 2), u32: Htpidr, safe_read, fake::SYSREGS);
23048#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23049read_write_sysreg!(htrfcr: (p15, 4, c2, c1, 1), u32: Htrfcr, safe_read, fake::SYSREGS);
23050#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23051read_write_sysreg!(httbr: (p15, 4, c2), u64: Httbr, safe_read, fake::SYSREGS);
23052#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23053read_write_sysreg!(hvbar: (p15, 4, c0, c12, 0), u32: Hvbar, safe_read, fake::SYSREGS);
23054#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23055read_write_sysreg!(icc_sre_el1: s3_0_c12_c12_5, u64: IccSreEl1, safe_read, fake::SYSREGS);
23056#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23057read_write_sysreg!(icc_sre_el2: s3_4_c12_c9_5, u64: IccSreEl2, safe_read, fake::SYSREGS);
23058#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23059read_write_sysreg! {
23060    /// # Safety
23061    ///
23062    /// The SRE bit of `icc_sre_el3` must not be changed from 1 to 0, as this can result in unpredictable behaviour.
23063    icc_sre_el3: s3_6_c12_c12_5, u64: IccSreEl3, safe_read, fake::SYSREGS
23064}
23065#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23066read_write_sysreg!(ich_hcr_el2: s3_4_c12_c11_0, u64: IchHcrEl2, safe_read, fake::SYSREGS);
23067#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23068read_write_sysreg!(ich_vmcr_el2: s3_4_c12_c11_7, u64: IchVmcrEl2, safe_read, safe_write, fake::SYSREGS);
23069#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23070read_sysreg!(id_aa64dfr0_el1, u64: IdAa64dfr0El1, safe, fake::SYSREGS);
23071#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23072read_sysreg!(id_aa64dfr1_el1, u64: IdAa64dfr1El1, safe, fake::SYSREGS);
23073#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23074read_sysreg!(id_aa64isar1_el1, u64: IdAa64isar1El1, safe, fake::SYSREGS);
23075#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23076read_sysreg!(id_aa64isar2_el1, u64: IdAa64isar2El1, safe, fake::SYSREGS);
23077#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23078read_sysreg!(id_aa64mmfr0_el1, u64: IdAa64mmfr0El1, safe, fake::SYSREGS);
23079#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23080read_sysreg!(id_aa64mmfr1_el1, u64: IdAa64mmfr1El1, safe, fake::SYSREGS);
23081#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23082read_sysreg!(id_aa64mmfr2_el1, u64: IdAa64mmfr2El1, safe, fake::SYSREGS);
23083#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23084read_sysreg!(id_aa64mmfr3_el1, u64: IdAa64mmfr3El1, safe, fake::SYSREGS);
23085#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23086read_sysreg!(id_aa64pfr0_el1, u64: IdAa64pfr0El1, safe, fake::SYSREGS);
23087#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23088read_sysreg!(id_aa64pfr1_el1, u64: IdAa64pfr1El1, safe, fake::SYSREGS);
23089#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23090read_sysreg!(id_aa64smfr0_el1, u64: IdAa64smfr0El1, safe, fake::SYSREGS);
23091#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23092read_sysreg!(id_afr0: (p15, 0, c1, c0, 3), u32, safe, fake::SYSREGS);
23093#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23094read_sysreg!(id_dfr0: (p15, 0, c1, c0, 2), u32: IdDfr0, safe, fake::SYSREGS);
23095#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23096read_sysreg!(id_dfr1: (p15, 0, c3, c0, 5), u32: IdDfr1, safe, fake::SYSREGS);
23097#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23098read_sysreg!(id_isar0: (p15, 0, c2, c0, 0), u32: IdIsar0, safe, fake::SYSREGS);
23099#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23100read_sysreg!(id_isar1: (p15, 0, c2, c0, 1), u32: IdIsar1, safe, fake::SYSREGS);
23101#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23102read_sysreg!(id_isar2: (p15, 0, c2, c0, 2), u32: IdIsar2, safe, fake::SYSREGS);
23103#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23104read_sysreg!(id_isar3: (p15, 0, c2, c0, 3), u32: IdIsar3, safe, fake::SYSREGS);
23105#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23106read_sysreg!(id_isar4: (p15, 0, c2, c0, 4), u32: IdIsar4, safe, fake::SYSREGS);
23107#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23108read_sysreg!(id_isar5: (p15, 0, c2, c0, 5), u32: IdIsar5, safe, fake::SYSREGS);
23109#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23110read_sysreg!(id_isar6: (p15, 0, c2, c0, 7), u32: IdIsar6, safe, fake::SYSREGS);
23111#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23112read_sysreg!(id_mmfr0: (p15, 0, c1, c0, 4), u32: IdMmfr0, safe, fake::SYSREGS);
23113#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23114read_sysreg!(id_mmfr1: (p15, 0, c1, c0, 5), u32: IdMmfr1, safe, fake::SYSREGS);
23115#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23116read_sysreg!(id_mmfr2: (p15, 0, c1, c0, 6), u32: IdMmfr2, safe, fake::SYSREGS);
23117#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23118read_sysreg!(id_mmfr3: (p15, 0, c1, c0, 7), u32: IdMmfr3, safe, fake::SYSREGS);
23119#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23120read_sysreg!(id_mmfr4: (p15, 0, c2, c0, 6), u32: IdMmfr4, safe, fake::SYSREGS);
23121#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23122read_sysreg!(id_mmfr5: (p15, 0, c3, c0, 6), u32: IdMmfr5, safe, fake::SYSREGS);
23123#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23124read_sysreg!(id_pfr0: (p15, 0, c1, c0, 0), u32: IdPfr0, safe, fake::SYSREGS);
23125#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23126read_sysreg!(id_pfr1: (p15, 0, c1, c0, 1), u32: IdPfr1, safe, fake::SYSREGS);
23127#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23128read_sysreg!(id_pfr2: (p15, 0, c3, c0, 4), u32: IdPfr2, safe, fake::SYSREGS);
23129#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23130read_write_sysreg!(ifar: (p15, 0, c0, c6, 2), u32: Ifar, safe_read, fake::SYSREGS);
23131#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23132read_write_sysreg!(ifsr: (p15, 0, c0, c5, 1), u32: Ifsr, safe_read, fake::SYSREGS);
23133#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23134read_sysreg!(isr: (p15, 0, c1, c12, 0), u32: Isr, safe, fake::SYSREGS);
23135#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23136read_sysreg!(isr_el1, u64: IsrEl1, safe, fake::SYSREGS);
23137#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23138read_sysreg!(jidr: (p14, 7, c0, c0, 0), u32, safe, fake::SYSREGS);
23139#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23140read_write_sysreg!(jmcr: (p14, 7, c0, c2, 0), u32, safe_read, fake::SYSREGS);
23141#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23142read_write_sysreg!(joscr: (p14, 7, c0, c1, 0), u32, safe_read, fake::SYSREGS);
23143#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23144read_write_sysreg!(mair0: (p15, 0, c2, c10, 0), u32: Mair0, safe_read, fake::SYSREGS);
23145#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23146read_write_sysreg!(mair1: (p15, 0, c2, c10, 1), u32: Mair1, safe_read, fake::SYSREGS);
23147#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23148read_write_sysreg!(mair_el1, u64: MairEl1, safe_read, fake::SYSREGS);
23149#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23150read_write_sysreg!(mair_el2, u64: MairEl2, safe_read, fake::SYSREGS);
23151#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23152read_write_sysreg! {
23153    /// # Safety
23154    ///
23155    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 memory attribute indirection register.
23156    mair_el3, u64: MairEl3, safe_read, fake::SYSREGS
23157}
23158#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23159read_write_sysreg!(mdccint_el1, u64: MdccintEl1, safe_read, safe_write, fake::SYSREGS);
23160#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23161read_write_sysreg!(mdcr_el2, u64: MdcrEl2, safe_read, safe_write, fake::SYSREGS);
23162#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23163read_write_sysreg!(mdcr_el3, u64: MdcrEl3, safe_read, safe_write, fake::SYSREGS);
23164#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23165read_write_sysreg!(mdscr_el1, u64: MdscrEl1, safe_read, safe_write, fake::SYSREGS);
23166#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23167read_sysreg!(midr: (p15, 0, c0, c0, 0), u32: Midr, safe, fake::SYSREGS);
23168#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23169read_sysreg!(midr_el1, u64: MidrEl1, safe, fake::SYSREGS);
23170#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23171read_write_sysreg!(mpam2_el2: s3_4_c10_c5_0, u64: Mpam2El2, safe_read, fake::SYSREGS);
23172#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23173read_write_sysreg!(mpam3_el3: s3_6_c10_c5_0, u64: Mpam3El3, safe_read, fake::SYSREGS);
23174#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23175read_write_sysreg!(mpamhcr_el2: s3_4_c10_c4_0, u64: MpamhcrEl2, safe_read, fake::SYSREGS);
23176#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23177read_sysreg!(mpamidr_el1: s3_0_c10_c4_4, u64: MpamidrEl1, safe, fake::SYSREGS);
23178#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23179read_write_sysreg!(mpamvpm0_el2: s3_4_c10_c6_0, u64: Mpamvpm0El2, safe_read, fake::SYSREGS);
23180#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23181read_write_sysreg!(mpamvpm1_el2: s3_4_c10_c6_1, u64: Mpamvpm1El2, safe_read, fake::SYSREGS);
23182#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23183read_write_sysreg!(mpamvpm2_el2: s3_4_c10_c6_2, u64: Mpamvpm2El2, safe_read, fake::SYSREGS);
23184#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23185read_write_sysreg!(mpamvpm3_el2: s3_4_c10_c6_3, u64: Mpamvpm3El2, safe_read, fake::SYSREGS);
23186#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23187read_write_sysreg!(mpamvpm4_el2: s3_4_c10_c6_4, u64: Mpamvpm4El2, safe_read, fake::SYSREGS);
23188#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23189read_write_sysreg!(mpamvpm5_el2: s3_4_c10_c6_5, u64: Mpamvpm5El2, safe_read, fake::SYSREGS);
23190#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23191read_write_sysreg!(mpamvpm6_el2: s3_4_c10_c6_6, u64: Mpamvpm6El2, safe_read, fake::SYSREGS);
23192#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23193read_write_sysreg!(mpamvpm7_el2: s3_4_c10_c6_7, u64: Mpamvpm7El2, safe_read, fake::SYSREGS);
23194#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23195read_write_sysreg!(mpamvpmv_el2: s3_4_c10_c4_1, u64: MpamvpmvEl2, safe_read, fake::SYSREGS);
23196#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23197read_sysreg!(mpidr: (p15, 0, c0, c0, 5), u32: Mpidr, safe, fake::SYSREGS);
23198#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23199read_sysreg!(mpidr_el1, u64: MpidrEl1, safe, fake::SYSREGS);
23200#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23201read_write_sysreg!(mvbar: (p15, 0, c0, c12, 1), u32: Mvbar, safe_read, fake::SYSREGS);
23202#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23203read_write_sysreg!(nmrr: (p15, 0, c2, c10, 1), u32: Nmrr, safe_read, fake::SYSREGS);
23204#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23205read_write_sysreg!(nsacr: (p15, 0, c1, c1, 2), u32: Nsacr, safe_read, fake::SYSREGS);
23206#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23207read_write_sysreg!(par: (p15, 0, c7), u64: Par, safe_read, fake::SYSREGS);
23208#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23209read_write_sysreg!(par_el1, u64: ParEl1, safe_read, fake::SYSREGS);
23210#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23211read_write_sysreg!(pmccfiltr: (p15, 0, c15, c14, 7), u32: Pmccfiltr, safe_read, fake::SYSREGS);
23212#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23213read_write_sysreg!(pmccntr: (p15, 0, c9), u64: Pmccntr, safe_read, fake::SYSREGS);
23214#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23215read_sysreg!(pmceid0: (p15, 0, c12, c9, 6), u32: Pmceid0, safe, fake::SYSREGS);
23216#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23217read_sysreg!(pmceid1: (p15, 0, c12, c9, 7), u32: Pmceid1, safe, fake::SYSREGS);
23218#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23219read_sysreg!(pmceid2: (p15, 0, c14, c9, 4), u32: Pmceid2, safe, fake::SYSREGS);
23220#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23221read_sysreg!(pmceid3: (p15, 0, c14, c9, 5), u32: Pmceid3, safe, fake::SYSREGS);
23222#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23223read_write_sysreg!(pmcntenclr: (p15, 0, c12, c9, 2), u32: Pmcntenclr, safe_read, fake::SYSREGS);
23224#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23225read_write_sysreg!(pmcntenset: (p15, 0, c12, c9, 1), u32: Pmcntenset, safe_read, fake::SYSREGS);
23226#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23227read_write_sysreg!(pmcr: (p15, 0, c12, c9, 0), u32: Pmcr, safe_read, fake::SYSREGS);
23228#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
23229read_write_sysreg!(pmcr_el0: s3_3_c9_c12_0, u64: PmcrEl0, safe_read, safe_write, fake::SYSREGS);
23230#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23231read_write_sysreg!(pmintenclr: (p15, 0, c14, c9, 2), u32: Pmintenclr, safe_read, fake::SYSREGS);
23232#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23233read_write_sysreg!(pmintenset: (p15, 0, c14, c9, 1), u32: Pmintenset, safe_read, fake::SYSREGS);
23234#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23235read_sysreg!(pmmir: (p15, 0, c14, c9, 6), u32: Pmmir, safe, fake::SYSREGS);
23236#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23237read_write_sysreg!(pmovsr: (p15, 0, c12, c9, 3), u32: Pmovsr, safe_read, fake::SYSREGS);
23238#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23239read_write_sysreg!(pmovsset: (p15, 0, c14, c9, 3), u32: Pmovsset, safe_read, fake::SYSREGS);
23240#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23241read_write_sysreg!(pmselr: (p15, 0, c12, c9, 5), u32: Pmselr, safe_read, fake::SYSREGS);
23242#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23243write_sysreg!(pmswinc: (p15, 0, c12, c9, 4), u32: Pmswinc, fake::SYSREGS);
23244#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23245read_write_sysreg!(pmuserenr: (p15, 0, c14, c9, 0), u32: Pmuserenr, safe_read, fake::SYSREGS);
23246#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23247read_write_sysreg!(pmxevtyper: (p15, 0, c13, c9, 1), u32: Pmxevtyper, safe_read, fake::SYSREGS);
23248#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23249read_write_sysreg!(prrr: (p15, 0, c2, c10, 0), u32: Prrr, safe_read, fake::SYSREGS);
23250#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23251read_sysreg!(revidr: (p15, 0, c0, c0, 6), u32, safe, fake::SYSREGS);
23252#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23253read_write_sysreg!(rgsr_el1: s3_0_c1_c0_5, u64: RgsrEl1, safe_read, safe_write, fake::SYSREGS);
23254#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23255read_write_sysreg!(rmr: (p15, 0, c0, c12, 2), u32: Rmr, safe_read, fake::SYSREGS);
23256#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23257read_sysreg!(rvbar: (p15, 0, c0, c12, 1), u32: Rvbar, safe, fake::SYSREGS);
23258#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23259read_write_sysreg!(scr: (p15, 0, c1, c1, 0), u32: Scr, safe_read, fake::SYSREGS);
23260#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23261read_write_sysreg!(scr_el3, u64: ScrEl3, safe_read, fake::SYSREGS);
23262#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23263read_write_sysreg!(sctlr: (p15, 0, c0, c1, 0), u32: Sctlr, safe_read, fake::SYSREGS);
23264#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23265read_write_sysreg!(sctlr2_el3: s3_6_c1_c0_3, u64: Sctlr2El3, safe_read, fake::SYSREGS);
23266#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23267read_write_sysreg!(sctlr_el1, u64: SctlrEl1, safe_read, fake::SYSREGS);
23268#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23269read_write_sysreg!(sctlr_el2, u64: SctlrEl2, safe_read, fake::SYSREGS);
23270#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23271read_write_sysreg! {
23272    /// # Safety
23273    ///
23274    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 system control register.
23275    sctlr_el3, u64: SctlrEl3, safe_read, fake::SYSREGS
23276}
23277#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23278read_write_sysreg!(sdcr: (p15, 0, c3, c1, 1), u32: Sdcr, safe_read, fake::SYSREGS);
23279#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23280read_write_sysreg!(sder: (p15, 0, c1, c1, 1), u32: Sder, safe_read, fake::SYSREGS);
23281#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23282read_write_sysreg!(smcr_el3: s3_6_c1_c2_6, u64: SmcrEl3, safe_read, fake::SYSREGS);
23283#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23284read_write_sysreg!(spsr_el1, u64: SpsrEl1, safe_read, fake::SYSREGS);
23285#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23286read_write_sysreg!(spsr_el2, u64: SpsrEl2, safe_read, fake::SYSREGS);
23287#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23288read_write_sysreg!(spsr_el3, u64: SpsrEl3, safe_read, fake::SYSREGS);
23289#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23290read_write_sysreg!(sp_el1, u64: SpEl1, safe_read, fake::SYSREGS);
23291#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23292read_write_sysreg!(sp_el2, u64: SpEl2, safe_read, fake::SYSREGS);
23293#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23294read_sysreg!(tcmtr: (p15, 0, c0, c0, 2), u32, safe, fake::SYSREGS);
23295#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23296read_write_sysreg!(tcr2_el1: s3_0_c2_c0_3, u64: Tcr2El1, safe_read, fake::SYSREGS);
23297#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23298read_write_sysreg!(tcr2_el2: s3_4_c2_c0_3, u64: Tcr2El2, safe_read, fake::SYSREGS);
23299#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23300read_write_sysreg!(tcr_el1, u64: TcrEl1, safe_read, fake::SYSREGS);
23301#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23302read_write_sysreg!(tcr_el2, u64: TcrEl2, safe_read, fake::SYSREGS);
23303#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23304read_write_sysreg! {
23305    /// # Safety
23306    ///
23307    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 translation control register.
23308    tcr_el3, u64: TcrEl3, safe_read, fake::SYSREGS
23309}
23310#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23311read_write_sysreg!(tfsre0_el1: s3_0_c5_c6_1, u64: Tfsre0El1, safe_read, safe_write, fake::SYSREGS);
23312#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23313read_write_sysreg!(tfsr_el1: s3_0_c5_c6_0, u64: TfsrEl1, safe_read, safe_write, fake::SYSREGS);
23314#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23315read_write_sysreg!(tfsr_el2: s3_4_c5_c6_0, u64: TfsrEl2, safe_read, safe_write, fake::SYSREGS);
23316#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23317read_sysreg!(tlbtr: (p15, 0, c0, c0, 3), u32: Tlbtr, safe, fake::SYSREGS);
23318#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23319read_write_sysreg!(tpidrprw: (p15, 0, c0, c13, 4), u32: Tpidrprw, safe_read, fake::SYSREGS);
23320#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
23321read_write_sysreg!(tpidrro_el0, u64: TpidrroEl0, safe_read, fake::SYSREGS);
23322#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23323read_write_sysreg!(tpidruro: (p15, 0, c0, c13, 3), u32: Tpidruro, safe_read, fake::SYSREGS);
23324#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23325read_write_sysreg!(tpidrurw: (p15, 0, c0, c13, 2), u32: Tpidrurw, safe_read, fake::SYSREGS);
23326#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
23327read_write_sysreg!(tpidr_el0, u64: TpidrEl0, safe_read, fake::SYSREGS);
23328#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23329read_write_sysreg!(tpidr_el1, u64: TpidrEl1, safe_read, fake::SYSREGS);
23330#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23331read_write_sysreg!(tpidr_el2, u64: TpidrEl2, safe_read, fake::SYSREGS);
23332#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23333read_write_sysreg!(trfcr: (p15, 0, c2, c1, 1), u32: Trfcr, safe_read, fake::SYSREGS);
23334#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23335read_write_sysreg!(ttbcr: (p15, 0, c0, c2, 2), u32: Ttbcr, safe_read, fake::SYSREGS);
23336#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23337read_write_sysreg!(ttbcr2: (p15, 0, c0, c2, 3), u32: Ttbcr2, safe_read, fake::SYSREGS);
23338#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23339read_write_sysreg!(ttbr0: (p15, 0, c2), u64: Ttbr0, safe_read, fake::SYSREGS);
23340#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23341read_write_sysreg! {
23342    /// # Safety
23343    ///
23344    /// The base address must point to a valid and properly aligned translation table.
23345    ttbr0_el1, u64: Ttbr0El1, safe_read, fake::SYSREGS
23346}
23347#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23348read_write_sysreg! {
23349    /// # Safety
23350    ///
23351    /// The base address must point to a valid and properly aligned translation table.
23352    ttbr0_el2, u64: Ttbr0El2, safe_read, fake::SYSREGS
23353}
23354#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23355read_write_sysreg! {
23356    /// # Safety
23357    ///
23358    /// The base address must point to a valid and properly aligned translation table.
23359    ttbr0_el3, u64: Ttbr0El3, safe_read, fake::SYSREGS
23360}
23361#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23362read_write_sysreg!(ttbr1: (p15, 1, c2), u64: Ttbr1, safe_read, fake::SYSREGS);
23363#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23364read_write_sysreg! {
23365    /// # Safety
23366    ///
23367    /// The base address must point to a valid and properly aligned translation table.
23368    ttbr1_el1, u64: Ttbr1El1, safe_read, fake::SYSREGS
23369}
23370#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23371read_write_sysreg! {
23372    /// # Safety
23373    ///
23374    /// The base address must point to a valid and properly aligned translation table.
23375    ttbr1_el2, u64: Ttbr1El2, safe_read, fake::SYSREGS
23376}
23377#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23378read_write_sysreg!(vbar: (p15, 0, c0, c12, 0), u32: Vbar, safe_read, fake::SYSREGS);
23379#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
23380read_write_sysreg! {
23381    /// # Safety
23382    ///
23383    /// The base address must point to a valid exception vector.
23384    vbar_el1, u64: VbarEl1, safe_read, fake::SYSREGS
23385}
23386#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23387read_write_sysreg! {
23388    /// # Safety
23389    ///
23390    /// The base address must point to a valid exception vector.
23391    vbar_el2, u64: VbarEl2, safe_read, fake::SYSREGS
23392}
23393#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23394read_write_sysreg!(vdfsr: (p15, 4, c2, c5, 3), u32: Vdfsr, safe_read, fake::SYSREGS);
23395#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23396read_write_sysreg!(vdisr: (p15, 0, c1, c12, 1), u32: Vdisr, safe_read, fake::SYSREGS);
23397#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23398read_write_sysreg!(vdisr_el2: s3_4_c12_c1_1, u64: VdisrEl2, safe_read, safe_write, fake::SYSREGS);
23399#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23400read_write_sysreg!(vmpidr: (p15, 0, c0, c0, 5), u32: Vmpidr, safe_read, fake::SYSREGS);
23401#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23402read_write_sysreg!(vmpidr_el2, u64: VmpidrEl2, safe_read, safe_write, fake::SYSREGS);
23403#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23404read_write_sysreg!(vpidr: (p15, 0, c0, c0, 0), u32: Vpidr, safe_read, fake::SYSREGS);
23405#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23406read_write_sysreg!(vpidr_el2, u64: VpidrEl2, safe_read, safe_write, fake::SYSREGS);
23407#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23408read_write_sysreg!(vsesr_el2: s3_4_c5_c2_3, u64: VsesrEl2, safe_read, safe_write, fake::SYSREGS);
23409#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23410read_write_sysreg!(vtcr: (p15, 4, c1, c2, 2), u32: Vtcr, safe_read, fake::SYSREGS);
23411#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23412read_write_sysreg!(vtcr_el2, u64: VtcrEl2, safe_read, fake::SYSREGS);
23413#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
23414read_write_sysreg!(vttbr: (p15, 6, c2), u64: Vttbr, safe_read, fake::SYSREGS);
23415#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
23416read_write_sysreg! {
23417    /// # Safety
23418    ///
23419    /// The base address must point to a valid and properly aligned stage 2 translation table.
23420    vttbr_el2, u64: VttbrEl2, safe_read, fake::SYSREGS
23421}
23422#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
23423read_write_sysreg!(zcr_el3: s3_6_c1_c2_0, u64: ZcrEl3, safe_read, fake::SYSREGS);