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// This file is generated, do not edit manually.
7
8#![cfg_attr(not(any(test, feature = "fakes")), no_std)]
9#![cfg_attr(docsrs, feature(doc_cfg))]
10
11#[cfg(all(not(any(test, feature = "fakes")), target_arch = "arm"))]
12mod aarch32;
13#[cfg(all(not(any(test, feature = "fakes")), target_arch = "aarch64"))]
14mod aarch64;
15#[cfg(any(test, feature = "fakes"))]
16pub mod fake;
17mod macros;
18mod manual;
19
20use bitflags::bitflags;
21pub use manual::*;
22#[doc(hidden)]
23pub use paste as _paste;
24
25bitflags! {
26    /// `AMCFGR` system register value.
27    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28    #[repr(transparent)]
29    pub struct Amcfgr: u32 {
30        /// `HDBG` bit.
31        const HDBG = 1 << 24;
32    }
33}
34
35impl Amcfgr {
36    /// Offset of the `N` field.
37    pub const N_SHIFT: u32 = 0;
38    /// Mask for the `N` field.
39    pub const N_MASK: u32 = 0b11111111;
40    /// Offset of the `SIZE` field.
41    pub const SIZE_SHIFT: u32 = 8;
42    /// Mask for the `SIZE` field.
43    pub const SIZE_MASK: u32 = 0b111111;
44    /// Offset of the `HDBG` field.
45    pub const HDBG_SHIFT: u32 = 24;
46    /// Offset of the `NCG` field.
47    pub const NCG_SHIFT: u32 = 28;
48    /// Mask for the `NCG` field.
49    pub const NCG_MASK: u32 = 0b1111;
50
51    /// Returns the value of the `N` field.
52    pub const fn n(self) -> u8 {
53        ((self.bits() >> Self::N_SHIFT) & 0b11111111) as u8
54    }
55
56    /// Sets the value of the `N` field.
57    pub const fn set_n(&mut self, value: u8) {
58        let offset = Self::N_SHIFT;
59        assert!(value & (Self::N_MASK as u8) == value);
60        *self = Self::from_bits_retain(
61            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
62        );
63    }
64
65    /// Returns a copy with the `N` field set to the given value.
66    pub const fn with_n(mut self, value: u8) -> Self {
67        self.set_n(value);
68        self
69    }
70
71    /// Returns the value of the `SIZE` field.
72    pub const fn size(self) -> u8 {
73        ((self.bits() >> Self::SIZE_SHIFT) & 0b111111) as u8
74    }
75
76    /// Sets the value of the `SIZE` field.
77    pub const fn set_size(&mut self, value: u8) {
78        let offset = Self::SIZE_SHIFT;
79        assert!(value & (Self::SIZE_MASK as u8) == value);
80        *self = Self::from_bits_retain(
81            (self.bits() & !(Self::SIZE_MASK << offset)) | ((value as u32) << offset),
82        );
83    }
84
85    /// Returns a copy with the `SIZE` field set to the given value.
86    pub const fn with_size(mut self, value: u8) -> Self {
87        self.set_size(value);
88        self
89    }
90
91    /// Returns the value of the `NCG` field.
92    pub const fn ncg(self) -> u8 {
93        ((self.bits() >> Self::NCG_SHIFT) & 0b1111) as u8
94    }
95
96    /// Sets the value of the `NCG` field.
97    pub const fn set_ncg(&mut self, value: u8) {
98        let offset = Self::NCG_SHIFT;
99        assert!(value & (Self::NCG_MASK as u8) == value);
100        *self = Self::from_bits_retain(
101            (self.bits() & !(Self::NCG_MASK << offset)) | ((value as u32) << offset),
102        );
103    }
104
105    /// Returns a copy with the `NCG` field set to the given value.
106    pub const fn with_ncg(mut self, value: u8) -> Self {
107        self.set_ncg(value);
108        self
109    }
110}
111
112bitflags! {
113    /// `AMCFGR_EL0` system register value.
114    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
115    #[repr(transparent)]
116    pub struct AmcfgrEl0: u64 {
117        /// `HDBG` bit.
118        const HDBG = 1 << 24;
119    }
120}
121
122impl AmcfgrEl0 {
123    /// Offset of the `N` field.
124    pub const N_SHIFT: u32 = 0;
125    /// Mask for the `N` field.
126    pub const N_MASK: u64 = 0b11111111;
127    /// Offset of the `SIZE` field.
128    pub const SIZE_SHIFT: u32 = 8;
129    /// Mask for the `SIZE` field.
130    pub const SIZE_MASK: u64 = 0b111111;
131    /// Offset of the `HDBG` field.
132    pub const HDBG_SHIFT: u32 = 24;
133    /// Offset of the `NCG` field.
134    pub const NCG_SHIFT: u32 = 28;
135    /// Mask for the `NCG` field.
136    pub const NCG_MASK: u64 = 0b1111;
137
138    /// Returns the value of the `N` field.
139    pub const fn n(self) -> u8 {
140        ((self.bits() >> Self::N_SHIFT) & 0b11111111) as u8
141    }
142
143    /// Sets the value of the `N` field.
144    pub const fn set_n(&mut self, value: u8) {
145        let offset = Self::N_SHIFT;
146        assert!(value & (Self::N_MASK as u8) == value);
147        *self = Self::from_bits_retain(
148            (self.bits() & !(Self::N_MASK << offset)) | ((value as u64) << offset),
149        );
150    }
151
152    /// Returns a copy with the `N` field set to the given value.
153    pub const fn with_n(mut self, value: u8) -> Self {
154        self.set_n(value);
155        self
156    }
157
158    /// Returns the value of the `SIZE` field.
159    pub const fn size(self) -> u8 {
160        ((self.bits() >> Self::SIZE_SHIFT) & 0b111111) as u8
161    }
162
163    /// Sets the value of the `SIZE` field.
164    pub const fn set_size(&mut self, value: u8) {
165        let offset = Self::SIZE_SHIFT;
166        assert!(value & (Self::SIZE_MASK as u8) == value);
167        *self = Self::from_bits_retain(
168            (self.bits() & !(Self::SIZE_MASK << offset)) | ((value as u64) << offset),
169        );
170    }
171
172    /// Returns a copy with the `SIZE` field set to the given value.
173    pub const fn with_size(mut self, value: u8) -> Self {
174        self.set_size(value);
175        self
176    }
177
178    /// Returns the value of the `NCG` field.
179    pub const fn ncg(self) -> u8 {
180        ((self.bits() >> Self::NCG_SHIFT) & 0b1111) as u8
181    }
182
183    /// Sets the value of the `NCG` field.
184    pub const fn set_ncg(&mut self, value: u8) {
185        let offset = Self::NCG_SHIFT;
186        assert!(value & (Self::NCG_MASK as u8) == value);
187        *self = Self::from_bits_retain(
188            (self.bits() & !(Self::NCG_MASK << offset)) | ((value as u64) << offset),
189        );
190    }
191
192    /// Returns a copy with the `NCG` field set to the given value.
193    pub const fn with_ncg(mut self, value: u8) -> Self {
194        self.set_ncg(value);
195        self
196    }
197}
198
199bitflags! {
200    /// `AMCGCR` system register value.
201    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
202    #[repr(transparent)]
203    pub struct Amcgcr: u32 {
204    }
205}
206
207impl Amcgcr {
208    /// Offset of the `CG0NC` field.
209    pub const CG0NC_SHIFT: u32 = 0;
210    /// Mask for the `CG0NC` field.
211    pub const CG0NC_MASK: u32 = 0b11111111;
212    /// Offset of the `CG1NC` field.
213    pub const CG1NC_SHIFT: u32 = 8;
214    /// Mask for the `CG1NC` field.
215    pub const CG1NC_MASK: u32 = 0b11111111;
216
217    /// Returns the value of the `CG0NC` field.
218    pub const fn cg0nc(self) -> u8 {
219        ((self.bits() >> Self::CG0NC_SHIFT) & 0b11111111) as u8
220    }
221
222    /// Sets the value of the `CG0NC` field.
223    pub const fn set_cg0nc(&mut self, value: u8) {
224        let offset = Self::CG0NC_SHIFT;
225        assert!(value & (Self::CG0NC_MASK as u8) == value);
226        *self = Self::from_bits_retain(
227            (self.bits() & !(Self::CG0NC_MASK << offset)) | ((value as u32) << offset),
228        );
229    }
230
231    /// Returns a copy with the `CG0NC` field set to the given value.
232    pub const fn with_cg0nc(mut self, value: u8) -> Self {
233        self.set_cg0nc(value);
234        self
235    }
236
237    /// Returns the value of the `CG1NC` field.
238    pub const fn cg1nc(self) -> u8 {
239        ((self.bits() >> Self::CG1NC_SHIFT) & 0b11111111) as u8
240    }
241
242    /// Sets the value of the `CG1NC` field.
243    pub const fn set_cg1nc(&mut self, value: u8) {
244        let offset = Self::CG1NC_SHIFT;
245        assert!(value & (Self::CG1NC_MASK as u8) == value);
246        *self = Self::from_bits_retain(
247            (self.bits() & !(Self::CG1NC_MASK << offset)) | ((value as u32) << offset),
248        );
249    }
250
251    /// Returns a copy with the `CG1NC` field set to the given value.
252    pub const fn with_cg1nc(mut self, value: u8) -> Self {
253        self.set_cg1nc(value);
254        self
255    }
256}
257
258bitflags! {
259    /// `AMCGCR_EL0` system register value.
260    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
261    #[repr(transparent)]
262    pub struct AmcgcrEl0: u64 {
263    }
264}
265
266impl AmcgcrEl0 {
267    /// Offset of the `CG0NC` field.
268    pub const CG0NC_SHIFT: u32 = 0;
269    /// Mask for the `CG0NC` field.
270    pub const CG0NC_MASK: u64 = 0b11111111;
271    /// Offset of the `CG1NC` field.
272    pub const CG1NC_SHIFT: u32 = 8;
273    /// Mask for the `CG1NC` field.
274    pub const CG1NC_MASK: u64 = 0b11111111;
275
276    /// Returns the value of the `CG0NC` field.
277    pub const fn cg0nc(self) -> u8 {
278        ((self.bits() >> Self::CG0NC_SHIFT) & 0b11111111) as u8
279    }
280
281    /// Sets the value of the `CG0NC` field.
282    pub const fn set_cg0nc(&mut self, value: u8) {
283        let offset = Self::CG0NC_SHIFT;
284        assert!(value & (Self::CG0NC_MASK as u8) == value);
285        *self = Self::from_bits_retain(
286            (self.bits() & !(Self::CG0NC_MASK << offset)) | ((value as u64) << offset),
287        );
288    }
289
290    /// Returns a copy with the `CG0NC` field set to the given value.
291    pub const fn with_cg0nc(mut self, value: u8) -> Self {
292        self.set_cg0nc(value);
293        self
294    }
295
296    /// Returns the value of the `CG1NC` field.
297    pub const fn cg1nc(self) -> u8 {
298        ((self.bits() >> Self::CG1NC_SHIFT) & 0b11111111) as u8
299    }
300
301    /// Sets the value of the `CG1NC` field.
302    pub const fn set_cg1nc(&mut self, value: u8) {
303        let offset = Self::CG1NC_SHIFT;
304        assert!(value & (Self::CG1NC_MASK as u8) == value);
305        *self = Self::from_bits_retain(
306            (self.bits() & !(Self::CG1NC_MASK << offset)) | ((value as u64) << offset),
307        );
308    }
309
310    /// Returns a copy with the `CG1NC` field set to the given value.
311    pub const fn with_cg1nc(mut self, value: u8) -> Self {
312        self.set_cg1nc(value);
313        self
314    }
315}
316
317bitflags! {
318    /// `AMCNTENCLR0` system register value.
319    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
320    #[repr(transparent)]
321    pub struct Amcntenclr0: u32 {
322        /// `P<n>` bit 0.
323        const P0 = 1 << 0;
324        /// `P<n>` bit 1.
325        const P1 = 1 << 1;
326        /// `P<n>` bit 2.
327        const P2 = 1 << 2;
328        /// `P<n>` bit 3.
329        const P3 = 1 << 3;
330    }
331}
332
333impl Amcntenclr0 {
334    /// Offset of the `P<n>` field.
335    pub const P_SHIFT: u32 = 0;
336}
337
338bitflags! {
339    /// `AMCNTENCLR0_EL0` system register value.
340    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
341    #[repr(transparent)]
342    pub struct Amcntenclr0El0: u64 {
343        /// `P<n>` bit 0.
344        const P0 = 1 << 0;
345        /// `P<n>` bit 1.
346        const P1 = 1 << 1;
347        /// `P<n>` bit 2.
348        const P2 = 1 << 2;
349        /// `P<n>` bit 3.
350        const P3 = 1 << 3;
351    }
352}
353
354impl Amcntenclr0El0 {
355    /// Offset of the `P<n>` field.
356    pub const P_SHIFT: u32 = 0;
357}
358
359bitflags! {
360    /// `AMCNTENCLR1` system register value.
361    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
362    #[repr(transparent)]
363    pub struct Amcntenclr1: u32 {
364        /// `P<n>` bit 0.
365        const P0 = 1 << 0;
366        /// `P<n>` bit 1.
367        const P1 = 1 << 1;
368        /// `P<n>` bit 2.
369        const P2 = 1 << 2;
370        /// `P<n>` bit 3.
371        const P3 = 1 << 3;
372        /// `P<n>` bit 4.
373        const P4 = 1 << 4;
374        /// `P<n>` bit 5.
375        const P5 = 1 << 5;
376        /// `P<n>` bit 6.
377        const P6 = 1 << 6;
378        /// `P<n>` bit 7.
379        const P7 = 1 << 7;
380        /// `P<n>` bit 8.
381        const P8 = 1 << 8;
382        /// `P<n>` bit 9.
383        const P9 = 1 << 9;
384        /// `P<n>` bit 10.
385        const P10 = 1 << 10;
386        /// `P<n>` bit 11.
387        const P11 = 1 << 11;
388        /// `P<n>` bit 12.
389        const P12 = 1 << 12;
390        /// `P<n>` bit 13.
391        const P13 = 1 << 13;
392        /// `P<n>` bit 14.
393        const P14 = 1 << 14;
394        /// `P<n>` bit 15.
395        const P15 = 1 << 15;
396    }
397}
398
399impl Amcntenclr1 {
400    /// Offset of the `P<n>` field.
401    pub const P_SHIFT: u32 = 0;
402}
403
404bitflags! {
405    /// `AMCNTENCLR1_EL0` system register value.
406    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
407    #[repr(transparent)]
408    pub struct Amcntenclr1El0: u64 {
409        /// `P<n>` bit 0.
410        const P0 = 1 << 0;
411        /// `P<n>` bit 1.
412        const P1 = 1 << 1;
413        /// `P<n>` bit 2.
414        const P2 = 1 << 2;
415        /// `P<n>` bit 3.
416        const P3 = 1 << 3;
417        /// `P<n>` bit 4.
418        const P4 = 1 << 4;
419        /// `P<n>` bit 5.
420        const P5 = 1 << 5;
421        /// `P<n>` bit 6.
422        const P6 = 1 << 6;
423        /// `P<n>` bit 7.
424        const P7 = 1 << 7;
425        /// `P<n>` bit 8.
426        const P8 = 1 << 8;
427        /// `P<n>` bit 9.
428        const P9 = 1 << 9;
429        /// `P<n>` bit 10.
430        const P10 = 1 << 10;
431        /// `P<n>` bit 11.
432        const P11 = 1 << 11;
433        /// `P<n>` bit 12.
434        const P12 = 1 << 12;
435        /// `P<n>` bit 13.
436        const P13 = 1 << 13;
437        /// `P<n>` bit 14.
438        const P14 = 1 << 14;
439        /// `P<n>` bit 15.
440        const P15 = 1 << 15;
441    }
442}
443
444impl Amcntenclr1El0 {
445    /// Offset of the `P<n>` field.
446    pub const P_SHIFT: u32 = 0;
447}
448
449bitflags! {
450    /// `AMCNTENSET0` system register value.
451    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
452    #[repr(transparent)]
453    pub struct Amcntenset0: u32 {
454        /// `P<n>` bit 0.
455        const P0 = 1 << 0;
456        /// `P<n>` bit 1.
457        const P1 = 1 << 1;
458        /// `P<n>` bit 2.
459        const P2 = 1 << 2;
460        /// `P<n>` bit 3.
461        const P3 = 1 << 3;
462    }
463}
464
465impl Amcntenset0 {
466    /// Offset of the `P<n>` field.
467    pub const P_SHIFT: u32 = 0;
468}
469
470bitflags! {
471    /// `AMCNTENSET0_EL0` system register value.
472    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
473    #[repr(transparent)]
474    pub struct Amcntenset0El0: u64 {
475        /// `P<n>` bit 0.
476        const P0 = 1 << 0;
477        /// `P<n>` bit 1.
478        const P1 = 1 << 1;
479        /// `P<n>` bit 2.
480        const P2 = 1 << 2;
481        /// `P<n>` bit 3.
482        const P3 = 1 << 3;
483    }
484}
485
486impl Amcntenset0El0 {
487    /// Offset of the `P<n>` field.
488    pub const P_SHIFT: u32 = 0;
489}
490
491bitflags! {
492    /// `AMCNTENSET1` system register value.
493    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
494    #[repr(transparent)]
495    pub struct Amcntenset1: u32 {
496        /// `P<n>` bit 0.
497        const P0 = 1 << 0;
498        /// `P<n>` bit 1.
499        const P1 = 1 << 1;
500        /// `P<n>` bit 2.
501        const P2 = 1 << 2;
502        /// `P<n>` bit 3.
503        const P3 = 1 << 3;
504        /// `P<n>` bit 4.
505        const P4 = 1 << 4;
506        /// `P<n>` bit 5.
507        const P5 = 1 << 5;
508        /// `P<n>` bit 6.
509        const P6 = 1 << 6;
510        /// `P<n>` bit 7.
511        const P7 = 1 << 7;
512        /// `P<n>` bit 8.
513        const P8 = 1 << 8;
514        /// `P<n>` bit 9.
515        const P9 = 1 << 9;
516        /// `P<n>` bit 10.
517        const P10 = 1 << 10;
518        /// `P<n>` bit 11.
519        const P11 = 1 << 11;
520        /// `P<n>` bit 12.
521        const P12 = 1 << 12;
522        /// `P<n>` bit 13.
523        const P13 = 1 << 13;
524        /// `P<n>` bit 14.
525        const P14 = 1 << 14;
526        /// `P<n>` bit 15.
527        const P15 = 1 << 15;
528    }
529}
530
531impl Amcntenset1 {
532    /// Offset of the `P<n>` field.
533    pub const P_SHIFT: u32 = 0;
534}
535
536bitflags! {
537    /// `AMCNTENSET1_EL0` system register value.
538    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
539    #[repr(transparent)]
540    pub struct Amcntenset1El0: u64 {
541        /// `P<n>` bit 0.
542        const P0 = 1 << 0;
543        /// `P<n>` bit 1.
544        const P1 = 1 << 1;
545        /// `P<n>` bit 2.
546        const P2 = 1 << 2;
547        /// `P<n>` bit 3.
548        const P3 = 1 << 3;
549        /// `P<n>` bit 4.
550        const P4 = 1 << 4;
551        /// `P<n>` bit 5.
552        const P5 = 1 << 5;
553        /// `P<n>` bit 6.
554        const P6 = 1 << 6;
555        /// `P<n>` bit 7.
556        const P7 = 1 << 7;
557        /// `P<n>` bit 8.
558        const P8 = 1 << 8;
559        /// `P<n>` bit 9.
560        const P9 = 1 << 9;
561        /// `P<n>` bit 10.
562        const P10 = 1 << 10;
563        /// `P<n>` bit 11.
564        const P11 = 1 << 11;
565        /// `P<n>` bit 12.
566        const P12 = 1 << 12;
567        /// `P<n>` bit 13.
568        const P13 = 1 << 13;
569        /// `P<n>` bit 14.
570        const P14 = 1 << 14;
571        /// `P<n>` bit 15.
572        const P15 = 1 << 15;
573    }
574}
575
576impl Amcntenset1El0 {
577    /// Offset of the `P<n>` field.
578    pub const P_SHIFT: u32 = 0;
579}
580
581bitflags! {
582    /// `AMCR` system register value.
583    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
584    #[repr(transparent)]
585    pub struct Amcr: u32 {
586        /// `HDBG` bit.
587        const HDBG = 1 << 10;
588        /// `CG1RZ` bit.
589        const CG1RZ = 1 << 17;
590    }
591}
592
593impl Amcr {
594    /// Offset of the `HDBG` field.
595    pub const HDBG_SHIFT: u32 = 10;
596    /// Offset of the `CG1RZ` field.
597    pub const CG1RZ_SHIFT: u32 = 17;
598}
599
600bitflags! {
601    /// `AMCR_EL0` system register value.
602    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
603    #[repr(transparent)]
604    pub struct AmcrEl0: u64 {
605        /// `HDBG` bit.
606        const HDBG = 1 << 10;
607        /// `CG1RZ` bit.
608        const CG1RZ = 1 << 17;
609    }
610}
611
612impl AmcrEl0 {
613    /// Offset of the `HDBG` field.
614    pub const HDBG_SHIFT: u32 = 10;
615    /// Offset of the `CG1RZ` field.
616    pub const CG1RZ_SHIFT: u32 = 17;
617}
618
619bitflags! {
620    /// `AMEVCNTR00` system register value.
621    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
622    #[repr(transparent)]
623    pub struct Amevcntr00: u64 {
624    }
625}
626
627impl Amevcntr00 {
628    /// Offset of the `ACNT` field.
629    pub const ACNT_SHIFT: u32 = 0;
630    /// Mask for the `ACNT` field.
631    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
632
633    /// Returns the value of the `ACNT` field.
634    pub const fn acnt(self) -> u64 {
635        ((self.bits() >> Self::ACNT_SHIFT)
636            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
637    }
638
639    /// Sets the value of the `ACNT` field.
640    pub const fn set_acnt(&mut self, value: u64) {
641        let offset = Self::ACNT_SHIFT;
642        assert!(value & (Self::ACNT_MASK as u64) == value);
643        *self = Self::from_bits_retain(
644            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
645        );
646    }
647
648    /// Returns a copy with the `ACNT` field set to the given value.
649    pub const fn with_acnt(mut self, value: u64) -> Self {
650        self.set_acnt(value);
651        self
652    }
653}
654
655bitflags! {
656    /// `AMEVCNTR00_EL0` system register value.
657    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
658    #[repr(transparent)]
659    pub struct Amevcntr00El0: u64 {
660    }
661}
662
663impl Amevcntr00El0 {
664    /// Offset of the `ACNT` field.
665    pub const ACNT_SHIFT: u32 = 0;
666    /// Mask for the `ACNT` field.
667    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
668
669    /// Returns the value of the `ACNT` field.
670    pub const fn acnt(self) -> u64 {
671        ((self.bits() >> Self::ACNT_SHIFT)
672            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
673    }
674
675    /// Sets the value of the `ACNT` field.
676    pub const fn set_acnt(&mut self, value: u64) {
677        let offset = Self::ACNT_SHIFT;
678        assert!(value & (Self::ACNT_MASK as u64) == value);
679        *self = Self::from_bits_retain(
680            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
681        );
682    }
683
684    /// Returns a copy with the `ACNT` field set to the given value.
685    pub const fn with_acnt(mut self, value: u64) -> Self {
686        self.set_acnt(value);
687        self
688    }
689}
690
691bitflags! {
692    /// `AMEVCNTR01` system register value.
693    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
694    #[repr(transparent)]
695    pub struct Amevcntr01: u64 {
696    }
697}
698
699impl Amevcntr01 {
700    /// Offset of the `ACNT` field.
701    pub const ACNT_SHIFT: u32 = 0;
702    /// Mask for the `ACNT` field.
703    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
704
705    /// Returns the value of the `ACNT` field.
706    pub const fn acnt(self) -> u64 {
707        ((self.bits() >> Self::ACNT_SHIFT)
708            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
709    }
710
711    /// Sets the value of the `ACNT` field.
712    pub const fn set_acnt(&mut self, value: u64) {
713        let offset = Self::ACNT_SHIFT;
714        assert!(value & (Self::ACNT_MASK as u64) == value);
715        *self = Self::from_bits_retain(
716            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
717        );
718    }
719
720    /// Returns a copy with the `ACNT` field set to the given value.
721    pub const fn with_acnt(mut self, value: u64) -> Self {
722        self.set_acnt(value);
723        self
724    }
725}
726
727bitflags! {
728    /// `AMEVCNTR01_EL0` system register value.
729    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
730    #[repr(transparent)]
731    pub struct Amevcntr01El0: u64 {
732    }
733}
734
735impl Amevcntr01El0 {
736    /// Offset of the `ACNT` field.
737    pub const ACNT_SHIFT: u32 = 0;
738    /// Mask for the `ACNT` field.
739    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
740
741    /// Returns the value of the `ACNT` field.
742    pub const fn acnt(self) -> u64 {
743        ((self.bits() >> Self::ACNT_SHIFT)
744            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
745    }
746
747    /// Sets the value of the `ACNT` field.
748    pub const fn set_acnt(&mut self, value: u64) {
749        let offset = Self::ACNT_SHIFT;
750        assert!(value & (Self::ACNT_MASK as u64) == value);
751        *self = Self::from_bits_retain(
752            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
753        );
754    }
755
756    /// Returns a copy with the `ACNT` field set to the given value.
757    pub const fn with_acnt(mut self, value: u64) -> Self {
758        self.set_acnt(value);
759        self
760    }
761}
762
763bitflags! {
764    /// `AMEVCNTR02` system register value.
765    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
766    #[repr(transparent)]
767    pub struct Amevcntr02: u64 {
768    }
769}
770
771impl Amevcntr02 {
772    /// Offset of the `ACNT` field.
773    pub const ACNT_SHIFT: u32 = 0;
774    /// Mask for the `ACNT` field.
775    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
776
777    /// Returns the value of the `ACNT` field.
778    pub const fn acnt(self) -> u64 {
779        ((self.bits() >> Self::ACNT_SHIFT)
780            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
781    }
782
783    /// Sets the value of the `ACNT` field.
784    pub const fn set_acnt(&mut self, value: u64) {
785        let offset = Self::ACNT_SHIFT;
786        assert!(value & (Self::ACNT_MASK as u64) == value);
787        *self = Self::from_bits_retain(
788            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
789        );
790    }
791
792    /// Returns a copy with the `ACNT` field set to the given value.
793    pub const fn with_acnt(mut self, value: u64) -> Self {
794        self.set_acnt(value);
795        self
796    }
797}
798
799bitflags! {
800    /// `AMEVCNTR02_EL0` system register value.
801    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
802    #[repr(transparent)]
803    pub struct Amevcntr02El0: u64 {
804    }
805}
806
807impl Amevcntr02El0 {
808    /// Offset of the `ACNT` field.
809    pub const ACNT_SHIFT: u32 = 0;
810    /// Mask for the `ACNT` field.
811    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
812
813    /// Returns the value of the `ACNT` field.
814    pub const fn acnt(self) -> u64 {
815        ((self.bits() >> Self::ACNT_SHIFT)
816            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
817    }
818
819    /// Sets the value of the `ACNT` field.
820    pub const fn set_acnt(&mut self, value: u64) {
821        let offset = Self::ACNT_SHIFT;
822        assert!(value & (Self::ACNT_MASK as u64) == value);
823        *self = Self::from_bits_retain(
824            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
825        );
826    }
827
828    /// Returns a copy with the `ACNT` field set to the given value.
829    pub const fn with_acnt(mut self, value: u64) -> Self {
830        self.set_acnt(value);
831        self
832    }
833}
834
835bitflags! {
836    /// `AMEVCNTR03` system register value.
837    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
838    #[repr(transparent)]
839    pub struct Amevcntr03: u64 {
840    }
841}
842
843impl Amevcntr03 {
844    /// Offset of the `ACNT` field.
845    pub const ACNT_SHIFT: u32 = 0;
846    /// Mask for the `ACNT` field.
847    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
848
849    /// Returns the value of the `ACNT` field.
850    pub const fn acnt(self) -> u64 {
851        ((self.bits() >> Self::ACNT_SHIFT)
852            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
853    }
854
855    /// Sets the value of the `ACNT` field.
856    pub const fn set_acnt(&mut self, value: u64) {
857        let offset = Self::ACNT_SHIFT;
858        assert!(value & (Self::ACNT_MASK as u64) == value);
859        *self = Self::from_bits_retain(
860            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
861        );
862    }
863
864    /// Returns a copy with the `ACNT` field set to the given value.
865    pub const fn with_acnt(mut self, value: u64) -> Self {
866        self.set_acnt(value);
867        self
868    }
869}
870
871bitflags! {
872    /// `AMEVCNTR03_EL0` system register value.
873    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
874    #[repr(transparent)]
875    pub struct Amevcntr03El0: u64 {
876    }
877}
878
879impl Amevcntr03El0 {
880    /// Offset of the `ACNT` field.
881    pub const ACNT_SHIFT: u32 = 0;
882    /// Mask for the `ACNT` field.
883    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
884
885    /// Returns the value of the `ACNT` field.
886    pub const fn acnt(self) -> u64 {
887        ((self.bits() >> Self::ACNT_SHIFT)
888            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
889    }
890
891    /// Sets the value of the `ACNT` field.
892    pub const fn set_acnt(&mut self, value: u64) {
893        let offset = Self::ACNT_SHIFT;
894        assert!(value & (Self::ACNT_MASK as u64) == value);
895        *self = Self::from_bits_retain(
896            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
897        );
898    }
899
900    /// Returns a copy with the `ACNT` field set to the given value.
901    pub const fn with_acnt(mut self, value: u64) -> Self {
902        self.set_acnt(value);
903        self
904    }
905}
906
907bitflags! {
908    /// `AMEVCNTR10_EL0` system register value.
909    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
910    #[repr(transparent)]
911    pub struct Amevcntr10El0: u64 {
912    }
913}
914
915impl Amevcntr10El0 {
916    /// Offset of the `ACNT` field.
917    pub const ACNT_SHIFT: u32 = 0;
918    /// Mask for the `ACNT` field.
919    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
920
921    /// Returns the value of the `ACNT` field.
922    pub const fn acnt(self) -> u64 {
923        ((self.bits() >> Self::ACNT_SHIFT)
924            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
925    }
926
927    /// Sets the value of the `ACNT` field.
928    pub const fn set_acnt(&mut self, value: u64) {
929        let offset = Self::ACNT_SHIFT;
930        assert!(value & (Self::ACNT_MASK as u64) == value);
931        *self = Self::from_bits_retain(
932            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
933        );
934    }
935
936    /// Returns a copy with the `ACNT` field set to the given value.
937    pub const fn with_acnt(mut self, value: u64) -> Self {
938        self.set_acnt(value);
939        self
940    }
941}
942
943bitflags! {
944    /// `AMEVCNTR110_EL0` system register value.
945    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
946    #[repr(transparent)]
947    pub struct Amevcntr110El0: u64 {
948    }
949}
950
951impl Amevcntr110El0 {
952    /// Offset of the `ACNT` field.
953    pub const ACNT_SHIFT: u32 = 0;
954    /// Mask for the `ACNT` field.
955    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
956
957    /// Returns the value of the `ACNT` field.
958    pub const fn acnt(self) -> u64 {
959        ((self.bits() >> Self::ACNT_SHIFT)
960            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
961    }
962
963    /// Sets the value of the `ACNT` field.
964    pub const fn set_acnt(&mut self, value: u64) {
965        let offset = Self::ACNT_SHIFT;
966        assert!(value & (Self::ACNT_MASK as u64) == value);
967        *self = Self::from_bits_retain(
968            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
969        );
970    }
971
972    /// Returns a copy with the `ACNT` field set to the given value.
973    pub const fn with_acnt(mut self, value: u64) -> Self {
974        self.set_acnt(value);
975        self
976    }
977}
978
979bitflags! {
980    /// `AMEVCNTR111_EL0` system register value.
981    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
982    #[repr(transparent)]
983    pub struct Amevcntr111El0: u64 {
984    }
985}
986
987impl Amevcntr111El0 {
988    /// Offset of the `ACNT` field.
989    pub const ACNT_SHIFT: u32 = 0;
990    /// Mask for the `ACNT` field.
991    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
992
993    /// Returns the value of the `ACNT` field.
994    pub const fn acnt(self) -> u64 {
995        ((self.bits() >> Self::ACNT_SHIFT)
996            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
997    }
998
999    /// Sets the value of the `ACNT` field.
1000    pub const fn set_acnt(&mut self, value: u64) {
1001        let offset = Self::ACNT_SHIFT;
1002        assert!(value & (Self::ACNT_MASK as u64) == value);
1003        *self = Self::from_bits_retain(
1004            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1005        );
1006    }
1007
1008    /// Returns a copy with the `ACNT` field set to the given value.
1009    pub const fn with_acnt(mut self, value: u64) -> Self {
1010        self.set_acnt(value);
1011        self
1012    }
1013}
1014
1015bitflags! {
1016    /// `AMEVCNTR112_EL0` system register value.
1017    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1018    #[repr(transparent)]
1019    pub struct Amevcntr112El0: u64 {
1020    }
1021}
1022
1023impl Amevcntr112El0 {
1024    /// Offset of the `ACNT` field.
1025    pub const ACNT_SHIFT: u32 = 0;
1026    /// Mask for the `ACNT` field.
1027    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1028
1029    /// Returns the value of the `ACNT` field.
1030    pub const fn acnt(self) -> u64 {
1031        ((self.bits() >> Self::ACNT_SHIFT)
1032            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1033    }
1034
1035    /// Sets the value of the `ACNT` field.
1036    pub const fn set_acnt(&mut self, value: u64) {
1037        let offset = Self::ACNT_SHIFT;
1038        assert!(value & (Self::ACNT_MASK as u64) == value);
1039        *self = Self::from_bits_retain(
1040            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1041        );
1042    }
1043
1044    /// Returns a copy with the `ACNT` field set to the given value.
1045    pub const fn with_acnt(mut self, value: u64) -> Self {
1046        self.set_acnt(value);
1047        self
1048    }
1049}
1050
1051bitflags! {
1052    /// `AMEVCNTR113_EL0` system register value.
1053    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1054    #[repr(transparent)]
1055    pub struct Amevcntr113El0: u64 {
1056    }
1057}
1058
1059impl Amevcntr113El0 {
1060    /// Offset of the `ACNT` field.
1061    pub const ACNT_SHIFT: u32 = 0;
1062    /// Mask for the `ACNT` field.
1063    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1064
1065    /// Returns the value of the `ACNT` field.
1066    pub const fn acnt(self) -> u64 {
1067        ((self.bits() >> Self::ACNT_SHIFT)
1068            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1069    }
1070
1071    /// Sets the value of the `ACNT` field.
1072    pub const fn set_acnt(&mut self, value: u64) {
1073        let offset = Self::ACNT_SHIFT;
1074        assert!(value & (Self::ACNT_MASK as u64) == value);
1075        *self = Self::from_bits_retain(
1076            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1077        );
1078    }
1079
1080    /// Returns a copy with the `ACNT` field set to the given value.
1081    pub const fn with_acnt(mut self, value: u64) -> Self {
1082        self.set_acnt(value);
1083        self
1084    }
1085}
1086
1087bitflags! {
1088    /// `AMEVCNTR114_EL0` system register value.
1089    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1090    #[repr(transparent)]
1091    pub struct Amevcntr114El0: u64 {
1092    }
1093}
1094
1095impl Amevcntr114El0 {
1096    /// Offset of the `ACNT` field.
1097    pub const ACNT_SHIFT: u32 = 0;
1098    /// Mask for the `ACNT` field.
1099    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1100
1101    /// Returns the value of the `ACNT` field.
1102    pub const fn acnt(self) -> u64 {
1103        ((self.bits() >> Self::ACNT_SHIFT)
1104            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1105    }
1106
1107    /// Sets the value of the `ACNT` field.
1108    pub const fn set_acnt(&mut self, value: u64) {
1109        let offset = Self::ACNT_SHIFT;
1110        assert!(value & (Self::ACNT_MASK as u64) == value);
1111        *self = Self::from_bits_retain(
1112            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1113        );
1114    }
1115
1116    /// Returns a copy with the `ACNT` field set to the given value.
1117    pub const fn with_acnt(mut self, value: u64) -> Self {
1118        self.set_acnt(value);
1119        self
1120    }
1121}
1122
1123bitflags! {
1124    /// `AMEVCNTR115_EL0` system register value.
1125    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1126    #[repr(transparent)]
1127    pub struct Amevcntr115El0: u64 {
1128    }
1129}
1130
1131impl Amevcntr115El0 {
1132    /// Offset of the `ACNT` field.
1133    pub const ACNT_SHIFT: u32 = 0;
1134    /// Mask for the `ACNT` field.
1135    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1136
1137    /// Returns the value of the `ACNT` field.
1138    pub const fn acnt(self) -> u64 {
1139        ((self.bits() >> Self::ACNT_SHIFT)
1140            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1141    }
1142
1143    /// Sets the value of the `ACNT` field.
1144    pub const fn set_acnt(&mut self, value: u64) {
1145        let offset = Self::ACNT_SHIFT;
1146        assert!(value & (Self::ACNT_MASK as u64) == value);
1147        *self = Self::from_bits_retain(
1148            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1149        );
1150    }
1151
1152    /// Returns a copy with the `ACNT` field set to the given value.
1153    pub const fn with_acnt(mut self, value: u64) -> Self {
1154        self.set_acnt(value);
1155        self
1156    }
1157}
1158
1159bitflags! {
1160    /// `AMEVCNTR11_EL0` system register value.
1161    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1162    #[repr(transparent)]
1163    pub struct Amevcntr11El0: u64 {
1164    }
1165}
1166
1167impl Amevcntr11El0 {
1168    /// Offset of the `ACNT` field.
1169    pub const ACNT_SHIFT: u32 = 0;
1170    /// Mask for the `ACNT` field.
1171    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1172
1173    /// Returns the value of the `ACNT` field.
1174    pub const fn acnt(self) -> u64 {
1175        ((self.bits() >> Self::ACNT_SHIFT)
1176            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1177    }
1178
1179    /// Sets the value of the `ACNT` field.
1180    pub const fn set_acnt(&mut self, value: u64) {
1181        let offset = Self::ACNT_SHIFT;
1182        assert!(value & (Self::ACNT_MASK as u64) == value);
1183        *self = Self::from_bits_retain(
1184            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1185        );
1186    }
1187
1188    /// Returns a copy with the `ACNT` field set to the given value.
1189    pub const fn with_acnt(mut self, value: u64) -> Self {
1190        self.set_acnt(value);
1191        self
1192    }
1193}
1194
1195bitflags! {
1196    /// `AMEVCNTR12_EL0` system register value.
1197    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1198    #[repr(transparent)]
1199    pub struct Amevcntr12El0: u64 {
1200    }
1201}
1202
1203impl Amevcntr12El0 {
1204    /// Offset of the `ACNT` field.
1205    pub const ACNT_SHIFT: u32 = 0;
1206    /// Mask for the `ACNT` field.
1207    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1208
1209    /// Returns the value of the `ACNT` field.
1210    pub const fn acnt(self) -> u64 {
1211        ((self.bits() >> Self::ACNT_SHIFT)
1212            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1213    }
1214
1215    /// Sets the value of the `ACNT` field.
1216    pub const fn set_acnt(&mut self, value: u64) {
1217        let offset = Self::ACNT_SHIFT;
1218        assert!(value & (Self::ACNT_MASK as u64) == value);
1219        *self = Self::from_bits_retain(
1220            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1221        );
1222    }
1223
1224    /// Returns a copy with the `ACNT` field set to the given value.
1225    pub const fn with_acnt(mut self, value: u64) -> Self {
1226        self.set_acnt(value);
1227        self
1228    }
1229}
1230
1231bitflags! {
1232    /// `AMEVCNTR13_EL0` system register value.
1233    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1234    #[repr(transparent)]
1235    pub struct Amevcntr13El0: u64 {
1236    }
1237}
1238
1239impl Amevcntr13El0 {
1240    /// Offset of the `ACNT` field.
1241    pub const ACNT_SHIFT: u32 = 0;
1242    /// Mask for the `ACNT` field.
1243    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1244
1245    /// Returns the value of the `ACNT` field.
1246    pub const fn acnt(self) -> u64 {
1247        ((self.bits() >> Self::ACNT_SHIFT)
1248            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1249    }
1250
1251    /// Sets the value of the `ACNT` field.
1252    pub const fn set_acnt(&mut self, value: u64) {
1253        let offset = Self::ACNT_SHIFT;
1254        assert!(value & (Self::ACNT_MASK as u64) == value);
1255        *self = Self::from_bits_retain(
1256            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1257        );
1258    }
1259
1260    /// Returns a copy with the `ACNT` field set to the given value.
1261    pub const fn with_acnt(mut self, value: u64) -> Self {
1262        self.set_acnt(value);
1263        self
1264    }
1265}
1266
1267bitflags! {
1268    /// `AMEVCNTR14_EL0` system register value.
1269    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1270    #[repr(transparent)]
1271    pub struct Amevcntr14El0: u64 {
1272    }
1273}
1274
1275impl Amevcntr14El0 {
1276    /// Offset of the `ACNT` field.
1277    pub const ACNT_SHIFT: u32 = 0;
1278    /// Mask for the `ACNT` field.
1279    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1280
1281    /// Returns the value of the `ACNT` field.
1282    pub const fn acnt(self) -> u64 {
1283        ((self.bits() >> Self::ACNT_SHIFT)
1284            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1285    }
1286
1287    /// Sets the value of the `ACNT` field.
1288    pub const fn set_acnt(&mut self, value: u64) {
1289        let offset = Self::ACNT_SHIFT;
1290        assert!(value & (Self::ACNT_MASK as u64) == value);
1291        *self = Self::from_bits_retain(
1292            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1293        );
1294    }
1295
1296    /// Returns a copy with the `ACNT` field set to the given value.
1297    pub const fn with_acnt(mut self, value: u64) -> Self {
1298        self.set_acnt(value);
1299        self
1300    }
1301}
1302
1303bitflags! {
1304    /// `AMEVCNTR15_EL0` system register value.
1305    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1306    #[repr(transparent)]
1307    pub struct Amevcntr15El0: u64 {
1308    }
1309}
1310
1311impl Amevcntr15El0 {
1312    /// Offset of the `ACNT` field.
1313    pub const ACNT_SHIFT: u32 = 0;
1314    /// Mask for the `ACNT` field.
1315    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1316
1317    /// Returns the value of the `ACNT` field.
1318    pub const fn acnt(self) -> u64 {
1319        ((self.bits() >> Self::ACNT_SHIFT)
1320            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1321    }
1322
1323    /// Sets the value of the `ACNT` field.
1324    pub const fn set_acnt(&mut self, value: u64) {
1325        let offset = Self::ACNT_SHIFT;
1326        assert!(value & (Self::ACNT_MASK as u64) == value);
1327        *self = Self::from_bits_retain(
1328            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1329        );
1330    }
1331
1332    /// Returns a copy with the `ACNT` field set to the given value.
1333    pub const fn with_acnt(mut self, value: u64) -> Self {
1334        self.set_acnt(value);
1335        self
1336    }
1337}
1338
1339bitflags! {
1340    /// `AMEVCNTR16_EL0` system register value.
1341    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1342    #[repr(transparent)]
1343    pub struct Amevcntr16El0: u64 {
1344    }
1345}
1346
1347impl Amevcntr16El0 {
1348    /// Offset of the `ACNT` field.
1349    pub const ACNT_SHIFT: u32 = 0;
1350    /// Mask for the `ACNT` field.
1351    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1352
1353    /// Returns the value of the `ACNT` field.
1354    pub const fn acnt(self) -> u64 {
1355        ((self.bits() >> Self::ACNT_SHIFT)
1356            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1357    }
1358
1359    /// Sets the value of the `ACNT` field.
1360    pub const fn set_acnt(&mut self, value: u64) {
1361        let offset = Self::ACNT_SHIFT;
1362        assert!(value & (Self::ACNT_MASK as u64) == value);
1363        *self = Self::from_bits_retain(
1364            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1365        );
1366    }
1367
1368    /// Returns a copy with the `ACNT` field set to the given value.
1369    pub const fn with_acnt(mut self, value: u64) -> Self {
1370        self.set_acnt(value);
1371        self
1372    }
1373}
1374
1375bitflags! {
1376    /// `AMEVCNTR17_EL0` system register value.
1377    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1378    #[repr(transparent)]
1379    pub struct Amevcntr17El0: u64 {
1380    }
1381}
1382
1383impl Amevcntr17El0 {
1384    /// Offset of the `ACNT` field.
1385    pub const ACNT_SHIFT: u32 = 0;
1386    /// Mask for the `ACNT` field.
1387    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1388
1389    /// Returns the value of the `ACNT` field.
1390    pub const fn acnt(self) -> u64 {
1391        ((self.bits() >> Self::ACNT_SHIFT)
1392            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1393    }
1394
1395    /// Sets the value of the `ACNT` field.
1396    pub const fn set_acnt(&mut self, value: u64) {
1397        let offset = Self::ACNT_SHIFT;
1398        assert!(value & (Self::ACNT_MASK as u64) == value);
1399        *self = Self::from_bits_retain(
1400            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1401        );
1402    }
1403
1404    /// Returns a copy with the `ACNT` field set to the given value.
1405    pub const fn with_acnt(mut self, value: u64) -> Self {
1406        self.set_acnt(value);
1407        self
1408    }
1409}
1410
1411bitflags! {
1412    /// `AMEVCNTR18_EL0` system register value.
1413    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1414    #[repr(transparent)]
1415    pub struct Amevcntr18El0: u64 {
1416    }
1417}
1418
1419impl Amevcntr18El0 {
1420    /// Offset of the `ACNT` field.
1421    pub const ACNT_SHIFT: u32 = 0;
1422    /// Mask for the `ACNT` field.
1423    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1424
1425    /// Returns the value of the `ACNT` field.
1426    pub const fn acnt(self) -> u64 {
1427        ((self.bits() >> Self::ACNT_SHIFT)
1428            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1429    }
1430
1431    /// Sets the value of the `ACNT` field.
1432    pub const fn set_acnt(&mut self, value: u64) {
1433        let offset = Self::ACNT_SHIFT;
1434        assert!(value & (Self::ACNT_MASK as u64) == value);
1435        *self = Self::from_bits_retain(
1436            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1437        );
1438    }
1439
1440    /// Returns a copy with the `ACNT` field set to the given value.
1441    pub const fn with_acnt(mut self, value: u64) -> Self {
1442        self.set_acnt(value);
1443        self
1444    }
1445}
1446
1447bitflags! {
1448    /// `AMEVCNTR19_EL0` system register value.
1449    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1450    #[repr(transparent)]
1451    pub struct Amevcntr19El0: u64 {
1452    }
1453}
1454
1455impl Amevcntr19El0 {
1456    /// Offset of the `ACNT` field.
1457    pub const ACNT_SHIFT: u32 = 0;
1458    /// Mask for the `ACNT` field.
1459    pub const ACNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
1460
1461    /// Returns the value of the `ACNT` field.
1462    pub const fn acnt(self) -> u64 {
1463        ((self.bits() >> Self::ACNT_SHIFT)
1464            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1465    }
1466
1467    /// Sets the value of the `ACNT` field.
1468    pub const fn set_acnt(&mut self, value: u64) {
1469        let offset = Self::ACNT_SHIFT;
1470        assert!(value & (Self::ACNT_MASK as u64) == value);
1471        *self = Self::from_bits_retain(
1472            (self.bits() & !(Self::ACNT_MASK << offset)) | ((value as u64) << offset),
1473        );
1474    }
1475
1476    /// Returns a copy with the `ACNT` field set to the given value.
1477    pub const fn with_acnt(mut self, value: u64) -> Self {
1478        self.set_acnt(value);
1479        self
1480    }
1481}
1482
1483bitflags! {
1484    /// `AMUSERENR` system register value.
1485    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1486    #[repr(transparent)]
1487    pub struct Amuserenr: u32 {
1488        /// `EN` bit.
1489        const EN = 1 << 0;
1490    }
1491}
1492
1493impl Amuserenr {
1494    /// Offset of the `EN` field.
1495    pub const EN_SHIFT: u32 = 0;
1496}
1497
1498bitflags! {
1499    /// `AMUSERENR_EL0` system register value.
1500    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1501    #[repr(transparent)]
1502    pub struct AmuserenrEl0: u64 {
1503        /// `EN` bit.
1504        const EN = 1 << 0;
1505    }
1506}
1507
1508impl AmuserenrEl0 {
1509    /// Offset of the `EN` field.
1510    pub const EN_SHIFT: u32 = 0;
1511}
1512
1513#[cfg(feature = "el1")]
1514bitflags! {
1515    /// `APIAKeyHi_EL1` system register value.
1516    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1517    #[repr(transparent)]
1518    pub struct ApiakeyhiEl1: u64 {
1519    }
1520}
1521
1522#[cfg(feature = "el1")]
1523impl ApiakeyhiEl1 {
1524    /// Offset of the `APIAKeyHi` field.
1525    pub const APIAKEYHI_SHIFT: u32 = 0;
1526    /// Mask for the `APIAKeyHi` field.
1527    pub const APIAKEYHI_MASK: u64 =
1528        0b1111111111111111111111111111111111111111111111111111111111111111;
1529
1530    /// Returns the value of the `APIAKeyHi` field.
1531    pub const fn apiakeyhi(self) -> u64 {
1532        ((self.bits() >> Self::APIAKEYHI_SHIFT)
1533            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1534    }
1535
1536    /// Sets the value of the `APIAKeyHi` field.
1537    pub const fn set_apiakeyhi(&mut self, value: u64) {
1538        let offset = Self::APIAKEYHI_SHIFT;
1539        assert!(value & (Self::APIAKEYHI_MASK as u64) == value);
1540        *self = Self::from_bits_retain(
1541            (self.bits() & !(Self::APIAKEYHI_MASK << offset)) | ((value as u64) << offset),
1542        );
1543    }
1544
1545    /// Returns a copy with the `APIAKeyHi` field set to the given value.
1546    pub const fn with_apiakeyhi(mut self, value: u64) -> Self {
1547        self.set_apiakeyhi(value);
1548        self
1549    }
1550}
1551
1552#[cfg(feature = "el1")]
1553bitflags! {
1554    /// `APIAKeyLo_EL1` system register value.
1555    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1556    #[repr(transparent)]
1557    pub struct ApiakeyloEl1: u64 {
1558    }
1559}
1560
1561#[cfg(feature = "el1")]
1562impl ApiakeyloEl1 {
1563    /// Offset of the `APIAKeyLo` field.
1564    pub const APIAKEYLO_SHIFT: u32 = 0;
1565    /// Mask for the `APIAKeyLo` field.
1566    pub const APIAKEYLO_MASK: u64 =
1567        0b1111111111111111111111111111111111111111111111111111111111111111;
1568
1569    /// Returns the value of the `APIAKeyLo` field.
1570    pub const fn apiakeylo(self) -> u64 {
1571        ((self.bits() >> Self::APIAKEYLO_SHIFT)
1572            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1573    }
1574
1575    /// Sets the value of the `APIAKeyLo` field.
1576    pub const fn set_apiakeylo(&mut self, value: u64) {
1577        let offset = Self::APIAKEYLO_SHIFT;
1578        assert!(value & (Self::APIAKEYLO_MASK as u64) == value);
1579        *self = Self::from_bits_retain(
1580            (self.bits() & !(Self::APIAKEYLO_MASK << offset)) | ((value as u64) << offset),
1581        );
1582    }
1583
1584    /// Returns a copy with the `APIAKeyLo` field set to the given value.
1585    pub const fn with_apiakeylo(mut self, value: u64) -> Self {
1586        self.set_apiakeylo(value);
1587        self
1588    }
1589}
1590
1591bitflags! {
1592    /// `CCSIDR` system register value.
1593    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1594    #[repr(transparent)]
1595    pub struct Ccsidr: u32 {
1596    }
1597}
1598
1599impl Ccsidr {
1600    /// Offset of the `LineSize` field.
1601    pub const LINESIZE_SHIFT: u32 = 0;
1602    /// Mask for the `LineSize` field.
1603    pub const LINESIZE_MASK: u32 = 0b111;
1604    /// Offset of the `NumSets` field.
1605    pub const NUMSETS_SHIFT: u32 = 13;
1606    /// Mask for the `NumSets` field.
1607    pub const NUMSETS_MASK: u32 = 0b111111111111111;
1608
1609    /// Returns the value of the `LineSize` field.
1610    pub const fn linesize(self) -> u8 {
1611        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
1612    }
1613
1614    /// Sets the value of the `LineSize` field.
1615    pub const fn set_linesize(&mut self, value: u8) {
1616        let offset = Self::LINESIZE_SHIFT;
1617        assert!(value & (Self::LINESIZE_MASK as u8) == value);
1618        *self = Self::from_bits_retain(
1619            (self.bits() & !(Self::LINESIZE_MASK << offset)) | ((value as u32) << offset),
1620        );
1621    }
1622
1623    /// Returns a copy with the `LineSize` field set to the given value.
1624    pub const fn with_linesize(mut self, value: u8) -> Self {
1625        self.set_linesize(value);
1626        self
1627    }
1628
1629    /// Returns the value of the `NumSets` field.
1630    pub const fn numsets(self) -> u16 {
1631        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111) as u16
1632    }
1633
1634    /// Sets the value of the `NumSets` field.
1635    pub const fn set_numsets(&mut self, value: u16) {
1636        let offset = Self::NUMSETS_SHIFT;
1637        assert!(value & (Self::NUMSETS_MASK as u16) == value);
1638        *self = Self::from_bits_retain(
1639            (self.bits() & !(Self::NUMSETS_MASK << offset)) | ((value as u32) << offset),
1640        );
1641    }
1642
1643    /// Returns a copy with the `NumSets` field set to the given value.
1644    pub const fn with_numsets(mut self, value: u16) -> Self {
1645        self.set_numsets(value);
1646        self
1647    }
1648}
1649
1650bitflags! {
1651    /// `CCSIDR2` system register value.
1652    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1653    #[repr(transparent)]
1654    pub struct Ccsidr2: u32 {
1655    }
1656}
1657
1658impl Ccsidr2 {
1659    /// Offset of the `NumSets` field.
1660    pub const NUMSETS_SHIFT: u32 = 0;
1661    /// Mask for the `NumSets` field.
1662    pub const NUMSETS_MASK: u32 = 0b111111111111111111111111;
1663
1664    /// Returns the value of the `NumSets` field.
1665    pub const fn numsets(self) -> u32 {
1666        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111111111111) as u32
1667    }
1668
1669    /// Sets the value of the `NumSets` field.
1670    pub const fn set_numsets(&mut self, value: u32) {
1671        let offset = Self::NUMSETS_SHIFT;
1672        assert!(value & (Self::NUMSETS_MASK as u32) == value);
1673        *self = Self::from_bits_retain(
1674            (self.bits() & !(Self::NUMSETS_MASK << offset)) | ((value as u32) << offset),
1675        );
1676    }
1677
1678    /// Returns a copy with the `NumSets` field set to the given value.
1679    pub const fn with_numsets(mut self, value: u32) -> Self {
1680        self.set_numsets(value);
1681        self
1682    }
1683}
1684
1685#[cfg(feature = "el1")]
1686bitflags! {
1687    /// `CCSIDR_EL1` system register value.
1688    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1689    #[repr(transparent)]
1690    pub struct CcsidrEl1: u64 {
1691    }
1692}
1693
1694#[cfg(feature = "el1")]
1695impl CcsidrEl1 {
1696    /// Offset of the `LineSize` field.
1697    pub const LINESIZE_SHIFT: u32 = 0;
1698    /// Mask for the `LineSize` field.
1699    pub const LINESIZE_MASK: u64 = 0b111;
1700
1701    /// Returns the value of the `LineSize` field.
1702    pub const fn linesize(self) -> u8 {
1703        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
1704    }
1705
1706    /// Sets the value of the `LineSize` field.
1707    pub const fn set_linesize(&mut self, value: u8) {
1708        let offset = Self::LINESIZE_SHIFT;
1709        assert!(value & (Self::LINESIZE_MASK as u8) == value);
1710        *self = Self::from_bits_retain(
1711            (self.bits() & !(Self::LINESIZE_MASK << offset)) | ((value as u64) << offset),
1712        );
1713    }
1714
1715    /// Returns a copy with the `LineSize` field set to the given value.
1716    pub const fn with_linesize(mut self, value: u8) -> Self {
1717        self.set_linesize(value);
1718        self
1719    }
1720}
1721
1722bitflags! {
1723    /// `CLIDR` system register value.
1724    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1725    #[repr(transparent)]
1726    pub struct Clidr: u32 {
1727    }
1728}
1729
1730impl Clidr {
1731    /// Offset of the `Ctype<n>` field.
1732    pub const CTYPE_SHIFT: u32 = 0;
1733    /// Mask for the `Ctype<n>` field.
1734    pub const CTYPE_MASK: u32 = 0b111;
1735    /// Offset of the `LoUIS` field.
1736    pub const LOUIS_SHIFT: u32 = 21;
1737    /// Mask for the `LoUIS` field.
1738    pub const LOUIS_MASK: u32 = 0b111;
1739    /// Offset of the `LoC` field.
1740    pub const LOC_SHIFT: u32 = 24;
1741    /// Mask for the `LoC` field.
1742    pub const LOC_MASK: u32 = 0b111;
1743    /// Offset of the `LoUU` field.
1744    pub const LOUU_SHIFT: u32 = 27;
1745    /// Mask for the `LoUU` field.
1746    pub const LOUU_MASK: u32 = 0b111;
1747    /// Offset of the `ICB` field.
1748    pub const ICB_SHIFT: u32 = 30;
1749    /// Mask for the `ICB` field.
1750    pub const ICB_MASK: u32 = 0b11;
1751
1752    /// Returns the value of the given `Ctype<n>` field.
1753    pub const fn ctype(self, n: u32) -> u8 {
1754        assert!(n >= 1 && n < 8);
1755        ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8
1756    }
1757
1758    /// Sets the value of the `Ctype<n>` field.
1759    pub const fn set_ctype(&mut self, n: u32, value: u8) {
1760        assert!(n >= 1 && n < 8);
1761        let offset = Self::CTYPE_SHIFT + (n - 1) * 3;
1762        assert!(value & (Self::CTYPE_MASK as u8) == value);
1763        *self = Self::from_bits_retain(
1764            (self.bits() & !(Self::CTYPE_MASK << offset)) | ((value as u32) << offset),
1765        );
1766    }
1767
1768    /// Returns a copy with the `Ctype<n>` field set to the given value.
1769    pub const fn with_ctype(mut self, n: u32, value: u8) -> Self {
1770        self.set_ctype(n, value);
1771        self
1772    }
1773
1774    /// Returns the value of the `LoUIS` field.
1775    pub const fn louis(self) -> u8 {
1776        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
1777    }
1778
1779    /// Sets the value of the `LoUIS` field.
1780    pub const fn set_louis(&mut self, value: u8) {
1781        let offset = Self::LOUIS_SHIFT;
1782        assert!(value & (Self::LOUIS_MASK as u8) == value);
1783        *self = Self::from_bits_retain(
1784            (self.bits() & !(Self::LOUIS_MASK << offset)) | ((value as u32) << offset),
1785        );
1786    }
1787
1788    /// Returns a copy with the `LoUIS` field set to the given value.
1789    pub const fn with_louis(mut self, value: u8) -> Self {
1790        self.set_louis(value);
1791        self
1792    }
1793
1794    /// Returns the value of the `LoC` field.
1795    pub const fn loc(self) -> u8 {
1796        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
1797    }
1798
1799    /// Sets the value of the `LoC` field.
1800    pub const fn set_loc(&mut self, value: u8) {
1801        let offset = Self::LOC_SHIFT;
1802        assert!(value & (Self::LOC_MASK as u8) == value);
1803        *self = Self::from_bits_retain(
1804            (self.bits() & !(Self::LOC_MASK << offset)) | ((value as u32) << offset),
1805        );
1806    }
1807
1808    /// Returns a copy with the `LoC` field set to the given value.
1809    pub const fn with_loc(mut self, value: u8) -> Self {
1810        self.set_loc(value);
1811        self
1812    }
1813
1814    /// Returns the value of the `LoUU` field.
1815    pub const fn louu(self) -> u8 {
1816        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
1817    }
1818
1819    /// Sets the value of the `LoUU` field.
1820    pub const fn set_louu(&mut self, value: u8) {
1821        let offset = Self::LOUU_SHIFT;
1822        assert!(value & (Self::LOUU_MASK as u8) == value);
1823        *self = Self::from_bits_retain(
1824            (self.bits() & !(Self::LOUU_MASK << offset)) | ((value as u32) << offset),
1825        );
1826    }
1827
1828    /// Returns a copy with the `LoUU` field set to the given value.
1829    pub const fn with_louu(mut self, value: u8) -> Self {
1830        self.set_louu(value);
1831        self
1832    }
1833
1834    /// Returns the value of the `ICB` field.
1835    pub const fn icb(self) -> u8 {
1836        ((self.bits() >> Self::ICB_SHIFT) & 0b11) as u8
1837    }
1838
1839    /// Sets the value of the `ICB` field.
1840    pub const fn set_icb(&mut self, value: u8) {
1841        let offset = Self::ICB_SHIFT;
1842        assert!(value & (Self::ICB_MASK as u8) == value);
1843        *self = Self::from_bits_retain(
1844            (self.bits() & !(Self::ICB_MASK << offset)) | ((value as u32) << offset),
1845        );
1846    }
1847
1848    /// Returns a copy with the `ICB` field set to the given value.
1849    pub const fn with_icb(mut self, value: u8) -> Self {
1850        self.set_icb(value);
1851        self
1852    }
1853}
1854
1855#[cfg(feature = "el1")]
1856bitflags! {
1857    /// `CLIDR_EL1` system register value.
1858    ///
1859    /// Cache Level ID.
1860    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1861    #[repr(transparent)]
1862    pub struct ClidrEl1: u64 {
1863    }
1864}
1865
1866#[cfg(feature = "el1")]
1867impl ClidrEl1 {
1868    /// Offset of the `Ctype<n>` field.
1869    pub const CTYPE_SHIFT: u32 = 0;
1870    /// Mask for the `Ctype<n>` field.
1871    pub const CTYPE_MASK: u64 = 0b111;
1872    /// Offset of the `LoUIS` field.
1873    pub const LOUIS_SHIFT: u32 = 21;
1874    /// Mask for the `LoUIS` field.
1875    pub const LOUIS_MASK: u64 = 0b111;
1876    /// Offset of the `LoC` field.
1877    pub const LOC_SHIFT: u32 = 24;
1878    /// Mask for the `LoC` field.
1879    pub const LOC_MASK: u64 = 0b111;
1880    /// Offset of the `LoUU` field.
1881    pub const LOUU_SHIFT: u32 = 27;
1882    /// Mask for the `LoUU` field.
1883    pub const LOUU_MASK: u64 = 0b111;
1884    /// Offset of the `ICB` field.
1885    pub const ICB_SHIFT: u32 = 30;
1886    /// Mask for the `ICB` field.
1887    pub const ICB_MASK: u64 = 0b111;
1888    /// Offset of the `Ttype<n>` field.
1889    pub const TTYPE_SHIFT: u32 = 33;
1890    /// Mask for the `Ttype<n>` field.
1891    pub const TTYPE_MASK: u64 = 0b11;
1892
1893    /// Returns the value of the given `Ctype<n>` field.
1894    pub fn ctype(self, n: u32) -> crate::manual::CacheType {
1895        assert!(n >= 1 && n < 8);
1896        crate::manual::CacheType::try_from(
1897            ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8,
1898        )
1899        .unwrap()
1900    }
1901
1902    /// Sets the value of the `Ctype<n>` field.
1903    pub fn set_ctype(&mut self, n: u32, value: crate::manual::CacheType) {
1904        assert!(n >= 1 && n < 8);
1905        let offset = Self::CTYPE_SHIFT + (n - 1) * 3;
1906        let value: u8 = value.into();
1907        assert!(value & (Self::CTYPE_MASK as u8) == value);
1908        *self = Self::from_bits_retain(
1909            (self.bits() & !(Self::CTYPE_MASK << offset)) | ((value as u64) << offset),
1910        );
1911    }
1912
1913    /// Returns a copy with the `Ctype<n>` field set to the given value.
1914    pub fn with_ctype(mut self, n: u32, value: crate::manual::CacheType) -> Self {
1915        self.set_ctype(n, value);
1916        self
1917    }
1918
1919    /// Returns the value of the `LoUIS` field.
1920    ///
1921    /// Level of Unification Inner Shareable for the cache hierarchy.
1922    pub const fn louis(self) -> u8 {
1923        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
1924    }
1925
1926    /// Sets the value of the `LoUIS` field.
1927    ///
1928    /// Level of Unification Inner Shareable for the cache hierarchy.
1929    pub const fn set_louis(&mut self, value: u8) {
1930        let offset = Self::LOUIS_SHIFT;
1931        assert!(value & (Self::LOUIS_MASK as u8) == value);
1932        *self = Self::from_bits_retain(
1933            (self.bits() & !(Self::LOUIS_MASK << offset)) | ((value as u64) << offset),
1934        );
1935    }
1936
1937    /// Returns a copy with the `LoUIS` field set to the given value.
1938    ///
1939    /// Level of Unification Inner Shareable for the cache hierarchy.
1940    pub const fn with_louis(mut self, value: u8) -> Self {
1941        self.set_louis(value);
1942        self
1943    }
1944
1945    /// Returns the value of the `LoC` field.
1946    ///
1947    /// Level of Coherence for the cache hierarchy.
1948    pub const fn loc(self) -> u8 {
1949        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
1950    }
1951
1952    /// Sets the value of the `LoC` field.
1953    ///
1954    /// Level of Coherence for the cache hierarchy.
1955    pub const fn set_loc(&mut self, value: u8) {
1956        let offset = Self::LOC_SHIFT;
1957        assert!(value & (Self::LOC_MASK as u8) == value);
1958        *self = Self::from_bits_retain(
1959            (self.bits() & !(Self::LOC_MASK << offset)) | ((value as u64) << offset),
1960        );
1961    }
1962
1963    /// Returns a copy with the `LoC` field set to the given value.
1964    ///
1965    /// Level of Coherence for the cache hierarchy.
1966    pub const fn with_loc(mut self, value: u8) -> Self {
1967        self.set_loc(value);
1968        self
1969    }
1970
1971    /// Returns the value of the `LoUU` field.
1972    ///
1973    /// Level of Unification Uniprocessor for the cache hierarchy.
1974    pub const fn louu(self) -> u8 {
1975        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
1976    }
1977
1978    /// Sets the value of the `LoUU` field.
1979    ///
1980    /// Level of Unification Uniprocessor for the cache hierarchy.
1981    pub const fn set_louu(&mut self, value: u8) {
1982        let offset = Self::LOUU_SHIFT;
1983        assert!(value & (Self::LOUU_MASK as u8) == value);
1984        *self = Self::from_bits_retain(
1985            (self.bits() & !(Self::LOUU_MASK << offset)) | ((value as u64) << offset),
1986        );
1987    }
1988
1989    /// Returns a copy with the `LoUU` field set to the given value.
1990    ///
1991    /// Level of Unification Uniprocessor for the cache hierarchy.
1992    pub const fn with_louu(mut self, value: u8) -> Self {
1993        self.set_louu(value);
1994        self
1995    }
1996
1997    /// Returns the value of the `ICB` field.
1998    ///
1999    /// Inner cache boundary level.
2000    pub const fn icb(self) -> u8 {
2001        ((self.bits() >> Self::ICB_SHIFT) & 0b111) as u8
2002    }
2003
2004    /// Sets the value of the `ICB` field.
2005    ///
2006    /// Inner cache boundary level.
2007    pub const fn set_icb(&mut self, value: u8) {
2008        let offset = Self::ICB_SHIFT;
2009        assert!(value & (Self::ICB_MASK as u8) == value);
2010        *self = Self::from_bits_retain(
2011            (self.bits() & !(Self::ICB_MASK << offset)) | ((value as u64) << offset),
2012        );
2013    }
2014
2015    /// Returns a copy with the `ICB` field set to the given value.
2016    ///
2017    /// Inner cache boundary level.
2018    pub const fn with_icb(mut self, value: u8) -> Self {
2019        self.set_icb(value);
2020        self
2021    }
2022
2023    /// Returns the value of the given `Ttype<n>` field.
2024    pub const fn ttype(self, n: u32) -> u8 {
2025        assert!(n >= 1 && n < 8);
2026        ((self.bits() >> (Self::TTYPE_SHIFT + (n - 1) * 2)) & 0b11) as u8
2027    }
2028
2029    /// Sets the value of the `Ttype<n>` field.
2030    pub const fn set_ttype(&mut self, n: u32, value: u8) {
2031        assert!(n >= 1 && n < 8);
2032        let offset = Self::TTYPE_SHIFT + (n - 1) * 2;
2033        assert!(value & (Self::TTYPE_MASK as u8) == value);
2034        *self = Self::from_bits_retain(
2035            (self.bits() & !(Self::TTYPE_MASK << offset)) | ((value as u64) << offset),
2036        );
2037    }
2038
2039    /// Returns a copy with the `Ttype<n>` field set to the given value.
2040    pub const fn with_ttype(mut self, n: u32, value: u8) -> Self {
2041        self.set_ttype(n, value);
2042        self
2043    }
2044}
2045
2046bitflags! {
2047    /// `CNTFRQ` system register value.
2048    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2049    #[repr(transparent)]
2050    pub struct Cntfrq: u32 {
2051    }
2052}
2053
2054impl Cntfrq {
2055    /// Offset of the `ClockFreq` field.
2056    pub const CLOCKFREQ_SHIFT: u32 = 0;
2057    /// Mask for the `ClockFreq` field.
2058    pub const CLOCKFREQ_MASK: u32 = 0b11111111111111111111111111111111;
2059
2060    /// Returns the value of the `ClockFreq` field.
2061    pub const fn clockfreq(self) -> u32 {
2062        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
2063    }
2064
2065    /// Sets the value of the `ClockFreq` field.
2066    pub const fn set_clockfreq(&mut self, value: u32) {
2067        let offset = Self::CLOCKFREQ_SHIFT;
2068        assert!(value & (Self::CLOCKFREQ_MASK as u32) == value);
2069        *self = Self::from_bits_retain(
2070            (self.bits() & !(Self::CLOCKFREQ_MASK << offset)) | ((value as u32) << offset),
2071        );
2072    }
2073
2074    /// Returns a copy with the `ClockFreq` field set to the given value.
2075    pub const fn with_clockfreq(mut self, value: u32) -> Self {
2076        self.set_clockfreq(value);
2077        self
2078    }
2079}
2080
2081bitflags! {
2082    /// `CNTFRQ_EL0` system register value.
2083    ///
2084    /// Counter-timer Frequency Register
2085    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2086    #[repr(transparent)]
2087    pub struct CntfrqEl0: u64 {
2088    }
2089}
2090
2091impl CntfrqEl0 {
2092    /// Offset of the `ClockFreq` field.
2093    pub const CLOCKFREQ_SHIFT: u32 = 0;
2094    /// Mask for the `ClockFreq` field.
2095    pub const CLOCKFREQ_MASK: u64 = 0b11111111111111111111111111111111;
2096
2097    /// Returns the value of the `ClockFreq` field.
2098    pub const fn clockfreq(self) -> u32 {
2099        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
2100    }
2101
2102    /// Sets the value of the `ClockFreq` field.
2103    pub const fn set_clockfreq(&mut self, value: u32) {
2104        let offset = Self::CLOCKFREQ_SHIFT;
2105        assert!(value & (Self::CLOCKFREQ_MASK as u32) == value);
2106        *self = Self::from_bits_retain(
2107            (self.bits() & !(Self::CLOCKFREQ_MASK << offset)) | ((value as u64) << offset),
2108        );
2109    }
2110
2111    /// Returns a copy with the `ClockFreq` field set to the given value.
2112    pub const fn with_clockfreq(mut self, value: u32) -> Self {
2113        self.set_clockfreq(value);
2114        self
2115    }
2116}
2117
2118bitflags! {
2119    /// `CNTHCTL` system register value.
2120    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2121    #[repr(transparent)]
2122    pub struct Cnthctl: u32 {
2123        /// `PL1PCTEN` bit.
2124        const PL1PCTEN = 1 << 0;
2125        /// `PL1PCEN` bit.
2126        const PL1PCEN = 1 << 1;
2127        /// `EVNTEN` bit.
2128        const EVNTEN = 1 << 2;
2129        /// `EVNTDIR` bit.
2130        const EVNTDIR = 1 << 3;
2131        /// `EVNTIS` bit.
2132        const EVNTIS = 1 << 17;
2133    }
2134}
2135
2136impl Cnthctl {
2137    /// Offset of the `PL1PCTEN` field.
2138    pub const PL1PCTEN_SHIFT: u32 = 0;
2139    /// Offset of the `PL1PCEN` field.
2140    pub const PL1PCEN_SHIFT: u32 = 1;
2141    /// Offset of the `EVNTEN` field.
2142    pub const EVNTEN_SHIFT: u32 = 2;
2143    /// Offset of the `EVNTDIR` field.
2144    pub const EVNTDIR_SHIFT: u32 = 3;
2145    /// Offset of the `EVNTI` field.
2146    pub const EVNTI_SHIFT: u32 = 4;
2147    /// Mask for the `EVNTI` field.
2148    pub const EVNTI_MASK: u32 = 0b1111;
2149    /// Offset of the `EVNTIS` field.
2150    pub const EVNTIS_SHIFT: u32 = 17;
2151
2152    /// Returns the value of the `EVNTI` field.
2153    pub const fn evnti(self) -> u8 {
2154        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
2155    }
2156
2157    /// Sets the value of the `EVNTI` field.
2158    pub const fn set_evnti(&mut self, value: u8) {
2159        let offset = Self::EVNTI_SHIFT;
2160        assert!(value & (Self::EVNTI_MASK as u8) == value);
2161        *self = Self::from_bits_retain(
2162            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u32) << offset),
2163        );
2164    }
2165
2166    /// Returns a copy with the `EVNTI` field set to the given value.
2167    pub const fn with_evnti(mut self, value: u8) -> Self {
2168        self.set_evnti(value);
2169        self
2170    }
2171}
2172
2173#[cfg(feature = "el2")]
2174bitflags! {
2175    /// `CNTHCTL_EL2` system register value.
2176    ///
2177    /// Counter-timer Hypervisor Control Register
2178    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2179    #[repr(transparent)]
2180    pub struct CnthctlEl2: u64 {
2181        /// `EL0PCTEN` bit.
2182        const EL0PCTEN = 1 << 0;
2183        /// `EL0VCTEN` bit.
2184        const EL0VCTEN = 1 << 1;
2185        /// `EL1PCEN` bit.
2186        const EL1PCEN = 1 << 1;
2187        /// `EVNTEN` bit.
2188        const EVNTEN = 1 << 2;
2189        /// `EVNTDIR` bit.
2190        const EVNTDIR = 1 << 3;
2191        /// `EL0VTEN` bit.
2192        const EL0VTEN = 1 << 8;
2193        /// `EL0PTEN` bit.
2194        const EL0PTEN = 1 << 9;
2195        /// `EL1PTEN` bit.
2196        const EL1PTEN = 1 << 11;
2197        /// `ECV` bit.
2198        const ECV = 1 << 12;
2199        /// `EL1TVT` bit.
2200        const EL1TVT = 1 << 13;
2201        /// `EL1TVCT` bit.
2202        const EL1TVCT = 1 << 14;
2203        /// `EL1NVPCT` bit.
2204        const EL1NVPCT = 1 << 15;
2205        /// `EL1NVVCT` bit.
2206        const EL1NVVCT = 1 << 16;
2207        /// `EVNTIS` bit.
2208        const EVNTIS = 1 << 17;
2209        /// `CNTVMASK` bit.
2210        const CNTVMASK = 1 << 18;
2211        /// `CNTPMASK` bit.
2212        const CNTPMASK = 1 << 19;
2213    }
2214}
2215
2216#[cfg(feature = "el2")]
2217impl CnthctlEl2 {
2218    /// Offset of the `EL0PCTEN` field.
2219    pub const EL0PCTEN_SHIFT: u32 = 0;
2220    /// Offset of the `EL0VCTEN` field.
2221    pub const EL0VCTEN_SHIFT: u32 = 1;
2222    /// Offset of the `EL1PCEN` field.
2223    pub const EL1PCEN_SHIFT: u32 = 1;
2224    /// Offset of the `EVNTEN` field.
2225    pub const EVNTEN_SHIFT: u32 = 2;
2226    /// Offset of the `EVNTDIR` field.
2227    pub const EVNTDIR_SHIFT: u32 = 3;
2228    /// Offset of the `EVNTI` field.
2229    pub const EVNTI_SHIFT: u32 = 4;
2230    /// Mask for the `EVNTI` field.
2231    pub const EVNTI_MASK: u64 = 0b1111;
2232    /// Offset of the `EL0VTEN` field.
2233    pub const EL0VTEN_SHIFT: u32 = 8;
2234    /// Offset of the `EL0PTEN` field.
2235    pub const EL0PTEN_SHIFT: u32 = 9;
2236    /// Offset of the `EL1PTEN` field.
2237    pub const EL1PTEN_SHIFT: u32 = 11;
2238    /// Offset of the `ECV` field.
2239    pub const ECV_SHIFT: u32 = 12;
2240    /// Offset of the `EL1TVT` field.
2241    pub const EL1TVT_SHIFT: u32 = 13;
2242    /// Offset of the `EL1TVCT` field.
2243    pub const EL1TVCT_SHIFT: u32 = 14;
2244    /// Offset of the `EL1NVPCT` field.
2245    pub const EL1NVPCT_SHIFT: u32 = 15;
2246    /// Offset of the `EL1NVVCT` field.
2247    pub const EL1NVVCT_SHIFT: u32 = 16;
2248    /// Offset of the `EVNTIS` field.
2249    pub const EVNTIS_SHIFT: u32 = 17;
2250    /// Offset of the `CNTVMASK` field.
2251    pub const CNTVMASK_SHIFT: u32 = 18;
2252    /// Offset of the `CNTPMASK` field.
2253    pub const CNTPMASK_SHIFT: u32 = 19;
2254
2255    /// Returns the value of the `EVNTI` field.
2256    pub const fn evnti(self) -> u8 {
2257        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
2258    }
2259
2260    /// Sets the value of the `EVNTI` field.
2261    pub const fn set_evnti(&mut self, value: u8) {
2262        let offset = Self::EVNTI_SHIFT;
2263        assert!(value & (Self::EVNTI_MASK as u8) == value);
2264        *self = Self::from_bits_retain(
2265            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u64) << offset),
2266        );
2267    }
2268
2269    /// Returns a copy with the `EVNTI` field set to the given value.
2270    pub const fn with_evnti(mut self, value: u8) -> Self {
2271        self.set_evnti(value);
2272        self
2273    }
2274}
2275
2276bitflags! {
2277    /// `CNTHPS_CTL` system register value.
2278    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2279    #[repr(transparent)]
2280    pub struct CnthpsCtl: u32 {
2281        /// `ENABLE` bit.
2282        const ENABLE = 1 << 0;
2283        /// `IMASK` bit.
2284        const IMASK = 1 << 1;
2285        /// `ISTATUS` bit.
2286        const ISTATUS = 1 << 2;
2287    }
2288}
2289
2290impl CnthpsCtl {
2291    /// Offset of the `ENABLE` field.
2292    pub const ENABLE_SHIFT: u32 = 0;
2293    /// Offset of the `IMASK` field.
2294    pub const IMASK_SHIFT: u32 = 1;
2295    /// Offset of the `ISTATUS` field.
2296    pub const ISTATUS_SHIFT: u32 = 2;
2297}
2298
2299#[cfg(feature = "el2")]
2300bitflags! {
2301    /// `CNTHPS_CTL_EL2` system register value.
2302    ///
2303    /// Counter-timer Secure Physical Timer Control Register (EL2)
2304    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2305    #[repr(transparent)]
2306    pub struct CnthpsCtlEl2: u64 {
2307        /// `ENABLE` bit.
2308        const ENABLE = 1 << 0;
2309        /// `IMASK` bit.
2310        const IMASK = 1 << 1;
2311        /// `ISTATUS` bit.
2312        const ISTATUS = 1 << 2;
2313    }
2314}
2315
2316#[cfg(feature = "el2")]
2317impl CnthpsCtlEl2 {
2318    /// Offset of the `ENABLE` field.
2319    pub const ENABLE_SHIFT: u32 = 0;
2320    /// Offset of the `IMASK` field.
2321    pub const IMASK_SHIFT: u32 = 1;
2322    /// Offset of the `ISTATUS` field.
2323    pub const ISTATUS_SHIFT: u32 = 2;
2324}
2325
2326bitflags! {
2327    /// `CNTHPS_CVAL` system register value.
2328    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2329    #[repr(transparent)]
2330    pub struct CnthpsCval: u64 {
2331    }
2332}
2333
2334impl CnthpsCval {
2335    /// Offset of the `CompareValue` field.
2336    pub const COMPAREVALUE_SHIFT: u32 = 0;
2337    /// Mask for the `CompareValue` field.
2338    pub const COMPAREVALUE_MASK: u64 =
2339        0b1111111111111111111111111111111111111111111111111111111111111111;
2340
2341    /// Returns the value of the `CompareValue` field.
2342    pub const fn comparevalue(self) -> u64 {
2343        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2344            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2345    }
2346
2347    /// Sets the value of the `CompareValue` field.
2348    pub const fn set_comparevalue(&mut self, value: u64) {
2349        let offset = Self::COMPAREVALUE_SHIFT;
2350        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2351        *self = Self::from_bits_retain(
2352            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2353        );
2354    }
2355
2356    /// Returns a copy with the `CompareValue` field set to the given value.
2357    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2358        self.set_comparevalue(value);
2359        self
2360    }
2361}
2362
2363#[cfg(feature = "el2")]
2364bitflags! {
2365    /// `CNTHPS_CVAL_EL2` system register value.
2366    ///
2367    /// Counter-timer Secure Physical Timer CompareValue Register (EL2)
2368    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2369    #[repr(transparent)]
2370    pub struct CnthpsCvalEl2: u64 {
2371    }
2372}
2373
2374#[cfg(feature = "el2")]
2375impl CnthpsCvalEl2 {
2376    /// Offset of the `CompareValue` field.
2377    pub const COMPAREVALUE_SHIFT: u32 = 0;
2378    /// Mask for the `CompareValue` field.
2379    pub const COMPAREVALUE_MASK: u64 =
2380        0b1111111111111111111111111111111111111111111111111111111111111111;
2381
2382    /// Returns the value of the `CompareValue` field.
2383    pub const fn comparevalue(self) -> u64 {
2384        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2385            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2386    }
2387
2388    /// Sets the value of the `CompareValue` field.
2389    pub const fn set_comparevalue(&mut self, value: u64) {
2390        let offset = Self::COMPAREVALUE_SHIFT;
2391        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2392        *self = Self::from_bits_retain(
2393            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2394        );
2395    }
2396
2397    /// Returns a copy with the `CompareValue` field set to the given value.
2398    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2399        self.set_comparevalue(value);
2400        self
2401    }
2402}
2403
2404bitflags! {
2405    /// `CNTHPS_TVAL` system register value.
2406    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2407    #[repr(transparent)]
2408    pub struct CnthpsTval: u32 {
2409    }
2410}
2411
2412impl CnthpsTval {
2413    /// Offset of the `TimerValue` field.
2414    pub const TIMERVALUE_SHIFT: u32 = 0;
2415    /// Mask for the `TimerValue` field.
2416    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
2417
2418    /// Returns the value of the `TimerValue` field.
2419    pub const fn timervalue(self) -> u32 {
2420        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2421    }
2422
2423    /// Sets the value of the `TimerValue` field.
2424    pub const fn set_timervalue(&mut self, value: u32) {
2425        let offset = Self::TIMERVALUE_SHIFT;
2426        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2427        *self = Self::from_bits_retain(
2428            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
2429        );
2430    }
2431
2432    /// Returns a copy with the `TimerValue` field set to the given value.
2433    pub const fn with_timervalue(mut self, value: u32) -> Self {
2434        self.set_timervalue(value);
2435        self
2436    }
2437}
2438
2439#[cfg(feature = "el2")]
2440bitflags! {
2441    /// `CNTHPS_TVAL_EL2` system register value.
2442    ///
2443    /// Counter-timer Secure Physical Timer TimerValue Register (EL2)
2444    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2445    #[repr(transparent)]
2446    pub struct CnthpsTvalEl2: u64 {
2447    }
2448}
2449
2450#[cfg(feature = "el2")]
2451impl CnthpsTvalEl2 {
2452    /// Offset of the `TimerValue` field.
2453    pub const TIMERVALUE_SHIFT: u32 = 0;
2454    /// Mask for the `TimerValue` field.
2455    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
2456
2457    /// Returns the value of the `TimerValue` field.
2458    pub const fn timervalue(self) -> u32 {
2459        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2460    }
2461
2462    /// Sets the value of the `TimerValue` field.
2463    pub const fn set_timervalue(&mut self, value: u32) {
2464        let offset = Self::TIMERVALUE_SHIFT;
2465        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2466        *self = Self::from_bits_retain(
2467            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
2468        );
2469    }
2470
2471    /// Returns a copy with the `TimerValue` field set to the given value.
2472    pub const fn with_timervalue(mut self, value: u32) -> Self {
2473        self.set_timervalue(value);
2474        self
2475    }
2476}
2477
2478bitflags! {
2479    /// `CNTHP_CTL` system register value.
2480    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2481    #[repr(transparent)]
2482    pub struct CnthpCtl: u32 {
2483        /// `ENABLE` bit.
2484        const ENABLE = 1 << 0;
2485        /// `IMASK` bit.
2486        const IMASK = 1 << 1;
2487        /// `ISTATUS` bit.
2488        const ISTATUS = 1 << 2;
2489    }
2490}
2491
2492impl CnthpCtl {
2493    /// Offset of the `ENABLE` field.
2494    pub const ENABLE_SHIFT: u32 = 0;
2495    /// Offset of the `IMASK` field.
2496    pub const IMASK_SHIFT: u32 = 1;
2497    /// Offset of the `ISTATUS` field.
2498    pub const ISTATUS_SHIFT: u32 = 2;
2499}
2500
2501#[cfg(feature = "el2")]
2502bitflags! {
2503    /// `CNTHP_CTL_EL2` system register value.
2504    ///
2505    /// Counter-timer Hypervisor Physical Timer Control Register
2506    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2507    #[repr(transparent)]
2508    pub struct CnthpCtlEl2: u64 {
2509        /// `ENABLE` bit.
2510        const ENABLE = 1 << 0;
2511        /// `IMASK` bit.
2512        const IMASK = 1 << 1;
2513        /// `ISTATUS` bit.
2514        const ISTATUS = 1 << 2;
2515    }
2516}
2517
2518#[cfg(feature = "el2")]
2519impl CnthpCtlEl2 {
2520    /// Offset of the `ENABLE` field.
2521    pub const ENABLE_SHIFT: u32 = 0;
2522    /// Offset of the `IMASK` field.
2523    pub const IMASK_SHIFT: u32 = 1;
2524    /// Offset of the `ISTATUS` field.
2525    pub const ISTATUS_SHIFT: u32 = 2;
2526}
2527
2528bitflags! {
2529    /// `CNTHP_CVAL` system register value.
2530    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2531    #[repr(transparent)]
2532    pub struct CnthpCval: u64 {
2533    }
2534}
2535
2536impl CnthpCval {
2537    /// Offset of the `CompareValue` field.
2538    pub const COMPAREVALUE_SHIFT: u32 = 0;
2539    /// Mask for the `CompareValue` field.
2540    pub const COMPAREVALUE_MASK: u64 =
2541        0b1111111111111111111111111111111111111111111111111111111111111111;
2542
2543    /// Returns the value of the `CompareValue` field.
2544    pub const fn comparevalue(self) -> u64 {
2545        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2546            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2547    }
2548
2549    /// Sets the value of the `CompareValue` field.
2550    pub const fn set_comparevalue(&mut self, value: u64) {
2551        let offset = Self::COMPAREVALUE_SHIFT;
2552        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2553        *self = Self::from_bits_retain(
2554            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2555        );
2556    }
2557
2558    /// Returns a copy with the `CompareValue` field set to the given value.
2559    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2560        self.set_comparevalue(value);
2561        self
2562    }
2563}
2564
2565#[cfg(feature = "el2")]
2566bitflags! {
2567    /// `CNTHP_CVAL_EL2` system register value.
2568    ///
2569    /// Counter-timer Physical Timer CompareValue Register (EL2)
2570    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2571    #[repr(transparent)]
2572    pub struct CnthpCvalEl2: u64 {
2573    }
2574}
2575
2576#[cfg(feature = "el2")]
2577impl CnthpCvalEl2 {
2578    /// Offset of the `CompareValue` field.
2579    pub const COMPAREVALUE_SHIFT: u32 = 0;
2580    /// Mask for the `CompareValue` field.
2581    pub const COMPAREVALUE_MASK: u64 =
2582        0b1111111111111111111111111111111111111111111111111111111111111111;
2583
2584    /// Returns the value of the `CompareValue` field.
2585    pub const fn comparevalue(self) -> u64 {
2586        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2587            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2588    }
2589
2590    /// Sets the value of the `CompareValue` field.
2591    pub const fn set_comparevalue(&mut self, value: u64) {
2592        let offset = Self::COMPAREVALUE_SHIFT;
2593        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2594        *self = Self::from_bits_retain(
2595            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2596        );
2597    }
2598
2599    /// Returns a copy with the `CompareValue` field set to the given value.
2600    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2601        self.set_comparevalue(value);
2602        self
2603    }
2604}
2605
2606bitflags! {
2607    /// `CNTHP_TVAL` system register value.
2608    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2609    #[repr(transparent)]
2610    pub struct CnthpTval: u32 {
2611    }
2612}
2613
2614impl CnthpTval {
2615    /// Offset of the `TimerValue` field.
2616    pub const TIMERVALUE_SHIFT: u32 = 0;
2617    /// Mask for the `TimerValue` field.
2618    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
2619
2620    /// Returns the value of the `TimerValue` field.
2621    pub const fn timervalue(self) -> u32 {
2622        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2623    }
2624
2625    /// Sets the value of the `TimerValue` field.
2626    pub const fn set_timervalue(&mut self, value: u32) {
2627        let offset = Self::TIMERVALUE_SHIFT;
2628        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2629        *self = Self::from_bits_retain(
2630            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
2631        );
2632    }
2633
2634    /// Returns a copy with the `TimerValue` field set to the given value.
2635    pub const fn with_timervalue(mut self, value: u32) -> Self {
2636        self.set_timervalue(value);
2637        self
2638    }
2639}
2640
2641#[cfg(feature = "el2")]
2642bitflags! {
2643    /// `CNTHP_TVAL_EL2` system register value.
2644    ///
2645    /// Counter-timer Physical Timer TimerValue Register (EL2)
2646    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2647    #[repr(transparent)]
2648    pub struct CnthpTvalEl2: u64 {
2649    }
2650}
2651
2652#[cfg(feature = "el2")]
2653impl CnthpTvalEl2 {
2654    /// Offset of the `TimerValue` field.
2655    pub const TIMERVALUE_SHIFT: u32 = 0;
2656    /// Mask for the `TimerValue` field.
2657    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
2658
2659    /// Returns the value of the `TimerValue` field.
2660    pub const fn timervalue(self) -> u32 {
2661        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2662    }
2663
2664    /// Sets the value of the `TimerValue` field.
2665    pub const fn set_timervalue(&mut self, value: u32) {
2666        let offset = Self::TIMERVALUE_SHIFT;
2667        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2668        *self = Self::from_bits_retain(
2669            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
2670        );
2671    }
2672
2673    /// Returns a copy with the `TimerValue` field set to the given value.
2674    pub const fn with_timervalue(mut self, value: u32) -> Self {
2675        self.set_timervalue(value);
2676        self
2677    }
2678}
2679
2680bitflags! {
2681    /// `CNTHVS_CTL` system register value.
2682    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2683    #[repr(transparent)]
2684    pub struct CnthvsCtl: u32 {
2685        /// `ENABLE` bit.
2686        const ENABLE = 1 << 0;
2687        /// `IMASK` bit.
2688        const IMASK = 1 << 1;
2689        /// `ISTATUS` bit.
2690        const ISTATUS = 1 << 2;
2691    }
2692}
2693
2694impl CnthvsCtl {
2695    /// Offset of the `ENABLE` field.
2696    pub const ENABLE_SHIFT: u32 = 0;
2697    /// Offset of the `IMASK` field.
2698    pub const IMASK_SHIFT: u32 = 1;
2699    /// Offset of the `ISTATUS` field.
2700    pub const ISTATUS_SHIFT: u32 = 2;
2701}
2702
2703#[cfg(feature = "el2")]
2704bitflags! {
2705    /// `CNTHVS_CTL_EL2` system register value.
2706    ///
2707    /// Counter-timer Secure Virtual Timer Control Register (EL2)
2708    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2709    #[repr(transparent)]
2710    pub struct CnthvsCtlEl2: u64 {
2711        /// `ENABLE` bit.
2712        const ENABLE = 1 << 0;
2713        /// `IMASK` bit.
2714        const IMASK = 1 << 1;
2715        /// `ISTATUS` bit.
2716        const ISTATUS = 1 << 2;
2717    }
2718}
2719
2720#[cfg(feature = "el2")]
2721impl CnthvsCtlEl2 {
2722    /// Offset of the `ENABLE` field.
2723    pub const ENABLE_SHIFT: u32 = 0;
2724    /// Offset of the `IMASK` field.
2725    pub const IMASK_SHIFT: u32 = 1;
2726    /// Offset of the `ISTATUS` field.
2727    pub const ISTATUS_SHIFT: u32 = 2;
2728}
2729
2730bitflags! {
2731    /// `CNTHVS_CVAL` system register value.
2732    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2733    #[repr(transparent)]
2734    pub struct CnthvsCval: u64 {
2735    }
2736}
2737
2738impl CnthvsCval {
2739    /// Offset of the `CompareValue` field.
2740    pub const COMPAREVALUE_SHIFT: u32 = 0;
2741    /// Mask for the `CompareValue` field.
2742    pub const COMPAREVALUE_MASK: u64 =
2743        0b1111111111111111111111111111111111111111111111111111111111111111;
2744
2745    /// Returns the value of the `CompareValue` field.
2746    pub const fn comparevalue(self) -> u64 {
2747        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2748            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2749    }
2750
2751    /// Sets the value of the `CompareValue` field.
2752    pub const fn set_comparevalue(&mut self, value: u64) {
2753        let offset = Self::COMPAREVALUE_SHIFT;
2754        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2755        *self = Self::from_bits_retain(
2756            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2757        );
2758    }
2759
2760    /// Returns a copy with the `CompareValue` field set to the given value.
2761    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2762        self.set_comparevalue(value);
2763        self
2764    }
2765}
2766
2767#[cfg(feature = "el2")]
2768bitflags! {
2769    /// `CNTHVS_CVAL_EL2` system register value.
2770    ///
2771    /// Counter-timer Secure Virtual Timer CompareValue Register (EL2)
2772    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2773    #[repr(transparent)]
2774    pub struct CnthvsCvalEl2: u64 {
2775    }
2776}
2777
2778#[cfg(feature = "el2")]
2779impl CnthvsCvalEl2 {
2780    /// Offset of the `CompareValue` field.
2781    pub const COMPAREVALUE_SHIFT: u32 = 0;
2782    /// Mask for the `CompareValue` field.
2783    pub const COMPAREVALUE_MASK: u64 =
2784        0b1111111111111111111111111111111111111111111111111111111111111111;
2785
2786    /// Returns the value of the `CompareValue` field.
2787    pub const fn comparevalue(self) -> u64 {
2788        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2789            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2790    }
2791
2792    /// Sets the value of the `CompareValue` field.
2793    pub const fn set_comparevalue(&mut self, value: u64) {
2794        let offset = Self::COMPAREVALUE_SHIFT;
2795        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2796        *self = Self::from_bits_retain(
2797            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2798        );
2799    }
2800
2801    /// Returns a copy with the `CompareValue` field set to the given value.
2802    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2803        self.set_comparevalue(value);
2804        self
2805    }
2806}
2807
2808bitflags! {
2809    /// `CNTHVS_TVAL` system register value.
2810    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2811    #[repr(transparent)]
2812    pub struct CnthvsTval: u32 {
2813    }
2814}
2815
2816impl CnthvsTval {
2817    /// Offset of the `TimerValue` field.
2818    pub const TIMERVALUE_SHIFT: u32 = 0;
2819    /// Mask for the `TimerValue` field.
2820    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
2821
2822    /// Returns the value of the `TimerValue` field.
2823    pub const fn timervalue(self) -> u32 {
2824        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2825    }
2826
2827    /// Sets the value of the `TimerValue` field.
2828    pub const fn set_timervalue(&mut self, value: u32) {
2829        let offset = Self::TIMERVALUE_SHIFT;
2830        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2831        *self = Self::from_bits_retain(
2832            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
2833        );
2834    }
2835
2836    /// Returns a copy with the `TimerValue` field set to the given value.
2837    pub const fn with_timervalue(mut self, value: u32) -> Self {
2838        self.set_timervalue(value);
2839        self
2840    }
2841}
2842
2843#[cfg(feature = "el2")]
2844bitflags! {
2845    /// `CNTHVS_TVAL_EL2` system register value.
2846    ///
2847    /// Counter-timer Secure Virtual Timer TimerValue Register (EL2)
2848    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2849    #[repr(transparent)]
2850    pub struct CnthvsTvalEl2: u64 {
2851    }
2852}
2853
2854#[cfg(feature = "el2")]
2855impl CnthvsTvalEl2 {
2856    /// Offset of the `TimerValue` field.
2857    pub const TIMERVALUE_SHIFT: u32 = 0;
2858    /// Mask for the `TimerValue` field.
2859    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
2860
2861    /// Returns the value of the `TimerValue` field.
2862    pub const fn timervalue(self) -> u32 {
2863        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2864    }
2865
2866    /// Sets the value of the `TimerValue` field.
2867    pub const fn set_timervalue(&mut self, value: u32) {
2868        let offset = Self::TIMERVALUE_SHIFT;
2869        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2870        *self = Self::from_bits_retain(
2871            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
2872        );
2873    }
2874
2875    /// Returns a copy with the `TimerValue` field set to the given value.
2876    pub const fn with_timervalue(mut self, value: u32) -> Self {
2877        self.set_timervalue(value);
2878        self
2879    }
2880}
2881
2882bitflags! {
2883    /// `CNTHV_CTL` system register value.
2884    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2885    #[repr(transparent)]
2886    pub struct CnthvCtl: u32 {
2887        /// `ENABLE` bit.
2888        const ENABLE = 1 << 0;
2889        /// `IMASK` bit.
2890        const IMASK = 1 << 1;
2891        /// `ISTATUS` bit.
2892        const ISTATUS = 1 << 2;
2893    }
2894}
2895
2896impl CnthvCtl {
2897    /// Offset of the `ENABLE` field.
2898    pub const ENABLE_SHIFT: u32 = 0;
2899    /// Offset of the `IMASK` field.
2900    pub const IMASK_SHIFT: u32 = 1;
2901    /// Offset of the `ISTATUS` field.
2902    pub const ISTATUS_SHIFT: u32 = 2;
2903}
2904
2905#[cfg(feature = "el2")]
2906bitflags! {
2907    /// `CNTHV_CTL_EL2` system register value.
2908    ///
2909    /// Counter-timer Virtual Timer Control Register (EL2)
2910    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2911    #[repr(transparent)]
2912    pub struct CnthvCtlEl2: u64 {
2913        /// `ENABLE` bit.
2914        const ENABLE = 1 << 0;
2915        /// `IMASK` bit.
2916        const IMASK = 1 << 1;
2917        /// `ISTATUS` bit.
2918        const ISTATUS = 1 << 2;
2919    }
2920}
2921
2922#[cfg(feature = "el2")]
2923impl CnthvCtlEl2 {
2924    /// Offset of the `ENABLE` field.
2925    pub const ENABLE_SHIFT: u32 = 0;
2926    /// Offset of the `IMASK` field.
2927    pub const IMASK_SHIFT: u32 = 1;
2928    /// Offset of the `ISTATUS` field.
2929    pub const ISTATUS_SHIFT: u32 = 2;
2930}
2931
2932bitflags! {
2933    /// `CNTHV_CVAL` system register value.
2934    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2935    #[repr(transparent)]
2936    pub struct CnthvCval: u64 {
2937    }
2938}
2939
2940impl CnthvCval {
2941    /// Offset of the `CompareValue` field.
2942    pub const COMPAREVALUE_SHIFT: u32 = 0;
2943    /// Mask for the `CompareValue` field.
2944    pub const COMPAREVALUE_MASK: u64 =
2945        0b1111111111111111111111111111111111111111111111111111111111111111;
2946
2947    /// Returns the value of the `CompareValue` field.
2948    pub const fn comparevalue(self) -> u64 {
2949        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2950            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2951    }
2952
2953    /// Sets the value of the `CompareValue` field.
2954    pub const fn set_comparevalue(&mut self, value: u64) {
2955        let offset = Self::COMPAREVALUE_SHIFT;
2956        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2957        *self = Self::from_bits_retain(
2958            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2959        );
2960    }
2961
2962    /// Returns a copy with the `CompareValue` field set to the given value.
2963    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2964        self.set_comparevalue(value);
2965        self
2966    }
2967}
2968
2969#[cfg(feature = "el2")]
2970bitflags! {
2971    /// `CNTHV_CVAL_EL2` system register value.
2972    ///
2973    /// Counter-timer Virtual Timer CompareValue Register (EL2)
2974    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2975    #[repr(transparent)]
2976    pub struct CnthvCvalEl2: u64 {
2977    }
2978}
2979
2980#[cfg(feature = "el2")]
2981impl CnthvCvalEl2 {
2982    /// Offset of the `CompareValue` field.
2983    pub const COMPAREVALUE_SHIFT: u32 = 0;
2984    /// Mask for the `CompareValue` field.
2985    pub const COMPAREVALUE_MASK: u64 =
2986        0b1111111111111111111111111111111111111111111111111111111111111111;
2987
2988    /// Returns the value of the `CompareValue` field.
2989    pub const fn comparevalue(self) -> u64 {
2990        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2991            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2992    }
2993
2994    /// Sets the value of the `CompareValue` field.
2995    pub const fn set_comparevalue(&mut self, value: u64) {
2996        let offset = Self::COMPAREVALUE_SHIFT;
2997        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2998        *self = Self::from_bits_retain(
2999            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
3000        );
3001    }
3002
3003    /// Returns a copy with the `CompareValue` field set to the given value.
3004    pub const fn with_comparevalue(mut self, value: u64) -> Self {
3005        self.set_comparevalue(value);
3006        self
3007    }
3008}
3009
3010bitflags! {
3011    /// `CNTHV_TVAL` system register value.
3012    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3013    #[repr(transparent)]
3014    pub struct CnthvTval: u32 {
3015    }
3016}
3017
3018impl CnthvTval {
3019    /// Offset of the `TimerValue` field.
3020    pub const TIMERVALUE_SHIFT: u32 = 0;
3021    /// Mask for the `TimerValue` field.
3022    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
3023
3024    /// Returns the value of the `TimerValue` field.
3025    pub const fn timervalue(self) -> u32 {
3026        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
3027    }
3028
3029    /// Sets the value of the `TimerValue` field.
3030    pub const fn set_timervalue(&mut self, value: u32) {
3031        let offset = Self::TIMERVALUE_SHIFT;
3032        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
3033        *self = Self::from_bits_retain(
3034            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
3035        );
3036    }
3037
3038    /// Returns a copy with the `TimerValue` field set to the given value.
3039    pub const fn with_timervalue(mut self, value: u32) -> Self {
3040        self.set_timervalue(value);
3041        self
3042    }
3043}
3044
3045#[cfg(feature = "el2")]
3046bitflags! {
3047    /// `CNTHV_TVAL_EL2` system register value.
3048    ///
3049    /// Counter-timer Virtual Timer TimerValue Register (EL2)
3050    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3051    #[repr(transparent)]
3052    pub struct CnthvTvalEl2: u64 {
3053    }
3054}
3055
3056#[cfg(feature = "el2")]
3057impl CnthvTvalEl2 {
3058    /// Offset of the `TimerValue` field.
3059    pub const TIMERVALUE_SHIFT: u32 = 0;
3060    /// Mask for the `TimerValue` field.
3061    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
3062
3063    /// Returns the value of the `TimerValue` field.
3064    pub const fn timervalue(self) -> u32 {
3065        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
3066    }
3067
3068    /// Sets the value of the `TimerValue` field.
3069    pub const fn set_timervalue(&mut self, value: u32) {
3070        let offset = Self::TIMERVALUE_SHIFT;
3071        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
3072        *self = Self::from_bits_retain(
3073            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
3074        );
3075    }
3076
3077    /// Returns a copy with the `TimerValue` field set to the given value.
3078    pub const fn with_timervalue(mut self, value: u32) -> Self {
3079        self.set_timervalue(value);
3080        self
3081    }
3082}
3083
3084bitflags! {
3085    /// `CNTKCTL` system register value.
3086    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3087    #[repr(transparent)]
3088    pub struct Cntkctl: u32 {
3089        /// `PL0PCTEN` bit.
3090        const PL0PCTEN = 1 << 0;
3091        /// `PL0VCTEN` bit.
3092        const PL0VCTEN = 1 << 1;
3093        /// `EVNTEN` bit.
3094        const EVNTEN = 1 << 2;
3095        /// `EVNTDIR` bit.
3096        const EVNTDIR = 1 << 3;
3097        /// `PL0VTEN` bit.
3098        const PL0VTEN = 1 << 8;
3099        /// `PL0PTEN` bit.
3100        const PL0PTEN = 1 << 9;
3101        /// `EVNTIS` bit.
3102        const EVNTIS = 1 << 17;
3103    }
3104}
3105
3106impl Cntkctl {
3107    /// Offset of the `PL0PCTEN` field.
3108    pub const PL0PCTEN_SHIFT: u32 = 0;
3109    /// Offset of the `PL0VCTEN` field.
3110    pub const PL0VCTEN_SHIFT: u32 = 1;
3111    /// Offset of the `EVNTEN` field.
3112    pub const EVNTEN_SHIFT: u32 = 2;
3113    /// Offset of the `EVNTDIR` field.
3114    pub const EVNTDIR_SHIFT: u32 = 3;
3115    /// Offset of the `EVNTI` field.
3116    pub const EVNTI_SHIFT: u32 = 4;
3117    /// Mask for the `EVNTI` field.
3118    pub const EVNTI_MASK: u32 = 0b1111;
3119    /// Offset of the `PL0VTEN` field.
3120    pub const PL0VTEN_SHIFT: u32 = 8;
3121    /// Offset of the `PL0PTEN` field.
3122    pub const PL0PTEN_SHIFT: u32 = 9;
3123    /// Offset of the `EVNTIS` field.
3124    pub const EVNTIS_SHIFT: u32 = 17;
3125
3126    /// Returns the value of the `EVNTI` field.
3127    pub const fn evnti(self) -> u8 {
3128        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
3129    }
3130
3131    /// Sets the value of the `EVNTI` field.
3132    pub const fn set_evnti(&mut self, value: u8) {
3133        let offset = Self::EVNTI_SHIFT;
3134        assert!(value & (Self::EVNTI_MASK as u8) == value);
3135        *self = Self::from_bits_retain(
3136            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u32) << offset),
3137        );
3138    }
3139
3140    /// Returns a copy with the `EVNTI` field set to the given value.
3141    pub const fn with_evnti(mut self, value: u8) -> Self {
3142        self.set_evnti(value);
3143        self
3144    }
3145}
3146
3147#[cfg(feature = "el1")]
3148bitflags! {
3149    /// `CNTKCTL_EL1` system register value.
3150    ///
3151    /// Counter-timer Kernel Control Register
3152    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3153    #[repr(transparent)]
3154    pub struct CntkctlEl1: u64 {
3155        /// `EL0PCTEN` bit.
3156        const EL0PCTEN = 1 << 0;
3157        /// `EL0VCTEN` bit.
3158        const EL0VCTEN = 1 << 1;
3159        /// `EVNTEN` bit.
3160        const EVNTEN = 1 << 2;
3161        /// `EVNTDIR` bit.
3162        const EVNTDIR = 1 << 3;
3163        /// `EL0VTEN` bit.
3164        const EL0VTEN = 1 << 8;
3165        /// `EL0PTEN` bit.
3166        const EL0PTEN = 1 << 9;
3167        /// `EL1PCTEN` bit.
3168        const EL1PCTEN = 1 << 10;
3169        /// `EL1PTEN` bit.
3170        const EL1PTEN = 1 << 11;
3171        /// `ECV` bit.
3172        const ECV = 1 << 12;
3173        /// `EL1TVT` bit.
3174        const EL1TVT = 1 << 13;
3175        /// `EL1TVCT` bit.
3176        const EL1TVCT = 1 << 14;
3177        /// `EL1NVPCT` bit.
3178        const EL1NVPCT = 1 << 15;
3179        /// `EL1NVVCT` bit.
3180        const EL1NVVCT = 1 << 16;
3181        /// `EVNTIS` bit.
3182        const EVNTIS = 1 << 17;
3183        /// `CNTVMASK` bit.
3184        const CNTVMASK = 1 << 18;
3185        /// `CNTPMASK` bit.
3186        const CNTPMASK = 1 << 19;
3187    }
3188}
3189
3190#[cfg(feature = "el1")]
3191impl CntkctlEl1 {
3192    /// Offset of the `EL0PCTEN` field.
3193    pub const EL0PCTEN_SHIFT: u32 = 0;
3194    /// Offset of the `EL0VCTEN` field.
3195    pub const EL0VCTEN_SHIFT: u32 = 1;
3196    /// Offset of the `EVNTEN` field.
3197    pub const EVNTEN_SHIFT: u32 = 2;
3198    /// Offset of the `EVNTDIR` field.
3199    pub const EVNTDIR_SHIFT: u32 = 3;
3200    /// Offset of the `EVNTI` field.
3201    pub const EVNTI_SHIFT: u32 = 4;
3202    /// Mask for the `EVNTI` field.
3203    pub const EVNTI_MASK: u64 = 0b1111;
3204    /// Offset of the `EL0VTEN` field.
3205    pub const EL0VTEN_SHIFT: u32 = 8;
3206    /// Offset of the `EL0PTEN` field.
3207    pub const EL0PTEN_SHIFT: u32 = 9;
3208    /// Offset of the `EL1PCTEN` field.
3209    pub const EL1PCTEN_SHIFT: u32 = 10;
3210    /// Offset of the `EL1PTEN` field.
3211    pub const EL1PTEN_SHIFT: u32 = 11;
3212    /// Offset of the `ECV` field.
3213    pub const ECV_SHIFT: u32 = 12;
3214    /// Offset of the `EL1TVT` field.
3215    pub const EL1TVT_SHIFT: u32 = 13;
3216    /// Offset of the `EL1TVCT` field.
3217    pub const EL1TVCT_SHIFT: u32 = 14;
3218    /// Offset of the `EL1NVPCT` field.
3219    pub const EL1NVPCT_SHIFT: u32 = 15;
3220    /// Offset of the `EL1NVVCT` field.
3221    pub const EL1NVVCT_SHIFT: u32 = 16;
3222    /// Offset of the `EVNTIS` field.
3223    pub const EVNTIS_SHIFT: u32 = 17;
3224    /// Offset of the `CNTVMASK` field.
3225    pub const CNTVMASK_SHIFT: u32 = 18;
3226    /// Offset of the `CNTPMASK` field.
3227    pub const CNTPMASK_SHIFT: u32 = 19;
3228
3229    /// Returns the value of the `EVNTI` field.
3230    pub const fn evnti(self) -> u8 {
3231        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
3232    }
3233
3234    /// Sets the value of the `EVNTI` field.
3235    pub const fn set_evnti(&mut self, value: u8) {
3236        let offset = Self::EVNTI_SHIFT;
3237        assert!(value & (Self::EVNTI_MASK as u8) == value);
3238        *self = Self::from_bits_retain(
3239            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u64) << offset),
3240        );
3241    }
3242
3243    /// Returns a copy with the `EVNTI` field set to the given value.
3244    pub const fn with_evnti(mut self, value: u8) -> Self {
3245        self.set_evnti(value);
3246        self
3247    }
3248}
3249
3250bitflags! {
3251    /// `CNTPCT` system register value.
3252    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3253    #[repr(transparent)]
3254    pub struct Cntpct: u64 {
3255    }
3256}
3257
3258impl Cntpct {
3259    /// Offset of the `PhysicalCount` field.
3260    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
3261    /// Mask for the `PhysicalCount` field.
3262    pub const PHYSICALCOUNT_MASK: u64 =
3263        0b1111111111111111111111111111111111111111111111111111111111111111;
3264
3265    /// Returns the value of the `PhysicalCount` field.
3266    pub const fn physicalcount(self) -> u64 {
3267        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
3268            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3269    }
3270
3271    /// Sets the value of the `PhysicalCount` field.
3272    pub const fn set_physicalcount(&mut self, value: u64) {
3273        let offset = Self::PHYSICALCOUNT_SHIFT;
3274        assert!(value & (Self::PHYSICALCOUNT_MASK as u64) == value);
3275        *self = Self::from_bits_retain(
3276            (self.bits() & !(Self::PHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
3277        );
3278    }
3279
3280    /// Returns a copy with the `PhysicalCount` field set to the given value.
3281    pub const fn with_physicalcount(mut self, value: u64) -> Self {
3282        self.set_physicalcount(value);
3283        self
3284    }
3285}
3286
3287bitflags! {
3288    /// `CNTPCTSS` system register value.
3289    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3290    #[repr(transparent)]
3291    pub struct Cntpctss: u64 {
3292    }
3293}
3294
3295impl Cntpctss {
3296    /// Offset of the `SSPhysicalCount` field.
3297    pub const SSPHYSICALCOUNT_SHIFT: u32 = 0;
3298    /// Mask for the `SSPhysicalCount` field.
3299    pub const SSPHYSICALCOUNT_MASK: u64 =
3300        0b1111111111111111111111111111111111111111111111111111111111111111;
3301
3302    /// Returns the value of the `SSPhysicalCount` field.
3303    pub const fn ssphysicalcount(self) -> u64 {
3304        ((self.bits() >> Self::SSPHYSICALCOUNT_SHIFT)
3305            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3306    }
3307
3308    /// Sets the value of the `SSPhysicalCount` field.
3309    pub const fn set_ssphysicalcount(&mut self, value: u64) {
3310        let offset = Self::SSPHYSICALCOUNT_SHIFT;
3311        assert!(value & (Self::SSPHYSICALCOUNT_MASK as u64) == value);
3312        *self = Self::from_bits_retain(
3313            (self.bits() & !(Self::SSPHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
3314        );
3315    }
3316
3317    /// Returns a copy with the `SSPhysicalCount` field set to the given value.
3318    pub const fn with_ssphysicalcount(mut self, value: u64) -> Self {
3319        self.set_ssphysicalcount(value);
3320        self
3321    }
3322}
3323
3324bitflags! {
3325    /// `CNTPCTSS_EL0` system register value.
3326    ///
3327    /// Counter-timer Self-Synchronized Physical Count Register
3328    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3329    #[repr(transparent)]
3330    pub struct CntpctssEl0: u64 {
3331    }
3332}
3333
3334impl CntpctssEl0 {
3335    /// Offset of the `SSPhysicalCount` field.
3336    pub const SSPHYSICALCOUNT_SHIFT: u32 = 0;
3337    /// Mask for the `SSPhysicalCount` field.
3338    pub const SSPHYSICALCOUNT_MASK: u64 =
3339        0b1111111111111111111111111111111111111111111111111111111111111111;
3340
3341    /// Returns the value of the `SSPhysicalCount` field.
3342    pub const fn ssphysicalcount(self) -> u64 {
3343        ((self.bits() >> Self::SSPHYSICALCOUNT_SHIFT)
3344            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3345    }
3346
3347    /// Sets the value of the `SSPhysicalCount` field.
3348    pub const fn set_ssphysicalcount(&mut self, value: u64) {
3349        let offset = Self::SSPHYSICALCOUNT_SHIFT;
3350        assert!(value & (Self::SSPHYSICALCOUNT_MASK as u64) == value);
3351        *self = Self::from_bits_retain(
3352            (self.bits() & !(Self::SSPHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
3353        );
3354    }
3355
3356    /// Returns a copy with the `SSPhysicalCount` field set to the given value.
3357    pub const fn with_ssphysicalcount(mut self, value: u64) -> Self {
3358        self.set_ssphysicalcount(value);
3359        self
3360    }
3361}
3362
3363bitflags! {
3364    /// `CNTPCT_EL0` system register value.
3365    ///
3366    /// Counter-timer Physical Count Register
3367    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3368    #[repr(transparent)]
3369    pub struct CntpctEl0: u64 {
3370    }
3371}
3372
3373impl CntpctEl0 {
3374    /// Offset of the `PhysicalCount` field.
3375    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
3376    /// Mask for the `PhysicalCount` field.
3377    pub const PHYSICALCOUNT_MASK: u64 =
3378        0b1111111111111111111111111111111111111111111111111111111111111111;
3379
3380    /// Returns the value of the `PhysicalCount` field.
3381    pub const fn physicalcount(self) -> u64 {
3382        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
3383            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3384    }
3385
3386    /// Sets the value of the `PhysicalCount` field.
3387    pub const fn set_physicalcount(&mut self, value: u64) {
3388        let offset = Self::PHYSICALCOUNT_SHIFT;
3389        assert!(value & (Self::PHYSICALCOUNT_MASK as u64) == value);
3390        *self = Self::from_bits_retain(
3391            (self.bits() & !(Self::PHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
3392        );
3393    }
3394
3395    /// Returns a copy with the `PhysicalCount` field set to the given value.
3396    pub const fn with_physicalcount(mut self, value: u64) -> Self {
3397        self.set_physicalcount(value);
3398        self
3399    }
3400}
3401
3402#[cfg(feature = "el2")]
3403bitflags! {
3404    /// `CNTPOFF_EL2` system register value.
3405    ///
3406    /// Counter-timer Physical Offset Register
3407    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3408    #[repr(transparent)]
3409    pub struct CntpoffEl2: u64 {
3410    }
3411}
3412
3413#[cfg(feature = "el2")]
3414impl CntpoffEl2 {
3415    /// Offset of the `PO` field.
3416    pub const PO_SHIFT: u32 = 0;
3417    /// Mask for the `PO` field.
3418    pub const PO_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
3419
3420    /// Returns the value of the `PO` field.
3421    pub const fn po(self) -> u64 {
3422        ((self.bits() >> Self::PO_SHIFT)
3423            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3424    }
3425
3426    /// Sets the value of the `PO` field.
3427    pub const fn set_po(&mut self, value: u64) {
3428        let offset = Self::PO_SHIFT;
3429        assert!(value & (Self::PO_MASK as u64) == value);
3430        *self = Self::from_bits_retain(
3431            (self.bits() & !(Self::PO_MASK << offset)) | ((value as u64) << offset),
3432        );
3433    }
3434
3435    /// Returns a copy with the `PO` field set to the given value.
3436    pub const fn with_po(mut self, value: u64) -> Self {
3437        self.set_po(value);
3438        self
3439    }
3440}
3441
3442#[cfg(feature = "el1")]
3443bitflags! {
3444    /// `CNTPS_CTL_EL1` system register value.
3445    ///
3446    /// Counter-timer Physical Secure Timer Control Register
3447    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3448    #[repr(transparent)]
3449    pub struct CntpsCtlEl1: u64 {
3450        /// `ENABLE` bit.
3451        const ENABLE = 1 << 0;
3452        /// `IMASK` bit.
3453        const IMASK = 1 << 1;
3454        /// `ISTATUS` bit.
3455        const ISTATUS = 1 << 2;
3456    }
3457}
3458
3459#[cfg(feature = "el1")]
3460impl CntpsCtlEl1 {
3461    /// Offset of the `ENABLE` field.
3462    pub const ENABLE_SHIFT: u32 = 0;
3463    /// Offset of the `IMASK` field.
3464    pub const IMASK_SHIFT: u32 = 1;
3465    /// Offset of the `ISTATUS` field.
3466    pub const ISTATUS_SHIFT: u32 = 2;
3467}
3468
3469#[cfg(feature = "el1")]
3470bitflags! {
3471    /// `CNTPS_CVAL_EL1` system register value.
3472    ///
3473    /// Counter-timer Physical Secure Timer CompareValue Register
3474    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3475    #[repr(transparent)]
3476    pub struct CntpsCvalEl1: u64 {
3477    }
3478}
3479
3480#[cfg(feature = "el1")]
3481impl CntpsCvalEl1 {
3482    /// Offset of the `CompareValue` field.
3483    pub const COMPAREVALUE_SHIFT: u32 = 0;
3484    /// Mask for the `CompareValue` field.
3485    pub const COMPAREVALUE_MASK: u64 =
3486        0b1111111111111111111111111111111111111111111111111111111111111111;
3487
3488    /// Returns the value of the `CompareValue` field.
3489    pub const fn comparevalue(self) -> u64 {
3490        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
3491            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3492    }
3493
3494    /// Sets the value of the `CompareValue` field.
3495    pub const fn set_comparevalue(&mut self, value: u64) {
3496        let offset = Self::COMPAREVALUE_SHIFT;
3497        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
3498        *self = Self::from_bits_retain(
3499            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
3500        );
3501    }
3502
3503    /// Returns a copy with the `CompareValue` field set to the given value.
3504    pub const fn with_comparevalue(mut self, value: u64) -> Self {
3505        self.set_comparevalue(value);
3506        self
3507    }
3508}
3509
3510#[cfg(feature = "el1")]
3511bitflags! {
3512    /// `CNTPS_TVAL_EL1` system register value.
3513    ///
3514    /// Counter-timer Physical Secure Timer TimerValue Register
3515    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3516    #[repr(transparent)]
3517    pub struct CntpsTvalEl1: u64 {
3518    }
3519}
3520
3521#[cfg(feature = "el1")]
3522impl CntpsTvalEl1 {
3523    /// Offset of the `TimerValue` field.
3524    pub const TIMERVALUE_SHIFT: u32 = 0;
3525    /// Mask for the `TimerValue` field.
3526    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
3527
3528    /// Returns the value of the `TimerValue` field.
3529    pub const fn timervalue(self) -> u32 {
3530        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
3531    }
3532
3533    /// Sets the value of the `TimerValue` field.
3534    pub const fn set_timervalue(&mut self, value: u32) {
3535        let offset = Self::TIMERVALUE_SHIFT;
3536        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
3537        *self = Self::from_bits_retain(
3538            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
3539        );
3540    }
3541
3542    /// Returns a copy with the `TimerValue` field set to the given value.
3543    pub const fn with_timervalue(mut self, value: u32) -> Self {
3544        self.set_timervalue(value);
3545        self
3546    }
3547}
3548
3549bitflags! {
3550    /// `CNTP_CTL` system register value.
3551    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3552    #[repr(transparent)]
3553    pub struct CntpCtl: u32 {
3554        /// `ENABLE` bit.
3555        const ENABLE = 1 << 0;
3556        /// `IMASK` bit.
3557        const IMASK = 1 << 1;
3558        /// `ISTATUS` bit.
3559        const ISTATUS = 1 << 2;
3560    }
3561}
3562
3563impl CntpCtl {
3564    /// Offset of the `ENABLE` field.
3565    pub const ENABLE_SHIFT: u32 = 0;
3566    /// Offset of the `IMASK` field.
3567    pub const IMASK_SHIFT: u32 = 1;
3568    /// Offset of the `ISTATUS` field.
3569    pub const ISTATUS_SHIFT: u32 = 2;
3570}
3571
3572bitflags! {
3573    /// `CNTP_CTL_EL0` system register value.
3574    ///
3575    /// Counter-timer Physical Timer Control Register
3576    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3577    #[repr(transparent)]
3578    pub struct CntpCtlEl0: u64 {
3579        /// `ENABLE` bit.
3580        const ENABLE = 1 << 0;
3581        /// `IMASK` bit.
3582        const IMASK = 1 << 1;
3583        /// `ISTATUS` bit.
3584        const ISTATUS = 1 << 2;
3585    }
3586}
3587
3588impl CntpCtlEl0 {
3589    /// Offset of the `ENABLE` field.
3590    pub const ENABLE_SHIFT: u32 = 0;
3591    /// Offset of the `IMASK` field.
3592    pub const IMASK_SHIFT: u32 = 1;
3593    /// Offset of the `ISTATUS` field.
3594    pub const ISTATUS_SHIFT: u32 = 2;
3595}
3596
3597bitflags! {
3598    /// `CNTP_CVAL` system register value.
3599    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3600    #[repr(transparent)]
3601    pub struct CntpCval: u64 {
3602    }
3603}
3604
3605impl CntpCval {
3606    /// Offset of the `CompareValue` field.
3607    pub const COMPAREVALUE_SHIFT: u32 = 0;
3608    /// Mask for the `CompareValue` field.
3609    pub const COMPAREVALUE_MASK: u64 =
3610        0b1111111111111111111111111111111111111111111111111111111111111111;
3611
3612    /// Returns the value of the `CompareValue` field.
3613    pub const fn comparevalue(self) -> u64 {
3614        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
3615            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3616    }
3617
3618    /// Sets the value of the `CompareValue` field.
3619    pub const fn set_comparevalue(&mut self, value: u64) {
3620        let offset = Self::COMPAREVALUE_SHIFT;
3621        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
3622        *self = Self::from_bits_retain(
3623            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
3624        );
3625    }
3626
3627    /// Returns a copy with the `CompareValue` field set to the given value.
3628    pub const fn with_comparevalue(mut self, value: u64) -> Self {
3629        self.set_comparevalue(value);
3630        self
3631    }
3632}
3633
3634bitflags! {
3635    /// `CNTP_CVAL_EL0` system register value.
3636    ///
3637    /// Counter-timer Physical Timer CompareValue Register
3638    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3639    #[repr(transparent)]
3640    pub struct CntpCvalEl0: u64 {
3641    }
3642}
3643
3644impl CntpCvalEl0 {
3645    /// Offset of the `CompareValue` field.
3646    pub const COMPAREVALUE_SHIFT: u32 = 0;
3647    /// Mask for the `CompareValue` field.
3648    pub const COMPAREVALUE_MASK: u64 =
3649        0b1111111111111111111111111111111111111111111111111111111111111111;
3650
3651    /// Returns the value of the `CompareValue` field.
3652    pub const fn comparevalue(self) -> u64 {
3653        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
3654            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3655    }
3656
3657    /// Sets the value of the `CompareValue` field.
3658    pub const fn set_comparevalue(&mut self, value: u64) {
3659        let offset = Self::COMPAREVALUE_SHIFT;
3660        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
3661        *self = Self::from_bits_retain(
3662            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
3663        );
3664    }
3665
3666    /// Returns a copy with the `CompareValue` field set to the given value.
3667    pub const fn with_comparevalue(mut self, value: u64) -> Self {
3668        self.set_comparevalue(value);
3669        self
3670    }
3671}
3672
3673bitflags! {
3674    /// `CNTP_TVAL` system register value.
3675    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3676    #[repr(transparent)]
3677    pub struct CntpTval: u32 {
3678    }
3679}
3680
3681impl CntpTval {
3682    /// Offset of the `TimerValue` field.
3683    pub const TIMERVALUE_SHIFT: u32 = 0;
3684    /// Mask for the `TimerValue` field.
3685    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
3686
3687    /// Returns the value of the `TimerValue` field.
3688    pub const fn timervalue(self) -> u32 {
3689        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
3690    }
3691
3692    /// Sets the value of the `TimerValue` field.
3693    pub const fn set_timervalue(&mut self, value: u32) {
3694        let offset = Self::TIMERVALUE_SHIFT;
3695        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
3696        *self = Self::from_bits_retain(
3697            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
3698        );
3699    }
3700
3701    /// Returns a copy with the `TimerValue` field set to the given value.
3702    pub const fn with_timervalue(mut self, value: u32) -> Self {
3703        self.set_timervalue(value);
3704        self
3705    }
3706}
3707
3708bitflags! {
3709    /// `CNTP_TVAL_EL0` system register value.
3710    ///
3711    /// Counter-timer Physical Timer TimerValue Register
3712    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3713    #[repr(transparent)]
3714    pub struct CntpTvalEl0: u64 {
3715    }
3716}
3717
3718impl CntpTvalEl0 {
3719    /// Offset of the `TimerValue` field.
3720    pub const TIMERVALUE_SHIFT: u32 = 0;
3721    /// Mask for the `TimerValue` field.
3722    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
3723
3724    /// Returns the value of the `TimerValue` field.
3725    pub const fn timervalue(self) -> u32 {
3726        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
3727    }
3728
3729    /// Sets the value of the `TimerValue` field.
3730    pub const fn set_timervalue(&mut self, value: u32) {
3731        let offset = Self::TIMERVALUE_SHIFT;
3732        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
3733        *self = Self::from_bits_retain(
3734            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
3735        );
3736    }
3737
3738    /// Returns a copy with the `TimerValue` field set to the given value.
3739    pub const fn with_timervalue(mut self, value: u32) -> Self {
3740        self.set_timervalue(value);
3741        self
3742    }
3743}
3744
3745bitflags! {
3746    /// `CNTVCT` system register value.
3747    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3748    #[repr(transparent)]
3749    pub struct Cntvct: u64 {
3750    }
3751}
3752
3753impl Cntvct {
3754    /// Offset of the `VirtualCount` field.
3755    pub const VIRTUALCOUNT_SHIFT: u32 = 0;
3756    /// Mask for the `VirtualCount` field.
3757    pub const VIRTUALCOUNT_MASK: u64 =
3758        0b1111111111111111111111111111111111111111111111111111111111111111;
3759
3760    /// Returns the value of the `VirtualCount` field.
3761    pub const fn virtualcount(self) -> u64 {
3762        ((self.bits() >> Self::VIRTUALCOUNT_SHIFT)
3763            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3764    }
3765
3766    /// Sets the value of the `VirtualCount` field.
3767    pub const fn set_virtualcount(&mut self, value: u64) {
3768        let offset = Self::VIRTUALCOUNT_SHIFT;
3769        assert!(value & (Self::VIRTUALCOUNT_MASK as u64) == value);
3770        *self = Self::from_bits_retain(
3771            (self.bits() & !(Self::VIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
3772        );
3773    }
3774
3775    /// Returns a copy with the `VirtualCount` field set to the given value.
3776    pub const fn with_virtualcount(mut self, value: u64) -> Self {
3777        self.set_virtualcount(value);
3778        self
3779    }
3780}
3781
3782bitflags! {
3783    /// `CNTVCTSS` system register value.
3784    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3785    #[repr(transparent)]
3786    pub struct Cntvctss: u64 {
3787    }
3788}
3789
3790impl Cntvctss {
3791    /// Offset of the `SSVirtualCount` field.
3792    pub const SSVIRTUALCOUNT_SHIFT: u32 = 0;
3793    /// Mask for the `SSVirtualCount` field.
3794    pub const SSVIRTUALCOUNT_MASK: u64 =
3795        0b1111111111111111111111111111111111111111111111111111111111111111;
3796
3797    /// Returns the value of the `SSVirtualCount` field.
3798    pub const fn ssvirtualcount(self) -> u64 {
3799        ((self.bits() >> Self::SSVIRTUALCOUNT_SHIFT)
3800            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3801    }
3802
3803    /// Sets the value of the `SSVirtualCount` field.
3804    pub const fn set_ssvirtualcount(&mut self, value: u64) {
3805        let offset = Self::SSVIRTUALCOUNT_SHIFT;
3806        assert!(value & (Self::SSVIRTUALCOUNT_MASK as u64) == value);
3807        *self = Self::from_bits_retain(
3808            (self.bits() & !(Self::SSVIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
3809        );
3810    }
3811
3812    /// Returns a copy with the `SSVirtualCount` field set to the given value.
3813    pub const fn with_ssvirtualcount(mut self, value: u64) -> Self {
3814        self.set_ssvirtualcount(value);
3815        self
3816    }
3817}
3818
3819bitflags! {
3820    /// `CNTVCTSS_EL0` system register value.
3821    ///
3822    /// Counter-timer Self-Synchronized Virtual Count Register
3823    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3824    #[repr(transparent)]
3825    pub struct CntvctssEl0: u64 {
3826    }
3827}
3828
3829impl CntvctssEl0 {
3830    /// Offset of the `SSVirtualCount` field.
3831    pub const SSVIRTUALCOUNT_SHIFT: u32 = 0;
3832    /// Mask for the `SSVirtualCount` field.
3833    pub const SSVIRTUALCOUNT_MASK: u64 =
3834        0b1111111111111111111111111111111111111111111111111111111111111111;
3835
3836    /// Returns the value of the `SSVirtualCount` field.
3837    pub const fn ssvirtualcount(self) -> u64 {
3838        ((self.bits() >> Self::SSVIRTUALCOUNT_SHIFT)
3839            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3840    }
3841
3842    /// Sets the value of the `SSVirtualCount` field.
3843    pub const fn set_ssvirtualcount(&mut self, value: u64) {
3844        let offset = Self::SSVIRTUALCOUNT_SHIFT;
3845        assert!(value & (Self::SSVIRTUALCOUNT_MASK as u64) == value);
3846        *self = Self::from_bits_retain(
3847            (self.bits() & !(Self::SSVIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
3848        );
3849    }
3850
3851    /// Returns a copy with the `SSVirtualCount` field set to the given value.
3852    pub const fn with_ssvirtualcount(mut self, value: u64) -> Self {
3853        self.set_ssvirtualcount(value);
3854        self
3855    }
3856}
3857
3858bitflags! {
3859    /// `CNTVCT_EL0` system register value.
3860    ///
3861    /// Counter-timer Virtual Count Register
3862    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3863    #[repr(transparent)]
3864    pub struct CntvctEl0: u64 {
3865    }
3866}
3867
3868impl CntvctEl0 {
3869    /// Offset of the `VirtualCount` field.
3870    pub const VIRTUALCOUNT_SHIFT: u32 = 0;
3871    /// Mask for the `VirtualCount` field.
3872    pub const VIRTUALCOUNT_MASK: u64 =
3873        0b1111111111111111111111111111111111111111111111111111111111111111;
3874
3875    /// Returns the value of the `VirtualCount` field.
3876    pub const fn virtualcount(self) -> u64 {
3877        ((self.bits() >> Self::VIRTUALCOUNT_SHIFT)
3878            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3879    }
3880
3881    /// Sets the value of the `VirtualCount` field.
3882    pub const fn set_virtualcount(&mut self, value: u64) {
3883        let offset = Self::VIRTUALCOUNT_SHIFT;
3884        assert!(value & (Self::VIRTUALCOUNT_MASK as u64) == value);
3885        *self = Self::from_bits_retain(
3886            (self.bits() & !(Self::VIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
3887        );
3888    }
3889
3890    /// Returns a copy with the `VirtualCount` field set to the given value.
3891    pub const fn with_virtualcount(mut self, value: u64) -> Self {
3892        self.set_virtualcount(value);
3893        self
3894    }
3895}
3896
3897bitflags! {
3898    /// `CNTVOFF` system register value.
3899    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3900    #[repr(transparent)]
3901    pub struct Cntvoff: u64 {
3902    }
3903}
3904
3905impl Cntvoff {
3906    /// Offset of the `VOffset` field.
3907    pub const VOFFSET_SHIFT: u32 = 0;
3908    /// Mask for the `VOffset` field.
3909    pub const VOFFSET_MASK: u64 =
3910        0b1111111111111111111111111111111111111111111111111111111111111111;
3911
3912    /// Returns the value of the `VOffset` field.
3913    pub const fn voffset(self) -> u64 {
3914        ((self.bits() >> Self::VOFFSET_SHIFT)
3915            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3916    }
3917
3918    /// Sets the value of the `VOffset` field.
3919    pub const fn set_voffset(&mut self, value: u64) {
3920        let offset = Self::VOFFSET_SHIFT;
3921        assert!(value & (Self::VOFFSET_MASK as u64) == value);
3922        *self = Self::from_bits_retain(
3923            (self.bits() & !(Self::VOFFSET_MASK << offset)) | ((value as u64) << offset),
3924        );
3925    }
3926
3927    /// Returns a copy with the `VOffset` field set to the given value.
3928    pub const fn with_voffset(mut self, value: u64) -> Self {
3929        self.set_voffset(value);
3930        self
3931    }
3932}
3933
3934#[cfg(feature = "el2")]
3935bitflags! {
3936    /// `CNTVOFF_EL2` system register value.
3937    ///
3938    /// Counter-timer Virtual Offset Register
3939    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3940    #[repr(transparent)]
3941    pub struct CntvoffEl2: u64 {
3942    }
3943}
3944
3945#[cfg(feature = "el2")]
3946impl CntvoffEl2 {
3947    /// Offset of the `VOffset` field.
3948    pub const VOFFSET_SHIFT: u32 = 0;
3949    /// Mask for the `VOffset` field.
3950    pub const VOFFSET_MASK: u64 =
3951        0b1111111111111111111111111111111111111111111111111111111111111111;
3952
3953    /// Returns the value of the `VOffset` field.
3954    pub const fn voffset(self) -> u64 {
3955        ((self.bits() >> Self::VOFFSET_SHIFT)
3956            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
3957    }
3958
3959    /// Sets the value of the `VOffset` field.
3960    pub const fn set_voffset(&mut self, value: u64) {
3961        let offset = Self::VOFFSET_SHIFT;
3962        assert!(value & (Self::VOFFSET_MASK as u64) == value);
3963        *self = Self::from_bits_retain(
3964            (self.bits() & !(Self::VOFFSET_MASK << offset)) | ((value as u64) << offset),
3965        );
3966    }
3967
3968    /// Returns a copy with the `VOffset` field set to the given value.
3969    pub const fn with_voffset(mut self, value: u64) -> Self {
3970        self.set_voffset(value);
3971        self
3972    }
3973}
3974
3975bitflags! {
3976    /// `CNTV_CTL` system register value.
3977    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3978    #[repr(transparent)]
3979    pub struct CntvCtl: u32 {
3980        /// `ENABLE` bit.
3981        const ENABLE = 1 << 0;
3982        /// `IMASK` bit.
3983        const IMASK = 1 << 1;
3984        /// `ISTATUS` bit.
3985        const ISTATUS = 1 << 2;
3986    }
3987}
3988
3989impl CntvCtl {
3990    /// Offset of the `ENABLE` field.
3991    pub const ENABLE_SHIFT: u32 = 0;
3992    /// Offset of the `IMASK` field.
3993    pub const IMASK_SHIFT: u32 = 1;
3994    /// Offset of the `ISTATUS` field.
3995    pub const ISTATUS_SHIFT: u32 = 2;
3996}
3997
3998bitflags! {
3999    /// `CNTV_CTL_EL0` system register value.
4000    ///
4001    /// Counter-timer Virtual Timer Control Register
4002    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4003    #[repr(transparent)]
4004    pub struct CntvCtlEl0: u64 {
4005        /// `ENABLE` bit.
4006        const ENABLE = 1 << 0;
4007        /// `IMASK` bit.
4008        const IMASK = 1 << 1;
4009        /// `ISTATUS` bit.
4010        const ISTATUS = 1 << 2;
4011    }
4012}
4013
4014impl CntvCtlEl0 {
4015    /// Offset of the `ENABLE` field.
4016    pub const ENABLE_SHIFT: u32 = 0;
4017    /// Offset of the `IMASK` field.
4018    pub const IMASK_SHIFT: u32 = 1;
4019    /// Offset of the `ISTATUS` field.
4020    pub const ISTATUS_SHIFT: u32 = 2;
4021}
4022
4023bitflags! {
4024    /// `CNTV_CVAL` system register value.
4025    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4026    #[repr(transparent)]
4027    pub struct CntvCval: u64 {
4028    }
4029}
4030
4031impl CntvCval {
4032    /// Offset of the `CompareValue` field.
4033    pub const COMPAREVALUE_SHIFT: u32 = 0;
4034    /// Mask for the `CompareValue` field.
4035    pub const COMPAREVALUE_MASK: u64 =
4036        0b1111111111111111111111111111111111111111111111111111111111111111;
4037
4038    /// Returns the value of the `CompareValue` field.
4039    pub const fn comparevalue(self) -> u64 {
4040        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
4041            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
4042    }
4043
4044    /// Sets the value of the `CompareValue` field.
4045    pub const fn set_comparevalue(&mut self, value: u64) {
4046        let offset = Self::COMPAREVALUE_SHIFT;
4047        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
4048        *self = Self::from_bits_retain(
4049            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
4050        );
4051    }
4052
4053    /// Returns a copy with the `CompareValue` field set to the given value.
4054    pub const fn with_comparevalue(mut self, value: u64) -> Self {
4055        self.set_comparevalue(value);
4056        self
4057    }
4058}
4059
4060bitflags! {
4061    /// `CNTV_CVAL_EL0` system register value.
4062    ///
4063    /// Counter-timer Virtual Timer CompareValue Register
4064    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4065    #[repr(transparent)]
4066    pub struct CntvCvalEl0: u64 {
4067    }
4068}
4069
4070impl CntvCvalEl0 {
4071    /// Offset of the `CompareValue` field.
4072    pub const COMPAREVALUE_SHIFT: u32 = 0;
4073    /// Mask for the `CompareValue` field.
4074    pub const COMPAREVALUE_MASK: u64 =
4075        0b1111111111111111111111111111111111111111111111111111111111111111;
4076
4077    /// Returns the value of the `CompareValue` field.
4078    pub const fn comparevalue(self) -> u64 {
4079        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
4080            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
4081    }
4082
4083    /// Sets the value of the `CompareValue` field.
4084    pub const fn set_comparevalue(&mut self, value: u64) {
4085        let offset = Self::COMPAREVALUE_SHIFT;
4086        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
4087        *self = Self::from_bits_retain(
4088            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
4089        );
4090    }
4091
4092    /// Returns a copy with the `CompareValue` field set to the given value.
4093    pub const fn with_comparevalue(mut self, value: u64) -> Self {
4094        self.set_comparevalue(value);
4095        self
4096    }
4097}
4098
4099bitflags! {
4100    /// `CNTV_TVAL` system register value.
4101    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4102    #[repr(transparent)]
4103    pub struct CntvTval: u32 {
4104    }
4105}
4106
4107impl CntvTval {
4108    /// Offset of the `TimerValue` field.
4109    pub const TIMERVALUE_SHIFT: u32 = 0;
4110    /// Mask for the `TimerValue` field.
4111    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
4112
4113    /// Returns the value of the `TimerValue` field.
4114    pub const fn timervalue(self) -> u32 {
4115        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
4116    }
4117
4118    /// Sets the value of the `TimerValue` field.
4119    pub const fn set_timervalue(&mut self, value: u32) {
4120        let offset = Self::TIMERVALUE_SHIFT;
4121        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
4122        *self = Self::from_bits_retain(
4123            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
4124        );
4125    }
4126
4127    /// Returns a copy with the `TimerValue` field set to the given value.
4128    pub const fn with_timervalue(mut self, value: u32) -> Self {
4129        self.set_timervalue(value);
4130        self
4131    }
4132}
4133
4134bitflags! {
4135    /// `CNTV_TVAL_EL0` system register value.
4136    ///
4137    /// Counter-timer Virtual Timer TimerValue Register
4138    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4139    #[repr(transparent)]
4140    pub struct CntvTvalEl0: u64 {
4141    }
4142}
4143
4144impl CntvTvalEl0 {
4145    /// Offset of the `TimerValue` field.
4146    pub const TIMERVALUE_SHIFT: u32 = 0;
4147    /// Mask for the `TimerValue` field.
4148    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
4149
4150    /// Returns the value of the `TimerValue` field.
4151    pub const fn timervalue(self) -> u32 {
4152        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
4153    }
4154
4155    /// Sets the value of the `TimerValue` field.
4156    pub const fn set_timervalue(&mut self, value: u32) {
4157        let offset = Self::TIMERVALUE_SHIFT;
4158        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
4159        *self = Self::from_bits_retain(
4160            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
4161        );
4162    }
4163
4164    /// Returns a copy with the `TimerValue` field set to the given value.
4165    pub const fn with_timervalue(mut self, value: u32) -> Self {
4166        self.set_timervalue(value);
4167        self
4168    }
4169}
4170
4171bitflags! {
4172    /// `CONTEXTIDR` system register value.
4173    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4174    #[repr(transparent)]
4175    pub struct Contextidr: u32 {
4176    }
4177}
4178
4179impl Contextidr {
4180    /// Offset of the `ASID` field.
4181    pub const ASID_SHIFT: u32 = 0;
4182    /// Mask for the `ASID` field.
4183    pub const ASID_MASK: u32 = 0b11111111;
4184
4185    /// Returns the value of the `ASID` field.
4186    pub const fn asid(self) -> u8 {
4187        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
4188    }
4189
4190    /// Sets the value of the `ASID` field.
4191    pub const fn set_asid(&mut self, value: u8) {
4192        let offset = Self::ASID_SHIFT;
4193        assert!(value & (Self::ASID_MASK as u8) == value);
4194        *self = Self::from_bits_retain(
4195            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u32) << offset),
4196        );
4197    }
4198
4199    /// Returns a copy with the `ASID` field set to the given value.
4200    pub const fn with_asid(mut self, value: u8) -> Self {
4201        self.set_asid(value);
4202        self
4203    }
4204}
4205
4206#[cfg(feature = "el1")]
4207bitflags! {
4208    /// `CONTEXTIDR_EL1` system register value.
4209    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4210    #[repr(transparent)]
4211    pub struct ContextidrEl1: u64 {
4212    }
4213}
4214
4215#[cfg(feature = "el1")]
4216impl ContextidrEl1 {
4217    /// Offset of the `PROCID` field.
4218    pub const PROCID_SHIFT: u32 = 0;
4219    /// Mask for the `PROCID` field.
4220    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
4221
4222    /// Returns the value of the `PROCID` field.
4223    pub const fn procid(self) -> u32 {
4224        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
4225    }
4226
4227    /// Sets the value of the `PROCID` field.
4228    pub const fn set_procid(&mut self, value: u32) {
4229        let offset = Self::PROCID_SHIFT;
4230        assert!(value & (Self::PROCID_MASK as u32) == value);
4231        *self = Self::from_bits_retain(
4232            (self.bits() & !(Self::PROCID_MASK << offset)) | ((value as u64) << offset),
4233        );
4234    }
4235
4236    /// Returns a copy with the `PROCID` field set to the given value.
4237    pub const fn with_procid(mut self, value: u32) -> Self {
4238        self.set_procid(value);
4239        self
4240    }
4241}
4242
4243#[cfg(feature = "el2")]
4244bitflags! {
4245    /// `CONTEXTIDR_EL2` system register value.
4246    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4247    #[repr(transparent)]
4248    pub struct ContextidrEl2: u64 {
4249    }
4250}
4251
4252#[cfg(feature = "el2")]
4253impl ContextidrEl2 {
4254    /// Offset of the `PROCID` field.
4255    pub const PROCID_SHIFT: u32 = 0;
4256    /// Mask for the `PROCID` field.
4257    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
4258
4259    /// Returns the value of the `PROCID` field.
4260    pub const fn procid(self) -> u32 {
4261        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
4262    }
4263
4264    /// Sets the value of the `PROCID` field.
4265    pub const fn set_procid(&mut self, value: u32) {
4266        let offset = Self::PROCID_SHIFT;
4267        assert!(value & (Self::PROCID_MASK as u32) == value);
4268        *self = Self::from_bits_retain(
4269            (self.bits() & !(Self::PROCID_MASK << offset)) | ((value as u64) << offset),
4270        );
4271    }
4272
4273    /// Returns a copy with the `PROCID` field set to the given value.
4274    pub const fn with_procid(mut self, value: u32) -> Self {
4275        self.set_procid(value);
4276        self
4277    }
4278}
4279
4280bitflags! {
4281    /// `CPACR` system register value.
4282    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4283    #[repr(transparent)]
4284    pub struct Cpacr: u32 {
4285        /// `TRCDIS` bit.
4286        const TRCDIS = 1 << 28;
4287        /// `ASEDIS` bit.
4288        const ASEDIS = 1 << 31;
4289    }
4290}
4291
4292impl Cpacr {
4293    /// Offset of the `cp10` field.
4294    pub const CP10_SHIFT: u32 = 20;
4295    /// Mask for the `cp10` field.
4296    pub const CP10_MASK: u32 = 0b11;
4297    /// Offset of the `cp11` field.
4298    pub const CP11_SHIFT: u32 = 22;
4299    /// Mask for the `cp11` field.
4300    pub const CP11_MASK: u32 = 0b11;
4301    /// Offset of the `TRCDIS` field.
4302    pub const TRCDIS_SHIFT: u32 = 28;
4303    /// Offset of the `ASEDIS` field.
4304    pub const ASEDIS_SHIFT: u32 = 31;
4305
4306    /// Returns the value of the `cp10` field.
4307    pub const fn cp10(self) -> u8 {
4308        ((self.bits() >> Self::CP10_SHIFT) & 0b11) as u8
4309    }
4310
4311    /// Sets the value of the `cp10` field.
4312    pub const fn set_cp10(&mut self, value: u8) {
4313        let offset = Self::CP10_SHIFT;
4314        assert!(value & (Self::CP10_MASK as u8) == value);
4315        *self = Self::from_bits_retain(
4316            (self.bits() & !(Self::CP10_MASK << offset)) | ((value as u32) << offset),
4317        );
4318    }
4319
4320    /// Returns a copy with the `cp10` field set to the given value.
4321    pub const fn with_cp10(mut self, value: u8) -> Self {
4322        self.set_cp10(value);
4323        self
4324    }
4325
4326    /// Returns the value of the `cp11` field.
4327    pub const fn cp11(self) -> u8 {
4328        ((self.bits() >> Self::CP11_SHIFT) & 0b11) as u8
4329    }
4330
4331    /// Sets the value of the `cp11` field.
4332    pub const fn set_cp11(&mut self, value: u8) {
4333        let offset = Self::CP11_SHIFT;
4334        assert!(value & (Self::CP11_MASK as u8) == value);
4335        *self = Self::from_bits_retain(
4336            (self.bits() & !(Self::CP11_MASK << offset)) | ((value as u32) << offset),
4337        );
4338    }
4339
4340    /// Returns a copy with the `cp11` field set to the given value.
4341    pub const fn with_cp11(mut self, value: u8) -> Self {
4342        self.set_cp11(value);
4343        self
4344    }
4345}
4346
4347#[cfg(feature = "el1")]
4348bitflags! {
4349    /// `CPACR_EL1` system register value.
4350    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4351    #[repr(transparent)]
4352    pub struct CpacrEl1: u64 {
4353        /// `TTA` bit.
4354        const TTA = 1 << 28;
4355        /// `E0POE` bit.
4356        const E0POE = 1 << 29;
4357        /// `TAM` bit.
4358        const TAM = 1 << 30;
4359        /// `TCPAC` bit.
4360        const TCPAC = 1 << 31;
4361        /// `E0TP0E` bit.
4362        const E0TP0E = 1 << 32;
4363        /// `E0TP1E` bit.
4364        const E0TP1E = 1 << 33;
4365    }
4366}
4367
4368#[cfg(feature = "el1")]
4369impl CpacrEl1 {
4370    /// Offset of the `ZEN` field.
4371    pub const ZEN_SHIFT: u32 = 16;
4372    /// Mask for the `ZEN` field.
4373    pub const ZEN_MASK: u64 = 0b11;
4374    /// Offset of the `FPEN` field.
4375    pub const FPEN_SHIFT: u32 = 20;
4376    /// Mask for the `FPEN` field.
4377    pub const FPEN_MASK: u64 = 0b11;
4378    /// Offset of the `SMEN` field.
4379    pub const SMEN_SHIFT: u32 = 24;
4380    /// Mask for the `SMEN` field.
4381    pub const SMEN_MASK: u64 = 0b11;
4382    /// Offset of the `TTA` field.
4383    pub const TTA_SHIFT: u32 = 28;
4384    /// Offset of the `E0POE` field.
4385    pub const E0POE_SHIFT: u32 = 29;
4386    /// Offset of the `TAM` field.
4387    pub const TAM_SHIFT: u32 = 30;
4388    /// Offset of the `TCPAC` field.
4389    pub const TCPAC_SHIFT: u32 = 31;
4390    /// Offset of the `E0TP0E` field.
4391    pub const E0TP0E_SHIFT: u32 = 32;
4392    /// Offset of the `E0TP1E` field.
4393    pub const E0TP1E_SHIFT: u32 = 33;
4394
4395    /// Returns the value of the `ZEN` field.
4396    pub const fn zen(self) -> u8 {
4397        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
4398    }
4399
4400    /// Sets the value of the `ZEN` field.
4401    pub const fn set_zen(&mut self, value: u8) {
4402        let offset = Self::ZEN_SHIFT;
4403        assert!(value & (Self::ZEN_MASK as u8) == value);
4404        *self = Self::from_bits_retain(
4405            (self.bits() & !(Self::ZEN_MASK << offset)) | ((value as u64) << offset),
4406        );
4407    }
4408
4409    /// Returns a copy with the `ZEN` field set to the given value.
4410    pub const fn with_zen(mut self, value: u8) -> Self {
4411        self.set_zen(value);
4412        self
4413    }
4414
4415    /// Returns the value of the `FPEN` field.
4416    pub const fn fpen(self) -> u8 {
4417        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
4418    }
4419
4420    /// Sets the value of the `FPEN` field.
4421    pub const fn set_fpen(&mut self, value: u8) {
4422        let offset = Self::FPEN_SHIFT;
4423        assert!(value & (Self::FPEN_MASK as u8) == value);
4424        *self = Self::from_bits_retain(
4425            (self.bits() & !(Self::FPEN_MASK << offset)) | ((value as u64) << offset),
4426        );
4427    }
4428
4429    /// Returns a copy with the `FPEN` field set to the given value.
4430    pub const fn with_fpen(mut self, value: u8) -> Self {
4431        self.set_fpen(value);
4432        self
4433    }
4434
4435    /// Returns the value of the `SMEN` field.
4436    pub const fn smen(self) -> u8 {
4437        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
4438    }
4439
4440    /// Sets the value of the `SMEN` field.
4441    pub const fn set_smen(&mut self, value: u8) {
4442        let offset = Self::SMEN_SHIFT;
4443        assert!(value & (Self::SMEN_MASK as u8) == value);
4444        *self = Self::from_bits_retain(
4445            (self.bits() & !(Self::SMEN_MASK << offset)) | ((value as u64) << offset),
4446        );
4447    }
4448
4449    /// Returns a copy with the `SMEN` field set to the given value.
4450    pub const fn with_smen(mut self, value: u8) -> Self {
4451        self.set_smen(value);
4452        self
4453    }
4454}
4455
4456#[cfg(feature = "el2")]
4457bitflags! {
4458    /// `CPTR_EL2` system register value.
4459    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4460    #[repr(transparent)]
4461    pub struct CptrEl2: u64 {
4462        /// RES1 bits in the `CPTR_EL2` register.
4463        const RES1 = 0b10001011111111;
4464        /// `TZ` bit.
4465        const TZ = 1 << 8;
4466        /// `TFP` bit.
4467        const TFP = 1 << 10;
4468        /// `TSM` bit.
4469        const TSM = 1 << 12;
4470        /// `E0POE` bit.
4471        const E0POE = 1 << 29;
4472        /// `TAM` bit.
4473        const TAM = 1 << 30;
4474        /// `TCPAC` bit.
4475        const TCPAC = 1 << 31;
4476        /// `E0TP0E` bit.
4477        const E0TP0E = 1 << 32;
4478        /// `E0TP1E` bit.
4479        const E0TP1E = 1 << 33;
4480    }
4481}
4482
4483#[cfg(feature = "el2")]
4484impl CptrEl2 {
4485    /// Offset of the `TZ` field.
4486    pub const TZ_SHIFT: u32 = 8;
4487    /// Offset of the `TFP` field.
4488    pub const TFP_SHIFT: u32 = 10;
4489    /// Offset of the `TSM` field.
4490    pub const TSM_SHIFT: u32 = 12;
4491    /// Offset of the `ZEN` field.
4492    pub const ZEN_SHIFT: u32 = 16;
4493    /// Mask for the `ZEN` field.
4494    pub const ZEN_MASK: u64 = 0b11;
4495    /// Offset of the `FPEN` field.
4496    pub const FPEN_SHIFT: u32 = 20;
4497    /// Mask for the `FPEN` field.
4498    pub const FPEN_MASK: u64 = 0b11;
4499    /// Offset of the `SMEN` field.
4500    pub const SMEN_SHIFT: u32 = 24;
4501    /// Mask for the `SMEN` field.
4502    pub const SMEN_MASK: u64 = 0b11;
4503    /// Offset of the `E0POE` field.
4504    pub const E0POE_SHIFT: u32 = 29;
4505    /// Offset of the `TAM` field.
4506    pub const TAM_SHIFT: u32 = 30;
4507    /// Offset of the `TCPAC` field.
4508    pub const TCPAC_SHIFT: u32 = 31;
4509    /// Offset of the `E0TP0E` field.
4510    pub const E0TP0E_SHIFT: u32 = 32;
4511    /// Offset of the `E0TP1E` field.
4512    pub const E0TP1E_SHIFT: u32 = 33;
4513
4514    /// Returns the value of the `ZEN` field.
4515    pub const fn zen(self) -> u8 {
4516        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
4517    }
4518
4519    /// Sets the value of the `ZEN` field.
4520    pub const fn set_zen(&mut self, value: u8) {
4521        let offset = Self::ZEN_SHIFT;
4522        assert!(value & (Self::ZEN_MASK as u8) == value);
4523        *self = Self::from_bits_retain(
4524            (self.bits() & !(Self::ZEN_MASK << offset)) | ((value as u64) << offset),
4525        );
4526    }
4527
4528    /// Returns a copy with the `ZEN` field set to the given value.
4529    pub const fn with_zen(mut self, value: u8) -> Self {
4530        self.set_zen(value);
4531        self
4532    }
4533
4534    /// Returns the value of the `FPEN` field.
4535    pub const fn fpen(self) -> u8 {
4536        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
4537    }
4538
4539    /// Sets the value of the `FPEN` field.
4540    pub const fn set_fpen(&mut self, value: u8) {
4541        let offset = Self::FPEN_SHIFT;
4542        assert!(value & (Self::FPEN_MASK as u8) == value);
4543        *self = Self::from_bits_retain(
4544            (self.bits() & !(Self::FPEN_MASK << offset)) | ((value as u64) << offset),
4545        );
4546    }
4547
4548    /// Returns a copy with the `FPEN` field set to the given value.
4549    pub const fn with_fpen(mut self, value: u8) -> Self {
4550        self.set_fpen(value);
4551        self
4552    }
4553
4554    /// Returns the value of the `SMEN` field.
4555    pub const fn smen(self) -> u8 {
4556        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
4557    }
4558
4559    /// Sets the value of the `SMEN` field.
4560    pub const fn set_smen(&mut self, value: u8) {
4561        let offset = Self::SMEN_SHIFT;
4562        assert!(value & (Self::SMEN_MASK as u8) == value);
4563        *self = Self::from_bits_retain(
4564            (self.bits() & !(Self::SMEN_MASK << offset)) | ((value as u64) << offset),
4565        );
4566    }
4567
4568    /// Returns a copy with the `SMEN` field set to the given value.
4569    pub const fn with_smen(mut self, value: u8) -> Self {
4570        self.set_smen(value);
4571        self
4572    }
4573}
4574
4575#[cfg(feature = "el3")]
4576bitflags! {
4577    /// `CPTR_EL3` system register value.
4578    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4579    #[repr(transparent)]
4580    pub struct CptrEl3: u64 {
4581        /// Do not trap execution of SVE instructions.
4582        const EZ = 1 << 8;
4583        /// Trap Advanced SIMD instructions execution.
4584        const TFP = 1 << 10;
4585        /// When FEAT_SME is implemented, do not trap SME instructions and system registers accesses.
4586        const ESM = 1 << 12;
4587        /// Trap trace system register accesses.
4588        const TTA = 1 << 20;
4589        /// When FEAT_AMUv1 implemented trap accesses from EL2/EL1/EL0 to AMU registers.
4590        const TAM = 1 << 30;
4591        /// Trap EL2 accesses to CPTR_EL2/HCPTR, and EL2/EL1 accesses to CPACR_EL1/CPACR.
4592        const TCPAC = 1 << 31;
4593    }
4594}
4595
4596#[cfg(feature = "el3")]
4597impl CptrEl3 {
4598    /// Offset of the `EZ` field.
4599    pub const EZ_SHIFT: u32 = 8;
4600    /// Offset of the `TFP` field.
4601    pub const TFP_SHIFT: u32 = 10;
4602    /// Offset of the `ESM` field.
4603    pub const ESM_SHIFT: u32 = 12;
4604    /// Offset of the `TTA` field.
4605    pub const TTA_SHIFT: u32 = 20;
4606    /// Offset of the `TAM` field.
4607    pub const TAM_SHIFT: u32 = 30;
4608    /// Offset of the `TCPAC` field.
4609    pub const TCPAC_SHIFT: u32 = 31;
4610}
4611
4612bitflags! {
4613    /// `CSSELR` system register value.
4614    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4615    #[repr(transparent)]
4616    pub struct Csselr: u32 {
4617        /// `InD` bit.
4618        const IND = 1 << 0;
4619    }
4620}
4621
4622impl Csselr {
4623    /// Offset of the `InD` field.
4624    pub const IND_SHIFT: u32 = 0;
4625    /// Offset of the `Level` field.
4626    pub const LEVEL_SHIFT: u32 = 1;
4627    /// Mask for the `Level` field.
4628    pub const LEVEL_MASK: u32 = 0b111;
4629
4630    /// Returns the value of the `Level` field.
4631    pub const fn level(self) -> u8 {
4632        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
4633    }
4634
4635    /// Sets the value of the `Level` field.
4636    pub const fn set_level(&mut self, value: u8) {
4637        let offset = Self::LEVEL_SHIFT;
4638        assert!(value & (Self::LEVEL_MASK as u8) == value);
4639        *self = Self::from_bits_retain(
4640            (self.bits() & !(Self::LEVEL_MASK << offset)) | ((value as u32) << offset),
4641        );
4642    }
4643
4644    /// Returns a copy with the `Level` field set to the given value.
4645    pub const fn with_level(mut self, value: u8) -> Self {
4646        self.set_level(value);
4647        self
4648    }
4649}
4650
4651#[cfg(feature = "el1")]
4652bitflags! {
4653    /// `CSSELR_EL1` system register value.
4654    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4655    #[repr(transparent)]
4656    pub struct CsselrEl1: u64 {
4657        /// Instruction not Data bit.
4658        const IND = 1 << 0;
4659        /// Allocation Tag not Data bit, only valid if FEAT_MTE2 is implemented.
4660        const TND = 1 << 4;
4661    }
4662}
4663
4664#[cfg(feature = "el1")]
4665impl CsselrEl1 {
4666    /// Offset of the `InD` field.
4667    pub const IND_SHIFT: u32 = 0;
4668    /// Offset of the `Level` field.
4669    pub const LEVEL_SHIFT: u32 = 1;
4670    /// Mask for the `Level` field.
4671    pub const LEVEL_MASK: u64 = 0b111;
4672    /// Offset of the `TnD` field.
4673    pub const TND_SHIFT: u32 = 4;
4674
4675    /// Returns the value of the `Level` field.
4676    pub const fn level(self) -> u8 {
4677        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
4678    }
4679
4680    /// Sets the value of the `Level` field.
4681    pub const fn set_level(&mut self, value: u8) {
4682        let offset = Self::LEVEL_SHIFT;
4683        assert!(value & (Self::LEVEL_MASK as u8) == value);
4684        *self = Self::from_bits_retain(
4685            (self.bits() & !(Self::LEVEL_MASK << offset)) | ((value as u64) << offset),
4686        );
4687    }
4688
4689    /// Returns a copy with the `Level` field set to the given value.
4690    pub const fn with_level(mut self, value: u8) -> Self {
4691        self.set_level(value);
4692        self
4693    }
4694}
4695
4696bitflags! {
4697    /// `CTR` system register value.
4698    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4699    #[repr(transparent)]
4700    pub struct Ctr: u32 {
4701        /// RES1 bits in the `CTR` register.
4702        const RES1 = 0b10000000000000000000000000000000;
4703        /// `IDC` bit.
4704        const IDC = 1 << 28;
4705        /// `DIC` bit.
4706        const DIC = 1 << 29;
4707    }
4708}
4709
4710impl Ctr {
4711    /// Offset of the `IminLine` field.
4712    pub const IMINLINE_SHIFT: u32 = 0;
4713    /// Mask for the `IminLine` field.
4714    pub const IMINLINE_MASK: u32 = 0b1111;
4715    /// Offset of the `L1Ip` field.
4716    pub const L1IP_SHIFT: u32 = 14;
4717    /// Mask for the `L1Ip` field.
4718    pub const L1IP_MASK: u32 = 0b11;
4719    /// Offset of the `DminLine` field.
4720    pub const DMINLINE_SHIFT: u32 = 16;
4721    /// Mask for the `DminLine` field.
4722    pub const DMINLINE_MASK: u32 = 0b1111;
4723    /// Offset of the `ERG` field.
4724    pub const ERG_SHIFT: u32 = 20;
4725    /// Mask for the `ERG` field.
4726    pub const ERG_MASK: u32 = 0b1111;
4727    /// Offset of the `CWG` field.
4728    pub const CWG_SHIFT: u32 = 24;
4729    /// Mask for the `CWG` field.
4730    pub const CWG_MASK: u32 = 0b1111;
4731    /// Offset of the `IDC` field.
4732    pub const IDC_SHIFT: u32 = 28;
4733    /// Offset of the `DIC` field.
4734    pub const DIC_SHIFT: u32 = 29;
4735
4736    /// Returns the value of the `IminLine` field.
4737    pub const fn iminline(self) -> u8 {
4738        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
4739    }
4740
4741    /// Sets the value of the `IminLine` field.
4742    pub const fn set_iminline(&mut self, value: u8) {
4743        let offset = Self::IMINLINE_SHIFT;
4744        assert!(value & (Self::IMINLINE_MASK as u8) == value);
4745        *self = Self::from_bits_retain(
4746            (self.bits() & !(Self::IMINLINE_MASK << offset)) | ((value as u32) << offset),
4747        );
4748    }
4749
4750    /// Returns a copy with the `IminLine` field set to the given value.
4751    pub const fn with_iminline(mut self, value: u8) -> Self {
4752        self.set_iminline(value);
4753        self
4754    }
4755
4756    /// Returns the value of the `L1Ip` field.
4757    pub const fn l1ip(self) -> u8 {
4758        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
4759    }
4760
4761    /// Sets the value of the `L1Ip` field.
4762    pub const fn set_l1ip(&mut self, value: u8) {
4763        let offset = Self::L1IP_SHIFT;
4764        assert!(value & (Self::L1IP_MASK as u8) == value);
4765        *self = Self::from_bits_retain(
4766            (self.bits() & !(Self::L1IP_MASK << offset)) | ((value as u32) << offset),
4767        );
4768    }
4769
4770    /// Returns a copy with the `L1Ip` field set to the given value.
4771    pub const fn with_l1ip(mut self, value: u8) -> Self {
4772        self.set_l1ip(value);
4773        self
4774    }
4775
4776    /// Returns the value of the `DminLine` field.
4777    pub const fn dminline(self) -> u8 {
4778        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
4779    }
4780
4781    /// Sets the value of the `DminLine` field.
4782    pub const fn set_dminline(&mut self, value: u8) {
4783        let offset = Self::DMINLINE_SHIFT;
4784        assert!(value & (Self::DMINLINE_MASK as u8) == value);
4785        *self = Self::from_bits_retain(
4786            (self.bits() & !(Self::DMINLINE_MASK << offset)) | ((value as u32) << offset),
4787        );
4788    }
4789
4790    /// Returns a copy with the `DminLine` field set to the given value.
4791    pub const fn with_dminline(mut self, value: u8) -> Self {
4792        self.set_dminline(value);
4793        self
4794    }
4795
4796    /// Returns the value of the `ERG` field.
4797    pub const fn erg(self) -> u8 {
4798        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
4799    }
4800
4801    /// Sets the value of the `ERG` field.
4802    pub const fn set_erg(&mut self, value: u8) {
4803        let offset = Self::ERG_SHIFT;
4804        assert!(value & (Self::ERG_MASK as u8) == value);
4805        *self = Self::from_bits_retain(
4806            (self.bits() & !(Self::ERG_MASK << offset)) | ((value as u32) << offset),
4807        );
4808    }
4809
4810    /// Returns a copy with the `ERG` field set to the given value.
4811    pub const fn with_erg(mut self, value: u8) -> Self {
4812        self.set_erg(value);
4813        self
4814    }
4815
4816    /// Returns the value of the `CWG` field.
4817    pub const fn cwg(self) -> u8 {
4818        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
4819    }
4820
4821    /// Sets the value of the `CWG` field.
4822    pub const fn set_cwg(&mut self, value: u8) {
4823        let offset = Self::CWG_SHIFT;
4824        assert!(value & (Self::CWG_MASK as u8) == value);
4825        *self = Self::from_bits_retain(
4826            (self.bits() & !(Self::CWG_MASK << offset)) | ((value as u32) << offset),
4827        );
4828    }
4829
4830    /// Returns a copy with the `CWG` field set to the given value.
4831    pub const fn with_cwg(mut self, value: u8) -> Self {
4832        self.set_cwg(value);
4833        self
4834    }
4835}
4836
4837bitflags! {
4838    /// `CTR_EL0` system register value.
4839    ///
4840    /// Cache Type Register.
4841    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4842    #[repr(transparent)]
4843    pub struct CtrEl0: u64 {
4844        /// RES1 bits in the `CTR_EL0` register.
4845        const RES1 = 0b10000000000000000000000000000000;
4846        /// `IDC` bit.
4847        const IDC = 1 << 28;
4848        /// `DIC` bit.
4849        const DIC = 1 << 29;
4850    }
4851}
4852
4853impl CtrEl0 {
4854    /// Offset of the `IminLine` field.
4855    pub const IMINLINE_SHIFT: u32 = 0;
4856    /// Mask for the `IminLine` field.
4857    pub const IMINLINE_MASK: u64 = 0b1111;
4858    /// Offset of the `L1Ip` field.
4859    pub const L1IP_SHIFT: u32 = 14;
4860    /// Mask for the `L1Ip` field.
4861    pub const L1IP_MASK: u64 = 0b11;
4862    /// Offset of the `DminLine` field.
4863    pub const DMINLINE_SHIFT: u32 = 16;
4864    /// Mask for the `DminLine` field.
4865    pub const DMINLINE_MASK: u64 = 0b1111;
4866    /// Offset of the `ERG` field.
4867    pub const ERG_SHIFT: u32 = 20;
4868    /// Mask for the `ERG` field.
4869    pub const ERG_MASK: u64 = 0b1111;
4870    /// Offset of the `CWG` field.
4871    pub const CWG_SHIFT: u32 = 24;
4872    /// Mask for the `CWG` field.
4873    pub const CWG_MASK: u64 = 0b1111;
4874    /// Offset of the `IDC` field.
4875    pub const IDC_SHIFT: u32 = 28;
4876    /// Offset of the `DIC` field.
4877    pub const DIC_SHIFT: u32 = 29;
4878    /// Offset of the `TminLine` field.
4879    pub const TMINLINE_SHIFT: u32 = 32;
4880    /// Mask for the `TminLine` field.
4881    pub const TMINLINE_MASK: u64 = 0b111111;
4882
4883    /// Returns the value of the `IminLine` field.
4884    pub const fn iminline(self) -> u8 {
4885        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
4886    }
4887
4888    /// Sets the value of the `IminLine` field.
4889    pub const fn set_iminline(&mut self, value: u8) {
4890        let offset = Self::IMINLINE_SHIFT;
4891        assert!(value & (Self::IMINLINE_MASK as u8) == value);
4892        *self = Self::from_bits_retain(
4893            (self.bits() & !(Self::IMINLINE_MASK << offset)) | ((value as u64) << offset),
4894        );
4895    }
4896
4897    /// Returns a copy with the `IminLine` field set to the given value.
4898    pub const fn with_iminline(mut self, value: u8) -> Self {
4899        self.set_iminline(value);
4900        self
4901    }
4902
4903    /// Returns the value of the `L1Ip` field.
4904    pub const fn l1ip(self) -> u8 {
4905        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
4906    }
4907
4908    /// Sets the value of the `L1Ip` field.
4909    pub const fn set_l1ip(&mut self, value: u8) {
4910        let offset = Self::L1IP_SHIFT;
4911        assert!(value & (Self::L1IP_MASK as u8) == value);
4912        *self = Self::from_bits_retain(
4913            (self.bits() & !(Self::L1IP_MASK << offset)) | ((value as u64) << offset),
4914        );
4915    }
4916
4917    /// Returns a copy with the `L1Ip` field set to the given value.
4918    pub const fn with_l1ip(mut self, value: u8) -> Self {
4919        self.set_l1ip(value);
4920        self
4921    }
4922
4923    /// Returns the value of the `DminLine` field.
4924    ///
4925    /// 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.
4926    pub const fn dminline(self) -> u8 {
4927        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
4928    }
4929
4930    /// Sets the value of the `DminLine` field.
4931    ///
4932    /// 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.
4933    pub const fn set_dminline(&mut self, value: u8) {
4934        let offset = Self::DMINLINE_SHIFT;
4935        assert!(value & (Self::DMINLINE_MASK as u8) == value);
4936        *self = Self::from_bits_retain(
4937            (self.bits() & !(Self::DMINLINE_MASK << offset)) | ((value as u64) << offset),
4938        );
4939    }
4940
4941    /// Returns a copy with the `DminLine` field set to the given value.
4942    ///
4943    /// 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.
4944    pub const fn with_dminline(mut self, value: u8) -> Self {
4945        self.set_dminline(value);
4946        self
4947    }
4948
4949    /// Returns the value of the `ERG` field.
4950    pub const fn erg(self) -> u8 {
4951        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
4952    }
4953
4954    /// Sets the value of the `ERG` field.
4955    pub const fn set_erg(&mut self, value: u8) {
4956        let offset = Self::ERG_SHIFT;
4957        assert!(value & (Self::ERG_MASK as u8) == value);
4958        *self = Self::from_bits_retain(
4959            (self.bits() & !(Self::ERG_MASK << offset)) | ((value as u64) << offset),
4960        );
4961    }
4962
4963    /// Returns a copy with the `ERG` field set to the given value.
4964    pub const fn with_erg(mut self, value: u8) -> Self {
4965        self.set_erg(value);
4966        self
4967    }
4968
4969    /// Returns the value of the `CWG` field.
4970    pub const fn cwg(self) -> u8 {
4971        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
4972    }
4973
4974    /// Sets the value of the `CWG` field.
4975    pub const fn set_cwg(&mut self, value: u8) {
4976        let offset = Self::CWG_SHIFT;
4977        assert!(value & (Self::CWG_MASK as u8) == value);
4978        *self = Self::from_bits_retain(
4979            (self.bits() & !(Self::CWG_MASK << offset)) | ((value as u64) << offset),
4980        );
4981    }
4982
4983    /// Returns a copy with the `CWG` field set to the given value.
4984    pub const fn with_cwg(mut self, value: u8) -> Self {
4985        self.set_cwg(value);
4986        self
4987    }
4988
4989    /// Returns the value of the `TminLine` field.
4990    pub const fn tminline(self) -> u8 {
4991        ((self.bits() >> Self::TMINLINE_SHIFT) & 0b111111) as u8
4992    }
4993
4994    /// Sets the value of the `TminLine` field.
4995    pub const fn set_tminline(&mut self, value: u8) {
4996        let offset = Self::TMINLINE_SHIFT;
4997        assert!(value & (Self::TMINLINE_MASK as u8) == value);
4998        *self = Self::from_bits_retain(
4999            (self.bits() & !(Self::TMINLINE_MASK << offset)) | ((value as u64) << offset),
5000        );
5001    }
5002
5003    /// Returns a copy with the `TminLine` field set to the given value.
5004    pub const fn with_tminline(mut self, value: u8) -> Self {
5005        self.set_tminline(value);
5006        self
5007    }
5008}
5009
5010bitflags! {
5011    /// `CurrentEL` system register value.
5012    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5013    #[repr(transparent)]
5014    pub struct Currentel: u64 {
5015    }
5016}
5017
5018impl Currentel {
5019    /// Offset of the `EL` field.
5020    pub const EL_SHIFT: u32 = 2;
5021    /// Mask for the `EL` field.
5022    pub const EL_MASK: u64 = 0b11;
5023
5024    /// Returns the value of the `EL` field.
5025    pub const fn el(self) -> u8 {
5026        ((self.bits() >> Self::EL_SHIFT) & 0b11) as u8
5027    }
5028
5029    /// Sets the value of the `EL` field.
5030    pub const fn set_el(&mut self, value: u8) {
5031        let offset = Self::EL_SHIFT;
5032        assert!(value & (Self::EL_MASK as u8) == value);
5033        *self = Self::from_bits_retain(
5034            (self.bits() & !(Self::EL_MASK << offset)) | ((value as u64) << offset),
5035        );
5036    }
5037
5038    /// Returns a copy with the `EL` field set to the given value.
5039    pub const fn with_el(mut self, value: u8) -> Self {
5040        self.set_el(value);
5041        self
5042    }
5043}
5044
5045bitflags! {
5046    /// `DACR` system register value.
5047    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5048    #[repr(transparent)]
5049    pub struct Dacr: u32 {
5050    }
5051}
5052
5053impl Dacr {
5054    /// Offset of the `D<n>` field.
5055    pub const D_SHIFT: u32 = 0;
5056    /// Mask for the `D<n>` field.
5057    pub const D_MASK: u32 = 0b11;
5058
5059    /// Returns the value of the given `D<n>` field.
5060    pub const fn d(self, n: u32) -> u8 {
5061        assert!(n < 16);
5062        ((self.bits() >> (Self::D_SHIFT + (n - 0) * 2)) & 0b11) as u8
5063    }
5064
5065    /// Sets the value of the `D<n>` field.
5066    pub const fn set_d(&mut self, n: u32, value: u8) {
5067        assert!(n < 16);
5068        let offset = Self::D_SHIFT + (n - 0) * 2;
5069        assert!(value & (Self::D_MASK as u8) == value);
5070        *self = Self::from_bits_retain(
5071            (self.bits() & !(Self::D_MASK << offset)) | ((value as u32) << offset),
5072        );
5073    }
5074
5075    /// Returns a copy with the `D<n>` field set to the given value.
5076    pub const fn with_d(mut self, n: u32, value: u8) -> Self {
5077        self.set_d(n, value);
5078        self
5079    }
5080}
5081
5082bitflags! {
5083    /// `DBGAUTHSTATUS` system register value.
5084    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5085    #[repr(transparent)]
5086    pub struct Dbgauthstatus: u32 {
5087    }
5088}
5089
5090impl Dbgauthstatus {
5091    /// Offset of the `NSID` field.
5092    pub const NSID_SHIFT: u32 = 0;
5093    /// Mask for the `NSID` field.
5094    pub const NSID_MASK: u32 = 0b11;
5095    /// Offset of the `NSNID` field.
5096    pub const NSNID_SHIFT: u32 = 2;
5097    /// Mask for the `NSNID` field.
5098    pub const NSNID_MASK: u32 = 0b11;
5099    /// Offset of the `SID` field.
5100    pub const SID_SHIFT: u32 = 4;
5101    /// Mask for the `SID` field.
5102    pub const SID_MASK: u32 = 0b11;
5103    /// Offset of the `SNID` field.
5104    pub const SNID_SHIFT: u32 = 6;
5105    /// Mask for the `SNID` field.
5106    pub const SNID_MASK: u32 = 0b11;
5107
5108    /// Returns the value of the `NSID` field.
5109    pub const fn nsid(self) -> u8 {
5110        ((self.bits() >> Self::NSID_SHIFT) & 0b11) as u8
5111    }
5112
5113    /// Sets the value of the `NSID` field.
5114    pub const fn set_nsid(&mut self, value: u8) {
5115        let offset = Self::NSID_SHIFT;
5116        assert!(value & (Self::NSID_MASK as u8) == value);
5117        *self = Self::from_bits_retain(
5118            (self.bits() & !(Self::NSID_MASK << offset)) | ((value as u32) << offset),
5119        );
5120    }
5121
5122    /// Returns a copy with the `NSID` field set to the given value.
5123    pub const fn with_nsid(mut self, value: u8) -> Self {
5124        self.set_nsid(value);
5125        self
5126    }
5127
5128    /// Returns the value of the `NSNID` field.
5129    pub const fn nsnid(self) -> u8 {
5130        ((self.bits() >> Self::NSNID_SHIFT) & 0b11) as u8
5131    }
5132
5133    /// Sets the value of the `NSNID` field.
5134    pub const fn set_nsnid(&mut self, value: u8) {
5135        let offset = Self::NSNID_SHIFT;
5136        assert!(value & (Self::NSNID_MASK as u8) == value);
5137        *self = Self::from_bits_retain(
5138            (self.bits() & !(Self::NSNID_MASK << offset)) | ((value as u32) << offset),
5139        );
5140    }
5141
5142    /// Returns a copy with the `NSNID` field set to the given value.
5143    pub const fn with_nsnid(mut self, value: u8) -> Self {
5144        self.set_nsnid(value);
5145        self
5146    }
5147
5148    /// Returns the value of the `SID` field.
5149    pub const fn sid(self) -> u8 {
5150        ((self.bits() >> Self::SID_SHIFT) & 0b11) as u8
5151    }
5152
5153    /// Sets the value of the `SID` field.
5154    pub const fn set_sid(&mut self, value: u8) {
5155        let offset = Self::SID_SHIFT;
5156        assert!(value & (Self::SID_MASK as u8) == value);
5157        *self = Self::from_bits_retain(
5158            (self.bits() & !(Self::SID_MASK << offset)) | ((value as u32) << offset),
5159        );
5160    }
5161
5162    /// Returns a copy with the `SID` field set to the given value.
5163    pub const fn with_sid(mut self, value: u8) -> Self {
5164        self.set_sid(value);
5165        self
5166    }
5167
5168    /// Returns the value of the `SNID` field.
5169    pub const fn snid(self) -> u8 {
5170        ((self.bits() >> Self::SNID_SHIFT) & 0b11) as u8
5171    }
5172
5173    /// Sets the value of the `SNID` field.
5174    pub const fn set_snid(&mut self, value: u8) {
5175        let offset = Self::SNID_SHIFT;
5176        assert!(value & (Self::SNID_MASK as u8) == value);
5177        *self = Self::from_bits_retain(
5178            (self.bits() & !(Self::SNID_MASK << offset)) | ((value as u32) << offset),
5179        );
5180    }
5181
5182    /// Returns a copy with the `SNID` field set to the given value.
5183    pub const fn with_snid(mut self, value: u8) -> Self {
5184        self.set_snid(value);
5185        self
5186    }
5187}
5188
5189bitflags! {
5190    /// `DBGCLAIMCLR` system register value.
5191    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5192    #[repr(transparent)]
5193    pub struct Dbgclaimclr: u32 {
5194        /// `CLAIM<m>` bit 0.
5195        const CLAIM0 = 1 << 0;
5196        /// `CLAIM<m>` bit 1.
5197        const CLAIM1 = 1 << 1;
5198        /// `CLAIM<m>` bit 2.
5199        const CLAIM2 = 1 << 2;
5200        /// `CLAIM<m>` bit 3.
5201        const CLAIM3 = 1 << 3;
5202        /// `CLAIM<m>` bit 4.
5203        const CLAIM4 = 1 << 4;
5204        /// `CLAIM<m>` bit 5.
5205        const CLAIM5 = 1 << 5;
5206        /// `CLAIM<m>` bit 6.
5207        const CLAIM6 = 1 << 6;
5208        /// `CLAIM<m>` bit 7.
5209        const CLAIM7 = 1 << 7;
5210    }
5211}
5212
5213impl Dbgclaimclr {
5214    /// Offset of the `CLAIM<m>` field.
5215    pub const CLAIM_SHIFT: u32 = 0;
5216}
5217
5218bitflags! {
5219    /// `DBGCLAIMSET` system register value.
5220    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5221    #[repr(transparent)]
5222    pub struct Dbgclaimset: u32 {
5223        /// `CLAIM<m>` bit 0.
5224        const CLAIM0 = 1 << 0;
5225        /// `CLAIM<m>` bit 1.
5226        const CLAIM1 = 1 << 1;
5227        /// `CLAIM<m>` bit 2.
5228        const CLAIM2 = 1 << 2;
5229        /// `CLAIM<m>` bit 3.
5230        const CLAIM3 = 1 << 3;
5231        /// `CLAIM<m>` bit 4.
5232        const CLAIM4 = 1 << 4;
5233        /// `CLAIM<m>` bit 5.
5234        const CLAIM5 = 1 << 5;
5235        /// `CLAIM<m>` bit 6.
5236        const CLAIM6 = 1 << 6;
5237        /// `CLAIM<m>` bit 7.
5238        const CLAIM7 = 1 << 7;
5239    }
5240}
5241
5242impl Dbgclaimset {
5243    /// Offset of the `CLAIM<m>` field.
5244    pub const CLAIM_SHIFT: u32 = 0;
5245}
5246
5247bitflags! {
5248    /// `DBGDCCINT` system register value.
5249    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5250    #[repr(transparent)]
5251    pub struct Dbgdccint: u32 {
5252        /// `TX` bit.
5253        const TX = 1 << 29;
5254        /// `RX` bit.
5255        const RX = 1 << 30;
5256    }
5257}
5258
5259impl Dbgdccint {
5260    /// Offset of the `TX` field.
5261    pub const TX_SHIFT: u32 = 29;
5262    /// Offset of the `RX` field.
5263    pub const RX_SHIFT: u32 = 30;
5264}
5265
5266bitflags! {
5267    /// `DBGDEVID` system register value.
5268    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5269    #[repr(transparent)]
5270    pub struct Dbgdevid: u32 {
5271    }
5272}
5273
5274impl Dbgdevid {
5275    /// Offset of the `PCSample` field.
5276    pub const PCSAMPLE_SHIFT: u32 = 0;
5277    /// Mask for the `PCSample` field.
5278    pub const PCSAMPLE_MASK: u32 = 0b1111;
5279    /// Offset of the `WPAddrMask` field.
5280    pub const WPADDRMASK_SHIFT: u32 = 4;
5281    /// Mask for the `WPAddrMask` field.
5282    pub const WPADDRMASK_MASK: u32 = 0b1111;
5283    /// Offset of the `BPAddrMask` field.
5284    pub const BPADDRMASK_SHIFT: u32 = 8;
5285    /// Mask for the `BPAddrMask` field.
5286    pub const BPADDRMASK_MASK: u32 = 0b1111;
5287    /// Offset of the `VectorCatch` field.
5288    pub const VECTORCATCH_SHIFT: u32 = 12;
5289    /// Mask for the `VectorCatch` field.
5290    pub const VECTORCATCH_MASK: u32 = 0b1111;
5291    /// Offset of the `VirtExtns` field.
5292    pub const VIRTEXTNS_SHIFT: u32 = 16;
5293    /// Mask for the `VirtExtns` field.
5294    pub const VIRTEXTNS_MASK: u32 = 0b1111;
5295    /// Offset of the `DoubleLock` field.
5296    pub const DOUBLELOCK_SHIFT: u32 = 20;
5297    /// Mask for the `DoubleLock` field.
5298    pub const DOUBLELOCK_MASK: u32 = 0b1111;
5299    /// Offset of the `AuxRegs` field.
5300    pub const AUXREGS_SHIFT: u32 = 24;
5301    /// Mask for the `AuxRegs` field.
5302    pub const AUXREGS_MASK: u32 = 0b1111;
5303    /// Offset of the `CIDMask` field.
5304    pub const CIDMASK_SHIFT: u32 = 28;
5305    /// Mask for the `CIDMask` field.
5306    pub const CIDMASK_MASK: u32 = 0b1111;
5307
5308    /// Returns the value of the `PCSample` field.
5309    pub const fn pcsample(self) -> u8 {
5310        ((self.bits() >> Self::PCSAMPLE_SHIFT) & 0b1111) as u8
5311    }
5312
5313    /// Sets the value of the `PCSample` field.
5314    pub const fn set_pcsample(&mut self, value: u8) {
5315        let offset = Self::PCSAMPLE_SHIFT;
5316        assert!(value & (Self::PCSAMPLE_MASK as u8) == value);
5317        *self = Self::from_bits_retain(
5318            (self.bits() & !(Self::PCSAMPLE_MASK << offset)) | ((value as u32) << offset),
5319        );
5320    }
5321
5322    /// Returns a copy with the `PCSample` field set to the given value.
5323    pub const fn with_pcsample(mut self, value: u8) -> Self {
5324        self.set_pcsample(value);
5325        self
5326    }
5327
5328    /// Returns the value of the `WPAddrMask` field.
5329    pub const fn wpaddrmask(self) -> u8 {
5330        ((self.bits() >> Self::WPADDRMASK_SHIFT) & 0b1111) as u8
5331    }
5332
5333    /// Sets the value of the `WPAddrMask` field.
5334    pub const fn set_wpaddrmask(&mut self, value: u8) {
5335        let offset = Self::WPADDRMASK_SHIFT;
5336        assert!(value & (Self::WPADDRMASK_MASK as u8) == value);
5337        *self = Self::from_bits_retain(
5338            (self.bits() & !(Self::WPADDRMASK_MASK << offset)) | ((value as u32) << offset),
5339        );
5340    }
5341
5342    /// Returns a copy with the `WPAddrMask` field set to the given value.
5343    pub const fn with_wpaddrmask(mut self, value: u8) -> Self {
5344        self.set_wpaddrmask(value);
5345        self
5346    }
5347
5348    /// Returns the value of the `BPAddrMask` field.
5349    pub const fn bpaddrmask(self) -> u8 {
5350        ((self.bits() >> Self::BPADDRMASK_SHIFT) & 0b1111) as u8
5351    }
5352
5353    /// Sets the value of the `BPAddrMask` field.
5354    pub const fn set_bpaddrmask(&mut self, value: u8) {
5355        let offset = Self::BPADDRMASK_SHIFT;
5356        assert!(value & (Self::BPADDRMASK_MASK as u8) == value);
5357        *self = Self::from_bits_retain(
5358            (self.bits() & !(Self::BPADDRMASK_MASK << offset)) | ((value as u32) << offset),
5359        );
5360    }
5361
5362    /// Returns a copy with the `BPAddrMask` field set to the given value.
5363    pub const fn with_bpaddrmask(mut self, value: u8) -> Self {
5364        self.set_bpaddrmask(value);
5365        self
5366    }
5367
5368    /// Returns the value of the `VectorCatch` field.
5369    pub const fn vectorcatch(self) -> u8 {
5370        ((self.bits() >> Self::VECTORCATCH_SHIFT) & 0b1111) as u8
5371    }
5372
5373    /// Sets the value of the `VectorCatch` field.
5374    pub const fn set_vectorcatch(&mut self, value: u8) {
5375        let offset = Self::VECTORCATCH_SHIFT;
5376        assert!(value & (Self::VECTORCATCH_MASK as u8) == value);
5377        *self = Self::from_bits_retain(
5378            (self.bits() & !(Self::VECTORCATCH_MASK << offset)) | ((value as u32) << offset),
5379        );
5380    }
5381
5382    /// Returns a copy with the `VectorCatch` field set to the given value.
5383    pub const fn with_vectorcatch(mut self, value: u8) -> Self {
5384        self.set_vectorcatch(value);
5385        self
5386    }
5387
5388    /// Returns the value of the `VirtExtns` field.
5389    pub const fn virtextns(self) -> u8 {
5390        ((self.bits() >> Self::VIRTEXTNS_SHIFT) & 0b1111) as u8
5391    }
5392
5393    /// Sets the value of the `VirtExtns` field.
5394    pub const fn set_virtextns(&mut self, value: u8) {
5395        let offset = Self::VIRTEXTNS_SHIFT;
5396        assert!(value & (Self::VIRTEXTNS_MASK as u8) == value);
5397        *self = Self::from_bits_retain(
5398            (self.bits() & !(Self::VIRTEXTNS_MASK << offset)) | ((value as u32) << offset),
5399        );
5400    }
5401
5402    /// Returns a copy with the `VirtExtns` field set to the given value.
5403    pub const fn with_virtextns(mut self, value: u8) -> Self {
5404        self.set_virtextns(value);
5405        self
5406    }
5407
5408    /// Returns the value of the `DoubleLock` field.
5409    pub const fn doublelock(self) -> u8 {
5410        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
5411    }
5412
5413    /// Sets the value of the `DoubleLock` field.
5414    pub const fn set_doublelock(&mut self, value: u8) {
5415        let offset = Self::DOUBLELOCK_SHIFT;
5416        assert!(value & (Self::DOUBLELOCK_MASK as u8) == value);
5417        *self = Self::from_bits_retain(
5418            (self.bits() & !(Self::DOUBLELOCK_MASK << offset)) | ((value as u32) << offset),
5419        );
5420    }
5421
5422    /// Returns a copy with the `DoubleLock` field set to the given value.
5423    pub const fn with_doublelock(mut self, value: u8) -> Self {
5424        self.set_doublelock(value);
5425        self
5426    }
5427
5428    /// Returns the value of the `AuxRegs` field.
5429    pub const fn auxregs(self) -> u8 {
5430        ((self.bits() >> Self::AUXREGS_SHIFT) & 0b1111) as u8
5431    }
5432
5433    /// Sets the value of the `AuxRegs` field.
5434    pub const fn set_auxregs(&mut self, value: u8) {
5435        let offset = Self::AUXREGS_SHIFT;
5436        assert!(value & (Self::AUXREGS_MASK as u8) == value);
5437        *self = Self::from_bits_retain(
5438            (self.bits() & !(Self::AUXREGS_MASK << offset)) | ((value as u32) << offset),
5439        );
5440    }
5441
5442    /// Returns a copy with the `AuxRegs` field set to the given value.
5443    pub const fn with_auxregs(mut self, value: u8) -> Self {
5444        self.set_auxregs(value);
5445        self
5446    }
5447
5448    /// Returns the value of the `CIDMask` field.
5449    pub const fn cidmask(self) -> u8 {
5450        ((self.bits() >> Self::CIDMASK_SHIFT) & 0b1111) as u8
5451    }
5452
5453    /// Sets the value of the `CIDMask` field.
5454    pub const fn set_cidmask(&mut self, value: u8) {
5455        let offset = Self::CIDMASK_SHIFT;
5456        assert!(value & (Self::CIDMASK_MASK as u8) == value);
5457        *self = Self::from_bits_retain(
5458            (self.bits() & !(Self::CIDMASK_MASK << offset)) | ((value as u32) << offset),
5459        );
5460    }
5461
5462    /// Returns a copy with the `CIDMask` field set to the given value.
5463    pub const fn with_cidmask(mut self, value: u8) -> Self {
5464        self.set_cidmask(value);
5465        self
5466    }
5467}
5468
5469bitflags! {
5470    /// `DBGDEVID1` system register value.
5471    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5472    #[repr(transparent)]
5473    pub struct Dbgdevid1: u32 {
5474    }
5475}
5476
5477impl Dbgdevid1 {
5478    /// Offset of the `PCSROffset` field.
5479    pub const PCSROFFSET_SHIFT: u32 = 0;
5480    /// Mask for the `PCSROffset` field.
5481    pub const PCSROFFSET_MASK: u32 = 0b1111;
5482
5483    /// Returns the value of the `PCSROffset` field.
5484    pub const fn pcsroffset(self) -> u8 {
5485        ((self.bits() >> Self::PCSROFFSET_SHIFT) & 0b1111) as u8
5486    }
5487
5488    /// Sets the value of the `PCSROffset` field.
5489    pub const fn set_pcsroffset(&mut self, value: u8) {
5490        let offset = Self::PCSROFFSET_SHIFT;
5491        assert!(value & (Self::PCSROFFSET_MASK as u8) == value);
5492        *self = Self::from_bits_retain(
5493            (self.bits() & !(Self::PCSROFFSET_MASK << offset)) | ((value as u32) << offset),
5494        );
5495    }
5496
5497    /// Returns a copy with the `PCSROffset` field set to the given value.
5498    pub const fn with_pcsroffset(mut self, value: u8) -> Self {
5499        self.set_pcsroffset(value);
5500        self
5501    }
5502}
5503
5504bitflags! {
5505    /// `DBGDIDR` system register value.
5506    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5507    #[repr(transparent)]
5508    pub struct Dbgdidr: u32 {
5509        /// RES1 bits in the `DBGDIDR` register.
5510        const RES1 = 0b1000000000000000;
5511        /// `SE_imp` bit.
5512        const SE_IMP = 1 << 12;
5513        /// `nSUHD_imp` bit.
5514        const NSUHD_IMP = 1 << 14;
5515    }
5516}
5517
5518impl Dbgdidr {
5519    /// Offset of the `SE_imp` field.
5520    pub const SE_IMP_SHIFT: u32 = 12;
5521    /// Offset of the `nSUHD_imp` field.
5522    pub const NSUHD_IMP_SHIFT: u32 = 14;
5523    /// Offset of the `Version` field.
5524    pub const VERSION_SHIFT: u32 = 16;
5525    /// Mask for the `Version` field.
5526    pub const VERSION_MASK: u32 = 0b1111;
5527    /// Offset of the `CTX_CMPs` field.
5528    pub const CTX_CMPS_SHIFT: u32 = 20;
5529    /// Mask for the `CTX_CMPs` field.
5530    pub const CTX_CMPS_MASK: u32 = 0b1111;
5531    /// Offset of the `BRPs` field.
5532    pub const BRPS_SHIFT: u32 = 24;
5533    /// Mask for the `BRPs` field.
5534    pub const BRPS_MASK: u32 = 0b1111;
5535    /// Offset of the `WRPs` field.
5536    pub const WRPS_SHIFT: u32 = 28;
5537    /// Mask for the `WRPs` field.
5538    pub const WRPS_MASK: u32 = 0b1111;
5539
5540    /// Returns the value of the `Version` field.
5541    pub const fn version(self) -> u8 {
5542        ((self.bits() >> Self::VERSION_SHIFT) & 0b1111) as u8
5543    }
5544
5545    /// Sets the value of the `Version` field.
5546    pub const fn set_version(&mut self, value: u8) {
5547        let offset = Self::VERSION_SHIFT;
5548        assert!(value & (Self::VERSION_MASK as u8) == value);
5549        *self = Self::from_bits_retain(
5550            (self.bits() & !(Self::VERSION_MASK << offset)) | ((value as u32) << offset),
5551        );
5552    }
5553
5554    /// Returns a copy with the `Version` field set to the given value.
5555    pub const fn with_version(mut self, value: u8) -> Self {
5556        self.set_version(value);
5557        self
5558    }
5559
5560    /// Returns the value of the `CTX_CMPs` field.
5561    pub const fn ctx_cmps(self) -> u8 {
5562        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
5563    }
5564
5565    /// Sets the value of the `CTX_CMPs` field.
5566    pub const fn set_ctx_cmps(&mut self, value: u8) {
5567        let offset = Self::CTX_CMPS_SHIFT;
5568        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
5569        *self = Self::from_bits_retain(
5570            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u32) << offset),
5571        );
5572    }
5573
5574    /// Returns a copy with the `CTX_CMPs` field set to the given value.
5575    pub const fn with_ctx_cmps(mut self, value: u8) -> Self {
5576        self.set_ctx_cmps(value);
5577        self
5578    }
5579
5580    /// Returns the value of the `BRPs` field.
5581    pub const fn brps(self) -> u8 {
5582        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
5583    }
5584
5585    /// Sets the value of the `BRPs` field.
5586    pub const fn set_brps(&mut self, value: u8) {
5587        let offset = Self::BRPS_SHIFT;
5588        assert!(value & (Self::BRPS_MASK as u8) == value);
5589        *self = Self::from_bits_retain(
5590            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u32) << offset),
5591        );
5592    }
5593
5594    /// Returns a copy with the `BRPs` field set to the given value.
5595    pub const fn with_brps(mut self, value: u8) -> Self {
5596        self.set_brps(value);
5597        self
5598    }
5599
5600    /// Returns the value of the `WRPs` field.
5601    pub const fn wrps(self) -> u8 {
5602        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
5603    }
5604
5605    /// Sets the value of the `WRPs` field.
5606    pub const fn set_wrps(&mut self, value: u8) {
5607        let offset = Self::WRPS_SHIFT;
5608        assert!(value & (Self::WRPS_MASK as u8) == value);
5609        *self = Self::from_bits_retain(
5610            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u32) << offset),
5611        );
5612    }
5613
5614    /// Returns a copy with the `WRPs` field set to the given value.
5615    pub const fn with_wrps(mut self, value: u8) -> Self {
5616        self.set_wrps(value);
5617        self
5618    }
5619}
5620
5621bitflags! {
5622    /// `DBGDRAR` system register value.
5623    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5624    #[repr(transparent)]
5625    pub struct Dbgdrar: u64 {
5626    }
5627}
5628
5629impl Dbgdrar {
5630    /// Offset of the `Valid` field.
5631    pub const VALID_SHIFT: u32 = 0;
5632    /// Mask for the `Valid` field.
5633    pub const VALID_MASK: u64 = 0b11;
5634    /// Offset of the `ROMADDR[47:12]` field.
5635    pub const ROMADDR_47_12_SHIFT: u32 = 12;
5636    /// Mask for the `ROMADDR[47:12]` field.
5637    pub const ROMADDR_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
5638
5639    /// Returns the value of the `Valid` field.
5640    pub const fn valid(self) -> u8 {
5641        ((self.bits() >> Self::VALID_SHIFT) & 0b11) as u8
5642    }
5643
5644    /// Sets the value of the `Valid` field.
5645    pub const fn set_valid(&mut self, value: u8) {
5646        let offset = Self::VALID_SHIFT;
5647        assert!(value & (Self::VALID_MASK as u8) == value);
5648        *self = Self::from_bits_retain(
5649            (self.bits() & !(Self::VALID_MASK << offset)) | ((value as u64) << offset),
5650        );
5651    }
5652
5653    /// Returns a copy with the `Valid` field set to the given value.
5654    pub const fn with_valid(mut self, value: u8) -> Self {
5655        self.set_valid(value);
5656        self
5657    }
5658
5659    /// Returns the value of the `ROMADDR[47:12]` field.
5660    pub const fn romaddr_47_12(self) -> u64 {
5661        ((self.bits() >> Self::ROMADDR_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
5662    }
5663
5664    /// Sets the value of the `ROMADDR[47:12]` field.
5665    pub const fn set_romaddr_47_12(&mut self, value: u64) {
5666        let offset = Self::ROMADDR_47_12_SHIFT;
5667        assert!(value & (Self::ROMADDR_47_12_MASK as u64) == value);
5668        *self = Self::from_bits_retain(
5669            (self.bits() & !(Self::ROMADDR_47_12_MASK << offset)) | ((value as u64) << offset),
5670        );
5671    }
5672
5673    /// Returns a copy with the `ROMADDR[47:12]` field set to the given value.
5674    pub const fn with_romaddr_47_12(mut self, value: u64) -> Self {
5675        self.set_romaddr_47_12(value);
5676        self
5677    }
5678}
5679
5680bitflags! {
5681    /// `DBGDSCRext` system register value.
5682    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5683    #[repr(transparent)]
5684    pub struct Dbgdscrext: u32 {
5685        /// `ERR` bit.
5686        const ERR = 1 << 6;
5687        /// `UDCCdis` bit.
5688        const UDCCDIS = 1 << 12;
5689        /// `HDE` bit.
5690        const HDE = 1 << 14;
5691        /// `MDBGen` bit.
5692        const MDBGEN = 1 << 15;
5693        /// `SPIDdis` bit.
5694        const SPIDDIS = 1 << 16;
5695        /// `SPNIDdis` bit.
5696        const SPNIDDIS = 1 << 17;
5697        /// `NS` bit.
5698        const NS = 1 << 18;
5699        /// `SC2` bit.
5700        const SC2 = 1 << 19;
5701        /// `TDA` bit.
5702        const TDA = 1 << 21;
5703        /// `TXU` bit.
5704        const TXU = 1 << 26;
5705        /// `RXO` bit.
5706        const RXO = 1 << 27;
5707        /// `TXfull` bit.
5708        const TXFULL = 1 << 29;
5709        /// `RXfull` bit.
5710        const RXFULL = 1 << 30;
5711        /// `TFO` bit.
5712        const TFO = 1 << 31;
5713    }
5714}
5715
5716impl Dbgdscrext {
5717    /// Offset of the `MOE` field.
5718    pub const MOE_SHIFT: u32 = 2;
5719    /// Mask for the `MOE` field.
5720    pub const MOE_MASK: u32 = 0b1111;
5721    /// Offset of the `ERR` field.
5722    pub const ERR_SHIFT: u32 = 6;
5723    /// Offset of the `UDCCdis` field.
5724    pub const UDCCDIS_SHIFT: u32 = 12;
5725    /// Offset of the `HDE` field.
5726    pub const HDE_SHIFT: u32 = 14;
5727    /// Offset of the `MDBGen` field.
5728    pub const MDBGEN_SHIFT: u32 = 15;
5729    /// Offset of the `SPIDdis` field.
5730    pub const SPIDDIS_SHIFT: u32 = 16;
5731    /// Offset of the `SPNIDdis` field.
5732    pub const SPNIDDIS_SHIFT: u32 = 17;
5733    /// Offset of the `NS` field.
5734    pub const NS_SHIFT: u32 = 18;
5735    /// Offset of the `SC2` field.
5736    pub const SC2_SHIFT: u32 = 19;
5737    /// Offset of the `TDA` field.
5738    pub const TDA_SHIFT: u32 = 21;
5739    /// Offset of the `INTdis` field.
5740    pub const INTDIS_SHIFT: u32 = 22;
5741    /// Mask for the `INTdis` field.
5742    pub const INTDIS_MASK: u32 = 0b11;
5743    /// Offset of the `TXU` field.
5744    pub const TXU_SHIFT: u32 = 26;
5745    /// Offset of the `RXO` field.
5746    pub const RXO_SHIFT: u32 = 27;
5747    /// Offset of the `TXfull` field.
5748    pub const TXFULL_SHIFT: u32 = 29;
5749    /// Offset of the `RXfull` field.
5750    pub const RXFULL_SHIFT: u32 = 30;
5751    /// Offset of the `TFO` field.
5752    pub const TFO_SHIFT: u32 = 31;
5753
5754    /// Returns the value of the `MOE` field.
5755    pub const fn moe(self) -> u8 {
5756        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
5757    }
5758
5759    /// Sets the value of the `MOE` field.
5760    pub const fn set_moe(&mut self, value: u8) {
5761        let offset = Self::MOE_SHIFT;
5762        assert!(value & (Self::MOE_MASK as u8) == value);
5763        *self = Self::from_bits_retain(
5764            (self.bits() & !(Self::MOE_MASK << offset)) | ((value as u32) << offset),
5765        );
5766    }
5767
5768    /// Returns a copy with the `MOE` field set to the given value.
5769    pub const fn with_moe(mut self, value: u8) -> Self {
5770        self.set_moe(value);
5771        self
5772    }
5773
5774    /// Returns the value of the `INTdis` field.
5775    pub const fn intdis(self) -> u8 {
5776        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
5777    }
5778
5779    /// Sets the value of the `INTdis` field.
5780    pub const fn set_intdis(&mut self, value: u8) {
5781        let offset = Self::INTDIS_SHIFT;
5782        assert!(value & (Self::INTDIS_MASK as u8) == value);
5783        *self = Self::from_bits_retain(
5784            (self.bits() & !(Self::INTDIS_MASK << offset)) | ((value as u32) << offset),
5785        );
5786    }
5787
5788    /// Returns a copy with the `INTdis` field set to the given value.
5789    pub const fn with_intdis(mut self, value: u8) -> Self {
5790        self.set_intdis(value);
5791        self
5792    }
5793}
5794
5795bitflags! {
5796    /// `DBGDSCRint` system register value.
5797    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5798    #[repr(transparent)]
5799    pub struct Dbgdscrint: u32 {
5800        /// `UDCCdis` bit.
5801        const UDCCDIS = 1 << 12;
5802        /// `MDBGen` bit.
5803        const MDBGEN = 1 << 15;
5804        /// `SPIDdis` bit.
5805        const SPIDDIS = 1 << 16;
5806        /// `SPNIDdis` bit.
5807        const SPNIDDIS = 1 << 17;
5808        /// `NS` bit.
5809        const NS = 1 << 18;
5810        /// `TXfull` bit.
5811        const TXFULL = 1 << 29;
5812        /// `RXfull` bit.
5813        const RXFULL = 1 << 30;
5814    }
5815}
5816
5817impl Dbgdscrint {
5818    /// Offset of the `MOE` field.
5819    pub const MOE_SHIFT: u32 = 2;
5820    /// Mask for the `MOE` field.
5821    pub const MOE_MASK: u32 = 0b1111;
5822    /// Offset of the `UDCCdis` field.
5823    pub const UDCCDIS_SHIFT: u32 = 12;
5824    /// Offset of the `MDBGen` field.
5825    pub const MDBGEN_SHIFT: u32 = 15;
5826    /// Offset of the `SPIDdis` field.
5827    pub const SPIDDIS_SHIFT: u32 = 16;
5828    /// Offset of the `SPNIDdis` field.
5829    pub const SPNIDDIS_SHIFT: u32 = 17;
5830    /// Offset of the `NS` field.
5831    pub const NS_SHIFT: u32 = 18;
5832    /// Offset of the `TXfull` field.
5833    pub const TXFULL_SHIFT: u32 = 29;
5834    /// Offset of the `RXfull` field.
5835    pub const RXFULL_SHIFT: u32 = 30;
5836
5837    /// Returns the value of the `MOE` field.
5838    pub const fn moe(self) -> u8 {
5839        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
5840    }
5841
5842    /// Sets the value of the `MOE` field.
5843    pub const fn set_moe(&mut self, value: u8) {
5844        let offset = Self::MOE_SHIFT;
5845        assert!(value & (Self::MOE_MASK as u8) == value);
5846        *self = Self::from_bits_retain(
5847            (self.bits() & !(Self::MOE_MASK << offset)) | ((value as u32) << offset),
5848        );
5849    }
5850
5851    /// Returns a copy with the `MOE` field set to the given value.
5852    pub const fn with_moe(mut self, value: u8) -> Self {
5853        self.set_moe(value);
5854        self
5855    }
5856}
5857
5858bitflags! {
5859    /// `DBGDTRRXext` system register value.
5860    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5861    #[repr(transparent)]
5862    pub struct Dbgdtrrxext: u32 {
5863    }
5864}
5865
5866impl Dbgdtrrxext {
5867    /// Offset of the `DTRRX` field.
5868    pub const DTRRX_SHIFT: u32 = 0;
5869    /// Mask for the `DTRRX` field.
5870    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
5871
5872    /// Returns the value of the `DTRRX` field.
5873    pub const fn dtrrx(self) -> u32 {
5874        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
5875    }
5876
5877    /// Sets the value of the `DTRRX` field.
5878    pub const fn set_dtrrx(&mut self, value: u32) {
5879        let offset = Self::DTRRX_SHIFT;
5880        assert!(value & (Self::DTRRX_MASK as u32) == value);
5881        *self = Self::from_bits_retain(
5882            (self.bits() & !(Self::DTRRX_MASK << offset)) | ((value as u32) << offset),
5883        );
5884    }
5885
5886    /// Returns a copy with the `DTRRX` field set to the given value.
5887    pub const fn with_dtrrx(mut self, value: u32) -> Self {
5888        self.set_dtrrx(value);
5889        self
5890    }
5891}
5892
5893bitflags! {
5894    /// `DBGDTRRXint` system register value.
5895    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5896    #[repr(transparent)]
5897    pub struct Dbgdtrrxint: u32 {
5898    }
5899}
5900
5901impl Dbgdtrrxint {
5902    /// Offset of the `DTRRX` field.
5903    pub const DTRRX_SHIFT: u32 = 0;
5904    /// Mask for the `DTRRX` field.
5905    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
5906
5907    /// Returns the value of the `DTRRX` field.
5908    pub const fn dtrrx(self) -> u32 {
5909        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
5910    }
5911
5912    /// Sets the value of the `DTRRX` field.
5913    pub const fn set_dtrrx(&mut self, value: u32) {
5914        let offset = Self::DTRRX_SHIFT;
5915        assert!(value & (Self::DTRRX_MASK as u32) == value);
5916        *self = Self::from_bits_retain(
5917            (self.bits() & !(Self::DTRRX_MASK << offset)) | ((value as u32) << offset),
5918        );
5919    }
5920
5921    /// Returns a copy with the `DTRRX` field set to the given value.
5922    pub const fn with_dtrrx(mut self, value: u32) -> Self {
5923        self.set_dtrrx(value);
5924        self
5925    }
5926}
5927
5928bitflags! {
5929    /// `DBGDTRTXext` system register value.
5930    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5931    #[repr(transparent)]
5932    pub struct Dbgdtrtxext: u32 {
5933    }
5934}
5935
5936impl Dbgdtrtxext {
5937    /// Offset of the `DTRTX` field.
5938    pub const DTRTX_SHIFT: u32 = 0;
5939    /// Mask for the `DTRTX` field.
5940    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
5941
5942    /// Returns the value of the `DTRTX` field.
5943    pub const fn dtrtx(self) -> u32 {
5944        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
5945    }
5946
5947    /// Sets the value of the `DTRTX` field.
5948    pub const fn set_dtrtx(&mut self, value: u32) {
5949        let offset = Self::DTRTX_SHIFT;
5950        assert!(value & (Self::DTRTX_MASK as u32) == value);
5951        *self = Self::from_bits_retain(
5952            (self.bits() & !(Self::DTRTX_MASK << offset)) | ((value as u32) << offset),
5953        );
5954    }
5955
5956    /// Returns a copy with the `DTRTX` field set to the given value.
5957    pub const fn with_dtrtx(mut self, value: u32) -> Self {
5958        self.set_dtrtx(value);
5959        self
5960    }
5961}
5962
5963bitflags! {
5964    /// `DBGDTRTXint` system register value.
5965    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5966    #[repr(transparent)]
5967    pub struct Dbgdtrtxint: u32 {
5968    }
5969}
5970
5971impl Dbgdtrtxint {
5972    /// Offset of the `DTRTX` field.
5973    pub const DTRTX_SHIFT: u32 = 0;
5974    /// Mask for the `DTRTX` field.
5975    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
5976
5977    /// Returns the value of the `DTRTX` field.
5978    pub const fn dtrtx(self) -> u32 {
5979        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
5980    }
5981
5982    /// Sets the value of the `DTRTX` field.
5983    pub const fn set_dtrtx(&mut self, value: u32) {
5984        let offset = Self::DTRTX_SHIFT;
5985        assert!(value & (Self::DTRTX_MASK as u32) == value);
5986        *self = Self::from_bits_retain(
5987            (self.bits() & !(Self::DTRTX_MASK << offset)) | ((value as u32) << offset),
5988        );
5989    }
5990
5991    /// Returns a copy with the `DTRTX` field set to the given value.
5992    pub const fn with_dtrtx(mut self, value: u32) -> Self {
5993        self.set_dtrtx(value);
5994        self
5995    }
5996}
5997
5998bitflags! {
5999    /// `DBGOSDLR` system register value.
6000    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6001    #[repr(transparent)]
6002    pub struct Dbgosdlr: u32 {
6003        /// `DLK` bit.
6004        const DLK = 1 << 0;
6005    }
6006}
6007
6008impl Dbgosdlr {
6009    /// Offset of the `DLK` field.
6010    pub const DLK_SHIFT: u32 = 0;
6011}
6012
6013bitflags! {
6014    /// `DBGOSECCR` system register value.
6015    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6016    #[repr(transparent)]
6017    pub struct Dbgoseccr: u32 {
6018    }
6019}
6020
6021impl Dbgoseccr {
6022    /// Offset of the `EDECCR` field.
6023    pub const EDECCR_SHIFT: u32 = 0;
6024    /// Mask for the `EDECCR` field.
6025    pub const EDECCR_MASK: u32 = 0b11111111111111111111111111111111;
6026
6027    /// Returns the value of the `EDECCR` field.
6028    pub const fn edeccr(self) -> u32 {
6029        ((self.bits() >> Self::EDECCR_SHIFT) & 0b11111111111111111111111111111111) as u32
6030    }
6031
6032    /// Sets the value of the `EDECCR` field.
6033    pub const fn set_edeccr(&mut self, value: u32) {
6034        let offset = Self::EDECCR_SHIFT;
6035        assert!(value & (Self::EDECCR_MASK as u32) == value);
6036        *self = Self::from_bits_retain(
6037            (self.bits() & !(Self::EDECCR_MASK << offset)) | ((value as u32) << offset),
6038        );
6039    }
6040
6041    /// Returns a copy with the `EDECCR` field set to the given value.
6042    pub const fn with_edeccr(mut self, value: u32) -> Self {
6043        self.set_edeccr(value);
6044        self
6045    }
6046}
6047
6048bitflags! {
6049    /// `DBGOSLAR` system register value.
6050    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6051    #[repr(transparent)]
6052    pub struct Dbgoslar: u32 {
6053    }
6054}
6055
6056impl Dbgoslar {
6057    /// Offset of the `OSLA` field.
6058    pub const OSLA_SHIFT: u32 = 0;
6059    /// Mask for the `OSLA` field.
6060    pub const OSLA_MASK: u32 = 0b11111111111111111111111111111111;
6061
6062    /// Returns the value of the `OSLA` field.
6063    pub const fn osla(self) -> u32 {
6064        ((self.bits() >> Self::OSLA_SHIFT) & 0b11111111111111111111111111111111) as u32
6065    }
6066
6067    /// Sets the value of the `OSLA` field.
6068    pub const fn set_osla(&mut self, value: u32) {
6069        let offset = Self::OSLA_SHIFT;
6070        assert!(value & (Self::OSLA_MASK as u32) == value);
6071        *self = Self::from_bits_retain(
6072            (self.bits() & !(Self::OSLA_MASK << offset)) | ((value as u32) << offset),
6073        );
6074    }
6075
6076    /// Returns a copy with the `OSLA` field set to the given value.
6077    pub const fn with_osla(mut self, value: u32) -> Self {
6078        self.set_osla(value);
6079        self
6080    }
6081}
6082
6083bitflags! {
6084    /// `DBGOSLSR` system register value.
6085    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6086    #[repr(transparent)]
6087    pub struct Dbgoslsr: u32 {
6088        /// `OSLK` bit.
6089        const OSLK = 1 << 1;
6090        /// `nTT` bit.
6091        const NTT = 1 << 2;
6092    }
6093}
6094
6095impl Dbgoslsr {
6096    /// Offset of the `OSLK` field.
6097    pub const OSLK_SHIFT: u32 = 1;
6098    /// Offset of the `nTT` field.
6099    pub const NTT_SHIFT: u32 = 2;
6100}
6101
6102bitflags! {
6103    /// `DBGPRCR` system register value.
6104    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6105    #[repr(transparent)]
6106    pub struct Dbgprcr: u32 {
6107        /// `CORENPDRQ` bit.
6108        const CORENPDRQ = 1 << 0;
6109    }
6110}
6111
6112impl Dbgprcr {
6113    /// Offset of the `CORENPDRQ` field.
6114    pub const CORENPDRQ_SHIFT: u32 = 0;
6115}
6116
6117bitflags! {
6118    /// `DBGVCR` system register value.
6119    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6120    #[repr(transparent)]
6121    pub struct Dbgvcr: u32 {
6122        /// `SU` bit.
6123        const SU = 1 << 1;
6124        /// `U` bit.
6125        const U = 1 << 1;
6126        /// `S` bit.
6127        const S = 1 << 2;
6128        /// `SS` bit.
6129        const SS = 1 << 2;
6130        /// `P` bit.
6131        const P = 1 << 3;
6132        /// `SP` bit.
6133        const SP = 1 << 3;
6134        /// `D` bit.
6135        const D = 1 << 4;
6136        /// `SD` bit.
6137        const SD = 1 << 4;
6138        /// `I` bit.
6139        const I = 1 << 6;
6140        /// `SI` bit.
6141        const SI = 1 << 6;
6142        /// `F` bit.
6143        const F = 1 << 7;
6144        /// `SF` bit.
6145        const SF = 1 << 7;
6146        /// `MS` bit.
6147        const MS = 1 << 10;
6148        /// `MP` bit.
6149        const MP = 1 << 11;
6150        /// `MD` bit.
6151        const MD = 1 << 12;
6152        /// `MI` bit.
6153        const MI = 1 << 14;
6154        /// `MF` bit.
6155        const MF = 1 << 15;
6156        /// `NSU` bit.
6157        const NSU = 1 << 25;
6158        /// `NSS` bit.
6159        const NSS = 1 << 26;
6160        /// `NSP` bit.
6161        const NSP = 1 << 27;
6162        /// `NSD` bit.
6163        const NSD = 1 << 28;
6164        /// `NSI` bit.
6165        const NSI = 1 << 30;
6166        /// `NSF` bit.
6167        const NSF = 1 << 31;
6168    }
6169}
6170
6171impl Dbgvcr {
6172    /// Offset of the `SU` field.
6173    pub const SU_SHIFT: u32 = 1;
6174    /// Offset of the `U` field.
6175    pub const U_SHIFT: u32 = 1;
6176    /// Offset of the `S` field.
6177    pub const S_SHIFT: u32 = 2;
6178    /// Offset of the `SS` field.
6179    pub const SS_SHIFT: u32 = 2;
6180    /// Offset of the `P` field.
6181    pub const P_SHIFT: u32 = 3;
6182    /// Offset of the `SP` field.
6183    pub const SP_SHIFT: u32 = 3;
6184    /// Offset of the `D` field.
6185    pub const D_SHIFT: u32 = 4;
6186    /// Offset of the `SD` field.
6187    pub const SD_SHIFT: u32 = 4;
6188    /// Offset of the `I` field.
6189    pub const I_SHIFT: u32 = 6;
6190    /// Offset of the `SI` field.
6191    pub const SI_SHIFT: u32 = 6;
6192    /// Offset of the `F` field.
6193    pub const F_SHIFT: u32 = 7;
6194    /// Offset of the `SF` field.
6195    pub const SF_SHIFT: u32 = 7;
6196    /// Offset of the `MS` field.
6197    pub const MS_SHIFT: u32 = 10;
6198    /// Offset of the `MP` field.
6199    pub const MP_SHIFT: u32 = 11;
6200    /// Offset of the `MD` field.
6201    pub const MD_SHIFT: u32 = 12;
6202    /// Offset of the `MI` field.
6203    pub const MI_SHIFT: u32 = 14;
6204    /// Offset of the `MF` field.
6205    pub const MF_SHIFT: u32 = 15;
6206    /// Offset of the `NSU` field.
6207    pub const NSU_SHIFT: u32 = 25;
6208    /// Offset of the `NSS` field.
6209    pub const NSS_SHIFT: u32 = 26;
6210    /// Offset of the `NSP` field.
6211    pub const NSP_SHIFT: u32 = 27;
6212    /// Offset of the `NSD` field.
6213    pub const NSD_SHIFT: u32 = 28;
6214    /// Offset of the `NSI` field.
6215    pub const NSI_SHIFT: u32 = 30;
6216    /// Offset of the `NSF` field.
6217    pub const NSF_SHIFT: u32 = 31;
6218}
6219
6220bitflags! {
6221    /// `DFAR` system register value.
6222    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6223    #[repr(transparent)]
6224    pub struct Dfar: u32 {
6225    }
6226}
6227
6228impl Dfar {
6229    /// Offset of the `VA` field.
6230    pub const VA_SHIFT: u32 = 0;
6231    /// Mask for the `VA` field.
6232    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
6233
6234    /// Returns the value of the `VA` field.
6235    pub const fn va(self) -> u32 {
6236        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
6237    }
6238
6239    /// Sets the value of the `VA` field.
6240    pub const fn set_va(&mut self, value: u32) {
6241        let offset = Self::VA_SHIFT;
6242        assert!(value & (Self::VA_MASK as u32) == value);
6243        *self = Self::from_bits_retain(
6244            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
6245        );
6246    }
6247
6248    /// Returns a copy with the `VA` field set to the given value.
6249    pub const fn with_va(mut self, value: u32) -> Self {
6250        self.set_va(value);
6251        self
6252    }
6253}
6254
6255bitflags! {
6256    /// `DFSR` system register value.
6257    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6258    #[repr(transparent)]
6259    pub struct Dfsr: u32 {
6260        /// `LPAE` bit.
6261        const LPAE = 1 << 9;
6262        /// `WnR` bit.
6263        const WNR = 1 << 11;
6264        /// `ExT` bit.
6265        const EXT = 1 << 12;
6266        /// `CM` bit.
6267        const CM = 1 << 13;
6268        /// `FnV` bit.
6269        const FNV = 1 << 16;
6270    }
6271}
6272
6273impl Dfsr {
6274    /// Offset of the `STATUS` field.
6275    pub const STATUS_SHIFT: u32 = 0;
6276    /// Mask for the `STATUS` field.
6277    pub const STATUS_MASK: u32 = 0b111111;
6278    /// Offset of the `Domain` field.
6279    pub const DOMAIN_SHIFT: u32 = 4;
6280    /// Mask for the `Domain` field.
6281    pub const DOMAIN_MASK: u32 = 0b1111;
6282    /// Offset of the `LPAE` field.
6283    pub const LPAE_SHIFT: u32 = 9;
6284    /// Offset of the `WnR` field.
6285    pub const WNR_SHIFT: u32 = 11;
6286    /// Offset of the `ExT` field.
6287    pub const EXT_SHIFT: u32 = 12;
6288    /// Offset of the `CM` field.
6289    pub const CM_SHIFT: u32 = 13;
6290    /// Offset of the `AET` field.
6291    pub const AET_SHIFT: u32 = 14;
6292    /// Mask for the `AET` field.
6293    pub const AET_MASK: u32 = 0b11;
6294    /// Offset of the `FnV` field.
6295    pub const FNV_SHIFT: u32 = 16;
6296
6297    /// Returns the value of the `STATUS` field.
6298    pub const fn status(self) -> u8 {
6299        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
6300    }
6301
6302    /// Sets the value of the `STATUS` field.
6303    pub const fn set_status(&mut self, value: u8) {
6304        let offset = Self::STATUS_SHIFT;
6305        assert!(value & (Self::STATUS_MASK as u8) == value);
6306        *self = Self::from_bits_retain(
6307            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
6308        );
6309    }
6310
6311    /// Returns a copy with the `STATUS` field set to the given value.
6312    pub const fn with_status(mut self, value: u8) -> Self {
6313        self.set_status(value);
6314        self
6315    }
6316
6317    /// Returns the value of the `Domain` field.
6318    pub const fn domain(self) -> u8 {
6319        ((self.bits() >> Self::DOMAIN_SHIFT) & 0b1111) as u8
6320    }
6321
6322    /// Sets the value of the `Domain` field.
6323    pub const fn set_domain(&mut self, value: u8) {
6324        let offset = Self::DOMAIN_SHIFT;
6325        assert!(value & (Self::DOMAIN_MASK as u8) == value);
6326        *self = Self::from_bits_retain(
6327            (self.bits() & !(Self::DOMAIN_MASK << offset)) | ((value as u32) << offset),
6328        );
6329    }
6330
6331    /// Returns a copy with the `Domain` field set to the given value.
6332    pub const fn with_domain(mut self, value: u8) -> Self {
6333        self.set_domain(value);
6334        self
6335    }
6336
6337    /// Returns the value of the `AET` field.
6338    pub const fn aet(self) -> u8 {
6339        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
6340    }
6341
6342    /// Sets the value of the `AET` field.
6343    pub const fn set_aet(&mut self, value: u8) {
6344        let offset = Self::AET_SHIFT;
6345        assert!(value & (Self::AET_MASK as u8) == value);
6346        *self = Self::from_bits_retain(
6347            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
6348        );
6349    }
6350
6351    /// Returns a copy with the `AET` field set to the given value.
6352    pub const fn with_aet(mut self, value: u8) -> Self {
6353        self.set_aet(value);
6354        self
6355    }
6356}
6357
6358bitflags! {
6359    /// `DISR` system register value.
6360    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6361    #[repr(transparent)]
6362    pub struct Disr: u32 {
6363        /// `EA` bit.
6364        const EA = 1 << 9;
6365        /// `LPAE` bit.
6366        const LPAE = 1 << 9;
6367        /// `ExT` bit.
6368        const EXT = 1 << 12;
6369        /// `A` bit.
6370        const A = 1 << 31;
6371    }
6372}
6373
6374impl Disr {
6375    /// Offset of the `DFSC` field.
6376    pub const DFSC_SHIFT: u32 = 0;
6377    /// Mask for the `DFSC` field.
6378    pub const DFSC_MASK: u32 = 0b111111;
6379    /// Offset of the `STATUS` field.
6380    pub const STATUS_SHIFT: u32 = 0;
6381    /// Mask for the `STATUS` field.
6382    pub const STATUS_MASK: u32 = 0b111111;
6383    /// Offset of the `EA` field.
6384    pub const EA_SHIFT: u32 = 9;
6385    /// Offset of the `LPAE` field.
6386    pub const LPAE_SHIFT: u32 = 9;
6387    /// Offset of the `ExT` field.
6388    pub const EXT_SHIFT: u32 = 12;
6389    /// Offset of the `A` field.
6390    pub const A_SHIFT: u32 = 31;
6391
6392    /// Returns the value of the `DFSC` field.
6393    pub const fn dfsc(self) -> u8 {
6394        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
6395    }
6396
6397    /// Sets the value of the `DFSC` field.
6398    pub const fn set_dfsc(&mut self, value: u8) {
6399        let offset = Self::DFSC_SHIFT;
6400        assert!(value & (Self::DFSC_MASK as u8) == value);
6401        *self = Self::from_bits_retain(
6402            (self.bits() & !(Self::DFSC_MASK << offset)) | ((value as u32) << offset),
6403        );
6404    }
6405
6406    /// Returns a copy with the `DFSC` field set to the given value.
6407    pub const fn with_dfsc(mut self, value: u8) -> Self {
6408        self.set_dfsc(value);
6409        self
6410    }
6411
6412    /// Returns the value of the `STATUS` field.
6413    pub const fn status(self) -> u8 {
6414        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
6415    }
6416
6417    /// Sets the value of the `STATUS` field.
6418    pub const fn set_status(&mut self, value: u8) {
6419        let offset = Self::STATUS_SHIFT;
6420        assert!(value & (Self::STATUS_MASK as u8) == value);
6421        *self = Self::from_bits_retain(
6422            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
6423        );
6424    }
6425
6426    /// Returns a copy with the `STATUS` field set to the given value.
6427    pub const fn with_status(mut self, value: u8) -> Self {
6428        self.set_status(value);
6429        self
6430    }
6431}
6432
6433#[cfg(feature = "el1")]
6434bitflags! {
6435    /// `DISR_EL1` system register value.
6436    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6437    #[repr(transparent)]
6438    pub struct DisrEl1: u64 {
6439        /// `WnR` bit.
6440        const WNR = 1 << 6;
6441        /// `WnRV` bit.
6442        const WNRV = 1 << 7;
6443        /// `EA` bit.
6444        const EA = 1 << 9;
6445        /// `IDS` bit.
6446        const IDS = 1 << 24;
6447        /// `A` bit.
6448        const A = 1 << 31;
6449    }
6450}
6451
6452#[cfg(feature = "el1")]
6453impl DisrEl1 {
6454    /// Offset of the `DFSC` field.
6455    pub const DFSC_SHIFT: u32 = 0;
6456    /// Mask for the `DFSC` field.
6457    pub const DFSC_MASK: u64 = 0b111111;
6458    /// Offset of the `WnR` field.
6459    pub const WNR_SHIFT: u32 = 6;
6460    /// Offset of the `WnRV` field.
6461    pub const WNRV_SHIFT: u32 = 7;
6462    /// Offset of the `EA` field.
6463    pub const EA_SHIFT: u32 = 9;
6464    /// Offset of the `AET` field.
6465    pub const AET_SHIFT: u32 = 10;
6466    /// Mask for the `AET` field.
6467    pub const AET_MASK: u64 = 0b111;
6468    /// Offset of the `WU` field.
6469    pub const WU_SHIFT: u32 = 16;
6470    /// Mask for the `WU` field.
6471    pub const WU_MASK: u64 = 0b11;
6472    /// Offset of the `IDS` field.
6473    pub const IDS_SHIFT: u32 = 24;
6474    /// Offset of the `A` field.
6475    pub const A_SHIFT: u32 = 31;
6476
6477    /// Returns the value of the `DFSC` field.
6478    pub const fn dfsc(self) -> u8 {
6479        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
6480    }
6481
6482    /// Sets the value of the `DFSC` field.
6483    pub const fn set_dfsc(&mut self, value: u8) {
6484        let offset = Self::DFSC_SHIFT;
6485        assert!(value & (Self::DFSC_MASK as u8) == value);
6486        *self = Self::from_bits_retain(
6487            (self.bits() & !(Self::DFSC_MASK << offset)) | ((value as u64) << offset),
6488        );
6489    }
6490
6491    /// Returns a copy with the `DFSC` field set to the given value.
6492    pub const fn with_dfsc(mut self, value: u8) -> Self {
6493        self.set_dfsc(value);
6494        self
6495    }
6496
6497    /// Returns the value of the `AET` field.
6498    pub const fn aet(self) -> u8 {
6499        ((self.bits() >> Self::AET_SHIFT) & 0b111) as u8
6500    }
6501
6502    /// Sets the value of the `AET` field.
6503    pub const fn set_aet(&mut self, value: u8) {
6504        let offset = Self::AET_SHIFT;
6505        assert!(value & (Self::AET_MASK as u8) == value);
6506        *self = Self::from_bits_retain(
6507            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
6508        );
6509    }
6510
6511    /// Returns a copy with the `AET` field set to the given value.
6512    pub const fn with_aet(mut self, value: u8) -> Self {
6513        self.set_aet(value);
6514        self
6515    }
6516
6517    /// Returns the value of the `WU` field.
6518    pub const fn wu(self) -> u8 {
6519        ((self.bits() >> Self::WU_SHIFT) & 0b11) as u8
6520    }
6521
6522    /// Sets the value of the `WU` field.
6523    pub const fn set_wu(&mut self, value: u8) {
6524        let offset = Self::WU_SHIFT;
6525        assert!(value & (Self::WU_MASK as u8) == value);
6526        *self = Self::from_bits_retain(
6527            (self.bits() & !(Self::WU_MASK << offset)) | ((value as u64) << offset),
6528        );
6529    }
6530
6531    /// Returns a copy with the `WU` field set to the given value.
6532    pub const fn with_wu(mut self, value: u8) -> Self {
6533        self.set_wu(value);
6534        self
6535    }
6536}
6537
6538bitflags! {
6539    /// `DIT` system register value.
6540    ///
6541    /// Data Independent Timing.
6542    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6543    #[repr(transparent)]
6544    pub struct Dit: u64 {
6545        /// Enable data independent timing.
6546        const DIT = 1 << 24;
6547    }
6548}
6549
6550impl Dit {
6551    /// Offset of the `DIT` field.
6552    pub const DIT_SHIFT: u32 = 24;
6553}
6554
6555bitflags! {
6556    /// `DLR` system register value.
6557    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6558    #[repr(transparent)]
6559    pub struct Dlr: u32 {
6560    }
6561}
6562
6563impl Dlr {
6564    /// Offset of the `ADDR` field.
6565    pub const ADDR_SHIFT: u32 = 0;
6566    /// Mask for the `ADDR` field.
6567    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
6568
6569    /// Returns the value of the `ADDR` field.
6570    pub const fn addr(self) -> u32 {
6571        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
6572    }
6573
6574    /// Sets the value of the `ADDR` field.
6575    pub const fn set_addr(&mut self, value: u32) {
6576        let offset = Self::ADDR_SHIFT;
6577        assert!(value & (Self::ADDR_MASK as u32) == value);
6578        *self = Self::from_bits_retain(
6579            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u32) << offset),
6580        );
6581    }
6582
6583    /// Returns a copy with the `ADDR` field set to the given value.
6584    pub const fn with_addr(mut self, value: u32) -> Self {
6585        self.set_addr(value);
6586        self
6587    }
6588}
6589
6590bitflags! {
6591    /// `DSPSR` system register value.
6592    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6593    #[repr(transparent)]
6594    pub struct Dspsr: u32 {
6595        /// `T` bit.
6596        const T = 1 << 5;
6597        /// `F` bit.
6598        const F = 1 << 6;
6599        /// `I` bit.
6600        const I = 1 << 7;
6601        /// `A` bit.
6602        const A = 1 << 8;
6603        /// `E` bit.
6604        const E = 1 << 9;
6605        /// `IL` bit.
6606        const IL = 1 << 20;
6607        /// `SS` bit.
6608        const SS = 1 << 21;
6609        /// `PAN` bit.
6610        const PAN = 1 << 22;
6611        /// `SSBS` bit.
6612        const SSBS = 1 << 23;
6613        /// `DIT` bit.
6614        const DIT = 1 << 24;
6615        /// `Q` bit.
6616        const Q = 1 << 27;
6617        /// `V` bit.
6618        const V = 1 << 28;
6619        /// `C` bit.
6620        const C = 1 << 29;
6621        /// `Z` bit.
6622        const Z = 1 << 30;
6623        /// `N` bit.
6624        const N = 1 << 31;
6625    }
6626}
6627
6628impl Dspsr {
6629    /// Offset of the `M[4:0]` field.
6630    pub const M_4_0_SHIFT: u32 = 0;
6631    /// Mask for the `M[4:0]` field.
6632    pub const M_4_0_MASK: u32 = 0b11111;
6633    /// Offset of the `T` field.
6634    pub const T_SHIFT: u32 = 5;
6635    /// Offset of the `F` field.
6636    pub const F_SHIFT: u32 = 6;
6637    /// Offset of the `I` field.
6638    pub const I_SHIFT: u32 = 7;
6639    /// Offset of the `A` field.
6640    pub const A_SHIFT: u32 = 8;
6641    /// Offset of the `E` field.
6642    pub const E_SHIFT: u32 = 9;
6643    /// Offset of the `GE` field.
6644    pub const GE_SHIFT: u32 = 16;
6645    /// Mask for the `GE` field.
6646    pub const GE_MASK: u32 = 0b1111;
6647    /// Offset of the `IL` field.
6648    pub const IL_SHIFT: u32 = 20;
6649    /// Offset of the `SS` field.
6650    pub const SS_SHIFT: u32 = 21;
6651    /// Offset of the `PAN` field.
6652    pub const PAN_SHIFT: u32 = 22;
6653    /// Offset of the `SSBS` field.
6654    pub const SSBS_SHIFT: u32 = 23;
6655    /// Offset of the `DIT` field.
6656    pub const DIT_SHIFT: u32 = 24;
6657    /// Offset of the `Q` field.
6658    pub const Q_SHIFT: u32 = 27;
6659    /// Offset of the `V` field.
6660    pub const V_SHIFT: u32 = 28;
6661    /// Offset of the `C` field.
6662    pub const C_SHIFT: u32 = 29;
6663    /// Offset of the `Z` field.
6664    pub const Z_SHIFT: u32 = 30;
6665    /// Offset of the `N` field.
6666    pub const N_SHIFT: u32 = 31;
6667
6668    /// Returns the value of the `M[4:0]` field.
6669    pub const fn m_4_0(self) -> u8 {
6670        ((self.bits() >> Self::M_4_0_SHIFT) & 0b11111) as u8
6671    }
6672
6673    /// Sets the value of the `M[4:0]` field.
6674    pub const fn set_m_4_0(&mut self, value: u8) {
6675        let offset = Self::M_4_0_SHIFT;
6676        assert!(value & (Self::M_4_0_MASK as u8) == value);
6677        *self = Self::from_bits_retain(
6678            (self.bits() & !(Self::M_4_0_MASK << offset)) | ((value as u32) << offset),
6679        );
6680    }
6681
6682    /// Returns a copy with the `M[4:0]` field set to the given value.
6683    pub const fn with_m_4_0(mut self, value: u8) -> Self {
6684        self.set_m_4_0(value);
6685        self
6686    }
6687
6688    /// Returns the value of the `GE` field.
6689    pub const fn ge(self) -> u8 {
6690        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
6691    }
6692
6693    /// Sets the value of the `GE` field.
6694    pub const fn set_ge(&mut self, value: u8) {
6695        let offset = Self::GE_SHIFT;
6696        assert!(value & (Self::GE_MASK as u8) == value);
6697        *self = Self::from_bits_retain(
6698            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u32) << offset),
6699        );
6700    }
6701
6702    /// Returns a copy with the `GE` field set to the given value.
6703    pub const fn with_ge(mut self, value: u8) -> Self {
6704        self.set_ge(value);
6705        self
6706    }
6707}
6708
6709bitflags! {
6710    /// `DSPSR2` system register value.
6711    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6712    #[repr(transparent)]
6713    pub struct Dspsr2: u32 {
6714        /// `PPEND` bit.
6715        const PPEND = 1 << 1;
6716        /// `UINJ` bit.
6717        const UINJ = 1 << 4;
6718    }
6719}
6720
6721impl Dspsr2 {
6722    /// Offset of the `PPEND` field.
6723    pub const PPEND_SHIFT: u32 = 1;
6724    /// Offset of the `UINJ` field.
6725    pub const UINJ_SHIFT: u32 = 4;
6726}
6727
6728#[cfg(feature = "el1")]
6729bitflags! {
6730    /// `ELR_EL1` system register value.
6731    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6732    #[repr(transparent)]
6733    pub struct ElrEl1: u64 {
6734    }
6735}
6736
6737#[cfg(feature = "el1")]
6738impl ElrEl1 {
6739    /// Offset of the `ADDR` field.
6740    pub const ADDR_SHIFT: u32 = 0;
6741    /// Mask for the `ADDR` field.
6742    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
6743
6744    /// Returns the value of the `ADDR` field.
6745    pub const fn addr(self) -> u64 {
6746        ((self.bits() >> Self::ADDR_SHIFT)
6747            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
6748    }
6749
6750    /// Sets the value of the `ADDR` field.
6751    pub const fn set_addr(&mut self, value: u64) {
6752        let offset = Self::ADDR_SHIFT;
6753        assert!(value & (Self::ADDR_MASK as u64) == value);
6754        *self = Self::from_bits_retain(
6755            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u64) << offset),
6756        );
6757    }
6758
6759    /// Returns a copy with the `ADDR` field set to the given value.
6760    pub const fn with_addr(mut self, value: u64) -> Self {
6761        self.set_addr(value);
6762        self
6763    }
6764}
6765
6766#[cfg(feature = "el2")]
6767bitflags! {
6768    /// `ELR_EL2` system register value.
6769    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6770    #[repr(transparent)]
6771    pub struct ElrEl2: u64 {
6772    }
6773}
6774
6775#[cfg(feature = "el2")]
6776impl ElrEl2 {
6777    /// Offset of the `ADDR` field.
6778    pub const ADDR_SHIFT: u32 = 0;
6779    /// Mask for the `ADDR` field.
6780    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
6781
6782    /// Returns the value of the `ADDR` field.
6783    pub const fn addr(self) -> u64 {
6784        ((self.bits() >> Self::ADDR_SHIFT)
6785            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
6786    }
6787
6788    /// Sets the value of the `ADDR` field.
6789    pub const fn set_addr(&mut self, value: u64) {
6790        let offset = Self::ADDR_SHIFT;
6791        assert!(value & (Self::ADDR_MASK as u64) == value);
6792        *self = Self::from_bits_retain(
6793            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u64) << offset),
6794        );
6795    }
6796
6797    /// Returns a copy with the `ADDR` field set to the given value.
6798    pub const fn with_addr(mut self, value: u64) -> Self {
6799        self.set_addr(value);
6800        self
6801    }
6802}
6803
6804#[cfg(feature = "el2")]
6805bitflags! {
6806    /// `ELR_hyp` system register value.
6807    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6808    #[repr(transparent)]
6809    pub struct ElrHyp: u32 {
6810    }
6811}
6812
6813#[cfg(feature = "el2")]
6814impl ElrHyp {
6815    /// Offset of the `ADDR` field.
6816    pub const ADDR_SHIFT: u32 = 0;
6817    /// Mask for the `ADDR` field.
6818    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
6819
6820    /// Returns the value of the `ADDR` field.
6821    pub const fn addr(self) -> u32 {
6822        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
6823    }
6824
6825    /// Sets the value of the `ADDR` field.
6826    pub const fn set_addr(&mut self, value: u32) {
6827        let offset = Self::ADDR_SHIFT;
6828        assert!(value & (Self::ADDR_MASK as u32) == value);
6829        *self = Self::from_bits_retain(
6830            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u32) << offset),
6831        );
6832    }
6833
6834    /// Returns a copy with the `ADDR` field set to the given value.
6835    pub const fn with_addr(mut self, value: u32) -> Self {
6836        self.set_addr(value);
6837        self
6838    }
6839}
6840
6841bitflags! {
6842    /// `ERRIDR` system register value.
6843    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6844    #[repr(transparent)]
6845    pub struct Erridr: u32 {
6846    }
6847}
6848
6849impl Erridr {
6850    /// Offset of the `NUM` field.
6851    pub const NUM_SHIFT: u32 = 0;
6852    /// Mask for the `NUM` field.
6853    pub const NUM_MASK: u32 = 0b1111111111111111;
6854
6855    /// Returns the value of the `NUM` field.
6856    pub const fn num(self) -> u16 {
6857        ((self.bits() >> Self::NUM_SHIFT) & 0b1111111111111111) as u16
6858    }
6859
6860    /// Sets the value of the `NUM` field.
6861    pub const fn set_num(&mut self, value: u16) {
6862        let offset = Self::NUM_SHIFT;
6863        assert!(value & (Self::NUM_MASK as u16) == value);
6864        *self = Self::from_bits_retain(
6865            (self.bits() & !(Self::NUM_MASK << offset)) | ((value as u32) << offset),
6866        );
6867    }
6868
6869    /// Returns a copy with the `NUM` field set to the given value.
6870    pub const fn with_num(mut self, value: u16) -> Self {
6871        self.set_num(value);
6872        self
6873    }
6874}
6875
6876bitflags! {
6877    /// `ERRSELR` system register value.
6878    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6879    #[repr(transparent)]
6880    pub struct Errselr: u32 {
6881    }
6882}
6883
6884impl Errselr {
6885    /// Offset of the `SEL` field.
6886    pub const SEL_SHIFT: u32 = 0;
6887    /// Mask for the `SEL` field.
6888    pub const SEL_MASK: u32 = 0b1111111111111111;
6889
6890    /// Returns the value of the `SEL` field.
6891    pub const fn sel(self) -> u16 {
6892        ((self.bits() >> Self::SEL_SHIFT) & 0b1111111111111111) as u16
6893    }
6894
6895    /// Sets the value of the `SEL` field.
6896    pub const fn set_sel(&mut self, value: u16) {
6897        let offset = Self::SEL_SHIFT;
6898        assert!(value & (Self::SEL_MASK as u16) == value);
6899        *self = Self::from_bits_retain(
6900            (self.bits() & !(Self::SEL_MASK << offset)) | ((value as u32) << offset),
6901        );
6902    }
6903
6904    /// Returns a copy with the `SEL` field set to the given value.
6905    pub const fn with_sel(mut self, value: u16) -> Self {
6906        self.set_sel(value);
6907        self
6908    }
6909}
6910
6911bitflags! {
6912    /// `ERXADDR` system register value.
6913    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6914    #[repr(transparent)]
6915    pub struct Erxaddr: u32 {
6916    }
6917}
6918
6919impl Erxaddr {
6920    /// Offset of the `ERRnADDRlo` field.
6921    pub const ERRNADDRLO_SHIFT: u32 = 0;
6922    /// Mask for the `ERRnADDRlo` field.
6923    pub const ERRNADDRLO_MASK: u32 = 0b11111111111111111111111111111111;
6924
6925    /// Returns the value of the `ERRnADDRlo` field.
6926    pub const fn errnaddrlo(self) -> u32 {
6927        ((self.bits() >> Self::ERRNADDRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
6928    }
6929
6930    /// Sets the value of the `ERRnADDRlo` field.
6931    pub const fn set_errnaddrlo(&mut self, value: u32) {
6932        let offset = Self::ERRNADDRLO_SHIFT;
6933        assert!(value & (Self::ERRNADDRLO_MASK as u32) == value);
6934        *self = Self::from_bits_retain(
6935            (self.bits() & !(Self::ERRNADDRLO_MASK << offset)) | ((value as u32) << offset),
6936        );
6937    }
6938
6939    /// Returns a copy with the `ERRnADDRlo` field set to the given value.
6940    pub const fn with_errnaddrlo(mut self, value: u32) -> Self {
6941        self.set_errnaddrlo(value);
6942        self
6943    }
6944}
6945
6946bitflags! {
6947    /// `ERXADDR2` system register value.
6948    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6949    #[repr(transparent)]
6950    pub struct Erxaddr2: u32 {
6951    }
6952}
6953
6954impl Erxaddr2 {
6955    /// Offset of the `ERRnADDRhi` field.
6956    pub const ERRNADDRHI_SHIFT: u32 = 0;
6957    /// Mask for the `ERRnADDRhi` field.
6958    pub const ERRNADDRHI_MASK: u32 = 0b11111111111111111111111111111111;
6959
6960    /// Returns the value of the `ERRnADDRhi` field.
6961    pub const fn errnaddrhi(self) -> u32 {
6962        ((self.bits() >> Self::ERRNADDRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
6963    }
6964
6965    /// Sets the value of the `ERRnADDRhi` field.
6966    pub const fn set_errnaddrhi(&mut self, value: u32) {
6967        let offset = Self::ERRNADDRHI_SHIFT;
6968        assert!(value & (Self::ERRNADDRHI_MASK as u32) == value);
6969        *self = Self::from_bits_retain(
6970            (self.bits() & !(Self::ERRNADDRHI_MASK << offset)) | ((value as u32) << offset),
6971        );
6972    }
6973
6974    /// Returns a copy with the `ERRnADDRhi` field set to the given value.
6975    pub const fn with_errnaddrhi(mut self, value: u32) -> Self {
6976        self.set_errnaddrhi(value);
6977        self
6978    }
6979}
6980
6981bitflags! {
6982    /// `ERXCTLR` system register value.
6983    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6984    #[repr(transparent)]
6985    pub struct Erxctlr: u32 {
6986    }
6987}
6988
6989impl Erxctlr {
6990    /// Offset of the `ERRnCTLRlo` field.
6991    pub const ERRNCTLRLO_SHIFT: u32 = 0;
6992    /// Mask for the `ERRnCTLRlo` field.
6993    pub const ERRNCTLRLO_MASK: u32 = 0b11111111111111111111111111111111;
6994
6995    /// Returns the value of the `ERRnCTLRlo` field.
6996    pub const fn errnctlrlo(self) -> u32 {
6997        ((self.bits() >> Self::ERRNCTLRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
6998    }
6999
7000    /// Sets the value of the `ERRnCTLRlo` field.
7001    pub const fn set_errnctlrlo(&mut self, value: u32) {
7002        let offset = Self::ERRNCTLRLO_SHIFT;
7003        assert!(value & (Self::ERRNCTLRLO_MASK as u32) == value);
7004        *self = Self::from_bits_retain(
7005            (self.bits() & !(Self::ERRNCTLRLO_MASK << offset)) | ((value as u32) << offset),
7006        );
7007    }
7008
7009    /// Returns a copy with the `ERRnCTLRlo` field set to the given value.
7010    pub const fn with_errnctlrlo(mut self, value: u32) -> Self {
7011        self.set_errnctlrlo(value);
7012        self
7013    }
7014}
7015
7016bitflags! {
7017    /// `ERXCTLR2` system register value.
7018    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7019    #[repr(transparent)]
7020    pub struct Erxctlr2: u32 {
7021    }
7022}
7023
7024impl Erxctlr2 {
7025    /// Offset of the `ERRnCTLRhi` field.
7026    pub const ERRNCTLRHI_SHIFT: u32 = 0;
7027    /// Mask for the `ERRnCTLRhi` field.
7028    pub const ERRNCTLRHI_MASK: u32 = 0b11111111111111111111111111111111;
7029
7030    /// Returns the value of the `ERRnCTLRhi` field.
7031    pub const fn errnctlrhi(self) -> u32 {
7032        ((self.bits() >> Self::ERRNCTLRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
7033    }
7034
7035    /// Sets the value of the `ERRnCTLRhi` field.
7036    pub const fn set_errnctlrhi(&mut self, value: u32) {
7037        let offset = Self::ERRNCTLRHI_SHIFT;
7038        assert!(value & (Self::ERRNCTLRHI_MASK as u32) == value);
7039        *self = Self::from_bits_retain(
7040            (self.bits() & !(Self::ERRNCTLRHI_MASK << offset)) | ((value as u32) << offset),
7041        );
7042    }
7043
7044    /// Returns a copy with the `ERRnCTLRhi` field set to the given value.
7045    pub const fn with_errnctlrhi(mut self, value: u32) -> Self {
7046        self.set_errnctlrhi(value);
7047        self
7048    }
7049}
7050
7051bitflags! {
7052    /// `ERXFR` system register value.
7053    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7054    #[repr(transparent)]
7055    pub struct Erxfr: u32 {
7056    }
7057}
7058
7059impl Erxfr {
7060    /// Offset of the `ERRnFRlo` field.
7061    pub const ERRNFRLO_SHIFT: u32 = 0;
7062    /// Mask for the `ERRnFRlo` field.
7063    pub const ERRNFRLO_MASK: u32 = 0b11111111111111111111111111111111;
7064
7065    /// Returns the value of the `ERRnFRlo` field.
7066    pub const fn errnfrlo(self) -> u32 {
7067        ((self.bits() >> Self::ERRNFRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
7068    }
7069
7070    /// Sets the value of the `ERRnFRlo` field.
7071    pub const fn set_errnfrlo(&mut self, value: u32) {
7072        let offset = Self::ERRNFRLO_SHIFT;
7073        assert!(value & (Self::ERRNFRLO_MASK as u32) == value);
7074        *self = Self::from_bits_retain(
7075            (self.bits() & !(Self::ERRNFRLO_MASK << offset)) | ((value as u32) << offset),
7076        );
7077    }
7078
7079    /// Returns a copy with the `ERRnFRlo` field set to the given value.
7080    pub const fn with_errnfrlo(mut self, value: u32) -> Self {
7081        self.set_errnfrlo(value);
7082        self
7083    }
7084}
7085
7086bitflags! {
7087    /// `ERXFR2` system register value.
7088    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7089    #[repr(transparent)]
7090    pub struct Erxfr2: u32 {
7091    }
7092}
7093
7094impl Erxfr2 {
7095    /// Offset of the `ERRnFRhi` field.
7096    pub const ERRNFRHI_SHIFT: u32 = 0;
7097    /// Mask for the `ERRnFRhi` field.
7098    pub const ERRNFRHI_MASK: u32 = 0b11111111111111111111111111111111;
7099
7100    /// Returns the value of the `ERRnFRhi` field.
7101    pub const fn errnfrhi(self) -> u32 {
7102        ((self.bits() >> Self::ERRNFRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
7103    }
7104
7105    /// Sets the value of the `ERRnFRhi` field.
7106    pub const fn set_errnfrhi(&mut self, value: u32) {
7107        let offset = Self::ERRNFRHI_SHIFT;
7108        assert!(value & (Self::ERRNFRHI_MASK as u32) == value);
7109        *self = Self::from_bits_retain(
7110            (self.bits() & !(Self::ERRNFRHI_MASK << offset)) | ((value as u32) << offset),
7111        );
7112    }
7113
7114    /// Returns a copy with the `ERRnFRhi` field set to the given value.
7115    pub const fn with_errnfrhi(mut self, value: u32) -> Self {
7116        self.set_errnfrhi(value);
7117        self
7118    }
7119}
7120
7121bitflags! {
7122    /// `ERXMISC0` system register value.
7123    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7124    #[repr(transparent)]
7125    pub struct Erxmisc0: u32 {
7126    }
7127}
7128
7129impl Erxmisc0 {
7130    /// Offset of the `ERRnMISC0lo` field.
7131    pub const ERRNMISC0LO_SHIFT: u32 = 0;
7132    /// Mask for the `ERRnMISC0lo` field.
7133    pub const ERRNMISC0LO_MASK: u32 = 0b11111111111111111111111111111111;
7134
7135    /// Returns the value of the `ERRnMISC0lo` field.
7136    pub const fn errnmisc0lo(self) -> u32 {
7137        ((self.bits() >> Self::ERRNMISC0LO_SHIFT) & 0b11111111111111111111111111111111) as u32
7138    }
7139
7140    /// Sets the value of the `ERRnMISC0lo` field.
7141    pub const fn set_errnmisc0lo(&mut self, value: u32) {
7142        let offset = Self::ERRNMISC0LO_SHIFT;
7143        assert!(value & (Self::ERRNMISC0LO_MASK as u32) == value);
7144        *self = Self::from_bits_retain(
7145            (self.bits() & !(Self::ERRNMISC0LO_MASK << offset)) | ((value as u32) << offset),
7146        );
7147    }
7148
7149    /// Returns a copy with the `ERRnMISC0lo` field set to the given value.
7150    pub const fn with_errnmisc0lo(mut self, value: u32) -> Self {
7151        self.set_errnmisc0lo(value);
7152        self
7153    }
7154}
7155
7156bitflags! {
7157    /// `ERXMISC1` system register value.
7158    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7159    #[repr(transparent)]
7160    pub struct Erxmisc1: u32 {
7161    }
7162}
7163
7164impl Erxmisc1 {
7165    /// Offset of the `ERRnMISC0hi` field.
7166    pub const ERRNMISC0HI_SHIFT: u32 = 0;
7167    /// Mask for the `ERRnMISC0hi` field.
7168    pub const ERRNMISC0HI_MASK: u32 = 0b11111111111111111111111111111111;
7169
7170    /// Returns the value of the `ERRnMISC0hi` field.
7171    pub const fn errnmisc0hi(self) -> u32 {
7172        ((self.bits() >> Self::ERRNMISC0HI_SHIFT) & 0b11111111111111111111111111111111) as u32
7173    }
7174
7175    /// Sets the value of the `ERRnMISC0hi` field.
7176    pub const fn set_errnmisc0hi(&mut self, value: u32) {
7177        let offset = Self::ERRNMISC0HI_SHIFT;
7178        assert!(value & (Self::ERRNMISC0HI_MASK as u32) == value);
7179        *self = Self::from_bits_retain(
7180            (self.bits() & !(Self::ERRNMISC0HI_MASK << offset)) | ((value as u32) << offset),
7181        );
7182    }
7183
7184    /// Returns a copy with the `ERRnMISC0hi` field set to the given value.
7185    pub const fn with_errnmisc0hi(mut self, value: u32) -> Self {
7186        self.set_errnmisc0hi(value);
7187        self
7188    }
7189}
7190
7191bitflags! {
7192    /// `ERXMISC2` system register value.
7193    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7194    #[repr(transparent)]
7195    pub struct Erxmisc2: u32 {
7196    }
7197}
7198
7199impl Erxmisc2 {
7200    /// Offset of the `ERRnMISC1lo` field.
7201    pub const ERRNMISC1LO_SHIFT: u32 = 0;
7202    /// Mask for the `ERRnMISC1lo` field.
7203    pub const ERRNMISC1LO_MASK: u32 = 0b11111111111111111111111111111111;
7204
7205    /// Returns the value of the `ERRnMISC1lo` field.
7206    pub const fn errnmisc1lo(self) -> u32 {
7207        ((self.bits() >> Self::ERRNMISC1LO_SHIFT) & 0b11111111111111111111111111111111) as u32
7208    }
7209
7210    /// Sets the value of the `ERRnMISC1lo` field.
7211    pub const fn set_errnmisc1lo(&mut self, value: u32) {
7212        let offset = Self::ERRNMISC1LO_SHIFT;
7213        assert!(value & (Self::ERRNMISC1LO_MASK as u32) == value);
7214        *self = Self::from_bits_retain(
7215            (self.bits() & !(Self::ERRNMISC1LO_MASK << offset)) | ((value as u32) << offset),
7216        );
7217    }
7218
7219    /// Returns a copy with the `ERRnMISC1lo` field set to the given value.
7220    pub const fn with_errnmisc1lo(mut self, value: u32) -> Self {
7221        self.set_errnmisc1lo(value);
7222        self
7223    }
7224}
7225
7226bitflags! {
7227    /// `ERXMISC3` system register value.
7228    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7229    #[repr(transparent)]
7230    pub struct Erxmisc3: u32 {
7231    }
7232}
7233
7234impl Erxmisc3 {
7235    /// Offset of the `ERRnMISC1hi` field.
7236    pub const ERRNMISC1HI_SHIFT: u32 = 0;
7237    /// Mask for the `ERRnMISC1hi` field.
7238    pub const ERRNMISC1HI_MASK: u32 = 0b11111111111111111111111111111111;
7239
7240    /// Returns the value of the `ERRnMISC1hi` field.
7241    pub const fn errnmisc1hi(self) -> u32 {
7242        ((self.bits() >> Self::ERRNMISC1HI_SHIFT) & 0b11111111111111111111111111111111) as u32
7243    }
7244
7245    /// Sets the value of the `ERRnMISC1hi` field.
7246    pub const fn set_errnmisc1hi(&mut self, value: u32) {
7247        let offset = Self::ERRNMISC1HI_SHIFT;
7248        assert!(value & (Self::ERRNMISC1HI_MASK as u32) == value);
7249        *self = Self::from_bits_retain(
7250            (self.bits() & !(Self::ERRNMISC1HI_MASK << offset)) | ((value as u32) << offset),
7251        );
7252    }
7253
7254    /// Returns a copy with the `ERRnMISC1hi` field set to the given value.
7255    pub const fn with_errnmisc1hi(mut self, value: u32) -> Self {
7256        self.set_errnmisc1hi(value);
7257        self
7258    }
7259}
7260
7261bitflags! {
7262    /// `ERXMISC4` system register value.
7263    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7264    #[repr(transparent)]
7265    pub struct Erxmisc4: u32 {
7266    }
7267}
7268
7269impl Erxmisc4 {
7270    /// Offset of the `ERRnMISC2lo` field.
7271    pub const ERRNMISC2LO_SHIFT: u32 = 0;
7272    /// Mask for the `ERRnMISC2lo` field.
7273    pub const ERRNMISC2LO_MASK: u32 = 0b11111111111111111111111111111111;
7274
7275    /// Returns the value of the `ERRnMISC2lo` field.
7276    pub const fn errnmisc2lo(self) -> u32 {
7277        ((self.bits() >> Self::ERRNMISC2LO_SHIFT) & 0b11111111111111111111111111111111) as u32
7278    }
7279
7280    /// Sets the value of the `ERRnMISC2lo` field.
7281    pub const fn set_errnmisc2lo(&mut self, value: u32) {
7282        let offset = Self::ERRNMISC2LO_SHIFT;
7283        assert!(value & (Self::ERRNMISC2LO_MASK as u32) == value);
7284        *self = Self::from_bits_retain(
7285            (self.bits() & !(Self::ERRNMISC2LO_MASK << offset)) | ((value as u32) << offset),
7286        );
7287    }
7288
7289    /// Returns a copy with the `ERRnMISC2lo` field set to the given value.
7290    pub const fn with_errnmisc2lo(mut self, value: u32) -> Self {
7291        self.set_errnmisc2lo(value);
7292        self
7293    }
7294}
7295
7296bitflags! {
7297    /// `ERXMISC5` system register value.
7298    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7299    #[repr(transparent)]
7300    pub struct Erxmisc5: u32 {
7301    }
7302}
7303
7304impl Erxmisc5 {
7305    /// Offset of the `ERRnMISC2hi` field.
7306    pub const ERRNMISC2HI_SHIFT: u32 = 0;
7307    /// Mask for the `ERRnMISC2hi` field.
7308    pub const ERRNMISC2HI_MASK: u32 = 0b11111111111111111111111111111111;
7309
7310    /// Returns the value of the `ERRnMISC2hi` field.
7311    pub const fn errnmisc2hi(self) -> u32 {
7312        ((self.bits() >> Self::ERRNMISC2HI_SHIFT) & 0b11111111111111111111111111111111) as u32
7313    }
7314
7315    /// Sets the value of the `ERRnMISC2hi` field.
7316    pub const fn set_errnmisc2hi(&mut self, value: u32) {
7317        let offset = Self::ERRNMISC2HI_SHIFT;
7318        assert!(value & (Self::ERRNMISC2HI_MASK as u32) == value);
7319        *self = Self::from_bits_retain(
7320            (self.bits() & !(Self::ERRNMISC2HI_MASK << offset)) | ((value as u32) << offset),
7321        );
7322    }
7323
7324    /// Returns a copy with the `ERRnMISC2hi` field set to the given value.
7325    pub const fn with_errnmisc2hi(mut self, value: u32) -> Self {
7326        self.set_errnmisc2hi(value);
7327        self
7328    }
7329}
7330
7331bitflags! {
7332    /// `ERXMISC6` system register value.
7333    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7334    #[repr(transparent)]
7335    pub struct Erxmisc6: u32 {
7336    }
7337}
7338
7339impl Erxmisc6 {
7340    /// Offset of the `ERRnMISC3lo` field.
7341    pub const ERRNMISC3LO_SHIFT: u32 = 0;
7342    /// Mask for the `ERRnMISC3lo` field.
7343    pub const ERRNMISC3LO_MASK: u32 = 0b11111111111111111111111111111111;
7344
7345    /// Returns the value of the `ERRnMISC3lo` field.
7346    pub const fn errnmisc3lo(self) -> u32 {
7347        ((self.bits() >> Self::ERRNMISC3LO_SHIFT) & 0b11111111111111111111111111111111) as u32
7348    }
7349
7350    /// Sets the value of the `ERRnMISC3lo` field.
7351    pub const fn set_errnmisc3lo(&mut self, value: u32) {
7352        let offset = Self::ERRNMISC3LO_SHIFT;
7353        assert!(value & (Self::ERRNMISC3LO_MASK as u32) == value);
7354        *self = Self::from_bits_retain(
7355            (self.bits() & !(Self::ERRNMISC3LO_MASK << offset)) | ((value as u32) << offset),
7356        );
7357    }
7358
7359    /// Returns a copy with the `ERRnMISC3lo` field set to the given value.
7360    pub const fn with_errnmisc3lo(mut self, value: u32) -> Self {
7361        self.set_errnmisc3lo(value);
7362        self
7363    }
7364}
7365
7366bitflags! {
7367    /// `ERXMISC7` system register value.
7368    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7369    #[repr(transparent)]
7370    pub struct Erxmisc7: u32 {
7371    }
7372}
7373
7374impl Erxmisc7 {
7375    /// Offset of the `ERRnMISC3hi` field.
7376    pub const ERRNMISC3HI_SHIFT: u32 = 0;
7377    /// Mask for the `ERRnMISC3hi` field.
7378    pub const ERRNMISC3HI_MASK: u32 = 0b11111111111111111111111111111111;
7379
7380    /// Returns the value of the `ERRnMISC3hi` field.
7381    pub const fn errnmisc3hi(self) -> u32 {
7382        ((self.bits() >> Self::ERRNMISC3HI_SHIFT) & 0b11111111111111111111111111111111) as u32
7383    }
7384
7385    /// Sets the value of the `ERRnMISC3hi` field.
7386    pub const fn set_errnmisc3hi(&mut self, value: u32) {
7387        let offset = Self::ERRNMISC3HI_SHIFT;
7388        assert!(value & (Self::ERRNMISC3HI_MASK as u32) == value);
7389        *self = Self::from_bits_retain(
7390            (self.bits() & !(Self::ERRNMISC3HI_MASK << offset)) | ((value as u32) << offset),
7391        );
7392    }
7393
7394    /// Returns a copy with the `ERRnMISC3hi` field set to the given value.
7395    pub const fn with_errnmisc3hi(mut self, value: u32) -> Self {
7396        self.set_errnmisc3hi(value);
7397        self
7398    }
7399}
7400
7401bitflags! {
7402    /// `ERXSTATUS` system register value.
7403    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7404    #[repr(transparent)]
7405    pub struct Erxstatus: u32 {
7406    }
7407}
7408
7409impl Erxstatus {
7410    /// Offset of the `ERRnSTATUSlo` field.
7411    pub const ERRNSTATUSLO_SHIFT: u32 = 0;
7412    /// Mask for the `ERRnSTATUSlo` field.
7413    pub const ERRNSTATUSLO_MASK: u32 = 0b11111111111111111111111111111111;
7414
7415    /// Returns the value of the `ERRnSTATUSlo` field.
7416    pub const fn errnstatuslo(self) -> u32 {
7417        ((self.bits() >> Self::ERRNSTATUSLO_SHIFT) & 0b11111111111111111111111111111111) as u32
7418    }
7419
7420    /// Sets the value of the `ERRnSTATUSlo` field.
7421    pub const fn set_errnstatuslo(&mut self, value: u32) {
7422        let offset = Self::ERRNSTATUSLO_SHIFT;
7423        assert!(value & (Self::ERRNSTATUSLO_MASK as u32) == value);
7424        *self = Self::from_bits_retain(
7425            (self.bits() & !(Self::ERRNSTATUSLO_MASK << offset)) | ((value as u32) << offset),
7426        );
7427    }
7428
7429    /// Returns a copy with the `ERRnSTATUSlo` field set to the given value.
7430    pub const fn with_errnstatuslo(mut self, value: u32) -> Self {
7431        self.set_errnstatuslo(value);
7432        self
7433    }
7434}
7435
7436#[cfg(feature = "el1")]
7437bitflags! {
7438    /// `ESR_EL1` system register value.
7439    #[derive(Clone, Copy, Eq, Default, PartialEq)]
7440    #[repr(transparent)]
7441    pub struct EsrEl1: u64 {
7442        /// `IL` bit.
7443        const IL = 1 << 25;
7444    }
7445}
7446
7447#[cfg(feature = "el1")]
7448impl EsrEl1 {
7449    /// Offset of the `ISS` field.
7450    pub const ISS_SHIFT: u32 = 0;
7451    /// Mask for the `ISS` field.
7452    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
7453    /// Offset of the `IL` field.
7454    pub const IL_SHIFT: u32 = 25;
7455    /// Offset of the `EC` field.
7456    pub const EC_SHIFT: u32 = 26;
7457    /// Mask for the `EC` field.
7458    pub const EC_MASK: u64 = 0b111111;
7459    /// Offset of the `ISS2` field.
7460    pub const ISS2_SHIFT: u32 = 32;
7461    /// Mask for the `ISS2` field.
7462    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
7463
7464    /// Returns the value of the `ISS` field.
7465    pub const fn iss(self) -> u32 {
7466        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
7467    }
7468
7469    /// Sets the value of the `ISS` field.
7470    pub const fn set_iss(&mut self, value: u32) {
7471        let offset = Self::ISS_SHIFT;
7472        assert!(value & (Self::ISS_MASK as u32) == value);
7473        *self = Self::from_bits_retain(
7474            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
7475        );
7476    }
7477
7478    /// Returns a copy with the `ISS` field set to the given value.
7479    pub const fn with_iss(mut self, value: u32) -> Self {
7480        self.set_iss(value);
7481        self
7482    }
7483
7484    /// Returns the value of the `EC` field.
7485    pub const fn ec(self) -> u8 {
7486        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
7487    }
7488
7489    /// Sets the value of the `EC` field.
7490    pub const fn set_ec(&mut self, value: u8) {
7491        let offset = Self::EC_SHIFT;
7492        assert!(value & (Self::EC_MASK as u8) == value);
7493        *self = Self::from_bits_retain(
7494            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
7495        );
7496    }
7497
7498    /// Returns a copy with the `EC` field set to the given value.
7499    pub const fn with_ec(mut self, value: u8) -> Self {
7500        self.set_ec(value);
7501        self
7502    }
7503
7504    /// Returns the value of the `ISS2` field.
7505    pub const fn iss2(self) -> u32 {
7506        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
7507    }
7508
7509    /// Sets the value of the `ISS2` field.
7510    pub const fn set_iss2(&mut self, value: u32) {
7511        let offset = Self::ISS2_SHIFT;
7512        assert!(value & (Self::ISS2_MASK as u32) == value);
7513        *self = Self::from_bits_retain(
7514            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
7515        );
7516    }
7517
7518    /// Returns a copy with the `ISS2` field set to the given value.
7519    pub const fn with_iss2(mut self, value: u32) -> Self {
7520        self.set_iss2(value);
7521        self
7522    }
7523}
7524
7525#[cfg(feature = "el2")]
7526bitflags! {
7527    /// `ESR_EL2` system register value.
7528    #[derive(Clone, Copy, Eq, Default, PartialEq)]
7529    #[repr(transparent)]
7530    pub struct EsrEl2: u64 {
7531        /// 32-bit instruction length.
7532        const IL = 1 << 25;
7533    }
7534}
7535
7536#[cfg(feature = "el2")]
7537impl EsrEl2 {
7538    /// Offset of the `ISS` field.
7539    pub const ISS_SHIFT: u32 = 0;
7540    /// Mask for the `ISS` field.
7541    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
7542    /// Offset of the `IL` field.
7543    pub const IL_SHIFT: u32 = 25;
7544    /// Offset of the `EC` field.
7545    pub const EC_SHIFT: u32 = 26;
7546    /// Mask for the `EC` field.
7547    pub const EC_MASK: u64 = 0b111111;
7548    /// Offset of the `ISS2` field.
7549    pub const ISS2_SHIFT: u32 = 32;
7550    /// Mask for the `ISS2` field.
7551    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
7552
7553    /// Returns the value of the `ISS` field.
7554    pub const fn iss(self) -> u32 {
7555        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
7556    }
7557
7558    /// Sets the value of the `ISS` field.
7559    pub const fn set_iss(&mut self, value: u32) {
7560        let offset = Self::ISS_SHIFT;
7561        assert!(value & (Self::ISS_MASK as u32) == value);
7562        *self = Self::from_bits_retain(
7563            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
7564        );
7565    }
7566
7567    /// Returns a copy with the `ISS` field set to the given value.
7568    pub const fn with_iss(mut self, value: u32) -> Self {
7569        self.set_iss(value);
7570        self
7571    }
7572
7573    /// Returns the value of the `EC` field.
7574    pub const fn ec(self) -> u8 {
7575        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
7576    }
7577
7578    /// Sets the value of the `EC` field.
7579    pub const fn set_ec(&mut self, value: u8) {
7580        let offset = Self::EC_SHIFT;
7581        assert!(value & (Self::EC_MASK as u8) == value);
7582        *self = Self::from_bits_retain(
7583            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
7584        );
7585    }
7586
7587    /// Returns a copy with the `EC` field set to the given value.
7588    pub const fn with_ec(mut self, value: u8) -> Self {
7589        self.set_ec(value);
7590        self
7591    }
7592
7593    /// Returns the value of the `ISS2` field.
7594    pub const fn iss2(self) -> u32 {
7595        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
7596    }
7597
7598    /// Sets the value of the `ISS2` field.
7599    pub const fn set_iss2(&mut self, value: u32) {
7600        let offset = Self::ISS2_SHIFT;
7601        assert!(value & (Self::ISS2_MASK as u32) == value);
7602        *self = Self::from_bits_retain(
7603            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
7604        );
7605    }
7606
7607    /// Returns a copy with the `ISS2` field set to the given value.
7608    pub const fn with_iss2(mut self, value: u32) -> Self {
7609        self.set_iss2(value);
7610        self
7611    }
7612}
7613
7614#[cfg(feature = "el3")]
7615bitflags! {
7616    /// `ESR_EL3` system register value.
7617    #[derive(Clone, Copy, Eq, Default, PartialEq)]
7618    #[repr(transparent)]
7619    pub struct EsrEl3: u64 {
7620        /// 32-bit instruction length.
7621        const IL = 1 << 25;
7622    }
7623}
7624
7625#[cfg(feature = "el3")]
7626impl EsrEl3 {
7627    /// Offset of the `ISS` field.
7628    pub const ISS_SHIFT: u32 = 0;
7629    /// Mask for the `ISS` field.
7630    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
7631    /// Offset of the `IL` field.
7632    pub const IL_SHIFT: u32 = 25;
7633    /// Offset of the `EC` field.
7634    pub const EC_SHIFT: u32 = 26;
7635    /// Mask for the `EC` field.
7636    pub const EC_MASK: u64 = 0b111111;
7637    /// Offset of the `ISS2` field.
7638    pub const ISS2_SHIFT: u32 = 32;
7639    /// Mask for the `ISS2` field.
7640    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
7641
7642    /// Returns the value of the `ISS` field.
7643    pub const fn iss(self) -> u32 {
7644        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
7645    }
7646
7647    /// Sets the value of the `ISS` field.
7648    pub const fn set_iss(&mut self, value: u32) {
7649        let offset = Self::ISS_SHIFT;
7650        assert!(value & (Self::ISS_MASK as u32) == value);
7651        *self = Self::from_bits_retain(
7652            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
7653        );
7654    }
7655
7656    /// Returns a copy with the `ISS` field set to the given value.
7657    pub const fn with_iss(mut self, value: u32) -> Self {
7658        self.set_iss(value);
7659        self
7660    }
7661
7662    /// Returns the value of the `EC` field.
7663    pub const fn ec(self) -> u8 {
7664        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
7665    }
7666
7667    /// Sets the value of the `EC` field.
7668    pub const fn set_ec(&mut self, value: u8) {
7669        let offset = Self::EC_SHIFT;
7670        assert!(value & (Self::EC_MASK as u8) == value);
7671        *self = Self::from_bits_retain(
7672            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
7673        );
7674    }
7675
7676    /// Returns a copy with the `EC` field set to the given value.
7677    pub const fn with_ec(mut self, value: u8) -> Self {
7678        self.set_ec(value);
7679        self
7680    }
7681
7682    /// Returns the value of the `ISS2` field.
7683    pub const fn iss2(self) -> u32 {
7684        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
7685    }
7686
7687    /// Sets the value of the `ISS2` field.
7688    pub const fn set_iss2(&mut self, value: u32) {
7689        let offset = Self::ISS2_SHIFT;
7690        assert!(value & (Self::ISS2_MASK as u32) == value);
7691        *self = Self::from_bits_retain(
7692            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
7693        );
7694    }
7695
7696    /// Returns a copy with the `ISS2` field set to the given value.
7697    pub const fn with_iss2(mut self, value: u32) -> Self {
7698        self.set_iss2(value);
7699        self
7700    }
7701}
7702
7703#[cfg(feature = "el1")]
7704bitflags! {
7705    /// `FAR_EL1` system register value.
7706    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7707    #[repr(transparent)]
7708    pub struct FarEl1: u64 {
7709    }
7710}
7711
7712#[cfg(feature = "el1")]
7713impl FarEl1 {
7714    /// Offset of the `VA` field.
7715    pub const VA_SHIFT: u32 = 0;
7716    /// Mask for the `VA` field.
7717    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
7718
7719    /// Returns the value of the `VA` field.
7720    pub const fn va(self) -> u64 {
7721        ((self.bits() >> Self::VA_SHIFT)
7722            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
7723    }
7724
7725    /// Sets the value of the `VA` field.
7726    pub const fn set_va(&mut self, value: u64) {
7727        let offset = Self::VA_SHIFT;
7728        assert!(value & (Self::VA_MASK as u64) == value);
7729        *self = Self::from_bits_retain(
7730            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u64) << offset),
7731        );
7732    }
7733
7734    /// Returns a copy with the `VA` field set to the given value.
7735    pub const fn with_va(mut self, value: u64) -> Self {
7736        self.set_va(value);
7737        self
7738    }
7739}
7740
7741#[cfg(feature = "el2")]
7742bitflags! {
7743    /// `FAR_EL2` system register value.
7744    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7745    #[repr(transparent)]
7746    pub struct FarEl2: u64 {
7747    }
7748}
7749
7750#[cfg(feature = "el2")]
7751impl FarEl2 {
7752    /// Offset of the `VA` field.
7753    pub const VA_SHIFT: u32 = 0;
7754    /// Mask for the `VA` field.
7755    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
7756
7757    /// Returns the value of the `VA` field.
7758    pub const fn va(self) -> u64 {
7759        ((self.bits() >> Self::VA_SHIFT)
7760            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
7761    }
7762
7763    /// Sets the value of the `VA` field.
7764    pub const fn set_va(&mut self, value: u64) {
7765        let offset = Self::VA_SHIFT;
7766        assert!(value & (Self::VA_MASK as u64) == value);
7767        *self = Self::from_bits_retain(
7768            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u64) << offset),
7769        );
7770    }
7771
7772    /// Returns a copy with the `VA` field set to the given value.
7773    pub const fn with_va(mut self, value: u64) -> Self {
7774        self.set_va(value);
7775        self
7776    }
7777}
7778
7779#[cfg(feature = "el1")]
7780bitflags! {
7781    /// `GCR_EL1` system register value.
7782    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7783    #[repr(transparent)]
7784    pub struct GcrEl1: u64 {
7785        /// `RRND` bit.
7786        const RRND = 1 << 16;
7787    }
7788}
7789
7790#[cfg(feature = "el1")]
7791impl GcrEl1 {
7792    /// Offset of the `Exclude` field.
7793    pub const EXCLUDE_SHIFT: u32 = 0;
7794    /// Mask for the `Exclude` field.
7795    pub const EXCLUDE_MASK: u64 = 0b1111111111111111;
7796    /// Offset of the `RRND` field.
7797    pub const RRND_SHIFT: u32 = 16;
7798
7799    /// Returns the value of the `Exclude` field.
7800    pub const fn exclude(self) -> u16 {
7801        ((self.bits() >> Self::EXCLUDE_SHIFT) & 0b1111111111111111) as u16
7802    }
7803
7804    /// Sets the value of the `Exclude` field.
7805    pub const fn set_exclude(&mut self, value: u16) {
7806        let offset = Self::EXCLUDE_SHIFT;
7807        assert!(value & (Self::EXCLUDE_MASK as u16) == value);
7808        *self = Self::from_bits_retain(
7809            (self.bits() & !(Self::EXCLUDE_MASK << offset)) | ((value as u64) << offset),
7810        );
7811    }
7812
7813    /// Returns a copy with the `Exclude` field set to the given value.
7814    pub const fn with_exclude(mut self, value: u16) -> Self {
7815        self.set_exclude(value);
7816        self
7817    }
7818}
7819
7820#[cfg(feature = "el1")]
7821bitflags! {
7822    /// `GCSCR_EL1` system register value.
7823    ///
7824    /// Guarded Control Stack Control register.
7825    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7826    #[repr(transparent)]
7827    pub struct GcscrEl1: u64 {
7828        /// `PCRSEL` bit.
7829        const PCRSEL = 1 << 0;
7830        /// `RVCHKEN` bit.
7831        const RVCHKEN = 1 << 5;
7832        /// Exception state lock enable.
7833        const EXLOCKEN = 1 << 6;
7834        /// `PUSHMEn` bit.
7835        const PUSHMEN = 1 << 8;
7836        /// `STREn` bit.
7837        const STREN = 1 << 9;
7838    }
7839}
7840
7841#[cfg(feature = "el1")]
7842impl GcscrEl1 {
7843    /// Offset of the `PCRSEL` field.
7844    pub const PCRSEL_SHIFT: u32 = 0;
7845    /// Offset of the `RVCHKEN` field.
7846    pub const RVCHKEN_SHIFT: u32 = 5;
7847    /// Offset of the `EXLOCKEN` field.
7848    pub const EXLOCKEN_SHIFT: u32 = 6;
7849    /// Offset of the `PUSHMEn` field.
7850    pub const PUSHMEN_SHIFT: u32 = 8;
7851    /// Offset of the `STREn` field.
7852    pub const STREN_SHIFT: u32 = 9;
7853}
7854
7855#[cfg(feature = "el2")]
7856bitflags! {
7857    /// `GCSCR_EL2` system register value.
7858    ///
7859    /// Guarded Control Stack Control register.
7860    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7861    #[repr(transparent)]
7862    pub struct GcscrEl2: u64 {
7863        /// `PCRSEL` bit.
7864        const PCRSEL = 1 << 0;
7865        /// `RVCHKEN` bit.
7866        const RVCHKEN = 1 << 5;
7867        /// Exception state lock enable.
7868        const EXLOCKEN = 1 << 6;
7869        /// `PUSHMEn` bit.
7870        const PUSHMEN = 1 << 8;
7871        /// `STREn` bit.
7872        const STREN = 1 << 9;
7873    }
7874}
7875
7876#[cfg(feature = "el2")]
7877impl GcscrEl2 {
7878    /// Offset of the `PCRSEL` field.
7879    pub const PCRSEL_SHIFT: u32 = 0;
7880    /// Offset of the `RVCHKEN` field.
7881    pub const RVCHKEN_SHIFT: u32 = 5;
7882    /// Offset of the `EXLOCKEN` field.
7883    pub const EXLOCKEN_SHIFT: u32 = 6;
7884    /// Offset of the `PUSHMEn` field.
7885    pub const PUSHMEN_SHIFT: u32 = 8;
7886    /// Offset of the `STREn` field.
7887    pub const STREN_SHIFT: u32 = 9;
7888}
7889
7890#[cfg(feature = "el3")]
7891bitflags! {
7892    /// `GPCCR_EL3` system register value.
7893    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7894    #[repr(transparent)]
7895    pub struct GpccrEl3: u64 {
7896        /// `PPS3` bit.
7897        const PPS3 = 1 << 3;
7898        /// `RLPAD` bit.
7899        const RLPAD = 1 << 5;
7900        /// `NSPAD` bit.
7901        const NSPAD = 1 << 6;
7902        /// `SPAD` bit.
7903        const SPAD = 1 << 7;
7904        /// `GPC` bit.
7905        const GPC = 1 << 16;
7906        /// `GPCP` bit.
7907        const GPCP = 1 << 17;
7908        /// `TBGPCD` bit.
7909        const TBGPCD = 1 << 18;
7910        /// `NSO` bit.
7911        const NSO = 1 << 19;
7912        /// `APPSAA` bit.
7913        const APPSAA = 1 << 24;
7914        /// `SA` bit.
7915        const SA = 1 << 25;
7916        /// `NSP` bit.
7917        const NSP = 1 << 26;
7918        /// `NA6` bit.
7919        const NA6 = 1 << 27;
7920        /// `NA7` bit.
7921        const NA7 = 1 << 28;
7922        /// `GPCBW` bit.
7923        const GPCBW = 1 << 29;
7924    }
7925}
7926
7927#[cfg(feature = "el3")]
7928impl GpccrEl3 {
7929    /// Offset of the `PPS` field.
7930    pub const PPS_SHIFT: u32 = 0;
7931    /// Mask for the `PPS` field.
7932    pub const PPS_MASK: u64 = 0b111;
7933    /// Offset of the `PPS3` field.
7934    pub const PPS3_SHIFT: u32 = 3;
7935    /// Offset of the `RLPAD` field.
7936    pub const RLPAD_SHIFT: u32 = 5;
7937    /// Offset of the `NSPAD` field.
7938    pub const NSPAD_SHIFT: u32 = 6;
7939    /// Offset of the `SPAD` field.
7940    pub const SPAD_SHIFT: u32 = 7;
7941    /// Offset of the `IRGN` field.
7942    pub const IRGN_SHIFT: u32 = 8;
7943    /// Mask for the `IRGN` field.
7944    pub const IRGN_MASK: u64 = 0b11;
7945    /// Offset of the `ORGN` field.
7946    pub const ORGN_SHIFT: u32 = 10;
7947    /// Mask for the `ORGN` field.
7948    pub const ORGN_MASK: u64 = 0b11;
7949    /// Offset of the `SH` field.
7950    pub const SH_SHIFT: u32 = 12;
7951    /// Mask for the `SH` field.
7952    pub const SH_MASK: u64 = 0b11;
7953    /// Offset of the `PGS` field.
7954    pub const PGS_SHIFT: u32 = 14;
7955    /// Mask for the `PGS` field.
7956    pub const PGS_MASK: u64 = 0b11;
7957    /// Offset of the `GPC` field.
7958    pub const GPC_SHIFT: u32 = 16;
7959    /// Offset of the `GPCP` field.
7960    pub const GPCP_SHIFT: u32 = 17;
7961    /// Offset of the `TBGPCD` field.
7962    pub const TBGPCD_SHIFT: u32 = 18;
7963    /// Offset of the `NSO` field.
7964    pub const NSO_SHIFT: u32 = 19;
7965    /// Offset of the `L0GPTSZ` field.
7966    pub const L0GPTSZ_SHIFT: u32 = 20;
7967    /// Mask for the `L0GPTSZ` field.
7968    pub const L0GPTSZ_MASK: u64 = 0b1111;
7969    /// Offset of the `APPSAA` field.
7970    pub const APPSAA_SHIFT: u32 = 24;
7971    /// Offset of the `SA` field.
7972    pub const SA_SHIFT: u32 = 25;
7973    /// Offset of the `NSP` field.
7974    pub const NSP_SHIFT: u32 = 26;
7975    /// Offset of the `NA6` field.
7976    pub const NA6_SHIFT: u32 = 27;
7977    /// Offset of the `NA7` field.
7978    pub const NA7_SHIFT: u32 = 28;
7979    /// Offset of the `GPCBW` field.
7980    pub const GPCBW_SHIFT: u32 = 29;
7981
7982    /// Returns the value of the `PPS` field.
7983    pub const fn pps(self) -> u8 {
7984        ((self.bits() >> Self::PPS_SHIFT) & 0b111) as u8
7985    }
7986
7987    /// Sets the value of the `PPS` field.
7988    pub const fn set_pps(&mut self, value: u8) {
7989        let offset = Self::PPS_SHIFT;
7990        assert!(value & (Self::PPS_MASK as u8) == value);
7991        *self = Self::from_bits_retain(
7992            (self.bits() & !(Self::PPS_MASK << offset)) | ((value as u64) << offset),
7993        );
7994    }
7995
7996    /// Returns a copy with the `PPS` field set to the given value.
7997    pub const fn with_pps(mut self, value: u8) -> Self {
7998        self.set_pps(value);
7999        self
8000    }
8001
8002    /// Returns the value of the `IRGN` field.
8003    pub fn irgn(self) -> crate::manual::Cacheability {
8004        crate::manual::Cacheability::try_from(((self.bits() >> Self::IRGN_SHIFT) & 0b11) as u8)
8005            .unwrap()
8006    }
8007
8008    /// Sets the value of the `IRGN` field.
8009    pub fn set_irgn(&mut self, value: crate::manual::Cacheability) {
8010        let offset = Self::IRGN_SHIFT;
8011        let value: u8 = value.into();
8012        assert!(value & (Self::IRGN_MASK as u8) == value);
8013        *self = Self::from_bits_retain(
8014            (self.bits() & !(Self::IRGN_MASK << offset)) | ((value as u64) << offset),
8015        );
8016    }
8017
8018    /// Returns a copy with the `IRGN` field set to the given value.
8019    pub fn with_irgn(mut self, value: crate::manual::Cacheability) -> Self {
8020        self.set_irgn(value);
8021        self
8022    }
8023
8024    /// Returns the value of the `ORGN` field.
8025    pub fn orgn(self) -> crate::manual::Cacheability {
8026        crate::manual::Cacheability::try_from(((self.bits() >> Self::ORGN_SHIFT) & 0b11) as u8)
8027            .unwrap()
8028    }
8029
8030    /// Sets the value of the `ORGN` field.
8031    pub fn set_orgn(&mut self, value: crate::manual::Cacheability) {
8032        let offset = Self::ORGN_SHIFT;
8033        let value: u8 = value.into();
8034        assert!(value & (Self::ORGN_MASK as u8) == value);
8035        *self = Self::from_bits_retain(
8036            (self.bits() & !(Self::ORGN_MASK << offset)) | ((value as u64) << offset),
8037        );
8038    }
8039
8040    /// Returns a copy with the `ORGN` field set to the given value.
8041    pub fn with_orgn(mut self, value: crate::manual::Cacheability) -> Self {
8042        self.set_orgn(value);
8043        self
8044    }
8045
8046    /// Returns the value of the `SH` field.
8047    pub fn sh(self) -> crate::manual::Shareability {
8048        crate::manual::Shareability::try_from(((self.bits() >> Self::SH_SHIFT) & 0b11) as u8)
8049            .unwrap()
8050    }
8051
8052    /// Sets the value of the `SH` field.
8053    pub fn set_sh(&mut self, value: crate::manual::Shareability) {
8054        let offset = Self::SH_SHIFT;
8055        let value: u8 = value.into();
8056        assert!(value & (Self::SH_MASK as u8) == value);
8057        *self = Self::from_bits_retain(
8058            (self.bits() & !(Self::SH_MASK << offset)) | ((value as u64) << offset),
8059        );
8060    }
8061
8062    /// Returns a copy with the `SH` field set to the given value.
8063    pub fn with_sh(mut self, value: crate::manual::Shareability) -> Self {
8064        self.set_sh(value);
8065        self
8066    }
8067
8068    /// Returns the value of the `PGS` field.
8069    pub const fn pgs(self) -> u8 {
8070        ((self.bits() >> Self::PGS_SHIFT) & 0b11) as u8
8071    }
8072
8073    /// Sets the value of the `PGS` field.
8074    pub const fn set_pgs(&mut self, value: u8) {
8075        let offset = Self::PGS_SHIFT;
8076        assert!(value & (Self::PGS_MASK as u8) == value);
8077        *self = Self::from_bits_retain(
8078            (self.bits() & !(Self::PGS_MASK << offset)) | ((value as u64) << offset),
8079        );
8080    }
8081
8082    /// Returns a copy with the `PGS` field set to the given value.
8083    pub const fn with_pgs(mut self, value: u8) -> Self {
8084        self.set_pgs(value);
8085        self
8086    }
8087
8088    /// Returns the value of the `L0GPTSZ` field.
8089    pub const fn l0gptsz(self) -> u8 {
8090        ((self.bits() >> Self::L0GPTSZ_SHIFT) & 0b1111) as u8
8091    }
8092
8093    /// Sets the value of the `L0GPTSZ` field.
8094    pub const fn set_l0gptsz(&mut self, value: u8) {
8095        let offset = Self::L0GPTSZ_SHIFT;
8096        assert!(value & (Self::L0GPTSZ_MASK as u8) == value);
8097        *self = Self::from_bits_retain(
8098            (self.bits() & !(Self::L0GPTSZ_MASK << offset)) | ((value as u64) << offset),
8099        );
8100    }
8101
8102    /// Returns a copy with the `L0GPTSZ` field set to the given value.
8103    pub const fn with_l0gptsz(mut self, value: u8) -> Self {
8104        self.set_l0gptsz(value);
8105        self
8106    }
8107}
8108
8109#[cfg(feature = "el3")]
8110bitflags! {
8111    /// `GPTBR_EL3` system register value.
8112    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8113    #[repr(transparent)]
8114    pub struct GptbrEl3: u64 {
8115    }
8116}
8117
8118#[cfg(feature = "el3")]
8119impl GptbrEl3 {
8120    /// Offset of the `BADDR` field.
8121    pub const BADDR_SHIFT: u32 = 0;
8122    /// Mask for the `BADDR` field.
8123    pub const BADDR_MASK: u64 = 0b1111111111111111111111111111111111111111;
8124    /// Offset of the `BADDR[43:40]` field.
8125    pub const BADDR_43_40_SHIFT: u32 = 40;
8126    /// Mask for the `BADDR[43:40]` field.
8127    pub const BADDR_43_40_MASK: u64 = 0b1111;
8128
8129    /// Returns the value of the `BADDR` field.
8130    pub const fn baddr(self) -> u64 {
8131        ((self.bits() >> Self::BADDR_SHIFT) & 0b1111111111111111111111111111111111111111) as u64
8132    }
8133
8134    /// Sets the value of the `BADDR` field.
8135    pub const fn set_baddr(&mut self, value: u64) {
8136        let offset = Self::BADDR_SHIFT;
8137        assert!(value & (Self::BADDR_MASK as u64) == value);
8138        *self = Self::from_bits_retain(
8139            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
8140        );
8141    }
8142
8143    /// Returns a copy with the `BADDR` field set to the given value.
8144    pub const fn with_baddr(mut self, value: u64) -> Self {
8145        self.set_baddr(value);
8146        self
8147    }
8148
8149    /// Returns the value of the `BADDR[43:40]` field.
8150    pub const fn baddr_43_40(self) -> u8 {
8151        ((self.bits() >> Self::BADDR_43_40_SHIFT) & 0b1111) as u8
8152    }
8153
8154    /// Sets the value of the `BADDR[43:40]` field.
8155    pub const fn set_baddr_43_40(&mut self, value: u8) {
8156        let offset = Self::BADDR_43_40_SHIFT;
8157        assert!(value & (Self::BADDR_43_40_MASK as u8) == value);
8158        *self = Self::from_bits_retain(
8159            (self.bits() & !(Self::BADDR_43_40_MASK << offset)) | ((value as u64) << offset),
8160        );
8161    }
8162
8163    /// Returns a copy with the `BADDR[43:40]` field set to the given value.
8164    pub const fn with_baddr_43_40(mut self, value: u8) -> Self {
8165        self.set_baddr_43_40(value);
8166        self
8167    }
8168}
8169
8170#[cfg(feature = "el2")]
8171bitflags! {
8172    /// `HAFGRTR_EL2` system register value.
8173    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8174    #[repr(transparent)]
8175    pub struct HafgrtrEl2: u64 {
8176        /// `AMEVCNTR0<x>_EL0` bit 0.
8177        const AMEVCNTR00_EL0 = 1 << 1;
8178        /// `AMEVCNTR0<x>_EL0` bit 1.
8179        const AMEVCNTR01_EL0 = 1 << 2;
8180        /// `AMEVCNTR0<x>_EL0` bit 2.
8181        const AMEVCNTR02_EL0 = 1 << 3;
8182        /// `AMEVCNTR0<x>_EL0` bit 3.
8183        const AMEVCNTR03_EL0 = 1 << 4;
8184    }
8185}
8186
8187#[cfg(feature = "el2")]
8188impl HafgrtrEl2 {
8189    /// Offset of the `AMEVCNTR0<x>_EL0` field.
8190    pub const AMEVCNTR0_EL0_SHIFT: u32 = 1;
8191}
8192
8193bitflags! {
8194    /// `HCPTR` system register value.
8195    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8196    #[repr(transparent)]
8197    pub struct Hcptr: u32 {
8198        /// RES1 bits in the `HCPTR` register.
8199        const RES1 = 0b11001111111111;
8200        /// `TCP10` bit.
8201        const TCP10 = 1 << 10;
8202        /// `TCP11` bit.
8203        const TCP11 = 1 << 11;
8204        /// `TASE` bit.
8205        const TASE = 1 << 15;
8206        /// `TTA` bit.
8207        const TTA = 1 << 20;
8208        /// `TAM` bit.
8209        const TAM = 1 << 30;
8210        /// `TCPAC` bit.
8211        const TCPAC = 1 << 31;
8212    }
8213}
8214
8215impl Hcptr {
8216    /// Offset of the `TCP10` field.
8217    pub const TCP10_SHIFT: u32 = 10;
8218    /// Offset of the `TCP11` field.
8219    pub const TCP11_SHIFT: u32 = 11;
8220    /// Offset of the `TASE` field.
8221    pub const TASE_SHIFT: u32 = 15;
8222    /// Offset of the `TTA` field.
8223    pub const TTA_SHIFT: u32 = 20;
8224    /// Offset of the `TAM` field.
8225    pub const TAM_SHIFT: u32 = 30;
8226    /// Offset of the `TCPAC` field.
8227    pub const TCPAC_SHIFT: u32 = 31;
8228}
8229
8230bitflags! {
8231    /// `HCR` system register value.
8232    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8233    #[repr(transparent)]
8234    pub struct Hcr: u32 {
8235        /// `VM` bit.
8236        const VM = 1 << 0;
8237        /// `SWIO` bit.
8238        const SWIO = 1 << 1;
8239        /// `PTW` bit.
8240        const PTW = 1 << 2;
8241        /// `FMO` bit.
8242        const FMO = 1 << 3;
8243        /// `IMO` bit.
8244        const IMO = 1 << 4;
8245        /// `AMO` bit.
8246        const AMO = 1 << 5;
8247        /// `VF` bit.
8248        const VF = 1 << 6;
8249        /// `VI` bit.
8250        const VI = 1 << 7;
8251        /// `VA` bit.
8252        const VA = 1 << 8;
8253        /// `FB` bit.
8254        const FB = 1 << 9;
8255        /// `DC` bit.
8256        const DC = 1 << 12;
8257        /// `TWI` bit.
8258        const TWI = 1 << 13;
8259        /// `TWE` bit.
8260        const TWE = 1 << 14;
8261        /// `TID0` bit.
8262        const TID0 = 1 << 15;
8263        /// `TID1` bit.
8264        const TID1 = 1 << 16;
8265        /// `TID2` bit.
8266        const TID2 = 1 << 17;
8267        /// `TID3` bit.
8268        const TID3 = 1 << 18;
8269        /// `TSC` bit.
8270        const TSC = 1 << 19;
8271        /// `TIDCP` bit.
8272        const TIDCP = 1 << 20;
8273        /// `TAC` bit.
8274        const TAC = 1 << 21;
8275        /// `TSW` bit.
8276        const TSW = 1 << 22;
8277        /// `TPC` bit.
8278        const TPC = 1 << 23;
8279        /// `TPU` bit.
8280        const TPU = 1 << 24;
8281        /// `TTLB` bit.
8282        const TTLB = 1 << 25;
8283        /// `TVM` bit.
8284        const TVM = 1 << 26;
8285        /// `TGE` bit.
8286        const TGE = 1 << 27;
8287        /// `HCD` bit.
8288        const HCD = 1 << 29;
8289        /// `TRVM` bit.
8290        const TRVM = 1 << 30;
8291    }
8292}
8293
8294impl Hcr {
8295    /// Offset of the `VM` field.
8296    pub const VM_SHIFT: u32 = 0;
8297    /// Offset of the `SWIO` field.
8298    pub const SWIO_SHIFT: u32 = 1;
8299    /// Offset of the `PTW` field.
8300    pub const PTW_SHIFT: u32 = 2;
8301    /// Offset of the `FMO` field.
8302    pub const FMO_SHIFT: u32 = 3;
8303    /// Offset of the `IMO` field.
8304    pub const IMO_SHIFT: u32 = 4;
8305    /// Offset of the `AMO` field.
8306    pub const AMO_SHIFT: u32 = 5;
8307    /// Offset of the `VF` field.
8308    pub const VF_SHIFT: u32 = 6;
8309    /// Offset of the `VI` field.
8310    pub const VI_SHIFT: u32 = 7;
8311    /// Offset of the `VA` field.
8312    pub const VA_SHIFT: u32 = 8;
8313    /// Offset of the `FB` field.
8314    pub const FB_SHIFT: u32 = 9;
8315    /// Offset of the `BSU` field.
8316    pub const BSU_SHIFT: u32 = 10;
8317    /// Mask for the `BSU` field.
8318    pub const BSU_MASK: u32 = 0b11;
8319    /// Offset of the `DC` field.
8320    pub const DC_SHIFT: u32 = 12;
8321    /// Offset of the `TWI` field.
8322    pub const TWI_SHIFT: u32 = 13;
8323    /// Offset of the `TWE` field.
8324    pub const TWE_SHIFT: u32 = 14;
8325    /// Offset of the `TID0` field.
8326    pub const TID0_SHIFT: u32 = 15;
8327    /// Offset of the `TID1` field.
8328    pub const TID1_SHIFT: u32 = 16;
8329    /// Offset of the `TID2` field.
8330    pub const TID2_SHIFT: u32 = 17;
8331    /// Offset of the `TID3` field.
8332    pub const TID3_SHIFT: u32 = 18;
8333    /// Offset of the `TSC` field.
8334    pub const TSC_SHIFT: u32 = 19;
8335    /// Offset of the `TIDCP` field.
8336    pub const TIDCP_SHIFT: u32 = 20;
8337    /// Offset of the `TAC` field.
8338    pub const TAC_SHIFT: u32 = 21;
8339    /// Offset of the `TSW` field.
8340    pub const TSW_SHIFT: u32 = 22;
8341    /// Offset of the `TPC` field.
8342    pub const TPC_SHIFT: u32 = 23;
8343    /// Offset of the `TPU` field.
8344    pub const TPU_SHIFT: u32 = 24;
8345    /// Offset of the `TTLB` field.
8346    pub const TTLB_SHIFT: u32 = 25;
8347    /// Offset of the `TVM` field.
8348    pub const TVM_SHIFT: u32 = 26;
8349    /// Offset of the `TGE` field.
8350    pub const TGE_SHIFT: u32 = 27;
8351    /// Offset of the `HCD` field.
8352    pub const HCD_SHIFT: u32 = 29;
8353    /// Offset of the `TRVM` field.
8354    pub const TRVM_SHIFT: u32 = 30;
8355
8356    /// Returns the value of the `BSU` field.
8357    pub const fn bsu(self) -> u8 {
8358        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
8359    }
8360
8361    /// Sets the value of the `BSU` field.
8362    pub const fn set_bsu(&mut self, value: u8) {
8363        let offset = Self::BSU_SHIFT;
8364        assert!(value & (Self::BSU_MASK as u8) == value);
8365        *self = Self::from_bits_retain(
8366            (self.bits() & !(Self::BSU_MASK << offset)) | ((value as u32) << offset),
8367        );
8368    }
8369
8370    /// Returns a copy with the `BSU` field set to the given value.
8371    pub const fn with_bsu(mut self, value: u8) -> Self {
8372        self.set_bsu(value);
8373        self
8374    }
8375}
8376
8377bitflags! {
8378    /// `HCR2` system register value.
8379    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8380    #[repr(transparent)]
8381    pub struct Hcr2: u32 {
8382        /// `CD` bit.
8383        const CD = 1 << 0;
8384        /// `ID` bit.
8385        const ID = 1 << 1;
8386        /// `TERR` bit.
8387        const TERR = 1 << 4;
8388        /// `TEA` bit.
8389        const TEA = 1 << 5;
8390        /// `TID4` bit.
8391        const TID4 = 1 << 17;
8392        /// `TICAB` bit.
8393        const TICAB = 1 << 18;
8394        /// `TOCU` bit.
8395        const TOCU = 1 << 20;
8396        /// `TTLBIS` bit.
8397        const TTLBIS = 1 << 22;
8398    }
8399}
8400
8401impl Hcr2 {
8402    /// Offset of the `CD` field.
8403    pub const CD_SHIFT: u32 = 0;
8404    /// Offset of the `ID` field.
8405    pub const ID_SHIFT: u32 = 1;
8406    /// Offset of the `TERR` field.
8407    pub const TERR_SHIFT: u32 = 4;
8408    /// Offset of the `TEA` field.
8409    pub const TEA_SHIFT: u32 = 5;
8410    /// Offset of the `TID4` field.
8411    pub const TID4_SHIFT: u32 = 17;
8412    /// Offset of the `TICAB` field.
8413    pub const TICAB_SHIFT: u32 = 18;
8414    /// Offset of the `TOCU` field.
8415    pub const TOCU_SHIFT: u32 = 20;
8416    /// Offset of the `TTLBIS` field.
8417    pub const TTLBIS_SHIFT: u32 = 22;
8418}
8419
8420#[cfg(feature = "el2")]
8421bitflags! {
8422    /// `HCRX_EL2` system register value.
8423    ///
8424    /// Extended Hypervisor Configuration Register.
8425    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8426    #[repr(transparent)]
8427    pub struct HcrxEl2: u64 {
8428        /// Do not trap execution of an ST64BV0 instruction at EL0 or EL1 to EL2.
8429        const ENAS0 = 1 << 0;
8430        /// Do not trap execution of an LD64B or ST64B instruction at EL0 or EL1 to EL2.
8431        const ENALS = 1 << 1;
8432        /// Do not trap execution of an ST64BV instruction at EL0 or EL1 to EL2.
8433        const ENASR = 1 << 2;
8434        /// Determines the behavior of TLBI instructions affected by the XS attribute.
8435        const FNXS = 1 << 3;
8436        /// Determines if the fine-grained traps in HFGITR_EL2 also apply to the corresponding TLBI maintenance instructions with the nXS qualifier.
8437        const FGTNXS = 1 << 4;
8438        /// Controls mapping of the value of SMPRI_EL1.Priority for streaming execution priority at EL0 or EL1.
8439        const SMPME = 1 << 5;
8440        /// Traps MSR writes of ALLINT at EL1 using AArch64 to EL2.
8441        const TALLINT = 1 << 6;
8442        /// Enables signaling of virtual IRQ interrupts with Superpriority.
8443        const VINMI = 1 << 7;
8444        /// Enables signaling of virtual FIQ interrupts with Superpriority.
8445        const VFNMI = 1 << 8;
8446        /// Controls the required permissions for cache maintenance instructions at EL1 or EL0.
8447        const CMOW = 1 << 9;
8448        /// Controls Memory Copy and Memory Set exceptions generated from EL1.
8449        const MCE2 = 1 << 10;
8450        /// Enables execution of Memory Set and Memory Copy instructions at EL1 or EL0.
8451        const MSCEN = 1 << 11;
8452        /// `TCR2En` bit.
8453        const TCR2EN = 1 << 14;
8454        /// `SCTLR2En` bit.
8455        const SCTLR2EN = 1 << 15;
8456        /// `PTTWI` bit.
8457        const PTTWI = 1 << 16;
8458        /// `D128En` bit.
8459        const D128EN = 1 << 17;
8460        /// `EnSNERR` bit.
8461        const ENSNERR = 1 << 18;
8462        /// `TMEA` bit.
8463        const TMEA = 1 << 19;
8464        /// `EnSDERR` bit.
8465        const ENSDERR = 1 << 20;
8466        /// `EnIDCP128` bit.
8467        const ENIDCP128 = 1 << 21;
8468        /// `GCSEn` bit.
8469        const GCSEN = 1 << 22;
8470        /// `EnFPM` bit.
8471        const ENFPM = 1 << 23;
8472        /// `PACMEn` bit.
8473        const PACMEN = 1 << 24;
8474        /// `VTLBIDEn` bit.
8475        const VTLBIDEN = 1 << 25;
8476        /// `SRMASKEn` bit.
8477        const SRMASKEN = 1 << 26;
8478        /// `NVTGE` bit.
8479        const NVTGE = 1 << 27;
8480        /// `POE2En` bit.
8481        const POE2EN = 1 << 29;
8482        /// `TPLIMEn` bit.
8483        const TPLIMEN = 1 << 30;
8484        /// `FDIT` bit.
8485        const FDIT = 1 << 31;
8486        /// `NVnTTLB` bit.
8487        const NVNTTLB = 1 << 32;
8488        /// `NVnTTLBIS` bit.
8489        const NVNTTLBIS = 1 << 33;
8490        /// `NVnTTLBOS` bit.
8491        const NVNTTLBOS = 1 << 34;
8492        /// `VTLBIDOSEn` bit.
8493        const VTLBIDOSEN = 1 << 35;
8494        /// `FNB` bit.
8495        const FNB = 1 << 36;
8496        /// `VTE` bit.
8497        const VTE = 1 << 37;
8498        /// `VTAO` bit.
8499        const VTAO = 1 << 38;
8500        /// `VTCO` bit.
8501        const VTCO = 1 << 39;
8502    }
8503}
8504
8505#[cfg(feature = "el2")]
8506impl HcrxEl2 {
8507    /// Offset of the `EnAS0` field.
8508    pub const ENAS0_SHIFT: u32 = 0;
8509    /// Offset of the `EnALS` field.
8510    pub const ENALS_SHIFT: u32 = 1;
8511    /// Offset of the `EnASR` field.
8512    pub const ENASR_SHIFT: u32 = 2;
8513    /// Offset of the `FnXS` field.
8514    pub const FNXS_SHIFT: u32 = 3;
8515    /// Offset of the `FGTnXS` field.
8516    pub const FGTNXS_SHIFT: u32 = 4;
8517    /// Offset of the `SMPME` field.
8518    pub const SMPME_SHIFT: u32 = 5;
8519    /// Offset of the `TALLINT` field.
8520    pub const TALLINT_SHIFT: u32 = 6;
8521    /// Offset of the `VINMI` field.
8522    pub const VINMI_SHIFT: u32 = 7;
8523    /// Offset of the `VFNMI` field.
8524    pub const VFNMI_SHIFT: u32 = 8;
8525    /// Offset of the `CMOW` field.
8526    pub const CMOW_SHIFT: u32 = 9;
8527    /// Offset of the `MCE2` field.
8528    pub const MCE2_SHIFT: u32 = 10;
8529    /// Offset of the `MSCEn` field.
8530    pub const MSCEN_SHIFT: u32 = 11;
8531    /// Offset of the `TCR2En` field.
8532    pub const TCR2EN_SHIFT: u32 = 14;
8533    /// Offset of the `SCTLR2En` field.
8534    pub const SCTLR2EN_SHIFT: u32 = 15;
8535    /// Offset of the `PTTWI` field.
8536    pub const PTTWI_SHIFT: u32 = 16;
8537    /// Offset of the `D128En` field.
8538    pub const D128EN_SHIFT: u32 = 17;
8539    /// Offset of the `EnSNERR` field.
8540    pub const ENSNERR_SHIFT: u32 = 18;
8541    /// Offset of the `TMEA` field.
8542    pub const TMEA_SHIFT: u32 = 19;
8543    /// Offset of the `EnSDERR` field.
8544    pub const ENSDERR_SHIFT: u32 = 20;
8545    /// Offset of the `EnIDCP128` field.
8546    pub const ENIDCP128_SHIFT: u32 = 21;
8547    /// Offset of the `GCSEn` field.
8548    pub const GCSEN_SHIFT: u32 = 22;
8549    /// Offset of the `EnFPM` field.
8550    pub const ENFPM_SHIFT: u32 = 23;
8551    /// Offset of the `PACMEn` field.
8552    pub const PACMEN_SHIFT: u32 = 24;
8553    /// Offset of the `VTLBIDEn` field.
8554    pub const VTLBIDEN_SHIFT: u32 = 25;
8555    /// Offset of the `SRMASKEn` field.
8556    pub const SRMASKEN_SHIFT: u32 = 26;
8557    /// Offset of the `NVTGE` field.
8558    pub const NVTGE_SHIFT: u32 = 27;
8559    /// Offset of the `POE2En` field.
8560    pub const POE2EN_SHIFT: u32 = 29;
8561    /// Offset of the `TPLIMEn` field.
8562    pub const TPLIMEN_SHIFT: u32 = 30;
8563    /// Offset of the `FDIT` field.
8564    pub const FDIT_SHIFT: u32 = 31;
8565    /// Offset of the `NVnTTLB` field.
8566    pub const NVNTTLB_SHIFT: u32 = 32;
8567    /// Offset of the `NVnTTLBIS` field.
8568    pub const NVNTTLBIS_SHIFT: u32 = 33;
8569    /// Offset of the `NVnTTLBOS` field.
8570    pub const NVNTTLBOS_SHIFT: u32 = 34;
8571    /// Offset of the `VTLBIDOSEn` field.
8572    pub const VTLBIDOSEN_SHIFT: u32 = 35;
8573    /// Offset of the `FNB` field.
8574    pub const FNB_SHIFT: u32 = 36;
8575    /// Offset of the `VTE` field.
8576    pub const VTE_SHIFT: u32 = 37;
8577    /// Offset of the `VTAO` field.
8578    pub const VTAO_SHIFT: u32 = 38;
8579    /// Offset of the `VTCO` field.
8580    pub const VTCO_SHIFT: u32 = 39;
8581}
8582
8583#[cfg(feature = "el2")]
8584bitflags! {
8585    /// `HCR_EL2` system register value.
8586    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8587    #[repr(transparent)]
8588    pub struct HcrEl2: u64 {
8589        /// `VM` bit.
8590        const VM = 1 << 0;
8591        /// `SWIO` bit.
8592        const SWIO = 1 << 1;
8593        /// `PTW` bit.
8594        const PTW = 1 << 2;
8595        /// `FMO` bit.
8596        const FMO = 1 << 3;
8597        /// `IMO` bit.
8598        const IMO = 1 << 4;
8599        /// `AMO` bit.
8600        const AMO = 1 << 5;
8601        /// `VF` bit.
8602        const VF = 1 << 6;
8603        /// `VI` bit.
8604        const VI = 1 << 7;
8605        /// `VSE` bit.
8606        const VSE = 1 << 8;
8607        /// `FB` bit.
8608        const FB = 1 << 9;
8609        /// `DC` bit.
8610        const DC = 1 << 12;
8611        /// `TWI` bit.
8612        const TWI = 1 << 13;
8613        /// `TWE` bit.
8614        const TWE = 1 << 14;
8615        /// `TID0` bit.
8616        const TID0 = 1 << 15;
8617        /// `TID1` bit.
8618        const TID1 = 1 << 16;
8619        /// `TID2` bit.
8620        const TID2 = 1 << 17;
8621        /// `TID3` bit.
8622        const TID3 = 1 << 18;
8623        /// `TSC` bit.
8624        const TSC = 1 << 19;
8625        /// `TIDCP` bit.
8626        const TIDCP = 1 << 20;
8627        /// `TACR` bit.
8628        const TACR = 1 << 21;
8629        /// `TSW` bit.
8630        const TSW = 1 << 22;
8631        /// `TPCP` bit.
8632        const TPCP = 1 << 23;
8633        /// `TPU` bit.
8634        const TPU = 1 << 24;
8635        /// `TTLB` bit.
8636        const TTLB = 1 << 25;
8637        /// `TVM` bit.
8638        const TVM = 1 << 26;
8639        /// Trap general exceptions to EL2.
8640        const TGE = 1 << 27;
8641        /// `TDZ` bit.
8642        const TDZ = 1 << 28;
8643        /// `HCD` bit.
8644        const HCD = 1 << 29;
8645        /// `TRVM` bit.
8646        const TRVM = 1 << 30;
8647        /// `RW` bit.
8648        const RW = 1 << 31;
8649        /// `CD` bit.
8650        const CD = 1 << 32;
8651        /// `ID` bit.
8652        const ID = 1 << 33;
8653        /// `E2H` bit.
8654        const E2H = 1 << 34;
8655        /// `TLOR` bit.
8656        const TLOR = 1 << 35;
8657        /// `TERR` bit.
8658        const TERR = 1 << 36;
8659        /// `TEA` bit.
8660        const TEA = 1 << 37;
8661        /// `APK` bit.
8662        const APK = 1 << 40;
8663        /// `API` bit.
8664        const API = 1 << 41;
8665        /// `NV` bit.
8666        const NV = 1 << 42;
8667        /// `NV1` bit.
8668        const NV1 = 1 << 43;
8669        /// `AT` bit.
8670        const AT = 1 << 44;
8671        /// `NV2` bit.
8672        const NV2 = 1 << 45;
8673        /// `FWB` bit.
8674        const FWB = 1 << 46;
8675        /// `FIEN` bit.
8676        const FIEN = 1 << 47;
8677        /// `GPF` bit.
8678        const GPF = 1 << 48;
8679        /// `TID4` bit.
8680        const TID4 = 1 << 49;
8681        /// `TICAB` bit.
8682        const TICAB = 1 << 50;
8683        /// `AMVOFFEN` bit.
8684        const AMVOFFEN = 1 << 51;
8685        /// `TOCU` bit.
8686        const TOCU = 1 << 52;
8687        /// `EnSCXT` bit.
8688        const ENSCXT = 1 << 53;
8689        /// `TTLBIS` bit.
8690        const TTLBIS = 1 << 54;
8691        /// `TTLBOS` bit.
8692        const TTLBOS = 1 << 55;
8693        /// `ATA` bit.
8694        const ATA = 1 << 56;
8695        /// `DCT` bit.
8696        const DCT = 1 << 57;
8697        /// `TID5` bit.
8698        const TID5 = 1 << 58;
8699        /// `TWEDEn` bit.
8700        const TWEDEN = 1 << 59;
8701    }
8702}
8703
8704#[cfg(feature = "el2")]
8705impl HcrEl2 {
8706    /// Offset of the `VM` field.
8707    pub const VM_SHIFT: u32 = 0;
8708    /// Offset of the `SWIO` field.
8709    pub const SWIO_SHIFT: u32 = 1;
8710    /// Offset of the `PTW` field.
8711    pub const PTW_SHIFT: u32 = 2;
8712    /// Offset of the `FMO` field.
8713    pub const FMO_SHIFT: u32 = 3;
8714    /// Offset of the `IMO` field.
8715    pub const IMO_SHIFT: u32 = 4;
8716    /// Offset of the `AMO` field.
8717    pub const AMO_SHIFT: u32 = 5;
8718    /// Offset of the `VF` field.
8719    pub const VF_SHIFT: u32 = 6;
8720    /// Offset of the `VI` field.
8721    pub const VI_SHIFT: u32 = 7;
8722    /// Offset of the `VSE` field.
8723    pub const VSE_SHIFT: u32 = 8;
8724    /// Offset of the `FB` field.
8725    pub const FB_SHIFT: u32 = 9;
8726    /// Offset of the `BSU` field.
8727    pub const BSU_SHIFT: u32 = 10;
8728    /// Mask for the `BSU` field.
8729    pub const BSU_MASK: u64 = 0b11;
8730    /// Offset of the `DC` field.
8731    pub const DC_SHIFT: u32 = 12;
8732    /// Offset of the `TWI` field.
8733    pub const TWI_SHIFT: u32 = 13;
8734    /// Offset of the `TWE` field.
8735    pub const TWE_SHIFT: u32 = 14;
8736    /// Offset of the `TID0` field.
8737    pub const TID0_SHIFT: u32 = 15;
8738    /// Offset of the `TID1` field.
8739    pub const TID1_SHIFT: u32 = 16;
8740    /// Offset of the `TID2` field.
8741    pub const TID2_SHIFT: u32 = 17;
8742    /// Offset of the `TID3` field.
8743    pub const TID3_SHIFT: u32 = 18;
8744    /// Offset of the `TSC` field.
8745    pub const TSC_SHIFT: u32 = 19;
8746    /// Offset of the `TIDCP` field.
8747    pub const TIDCP_SHIFT: u32 = 20;
8748    /// Offset of the `TACR` field.
8749    pub const TACR_SHIFT: u32 = 21;
8750    /// Offset of the `TSW` field.
8751    pub const TSW_SHIFT: u32 = 22;
8752    /// Offset of the `TPCP` field.
8753    pub const TPCP_SHIFT: u32 = 23;
8754    /// Offset of the `TPU` field.
8755    pub const TPU_SHIFT: u32 = 24;
8756    /// Offset of the `TTLB` field.
8757    pub const TTLB_SHIFT: u32 = 25;
8758    /// Offset of the `TVM` field.
8759    pub const TVM_SHIFT: u32 = 26;
8760    /// Offset of the `TGE` field.
8761    pub const TGE_SHIFT: u32 = 27;
8762    /// Offset of the `TDZ` field.
8763    pub const TDZ_SHIFT: u32 = 28;
8764    /// Offset of the `HCD` field.
8765    pub const HCD_SHIFT: u32 = 29;
8766    /// Offset of the `TRVM` field.
8767    pub const TRVM_SHIFT: u32 = 30;
8768    /// Offset of the `RW` field.
8769    pub const RW_SHIFT: u32 = 31;
8770    /// Offset of the `CD` field.
8771    pub const CD_SHIFT: u32 = 32;
8772    /// Offset of the `ID` field.
8773    pub const ID_SHIFT: u32 = 33;
8774    /// Offset of the `E2H` field.
8775    pub const E2H_SHIFT: u32 = 34;
8776    /// Offset of the `TLOR` field.
8777    pub const TLOR_SHIFT: u32 = 35;
8778    /// Offset of the `TERR` field.
8779    pub const TERR_SHIFT: u32 = 36;
8780    /// Offset of the `TEA` field.
8781    pub const TEA_SHIFT: u32 = 37;
8782    /// Offset of the `APK` field.
8783    pub const APK_SHIFT: u32 = 40;
8784    /// Offset of the `API` field.
8785    pub const API_SHIFT: u32 = 41;
8786    /// Offset of the `NV` field.
8787    pub const NV_SHIFT: u32 = 42;
8788    /// Offset of the `NV1` field.
8789    pub const NV1_SHIFT: u32 = 43;
8790    /// Offset of the `AT` field.
8791    pub const AT_SHIFT: u32 = 44;
8792    /// Offset of the `NV2` field.
8793    pub const NV2_SHIFT: u32 = 45;
8794    /// Offset of the `FWB` field.
8795    pub const FWB_SHIFT: u32 = 46;
8796    /// Offset of the `FIEN` field.
8797    pub const FIEN_SHIFT: u32 = 47;
8798    /// Offset of the `GPF` field.
8799    pub const GPF_SHIFT: u32 = 48;
8800    /// Offset of the `TID4` field.
8801    pub const TID4_SHIFT: u32 = 49;
8802    /// Offset of the `TICAB` field.
8803    pub const TICAB_SHIFT: u32 = 50;
8804    /// Offset of the `AMVOFFEN` field.
8805    pub const AMVOFFEN_SHIFT: u32 = 51;
8806    /// Offset of the `TOCU` field.
8807    pub const TOCU_SHIFT: u32 = 52;
8808    /// Offset of the `EnSCXT` field.
8809    pub const ENSCXT_SHIFT: u32 = 53;
8810    /// Offset of the `TTLBIS` field.
8811    pub const TTLBIS_SHIFT: u32 = 54;
8812    /// Offset of the `TTLBOS` field.
8813    pub const TTLBOS_SHIFT: u32 = 55;
8814    /// Offset of the `ATA` field.
8815    pub const ATA_SHIFT: u32 = 56;
8816    /// Offset of the `DCT` field.
8817    pub const DCT_SHIFT: u32 = 57;
8818    /// Offset of the `TID5` field.
8819    pub const TID5_SHIFT: u32 = 58;
8820    /// Offset of the `TWEDEn` field.
8821    pub const TWEDEN_SHIFT: u32 = 59;
8822    /// Offset of the `TWEDEL` field.
8823    pub const TWEDEL_SHIFT: u32 = 60;
8824    /// Mask for the `TWEDEL` field.
8825    pub const TWEDEL_MASK: u64 = 0b1111;
8826
8827    /// Returns the value of the `BSU` field.
8828    pub const fn bsu(self) -> u8 {
8829        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
8830    }
8831
8832    /// Sets the value of the `BSU` field.
8833    pub const fn set_bsu(&mut self, value: u8) {
8834        let offset = Self::BSU_SHIFT;
8835        assert!(value & (Self::BSU_MASK as u8) == value);
8836        *self = Self::from_bits_retain(
8837            (self.bits() & !(Self::BSU_MASK << offset)) | ((value as u64) << offset),
8838        );
8839    }
8840
8841    /// Returns a copy with the `BSU` field set to the given value.
8842    pub const fn with_bsu(mut self, value: u8) -> Self {
8843        self.set_bsu(value);
8844        self
8845    }
8846
8847    /// Returns the value of the `TWEDEL` field.
8848    pub const fn twedel(self) -> u8 {
8849        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
8850    }
8851
8852    /// Sets the value of the `TWEDEL` field.
8853    pub const fn set_twedel(&mut self, value: u8) {
8854        let offset = Self::TWEDEL_SHIFT;
8855        assert!(value & (Self::TWEDEL_MASK as u8) == value);
8856        *self = Self::from_bits_retain(
8857            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
8858        );
8859    }
8860
8861    /// Returns a copy with the `TWEDEL` field set to the given value.
8862    pub const fn with_twedel(mut self, value: u8) -> Self {
8863        self.set_twedel(value);
8864        self
8865    }
8866}
8867
8868bitflags! {
8869    /// `HDCR` system register value.
8870    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8871    #[repr(transparent)]
8872    pub struct Hdcr: u32 {
8873        /// `TPMCR` bit.
8874        const TPMCR = 1 << 5;
8875        /// `TPM` bit.
8876        const TPM = 1 << 6;
8877        /// `HPME` bit.
8878        const HPME = 1 << 7;
8879        /// `TDE` bit.
8880        const TDE = 1 << 8;
8881        /// `TDA` bit.
8882        const TDA = 1 << 9;
8883        /// `TDOSA` bit.
8884        const TDOSA = 1 << 10;
8885        /// `TDRA` bit.
8886        const TDRA = 1 << 11;
8887        /// `HPMD` bit.
8888        const HPMD = 1 << 17;
8889        /// `TTRF` bit.
8890        const TTRF = 1 << 19;
8891        /// `HCCD` bit.
8892        const HCCD = 1 << 23;
8893        /// `HLP` bit.
8894        const HLP = 1 << 26;
8895        /// `TDCC` bit.
8896        const TDCC = 1 << 27;
8897        /// `MTPME` bit.
8898        const MTPME = 1 << 28;
8899        /// `HPMFZO` bit.
8900        const HPMFZO = 1 << 29;
8901    }
8902}
8903
8904impl Hdcr {
8905    /// Offset of the `HPMN` field.
8906    pub const HPMN_SHIFT: u32 = 0;
8907    /// Mask for the `HPMN` field.
8908    pub const HPMN_MASK: u32 = 0b11111;
8909    /// Offset of the `TPMCR` field.
8910    pub const TPMCR_SHIFT: u32 = 5;
8911    /// Offset of the `TPM` field.
8912    pub const TPM_SHIFT: u32 = 6;
8913    /// Offset of the `HPME` field.
8914    pub const HPME_SHIFT: u32 = 7;
8915    /// Offset of the `TDE` field.
8916    pub const TDE_SHIFT: u32 = 8;
8917    /// Offset of the `TDA` field.
8918    pub const TDA_SHIFT: u32 = 9;
8919    /// Offset of the `TDOSA` field.
8920    pub const TDOSA_SHIFT: u32 = 10;
8921    /// Offset of the `TDRA` field.
8922    pub const TDRA_SHIFT: u32 = 11;
8923    /// Offset of the `HPMD` field.
8924    pub const HPMD_SHIFT: u32 = 17;
8925    /// Offset of the `TTRF` field.
8926    pub const TTRF_SHIFT: u32 = 19;
8927    /// Offset of the `HCCD` field.
8928    pub const HCCD_SHIFT: u32 = 23;
8929    /// Offset of the `HLP` field.
8930    pub const HLP_SHIFT: u32 = 26;
8931    /// Offset of the `TDCC` field.
8932    pub const TDCC_SHIFT: u32 = 27;
8933    /// Offset of the `MTPME` field.
8934    pub const MTPME_SHIFT: u32 = 28;
8935    /// Offset of the `HPMFZO` field.
8936    pub const HPMFZO_SHIFT: u32 = 29;
8937
8938    /// Returns the value of the `HPMN` field.
8939    pub const fn hpmn(self) -> u8 {
8940        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
8941    }
8942
8943    /// Sets the value of the `HPMN` field.
8944    pub const fn set_hpmn(&mut self, value: u8) {
8945        let offset = Self::HPMN_SHIFT;
8946        assert!(value & (Self::HPMN_MASK as u8) == value);
8947        *self = Self::from_bits_retain(
8948            (self.bits() & !(Self::HPMN_MASK << offset)) | ((value as u32) << offset),
8949        );
8950    }
8951
8952    /// Returns a copy with the `HPMN` field set to the given value.
8953    pub const fn with_hpmn(mut self, value: u8) -> Self {
8954        self.set_hpmn(value);
8955        self
8956    }
8957}
8958
8959bitflags! {
8960    /// `HDFAR` system register value.
8961    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8962    #[repr(transparent)]
8963    pub struct Hdfar: u32 {
8964    }
8965}
8966
8967impl Hdfar {
8968    /// Offset of the `VA` field.
8969    pub const VA_SHIFT: u32 = 0;
8970    /// Mask for the `VA` field.
8971    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
8972
8973    /// Returns the value of the `VA` field.
8974    pub const fn va(self) -> u32 {
8975        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
8976    }
8977
8978    /// Sets the value of the `VA` field.
8979    pub const fn set_va(&mut self, value: u32) {
8980        let offset = Self::VA_SHIFT;
8981        assert!(value & (Self::VA_MASK as u32) == value);
8982        *self = Self::from_bits_retain(
8983            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
8984        );
8985    }
8986
8987    /// Returns a copy with the `VA` field set to the given value.
8988    pub const fn with_va(mut self, value: u32) -> Self {
8989        self.set_va(value);
8990        self
8991    }
8992}
8993
8994#[cfg(feature = "el2")]
8995bitflags! {
8996    /// `HDFGRTR2_EL2` system register value.
8997    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8998    #[repr(transparent)]
8999    pub struct Hdfgrtr2El2: u64 {
9000        /// `nPMECR_EL1` bit.
9001        const NPMECR_EL1 = 1 << 0;
9002        /// `nPMIAR_EL1` bit.
9003        const NPMIAR_EL1 = 1 << 1;
9004        /// `nPMICNTR_EL0` bit.
9005        const NPMICNTR_EL0 = 1 << 2;
9006        /// `nPMICFILTR_EL0` bit.
9007        const NPMICFILTR_EL0 = 1 << 3;
9008        /// `nPMUACR_EL1` bit.
9009        const NPMUACR_EL1 = 1 << 4;
9010        /// `nMDSELR_EL1` bit.
9011        const NMDSELR_EL1 = 1 << 5;
9012        /// `nPMSSDATA` bit.
9013        const NPMSSDATA = 1 << 6;
9014        /// `nPMSSCR_EL1` bit.
9015        const NPMSSCR_EL1 = 1 << 7;
9016        /// `nSPMEVCNTRn_EL0` bit.
9017        const NSPMEVCNTRN_EL0 = 1 << 8;
9018        /// `nSPMEVTYPERn_EL0` bit.
9019        const NSPMEVTYPERN_EL0 = 1 << 9;
9020        /// `nSPMSELR_EL0` bit.
9021        const NSPMSELR_EL0 = 1 << 10;
9022        /// `nSPMCNTEN` bit.
9023        const NSPMCNTEN = 1 << 11;
9024        /// `nSPMINTEN` bit.
9025        const NSPMINTEN = 1 << 12;
9026        /// `nSPMOVS` bit.
9027        const NSPMOVS = 1 << 13;
9028        /// `nSPMCR_EL0` bit.
9029        const NSPMCR_EL0 = 1 << 14;
9030        /// `nSPMACCESSR_EL1` bit.
9031        const NSPMACCESSR_EL1 = 1 << 15;
9032        /// `nSPMSCR_EL1` bit.
9033        const NSPMSCR_EL1 = 1 << 16;
9034        /// `nSPMID` bit.
9035        const NSPMID = 1 << 17;
9036        /// `nSPMDEVAFF_EL1` bit.
9037        const NSPMDEVAFF_EL1 = 1 << 18;
9038        /// `nPMSDSFR_EL1` bit.
9039        const NPMSDSFR_EL1 = 1 << 19;
9040        /// `nTRCITECR_EL1` bit.
9041        const NTRCITECR_EL1 = 1 << 20;
9042        /// `nTRBMPAM_EL1` bit.
9043        const NTRBMPAM_EL1 = 1 << 22;
9044        /// `nMDSTEPOP_EL1` bit.
9045        const NMDSTEPOP_EL1 = 1 << 23;
9046        /// `nPMBMAR_EL1` bit.
9047        const NPMBMAR_EL1 = 1 << 24;
9048    }
9049}
9050
9051#[cfg(feature = "el2")]
9052impl Hdfgrtr2El2 {
9053    /// Offset of the `nPMECR_EL1` field.
9054    pub const NPMECR_EL1_SHIFT: u32 = 0;
9055    /// Offset of the `nPMIAR_EL1` field.
9056    pub const NPMIAR_EL1_SHIFT: u32 = 1;
9057    /// Offset of the `nPMICNTR_EL0` field.
9058    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
9059    /// Offset of the `nPMICFILTR_EL0` field.
9060    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
9061    /// Offset of the `nPMUACR_EL1` field.
9062    pub const NPMUACR_EL1_SHIFT: u32 = 4;
9063    /// Offset of the `nMDSELR_EL1` field.
9064    pub const NMDSELR_EL1_SHIFT: u32 = 5;
9065    /// Offset of the `nPMSSDATA` field.
9066    pub const NPMSSDATA_SHIFT: u32 = 6;
9067    /// Offset of the `nPMSSCR_EL1` field.
9068    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
9069    /// Offset of the `nSPMEVCNTRn_EL0` field.
9070    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
9071    /// Offset of the `nSPMEVTYPERn_EL0` field.
9072    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
9073    /// Offset of the `nSPMSELR_EL0` field.
9074    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
9075    /// Offset of the `nSPMCNTEN` field.
9076    pub const NSPMCNTEN_SHIFT: u32 = 11;
9077    /// Offset of the `nSPMINTEN` field.
9078    pub const NSPMINTEN_SHIFT: u32 = 12;
9079    /// Offset of the `nSPMOVS` field.
9080    pub const NSPMOVS_SHIFT: u32 = 13;
9081    /// Offset of the `nSPMCR_EL0` field.
9082    pub const NSPMCR_EL0_SHIFT: u32 = 14;
9083    /// Offset of the `nSPMACCESSR_EL1` field.
9084    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
9085    /// Offset of the `nSPMSCR_EL1` field.
9086    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
9087    /// Offset of the `nSPMID` field.
9088    pub const NSPMID_SHIFT: u32 = 17;
9089    /// Offset of the `nSPMDEVAFF_EL1` field.
9090    pub const NSPMDEVAFF_EL1_SHIFT: u32 = 18;
9091    /// Offset of the `nPMSDSFR_EL1` field.
9092    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
9093    /// Offset of the `nTRCITECR_EL1` field.
9094    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
9095    /// Offset of the `nTRBMPAM_EL1` field.
9096    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
9097    /// Offset of the `nMDSTEPOP_EL1` field.
9098    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
9099    /// Offset of the `nPMBMAR_EL1` field.
9100    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
9101}
9102
9103#[cfg(feature = "el2")]
9104bitflags! {
9105    /// `HDFGRTR_EL2` system register value.
9106    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9107    #[repr(transparent)]
9108    pub struct HdfgrtrEl2: u64 {
9109        /// `DBGBCRn_EL1` bit.
9110        const DBGBCRN_EL1 = 1 << 0;
9111        /// `DBGBVRn_EL1` bit.
9112        const DBGBVRN_EL1 = 1 << 1;
9113        /// `DBGWCRn_EL1` bit.
9114        const DBGWCRN_EL1 = 1 << 2;
9115        /// `DBGWVRn_EL1` bit.
9116        const DBGWVRN_EL1 = 1 << 3;
9117        /// `MDSCR_EL1` bit.
9118        const MDSCR_EL1 = 1 << 4;
9119        /// `DBGCLAIM` bit.
9120        const DBGCLAIM = 1 << 5;
9121        /// `DBGAUTHSTATUS_EL1` bit.
9122        const DBGAUTHSTATUS_EL1 = 1 << 6;
9123        /// `DBGPRCR_EL1` bit.
9124        const DBGPRCR_EL1 = 1 << 7;
9125        /// `OSLSR_EL1` bit.
9126        const OSLSR_EL1 = 1 << 9;
9127        /// `OSECCR_EL1` bit.
9128        const OSECCR_EL1 = 1 << 10;
9129        /// `OSDLR_EL1` bit.
9130        const OSDLR_EL1 = 1 << 11;
9131        /// `PMEVCNTRn_EL0` bit.
9132        const PMEVCNTRN_EL0 = 1 << 12;
9133        /// `PMEVTYPERn_EL0` bit.
9134        const PMEVTYPERN_EL0 = 1 << 13;
9135        /// `PMCCFILTR_EL0` bit.
9136        const PMCCFILTR_EL0 = 1 << 14;
9137        /// `PMCCNTR_EL0` bit.
9138        const PMCCNTR_EL0 = 1 << 15;
9139        /// `PMCNTEN` bit.
9140        const PMCNTEN = 1 << 16;
9141        /// `PMINTEN` bit.
9142        const PMINTEN = 1 << 17;
9143        /// `PMOVS` bit.
9144        const PMOVS = 1 << 18;
9145        /// `PMSELR_EL0` bit.
9146        const PMSELR_EL0 = 1 << 19;
9147        /// `PMMIR_EL1` bit.
9148        const PMMIR_EL1 = 1 << 22;
9149        /// `PMBLIMITR_EL1` bit.
9150        const PMBLIMITR_EL1 = 1 << 23;
9151        /// `PMBPTR_EL1` bit.
9152        const PMBPTR_EL1 = 1 << 24;
9153        /// `PMBSR_EL1` bit.
9154        const PMBSR_EL1 = 1 << 25;
9155        /// `PMSCR_EL1` bit.
9156        const PMSCR_EL1 = 1 << 26;
9157        /// `PMSEVFR_EL1` bit.
9158        const PMSEVFR_EL1 = 1 << 27;
9159        /// `PMSFCR_EL1` bit.
9160        const PMSFCR_EL1 = 1 << 28;
9161        /// `PMSICR_EL1` bit.
9162        const PMSICR_EL1 = 1 << 29;
9163        /// `PMSIDR_EL1` bit.
9164        const PMSIDR_EL1 = 1 << 30;
9165        /// `PMSIRR_EL1` bit.
9166        const PMSIRR_EL1 = 1 << 31;
9167        /// `PMSLATFR_EL1` bit.
9168        const PMSLATFR_EL1 = 1 << 32;
9169        /// `TRC` bit.
9170        const TRC = 1 << 33;
9171        /// `TRCAUTHSTATUS` bit.
9172        const TRCAUTHSTATUS = 1 << 34;
9173        /// `TRCAUXCTLR` bit.
9174        const TRCAUXCTLR = 1 << 35;
9175        /// `TRCCLAIM` bit.
9176        const TRCCLAIM = 1 << 36;
9177        /// `TRCCNTVRn` bit.
9178        const TRCCNTVRN = 1 << 37;
9179        /// `TRCID` bit.
9180        const TRCID = 1 << 40;
9181        /// `TRCIMSPECn` bit.
9182        const TRCIMSPECN = 1 << 41;
9183        /// `TRCOSLSR` bit.
9184        const TRCOSLSR = 1 << 43;
9185        /// `TRCPRGCTLR` bit.
9186        const TRCPRGCTLR = 1 << 44;
9187        /// `TRCSEQSTR` bit.
9188        const TRCSEQSTR = 1 << 45;
9189        /// `TRCSSCSRn` bit.
9190        const TRCSSCSRN = 1 << 46;
9191        /// `TRCSTATR` bit.
9192        const TRCSTATR = 1 << 47;
9193        /// `TRCVICTLR` bit.
9194        const TRCVICTLR = 1 << 48;
9195        /// `TRBBASER_EL1` bit.
9196        const TRBBASER_EL1 = 1 << 50;
9197        /// `TRBIDR_EL1` bit.
9198        const TRBIDR_EL1 = 1 << 51;
9199        /// `TRBLIMITR_EL1` bit.
9200        const TRBLIMITR_EL1 = 1 << 52;
9201        /// `TRBMAR_EL1` bit.
9202        const TRBMAR_EL1 = 1 << 53;
9203        /// `TRBPTR_EL1` bit.
9204        const TRBPTR_EL1 = 1 << 54;
9205        /// `TRBSR_EL1` bit.
9206        const TRBSR_EL1 = 1 << 55;
9207        /// `TRBTRG_EL1` bit.
9208        const TRBTRG_EL1 = 1 << 56;
9209        /// `PMUSERENR_EL0` bit.
9210        const PMUSERENR_EL0 = 1 << 57;
9211        /// `PMCEIDn_EL0` bit.
9212        const PMCEIDN_EL0 = 1 << 58;
9213        /// `nBRBIDR` bit.
9214        const NBRBIDR = 1 << 59;
9215        /// `nBRBCTL` bit.
9216        const NBRBCTL = 1 << 60;
9217        /// `nBRBDATA` bit.
9218        const NBRBDATA = 1 << 61;
9219        /// `nPMSNEVFR_EL1` bit.
9220        const NPMSNEVFR_EL1 = 1 << 62;
9221        /// `PMBIDR_EL1` bit.
9222        const PMBIDR_EL1 = 1 << 63;
9223    }
9224}
9225
9226#[cfg(feature = "el2")]
9227impl HdfgrtrEl2 {
9228    /// Offset of the `DBGBCRn_EL1` field.
9229    pub const DBGBCRN_EL1_SHIFT: u32 = 0;
9230    /// Offset of the `DBGBVRn_EL1` field.
9231    pub const DBGBVRN_EL1_SHIFT: u32 = 1;
9232    /// Offset of the `DBGWCRn_EL1` field.
9233    pub const DBGWCRN_EL1_SHIFT: u32 = 2;
9234    /// Offset of the `DBGWVRn_EL1` field.
9235    pub const DBGWVRN_EL1_SHIFT: u32 = 3;
9236    /// Offset of the `MDSCR_EL1` field.
9237    pub const MDSCR_EL1_SHIFT: u32 = 4;
9238    /// Offset of the `DBGCLAIM` field.
9239    pub const DBGCLAIM_SHIFT: u32 = 5;
9240    /// Offset of the `DBGAUTHSTATUS_EL1` field.
9241    pub const DBGAUTHSTATUS_EL1_SHIFT: u32 = 6;
9242    /// Offset of the `DBGPRCR_EL1` field.
9243    pub const DBGPRCR_EL1_SHIFT: u32 = 7;
9244    /// Offset of the `OSLSR_EL1` field.
9245    pub const OSLSR_EL1_SHIFT: u32 = 9;
9246    /// Offset of the `OSECCR_EL1` field.
9247    pub const OSECCR_EL1_SHIFT: u32 = 10;
9248    /// Offset of the `OSDLR_EL1` field.
9249    pub const OSDLR_EL1_SHIFT: u32 = 11;
9250    /// Offset of the `PMEVCNTRn_EL0` field.
9251    pub const PMEVCNTRN_EL0_SHIFT: u32 = 12;
9252    /// Offset of the `PMEVTYPERn_EL0` field.
9253    pub const PMEVTYPERN_EL0_SHIFT: u32 = 13;
9254    /// Offset of the `PMCCFILTR_EL0` field.
9255    pub const PMCCFILTR_EL0_SHIFT: u32 = 14;
9256    /// Offset of the `PMCCNTR_EL0` field.
9257    pub const PMCCNTR_EL0_SHIFT: u32 = 15;
9258    /// Offset of the `PMCNTEN` field.
9259    pub const PMCNTEN_SHIFT: u32 = 16;
9260    /// Offset of the `PMINTEN` field.
9261    pub const PMINTEN_SHIFT: u32 = 17;
9262    /// Offset of the `PMOVS` field.
9263    pub const PMOVS_SHIFT: u32 = 18;
9264    /// Offset of the `PMSELR_EL0` field.
9265    pub const PMSELR_EL0_SHIFT: u32 = 19;
9266    /// Offset of the `PMMIR_EL1` field.
9267    pub const PMMIR_EL1_SHIFT: u32 = 22;
9268    /// Offset of the `PMBLIMITR_EL1` field.
9269    pub const PMBLIMITR_EL1_SHIFT: u32 = 23;
9270    /// Offset of the `PMBPTR_EL1` field.
9271    pub const PMBPTR_EL1_SHIFT: u32 = 24;
9272    /// Offset of the `PMBSR_EL1` field.
9273    pub const PMBSR_EL1_SHIFT: u32 = 25;
9274    /// Offset of the `PMSCR_EL1` field.
9275    pub const PMSCR_EL1_SHIFT: u32 = 26;
9276    /// Offset of the `PMSEVFR_EL1` field.
9277    pub const PMSEVFR_EL1_SHIFT: u32 = 27;
9278    /// Offset of the `PMSFCR_EL1` field.
9279    pub const PMSFCR_EL1_SHIFT: u32 = 28;
9280    /// Offset of the `PMSICR_EL1` field.
9281    pub const PMSICR_EL1_SHIFT: u32 = 29;
9282    /// Offset of the `PMSIDR_EL1` field.
9283    pub const PMSIDR_EL1_SHIFT: u32 = 30;
9284    /// Offset of the `PMSIRR_EL1` field.
9285    pub const PMSIRR_EL1_SHIFT: u32 = 31;
9286    /// Offset of the `PMSLATFR_EL1` field.
9287    pub const PMSLATFR_EL1_SHIFT: u32 = 32;
9288    /// Offset of the `TRC` field.
9289    pub const TRC_SHIFT: u32 = 33;
9290    /// Offset of the `TRCAUTHSTATUS` field.
9291    pub const TRCAUTHSTATUS_SHIFT: u32 = 34;
9292    /// Offset of the `TRCAUXCTLR` field.
9293    pub const TRCAUXCTLR_SHIFT: u32 = 35;
9294    /// Offset of the `TRCCLAIM` field.
9295    pub const TRCCLAIM_SHIFT: u32 = 36;
9296    /// Offset of the `TRCCNTVRn` field.
9297    pub const TRCCNTVRN_SHIFT: u32 = 37;
9298    /// Offset of the `TRCID` field.
9299    pub const TRCID_SHIFT: u32 = 40;
9300    /// Offset of the `TRCIMSPECn` field.
9301    pub const TRCIMSPECN_SHIFT: u32 = 41;
9302    /// Offset of the `TRCOSLSR` field.
9303    pub const TRCOSLSR_SHIFT: u32 = 43;
9304    /// Offset of the `TRCPRGCTLR` field.
9305    pub const TRCPRGCTLR_SHIFT: u32 = 44;
9306    /// Offset of the `TRCSEQSTR` field.
9307    pub const TRCSEQSTR_SHIFT: u32 = 45;
9308    /// Offset of the `TRCSSCSRn` field.
9309    pub const TRCSSCSRN_SHIFT: u32 = 46;
9310    /// Offset of the `TRCSTATR` field.
9311    pub const TRCSTATR_SHIFT: u32 = 47;
9312    /// Offset of the `TRCVICTLR` field.
9313    pub const TRCVICTLR_SHIFT: u32 = 48;
9314    /// Offset of the `TRBBASER_EL1` field.
9315    pub const TRBBASER_EL1_SHIFT: u32 = 50;
9316    /// Offset of the `TRBIDR_EL1` field.
9317    pub const TRBIDR_EL1_SHIFT: u32 = 51;
9318    /// Offset of the `TRBLIMITR_EL1` field.
9319    pub const TRBLIMITR_EL1_SHIFT: u32 = 52;
9320    /// Offset of the `TRBMAR_EL1` field.
9321    pub const TRBMAR_EL1_SHIFT: u32 = 53;
9322    /// Offset of the `TRBPTR_EL1` field.
9323    pub const TRBPTR_EL1_SHIFT: u32 = 54;
9324    /// Offset of the `TRBSR_EL1` field.
9325    pub const TRBSR_EL1_SHIFT: u32 = 55;
9326    /// Offset of the `TRBTRG_EL1` field.
9327    pub const TRBTRG_EL1_SHIFT: u32 = 56;
9328    /// Offset of the `PMUSERENR_EL0` field.
9329    pub const PMUSERENR_EL0_SHIFT: u32 = 57;
9330    /// Offset of the `PMCEIDn_EL0` field.
9331    pub const PMCEIDN_EL0_SHIFT: u32 = 58;
9332    /// Offset of the `nBRBIDR` field.
9333    pub const NBRBIDR_SHIFT: u32 = 59;
9334    /// Offset of the `nBRBCTL` field.
9335    pub const NBRBCTL_SHIFT: u32 = 60;
9336    /// Offset of the `nBRBDATA` field.
9337    pub const NBRBDATA_SHIFT: u32 = 61;
9338    /// Offset of the `nPMSNEVFR_EL1` field.
9339    pub const NPMSNEVFR_EL1_SHIFT: u32 = 62;
9340    /// Offset of the `PMBIDR_EL1` field.
9341    pub const PMBIDR_EL1_SHIFT: u32 = 63;
9342}
9343
9344#[cfg(feature = "el2")]
9345bitflags! {
9346    /// `HDFGWTR2_EL2` system register value.
9347    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9348    #[repr(transparent)]
9349    pub struct Hdfgwtr2El2: u64 {
9350        /// `nPMECR_EL1` bit.
9351        const NPMECR_EL1 = 1 << 0;
9352        /// `nPMIAR_EL1` bit.
9353        const NPMIAR_EL1 = 1 << 1;
9354        /// `nPMICNTR_EL0` bit.
9355        const NPMICNTR_EL0 = 1 << 2;
9356        /// `nPMICFILTR_EL0` bit.
9357        const NPMICFILTR_EL0 = 1 << 3;
9358        /// `nPMUACR_EL1` bit.
9359        const NPMUACR_EL1 = 1 << 4;
9360        /// `nMDSELR_EL1` bit.
9361        const NMDSELR_EL1 = 1 << 5;
9362        /// `nPMSSCR_EL1` bit.
9363        const NPMSSCR_EL1 = 1 << 7;
9364        /// `nSPMEVCNTRn_EL0` bit.
9365        const NSPMEVCNTRN_EL0 = 1 << 8;
9366        /// `nSPMEVTYPERn_EL0` bit.
9367        const NSPMEVTYPERN_EL0 = 1 << 9;
9368        /// `nSPMSELR_EL0` bit.
9369        const NSPMSELR_EL0 = 1 << 10;
9370        /// `nSPMCNTEN` bit.
9371        const NSPMCNTEN = 1 << 11;
9372        /// `nSPMINTEN` bit.
9373        const NSPMINTEN = 1 << 12;
9374        /// `nSPMOVS` bit.
9375        const NSPMOVS = 1 << 13;
9376        /// `nSPMCR_EL0` bit.
9377        const NSPMCR_EL0 = 1 << 14;
9378        /// `nSPMACCESSR_EL1` bit.
9379        const NSPMACCESSR_EL1 = 1 << 15;
9380        /// `nSPMSCR_EL1` bit.
9381        const NSPMSCR_EL1 = 1 << 16;
9382        /// `nPMSDSFR_EL1` bit.
9383        const NPMSDSFR_EL1 = 1 << 19;
9384        /// `nTRCITECR_EL1` bit.
9385        const NTRCITECR_EL1 = 1 << 20;
9386        /// `nPMZR_EL0` bit.
9387        const NPMZR_EL0 = 1 << 21;
9388        /// `nTRBMPAM_EL1` bit.
9389        const NTRBMPAM_EL1 = 1 << 22;
9390        /// `nMDSTEPOP_EL1` bit.
9391        const NMDSTEPOP_EL1 = 1 << 23;
9392        /// `nPMBMAR_EL1` bit.
9393        const NPMBMAR_EL1 = 1 << 24;
9394    }
9395}
9396
9397#[cfg(feature = "el2")]
9398impl Hdfgwtr2El2 {
9399    /// Offset of the `nPMECR_EL1` field.
9400    pub const NPMECR_EL1_SHIFT: u32 = 0;
9401    /// Offset of the `nPMIAR_EL1` field.
9402    pub const NPMIAR_EL1_SHIFT: u32 = 1;
9403    /// Offset of the `nPMICNTR_EL0` field.
9404    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
9405    /// Offset of the `nPMICFILTR_EL0` field.
9406    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
9407    /// Offset of the `nPMUACR_EL1` field.
9408    pub const NPMUACR_EL1_SHIFT: u32 = 4;
9409    /// Offset of the `nMDSELR_EL1` field.
9410    pub const NMDSELR_EL1_SHIFT: u32 = 5;
9411    /// Offset of the `nPMSSCR_EL1` field.
9412    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
9413    /// Offset of the `nSPMEVCNTRn_EL0` field.
9414    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
9415    /// Offset of the `nSPMEVTYPERn_EL0` field.
9416    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
9417    /// Offset of the `nSPMSELR_EL0` field.
9418    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
9419    /// Offset of the `nSPMCNTEN` field.
9420    pub const NSPMCNTEN_SHIFT: u32 = 11;
9421    /// Offset of the `nSPMINTEN` field.
9422    pub const NSPMINTEN_SHIFT: u32 = 12;
9423    /// Offset of the `nSPMOVS` field.
9424    pub const NSPMOVS_SHIFT: u32 = 13;
9425    /// Offset of the `nSPMCR_EL0` field.
9426    pub const NSPMCR_EL0_SHIFT: u32 = 14;
9427    /// Offset of the `nSPMACCESSR_EL1` field.
9428    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
9429    /// Offset of the `nSPMSCR_EL1` field.
9430    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
9431    /// Offset of the `nPMSDSFR_EL1` field.
9432    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
9433    /// Offset of the `nTRCITECR_EL1` field.
9434    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
9435    /// Offset of the `nPMZR_EL0` field.
9436    pub const NPMZR_EL0_SHIFT: u32 = 21;
9437    /// Offset of the `nTRBMPAM_EL1` field.
9438    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
9439    /// Offset of the `nMDSTEPOP_EL1` field.
9440    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
9441    /// Offset of the `nPMBMAR_EL1` field.
9442    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
9443}
9444
9445#[cfg(feature = "el2")]
9446bitflags! {
9447    /// `HDFGWTR_EL2` system register value.
9448    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9449    #[repr(transparent)]
9450    pub struct HdfgwtrEl2: u64 {
9451        /// `DBGBCRn_EL1` bit.
9452        const DBGBCRN_EL1 = 1 << 0;
9453        /// `DBGBVRn_EL1` bit.
9454        const DBGBVRN_EL1 = 1 << 1;
9455        /// `DBGWCRn_EL1` bit.
9456        const DBGWCRN_EL1 = 1 << 2;
9457        /// `DBGWVRn_EL1` bit.
9458        const DBGWVRN_EL1 = 1 << 3;
9459        /// `MDSCR_EL1` bit.
9460        const MDSCR_EL1 = 1 << 4;
9461        /// `DBGCLAIM` bit.
9462        const DBGCLAIM = 1 << 5;
9463        /// `DBGPRCR_EL1` bit.
9464        const DBGPRCR_EL1 = 1 << 7;
9465        /// `OSLAR_EL1` bit.
9466        const OSLAR_EL1 = 1 << 8;
9467        /// `OSECCR_EL1` bit.
9468        const OSECCR_EL1 = 1 << 10;
9469        /// `OSDLR_EL1` bit.
9470        const OSDLR_EL1 = 1 << 11;
9471        /// `PMEVCNTRn_EL0` bit.
9472        const PMEVCNTRN_EL0 = 1 << 12;
9473        /// `PMEVTYPERn_EL0` bit.
9474        const PMEVTYPERN_EL0 = 1 << 13;
9475        /// `PMCCFILTR_EL0` bit.
9476        const PMCCFILTR_EL0 = 1 << 14;
9477        /// `PMCCNTR_EL0` bit.
9478        const PMCCNTR_EL0 = 1 << 15;
9479        /// `PMCNTEN` bit.
9480        const PMCNTEN = 1 << 16;
9481        /// `PMINTEN` bit.
9482        const PMINTEN = 1 << 17;
9483        /// `PMOVS` bit.
9484        const PMOVS = 1 << 18;
9485        /// `PMSELR_EL0` bit.
9486        const PMSELR_EL0 = 1 << 19;
9487        /// `PMSWINC_EL0` bit.
9488        const PMSWINC_EL0 = 1 << 20;
9489        /// `PMCR_EL0` bit.
9490        const PMCR_EL0 = 1 << 21;
9491        /// `PMBLIMITR_EL1` bit.
9492        const PMBLIMITR_EL1 = 1 << 23;
9493        /// `PMBPTR_EL1` bit.
9494        const PMBPTR_EL1 = 1 << 24;
9495        /// `PMBSR_EL1` bit.
9496        const PMBSR_EL1 = 1 << 25;
9497        /// `PMSCR_EL1` bit.
9498        const PMSCR_EL1 = 1 << 26;
9499        /// `PMSEVFR_EL1` bit.
9500        const PMSEVFR_EL1 = 1 << 27;
9501        /// `PMSFCR_EL1` bit.
9502        const PMSFCR_EL1 = 1 << 28;
9503        /// `PMSICR_EL1` bit.
9504        const PMSICR_EL1 = 1 << 29;
9505        /// `PMSIRR_EL1` bit.
9506        const PMSIRR_EL1 = 1 << 31;
9507        /// `PMSLATFR_EL1` bit.
9508        const PMSLATFR_EL1 = 1 << 32;
9509        /// `TRC` bit.
9510        const TRC = 1 << 33;
9511        /// `TRCAUXCTLR` bit.
9512        const TRCAUXCTLR = 1 << 35;
9513        /// `TRCCLAIM` bit.
9514        const TRCCLAIM = 1 << 36;
9515        /// `TRCCNTVRn` bit.
9516        const TRCCNTVRN = 1 << 37;
9517        /// `TRCIMSPECn` bit.
9518        const TRCIMSPECN = 1 << 41;
9519        /// `TRCOSLAR` bit.
9520        const TRCOSLAR = 1 << 42;
9521        /// `TRCPRGCTLR` bit.
9522        const TRCPRGCTLR = 1 << 44;
9523        /// `TRCSEQSTR` bit.
9524        const TRCSEQSTR = 1 << 45;
9525        /// `TRCSSCSRn` bit.
9526        const TRCSSCSRN = 1 << 46;
9527        /// `TRCVICTLR` bit.
9528        const TRCVICTLR = 1 << 48;
9529        /// `TRFCR_EL1` bit.
9530        const TRFCR_EL1 = 1 << 49;
9531        /// `TRBBASER_EL1` bit.
9532        const TRBBASER_EL1 = 1 << 50;
9533        /// `TRBLIMITR_EL1` bit.
9534        const TRBLIMITR_EL1 = 1 << 52;
9535        /// `TRBMAR_EL1` bit.
9536        const TRBMAR_EL1 = 1 << 53;
9537        /// `TRBPTR_EL1` bit.
9538        const TRBPTR_EL1 = 1 << 54;
9539        /// `TRBSR_EL1` bit.
9540        const TRBSR_EL1 = 1 << 55;
9541        /// `TRBTRG_EL1` bit.
9542        const TRBTRG_EL1 = 1 << 56;
9543        /// `PMUSERENR_EL0` bit.
9544        const PMUSERENR_EL0 = 1 << 57;
9545        /// `nBRBCTL` bit.
9546        const NBRBCTL = 1 << 60;
9547        /// `nBRBDATA` bit.
9548        const NBRBDATA = 1 << 61;
9549        /// `nPMSNEVFR_EL1` bit.
9550        const NPMSNEVFR_EL1 = 1 << 62;
9551    }
9552}
9553
9554#[cfg(feature = "el2")]
9555impl HdfgwtrEl2 {
9556    /// Offset of the `DBGBCRn_EL1` field.
9557    pub const DBGBCRN_EL1_SHIFT: u32 = 0;
9558    /// Offset of the `DBGBVRn_EL1` field.
9559    pub const DBGBVRN_EL1_SHIFT: u32 = 1;
9560    /// Offset of the `DBGWCRn_EL1` field.
9561    pub const DBGWCRN_EL1_SHIFT: u32 = 2;
9562    /// Offset of the `DBGWVRn_EL1` field.
9563    pub const DBGWVRN_EL1_SHIFT: u32 = 3;
9564    /// Offset of the `MDSCR_EL1` field.
9565    pub const MDSCR_EL1_SHIFT: u32 = 4;
9566    /// Offset of the `DBGCLAIM` field.
9567    pub const DBGCLAIM_SHIFT: u32 = 5;
9568    /// Offset of the `DBGPRCR_EL1` field.
9569    pub const DBGPRCR_EL1_SHIFT: u32 = 7;
9570    /// Offset of the `OSLAR_EL1` field.
9571    pub const OSLAR_EL1_SHIFT: u32 = 8;
9572    /// Offset of the `OSECCR_EL1` field.
9573    pub const OSECCR_EL1_SHIFT: u32 = 10;
9574    /// Offset of the `OSDLR_EL1` field.
9575    pub const OSDLR_EL1_SHIFT: u32 = 11;
9576    /// Offset of the `PMEVCNTRn_EL0` field.
9577    pub const PMEVCNTRN_EL0_SHIFT: u32 = 12;
9578    /// Offset of the `PMEVTYPERn_EL0` field.
9579    pub const PMEVTYPERN_EL0_SHIFT: u32 = 13;
9580    /// Offset of the `PMCCFILTR_EL0` field.
9581    pub const PMCCFILTR_EL0_SHIFT: u32 = 14;
9582    /// Offset of the `PMCCNTR_EL0` field.
9583    pub const PMCCNTR_EL0_SHIFT: u32 = 15;
9584    /// Offset of the `PMCNTEN` field.
9585    pub const PMCNTEN_SHIFT: u32 = 16;
9586    /// Offset of the `PMINTEN` field.
9587    pub const PMINTEN_SHIFT: u32 = 17;
9588    /// Offset of the `PMOVS` field.
9589    pub const PMOVS_SHIFT: u32 = 18;
9590    /// Offset of the `PMSELR_EL0` field.
9591    pub const PMSELR_EL0_SHIFT: u32 = 19;
9592    /// Offset of the `PMSWINC_EL0` field.
9593    pub const PMSWINC_EL0_SHIFT: u32 = 20;
9594    /// Offset of the `PMCR_EL0` field.
9595    pub const PMCR_EL0_SHIFT: u32 = 21;
9596    /// Offset of the `PMBLIMITR_EL1` field.
9597    pub const PMBLIMITR_EL1_SHIFT: u32 = 23;
9598    /// Offset of the `PMBPTR_EL1` field.
9599    pub const PMBPTR_EL1_SHIFT: u32 = 24;
9600    /// Offset of the `PMBSR_EL1` field.
9601    pub const PMBSR_EL1_SHIFT: u32 = 25;
9602    /// Offset of the `PMSCR_EL1` field.
9603    pub const PMSCR_EL1_SHIFT: u32 = 26;
9604    /// Offset of the `PMSEVFR_EL1` field.
9605    pub const PMSEVFR_EL1_SHIFT: u32 = 27;
9606    /// Offset of the `PMSFCR_EL1` field.
9607    pub const PMSFCR_EL1_SHIFT: u32 = 28;
9608    /// Offset of the `PMSICR_EL1` field.
9609    pub const PMSICR_EL1_SHIFT: u32 = 29;
9610    /// Offset of the `PMSIRR_EL1` field.
9611    pub const PMSIRR_EL1_SHIFT: u32 = 31;
9612    /// Offset of the `PMSLATFR_EL1` field.
9613    pub const PMSLATFR_EL1_SHIFT: u32 = 32;
9614    /// Offset of the `TRC` field.
9615    pub const TRC_SHIFT: u32 = 33;
9616    /// Offset of the `TRCAUXCTLR` field.
9617    pub const TRCAUXCTLR_SHIFT: u32 = 35;
9618    /// Offset of the `TRCCLAIM` field.
9619    pub const TRCCLAIM_SHIFT: u32 = 36;
9620    /// Offset of the `TRCCNTVRn` field.
9621    pub const TRCCNTVRN_SHIFT: u32 = 37;
9622    /// Offset of the `TRCIMSPECn` field.
9623    pub const TRCIMSPECN_SHIFT: u32 = 41;
9624    /// Offset of the `TRCOSLAR` field.
9625    pub const TRCOSLAR_SHIFT: u32 = 42;
9626    /// Offset of the `TRCPRGCTLR` field.
9627    pub const TRCPRGCTLR_SHIFT: u32 = 44;
9628    /// Offset of the `TRCSEQSTR` field.
9629    pub const TRCSEQSTR_SHIFT: u32 = 45;
9630    /// Offset of the `TRCSSCSRn` field.
9631    pub const TRCSSCSRN_SHIFT: u32 = 46;
9632    /// Offset of the `TRCVICTLR` field.
9633    pub const TRCVICTLR_SHIFT: u32 = 48;
9634    /// Offset of the `TRFCR_EL1` field.
9635    pub const TRFCR_EL1_SHIFT: u32 = 49;
9636    /// Offset of the `TRBBASER_EL1` field.
9637    pub const TRBBASER_EL1_SHIFT: u32 = 50;
9638    /// Offset of the `TRBLIMITR_EL1` field.
9639    pub const TRBLIMITR_EL1_SHIFT: u32 = 52;
9640    /// Offset of the `TRBMAR_EL1` field.
9641    pub const TRBMAR_EL1_SHIFT: u32 = 53;
9642    /// Offset of the `TRBPTR_EL1` field.
9643    pub const TRBPTR_EL1_SHIFT: u32 = 54;
9644    /// Offset of the `TRBSR_EL1` field.
9645    pub const TRBSR_EL1_SHIFT: u32 = 55;
9646    /// Offset of the `TRBTRG_EL1` field.
9647    pub const TRBTRG_EL1_SHIFT: u32 = 56;
9648    /// Offset of the `PMUSERENR_EL0` field.
9649    pub const PMUSERENR_EL0_SHIFT: u32 = 57;
9650    /// Offset of the `nBRBCTL` field.
9651    pub const NBRBCTL_SHIFT: u32 = 60;
9652    /// Offset of the `nBRBDATA` field.
9653    pub const NBRBDATA_SHIFT: u32 = 61;
9654    /// Offset of the `nPMSNEVFR_EL1` field.
9655    pub const NPMSNEVFR_EL1_SHIFT: u32 = 62;
9656}
9657
9658#[cfg(feature = "el2")]
9659bitflags! {
9660    /// `HFGITR2_EL2` system register value.
9661    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9662    #[repr(transparent)]
9663    pub struct Hfgitr2El2: u64 {
9664        /// `TSBCSYNC` bit.
9665        const TSBCSYNC = 1 << 0;
9666        /// `nDCCIVAPS` bit.
9667        const NDCCIVAPS = 1 << 1;
9668        /// `PLBIPERME1OS` bit.
9669        const PLBIPERME1OS = 1 << 2;
9670        /// `PLBIASIDE1OS` bit.
9671        const PLBIASIDE1OS = 1 << 3;
9672        /// `PLBIVMALLE1OS` bit.
9673        const PLBIVMALLE1OS = 1 << 4;
9674        /// `PLBIPERME1IS` bit.
9675        const PLBIPERME1IS = 1 << 5;
9676        /// `PLBIASIDE1IS` bit.
9677        const PLBIASIDE1IS = 1 << 6;
9678        /// `PLBIVMALLE1IS` bit.
9679        const PLBIVMALLE1IS = 1 << 7;
9680        /// `PLBIPERME1` bit.
9681        const PLBIPERME1 = 1 << 8;
9682        /// `PLBIASIDE1` bit.
9683        const PLBIASIDE1 = 1 << 9;
9684        /// `PLBIVMALLE1` bit.
9685        const PLBIVMALLE1 = 1 << 10;
9686        /// `PLBIPERMAE1OS` bit.
9687        const PLBIPERMAE1OS = 1 << 11;
9688        /// `PLBIPERMAE1IS` bit.
9689        const PLBIPERMAE1IS = 1 << 12;
9690        /// `PLBIPERMAE1` bit.
9691        const PLBIPERMAE1 = 1 << 13;
9692        /// `DCGBVA` bit.
9693        const DCGBVA = 1 << 14;
9694    }
9695}
9696
9697#[cfg(feature = "el2")]
9698impl Hfgitr2El2 {
9699    /// Offset of the `TSBCSYNC` field.
9700    pub const TSBCSYNC_SHIFT: u32 = 0;
9701    /// Offset of the `nDCCIVAPS` field.
9702    pub const NDCCIVAPS_SHIFT: u32 = 1;
9703    /// Offset of the `PLBIPERME1OS` field.
9704    pub const PLBIPERME1OS_SHIFT: u32 = 2;
9705    /// Offset of the `PLBIASIDE1OS` field.
9706    pub const PLBIASIDE1OS_SHIFT: u32 = 3;
9707    /// Offset of the `PLBIVMALLE1OS` field.
9708    pub const PLBIVMALLE1OS_SHIFT: u32 = 4;
9709    /// Offset of the `PLBIPERME1IS` field.
9710    pub const PLBIPERME1IS_SHIFT: u32 = 5;
9711    /// Offset of the `PLBIASIDE1IS` field.
9712    pub const PLBIASIDE1IS_SHIFT: u32 = 6;
9713    /// Offset of the `PLBIVMALLE1IS` field.
9714    pub const PLBIVMALLE1IS_SHIFT: u32 = 7;
9715    /// Offset of the `PLBIPERME1` field.
9716    pub const PLBIPERME1_SHIFT: u32 = 8;
9717    /// Offset of the `PLBIASIDE1` field.
9718    pub const PLBIASIDE1_SHIFT: u32 = 9;
9719    /// Offset of the `PLBIVMALLE1` field.
9720    pub const PLBIVMALLE1_SHIFT: u32 = 10;
9721    /// Offset of the `PLBIPERMAE1OS` field.
9722    pub const PLBIPERMAE1OS_SHIFT: u32 = 11;
9723    /// Offset of the `PLBIPERMAE1IS` field.
9724    pub const PLBIPERMAE1IS_SHIFT: u32 = 12;
9725    /// Offset of the `PLBIPERMAE1` field.
9726    pub const PLBIPERMAE1_SHIFT: u32 = 13;
9727    /// Offset of the `DCGBVA` field.
9728    pub const DCGBVA_SHIFT: u32 = 14;
9729}
9730
9731#[cfg(feature = "el2")]
9732bitflags! {
9733    /// `HFGITR_EL2` system register value.
9734    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9735    #[repr(transparent)]
9736    pub struct HfgitrEl2: u64 {
9737        /// `ICIALLUIS` bit.
9738        const ICIALLUIS = 1 << 0;
9739        /// `ICIALLU` bit.
9740        const ICIALLU = 1 << 1;
9741        /// `ICIVAU` bit.
9742        const ICIVAU = 1 << 2;
9743        /// `DCIVAC` bit.
9744        const DCIVAC = 1 << 3;
9745        /// `DCISW` bit.
9746        const DCISW = 1 << 4;
9747        /// `DCCSW` bit.
9748        const DCCSW = 1 << 5;
9749        /// `DCCISW` bit.
9750        const DCCISW = 1 << 6;
9751        /// `DCCVAU` bit.
9752        const DCCVAU = 1 << 7;
9753        /// `DCCVAP` bit.
9754        const DCCVAP = 1 << 8;
9755        /// `DCCVADP` bit.
9756        const DCCVADP = 1 << 9;
9757        /// `DCCIVAC` bit.
9758        const DCCIVAC = 1 << 10;
9759        /// `DCZVA` bit.
9760        const DCZVA = 1 << 11;
9761        /// `ATS1E1R` bit.
9762        const ATS1E1R = 1 << 12;
9763        /// `ATS1E1W` bit.
9764        const ATS1E1W = 1 << 13;
9765        /// `ATS1E0R` bit.
9766        const ATS1E0R = 1 << 14;
9767        /// `ATS1E0W` bit.
9768        const ATS1E0W = 1 << 15;
9769        /// `ATS1E1RP` bit.
9770        const ATS1E1RP = 1 << 16;
9771        /// `ATS1E1WP` bit.
9772        const ATS1E1WP = 1 << 17;
9773        /// `TLBIVMALLE1OS` bit.
9774        const TLBIVMALLE1OS = 1 << 18;
9775        /// `TLBIVAE1OS` bit.
9776        const TLBIVAE1OS = 1 << 19;
9777        /// `TLBIASIDE1OS` bit.
9778        const TLBIASIDE1OS = 1 << 20;
9779        /// `TLBIVAAE1OS` bit.
9780        const TLBIVAAE1OS = 1 << 21;
9781        /// `TLBIVALE1OS` bit.
9782        const TLBIVALE1OS = 1 << 22;
9783        /// `TLBIVAALE1OS` bit.
9784        const TLBIVAALE1OS = 1 << 23;
9785        /// `TLBIRVAE1OS` bit.
9786        const TLBIRVAE1OS = 1 << 24;
9787        /// `TLBIRVAAE1OS` bit.
9788        const TLBIRVAAE1OS = 1 << 25;
9789        /// `TLBIRVALE1OS` bit.
9790        const TLBIRVALE1OS = 1 << 26;
9791        /// `TLBIRVAALE1OS` bit.
9792        const TLBIRVAALE1OS = 1 << 27;
9793        /// `TLBIVMALLE1IS` bit.
9794        const TLBIVMALLE1IS = 1 << 28;
9795        /// `TLBIVAE1IS` bit.
9796        const TLBIVAE1IS = 1 << 29;
9797        /// `TLBIASIDE1IS` bit.
9798        const TLBIASIDE1IS = 1 << 30;
9799        /// `TLBIVAAE1IS` bit.
9800        const TLBIVAAE1IS = 1 << 31;
9801        /// `TLBIVALE1IS` bit.
9802        const TLBIVALE1IS = 1 << 32;
9803        /// `TLBIVAALE1IS` bit.
9804        const TLBIVAALE1IS = 1 << 33;
9805        /// `TLBIRVAE1IS` bit.
9806        const TLBIRVAE1IS = 1 << 34;
9807        /// `TLBIRVAAE1IS` bit.
9808        const TLBIRVAAE1IS = 1 << 35;
9809        /// `TLBIRVALE1IS` bit.
9810        const TLBIRVALE1IS = 1 << 36;
9811        /// `TLBIRVAALE1IS` bit.
9812        const TLBIRVAALE1IS = 1 << 37;
9813        /// `TLBIRVAE1` bit.
9814        const TLBIRVAE1 = 1 << 38;
9815        /// `TLBIRVAAE1` bit.
9816        const TLBIRVAAE1 = 1 << 39;
9817        /// `TLBIRVALE1` bit.
9818        const TLBIRVALE1 = 1 << 40;
9819        /// `TLBIRVAALE1` bit.
9820        const TLBIRVAALE1 = 1 << 41;
9821        /// `TLBIVMALLE1` bit.
9822        const TLBIVMALLE1 = 1 << 42;
9823        /// `TLBIVAE1` bit.
9824        const TLBIVAE1 = 1 << 43;
9825        /// `TLBIASIDE1` bit.
9826        const TLBIASIDE1 = 1 << 44;
9827        /// `TLBIVAAE1` bit.
9828        const TLBIVAAE1 = 1 << 45;
9829        /// `TLBIVALE1` bit.
9830        const TLBIVALE1 = 1 << 46;
9831        /// `TLBIVAALE1` bit.
9832        const TLBIVAALE1 = 1 << 47;
9833        /// `CFPRCTX` bit.
9834        const CFPRCTX = 1 << 48;
9835        /// `DVPRCTX` bit.
9836        const DVPRCTX = 1 << 49;
9837        /// `CPPRCTX` bit.
9838        const CPPRCTX = 1 << 50;
9839        /// `ERET` bit.
9840        const ERET = 1 << 51;
9841        /// `SVC_EL0` bit.
9842        const SVC_EL0 = 1 << 52;
9843        /// `SVC_EL1` bit.
9844        const SVC_EL1 = 1 << 53;
9845        /// `DCCVAC` bit.
9846        const DCCVAC = 1 << 54;
9847        /// `nBRBINJ` bit.
9848        const NBRBINJ = 1 << 55;
9849        /// `nBRBIALL` bit.
9850        const NBRBIALL = 1 << 56;
9851        /// `nGCSPUSHM_EL1` bit.
9852        const NGCSPUSHM_EL1 = 1 << 57;
9853        /// `nGCSSTR_EL1` bit.
9854        const NGCSSTR_EL1 = 1 << 58;
9855        /// `nGCSEPP` bit.
9856        const NGCSEPP = 1 << 59;
9857        /// `COSPRCTX` bit.
9858        const COSPRCTX = 1 << 60;
9859        /// `ATS1E1A` bit.
9860        const ATS1E1A = 1 << 62;
9861        /// `PSBCSYNC` bit.
9862        const PSBCSYNC = 1 << 63;
9863    }
9864}
9865
9866#[cfg(feature = "el2")]
9867impl HfgitrEl2 {
9868    /// Offset of the `ICIALLUIS` field.
9869    pub const ICIALLUIS_SHIFT: u32 = 0;
9870    /// Offset of the `ICIALLU` field.
9871    pub const ICIALLU_SHIFT: u32 = 1;
9872    /// Offset of the `ICIVAU` field.
9873    pub const ICIVAU_SHIFT: u32 = 2;
9874    /// Offset of the `DCIVAC` field.
9875    pub const DCIVAC_SHIFT: u32 = 3;
9876    /// Offset of the `DCISW` field.
9877    pub const DCISW_SHIFT: u32 = 4;
9878    /// Offset of the `DCCSW` field.
9879    pub const DCCSW_SHIFT: u32 = 5;
9880    /// Offset of the `DCCISW` field.
9881    pub const DCCISW_SHIFT: u32 = 6;
9882    /// Offset of the `DCCVAU` field.
9883    pub const DCCVAU_SHIFT: u32 = 7;
9884    /// Offset of the `DCCVAP` field.
9885    pub const DCCVAP_SHIFT: u32 = 8;
9886    /// Offset of the `DCCVADP` field.
9887    pub const DCCVADP_SHIFT: u32 = 9;
9888    /// Offset of the `DCCIVAC` field.
9889    pub const DCCIVAC_SHIFT: u32 = 10;
9890    /// Offset of the `DCZVA` field.
9891    pub const DCZVA_SHIFT: u32 = 11;
9892    /// Offset of the `ATS1E1R` field.
9893    pub const ATS1E1R_SHIFT: u32 = 12;
9894    /// Offset of the `ATS1E1W` field.
9895    pub const ATS1E1W_SHIFT: u32 = 13;
9896    /// Offset of the `ATS1E0R` field.
9897    pub const ATS1E0R_SHIFT: u32 = 14;
9898    /// Offset of the `ATS1E0W` field.
9899    pub const ATS1E0W_SHIFT: u32 = 15;
9900    /// Offset of the `ATS1E1RP` field.
9901    pub const ATS1E1RP_SHIFT: u32 = 16;
9902    /// Offset of the `ATS1E1WP` field.
9903    pub const ATS1E1WP_SHIFT: u32 = 17;
9904    /// Offset of the `TLBIVMALLE1OS` field.
9905    pub const TLBIVMALLE1OS_SHIFT: u32 = 18;
9906    /// Offset of the `TLBIVAE1OS` field.
9907    pub const TLBIVAE1OS_SHIFT: u32 = 19;
9908    /// Offset of the `TLBIASIDE1OS` field.
9909    pub const TLBIASIDE1OS_SHIFT: u32 = 20;
9910    /// Offset of the `TLBIVAAE1OS` field.
9911    pub const TLBIVAAE1OS_SHIFT: u32 = 21;
9912    /// Offset of the `TLBIVALE1OS` field.
9913    pub const TLBIVALE1OS_SHIFT: u32 = 22;
9914    /// Offset of the `TLBIVAALE1OS` field.
9915    pub const TLBIVAALE1OS_SHIFT: u32 = 23;
9916    /// Offset of the `TLBIRVAE1OS` field.
9917    pub const TLBIRVAE1OS_SHIFT: u32 = 24;
9918    /// Offset of the `TLBIRVAAE1OS` field.
9919    pub const TLBIRVAAE1OS_SHIFT: u32 = 25;
9920    /// Offset of the `TLBIRVALE1OS` field.
9921    pub const TLBIRVALE1OS_SHIFT: u32 = 26;
9922    /// Offset of the `TLBIRVAALE1OS` field.
9923    pub const TLBIRVAALE1OS_SHIFT: u32 = 27;
9924    /// Offset of the `TLBIVMALLE1IS` field.
9925    pub const TLBIVMALLE1IS_SHIFT: u32 = 28;
9926    /// Offset of the `TLBIVAE1IS` field.
9927    pub const TLBIVAE1IS_SHIFT: u32 = 29;
9928    /// Offset of the `TLBIASIDE1IS` field.
9929    pub const TLBIASIDE1IS_SHIFT: u32 = 30;
9930    /// Offset of the `TLBIVAAE1IS` field.
9931    pub const TLBIVAAE1IS_SHIFT: u32 = 31;
9932    /// Offset of the `TLBIVALE1IS` field.
9933    pub const TLBIVALE1IS_SHIFT: u32 = 32;
9934    /// Offset of the `TLBIVAALE1IS` field.
9935    pub const TLBIVAALE1IS_SHIFT: u32 = 33;
9936    /// Offset of the `TLBIRVAE1IS` field.
9937    pub const TLBIRVAE1IS_SHIFT: u32 = 34;
9938    /// Offset of the `TLBIRVAAE1IS` field.
9939    pub const TLBIRVAAE1IS_SHIFT: u32 = 35;
9940    /// Offset of the `TLBIRVALE1IS` field.
9941    pub const TLBIRVALE1IS_SHIFT: u32 = 36;
9942    /// Offset of the `TLBIRVAALE1IS` field.
9943    pub const TLBIRVAALE1IS_SHIFT: u32 = 37;
9944    /// Offset of the `TLBIRVAE1` field.
9945    pub const TLBIRVAE1_SHIFT: u32 = 38;
9946    /// Offset of the `TLBIRVAAE1` field.
9947    pub const TLBIRVAAE1_SHIFT: u32 = 39;
9948    /// Offset of the `TLBIRVALE1` field.
9949    pub const TLBIRVALE1_SHIFT: u32 = 40;
9950    /// Offset of the `TLBIRVAALE1` field.
9951    pub const TLBIRVAALE1_SHIFT: u32 = 41;
9952    /// Offset of the `TLBIVMALLE1` field.
9953    pub const TLBIVMALLE1_SHIFT: u32 = 42;
9954    /// Offset of the `TLBIVAE1` field.
9955    pub const TLBIVAE1_SHIFT: u32 = 43;
9956    /// Offset of the `TLBIASIDE1` field.
9957    pub const TLBIASIDE1_SHIFT: u32 = 44;
9958    /// Offset of the `TLBIVAAE1` field.
9959    pub const TLBIVAAE1_SHIFT: u32 = 45;
9960    /// Offset of the `TLBIVALE1` field.
9961    pub const TLBIVALE1_SHIFT: u32 = 46;
9962    /// Offset of the `TLBIVAALE1` field.
9963    pub const TLBIVAALE1_SHIFT: u32 = 47;
9964    /// Offset of the `CFPRCTX` field.
9965    pub const CFPRCTX_SHIFT: u32 = 48;
9966    /// Offset of the `DVPRCTX` field.
9967    pub const DVPRCTX_SHIFT: u32 = 49;
9968    /// Offset of the `CPPRCTX` field.
9969    pub const CPPRCTX_SHIFT: u32 = 50;
9970    /// Offset of the `ERET` field.
9971    pub const ERET_SHIFT: u32 = 51;
9972    /// Offset of the `SVC_EL0` field.
9973    pub const SVC_EL0_SHIFT: u32 = 52;
9974    /// Offset of the `SVC_EL1` field.
9975    pub const SVC_EL1_SHIFT: u32 = 53;
9976    /// Offset of the `DCCVAC` field.
9977    pub const DCCVAC_SHIFT: u32 = 54;
9978    /// Offset of the `nBRBINJ` field.
9979    pub const NBRBINJ_SHIFT: u32 = 55;
9980    /// Offset of the `nBRBIALL` field.
9981    pub const NBRBIALL_SHIFT: u32 = 56;
9982    /// Offset of the `nGCSPUSHM_EL1` field.
9983    pub const NGCSPUSHM_EL1_SHIFT: u32 = 57;
9984    /// Offset of the `nGCSSTR_EL1` field.
9985    pub const NGCSSTR_EL1_SHIFT: u32 = 58;
9986    /// Offset of the `nGCSEPP` field.
9987    pub const NGCSEPP_SHIFT: u32 = 59;
9988    /// Offset of the `COSPRCTX` field.
9989    pub const COSPRCTX_SHIFT: u32 = 60;
9990    /// Offset of the `ATS1E1A` field.
9991    pub const ATS1E1A_SHIFT: u32 = 62;
9992    /// Offset of the `PSBCSYNC` field.
9993    pub const PSBCSYNC_SHIFT: u32 = 63;
9994}
9995
9996#[cfg(feature = "el2")]
9997bitflags! {
9998    /// `HFGRTR2_EL2` system register value.
9999    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10000    #[repr(transparent)]
10001    pub struct Hfgrtr2El2: u64 {
10002        /// `nPFAR_EL1` bit.
10003        const NPFAR_EL1 = 1 << 0;
10004        /// `nERXGSR_EL1` bit.
10005        const NERXGSR_EL1 = 1 << 1;
10006        /// `nRCWSMASK_EL1` bit.
10007        const NRCWSMASK_EL1 = 1 << 2;
10008        /// `nCPACRMASK_EL1` bit.
10009        const NCPACRMASK_EL1 = 1 << 3;
10010        /// `nSCTLRMASK_EL1` bit.
10011        const NSCTLRMASK_EL1 = 1 << 4;
10012        /// `nSCTLR2MASK_EL1` bit.
10013        const NSCTLR2MASK_EL1 = 1 << 5;
10014        /// `nTCRMASK_EL1` bit.
10015        const NTCRMASK_EL1 = 1 << 6;
10016        /// `nTCR2MASK_EL1` bit.
10017        const NTCR2MASK_EL1 = 1 << 7;
10018        /// `nCPACRALIAS_EL1` bit.
10019        const NCPACRALIAS_EL1 = 1 << 8;
10020        /// `nSCTLRALIAS_EL1` bit.
10021        const NSCTLRALIAS_EL1 = 1 << 9;
10022        /// `nSCTLR2ALIAS_EL1` bit.
10023        const NSCTLR2ALIAS_EL1 = 1 << 10;
10024        /// `nTCRALIAS_EL1` bit.
10025        const NTCRALIAS_EL1 = 1 << 11;
10026        /// `nTCR2ALIAS_EL1` bit.
10027        const NTCR2ALIAS_EL1 = 1 << 12;
10028        /// `nACTLRMASK_EL1` bit.
10029        const NACTLRMASK_EL1 = 1 << 13;
10030        /// `nACTLRALIAS_EL1` bit.
10031        const NACTLRALIAS_EL1 = 1 << 14;
10032        /// `nTINDEX_EL0` bit.
10033        const NTINDEX_EL0 = 1 << 15;
10034        /// `nTINDEX_EL1` bit.
10035        const NTINDEX_EL1 = 1 << 16;
10036        /// `nSTINDEX_EL1` bit.
10037        const NSTINDEX_EL1 = 1 << 17;
10038        /// `nTTTBRP_EL1` bit.
10039        const NTTTBRP_EL1 = 1 << 20;
10040        /// `nTTTBRU_EL1` bit.
10041        const NTTTBRU_EL1 = 1 << 21;
10042        /// `nIRTBRP_EL1` bit.
10043        const NIRTBRP_EL1 = 1 << 22;
10044        /// `nIRTBRU_EL1` bit.
10045        const NIRTBRU_EL1 = 1 << 23;
10046        /// `nDPOTBR1_EL1` bit.
10047        const NDPOTBR1_EL1 = 1 << 24;
10048        /// `nDPOTBR0_EL1` bit.
10049        const NDPOTBR0_EL1 = 1 << 25;
10050        /// `nTPMIN1_EL1` bit.
10051        const NTPMIN1_EL1 = 1 << 26;
10052        /// `nTPMIN0_EL1` bit.
10053        const NTPMIN0_EL1 = 1 << 27;
10054        /// `nTPMIN1_EL0` bit.
10055        const NTPMIN1_EL0 = 1 << 28;
10056        /// `nTPMIN0_EL0` bit.
10057        const NTPMIN0_EL0 = 1 << 29;
10058        /// `nTLBIDIDR_EL1` bit.
10059        const NTLBIDIDR_EL1 = 1 << 30;
10060        /// `TFSR_EL1` bit.
10061        const TFSR_EL1 = 1 << 33;
10062        /// `RGSR_EL1` bit.
10063        const RGSR_EL1 = 1 << 34;
10064        /// `GCR_EL1` bit.
10065        const GCR_EL1 = 1 << 35;
10066        /// `nTPIDR3_EL0` bit.
10067        const NTPIDR3_EL0 = 1 << 36;
10068        /// `nTPIDR3_EL1` bit.
10069        const NTPIDR3_EL1 = 1 << 37;
10070    }
10071}
10072
10073#[cfg(feature = "el2")]
10074impl Hfgrtr2El2 {
10075    /// Offset of the `nPFAR_EL1` field.
10076    pub const NPFAR_EL1_SHIFT: u32 = 0;
10077    /// Offset of the `nERXGSR_EL1` field.
10078    pub const NERXGSR_EL1_SHIFT: u32 = 1;
10079    /// Offset of the `nRCWSMASK_EL1` field.
10080    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
10081    /// Offset of the `nCPACRMASK_EL1` field.
10082    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
10083    /// Offset of the `nSCTLRMASK_EL1` field.
10084    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
10085    /// Offset of the `nSCTLR2MASK_EL1` field.
10086    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
10087    /// Offset of the `nTCRMASK_EL1` field.
10088    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
10089    /// Offset of the `nTCR2MASK_EL1` field.
10090    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
10091    /// Offset of the `nCPACRALIAS_EL1` field.
10092    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
10093    /// Offset of the `nSCTLRALIAS_EL1` field.
10094    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
10095    /// Offset of the `nSCTLR2ALIAS_EL1` field.
10096    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
10097    /// Offset of the `nTCRALIAS_EL1` field.
10098    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
10099    /// Offset of the `nTCR2ALIAS_EL1` field.
10100    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
10101    /// Offset of the `nACTLRMASK_EL1` field.
10102    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
10103    /// Offset of the `nACTLRALIAS_EL1` field.
10104    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
10105    /// Offset of the `nTINDEX_EL0` field.
10106    pub const NTINDEX_EL0_SHIFT: u32 = 15;
10107    /// Offset of the `nTINDEX_EL1` field.
10108    pub const NTINDEX_EL1_SHIFT: u32 = 16;
10109    /// Offset of the `nSTINDEX_EL1` field.
10110    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
10111    /// Offset of the `nFGDTn_EL1` field.
10112    pub const NFGDTN_EL1_SHIFT: u32 = 18;
10113    /// Mask for the `nFGDTn_EL1` field.
10114    pub const NFGDTN_EL1_MASK: u64 = 0b11;
10115    /// Offset of the `nTTTBRP_EL1` field.
10116    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
10117    /// Offset of the `nTTTBRU_EL1` field.
10118    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
10119    /// Offset of the `nIRTBRP_EL1` field.
10120    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
10121    /// Offset of the `nIRTBRU_EL1` field.
10122    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
10123    /// Offset of the `nDPOTBR1_EL1` field.
10124    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
10125    /// Offset of the `nDPOTBR0_EL1` field.
10126    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
10127    /// Offset of the `nTPMIN1_EL1` field.
10128    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
10129    /// Offset of the `nTPMIN0_EL1` field.
10130    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
10131    /// Offset of the `nTPMIN1_EL0` field.
10132    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
10133    /// Offset of the `nTPMIN0_EL0` field.
10134    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
10135    /// Offset of the `nTLBIDIDR_EL1` field.
10136    pub const NTLBIDIDR_EL1_SHIFT: u32 = 30;
10137    /// Offset of the `nAFGDTn_EL1` field.
10138    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
10139    /// Mask for the `nAFGDTn_EL1` field.
10140    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
10141    /// Offset of the `TFSR_EL1` field.
10142    pub const TFSR_EL1_SHIFT: u32 = 33;
10143    /// Offset of the `RGSR_EL1` field.
10144    pub const RGSR_EL1_SHIFT: u32 = 34;
10145    /// Offset of the `GCR_EL1` field.
10146    pub const GCR_EL1_SHIFT: u32 = 35;
10147    /// Offset of the `nTPIDR3_EL0` field.
10148    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
10149    /// Offset of the `nTPIDR3_EL1` field.
10150    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
10151
10152    /// Returns the value of the `nFGDTn_EL1` field.
10153    pub const fn nfgdtn_el1(self) -> u8 {
10154        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
10155    }
10156
10157    /// Sets the value of the `nFGDTn_EL1` field.
10158    pub const fn set_nfgdtn_el1(&mut self, value: u8) {
10159        let offset = Self::NFGDTN_EL1_SHIFT;
10160        assert!(value & (Self::NFGDTN_EL1_MASK as u8) == value);
10161        *self = Self::from_bits_retain(
10162            (self.bits() & !(Self::NFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
10163        );
10164    }
10165
10166    /// Returns a copy with the `nFGDTn_EL1` field set to the given value.
10167    pub const fn with_nfgdtn_el1(mut self, value: u8) -> Self {
10168        self.set_nfgdtn_el1(value);
10169        self
10170    }
10171
10172    /// Returns the value of the `nAFGDTn_EL1` field.
10173    pub const fn nafgdtn_el1(self) -> u8 {
10174        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
10175    }
10176
10177    /// Sets the value of the `nAFGDTn_EL1` field.
10178    pub const fn set_nafgdtn_el1(&mut self, value: u8) {
10179        let offset = Self::NAFGDTN_EL1_SHIFT;
10180        assert!(value & (Self::NAFGDTN_EL1_MASK as u8) == value);
10181        *self = Self::from_bits_retain(
10182            (self.bits() & !(Self::NAFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
10183        );
10184    }
10185
10186    /// Returns a copy with the `nAFGDTn_EL1` field set to the given value.
10187    pub const fn with_nafgdtn_el1(mut self, value: u8) -> Self {
10188        self.set_nafgdtn_el1(value);
10189        self
10190    }
10191}
10192
10193#[cfg(feature = "el2")]
10194bitflags! {
10195    /// `HFGRTR_EL2` system register value.
10196    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10197    #[repr(transparent)]
10198    pub struct HfgrtrEl2: u64 {
10199        /// `AFSR0_EL1` bit.
10200        const AFSR0_EL1 = 1 << 0;
10201        /// `AFSR1_EL1` bit.
10202        const AFSR1_EL1 = 1 << 1;
10203        /// `AIDR_EL1` bit.
10204        const AIDR_EL1 = 1 << 2;
10205        /// `AMAIR_EL1` bit.
10206        const AMAIR_EL1 = 1 << 3;
10207        /// `APDAKey` bit.
10208        const APDAKEY = 1 << 4;
10209        /// `APDBKey` bit.
10210        const APDBKEY = 1 << 5;
10211        /// `APGAKey` bit.
10212        const APGAKEY = 1 << 6;
10213        /// `APIAKey` bit.
10214        const APIAKEY = 1 << 7;
10215        /// `APIBKey` bit.
10216        const APIBKEY = 1 << 8;
10217        /// `CCSIDR_EL1` bit.
10218        const CCSIDR_EL1 = 1 << 9;
10219        /// `CLIDR_EL1` bit.
10220        const CLIDR_EL1 = 1 << 10;
10221        /// `CONTEXTIDR_EL1` bit.
10222        const CONTEXTIDR_EL1 = 1 << 11;
10223        /// `CPACR_EL1` bit.
10224        const CPACR_EL1 = 1 << 12;
10225        /// `CSSELR_EL1` bit.
10226        const CSSELR_EL1 = 1 << 13;
10227        /// `CTR_EL0` bit.
10228        const CTR_EL0 = 1 << 14;
10229        /// `DCZID_EL0` bit.
10230        const DCZID_EL0 = 1 << 15;
10231        /// `ESR_EL1` bit.
10232        const ESR_EL1 = 1 << 16;
10233        /// `FAR_EL1` bit.
10234        const FAR_EL1 = 1 << 17;
10235        /// `ISR_EL1` bit.
10236        const ISR_EL1 = 1 << 18;
10237        /// `LORC_EL1` bit.
10238        const LORC_EL1 = 1 << 19;
10239        /// `LOREA_EL1` bit.
10240        const LOREA_EL1 = 1 << 20;
10241        /// `LORID_EL1` bit.
10242        const LORID_EL1 = 1 << 21;
10243        /// `LORN_EL1` bit.
10244        const LORN_EL1 = 1 << 22;
10245        /// `LORSA_EL1` bit.
10246        const LORSA_EL1 = 1 << 23;
10247        /// `MAIR_EL1` bit.
10248        const MAIR_EL1 = 1 << 24;
10249        /// `MIDR_EL1` bit.
10250        const MIDR_EL1 = 1 << 25;
10251        /// `MPIDR_EL1` bit.
10252        const MPIDR_EL1 = 1 << 26;
10253        /// `PAR_EL1` bit.
10254        const PAR_EL1 = 1 << 27;
10255        /// `REVIDR_EL1` bit.
10256        const REVIDR_EL1 = 1 << 28;
10257        /// `SCTLR_EL1` bit.
10258        const SCTLR_EL1 = 1 << 29;
10259        /// `SCXTNUM_EL1` bit.
10260        const SCXTNUM_EL1 = 1 << 30;
10261        /// `SCXTNUM_EL0` bit.
10262        const SCXTNUM_EL0 = 1 << 31;
10263        /// `TCR_EL1` bit.
10264        const TCR_EL1 = 1 << 32;
10265        /// `TPIDR_EL1` bit.
10266        const TPIDR_EL1 = 1 << 33;
10267        /// `TPIDRRO_EL0` bit.
10268        const TPIDRRO_EL0 = 1 << 34;
10269        /// `TPIDR_EL0` bit.
10270        const TPIDR_EL0 = 1 << 35;
10271        /// `TTBR0_EL1` bit.
10272        const TTBR0_EL1 = 1 << 36;
10273        /// `TTBR1_EL1` bit.
10274        const TTBR1_EL1 = 1 << 37;
10275        /// `VBAR_EL1` bit.
10276        const VBAR_EL1 = 1 << 38;
10277        /// `ICC_IGRPENn_EL1` bit.
10278        const ICC_IGRPENN_EL1 = 1 << 39;
10279        /// `ERRIDR_EL1` bit.
10280        const ERRIDR_EL1 = 1 << 40;
10281        /// `ERRSELR_EL1` bit.
10282        const ERRSELR_EL1 = 1 << 41;
10283        /// `ERXFR_EL1` bit.
10284        const ERXFR_EL1 = 1 << 42;
10285        /// `ERXCTLR_EL1` bit.
10286        const ERXCTLR_EL1 = 1 << 43;
10287        /// `ERXSTATUS_EL1` bit.
10288        const ERXSTATUS_EL1 = 1 << 44;
10289        /// `ERXMISCn_EL1` bit.
10290        const ERXMISCN_EL1 = 1 << 45;
10291        /// `ERXPFGF_EL1` bit.
10292        const ERXPFGF_EL1 = 1 << 46;
10293        /// `ERXPFGCTL_EL1` bit.
10294        const ERXPFGCTL_EL1 = 1 << 47;
10295        /// `ERXPFGCDN_EL1` bit.
10296        const ERXPFGCDN_EL1 = 1 << 48;
10297        /// `ERXADDR_EL1` bit.
10298        const ERXADDR_EL1 = 1 << 49;
10299        /// `nACCDATA_EL1` bit.
10300        const NACCDATA_EL1 = 1 << 50;
10301        /// `nGCS_EL0` bit.
10302        const NGCS_EL0 = 1 << 52;
10303        /// `nGCS_EL1` bit.
10304        const NGCS_EL1 = 1 << 53;
10305        /// `nSMPRI_EL1` bit.
10306        const NSMPRI_EL1 = 1 << 54;
10307        /// `nTPIDR2_EL0` bit.
10308        const NTPIDR2_EL0 = 1 << 55;
10309        /// `nRCWMASK_EL1` bit.
10310        const NRCWMASK_EL1 = 1 << 56;
10311        /// `nPIRE0_EL1` bit.
10312        const NPIRE0_EL1 = 1 << 57;
10313        /// `nPIR_EL1` bit.
10314        const NPIR_EL1 = 1 << 58;
10315        /// `nPOR_EL0` bit.
10316        const NPOR_EL0 = 1 << 59;
10317        /// `nPOR_EL1` bit.
10318        const NPOR_EL1 = 1 << 60;
10319        /// `nS2POR_EL1` bit.
10320        const NS2POR_EL1 = 1 << 61;
10321        /// `nMAIR2_EL1` bit.
10322        const NMAIR2_EL1 = 1 << 62;
10323        /// `nAMAIR2_EL1` bit.
10324        const NAMAIR2_EL1 = 1 << 63;
10325    }
10326}
10327
10328#[cfg(feature = "el2")]
10329impl HfgrtrEl2 {
10330    /// Offset of the `AFSR0_EL1` field.
10331    pub const AFSR0_EL1_SHIFT: u32 = 0;
10332    /// Offset of the `AFSR1_EL1` field.
10333    pub const AFSR1_EL1_SHIFT: u32 = 1;
10334    /// Offset of the `AIDR_EL1` field.
10335    pub const AIDR_EL1_SHIFT: u32 = 2;
10336    /// Offset of the `AMAIR_EL1` field.
10337    pub const AMAIR_EL1_SHIFT: u32 = 3;
10338    /// Offset of the `APDAKey` field.
10339    pub const APDAKEY_SHIFT: u32 = 4;
10340    /// Offset of the `APDBKey` field.
10341    pub const APDBKEY_SHIFT: u32 = 5;
10342    /// Offset of the `APGAKey` field.
10343    pub const APGAKEY_SHIFT: u32 = 6;
10344    /// Offset of the `APIAKey` field.
10345    pub const APIAKEY_SHIFT: u32 = 7;
10346    /// Offset of the `APIBKey` field.
10347    pub const APIBKEY_SHIFT: u32 = 8;
10348    /// Offset of the `CCSIDR_EL1` field.
10349    pub const CCSIDR_EL1_SHIFT: u32 = 9;
10350    /// Offset of the `CLIDR_EL1` field.
10351    pub const CLIDR_EL1_SHIFT: u32 = 10;
10352    /// Offset of the `CONTEXTIDR_EL1` field.
10353    pub const CONTEXTIDR_EL1_SHIFT: u32 = 11;
10354    /// Offset of the `CPACR_EL1` field.
10355    pub const CPACR_EL1_SHIFT: u32 = 12;
10356    /// Offset of the `CSSELR_EL1` field.
10357    pub const CSSELR_EL1_SHIFT: u32 = 13;
10358    /// Offset of the `CTR_EL0` field.
10359    pub const CTR_EL0_SHIFT: u32 = 14;
10360    /// Offset of the `DCZID_EL0` field.
10361    pub const DCZID_EL0_SHIFT: u32 = 15;
10362    /// Offset of the `ESR_EL1` field.
10363    pub const ESR_EL1_SHIFT: u32 = 16;
10364    /// Offset of the `FAR_EL1` field.
10365    pub const FAR_EL1_SHIFT: u32 = 17;
10366    /// Offset of the `ISR_EL1` field.
10367    pub const ISR_EL1_SHIFT: u32 = 18;
10368    /// Offset of the `LORC_EL1` field.
10369    pub const LORC_EL1_SHIFT: u32 = 19;
10370    /// Offset of the `LOREA_EL1` field.
10371    pub const LOREA_EL1_SHIFT: u32 = 20;
10372    /// Offset of the `LORID_EL1` field.
10373    pub const LORID_EL1_SHIFT: u32 = 21;
10374    /// Offset of the `LORN_EL1` field.
10375    pub const LORN_EL1_SHIFT: u32 = 22;
10376    /// Offset of the `LORSA_EL1` field.
10377    pub const LORSA_EL1_SHIFT: u32 = 23;
10378    /// Offset of the `MAIR_EL1` field.
10379    pub const MAIR_EL1_SHIFT: u32 = 24;
10380    /// Offset of the `MIDR_EL1` field.
10381    pub const MIDR_EL1_SHIFT: u32 = 25;
10382    /// Offset of the `MPIDR_EL1` field.
10383    pub const MPIDR_EL1_SHIFT: u32 = 26;
10384    /// Offset of the `PAR_EL1` field.
10385    pub const PAR_EL1_SHIFT: u32 = 27;
10386    /// Offset of the `REVIDR_EL1` field.
10387    pub const REVIDR_EL1_SHIFT: u32 = 28;
10388    /// Offset of the `SCTLR_EL1` field.
10389    pub const SCTLR_EL1_SHIFT: u32 = 29;
10390    /// Offset of the `SCXTNUM_EL1` field.
10391    pub const SCXTNUM_EL1_SHIFT: u32 = 30;
10392    /// Offset of the `SCXTNUM_EL0` field.
10393    pub const SCXTNUM_EL0_SHIFT: u32 = 31;
10394    /// Offset of the `TCR_EL1` field.
10395    pub const TCR_EL1_SHIFT: u32 = 32;
10396    /// Offset of the `TPIDR_EL1` field.
10397    pub const TPIDR_EL1_SHIFT: u32 = 33;
10398    /// Offset of the `TPIDRRO_EL0` field.
10399    pub const TPIDRRO_EL0_SHIFT: u32 = 34;
10400    /// Offset of the `TPIDR_EL0` field.
10401    pub const TPIDR_EL0_SHIFT: u32 = 35;
10402    /// Offset of the `TTBR0_EL1` field.
10403    pub const TTBR0_EL1_SHIFT: u32 = 36;
10404    /// Offset of the `TTBR1_EL1` field.
10405    pub const TTBR1_EL1_SHIFT: u32 = 37;
10406    /// Offset of the `VBAR_EL1` field.
10407    pub const VBAR_EL1_SHIFT: u32 = 38;
10408    /// Offset of the `ICC_IGRPENn_EL1` field.
10409    pub const ICC_IGRPENN_EL1_SHIFT: u32 = 39;
10410    /// Offset of the `ERRIDR_EL1` field.
10411    pub const ERRIDR_EL1_SHIFT: u32 = 40;
10412    /// Offset of the `ERRSELR_EL1` field.
10413    pub const ERRSELR_EL1_SHIFT: u32 = 41;
10414    /// Offset of the `ERXFR_EL1` field.
10415    pub const ERXFR_EL1_SHIFT: u32 = 42;
10416    /// Offset of the `ERXCTLR_EL1` field.
10417    pub const ERXCTLR_EL1_SHIFT: u32 = 43;
10418    /// Offset of the `ERXSTATUS_EL1` field.
10419    pub const ERXSTATUS_EL1_SHIFT: u32 = 44;
10420    /// Offset of the `ERXMISCn_EL1` field.
10421    pub const ERXMISCN_EL1_SHIFT: u32 = 45;
10422    /// Offset of the `ERXPFGF_EL1` field.
10423    pub const ERXPFGF_EL1_SHIFT: u32 = 46;
10424    /// Offset of the `ERXPFGCTL_EL1` field.
10425    pub const ERXPFGCTL_EL1_SHIFT: u32 = 47;
10426    /// Offset of the `ERXPFGCDN_EL1` field.
10427    pub const ERXPFGCDN_EL1_SHIFT: u32 = 48;
10428    /// Offset of the `ERXADDR_EL1` field.
10429    pub const ERXADDR_EL1_SHIFT: u32 = 49;
10430    /// Offset of the `nACCDATA_EL1` field.
10431    pub const NACCDATA_EL1_SHIFT: u32 = 50;
10432    /// Offset of the `nGCS_EL0` field.
10433    pub const NGCS_EL0_SHIFT: u32 = 52;
10434    /// Offset of the `nGCS_EL1` field.
10435    pub const NGCS_EL1_SHIFT: u32 = 53;
10436    /// Offset of the `nSMPRI_EL1` field.
10437    pub const NSMPRI_EL1_SHIFT: u32 = 54;
10438    /// Offset of the `nTPIDR2_EL0` field.
10439    pub const NTPIDR2_EL0_SHIFT: u32 = 55;
10440    /// Offset of the `nRCWMASK_EL1` field.
10441    pub const NRCWMASK_EL1_SHIFT: u32 = 56;
10442    /// Offset of the `nPIRE0_EL1` field.
10443    pub const NPIRE0_EL1_SHIFT: u32 = 57;
10444    /// Offset of the `nPIR_EL1` field.
10445    pub const NPIR_EL1_SHIFT: u32 = 58;
10446    /// Offset of the `nPOR_EL0` field.
10447    pub const NPOR_EL0_SHIFT: u32 = 59;
10448    /// Offset of the `nPOR_EL1` field.
10449    pub const NPOR_EL1_SHIFT: u32 = 60;
10450    /// Offset of the `nS2POR_EL1` field.
10451    pub const NS2POR_EL1_SHIFT: u32 = 61;
10452    /// Offset of the `nMAIR2_EL1` field.
10453    pub const NMAIR2_EL1_SHIFT: u32 = 62;
10454    /// Offset of the `nAMAIR2_EL1` field.
10455    pub const NAMAIR2_EL1_SHIFT: u32 = 63;
10456}
10457
10458#[cfg(feature = "el2")]
10459bitflags! {
10460    /// `HFGWTR2_EL2` system register value.
10461    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10462    #[repr(transparent)]
10463    pub struct Hfgwtr2El2: u64 {
10464        /// `nPFAR_EL1` bit.
10465        const NPFAR_EL1 = 1 << 0;
10466        /// `nRCWSMASK_EL1` bit.
10467        const NRCWSMASK_EL1 = 1 << 2;
10468        /// `nCPACRMASK_EL1` bit.
10469        const NCPACRMASK_EL1 = 1 << 3;
10470        /// `nSCTLRMASK_EL1` bit.
10471        const NSCTLRMASK_EL1 = 1 << 4;
10472        /// `nSCTLR2MASK_EL1` bit.
10473        const NSCTLR2MASK_EL1 = 1 << 5;
10474        /// `nTCRMASK_EL1` bit.
10475        const NTCRMASK_EL1 = 1 << 6;
10476        /// `nTCR2MASK_EL1` bit.
10477        const NTCR2MASK_EL1 = 1 << 7;
10478        /// `nCPACRALIAS_EL1` bit.
10479        const NCPACRALIAS_EL1 = 1 << 8;
10480        /// `nSCTLRALIAS_EL1` bit.
10481        const NSCTLRALIAS_EL1 = 1 << 9;
10482        /// `nSCTLR2ALIAS_EL1` bit.
10483        const NSCTLR2ALIAS_EL1 = 1 << 10;
10484        /// `nTCRALIAS_EL1` bit.
10485        const NTCRALIAS_EL1 = 1 << 11;
10486        /// `nTCR2ALIAS_EL1` bit.
10487        const NTCR2ALIAS_EL1 = 1 << 12;
10488        /// `nACTLRMASK_EL1` bit.
10489        const NACTLRMASK_EL1 = 1 << 13;
10490        /// `nACTLRALIAS_EL1` bit.
10491        const NACTLRALIAS_EL1 = 1 << 14;
10492        /// `nTINDEX_EL0` bit.
10493        const NTINDEX_EL0 = 1 << 15;
10494        /// `nTINDEX_EL1` bit.
10495        const NTINDEX_EL1 = 1 << 16;
10496        /// `nSTINDEX_EL1` bit.
10497        const NSTINDEX_EL1 = 1 << 17;
10498        /// `nTTTBRP_EL1` bit.
10499        const NTTTBRP_EL1 = 1 << 20;
10500        /// `nTTTBRU_EL1` bit.
10501        const NTTTBRU_EL1 = 1 << 21;
10502        /// `nIRTBRP_EL1` bit.
10503        const NIRTBRP_EL1 = 1 << 22;
10504        /// `nIRTBRU_EL1` bit.
10505        const NIRTBRU_EL1 = 1 << 23;
10506        /// `nDPOTBR1_EL1` bit.
10507        const NDPOTBR1_EL1 = 1 << 24;
10508        /// `nDPOTBR0_EL1` bit.
10509        const NDPOTBR0_EL1 = 1 << 25;
10510        /// `nTPMIN1_EL1` bit.
10511        const NTPMIN1_EL1 = 1 << 26;
10512        /// `nTPMIN0_EL1` bit.
10513        const NTPMIN0_EL1 = 1 << 27;
10514        /// `nTPMIN1_EL0` bit.
10515        const NTPMIN1_EL0 = 1 << 28;
10516        /// `nTPMIN0_EL0` bit.
10517        const NTPMIN0_EL0 = 1 << 29;
10518        /// `TFSR_EL1` bit.
10519        const TFSR_EL1 = 1 << 33;
10520        /// `RGSR_EL1` bit.
10521        const RGSR_EL1 = 1 << 34;
10522        /// `GCR_EL1` bit.
10523        const GCR_EL1 = 1 << 35;
10524        /// `nTPIDR3_EL0` bit.
10525        const NTPIDR3_EL0 = 1 << 36;
10526        /// `nTPIDR3_EL1` bit.
10527        const NTPIDR3_EL1 = 1 << 37;
10528    }
10529}
10530
10531#[cfg(feature = "el2")]
10532impl Hfgwtr2El2 {
10533    /// Offset of the `nPFAR_EL1` field.
10534    pub const NPFAR_EL1_SHIFT: u32 = 0;
10535    /// Offset of the `nRCWSMASK_EL1` field.
10536    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
10537    /// Offset of the `nCPACRMASK_EL1` field.
10538    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
10539    /// Offset of the `nSCTLRMASK_EL1` field.
10540    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
10541    /// Offset of the `nSCTLR2MASK_EL1` field.
10542    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
10543    /// Offset of the `nTCRMASK_EL1` field.
10544    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
10545    /// Offset of the `nTCR2MASK_EL1` field.
10546    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
10547    /// Offset of the `nCPACRALIAS_EL1` field.
10548    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
10549    /// Offset of the `nSCTLRALIAS_EL1` field.
10550    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
10551    /// Offset of the `nSCTLR2ALIAS_EL1` field.
10552    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
10553    /// Offset of the `nTCRALIAS_EL1` field.
10554    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
10555    /// Offset of the `nTCR2ALIAS_EL1` field.
10556    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
10557    /// Offset of the `nACTLRMASK_EL1` field.
10558    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
10559    /// Offset of the `nACTLRALIAS_EL1` field.
10560    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
10561    /// Offset of the `nTINDEX_EL0` field.
10562    pub const NTINDEX_EL0_SHIFT: u32 = 15;
10563    /// Offset of the `nTINDEX_EL1` field.
10564    pub const NTINDEX_EL1_SHIFT: u32 = 16;
10565    /// Offset of the `nSTINDEX_EL1` field.
10566    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
10567    /// Offset of the `nFGDTn_EL1` field.
10568    pub const NFGDTN_EL1_SHIFT: u32 = 18;
10569    /// Mask for the `nFGDTn_EL1` field.
10570    pub const NFGDTN_EL1_MASK: u64 = 0b11;
10571    /// Offset of the `nTTTBRP_EL1` field.
10572    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
10573    /// Offset of the `nTTTBRU_EL1` field.
10574    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
10575    /// Offset of the `nIRTBRP_EL1` field.
10576    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
10577    /// Offset of the `nIRTBRU_EL1` field.
10578    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
10579    /// Offset of the `nDPOTBR1_EL1` field.
10580    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
10581    /// Offset of the `nDPOTBR0_EL1` field.
10582    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
10583    /// Offset of the `nTPMIN1_EL1` field.
10584    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
10585    /// Offset of the `nTPMIN0_EL1` field.
10586    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
10587    /// Offset of the `nTPMIN1_EL0` field.
10588    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
10589    /// Offset of the `nTPMIN0_EL0` field.
10590    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
10591    /// Offset of the `nAFGDTn_EL1` field.
10592    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
10593    /// Mask for the `nAFGDTn_EL1` field.
10594    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
10595    /// Offset of the `TFSR_EL1` field.
10596    pub const TFSR_EL1_SHIFT: u32 = 33;
10597    /// Offset of the `RGSR_EL1` field.
10598    pub const RGSR_EL1_SHIFT: u32 = 34;
10599    /// Offset of the `GCR_EL1` field.
10600    pub const GCR_EL1_SHIFT: u32 = 35;
10601    /// Offset of the `nTPIDR3_EL0` field.
10602    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
10603    /// Offset of the `nTPIDR3_EL1` field.
10604    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
10605
10606    /// Returns the value of the `nFGDTn_EL1` field.
10607    pub const fn nfgdtn_el1(self) -> u8 {
10608        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
10609    }
10610
10611    /// Sets the value of the `nFGDTn_EL1` field.
10612    pub const fn set_nfgdtn_el1(&mut self, value: u8) {
10613        let offset = Self::NFGDTN_EL1_SHIFT;
10614        assert!(value & (Self::NFGDTN_EL1_MASK as u8) == value);
10615        *self = Self::from_bits_retain(
10616            (self.bits() & !(Self::NFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
10617        );
10618    }
10619
10620    /// Returns a copy with the `nFGDTn_EL1` field set to the given value.
10621    pub const fn with_nfgdtn_el1(mut self, value: u8) -> Self {
10622        self.set_nfgdtn_el1(value);
10623        self
10624    }
10625
10626    /// Returns the value of the `nAFGDTn_EL1` field.
10627    pub const fn nafgdtn_el1(self) -> u8 {
10628        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
10629    }
10630
10631    /// Sets the value of the `nAFGDTn_EL1` field.
10632    pub const fn set_nafgdtn_el1(&mut self, value: u8) {
10633        let offset = Self::NAFGDTN_EL1_SHIFT;
10634        assert!(value & (Self::NAFGDTN_EL1_MASK as u8) == value);
10635        *self = Self::from_bits_retain(
10636            (self.bits() & !(Self::NAFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
10637        );
10638    }
10639
10640    /// Returns a copy with the `nAFGDTn_EL1` field set to the given value.
10641    pub const fn with_nafgdtn_el1(mut self, value: u8) -> Self {
10642        self.set_nafgdtn_el1(value);
10643        self
10644    }
10645}
10646
10647#[cfg(feature = "el2")]
10648bitflags! {
10649    /// `HFGWTR_EL2` system register value.
10650    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10651    #[repr(transparent)]
10652    pub struct HfgwtrEl2: u64 {
10653        /// `AFSR0_EL1` bit.
10654        const AFSR0_EL1 = 1 << 0;
10655        /// `AFSR1_EL1` bit.
10656        const AFSR1_EL1 = 1 << 1;
10657        /// `AMAIR_EL1` bit.
10658        const AMAIR_EL1 = 1 << 3;
10659        /// `APDAKey` bit.
10660        const APDAKEY = 1 << 4;
10661        /// `APDBKey` bit.
10662        const APDBKEY = 1 << 5;
10663        /// `APGAKey` bit.
10664        const APGAKEY = 1 << 6;
10665        /// `APIAKey` bit.
10666        const APIAKEY = 1 << 7;
10667        /// `APIBKey` bit.
10668        const APIBKEY = 1 << 8;
10669        /// `CONTEXTIDR_EL1` bit.
10670        const CONTEXTIDR_EL1 = 1 << 11;
10671        /// `CPACR_EL1` bit.
10672        const CPACR_EL1 = 1 << 12;
10673        /// `CSSELR_EL1` bit.
10674        const CSSELR_EL1 = 1 << 13;
10675        /// `ESR_EL1` bit.
10676        const ESR_EL1 = 1 << 16;
10677        /// `FAR_EL1` bit.
10678        const FAR_EL1 = 1 << 17;
10679        /// `LORC_EL1` bit.
10680        const LORC_EL1 = 1 << 19;
10681        /// `LOREA_EL1` bit.
10682        const LOREA_EL1 = 1 << 20;
10683        /// `LORN_EL1` bit.
10684        const LORN_EL1 = 1 << 22;
10685        /// `LORSA_EL1` bit.
10686        const LORSA_EL1 = 1 << 23;
10687        /// `MAIR_EL1` bit.
10688        const MAIR_EL1 = 1 << 24;
10689        /// `PAR_EL1` bit.
10690        const PAR_EL1 = 1 << 27;
10691        /// `SCTLR_EL1` bit.
10692        const SCTLR_EL1 = 1 << 29;
10693        /// `SCXTNUM_EL1` bit.
10694        const SCXTNUM_EL1 = 1 << 30;
10695        /// `SCXTNUM_EL0` bit.
10696        const SCXTNUM_EL0 = 1 << 31;
10697        /// `TCR_EL1` bit.
10698        const TCR_EL1 = 1 << 32;
10699        /// `TPIDR_EL1` bit.
10700        const TPIDR_EL1 = 1 << 33;
10701        /// `TPIDRRO_EL0` bit.
10702        const TPIDRRO_EL0 = 1 << 34;
10703        /// `TPIDR_EL0` bit.
10704        const TPIDR_EL0 = 1 << 35;
10705        /// `TTBR0_EL1` bit.
10706        const TTBR0_EL1 = 1 << 36;
10707        /// `TTBR1_EL1` bit.
10708        const TTBR1_EL1 = 1 << 37;
10709        /// `VBAR_EL1` bit.
10710        const VBAR_EL1 = 1 << 38;
10711        /// `ICC_IGRPENn_EL1` bit.
10712        const ICC_IGRPENN_EL1 = 1 << 39;
10713        /// `ERRSELR_EL1` bit.
10714        const ERRSELR_EL1 = 1 << 41;
10715        /// `ERXCTLR_EL1` bit.
10716        const ERXCTLR_EL1 = 1 << 43;
10717        /// `ERXSTATUS_EL1` bit.
10718        const ERXSTATUS_EL1 = 1 << 44;
10719        /// `ERXMISCn_EL1` bit.
10720        const ERXMISCN_EL1 = 1 << 45;
10721        /// `ERXPFGCTL_EL1` bit.
10722        const ERXPFGCTL_EL1 = 1 << 47;
10723        /// `ERXPFGCDN_EL1` bit.
10724        const ERXPFGCDN_EL1 = 1 << 48;
10725        /// `ERXADDR_EL1` bit.
10726        const ERXADDR_EL1 = 1 << 49;
10727        /// `nACCDATA_EL1` bit.
10728        const NACCDATA_EL1 = 1 << 50;
10729        /// `nGCS_EL0` bit.
10730        const NGCS_EL0 = 1 << 52;
10731        /// `nGCS_EL1` bit.
10732        const NGCS_EL1 = 1 << 53;
10733        /// `nSMPRI_EL1` bit.
10734        const NSMPRI_EL1 = 1 << 54;
10735        /// `nTPIDR2_EL0` bit.
10736        const NTPIDR2_EL0 = 1 << 55;
10737        /// `nRCWMASK_EL1` bit.
10738        const NRCWMASK_EL1 = 1 << 56;
10739        /// `nPIRE0_EL1` bit.
10740        const NPIRE0_EL1 = 1 << 57;
10741        /// `nPIR_EL1` bit.
10742        const NPIR_EL1 = 1 << 58;
10743        /// `nPOR_EL0` bit.
10744        const NPOR_EL0 = 1 << 59;
10745        /// `nPOR_EL1` bit.
10746        const NPOR_EL1 = 1 << 60;
10747        /// `nS2POR_EL1` bit.
10748        const NS2POR_EL1 = 1 << 61;
10749        /// `nMAIR2_EL1` bit.
10750        const NMAIR2_EL1 = 1 << 62;
10751        /// `nAMAIR2_EL1` bit.
10752        const NAMAIR2_EL1 = 1 << 63;
10753    }
10754}
10755
10756#[cfg(feature = "el2")]
10757impl HfgwtrEl2 {
10758    /// Offset of the `AFSR0_EL1` field.
10759    pub const AFSR0_EL1_SHIFT: u32 = 0;
10760    /// Offset of the `AFSR1_EL1` field.
10761    pub const AFSR1_EL1_SHIFT: u32 = 1;
10762    /// Offset of the `AMAIR_EL1` field.
10763    pub const AMAIR_EL1_SHIFT: u32 = 3;
10764    /// Offset of the `APDAKey` field.
10765    pub const APDAKEY_SHIFT: u32 = 4;
10766    /// Offset of the `APDBKey` field.
10767    pub const APDBKEY_SHIFT: u32 = 5;
10768    /// Offset of the `APGAKey` field.
10769    pub const APGAKEY_SHIFT: u32 = 6;
10770    /// Offset of the `APIAKey` field.
10771    pub const APIAKEY_SHIFT: u32 = 7;
10772    /// Offset of the `APIBKey` field.
10773    pub const APIBKEY_SHIFT: u32 = 8;
10774    /// Offset of the `CONTEXTIDR_EL1` field.
10775    pub const CONTEXTIDR_EL1_SHIFT: u32 = 11;
10776    /// Offset of the `CPACR_EL1` field.
10777    pub const CPACR_EL1_SHIFT: u32 = 12;
10778    /// Offset of the `CSSELR_EL1` field.
10779    pub const CSSELR_EL1_SHIFT: u32 = 13;
10780    /// Offset of the `ESR_EL1` field.
10781    pub const ESR_EL1_SHIFT: u32 = 16;
10782    /// Offset of the `FAR_EL1` field.
10783    pub const FAR_EL1_SHIFT: u32 = 17;
10784    /// Offset of the `LORC_EL1` field.
10785    pub const LORC_EL1_SHIFT: u32 = 19;
10786    /// Offset of the `LOREA_EL1` field.
10787    pub const LOREA_EL1_SHIFT: u32 = 20;
10788    /// Offset of the `LORN_EL1` field.
10789    pub const LORN_EL1_SHIFT: u32 = 22;
10790    /// Offset of the `LORSA_EL1` field.
10791    pub const LORSA_EL1_SHIFT: u32 = 23;
10792    /// Offset of the `MAIR_EL1` field.
10793    pub const MAIR_EL1_SHIFT: u32 = 24;
10794    /// Offset of the `PAR_EL1` field.
10795    pub const PAR_EL1_SHIFT: u32 = 27;
10796    /// Offset of the `SCTLR_EL1` field.
10797    pub const SCTLR_EL1_SHIFT: u32 = 29;
10798    /// Offset of the `SCXTNUM_EL1` field.
10799    pub const SCXTNUM_EL1_SHIFT: u32 = 30;
10800    /// Offset of the `SCXTNUM_EL0` field.
10801    pub const SCXTNUM_EL0_SHIFT: u32 = 31;
10802    /// Offset of the `TCR_EL1` field.
10803    pub const TCR_EL1_SHIFT: u32 = 32;
10804    /// Offset of the `TPIDR_EL1` field.
10805    pub const TPIDR_EL1_SHIFT: u32 = 33;
10806    /// Offset of the `TPIDRRO_EL0` field.
10807    pub const TPIDRRO_EL0_SHIFT: u32 = 34;
10808    /// Offset of the `TPIDR_EL0` field.
10809    pub const TPIDR_EL0_SHIFT: u32 = 35;
10810    /// Offset of the `TTBR0_EL1` field.
10811    pub const TTBR0_EL1_SHIFT: u32 = 36;
10812    /// Offset of the `TTBR1_EL1` field.
10813    pub const TTBR1_EL1_SHIFT: u32 = 37;
10814    /// Offset of the `VBAR_EL1` field.
10815    pub const VBAR_EL1_SHIFT: u32 = 38;
10816    /// Offset of the `ICC_IGRPENn_EL1` field.
10817    pub const ICC_IGRPENN_EL1_SHIFT: u32 = 39;
10818    /// Offset of the `ERRSELR_EL1` field.
10819    pub const ERRSELR_EL1_SHIFT: u32 = 41;
10820    /// Offset of the `ERXCTLR_EL1` field.
10821    pub const ERXCTLR_EL1_SHIFT: u32 = 43;
10822    /// Offset of the `ERXSTATUS_EL1` field.
10823    pub const ERXSTATUS_EL1_SHIFT: u32 = 44;
10824    /// Offset of the `ERXMISCn_EL1` field.
10825    pub const ERXMISCN_EL1_SHIFT: u32 = 45;
10826    /// Offset of the `ERXPFGCTL_EL1` field.
10827    pub const ERXPFGCTL_EL1_SHIFT: u32 = 47;
10828    /// Offset of the `ERXPFGCDN_EL1` field.
10829    pub const ERXPFGCDN_EL1_SHIFT: u32 = 48;
10830    /// Offset of the `ERXADDR_EL1` field.
10831    pub const ERXADDR_EL1_SHIFT: u32 = 49;
10832    /// Offset of the `nACCDATA_EL1` field.
10833    pub const NACCDATA_EL1_SHIFT: u32 = 50;
10834    /// Offset of the `nGCS_EL0` field.
10835    pub const NGCS_EL0_SHIFT: u32 = 52;
10836    /// Offset of the `nGCS_EL1` field.
10837    pub const NGCS_EL1_SHIFT: u32 = 53;
10838    /// Offset of the `nSMPRI_EL1` field.
10839    pub const NSMPRI_EL1_SHIFT: u32 = 54;
10840    /// Offset of the `nTPIDR2_EL0` field.
10841    pub const NTPIDR2_EL0_SHIFT: u32 = 55;
10842    /// Offset of the `nRCWMASK_EL1` field.
10843    pub const NRCWMASK_EL1_SHIFT: u32 = 56;
10844    /// Offset of the `nPIRE0_EL1` field.
10845    pub const NPIRE0_EL1_SHIFT: u32 = 57;
10846    /// Offset of the `nPIR_EL1` field.
10847    pub const NPIR_EL1_SHIFT: u32 = 58;
10848    /// Offset of the `nPOR_EL0` field.
10849    pub const NPOR_EL0_SHIFT: u32 = 59;
10850    /// Offset of the `nPOR_EL1` field.
10851    pub const NPOR_EL1_SHIFT: u32 = 60;
10852    /// Offset of the `nS2POR_EL1` field.
10853    pub const NS2POR_EL1_SHIFT: u32 = 61;
10854    /// Offset of the `nMAIR2_EL1` field.
10855    pub const NMAIR2_EL1_SHIFT: u32 = 62;
10856    /// Offset of the `nAMAIR2_EL1` field.
10857    pub const NAMAIR2_EL1_SHIFT: u32 = 63;
10858}
10859
10860bitflags! {
10861    /// `HIFAR` system register value.
10862    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10863    #[repr(transparent)]
10864    pub struct Hifar: u32 {
10865    }
10866}
10867
10868impl Hifar {
10869    /// Offset of the `VA` field.
10870    pub const VA_SHIFT: u32 = 0;
10871    /// Mask for the `VA` field.
10872    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
10873
10874    /// Returns the value of the `VA` field.
10875    pub const fn va(self) -> u32 {
10876        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
10877    }
10878
10879    /// Sets the value of the `VA` field.
10880    pub const fn set_va(&mut self, value: u32) {
10881        let offset = Self::VA_SHIFT;
10882        assert!(value & (Self::VA_MASK as u32) == value);
10883        *self = Self::from_bits_retain(
10884            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
10885        );
10886    }
10887
10888    /// Returns a copy with the `VA` field set to the given value.
10889    pub const fn with_va(mut self, value: u32) -> Self {
10890        self.set_va(value);
10891        self
10892    }
10893}
10894
10895bitflags! {
10896    /// `HMAIR0` system register value.
10897    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10898    #[repr(transparent)]
10899    pub struct Hmair0: u32 {
10900    }
10901}
10902
10903impl Hmair0 {
10904    /// Offset of the `Attr<n>` field.
10905    pub const ATTR_SHIFT: u32 = 0;
10906    /// Mask for the `Attr<n>` field.
10907    pub const ATTR_MASK: u32 = 0b11111111;
10908
10909    /// Returns the value of the given `Attr<n>` field.
10910    pub const fn attr(self, n: u32) -> u8 {
10911        assert!(n < 4);
10912        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
10913    }
10914
10915    /// Sets the value of the `Attr<n>` field.
10916    pub const fn set_attr(&mut self, n: u32, value: u8) {
10917        assert!(n < 4);
10918        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
10919        assert!(value & (Self::ATTR_MASK as u8) == value);
10920        *self = Self::from_bits_retain(
10921            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
10922        );
10923    }
10924
10925    /// Returns a copy with the `Attr<n>` field set to the given value.
10926    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
10927        self.set_attr(n, value);
10928        self
10929    }
10930}
10931
10932bitflags! {
10933    /// `HMAIR1` system register value.
10934    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10935    #[repr(transparent)]
10936    pub struct Hmair1: u32 {
10937    }
10938}
10939
10940impl Hmair1 {
10941    /// Offset of the `Attr<n>` field.
10942    pub const ATTR_SHIFT: u32 = 0;
10943    /// Mask for the `Attr<n>` field.
10944    pub const ATTR_MASK: u32 = 0b11111111;
10945
10946    /// Returns the value of the given `Attr<n>` field.
10947    pub const fn attr(self, n: u32) -> u8 {
10948        assert!(n >= 4 && n < 8);
10949        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
10950    }
10951
10952    /// Sets the value of the `Attr<n>` field.
10953    pub const fn set_attr(&mut self, n: u32, value: u8) {
10954        assert!(n >= 4 && n < 8);
10955        let offset = Self::ATTR_SHIFT + (n - 4) * 8;
10956        assert!(value & (Self::ATTR_MASK as u8) == value);
10957        *self = Self::from_bits_retain(
10958            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
10959        );
10960    }
10961
10962    /// Returns a copy with the `Attr<n>` field set to the given value.
10963    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
10964        self.set_attr(n, value);
10965        self
10966    }
10967}
10968
10969bitflags! {
10970    /// `HPFAR` system register value.
10971    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10972    #[repr(transparent)]
10973    pub struct Hpfar: u32 {
10974    }
10975}
10976
10977impl Hpfar {
10978    /// Offset of the `FIPA[39:12]` field.
10979    pub const FIPA_39_12_SHIFT: u32 = 4;
10980    /// Mask for the `FIPA[39:12]` field.
10981    pub const FIPA_39_12_MASK: u32 = 0b1111111111111111111111111111;
10982
10983    /// Returns the value of the `FIPA[39:12]` field.
10984    pub const fn fipa_39_12(self) -> u32 {
10985        ((self.bits() >> Self::FIPA_39_12_SHIFT) & 0b1111111111111111111111111111) as u32
10986    }
10987
10988    /// Sets the value of the `FIPA[39:12]` field.
10989    pub const fn set_fipa_39_12(&mut self, value: u32) {
10990        let offset = Self::FIPA_39_12_SHIFT;
10991        assert!(value & (Self::FIPA_39_12_MASK as u32) == value);
10992        *self = Self::from_bits_retain(
10993            (self.bits() & !(Self::FIPA_39_12_MASK << offset)) | ((value as u32) << offset),
10994        );
10995    }
10996
10997    /// Returns a copy with the `FIPA[39:12]` field set to the given value.
10998    pub const fn with_fipa_39_12(mut self, value: u32) -> Self {
10999        self.set_fipa_39_12(value);
11000        self
11001    }
11002}
11003
11004#[cfg(feature = "el2")]
11005bitflags! {
11006    /// `HPFAR_EL2` system register value.
11007    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11008    #[repr(transparent)]
11009    pub struct HpfarEl2: u64 {
11010        /// `NS` bit.
11011        const NS = 1 << 63;
11012    }
11013}
11014
11015#[cfg(feature = "el2")]
11016impl HpfarEl2 {
11017    /// Offset of the `FIPA` field.
11018    pub const FIPA_SHIFT: u32 = 4;
11019    /// Mask for the `FIPA` field.
11020    pub const FIPA_MASK: u64 = 0b11111111111111111111111111111111111111111111;
11021    /// Offset of the `NS` field.
11022    pub const NS_SHIFT: u32 = 63;
11023
11024    /// Returns the value of the `FIPA` field.
11025    pub const fn fipa(self) -> u64 {
11026        ((self.bits() >> Self::FIPA_SHIFT) & 0b11111111111111111111111111111111111111111111) as u64
11027    }
11028
11029    /// Sets the value of the `FIPA` field.
11030    pub const fn set_fipa(&mut self, value: u64) {
11031        let offset = Self::FIPA_SHIFT;
11032        assert!(value & (Self::FIPA_MASK as u64) == value);
11033        *self = Self::from_bits_retain(
11034            (self.bits() & !(Self::FIPA_MASK << offset)) | ((value as u64) << offset),
11035        );
11036    }
11037
11038    /// Returns a copy with the `FIPA` field set to the given value.
11039    pub const fn with_fipa(mut self, value: u64) -> Self {
11040        self.set_fipa(value);
11041        self
11042    }
11043}
11044
11045bitflags! {
11046    /// `HRMR` system register value.
11047    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11048    #[repr(transparent)]
11049    pub struct Hrmr: u32 {
11050        /// `AA64` bit.
11051        const AA64 = 1 << 0;
11052        /// `RR` bit.
11053        const RR = 1 << 1;
11054    }
11055}
11056
11057impl Hrmr {
11058    /// Offset of the `AA64` field.
11059    pub const AA64_SHIFT: u32 = 0;
11060    /// Offset of the `RR` field.
11061    pub const RR_SHIFT: u32 = 1;
11062}
11063
11064bitflags! {
11065    /// `HSCTLR` system register value.
11066    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11067    #[repr(transparent)]
11068    pub struct Hsctlr: u32 {
11069        /// RES1 bits in the `HSCTLR` register.
11070        const RES1 = 0b110000110001010000100000000000;
11071        /// `M` bit.
11072        const M = 1 << 0;
11073        /// `A` bit.
11074        const A = 1 << 1;
11075        /// `C` bit.
11076        const C = 1 << 2;
11077        /// `nTLSMD` bit.
11078        const NTLSMD = 1 << 3;
11079        /// `LSMAOE` bit.
11080        const LSMAOE = 1 << 4;
11081        /// `CP15BEN` bit.
11082        const CP15BEN = 1 << 5;
11083        /// `ITD` bit.
11084        const ITD = 1 << 7;
11085        /// `SED` bit.
11086        const SED = 1 << 8;
11087        /// `I` bit.
11088        const I = 1 << 12;
11089        /// `WXN` bit.
11090        const WXN = 1 << 19;
11091        /// `TE` bit.
11092        const TE = 1 << 30;
11093        /// `DSSBS` bit.
11094        const DSSBS = 1 << 31;
11095    }
11096}
11097
11098impl Hsctlr {
11099    /// Offset of the `M` field.
11100    pub const M_SHIFT: u32 = 0;
11101    /// Offset of the `A` field.
11102    pub const A_SHIFT: u32 = 1;
11103    /// Offset of the `C` field.
11104    pub const C_SHIFT: u32 = 2;
11105    /// Offset of the `nTLSMD` field.
11106    pub const NTLSMD_SHIFT: u32 = 3;
11107    /// Offset of the `LSMAOE` field.
11108    pub const LSMAOE_SHIFT: u32 = 4;
11109    /// Offset of the `CP15BEN` field.
11110    pub const CP15BEN_SHIFT: u32 = 5;
11111    /// Offset of the `ITD` field.
11112    pub const ITD_SHIFT: u32 = 7;
11113    /// Offset of the `SED` field.
11114    pub const SED_SHIFT: u32 = 8;
11115    /// Offset of the `I` field.
11116    pub const I_SHIFT: u32 = 12;
11117    /// Offset of the `WXN` field.
11118    pub const WXN_SHIFT: u32 = 19;
11119    /// Offset of the `TE` field.
11120    pub const TE_SHIFT: u32 = 30;
11121    /// Offset of the `DSSBS` field.
11122    pub const DSSBS_SHIFT: u32 = 31;
11123}
11124
11125bitflags! {
11126    /// `HSR` system register value.
11127    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11128    #[repr(transparent)]
11129    pub struct Hsr: u32 {
11130        /// `IL` bit.
11131        const IL = 1 << 25;
11132    }
11133}
11134
11135impl Hsr {
11136    /// Offset of the `ISS` field.
11137    pub const ISS_SHIFT: u32 = 0;
11138    /// Mask for the `ISS` field.
11139    pub const ISS_MASK: u32 = 0b1111111111111111111111111;
11140    /// Offset of the `IL` field.
11141    pub const IL_SHIFT: u32 = 25;
11142    /// Offset of the `EC` field.
11143    pub const EC_SHIFT: u32 = 26;
11144    /// Mask for the `EC` field.
11145    pub const EC_MASK: u32 = 0b111111;
11146
11147    /// Returns the value of the `ISS` field.
11148    pub const fn iss(self) -> u32 {
11149        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
11150    }
11151
11152    /// Sets the value of the `ISS` field.
11153    pub const fn set_iss(&mut self, value: u32) {
11154        let offset = Self::ISS_SHIFT;
11155        assert!(value & (Self::ISS_MASK as u32) == value);
11156        *self = Self::from_bits_retain(
11157            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u32) << offset),
11158        );
11159    }
11160
11161    /// Returns a copy with the `ISS` field set to the given value.
11162    pub const fn with_iss(mut self, value: u32) -> Self {
11163        self.set_iss(value);
11164        self
11165    }
11166
11167    /// Returns the value of the `EC` field.
11168    pub const fn ec(self) -> u8 {
11169        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
11170    }
11171
11172    /// Sets the value of the `EC` field.
11173    pub const fn set_ec(&mut self, value: u8) {
11174        let offset = Self::EC_SHIFT;
11175        assert!(value & (Self::EC_MASK as u8) == value);
11176        *self = Self::from_bits_retain(
11177            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u32) << offset),
11178        );
11179    }
11180
11181    /// Returns a copy with the `EC` field set to the given value.
11182    pub const fn with_ec(mut self, value: u8) -> Self {
11183        self.set_ec(value);
11184        self
11185    }
11186}
11187
11188bitflags! {
11189    /// `HTCR` system register value.
11190    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11191    #[repr(transparent)]
11192    pub struct Htcr: u32 {
11193        /// RES1 bits in the `HTCR` register.
11194        const RES1 = 0b10000000100000000000000000000000;
11195        /// `HPD` bit.
11196        const HPD = 1 << 24;
11197        /// `HWU59` bit.
11198        const HWU59 = 1 << 25;
11199        /// `HWU60` bit.
11200        const HWU60 = 1 << 26;
11201        /// `HWU61` bit.
11202        const HWU61 = 1 << 27;
11203        /// `HWU62` bit.
11204        const HWU62 = 1 << 28;
11205    }
11206}
11207
11208impl Htcr {
11209    /// Offset of the `T0SZ` field.
11210    pub const T0SZ_SHIFT: u32 = 0;
11211    /// Mask for the `T0SZ` field.
11212    pub const T0SZ_MASK: u32 = 0b111;
11213    /// Offset of the `IRGN0` field.
11214    pub const IRGN0_SHIFT: u32 = 8;
11215    /// Mask for the `IRGN0` field.
11216    pub const IRGN0_MASK: u32 = 0b11;
11217    /// Offset of the `ORGN0` field.
11218    pub const ORGN0_SHIFT: u32 = 10;
11219    /// Mask for the `ORGN0` field.
11220    pub const ORGN0_MASK: u32 = 0b11;
11221    /// Offset of the `SH0` field.
11222    pub const SH0_SHIFT: u32 = 12;
11223    /// Mask for the `SH0` field.
11224    pub const SH0_MASK: u32 = 0b11;
11225    /// Offset of the `HPD` field.
11226    pub const HPD_SHIFT: u32 = 24;
11227    /// Offset of the `HWU59` field.
11228    pub const HWU59_SHIFT: u32 = 25;
11229    /// Offset of the `HWU60` field.
11230    pub const HWU60_SHIFT: u32 = 26;
11231    /// Offset of the `HWU61` field.
11232    pub const HWU61_SHIFT: u32 = 27;
11233    /// Offset of the `HWU62` field.
11234    pub const HWU62_SHIFT: u32 = 28;
11235
11236    /// Returns the value of the `T0SZ` field.
11237    pub const fn t0sz(self) -> u8 {
11238        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
11239    }
11240
11241    /// Sets the value of the `T0SZ` field.
11242    pub const fn set_t0sz(&mut self, value: u8) {
11243        let offset = Self::T0SZ_SHIFT;
11244        assert!(value & (Self::T0SZ_MASK as u8) == value);
11245        *self = Self::from_bits_retain(
11246            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
11247        );
11248    }
11249
11250    /// Returns a copy with the `T0SZ` field set to the given value.
11251    pub const fn with_t0sz(mut self, value: u8) -> Self {
11252        self.set_t0sz(value);
11253        self
11254    }
11255
11256    /// Returns the value of the `IRGN0` field.
11257    pub const fn irgn0(self) -> u8 {
11258        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
11259    }
11260
11261    /// Sets the value of the `IRGN0` field.
11262    pub const fn set_irgn0(&mut self, value: u8) {
11263        let offset = Self::IRGN0_SHIFT;
11264        assert!(value & (Self::IRGN0_MASK as u8) == value);
11265        *self = Self::from_bits_retain(
11266            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
11267        );
11268    }
11269
11270    /// Returns a copy with the `IRGN0` field set to the given value.
11271    pub const fn with_irgn0(mut self, value: u8) -> Self {
11272        self.set_irgn0(value);
11273        self
11274    }
11275
11276    /// Returns the value of the `ORGN0` field.
11277    pub const fn orgn0(self) -> u8 {
11278        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
11279    }
11280
11281    /// Sets the value of the `ORGN0` field.
11282    pub const fn set_orgn0(&mut self, value: u8) {
11283        let offset = Self::ORGN0_SHIFT;
11284        assert!(value & (Self::ORGN0_MASK as u8) == value);
11285        *self = Self::from_bits_retain(
11286            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
11287        );
11288    }
11289
11290    /// Returns a copy with the `ORGN0` field set to the given value.
11291    pub const fn with_orgn0(mut self, value: u8) -> Self {
11292        self.set_orgn0(value);
11293        self
11294    }
11295
11296    /// Returns the value of the `SH0` field.
11297    pub const fn sh0(self) -> u8 {
11298        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
11299    }
11300
11301    /// Sets the value of the `SH0` field.
11302    pub const fn set_sh0(&mut self, value: u8) {
11303        let offset = Self::SH0_SHIFT;
11304        assert!(value & (Self::SH0_MASK as u8) == value);
11305        *self = Self::from_bits_retain(
11306            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
11307        );
11308    }
11309
11310    /// Returns a copy with the `SH0` field set to the given value.
11311    pub const fn with_sh0(mut self, value: u8) -> Self {
11312        self.set_sh0(value);
11313        self
11314    }
11315}
11316
11317bitflags! {
11318    /// `HTPIDR` system register value.
11319    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11320    #[repr(transparent)]
11321    pub struct Htpidr: u32 {
11322    }
11323}
11324
11325impl Htpidr {
11326    /// Offset of the `TID` field.
11327    pub const TID_SHIFT: u32 = 0;
11328    /// Mask for the `TID` field.
11329    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
11330
11331    /// Returns the value of the `TID` field.
11332    pub const fn tid(self) -> u32 {
11333        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
11334    }
11335
11336    /// Sets the value of the `TID` field.
11337    pub const fn set_tid(&mut self, value: u32) {
11338        let offset = Self::TID_SHIFT;
11339        assert!(value & (Self::TID_MASK as u32) == value);
11340        *self = Self::from_bits_retain(
11341            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
11342        );
11343    }
11344
11345    /// Returns a copy with the `TID` field set to the given value.
11346    pub const fn with_tid(mut self, value: u32) -> Self {
11347        self.set_tid(value);
11348        self
11349    }
11350}
11351
11352bitflags! {
11353    /// `HTRFCR` system register value.
11354    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11355    #[repr(transparent)]
11356    pub struct Htrfcr: u32 {
11357        /// `E0HTRE` bit.
11358        const E0HTRE = 1 << 0;
11359        /// `E2TRE` bit.
11360        const E2TRE = 1 << 1;
11361        /// `CX` bit.
11362        const CX = 1 << 3;
11363    }
11364}
11365
11366impl Htrfcr {
11367    /// Offset of the `E0HTRE` field.
11368    pub const E0HTRE_SHIFT: u32 = 0;
11369    /// Offset of the `E2TRE` field.
11370    pub const E2TRE_SHIFT: u32 = 1;
11371    /// Offset of the `CX` field.
11372    pub const CX_SHIFT: u32 = 3;
11373    /// Offset of the `TS` field.
11374    pub const TS_SHIFT: u32 = 5;
11375    /// Mask for the `TS` field.
11376    pub const TS_MASK: u32 = 0b11;
11377
11378    /// Returns the value of the `TS` field.
11379    pub const fn ts(self) -> u8 {
11380        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
11381    }
11382
11383    /// Sets the value of the `TS` field.
11384    pub const fn set_ts(&mut self, value: u8) {
11385        let offset = Self::TS_SHIFT;
11386        assert!(value & (Self::TS_MASK as u8) == value);
11387        *self = Self::from_bits_retain(
11388            (self.bits() & !(Self::TS_MASK << offset)) | ((value as u32) << offset),
11389        );
11390    }
11391
11392    /// Returns a copy with the `TS` field set to the given value.
11393    pub const fn with_ts(mut self, value: u8) -> Self {
11394        self.set_ts(value);
11395        self
11396    }
11397}
11398
11399bitflags! {
11400    /// `HTTBR` system register value.
11401    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11402    #[repr(transparent)]
11403    pub struct Httbr: u64 {
11404        /// `CnP` bit.
11405        const CNP = 1 << 0;
11406    }
11407}
11408
11409impl Httbr {
11410    /// Offset of the `CnP` field.
11411    pub const CNP_SHIFT: u32 = 0;
11412    /// Offset of the `BADDR` field.
11413    pub const BADDR_SHIFT: u32 = 1;
11414    /// Mask for the `BADDR` field.
11415    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
11416
11417    /// Returns the value of the `BADDR` field.
11418    pub const fn baddr(self) -> u64 {
11419        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
11420            as u64
11421    }
11422
11423    /// Sets the value of the `BADDR` field.
11424    pub const fn set_baddr(&mut self, value: u64) {
11425        let offset = Self::BADDR_SHIFT;
11426        assert!(value & (Self::BADDR_MASK as u64) == value);
11427        *self = Self::from_bits_retain(
11428            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
11429        );
11430    }
11431
11432    /// Returns a copy with the `BADDR` field set to the given value.
11433    pub const fn with_baddr(mut self, value: u64) -> Self {
11434        self.set_baddr(value);
11435        self
11436    }
11437}
11438
11439bitflags! {
11440    /// `HVBAR` system register value.
11441    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11442    #[repr(transparent)]
11443    pub struct Hvbar: u32 {
11444    }
11445}
11446
11447impl Hvbar {
11448    /// Offset of the `VBA` field.
11449    pub const VBA_SHIFT: u32 = 5;
11450    /// Mask for the `VBA` field.
11451    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
11452
11453    /// Returns the value of the `VBA` field.
11454    pub const fn vba(self) -> u32 {
11455        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
11456    }
11457
11458    /// Sets the value of the `VBA` field.
11459    pub const fn set_vba(&mut self, value: u32) {
11460        let offset = Self::VBA_SHIFT;
11461        assert!(value & (Self::VBA_MASK as u32) == value);
11462        *self = Self::from_bits_retain(
11463            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
11464        );
11465    }
11466
11467    /// Returns a copy with the `VBA` field set to the given value.
11468    pub const fn with_vba(mut self, value: u32) -> Self {
11469        self.set_vba(value);
11470        self
11471    }
11472}
11473
11474#[cfg(feature = "el1")]
11475bitflags! {
11476    /// `ICC_AP1R0_EL1` system register value.
11477    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11478    #[repr(transparent)]
11479    pub struct IccAp1r0El1: u64 {
11480        /// `NMI` bit.
11481        const NMI = 1 << 63;
11482    }
11483}
11484
11485#[cfg(feature = "el1")]
11486impl IccAp1r0El1 {
11487    /// Offset of the `NMI` field.
11488    pub const NMI_SHIFT: u32 = 63;
11489}
11490
11491bitflags! {
11492    /// `ICC_ASGI1R` system register value.
11493    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11494    #[repr(transparent)]
11495    pub struct IccAsgi1r: u64 {
11496        /// `IRM` bit.
11497        const IRM = 1 << 40;
11498    }
11499}
11500
11501impl IccAsgi1r {
11502    /// Offset of the `TargetList` field.
11503    pub const TARGETLIST_SHIFT: u32 = 0;
11504    /// Mask for the `TargetList` field.
11505    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
11506    /// Offset of the `Aff1` field.
11507    pub const AFF1_SHIFT: u32 = 16;
11508    /// Mask for the `Aff1` field.
11509    pub const AFF1_MASK: u64 = 0b11111111;
11510    /// Offset of the `INTID` field.
11511    pub const INTID_SHIFT: u32 = 24;
11512    /// Mask for the `INTID` field.
11513    pub const INTID_MASK: u64 = 0b1111;
11514    /// Offset of the `Aff2` field.
11515    pub const AFF2_SHIFT: u32 = 32;
11516    /// Mask for the `Aff2` field.
11517    pub const AFF2_MASK: u64 = 0b11111111;
11518    /// Offset of the `IRM` field.
11519    pub const IRM_SHIFT: u32 = 40;
11520    /// Offset of the `RS` field.
11521    pub const RS_SHIFT: u32 = 44;
11522    /// Mask for the `RS` field.
11523    pub const RS_MASK: u64 = 0b1111;
11524    /// Offset of the `Aff3` field.
11525    pub const AFF3_SHIFT: u32 = 48;
11526    /// Mask for the `Aff3` field.
11527    pub const AFF3_MASK: u64 = 0b11111111;
11528
11529    /// Returns the value of the `TargetList` field.
11530    pub const fn targetlist(self) -> u16 {
11531        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
11532    }
11533
11534    /// Sets the value of the `TargetList` field.
11535    pub const fn set_targetlist(&mut self, value: u16) {
11536        let offset = Self::TARGETLIST_SHIFT;
11537        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
11538        *self = Self::from_bits_retain(
11539            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
11540        );
11541    }
11542
11543    /// Returns a copy with the `TargetList` field set to the given value.
11544    pub const fn with_targetlist(mut self, value: u16) -> Self {
11545        self.set_targetlist(value);
11546        self
11547    }
11548
11549    /// Returns the value of the `Aff1` field.
11550    pub const fn aff1(self) -> u8 {
11551        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
11552    }
11553
11554    /// Sets the value of the `Aff1` field.
11555    pub const fn set_aff1(&mut self, value: u8) {
11556        let offset = Self::AFF1_SHIFT;
11557        assert!(value & (Self::AFF1_MASK as u8) == value);
11558        *self = Self::from_bits_retain(
11559            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
11560        );
11561    }
11562
11563    /// Returns a copy with the `Aff1` field set to the given value.
11564    pub const fn with_aff1(mut self, value: u8) -> Self {
11565        self.set_aff1(value);
11566        self
11567    }
11568
11569    /// Returns the value of the `INTID` field.
11570    pub const fn intid(self) -> u8 {
11571        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
11572    }
11573
11574    /// Sets the value of the `INTID` field.
11575    pub const fn set_intid(&mut self, value: u8) {
11576        let offset = Self::INTID_SHIFT;
11577        assert!(value & (Self::INTID_MASK as u8) == value);
11578        *self = Self::from_bits_retain(
11579            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11580        );
11581    }
11582
11583    /// Returns a copy with the `INTID` field set to the given value.
11584    pub const fn with_intid(mut self, value: u8) -> Self {
11585        self.set_intid(value);
11586        self
11587    }
11588
11589    /// Returns the value of the `Aff2` field.
11590    pub const fn aff2(self) -> u8 {
11591        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
11592    }
11593
11594    /// Sets the value of the `Aff2` field.
11595    pub const fn set_aff2(&mut self, value: u8) {
11596        let offset = Self::AFF2_SHIFT;
11597        assert!(value & (Self::AFF2_MASK as u8) == value);
11598        *self = Self::from_bits_retain(
11599            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
11600        );
11601    }
11602
11603    /// Returns a copy with the `Aff2` field set to the given value.
11604    pub const fn with_aff2(mut self, value: u8) -> Self {
11605        self.set_aff2(value);
11606        self
11607    }
11608
11609    /// Returns the value of the `RS` field.
11610    pub const fn rs(self) -> u8 {
11611        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
11612    }
11613
11614    /// Sets the value of the `RS` field.
11615    pub const fn set_rs(&mut self, value: u8) {
11616        let offset = Self::RS_SHIFT;
11617        assert!(value & (Self::RS_MASK as u8) == value);
11618        *self = Self::from_bits_retain(
11619            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
11620        );
11621    }
11622
11623    /// Returns a copy with the `RS` field set to the given value.
11624    pub const fn with_rs(mut self, value: u8) -> Self {
11625        self.set_rs(value);
11626        self
11627    }
11628
11629    /// Returns the value of the `Aff3` field.
11630    pub const fn aff3(self) -> u8 {
11631        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
11632    }
11633
11634    /// Sets the value of the `Aff3` field.
11635    pub const fn set_aff3(&mut self, value: u8) {
11636        let offset = Self::AFF3_SHIFT;
11637        assert!(value & (Self::AFF3_MASK as u8) == value);
11638        *self = Self::from_bits_retain(
11639            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
11640        );
11641    }
11642
11643    /// Returns a copy with the `Aff3` field set to the given value.
11644    pub const fn with_aff3(mut self, value: u8) -> Self {
11645        self.set_aff3(value);
11646        self
11647    }
11648}
11649
11650#[cfg(feature = "el1")]
11651bitflags! {
11652    /// `ICC_ASGI1R_EL1` system register value.
11653    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11654    #[repr(transparent)]
11655    pub struct IccAsgi1rEl1: u64 {
11656        /// `IRM` bit.
11657        const IRM = 1 << 40;
11658    }
11659}
11660
11661#[cfg(feature = "el1")]
11662impl IccAsgi1rEl1 {
11663    /// Offset of the `TargetList` field.
11664    pub const TARGETLIST_SHIFT: u32 = 0;
11665    /// Mask for the `TargetList` field.
11666    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
11667    /// Offset of the `Aff1` field.
11668    pub const AFF1_SHIFT: u32 = 16;
11669    /// Mask for the `Aff1` field.
11670    pub const AFF1_MASK: u64 = 0b11111111;
11671    /// Offset of the `INTID` field.
11672    pub const INTID_SHIFT: u32 = 24;
11673    /// Mask for the `INTID` field.
11674    pub const INTID_MASK: u64 = 0b1111;
11675    /// Offset of the `Aff2` field.
11676    pub const AFF2_SHIFT: u32 = 32;
11677    /// Mask for the `Aff2` field.
11678    pub const AFF2_MASK: u64 = 0b11111111;
11679    /// Offset of the `IRM` field.
11680    pub const IRM_SHIFT: u32 = 40;
11681    /// Offset of the `RS` field.
11682    pub const RS_SHIFT: u32 = 44;
11683    /// Mask for the `RS` field.
11684    pub const RS_MASK: u64 = 0b1111;
11685    /// Offset of the `Aff3` field.
11686    pub const AFF3_SHIFT: u32 = 48;
11687    /// Mask for the `Aff3` field.
11688    pub const AFF3_MASK: u64 = 0b11111111;
11689
11690    /// Returns the value of the `TargetList` field.
11691    pub const fn targetlist(self) -> u16 {
11692        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
11693    }
11694
11695    /// Sets the value of the `TargetList` field.
11696    pub const fn set_targetlist(&mut self, value: u16) {
11697        let offset = Self::TARGETLIST_SHIFT;
11698        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
11699        *self = Self::from_bits_retain(
11700            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
11701        );
11702    }
11703
11704    /// Returns a copy with the `TargetList` field set to the given value.
11705    pub const fn with_targetlist(mut self, value: u16) -> Self {
11706        self.set_targetlist(value);
11707        self
11708    }
11709
11710    /// Returns the value of the `Aff1` field.
11711    pub const fn aff1(self) -> u8 {
11712        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
11713    }
11714
11715    /// Sets the value of the `Aff1` field.
11716    pub const fn set_aff1(&mut self, value: u8) {
11717        let offset = Self::AFF1_SHIFT;
11718        assert!(value & (Self::AFF1_MASK as u8) == value);
11719        *self = Self::from_bits_retain(
11720            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
11721        );
11722    }
11723
11724    /// Returns a copy with the `Aff1` field set to the given value.
11725    pub const fn with_aff1(mut self, value: u8) -> Self {
11726        self.set_aff1(value);
11727        self
11728    }
11729
11730    /// Returns the value of the `INTID` field.
11731    pub const fn intid(self) -> u8 {
11732        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
11733    }
11734
11735    /// Sets the value of the `INTID` field.
11736    pub const fn set_intid(&mut self, value: u8) {
11737        let offset = Self::INTID_SHIFT;
11738        assert!(value & (Self::INTID_MASK as u8) == value);
11739        *self = Self::from_bits_retain(
11740            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11741        );
11742    }
11743
11744    /// Returns a copy with the `INTID` field set to the given value.
11745    pub const fn with_intid(mut self, value: u8) -> Self {
11746        self.set_intid(value);
11747        self
11748    }
11749
11750    /// Returns the value of the `Aff2` field.
11751    pub const fn aff2(self) -> u8 {
11752        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
11753    }
11754
11755    /// Sets the value of the `Aff2` field.
11756    pub const fn set_aff2(&mut self, value: u8) {
11757        let offset = Self::AFF2_SHIFT;
11758        assert!(value & (Self::AFF2_MASK as u8) == value);
11759        *self = Self::from_bits_retain(
11760            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
11761        );
11762    }
11763
11764    /// Returns a copy with the `Aff2` field set to the given value.
11765    pub const fn with_aff2(mut self, value: u8) -> Self {
11766        self.set_aff2(value);
11767        self
11768    }
11769
11770    /// Returns the value of the `RS` field.
11771    pub const fn rs(self) -> u8 {
11772        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
11773    }
11774
11775    /// Sets the value of the `RS` field.
11776    pub const fn set_rs(&mut self, value: u8) {
11777        let offset = Self::RS_SHIFT;
11778        assert!(value & (Self::RS_MASK as u8) == value);
11779        *self = Self::from_bits_retain(
11780            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
11781        );
11782    }
11783
11784    /// Returns a copy with the `RS` field set to the given value.
11785    pub const fn with_rs(mut self, value: u8) -> Self {
11786        self.set_rs(value);
11787        self
11788    }
11789
11790    /// Returns the value of the `Aff3` field.
11791    pub const fn aff3(self) -> u8 {
11792        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
11793    }
11794
11795    /// Sets the value of the `Aff3` field.
11796    pub const fn set_aff3(&mut self, value: u8) {
11797        let offset = Self::AFF3_SHIFT;
11798        assert!(value & (Self::AFF3_MASK as u8) == value);
11799        *self = Self::from_bits_retain(
11800            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
11801        );
11802    }
11803
11804    /// Returns a copy with the `Aff3` field set to the given value.
11805    pub const fn with_aff3(mut self, value: u8) -> Self {
11806        self.set_aff3(value);
11807        self
11808    }
11809}
11810
11811bitflags! {
11812    /// `ICC_BPR0` system register value.
11813    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11814    #[repr(transparent)]
11815    pub struct IccBpr0: u32 {
11816    }
11817}
11818
11819impl IccBpr0 {
11820    /// Offset of the `BinaryPoint` field.
11821    pub const BINARYPOINT_SHIFT: u32 = 0;
11822    /// Mask for the `BinaryPoint` field.
11823    pub const BINARYPOINT_MASK: u32 = 0b111;
11824
11825    /// Returns the value of the `BinaryPoint` field.
11826    pub const fn binarypoint(self) -> u8 {
11827        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
11828    }
11829
11830    /// Sets the value of the `BinaryPoint` field.
11831    pub const fn set_binarypoint(&mut self, value: u8) {
11832        let offset = Self::BINARYPOINT_SHIFT;
11833        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
11834        *self = Self::from_bits_retain(
11835            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u32) << offset),
11836        );
11837    }
11838
11839    /// Returns a copy with the `BinaryPoint` field set to the given value.
11840    pub const fn with_binarypoint(mut self, value: u8) -> Self {
11841        self.set_binarypoint(value);
11842        self
11843    }
11844}
11845
11846#[cfg(feature = "el1")]
11847bitflags! {
11848    /// `ICC_BPR0_EL1` system register value.
11849    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11850    #[repr(transparent)]
11851    pub struct IccBpr0El1: u64 {
11852    }
11853}
11854
11855#[cfg(feature = "el1")]
11856impl IccBpr0El1 {
11857    /// Offset of the `BinaryPoint` field.
11858    pub const BINARYPOINT_SHIFT: u32 = 0;
11859    /// Mask for the `BinaryPoint` field.
11860    pub const BINARYPOINT_MASK: u64 = 0b111;
11861
11862    /// Returns the value of the `BinaryPoint` field.
11863    pub const fn binarypoint(self) -> u8 {
11864        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
11865    }
11866
11867    /// Sets the value of the `BinaryPoint` field.
11868    pub const fn set_binarypoint(&mut self, value: u8) {
11869        let offset = Self::BINARYPOINT_SHIFT;
11870        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
11871        *self = Self::from_bits_retain(
11872            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u64) << offset),
11873        );
11874    }
11875
11876    /// Returns a copy with the `BinaryPoint` field set to the given value.
11877    pub const fn with_binarypoint(mut self, value: u8) -> Self {
11878        self.set_binarypoint(value);
11879        self
11880    }
11881}
11882
11883bitflags! {
11884    /// `ICC_BPR1` system register value.
11885    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11886    #[repr(transparent)]
11887    pub struct IccBpr1: u32 {
11888    }
11889}
11890
11891impl IccBpr1 {
11892    /// Offset of the `BinaryPoint` field.
11893    pub const BINARYPOINT_SHIFT: u32 = 0;
11894    /// Mask for the `BinaryPoint` field.
11895    pub const BINARYPOINT_MASK: u32 = 0b111;
11896
11897    /// Returns the value of the `BinaryPoint` field.
11898    pub const fn binarypoint(self) -> u8 {
11899        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
11900    }
11901
11902    /// Sets the value of the `BinaryPoint` field.
11903    pub const fn set_binarypoint(&mut self, value: u8) {
11904        let offset = Self::BINARYPOINT_SHIFT;
11905        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
11906        *self = Self::from_bits_retain(
11907            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u32) << offset),
11908        );
11909    }
11910
11911    /// Returns a copy with the `BinaryPoint` field set to the given value.
11912    pub const fn with_binarypoint(mut self, value: u8) -> Self {
11913        self.set_binarypoint(value);
11914        self
11915    }
11916}
11917
11918#[cfg(feature = "el1")]
11919bitflags! {
11920    /// `ICC_BPR1_EL1` system register value.
11921    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11922    #[repr(transparent)]
11923    pub struct IccBpr1El1: u64 {
11924    }
11925}
11926
11927#[cfg(feature = "el1")]
11928impl IccBpr1El1 {
11929    /// Offset of the `BinaryPoint` field.
11930    pub const BINARYPOINT_SHIFT: u32 = 0;
11931    /// Mask for the `BinaryPoint` field.
11932    pub const BINARYPOINT_MASK: u64 = 0b111;
11933
11934    /// Returns the value of the `BinaryPoint` field.
11935    pub const fn binarypoint(self) -> u8 {
11936        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
11937    }
11938
11939    /// Sets the value of the `BinaryPoint` field.
11940    pub const fn set_binarypoint(&mut self, value: u8) {
11941        let offset = Self::BINARYPOINT_SHIFT;
11942        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
11943        *self = Self::from_bits_retain(
11944            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u64) << offset),
11945        );
11946    }
11947
11948    /// Returns a copy with the `BinaryPoint` field set to the given value.
11949    pub const fn with_binarypoint(mut self, value: u8) -> Self {
11950        self.set_binarypoint(value);
11951        self
11952    }
11953}
11954
11955bitflags! {
11956    /// `ICC_CTLR` system register value.
11957    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11958    #[repr(transparent)]
11959    pub struct IccCtlr: u32 {
11960        /// `CBPR` bit.
11961        const CBPR = 1 << 0;
11962        /// `EOImode` bit.
11963        const EOIMODE = 1 << 1;
11964        /// `PMHE` bit.
11965        const PMHE = 1 << 6;
11966        /// `SEIS` bit.
11967        const SEIS = 1 << 14;
11968        /// `A3V` bit.
11969        const A3V = 1 << 15;
11970        /// `RSS` bit.
11971        const RSS = 1 << 18;
11972        /// `ExtRange` bit.
11973        const EXTRANGE = 1 << 19;
11974    }
11975}
11976
11977impl IccCtlr {
11978    /// Offset of the `CBPR` field.
11979    pub const CBPR_SHIFT: u32 = 0;
11980    /// Offset of the `EOImode` field.
11981    pub const EOIMODE_SHIFT: u32 = 1;
11982    /// Offset of the `PMHE` field.
11983    pub const PMHE_SHIFT: u32 = 6;
11984    /// Offset of the `PRIbits` field.
11985    pub const PRIBITS_SHIFT: u32 = 8;
11986    /// Mask for the `PRIbits` field.
11987    pub const PRIBITS_MASK: u32 = 0b111;
11988    /// Offset of the `IDbits` field.
11989    pub const IDBITS_SHIFT: u32 = 11;
11990    /// Mask for the `IDbits` field.
11991    pub const IDBITS_MASK: u32 = 0b111;
11992    /// Offset of the `SEIS` field.
11993    pub const SEIS_SHIFT: u32 = 14;
11994    /// Offset of the `A3V` field.
11995    pub const A3V_SHIFT: u32 = 15;
11996    /// Offset of the `RSS` field.
11997    pub const RSS_SHIFT: u32 = 18;
11998    /// Offset of the `ExtRange` field.
11999    pub const EXTRANGE_SHIFT: u32 = 19;
12000
12001    /// Returns the value of the `PRIbits` field.
12002    pub const fn pribits(self) -> u8 {
12003        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
12004    }
12005
12006    /// Sets the value of the `PRIbits` field.
12007    pub const fn set_pribits(&mut self, value: u8) {
12008        let offset = Self::PRIBITS_SHIFT;
12009        assert!(value & (Self::PRIBITS_MASK as u8) == value);
12010        *self = Self::from_bits_retain(
12011            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u32) << offset),
12012        );
12013    }
12014
12015    /// Returns a copy with the `PRIbits` field set to the given value.
12016    pub const fn with_pribits(mut self, value: u8) -> Self {
12017        self.set_pribits(value);
12018        self
12019    }
12020
12021    /// Returns the value of the `IDbits` field.
12022    pub const fn idbits(self) -> u8 {
12023        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
12024    }
12025
12026    /// Sets the value of the `IDbits` field.
12027    pub const fn set_idbits(&mut self, value: u8) {
12028        let offset = Self::IDBITS_SHIFT;
12029        assert!(value & (Self::IDBITS_MASK as u8) == value);
12030        *self = Self::from_bits_retain(
12031            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u32) << offset),
12032        );
12033    }
12034
12035    /// Returns a copy with the `IDbits` field set to the given value.
12036    pub const fn with_idbits(mut self, value: u8) -> Self {
12037        self.set_idbits(value);
12038        self
12039    }
12040}
12041
12042#[cfg(feature = "el1")]
12043bitflags! {
12044    /// `ICC_CTLR_EL1` system register value.
12045    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12046    #[repr(transparent)]
12047    pub struct IccCtlrEl1: u64 {
12048        /// `CBPR` bit.
12049        const CBPR = 1 << 0;
12050        /// `EOImode` bit.
12051        const EOIMODE = 1 << 1;
12052        /// `PMHE` bit.
12053        const PMHE = 1 << 6;
12054        /// `SEIS` bit.
12055        const SEIS = 1 << 14;
12056        /// `A3V` bit.
12057        const A3V = 1 << 15;
12058        /// `RSS` bit.
12059        const RSS = 1 << 18;
12060        /// `ExtRange` bit.
12061        const EXTRANGE = 1 << 19;
12062    }
12063}
12064
12065#[cfg(feature = "el1")]
12066impl IccCtlrEl1 {
12067    /// Offset of the `CBPR` field.
12068    pub const CBPR_SHIFT: u32 = 0;
12069    /// Offset of the `EOImode` field.
12070    pub const EOIMODE_SHIFT: u32 = 1;
12071    /// Offset of the `PMHE` field.
12072    pub const PMHE_SHIFT: u32 = 6;
12073    /// Offset of the `PRIbits` field.
12074    pub const PRIBITS_SHIFT: u32 = 8;
12075    /// Mask for the `PRIbits` field.
12076    pub const PRIBITS_MASK: u64 = 0b111;
12077    /// Offset of the `IDbits` field.
12078    pub const IDBITS_SHIFT: u32 = 11;
12079    /// Mask for the `IDbits` field.
12080    pub const IDBITS_MASK: u64 = 0b111;
12081    /// Offset of the `SEIS` field.
12082    pub const SEIS_SHIFT: u32 = 14;
12083    /// Offset of the `A3V` field.
12084    pub const A3V_SHIFT: u32 = 15;
12085    /// Offset of the `RSS` field.
12086    pub const RSS_SHIFT: u32 = 18;
12087    /// Offset of the `ExtRange` field.
12088    pub const EXTRANGE_SHIFT: u32 = 19;
12089
12090    /// Returns the value of the `PRIbits` field.
12091    pub const fn pribits(self) -> u8 {
12092        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
12093    }
12094
12095    /// Sets the value of the `PRIbits` field.
12096    pub const fn set_pribits(&mut self, value: u8) {
12097        let offset = Self::PRIBITS_SHIFT;
12098        assert!(value & (Self::PRIBITS_MASK as u8) == value);
12099        *self = Self::from_bits_retain(
12100            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u64) << offset),
12101        );
12102    }
12103
12104    /// Returns a copy with the `PRIbits` field set to the given value.
12105    pub const fn with_pribits(mut self, value: u8) -> Self {
12106        self.set_pribits(value);
12107        self
12108    }
12109
12110    /// Returns the value of the `IDbits` field.
12111    pub const fn idbits(self) -> u8 {
12112        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
12113    }
12114
12115    /// Sets the value of the `IDbits` field.
12116    pub const fn set_idbits(&mut self, value: u8) {
12117        let offset = Self::IDBITS_SHIFT;
12118        assert!(value & (Self::IDBITS_MASK as u8) == value);
12119        *self = Self::from_bits_retain(
12120            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u64) << offset),
12121        );
12122    }
12123
12124    /// Returns a copy with the `IDbits` field set to the given value.
12125    pub const fn with_idbits(mut self, value: u8) -> Self {
12126        self.set_idbits(value);
12127        self
12128    }
12129}
12130
12131#[cfg(feature = "el3")]
12132bitflags! {
12133    /// `ICC_CTLR_EL3` system register value.
12134    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12135    #[repr(transparent)]
12136    pub struct IccCtlrEl3: u64 {
12137        /// `CBPR_EL1S` bit.
12138        const CBPR_EL1S = 1 << 0;
12139        /// `CBPR_EL1NS` bit.
12140        const CBPR_EL1NS = 1 << 1;
12141        /// `EOImode_EL3` bit.
12142        const EOIMODE_EL3 = 1 << 2;
12143        /// `EOImode_EL1S` bit.
12144        const EOIMODE_EL1S = 1 << 3;
12145        /// `EOImode_EL1NS` bit.
12146        const EOIMODE_EL1NS = 1 << 4;
12147        /// `RM` bit.
12148        const RM = 1 << 5;
12149        /// `PMHE` bit.
12150        const PMHE = 1 << 6;
12151        /// `SEIS` bit.
12152        const SEIS = 1 << 14;
12153        /// `A3V` bit.
12154        const A3V = 1 << 15;
12155        /// `nDS` bit.
12156        const NDS = 1 << 17;
12157        /// `RSS` bit.
12158        const RSS = 1 << 18;
12159        /// `ExtRange` bit.
12160        const EXTRANGE = 1 << 19;
12161    }
12162}
12163
12164#[cfg(feature = "el3")]
12165impl IccCtlrEl3 {
12166    /// Offset of the `CBPR_EL1S` field.
12167    pub const CBPR_EL1S_SHIFT: u32 = 0;
12168    /// Offset of the `CBPR_EL1NS` field.
12169    pub const CBPR_EL1NS_SHIFT: u32 = 1;
12170    /// Offset of the `EOImode_EL3` field.
12171    pub const EOIMODE_EL3_SHIFT: u32 = 2;
12172    /// Offset of the `EOImode_EL1S` field.
12173    pub const EOIMODE_EL1S_SHIFT: u32 = 3;
12174    /// Offset of the `EOImode_EL1NS` field.
12175    pub const EOIMODE_EL1NS_SHIFT: u32 = 4;
12176    /// Offset of the `RM` field.
12177    pub const RM_SHIFT: u32 = 5;
12178    /// Offset of the `PMHE` field.
12179    pub const PMHE_SHIFT: u32 = 6;
12180    /// Offset of the `PRIbits` field.
12181    pub const PRIBITS_SHIFT: u32 = 8;
12182    /// Mask for the `PRIbits` field.
12183    pub const PRIBITS_MASK: u64 = 0b111;
12184    /// Offset of the `IDbits` field.
12185    pub const IDBITS_SHIFT: u32 = 11;
12186    /// Mask for the `IDbits` field.
12187    pub const IDBITS_MASK: u64 = 0b111;
12188    /// Offset of the `SEIS` field.
12189    pub const SEIS_SHIFT: u32 = 14;
12190    /// Offset of the `A3V` field.
12191    pub const A3V_SHIFT: u32 = 15;
12192    /// Offset of the `nDS` field.
12193    pub const NDS_SHIFT: u32 = 17;
12194    /// Offset of the `RSS` field.
12195    pub const RSS_SHIFT: u32 = 18;
12196    /// Offset of the `ExtRange` field.
12197    pub const EXTRANGE_SHIFT: u32 = 19;
12198
12199    /// Returns the value of the `PRIbits` field.
12200    pub const fn pribits(self) -> u8 {
12201        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
12202    }
12203
12204    /// Sets the value of the `PRIbits` field.
12205    pub const fn set_pribits(&mut self, value: u8) {
12206        let offset = Self::PRIBITS_SHIFT;
12207        assert!(value & (Self::PRIBITS_MASK as u8) == value);
12208        *self = Self::from_bits_retain(
12209            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u64) << offset),
12210        );
12211    }
12212
12213    /// Returns a copy with the `PRIbits` field set to the given value.
12214    pub const fn with_pribits(mut self, value: u8) -> Self {
12215        self.set_pribits(value);
12216        self
12217    }
12218
12219    /// Returns the value of the `IDbits` field.
12220    pub const fn idbits(self) -> u8 {
12221        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
12222    }
12223
12224    /// Sets the value of the `IDbits` field.
12225    pub const fn set_idbits(&mut self, value: u8) {
12226        let offset = Self::IDBITS_SHIFT;
12227        assert!(value & (Self::IDBITS_MASK as u8) == value);
12228        *self = Self::from_bits_retain(
12229            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u64) << offset),
12230        );
12231    }
12232
12233    /// Returns a copy with the `IDbits` field set to the given value.
12234    pub const fn with_idbits(mut self, value: u8) -> Self {
12235        self.set_idbits(value);
12236        self
12237    }
12238}
12239
12240bitflags! {
12241    /// `ICC_DIR` system register value.
12242    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12243    #[repr(transparent)]
12244    pub struct IccDir: u32 {
12245    }
12246}
12247
12248impl IccDir {
12249    /// Offset of the `INTID` field.
12250    pub const INTID_SHIFT: u32 = 0;
12251    /// Mask for the `INTID` field.
12252    pub const INTID_MASK: u32 = 0b111111111111111111111111;
12253
12254    /// Returns the value of the `INTID` field.
12255    pub const fn intid(self) -> u32 {
12256        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12257    }
12258
12259    /// Sets the value of the `INTID` field.
12260    pub const fn set_intid(&mut self, value: u32) {
12261        let offset = Self::INTID_SHIFT;
12262        assert!(value & (Self::INTID_MASK as u32) == value);
12263        *self = Self::from_bits_retain(
12264            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
12265        );
12266    }
12267
12268    /// Returns a copy with the `INTID` field set to the given value.
12269    pub const fn with_intid(mut self, value: u32) -> Self {
12270        self.set_intid(value);
12271        self
12272    }
12273}
12274
12275#[cfg(feature = "el1")]
12276bitflags! {
12277    /// `ICC_DIR_EL1` system register value.
12278    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12279    #[repr(transparent)]
12280    pub struct IccDirEl1: u64 {
12281    }
12282}
12283
12284#[cfg(feature = "el1")]
12285impl IccDirEl1 {
12286    /// Offset of the `INTID` field.
12287    pub const INTID_SHIFT: u32 = 0;
12288    /// Mask for the `INTID` field.
12289    pub const INTID_MASK: u64 = 0b111111111111111111111111;
12290
12291    /// Returns the value of the `INTID` field.
12292    pub const fn intid(self) -> u32 {
12293        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12294    }
12295
12296    /// Sets the value of the `INTID` field.
12297    pub const fn set_intid(&mut self, value: u32) {
12298        let offset = Self::INTID_SHIFT;
12299        assert!(value & (Self::INTID_MASK as u32) == value);
12300        *self = Self::from_bits_retain(
12301            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12302        );
12303    }
12304
12305    /// Returns a copy with the `INTID` field set to the given value.
12306    pub const fn with_intid(mut self, value: u32) -> Self {
12307        self.set_intid(value);
12308        self
12309    }
12310}
12311
12312bitflags! {
12313    /// `ICC_EOIR0` system register value.
12314    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12315    #[repr(transparent)]
12316    pub struct IccEoir0: u32 {
12317    }
12318}
12319
12320impl IccEoir0 {
12321    /// Offset of the `INTID` field.
12322    pub const INTID_SHIFT: u32 = 0;
12323    /// Mask for the `INTID` field.
12324    pub const INTID_MASK: u32 = 0b111111111111111111111111;
12325
12326    /// Returns the value of the `INTID` field.
12327    pub const fn intid(self) -> u32 {
12328        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12329    }
12330
12331    /// Sets the value of the `INTID` field.
12332    pub const fn set_intid(&mut self, value: u32) {
12333        let offset = Self::INTID_SHIFT;
12334        assert!(value & (Self::INTID_MASK as u32) == value);
12335        *self = Self::from_bits_retain(
12336            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
12337        );
12338    }
12339
12340    /// Returns a copy with the `INTID` field set to the given value.
12341    pub const fn with_intid(mut self, value: u32) -> Self {
12342        self.set_intid(value);
12343        self
12344    }
12345}
12346
12347#[cfg(feature = "el1")]
12348bitflags! {
12349    /// `ICC_EOIR0_EL1` system register value.
12350    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12351    #[repr(transparent)]
12352    pub struct IccEoir0El1: u64 {
12353    }
12354}
12355
12356#[cfg(feature = "el1")]
12357impl IccEoir0El1 {
12358    /// Offset of the `INTID` field.
12359    pub const INTID_SHIFT: u32 = 0;
12360    /// Mask for the `INTID` field.
12361    pub const INTID_MASK: u64 = 0b111111111111111111111111;
12362
12363    /// Returns the value of the `INTID` field.
12364    pub const fn intid(self) -> u32 {
12365        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12366    }
12367
12368    /// Sets the value of the `INTID` field.
12369    pub const fn set_intid(&mut self, value: u32) {
12370        let offset = Self::INTID_SHIFT;
12371        assert!(value & (Self::INTID_MASK as u32) == value);
12372        *self = Self::from_bits_retain(
12373            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12374        );
12375    }
12376
12377    /// Returns a copy with the `INTID` field set to the given value.
12378    pub const fn with_intid(mut self, value: u32) -> Self {
12379        self.set_intid(value);
12380        self
12381    }
12382}
12383
12384bitflags! {
12385    /// `ICC_EOIR1` system register value.
12386    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12387    #[repr(transparent)]
12388    pub struct IccEoir1: u32 {
12389    }
12390}
12391
12392impl IccEoir1 {
12393    /// Offset of the `INTID` field.
12394    pub const INTID_SHIFT: u32 = 0;
12395    /// Mask for the `INTID` field.
12396    pub const INTID_MASK: u32 = 0b111111111111111111111111;
12397
12398    /// Returns the value of the `INTID` field.
12399    pub const fn intid(self) -> u32 {
12400        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12401    }
12402
12403    /// Sets the value of the `INTID` field.
12404    pub const fn set_intid(&mut self, value: u32) {
12405        let offset = Self::INTID_SHIFT;
12406        assert!(value & (Self::INTID_MASK as u32) == value);
12407        *self = Self::from_bits_retain(
12408            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
12409        );
12410    }
12411
12412    /// Returns a copy with the `INTID` field set to the given value.
12413    pub const fn with_intid(mut self, value: u32) -> Self {
12414        self.set_intid(value);
12415        self
12416    }
12417}
12418
12419#[cfg(feature = "el1")]
12420bitflags! {
12421    /// `ICC_EOIR1_EL1` system register value.
12422    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12423    #[repr(transparent)]
12424    pub struct IccEoir1El1: u64 {
12425    }
12426}
12427
12428#[cfg(feature = "el1")]
12429impl IccEoir1El1 {
12430    /// Offset of the `INTID` field.
12431    pub const INTID_SHIFT: u32 = 0;
12432    /// Mask for the `INTID` field.
12433    pub const INTID_MASK: u64 = 0b111111111111111111111111;
12434
12435    /// Returns the value of the `INTID` field.
12436    pub const fn intid(self) -> u32 {
12437        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12438    }
12439
12440    /// Sets the value of the `INTID` field.
12441    pub const fn set_intid(&mut self, value: u32) {
12442        let offset = Self::INTID_SHIFT;
12443        assert!(value & (Self::INTID_MASK as u32) == value);
12444        *self = Self::from_bits_retain(
12445            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12446        );
12447    }
12448
12449    /// Returns a copy with the `INTID` field set to the given value.
12450    pub const fn with_intid(mut self, value: u32) -> Self {
12451        self.set_intid(value);
12452        self
12453    }
12454}
12455
12456bitflags! {
12457    /// `ICC_HPPIR0` system register value.
12458    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12459    #[repr(transparent)]
12460    pub struct IccHppir0: u32 {
12461    }
12462}
12463
12464impl IccHppir0 {
12465    /// Offset of the `INTID` field.
12466    pub const INTID_SHIFT: u32 = 0;
12467    /// Mask for the `INTID` field.
12468    pub const INTID_MASK: u32 = 0b111111111111111111111111;
12469
12470    /// Returns the value of the `INTID` field.
12471    pub const fn intid(self) -> u32 {
12472        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12473    }
12474
12475    /// Sets the value of the `INTID` field.
12476    pub const fn set_intid(&mut self, value: u32) {
12477        let offset = Self::INTID_SHIFT;
12478        assert!(value & (Self::INTID_MASK as u32) == value);
12479        *self = Self::from_bits_retain(
12480            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
12481        );
12482    }
12483
12484    /// Returns a copy with the `INTID` field set to the given value.
12485    pub const fn with_intid(mut self, value: u32) -> Self {
12486        self.set_intid(value);
12487        self
12488    }
12489}
12490
12491#[cfg(feature = "el1")]
12492bitflags! {
12493    /// `ICC_HPPIR0_EL1` system register value.
12494    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12495    #[repr(transparent)]
12496    pub struct IccHppir0El1: u64 {
12497    }
12498}
12499
12500#[cfg(feature = "el1")]
12501impl IccHppir0El1 {
12502    /// Offset of the `INTID` field.
12503    pub const INTID_SHIFT: u32 = 0;
12504    /// Mask for the `INTID` field.
12505    pub const INTID_MASK: u64 = 0b111111111111111111111111;
12506
12507    /// Returns the value of the `INTID` field.
12508    pub const fn intid(self) -> u32 {
12509        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12510    }
12511
12512    /// Sets the value of the `INTID` field.
12513    pub const fn set_intid(&mut self, value: u32) {
12514        let offset = Self::INTID_SHIFT;
12515        assert!(value & (Self::INTID_MASK as u32) == value);
12516        *self = Self::from_bits_retain(
12517            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12518        );
12519    }
12520
12521    /// Returns a copy with the `INTID` field set to the given value.
12522    pub const fn with_intid(mut self, value: u32) -> Self {
12523        self.set_intid(value);
12524        self
12525    }
12526}
12527
12528bitflags! {
12529    /// `ICC_HPPIR1` system register value.
12530    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12531    #[repr(transparent)]
12532    pub struct IccHppir1: u32 {
12533    }
12534}
12535
12536impl IccHppir1 {
12537    /// Offset of the `INTID` field.
12538    pub const INTID_SHIFT: u32 = 0;
12539    /// Mask for the `INTID` field.
12540    pub const INTID_MASK: u32 = 0b111111111111111111111111;
12541
12542    /// Returns the value of the `INTID` field.
12543    pub const fn intid(self) -> u32 {
12544        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12545    }
12546
12547    /// Sets the value of the `INTID` field.
12548    pub const fn set_intid(&mut self, value: u32) {
12549        let offset = Self::INTID_SHIFT;
12550        assert!(value & (Self::INTID_MASK as u32) == value);
12551        *self = Self::from_bits_retain(
12552            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
12553        );
12554    }
12555
12556    /// Returns a copy with the `INTID` field set to the given value.
12557    pub const fn with_intid(mut self, value: u32) -> Self {
12558        self.set_intid(value);
12559        self
12560    }
12561}
12562
12563#[cfg(feature = "el1")]
12564bitflags! {
12565    /// `ICC_HPPIR1_EL1` system register value.
12566    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12567    #[repr(transparent)]
12568    pub struct IccHppir1El1: u64 {
12569    }
12570}
12571
12572#[cfg(feature = "el1")]
12573impl IccHppir1El1 {
12574    /// Offset of the `INTID` field.
12575    pub const INTID_SHIFT: u32 = 0;
12576    /// Mask for the `INTID` field.
12577    pub const INTID_MASK: u64 = 0b111111111111111111111111;
12578
12579    /// Returns the value of the `INTID` field.
12580    pub const fn intid(self) -> u32 {
12581        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12582    }
12583
12584    /// Sets the value of the `INTID` field.
12585    pub const fn set_intid(&mut self, value: u32) {
12586        let offset = Self::INTID_SHIFT;
12587        assert!(value & (Self::INTID_MASK as u32) == value);
12588        *self = Self::from_bits_retain(
12589            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12590        );
12591    }
12592
12593    /// Returns a copy with the `INTID` field set to the given value.
12594    pub const fn with_intid(mut self, value: u32) -> Self {
12595        self.set_intid(value);
12596        self
12597    }
12598}
12599
12600bitflags! {
12601    /// `ICC_HSRE` system register value.
12602    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12603    #[repr(transparent)]
12604    pub struct IccHsre: u32 {
12605        /// `SRE` bit.
12606        const SRE = 1 << 0;
12607        /// `DFB` bit.
12608        const DFB = 1 << 1;
12609        /// `DIB` bit.
12610        const DIB = 1 << 2;
12611        /// `Enable` bit.
12612        const ENABLE = 1 << 3;
12613    }
12614}
12615
12616impl IccHsre {
12617    /// Offset of the `SRE` field.
12618    pub const SRE_SHIFT: u32 = 0;
12619    /// Offset of the `DFB` field.
12620    pub const DFB_SHIFT: u32 = 1;
12621    /// Offset of the `DIB` field.
12622    pub const DIB_SHIFT: u32 = 2;
12623    /// Offset of the `Enable` field.
12624    pub const ENABLE_SHIFT: u32 = 3;
12625}
12626
12627bitflags! {
12628    /// `ICC_IAR0` system register value.
12629    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12630    #[repr(transparent)]
12631    pub struct IccIar0: u32 {
12632    }
12633}
12634
12635impl IccIar0 {
12636    /// Offset of the `INTID` field.
12637    pub const INTID_SHIFT: u32 = 0;
12638    /// Mask for the `INTID` field.
12639    pub const INTID_MASK: u32 = 0b111111111111111111111111;
12640
12641    /// Returns the value of the `INTID` field.
12642    pub const fn intid(self) -> u32 {
12643        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12644    }
12645
12646    /// Sets the value of the `INTID` field.
12647    pub const fn set_intid(&mut self, value: u32) {
12648        let offset = Self::INTID_SHIFT;
12649        assert!(value & (Self::INTID_MASK as u32) == value);
12650        *self = Self::from_bits_retain(
12651            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
12652        );
12653    }
12654
12655    /// Returns a copy with the `INTID` field set to the given value.
12656    pub const fn with_intid(mut self, value: u32) -> Self {
12657        self.set_intid(value);
12658        self
12659    }
12660}
12661
12662#[cfg(feature = "el1")]
12663bitflags! {
12664    /// `ICC_IAR0_EL1` system register value.
12665    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12666    #[repr(transparent)]
12667    pub struct IccIar0El1: u64 {
12668    }
12669}
12670
12671#[cfg(feature = "el1")]
12672impl IccIar0El1 {
12673    /// Offset of the `INTID` field.
12674    pub const INTID_SHIFT: u32 = 0;
12675    /// Mask for the `INTID` field.
12676    pub const INTID_MASK: u64 = 0b111111111111111111111111;
12677
12678    /// Returns the value of the `INTID` field.
12679    pub const fn intid(self) -> u32 {
12680        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12681    }
12682
12683    /// Sets the value of the `INTID` field.
12684    pub const fn set_intid(&mut self, value: u32) {
12685        let offset = Self::INTID_SHIFT;
12686        assert!(value & (Self::INTID_MASK as u32) == value);
12687        *self = Self::from_bits_retain(
12688            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12689        );
12690    }
12691
12692    /// Returns a copy with the `INTID` field set to the given value.
12693    pub const fn with_intid(mut self, value: u32) -> Self {
12694        self.set_intid(value);
12695        self
12696    }
12697}
12698
12699bitflags! {
12700    /// `ICC_IAR1` system register value.
12701    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12702    #[repr(transparent)]
12703    pub struct IccIar1: u32 {
12704    }
12705}
12706
12707impl IccIar1 {
12708    /// Offset of the `INTID` field.
12709    pub const INTID_SHIFT: u32 = 0;
12710    /// Mask for the `INTID` field.
12711    pub const INTID_MASK: u32 = 0b111111111111111111111111;
12712
12713    /// Returns the value of the `INTID` field.
12714    pub const fn intid(self) -> u32 {
12715        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12716    }
12717
12718    /// Sets the value of the `INTID` field.
12719    pub const fn set_intid(&mut self, value: u32) {
12720        let offset = Self::INTID_SHIFT;
12721        assert!(value & (Self::INTID_MASK as u32) == value);
12722        *self = Self::from_bits_retain(
12723            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
12724        );
12725    }
12726
12727    /// Returns a copy with the `INTID` field set to the given value.
12728    pub const fn with_intid(mut self, value: u32) -> Self {
12729        self.set_intid(value);
12730        self
12731    }
12732}
12733
12734#[cfg(feature = "el1")]
12735bitflags! {
12736    /// `ICC_IAR1_EL1` system register value.
12737    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12738    #[repr(transparent)]
12739    pub struct IccIar1El1: u64 {
12740    }
12741}
12742
12743#[cfg(feature = "el1")]
12744impl IccIar1El1 {
12745    /// Offset of the `INTID` field.
12746    pub const INTID_SHIFT: u32 = 0;
12747    /// Mask for the `INTID` field.
12748    pub const INTID_MASK: u64 = 0b111111111111111111111111;
12749
12750    /// Returns the value of the `INTID` field.
12751    pub const fn intid(self) -> u32 {
12752        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
12753    }
12754
12755    /// Sets the value of the `INTID` field.
12756    pub const fn set_intid(&mut self, value: u32) {
12757        let offset = Self::INTID_SHIFT;
12758        assert!(value & (Self::INTID_MASK as u32) == value);
12759        *self = Self::from_bits_retain(
12760            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12761        );
12762    }
12763
12764    /// Returns a copy with the `INTID` field set to the given value.
12765    pub const fn with_intid(mut self, value: u32) -> Self {
12766        self.set_intid(value);
12767        self
12768    }
12769}
12770
12771bitflags! {
12772    /// `ICC_IGRPEN0` system register value.
12773    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12774    #[repr(transparent)]
12775    pub struct IccIgrpen0: u32 {
12776        /// `Enable` bit.
12777        const ENABLE = 1 << 0;
12778    }
12779}
12780
12781impl IccIgrpen0 {
12782    /// Offset of the `Enable` field.
12783    pub const ENABLE_SHIFT: u32 = 0;
12784}
12785
12786#[cfg(feature = "el1")]
12787bitflags! {
12788    /// `ICC_IGRPEN0_EL1` system register value.
12789    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12790    #[repr(transparent)]
12791    pub struct IccIgrpen0El1: u64 {
12792        /// `Enable` bit.
12793        const ENABLE = 1 << 0;
12794    }
12795}
12796
12797#[cfg(feature = "el1")]
12798impl IccIgrpen0El1 {
12799    /// Offset of the `Enable` field.
12800    pub const ENABLE_SHIFT: u32 = 0;
12801}
12802
12803bitflags! {
12804    /// `ICC_IGRPEN1` system register value.
12805    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12806    #[repr(transparent)]
12807    pub struct IccIgrpen1: u32 {
12808        /// `Enable` bit.
12809        const ENABLE = 1 << 0;
12810    }
12811}
12812
12813impl IccIgrpen1 {
12814    /// Offset of the `Enable` field.
12815    pub const ENABLE_SHIFT: u32 = 0;
12816}
12817
12818#[cfg(feature = "el1")]
12819bitflags! {
12820    /// `ICC_IGRPEN1_EL1` system register value.
12821    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12822    #[repr(transparent)]
12823    pub struct IccIgrpen1El1: u64 {
12824        /// `Enable` bit.
12825        const ENABLE = 1 << 0;
12826    }
12827}
12828
12829#[cfg(feature = "el1")]
12830impl IccIgrpen1El1 {
12831    /// Offset of the `Enable` field.
12832    pub const ENABLE_SHIFT: u32 = 0;
12833}
12834
12835#[cfg(feature = "el3")]
12836bitflags! {
12837    /// `ICC_IGRPEN1_EL3` system register value.
12838    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12839    #[repr(transparent)]
12840    pub struct IccIgrpen1El3: u64 {
12841        /// `EnableGrp1NS` bit.
12842        const ENABLEGRP1NS = 1 << 0;
12843        /// `EnableGrp1S` bit.
12844        const ENABLEGRP1S = 1 << 1;
12845    }
12846}
12847
12848#[cfg(feature = "el3")]
12849impl IccIgrpen1El3 {
12850    /// Offset of the `EnableGrp1NS` field.
12851    pub const ENABLEGRP1NS_SHIFT: u32 = 0;
12852    /// Offset of the `EnableGrp1S` field.
12853    pub const ENABLEGRP1S_SHIFT: u32 = 1;
12854}
12855
12856bitflags! {
12857    /// `ICC_MCTLR` system register value.
12858    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12859    #[repr(transparent)]
12860    pub struct IccMctlr: u32 {
12861        /// `CBPR_EL1S` bit.
12862        const CBPR_EL1S = 1 << 0;
12863        /// `CBPR_EL1NS` bit.
12864        const CBPR_EL1NS = 1 << 1;
12865        /// `EOImode_EL3` bit.
12866        const EOIMODE_EL3 = 1 << 2;
12867        /// `EOImode_EL1S` bit.
12868        const EOIMODE_EL1S = 1 << 3;
12869        /// `EOImode_EL1NS` bit.
12870        const EOIMODE_EL1NS = 1 << 4;
12871        /// `RM` bit.
12872        const RM = 1 << 5;
12873        /// `PMHE` bit.
12874        const PMHE = 1 << 6;
12875        /// `SEIS` bit.
12876        const SEIS = 1 << 14;
12877        /// `A3V` bit.
12878        const A3V = 1 << 15;
12879        /// `nDS` bit.
12880        const NDS = 1 << 17;
12881        /// `RSS` bit.
12882        const RSS = 1 << 18;
12883        /// `ExtRange` bit.
12884        const EXTRANGE = 1 << 19;
12885    }
12886}
12887
12888impl IccMctlr {
12889    /// Offset of the `CBPR_EL1S` field.
12890    pub const CBPR_EL1S_SHIFT: u32 = 0;
12891    /// Offset of the `CBPR_EL1NS` field.
12892    pub const CBPR_EL1NS_SHIFT: u32 = 1;
12893    /// Offset of the `EOImode_EL3` field.
12894    pub const EOIMODE_EL3_SHIFT: u32 = 2;
12895    /// Offset of the `EOImode_EL1S` field.
12896    pub const EOIMODE_EL1S_SHIFT: u32 = 3;
12897    /// Offset of the `EOImode_EL1NS` field.
12898    pub const EOIMODE_EL1NS_SHIFT: u32 = 4;
12899    /// Offset of the `RM` field.
12900    pub const RM_SHIFT: u32 = 5;
12901    /// Offset of the `PMHE` field.
12902    pub const PMHE_SHIFT: u32 = 6;
12903    /// Offset of the `PRIbits` field.
12904    pub const PRIBITS_SHIFT: u32 = 8;
12905    /// Mask for the `PRIbits` field.
12906    pub const PRIBITS_MASK: u32 = 0b111;
12907    /// Offset of the `IDbits` field.
12908    pub const IDBITS_SHIFT: u32 = 11;
12909    /// Mask for the `IDbits` field.
12910    pub const IDBITS_MASK: u32 = 0b111;
12911    /// Offset of the `SEIS` field.
12912    pub const SEIS_SHIFT: u32 = 14;
12913    /// Offset of the `A3V` field.
12914    pub const A3V_SHIFT: u32 = 15;
12915    /// Offset of the `nDS` field.
12916    pub const NDS_SHIFT: u32 = 17;
12917    /// Offset of the `RSS` field.
12918    pub const RSS_SHIFT: u32 = 18;
12919    /// Offset of the `ExtRange` field.
12920    pub const EXTRANGE_SHIFT: u32 = 19;
12921
12922    /// Returns the value of the `PRIbits` field.
12923    pub const fn pribits(self) -> u8 {
12924        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
12925    }
12926
12927    /// Sets the value of the `PRIbits` field.
12928    pub const fn set_pribits(&mut self, value: u8) {
12929        let offset = Self::PRIBITS_SHIFT;
12930        assert!(value & (Self::PRIBITS_MASK as u8) == value);
12931        *self = Self::from_bits_retain(
12932            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u32) << offset),
12933        );
12934    }
12935
12936    /// Returns a copy with the `PRIbits` field set to the given value.
12937    pub const fn with_pribits(mut self, value: u8) -> Self {
12938        self.set_pribits(value);
12939        self
12940    }
12941
12942    /// Returns the value of the `IDbits` field.
12943    pub const fn idbits(self) -> u8 {
12944        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
12945    }
12946
12947    /// Sets the value of the `IDbits` field.
12948    pub const fn set_idbits(&mut self, value: u8) {
12949        let offset = Self::IDBITS_SHIFT;
12950        assert!(value & (Self::IDBITS_MASK as u8) == value);
12951        *self = Self::from_bits_retain(
12952            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u32) << offset),
12953        );
12954    }
12955
12956    /// Returns a copy with the `IDbits` field set to the given value.
12957    pub const fn with_idbits(mut self, value: u8) -> Self {
12958        self.set_idbits(value);
12959        self
12960    }
12961}
12962
12963bitflags! {
12964    /// `ICC_MGRPEN1` system register value.
12965    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12966    #[repr(transparent)]
12967    pub struct IccMgrpen1: u32 {
12968        /// `EnableGrp1NS` bit.
12969        const ENABLEGRP1NS = 1 << 0;
12970        /// `EnableGrp1S` bit.
12971        const ENABLEGRP1S = 1 << 1;
12972    }
12973}
12974
12975impl IccMgrpen1 {
12976    /// Offset of the `EnableGrp1NS` field.
12977    pub const ENABLEGRP1NS_SHIFT: u32 = 0;
12978    /// Offset of the `EnableGrp1S` field.
12979    pub const ENABLEGRP1S_SHIFT: u32 = 1;
12980}
12981
12982bitflags! {
12983    /// `ICC_MSRE` system register value.
12984    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12985    #[repr(transparent)]
12986    pub struct IccMsre: u32 {
12987        /// `SRE` bit.
12988        const SRE = 1 << 0;
12989        /// `DFB` bit.
12990        const DFB = 1 << 1;
12991        /// `DIB` bit.
12992        const DIB = 1 << 2;
12993        /// `Enable` bit.
12994        const ENABLE = 1 << 3;
12995    }
12996}
12997
12998impl IccMsre {
12999    /// Offset of the `SRE` field.
13000    pub const SRE_SHIFT: u32 = 0;
13001    /// Offset of the `DFB` field.
13002    pub const DFB_SHIFT: u32 = 1;
13003    /// Offset of the `DIB` field.
13004    pub const DIB_SHIFT: u32 = 2;
13005    /// Offset of the `Enable` field.
13006    pub const ENABLE_SHIFT: u32 = 3;
13007}
13008
13009#[cfg(feature = "el1")]
13010bitflags! {
13011    /// `ICC_NMIAR1_EL1` system register value.
13012    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13013    #[repr(transparent)]
13014    pub struct IccNmiar1El1: u64 {
13015    }
13016}
13017
13018#[cfg(feature = "el1")]
13019impl IccNmiar1El1 {
13020    /// Offset of the `INTID` field.
13021    pub const INTID_SHIFT: u32 = 0;
13022    /// Mask for the `INTID` field.
13023    pub const INTID_MASK: u64 = 0b111111111111111111111111;
13024
13025    /// Returns the value of the `INTID` field.
13026    pub const fn intid(self) -> u32 {
13027        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
13028    }
13029
13030    /// Sets the value of the `INTID` field.
13031    pub const fn set_intid(&mut self, value: u32) {
13032        let offset = Self::INTID_SHIFT;
13033        assert!(value & (Self::INTID_MASK as u32) == value);
13034        *self = Self::from_bits_retain(
13035            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
13036        );
13037    }
13038
13039    /// Returns a copy with the `INTID` field set to the given value.
13040    pub const fn with_intid(mut self, value: u32) -> Self {
13041        self.set_intid(value);
13042        self
13043    }
13044}
13045
13046bitflags! {
13047    /// `ICC_PMR` system register value.
13048    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13049    #[repr(transparent)]
13050    pub struct IccPmr: u32 {
13051    }
13052}
13053
13054impl IccPmr {
13055    /// Offset of the `Priority` field.
13056    pub const PRIORITY_SHIFT: u32 = 0;
13057    /// Mask for the `Priority` field.
13058    pub const PRIORITY_MASK: u32 = 0b11111111;
13059
13060    /// Returns the value of the `Priority` field.
13061    pub const fn priority(self) -> u8 {
13062        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
13063    }
13064
13065    /// Sets the value of the `Priority` field.
13066    pub const fn set_priority(&mut self, value: u8) {
13067        let offset = Self::PRIORITY_SHIFT;
13068        assert!(value & (Self::PRIORITY_MASK as u8) == value);
13069        *self = Self::from_bits_retain(
13070            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u32) << offset),
13071        );
13072    }
13073
13074    /// Returns a copy with the `Priority` field set to the given value.
13075    pub const fn with_priority(mut self, value: u8) -> Self {
13076        self.set_priority(value);
13077        self
13078    }
13079}
13080
13081#[cfg(feature = "el1")]
13082bitflags! {
13083    /// `ICC_PMR_EL1` system register value.
13084    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13085    #[repr(transparent)]
13086    pub struct IccPmrEl1: u64 {
13087    }
13088}
13089
13090#[cfg(feature = "el1")]
13091impl IccPmrEl1 {
13092    /// Offset of the `Priority` field.
13093    pub const PRIORITY_SHIFT: u32 = 0;
13094    /// Mask for the `Priority` field.
13095    pub const PRIORITY_MASK: u64 = 0b11111111;
13096
13097    /// Returns the value of the `Priority` field.
13098    pub const fn priority(self) -> u8 {
13099        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
13100    }
13101
13102    /// Sets the value of the `Priority` field.
13103    pub const fn set_priority(&mut self, value: u8) {
13104        let offset = Self::PRIORITY_SHIFT;
13105        assert!(value & (Self::PRIORITY_MASK as u8) == value);
13106        *self = Self::from_bits_retain(
13107            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u64) << offset),
13108        );
13109    }
13110
13111    /// Returns a copy with the `Priority` field set to the given value.
13112    pub const fn with_priority(mut self, value: u8) -> Self {
13113        self.set_priority(value);
13114        self
13115    }
13116}
13117
13118bitflags! {
13119    /// `ICC_RPR` system register value.
13120    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13121    #[repr(transparent)]
13122    pub struct IccRpr: u32 {
13123    }
13124}
13125
13126impl IccRpr {
13127    /// Offset of the `Priority` field.
13128    pub const PRIORITY_SHIFT: u32 = 0;
13129    /// Mask for the `Priority` field.
13130    pub const PRIORITY_MASK: u32 = 0b11111111;
13131
13132    /// Returns the value of the `Priority` field.
13133    pub const fn priority(self) -> u8 {
13134        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
13135    }
13136
13137    /// Sets the value of the `Priority` field.
13138    pub const fn set_priority(&mut self, value: u8) {
13139        let offset = Self::PRIORITY_SHIFT;
13140        assert!(value & (Self::PRIORITY_MASK as u8) == value);
13141        *self = Self::from_bits_retain(
13142            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u32) << offset),
13143        );
13144    }
13145
13146    /// Returns a copy with the `Priority` field set to the given value.
13147    pub const fn with_priority(mut self, value: u8) -> Self {
13148        self.set_priority(value);
13149        self
13150    }
13151}
13152
13153#[cfg(feature = "el1")]
13154bitflags! {
13155    /// `ICC_RPR_EL1` system register value.
13156    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13157    #[repr(transparent)]
13158    pub struct IccRprEl1: u64 {
13159        /// `NMI_NS` bit.
13160        const NMI_NS = 1 << 62;
13161        /// `NMI` bit.
13162        const NMI = 1 << 63;
13163    }
13164}
13165
13166#[cfg(feature = "el1")]
13167impl IccRprEl1 {
13168    /// Offset of the `Priority` field.
13169    pub const PRIORITY_SHIFT: u32 = 0;
13170    /// Mask for the `Priority` field.
13171    pub const PRIORITY_MASK: u64 = 0b11111111;
13172    /// Offset of the `NMI_NS` field.
13173    pub const NMI_NS_SHIFT: u32 = 62;
13174    /// Offset of the `NMI` field.
13175    pub const NMI_SHIFT: u32 = 63;
13176
13177    /// Returns the value of the `Priority` field.
13178    pub const fn priority(self) -> u8 {
13179        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
13180    }
13181
13182    /// Sets the value of the `Priority` field.
13183    pub const fn set_priority(&mut self, value: u8) {
13184        let offset = Self::PRIORITY_SHIFT;
13185        assert!(value & (Self::PRIORITY_MASK as u8) == value);
13186        *self = Self::from_bits_retain(
13187            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u64) << offset),
13188        );
13189    }
13190
13191    /// Returns a copy with the `Priority` field set to the given value.
13192    pub const fn with_priority(mut self, value: u8) -> Self {
13193        self.set_priority(value);
13194        self
13195    }
13196}
13197
13198bitflags! {
13199    /// `ICC_SGI0R` system register value.
13200    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13201    #[repr(transparent)]
13202    pub struct IccSgi0r: u64 {
13203        /// `IRM` bit.
13204        const IRM = 1 << 40;
13205    }
13206}
13207
13208impl IccSgi0r {
13209    /// Offset of the `TargetList` field.
13210    pub const TARGETLIST_SHIFT: u32 = 0;
13211    /// Mask for the `TargetList` field.
13212    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
13213    /// Offset of the `Aff1` field.
13214    pub const AFF1_SHIFT: u32 = 16;
13215    /// Mask for the `Aff1` field.
13216    pub const AFF1_MASK: u64 = 0b11111111;
13217    /// Offset of the `INTID` field.
13218    pub const INTID_SHIFT: u32 = 24;
13219    /// Mask for the `INTID` field.
13220    pub const INTID_MASK: u64 = 0b1111;
13221    /// Offset of the `Aff2` field.
13222    pub const AFF2_SHIFT: u32 = 32;
13223    /// Mask for the `Aff2` field.
13224    pub const AFF2_MASK: u64 = 0b11111111;
13225    /// Offset of the `IRM` field.
13226    pub const IRM_SHIFT: u32 = 40;
13227    /// Offset of the `RS` field.
13228    pub const RS_SHIFT: u32 = 44;
13229    /// Mask for the `RS` field.
13230    pub const RS_MASK: u64 = 0b1111;
13231    /// Offset of the `Aff3` field.
13232    pub const AFF3_SHIFT: u32 = 48;
13233    /// Mask for the `Aff3` field.
13234    pub const AFF3_MASK: u64 = 0b11111111;
13235
13236    /// Returns the value of the `TargetList` field.
13237    pub const fn targetlist(self) -> u16 {
13238        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
13239    }
13240
13241    /// Sets the value of the `TargetList` field.
13242    pub const fn set_targetlist(&mut self, value: u16) {
13243        let offset = Self::TARGETLIST_SHIFT;
13244        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
13245        *self = Self::from_bits_retain(
13246            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
13247        );
13248    }
13249
13250    /// Returns a copy with the `TargetList` field set to the given value.
13251    pub const fn with_targetlist(mut self, value: u16) -> Self {
13252        self.set_targetlist(value);
13253        self
13254    }
13255
13256    /// Returns the value of the `Aff1` field.
13257    pub const fn aff1(self) -> u8 {
13258        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
13259    }
13260
13261    /// Sets the value of the `Aff1` field.
13262    pub const fn set_aff1(&mut self, value: u8) {
13263        let offset = Self::AFF1_SHIFT;
13264        assert!(value & (Self::AFF1_MASK as u8) == value);
13265        *self = Self::from_bits_retain(
13266            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
13267        );
13268    }
13269
13270    /// Returns a copy with the `Aff1` field set to the given value.
13271    pub const fn with_aff1(mut self, value: u8) -> Self {
13272        self.set_aff1(value);
13273        self
13274    }
13275
13276    /// Returns the value of the `INTID` field.
13277    pub const fn intid(self) -> u8 {
13278        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
13279    }
13280
13281    /// Sets the value of the `INTID` field.
13282    pub const fn set_intid(&mut self, value: u8) {
13283        let offset = Self::INTID_SHIFT;
13284        assert!(value & (Self::INTID_MASK as u8) == value);
13285        *self = Self::from_bits_retain(
13286            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
13287        );
13288    }
13289
13290    /// Returns a copy with the `INTID` field set to the given value.
13291    pub const fn with_intid(mut self, value: u8) -> Self {
13292        self.set_intid(value);
13293        self
13294    }
13295
13296    /// Returns the value of the `Aff2` field.
13297    pub const fn aff2(self) -> u8 {
13298        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
13299    }
13300
13301    /// Sets the value of the `Aff2` field.
13302    pub const fn set_aff2(&mut self, value: u8) {
13303        let offset = Self::AFF2_SHIFT;
13304        assert!(value & (Self::AFF2_MASK as u8) == value);
13305        *self = Self::from_bits_retain(
13306            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
13307        );
13308    }
13309
13310    /// Returns a copy with the `Aff2` field set to the given value.
13311    pub const fn with_aff2(mut self, value: u8) -> Self {
13312        self.set_aff2(value);
13313        self
13314    }
13315
13316    /// Returns the value of the `RS` field.
13317    pub const fn rs(self) -> u8 {
13318        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
13319    }
13320
13321    /// Sets the value of the `RS` field.
13322    pub const fn set_rs(&mut self, value: u8) {
13323        let offset = Self::RS_SHIFT;
13324        assert!(value & (Self::RS_MASK as u8) == value);
13325        *self = Self::from_bits_retain(
13326            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
13327        );
13328    }
13329
13330    /// Returns a copy with the `RS` field set to the given value.
13331    pub const fn with_rs(mut self, value: u8) -> Self {
13332        self.set_rs(value);
13333        self
13334    }
13335
13336    /// Returns the value of the `Aff3` field.
13337    pub const fn aff3(self) -> u8 {
13338        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
13339    }
13340
13341    /// Sets the value of the `Aff3` field.
13342    pub const fn set_aff3(&mut self, value: u8) {
13343        let offset = Self::AFF3_SHIFT;
13344        assert!(value & (Self::AFF3_MASK as u8) == value);
13345        *self = Self::from_bits_retain(
13346            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
13347        );
13348    }
13349
13350    /// Returns a copy with the `Aff3` field set to the given value.
13351    pub const fn with_aff3(mut self, value: u8) -> Self {
13352        self.set_aff3(value);
13353        self
13354    }
13355}
13356
13357#[cfg(feature = "el1")]
13358bitflags! {
13359    /// `ICC_SGI0R_EL1` system register value.
13360    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13361    #[repr(transparent)]
13362    pub struct IccSgi0rEl1: u64 {
13363        /// `IRM` bit.
13364        const IRM = 1 << 40;
13365    }
13366}
13367
13368#[cfg(feature = "el1")]
13369impl IccSgi0rEl1 {
13370    /// Offset of the `TargetList` field.
13371    pub const TARGETLIST_SHIFT: u32 = 0;
13372    /// Mask for the `TargetList` field.
13373    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
13374    /// Offset of the `Aff1` field.
13375    pub const AFF1_SHIFT: u32 = 16;
13376    /// Mask for the `Aff1` field.
13377    pub const AFF1_MASK: u64 = 0b11111111;
13378    /// Offset of the `INTID` field.
13379    pub const INTID_SHIFT: u32 = 24;
13380    /// Mask for the `INTID` field.
13381    pub const INTID_MASK: u64 = 0b1111;
13382    /// Offset of the `Aff2` field.
13383    pub const AFF2_SHIFT: u32 = 32;
13384    /// Mask for the `Aff2` field.
13385    pub const AFF2_MASK: u64 = 0b11111111;
13386    /// Offset of the `IRM` field.
13387    pub const IRM_SHIFT: u32 = 40;
13388    /// Offset of the `RS` field.
13389    pub const RS_SHIFT: u32 = 44;
13390    /// Mask for the `RS` field.
13391    pub const RS_MASK: u64 = 0b1111;
13392    /// Offset of the `Aff3` field.
13393    pub const AFF3_SHIFT: u32 = 48;
13394    /// Mask for the `Aff3` field.
13395    pub const AFF3_MASK: u64 = 0b11111111;
13396
13397    /// Returns the value of the `TargetList` field.
13398    pub const fn targetlist(self) -> u16 {
13399        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
13400    }
13401
13402    /// Sets the value of the `TargetList` field.
13403    pub const fn set_targetlist(&mut self, value: u16) {
13404        let offset = Self::TARGETLIST_SHIFT;
13405        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
13406        *self = Self::from_bits_retain(
13407            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
13408        );
13409    }
13410
13411    /// Returns a copy with the `TargetList` field set to the given value.
13412    pub const fn with_targetlist(mut self, value: u16) -> Self {
13413        self.set_targetlist(value);
13414        self
13415    }
13416
13417    /// Returns the value of the `Aff1` field.
13418    pub const fn aff1(self) -> u8 {
13419        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
13420    }
13421
13422    /// Sets the value of the `Aff1` field.
13423    pub const fn set_aff1(&mut self, value: u8) {
13424        let offset = Self::AFF1_SHIFT;
13425        assert!(value & (Self::AFF1_MASK as u8) == value);
13426        *self = Self::from_bits_retain(
13427            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
13428        );
13429    }
13430
13431    /// Returns a copy with the `Aff1` field set to the given value.
13432    pub const fn with_aff1(mut self, value: u8) -> Self {
13433        self.set_aff1(value);
13434        self
13435    }
13436
13437    /// Returns the value of the `INTID` field.
13438    pub const fn intid(self) -> u8 {
13439        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
13440    }
13441
13442    /// Sets the value of the `INTID` field.
13443    pub const fn set_intid(&mut self, value: u8) {
13444        let offset = Self::INTID_SHIFT;
13445        assert!(value & (Self::INTID_MASK as u8) == value);
13446        *self = Self::from_bits_retain(
13447            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
13448        );
13449    }
13450
13451    /// Returns a copy with the `INTID` field set to the given value.
13452    pub const fn with_intid(mut self, value: u8) -> Self {
13453        self.set_intid(value);
13454        self
13455    }
13456
13457    /// Returns the value of the `Aff2` field.
13458    pub const fn aff2(self) -> u8 {
13459        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
13460    }
13461
13462    /// Sets the value of the `Aff2` field.
13463    pub const fn set_aff2(&mut self, value: u8) {
13464        let offset = Self::AFF2_SHIFT;
13465        assert!(value & (Self::AFF2_MASK as u8) == value);
13466        *self = Self::from_bits_retain(
13467            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
13468        );
13469    }
13470
13471    /// Returns a copy with the `Aff2` field set to the given value.
13472    pub const fn with_aff2(mut self, value: u8) -> Self {
13473        self.set_aff2(value);
13474        self
13475    }
13476
13477    /// Returns the value of the `RS` field.
13478    pub const fn rs(self) -> u8 {
13479        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
13480    }
13481
13482    /// Sets the value of the `RS` field.
13483    pub const fn set_rs(&mut self, value: u8) {
13484        let offset = Self::RS_SHIFT;
13485        assert!(value & (Self::RS_MASK as u8) == value);
13486        *self = Self::from_bits_retain(
13487            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
13488        );
13489    }
13490
13491    /// Returns a copy with the `RS` field set to the given value.
13492    pub const fn with_rs(mut self, value: u8) -> Self {
13493        self.set_rs(value);
13494        self
13495    }
13496
13497    /// Returns the value of the `Aff3` field.
13498    pub const fn aff3(self) -> u8 {
13499        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
13500    }
13501
13502    /// Sets the value of the `Aff3` field.
13503    pub const fn set_aff3(&mut self, value: u8) {
13504        let offset = Self::AFF3_SHIFT;
13505        assert!(value & (Self::AFF3_MASK as u8) == value);
13506        *self = Self::from_bits_retain(
13507            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
13508        );
13509    }
13510
13511    /// Returns a copy with the `Aff3` field set to the given value.
13512    pub const fn with_aff3(mut self, value: u8) -> Self {
13513        self.set_aff3(value);
13514        self
13515    }
13516}
13517
13518bitflags! {
13519    /// `ICC_SGI1R` system register value.
13520    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13521    #[repr(transparent)]
13522    pub struct IccSgi1r: u64 {
13523        /// `IRM` bit.
13524        const IRM = 1 << 40;
13525    }
13526}
13527
13528impl IccSgi1r {
13529    /// Offset of the `TargetList` field.
13530    pub const TARGETLIST_SHIFT: u32 = 0;
13531    /// Mask for the `TargetList` field.
13532    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
13533    /// Offset of the `Aff1` field.
13534    pub const AFF1_SHIFT: u32 = 16;
13535    /// Mask for the `Aff1` field.
13536    pub const AFF1_MASK: u64 = 0b11111111;
13537    /// Offset of the `INTID` field.
13538    pub const INTID_SHIFT: u32 = 24;
13539    /// Mask for the `INTID` field.
13540    pub const INTID_MASK: u64 = 0b1111;
13541    /// Offset of the `Aff2` field.
13542    pub const AFF2_SHIFT: u32 = 32;
13543    /// Mask for the `Aff2` field.
13544    pub const AFF2_MASK: u64 = 0b11111111;
13545    /// Offset of the `IRM` field.
13546    pub const IRM_SHIFT: u32 = 40;
13547    /// Offset of the `RS` field.
13548    pub const RS_SHIFT: u32 = 44;
13549    /// Mask for the `RS` field.
13550    pub const RS_MASK: u64 = 0b1111;
13551    /// Offset of the `Aff3` field.
13552    pub const AFF3_SHIFT: u32 = 48;
13553    /// Mask for the `Aff3` field.
13554    pub const AFF3_MASK: u64 = 0b11111111;
13555
13556    /// Returns the value of the `TargetList` field.
13557    pub const fn targetlist(self) -> u16 {
13558        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
13559    }
13560
13561    /// Sets the value of the `TargetList` field.
13562    pub const fn set_targetlist(&mut self, value: u16) {
13563        let offset = Self::TARGETLIST_SHIFT;
13564        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
13565        *self = Self::from_bits_retain(
13566            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
13567        );
13568    }
13569
13570    /// Returns a copy with the `TargetList` field set to the given value.
13571    pub const fn with_targetlist(mut self, value: u16) -> Self {
13572        self.set_targetlist(value);
13573        self
13574    }
13575
13576    /// Returns the value of the `Aff1` field.
13577    pub const fn aff1(self) -> u8 {
13578        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
13579    }
13580
13581    /// Sets the value of the `Aff1` field.
13582    pub const fn set_aff1(&mut self, value: u8) {
13583        let offset = Self::AFF1_SHIFT;
13584        assert!(value & (Self::AFF1_MASK as u8) == value);
13585        *self = Self::from_bits_retain(
13586            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
13587        );
13588    }
13589
13590    /// Returns a copy with the `Aff1` field set to the given value.
13591    pub const fn with_aff1(mut self, value: u8) -> Self {
13592        self.set_aff1(value);
13593        self
13594    }
13595
13596    /// Returns the value of the `INTID` field.
13597    pub const fn intid(self) -> u8 {
13598        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
13599    }
13600
13601    /// Sets the value of the `INTID` field.
13602    pub const fn set_intid(&mut self, value: u8) {
13603        let offset = Self::INTID_SHIFT;
13604        assert!(value & (Self::INTID_MASK as u8) == value);
13605        *self = Self::from_bits_retain(
13606            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
13607        );
13608    }
13609
13610    /// Returns a copy with the `INTID` field set to the given value.
13611    pub const fn with_intid(mut self, value: u8) -> Self {
13612        self.set_intid(value);
13613        self
13614    }
13615
13616    /// Returns the value of the `Aff2` field.
13617    pub const fn aff2(self) -> u8 {
13618        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
13619    }
13620
13621    /// Sets the value of the `Aff2` field.
13622    pub const fn set_aff2(&mut self, value: u8) {
13623        let offset = Self::AFF2_SHIFT;
13624        assert!(value & (Self::AFF2_MASK as u8) == value);
13625        *self = Self::from_bits_retain(
13626            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
13627        );
13628    }
13629
13630    /// Returns a copy with the `Aff2` field set to the given value.
13631    pub const fn with_aff2(mut self, value: u8) -> Self {
13632        self.set_aff2(value);
13633        self
13634    }
13635
13636    /// Returns the value of the `RS` field.
13637    pub const fn rs(self) -> u8 {
13638        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
13639    }
13640
13641    /// Sets the value of the `RS` field.
13642    pub const fn set_rs(&mut self, value: u8) {
13643        let offset = Self::RS_SHIFT;
13644        assert!(value & (Self::RS_MASK as u8) == value);
13645        *self = Self::from_bits_retain(
13646            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
13647        );
13648    }
13649
13650    /// Returns a copy with the `RS` field set to the given value.
13651    pub const fn with_rs(mut self, value: u8) -> Self {
13652        self.set_rs(value);
13653        self
13654    }
13655
13656    /// Returns the value of the `Aff3` field.
13657    pub const fn aff3(self) -> u8 {
13658        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
13659    }
13660
13661    /// Sets the value of the `Aff3` field.
13662    pub const fn set_aff3(&mut self, value: u8) {
13663        let offset = Self::AFF3_SHIFT;
13664        assert!(value & (Self::AFF3_MASK as u8) == value);
13665        *self = Self::from_bits_retain(
13666            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
13667        );
13668    }
13669
13670    /// Returns a copy with the `Aff3` field set to the given value.
13671    pub const fn with_aff3(mut self, value: u8) -> Self {
13672        self.set_aff3(value);
13673        self
13674    }
13675}
13676
13677#[cfg(feature = "el1")]
13678bitflags! {
13679    /// `ICC_SGI1R_EL1` system register value.
13680    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13681    #[repr(transparent)]
13682    pub struct IccSgi1rEl1: u64 {
13683        /// `IRM` bit.
13684        const IRM = 1 << 40;
13685    }
13686}
13687
13688#[cfg(feature = "el1")]
13689impl IccSgi1rEl1 {
13690    /// Offset of the `TargetList` field.
13691    pub const TARGETLIST_SHIFT: u32 = 0;
13692    /// Mask for the `TargetList` field.
13693    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
13694    /// Offset of the `Aff1` field.
13695    pub const AFF1_SHIFT: u32 = 16;
13696    /// Mask for the `Aff1` field.
13697    pub const AFF1_MASK: u64 = 0b11111111;
13698    /// Offset of the `INTID` field.
13699    pub const INTID_SHIFT: u32 = 24;
13700    /// Mask for the `INTID` field.
13701    pub const INTID_MASK: u64 = 0b1111;
13702    /// Offset of the `Aff2` field.
13703    pub const AFF2_SHIFT: u32 = 32;
13704    /// Mask for the `Aff2` field.
13705    pub const AFF2_MASK: u64 = 0b11111111;
13706    /// Offset of the `IRM` field.
13707    pub const IRM_SHIFT: u32 = 40;
13708    /// Offset of the `RS` field.
13709    pub const RS_SHIFT: u32 = 44;
13710    /// Mask for the `RS` field.
13711    pub const RS_MASK: u64 = 0b1111;
13712    /// Offset of the `Aff3` field.
13713    pub const AFF3_SHIFT: u32 = 48;
13714    /// Mask for the `Aff3` field.
13715    pub const AFF3_MASK: u64 = 0b11111111;
13716
13717    /// Returns the value of the `TargetList` field.
13718    pub const fn targetlist(self) -> u16 {
13719        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
13720    }
13721
13722    /// Sets the value of the `TargetList` field.
13723    pub const fn set_targetlist(&mut self, value: u16) {
13724        let offset = Self::TARGETLIST_SHIFT;
13725        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
13726        *self = Self::from_bits_retain(
13727            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
13728        );
13729    }
13730
13731    /// Returns a copy with the `TargetList` field set to the given value.
13732    pub const fn with_targetlist(mut self, value: u16) -> Self {
13733        self.set_targetlist(value);
13734        self
13735    }
13736
13737    /// Returns the value of the `Aff1` field.
13738    pub const fn aff1(self) -> u8 {
13739        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
13740    }
13741
13742    /// Sets the value of the `Aff1` field.
13743    pub const fn set_aff1(&mut self, value: u8) {
13744        let offset = Self::AFF1_SHIFT;
13745        assert!(value & (Self::AFF1_MASK as u8) == value);
13746        *self = Self::from_bits_retain(
13747            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
13748        );
13749    }
13750
13751    /// Returns a copy with the `Aff1` field set to the given value.
13752    pub const fn with_aff1(mut self, value: u8) -> Self {
13753        self.set_aff1(value);
13754        self
13755    }
13756
13757    /// Returns the value of the `INTID` field.
13758    pub const fn intid(self) -> u8 {
13759        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
13760    }
13761
13762    /// Sets the value of the `INTID` field.
13763    pub const fn set_intid(&mut self, value: u8) {
13764        let offset = Self::INTID_SHIFT;
13765        assert!(value & (Self::INTID_MASK as u8) == value);
13766        *self = Self::from_bits_retain(
13767            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
13768        );
13769    }
13770
13771    /// Returns a copy with the `INTID` field set to the given value.
13772    pub const fn with_intid(mut self, value: u8) -> Self {
13773        self.set_intid(value);
13774        self
13775    }
13776
13777    /// Returns the value of the `Aff2` field.
13778    pub const fn aff2(self) -> u8 {
13779        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
13780    }
13781
13782    /// Sets the value of the `Aff2` field.
13783    pub const fn set_aff2(&mut self, value: u8) {
13784        let offset = Self::AFF2_SHIFT;
13785        assert!(value & (Self::AFF2_MASK as u8) == value);
13786        *self = Self::from_bits_retain(
13787            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
13788        );
13789    }
13790
13791    /// Returns a copy with the `Aff2` field set to the given value.
13792    pub const fn with_aff2(mut self, value: u8) -> Self {
13793        self.set_aff2(value);
13794        self
13795    }
13796
13797    /// Returns the value of the `RS` field.
13798    pub const fn rs(self) -> u8 {
13799        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
13800    }
13801
13802    /// Sets the value of the `RS` field.
13803    pub const fn set_rs(&mut self, value: u8) {
13804        let offset = Self::RS_SHIFT;
13805        assert!(value & (Self::RS_MASK as u8) == value);
13806        *self = Self::from_bits_retain(
13807            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
13808        );
13809    }
13810
13811    /// Returns a copy with the `RS` field set to the given value.
13812    pub const fn with_rs(mut self, value: u8) -> Self {
13813        self.set_rs(value);
13814        self
13815    }
13816
13817    /// Returns the value of the `Aff3` field.
13818    pub const fn aff3(self) -> u8 {
13819        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
13820    }
13821
13822    /// Sets the value of the `Aff3` field.
13823    pub const fn set_aff3(&mut self, value: u8) {
13824        let offset = Self::AFF3_SHIFT;
13825        assert!(value & (Self::AFF3_MASK as u8) == value);
13826        *self = Self::from_bits_retain(
13827            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
13828        );
13829    }
13830
13831    /// Returns a copy with the `Aff3` field set to the given value.
13832    pub const fn with_aff3(mut self, value: u8) -> Self {
13833        self.set_aff3(value);
13834        self
13835    }
13836}
13837
13838bitflags! {
13839    /// `ICC_SRE` system register value.
13840    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13841    #[repr(transparent)]
13842    pub struct IccSre: u32 {
13843        /// `SRE` bit.
13844        const SRE = 1 << 0;
13845        /// `DFB` bit.
13846        const DFB = 1 << 1;
13847        /// `DIB` bit.
13848        const DIB = 1 << 2;
13849    }
13850}
13851
13852impl IccSre {
13853    /// Offset of the `SRE` field.
13854    pub const SRE_SHIFT: u32 = 0;
13855    /// Offset of the `DFB` field.
13856    pub const DFB_SHIFT: u32 = 1;
13857    /// Offset of the `DIB` field.
13858    pub const DIB_SHIFT: u32 = 2;
13859}
13860
13861#[cfg(feature = "el1")]
13862bitflags! {
13863    /// `ICC_SRE_EL1` system register value.
13864    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13865    #[repr(transparent)]
13866    pub struct IccSreEl1: u64 {
13867        /// Enable the system register interface.
13868        const SRE = 1 << 0;
13869        /// Disable FIQ bypass.
13870        const DFB = 1 << 1;
13871        /// Disable IRQ bypass.
13872        const DIB = 1 << 2;
13873    }
13874}
13875
13876#[cfg(feature = "el1")]
13877impl IccSreEl1 {
13878    /// Offset of the `SRE` field.
13879    pub const SRE_SHIFT: u32 = 0;
13880    /// Offset of the `DFB` field.
13881    pub const DFB_SHIFT: u32 = 1;
13882    /// Offset of the `DIB` field.
13883    pub const DIB_SHIFT: u32 = 2;
13884}
13885
13886#[cfg(feature = "el2")]
13887bitflags! {
13888    /// `ICC_SRE_EL2` system register value.
13889    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13890    #[repr(transparent)]
13891    pub struct IccSreEl2: u64 {
13892        /// Enable the system register interface.
13893        const SRE = 1 << 0;
13894        /// Disable FIQ bypass.
13895        const DFB = 1 << 1;
13896        /// Disable IRQ bypass.
13897        const DIB = 1 << 2;
13898        /// Enable lower exception level access.
13899        const ENABLE = 1 << 3;
13900    }
13901}
13902
13903#[cfg(feature = "el2")]
13904impl IccSreEl2 {
13905    /// Offset of the `SRE` field.
13906    pub const SRE_SHIFT: u32 = 0;
13907    /// Offset of the `DFB` field.
13908    pub const DFB_SHIFT: u32 = 1;
13909    /// Offset of the `DIB` field.
13910    pub const DIB_SHIFT: u32 = 2;
13911    /// Offset of the `Enable` field.
13912    pub const ENABLE_SHIFT: u32 = 3;
13913}
13914
13915#[cfg(feature = "el3")]
13916bitflags! {
13917    /// `ICC_SRE_EL3` system register value.
13918    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13919    #[repr(transparent)]
13920    pub struct IccSreEl3: u64 {
13921        /// Enable the system register interface.
13922        const SRE = 1 << 0;
13923        /// Disable FIQ bypass.
13924        const DFB = 1 << 1;
13925        /// Disable IRQ bypass.
13926        const DIB = 1 << 2;
13927        /// Enable lower exception level access.
13928        const ENABLE = 1 << 3;
13929    }
13930}
13931
13932#[cfg(feature = "el3")]
13933impl IccSreEl3 {
13934    /// Offset of the `SRE` field.
13935    pub const SRE_SHIFT: u32 = 0;
13936    /// Offset of the `DFB` field.
13937    pub const DFB_SHIFT: u32 = 1;
13938    /// Offset of the `DIB` field.
13939    pub const DIB_SHIFT: u32 = 2;
13940    /// Offset of the `Enable` field.
13941    pub const ENABLE_SHIFT: u32 = 3;
13942}
13943
13944#[cfg(feature = "el2")]
13945bitflags! {
13946    /// `ICH_HCR_EL2` system register value.
13947    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13948    #[repr(transparent)]
13949    pub struct IchHcrEl2: u64 {
13950        /// `En` bit.
13951        const EN = 1 << 0;
13952        /// `UIE` bit.
13953        const UIE = 1 << 1;
13954        /// `LRENPIE` bit.
13955        const LRENPIE = 1 << 2;
13956        /// `NPIE` bit.
13957        const NPIE = 1 << 3;
13958        /// `VGrp0EIE` bit.
13959        const VGRP0EIE = 1 << 4;
13960        /// `VGrp0DIE` bit.
13961        const VGRP0DIE = 1 << 5;
13962        /// `VGrp1EIE` bit.
13963        const VGRP1EIE = 1 << 6;
13964        /// `VGrp1DIE` bit.
13965        const VGRP1DIE = 1 << 7;
13966        /// `vSGIEOICount` bit.
13967        const VSGIEOICOUNT = 1 << 8;
13968        /// `TC` bit.
13969        const TC = 1 << 10;
13970        /// `TALL0` bit.
13971        const TALL0 = 1 << 11;
13972        /// `TALL1` bit.
13973        const TALL1 = 1 << 12;
13974        /// `TSEI` bit.
13975        const TSEI = 1 << 13;
13976        /// `TDIR` bit.
13977        const TDIR = 1 << 14;
13978        /// `DVIM` bit.
13979        const DVIM = 1 << 15;
13980    }
13981}
13982
13983#[cfg(feature = "el2")]
13984impl IchHcrEl2 {
13985    /// Offset of the `En` field.
13986    pub const EN_SHIFT: u32 = 0;
13987    /// Offset of the `UIE` field.
13988    pub const UIE_SHIFT: u32 = 1;
13989    /// Offset of the `LRENPIE` field.
13990    pub const LRENPIE_SHIFT: u32 = 2;
13991    /// Offset of the `NPIE` field.
13992    pub const NPIE_SHIFT: u32 = 3;
13993    /// Offset of the `VGrp0EIE` field.
13994    pub const VGRP0EIE_SHIFT: u32 = 4;
13995    /// Offset of the `VGrp0DIE` field.
13996    pub const VGRP0DIE_SHIFT: u32 = 5;
13997    /// Offset of the `VGrp1EIE` field.
13998    pub const VGRP1EIE_SHIFT: u32 = 6;
13999    /// Offset of the `VGrp1DIE` field.
14000    pub const VGRP1DIE_SHIFT: u32 = 7;
14001    /// Offset of the `vSGIEOICount` field.
14002    pub const VSGIEOICOUNT_SHIFT: u32 = 8;
14003    /// Offset of the `TC` field.
14004    pub const TC_SHIFT: u32 = 10;
14005    /// Offset of the `TALL0` field.
14006    pub const TALL0_SHIFT: u32 = 11;
14007    /// Offset of the `TALL1` field.
14008    pub const TALL1_SHIFT: u32 = 12;
14009    /// Offset of the `TSEI` field.
14010    pub const TSEI_SHIFT: u32 = 13;
14011    /// Offset of the `TDIR` field.
14012    pub const TDIR_SHIFT: u32 = 14;
14013    /// Offset of the `DVIM` field.
14014    pub const DVIM_SHIFT: u32 = 15;
14015    /// Offset of the `EOIcount` field.
14016    pub const EOICOUNT_SHIFT: u32 = 27;
14017    /// Mask for the `EOIcount` field.
14018    pub const EOICOUNT_MASK: u64 = 0b11111;
14019
14020    /// Returns the value of the `EOIcount` field.
14021    pub const fn eoicount(self) -> u8 {
14022        ((self.bits() >> Self::EOICOUNT_SHIFT) & 0b11111) as u8
14023    }
14024
14025    /// Sets the value of the `EOIcount` field.
14026    pub const fn set_eoicount(&mut self, value: u8) {
14027        let offset = Self::EOICOUNT_SHIFT;
14028        assert!(value & (Self::EOICOUNT_MASK as u8) == value);
14029        *self = Self::from_bits_retain(
14030            (self.bits() & !(Self::EOICOUNT_MASK << offset)) | ((value as u64) << offset),
14031        );
14032    }
14033
14034    /// Returns a copy with the `EOIcount` field set to the given value.
14035    pub const fn with_eoicount(mut self, value: u8) -> Self {
14036        self.set_eoicount(value);
14037        self
14038    }
14039}
14040
14041#[cfg(feature = "el2")]
14042bitflags! {
14043    /// `ICH_VMCR_EL2` system register value.
14044    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14045    #[repr(transparent)]
14046    pub struct IchVmcrEl2: u64 {
14047        /// `EN` bit.
14048        const EN = 1 << 0;
14049        /// `VENG0` bit.
14050        const VENG0 = 1 << 0;
14051        /// `VENG1` bit.
14052        const VENG1 = 1 << 1;
14053        /// `VAckCtl` bit.
14054        const VACKCTL = 1 << 2;
14055        /// `VFIQEn` bit.
14056        const VFIQEN = 1 << 3;
14057        /// `VCBPR` bit.
14058        const VCBPR = 1 << 4;
14059        /// `VEOIM` bit.
14060        const VEOIM = 1 << 9;
14061    }
14062}
14063
14064#[cfg(feature = "el2")]
14065impl IchVmcrEl2 {
14066    /// Offset of the `EN` field.
14067    pub const EN_SHIFT: u32 = 0;
14068    /// Offset of the `VENG0` field.
14069    pub const VENG0_SHIFT: u32 = 0;
14070    /// Offset of the `VENG1` field.
14071    pub const VENG1_SHIFT: u32 = 1;
14072    /// Offset of the `VAckCtl` field.
14073    pub const VACKCTL_SHIFT: u32 = 2;
14074    /// Offset of the `VFIQEn` field.
14075    pub const VFIQEN_SHIFT: u32 = 3;
14076    /// Offset of the `VCBPR` field.
14077    pub const VCBPR_SHIFT: u32 = 4;
14078    /// Offset of the `VEOIM` field.
14079    pub const VEOIM_SHIFT: u32 = 9;
14080    /// Offset of the `VBPR1` field.
14081    pub const VBPR1_SHIFT: u32 = 18;
14082    /// Mask for the `VBPR1` field.
14083    pub const VBPR1_MASK: u64 = 0b111;
14084    /// Offset of the `VBPR0` field.
14085    pub const VBPR0_SHIFT: u32 = 21;
14086    /// Mask for the `VBPR0` field.
14087    pub const VBPR0_MASK: u64 = 0b111;
14088
14089    /// Returns the value of the `VBPR1` field.
14090    pub const fn vbpr1(self) -> u8 {
14091        ((self.bits() >> Self::VBPR1_SHIFT) & 0b111) as u8
14092    }
14093
14094    /// Sets the value of the `VBPR1` field.
14095    pub const fn set_vbpr1(&mut self, value: u8) {
14096        let offset = Self::VBPR1_SHIFT;
14097        assert!(value & (Self::VBPR1_MASK as u8) == value);
14098        *self = Self::from_bits_retain(
14099            (self.bits() & !(Self::VBPR1_MASK << offset)) | ((value as u64) << offset),
14100        );
14101    }
14102
14103    /// Returns a copy with the `VBPR1` field set to the given value.
14104    pub const fn with_vbpr1(mut self, value: u8) -> Self {
14105        self.set_vbpr1(value);
14106        self
14107    }
14108
14109    /// Returns the value of the `VBPR0` field.
14110    pub const fn vbpr0(self) -> u8 {
14111        ((self.bits() >> Self::VBPR0_SHIFT) & 0b111) as u8
14112    }
14113
14114    /// Sets the value of the `VBPR0` field.
14115    pub const fn set_vbpr0(&mut self, value: u8) {
14116        let offset = Self::VBPR0_SHIFT;
14117        assert!(value & (Self::VBPR0_MASK as u8) == value);
14118        *self = Self::from_bits_retain(
14119            (self.bits() & !(Self::VBPR0_MASK << offset)) | ((value as u64) << offset),
14120        );
14121    }
14122
14123    /// Returns a copy with the `VBPR0` field set to the given value.
14124    pub const fn with_vbpr0(mut self, value: u8) -> Self {
14125        self.set_vbpr0(value);
14126        self
14127    }
14128}
14129
14130#[cfg(feature = "el1")]
14131bitflags! {
14132    /// `ID_AA64DFR0_EL1` system register value.
14133    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14134    #[repr(transparent)]
14135    pub struct IdAa64dfr0El1: u64 {
14136    }
14137}
14138
14139#[cfg(feature = "el1")]
14140impl IdAa64dfr0El1 {
14141    /// Offset of the `DebugVer` field.
14142    pub const DEBUGVER_SHIFT: u32 = 0;
14143    /// Mask for the `DebugVer` field.
14144    pub const DEBUGVER_MASK: u64 = 0b1111;
14145    /// Offset of the `TraceVer` field.
14146    pub const TRACEVER_SHIFT: u32 = 4;
14147    /// Mask for the `TraceVer` field.
14148    pub const TRACEVER_MASK: u64 = 0b1111;
14149    /// Offset of the `PMUVer` field.
14150    pub const PMUVER_SHIFT: u32 = 8;
14151    /// Mask for the `PMUVer` field.
14152    pub const PMUVER_MASK: u64 = 0b1111;
14153    /// Offset of the `BRPs` field.
14154    pub const BRPS_SHIFT: u32 = 12;
14155    /// Mask for the `BRPs` field.
14156    pub const BRPS_MASK: u64 = 0b1111;
14157    /// Offset of the `PMSS` field.
14158    pub const PMSS_SHIFT: u32 = 16;
14159    /// Mask for the `PMSS` field.
14160    pub const PMSS_MASK: u64 = 0b1111;
14161    /// Offset of the `WRPs` field.
14162    pub const WRPS_SHIFT: u32 = 20;
14163    /// Mask for the `WRPs` field.
14164    pub const WRPS_MASK: u64 = 0b1111;
14165    /// Offset of the `SEBEP` field.
14166    pub const SEBEP_SHIFT: u32 = 24;
14167    /// Mask for the `SEBEP` field.
14168    pub const SEBEP_MASK: u64 = 0b1111;
14169    /// Offset of the `CTX_CMPs` field.
14170    pub const CTX_CMPS_SHIFT: u32 = 28;
14171    /// Mask for the `CTX_CMPs` field.
14172    pub const CTX_CMPS_MASK: u64 = 0b1111;
14173    /// Offset of the `PMSVer` field.
14174    pub const PMSVER_SHIFT: u32 = 32;
14175    /// Mask for the `PMSVer` field.
14176    pub const PMSVER_MASK: u64 = 0b1111;
14177    /// Offset of the `DoubleLock` field.
14178    pub const DOUBLELOCK_SHIFT: u32 = 36;
14179    /// Mask for the `DoubleLock` field.
14180    pub const DOUBLELOCK_MASK: u64 = 0b1111;
14181    /// Offset of the `TraceFilt` field.
14182    pub const TRACEFILT_SHIFT: u32 = 40;
14183    /// Mask for the `TraceFilt` field.
14184    pub const TRACEFILT_MASK: u64 = 0b1111;
14185    /// Offset of the `TraceBuffer` field.
14186    pub const TRACEBUFFER_SHIFT: u32 = 44;
14187    /// Mask for the `TraceBuffer` field.
14188    pub const TRACEBUFFER_MASK: u64 = 0b1111;
14189    /// Offset of the `MTPMU` field.
14190    pub const MTPMU_SHIFT: u32 = 48;
14191    /// Mask for the `MTPMU` field.
14192    pub const MTPMU_MASK: u64 = 0b1111;
14193    /// Offset of the `BRBE` field.
14194    pub const BRBE_SHIFT: u32 = 52;
14195    /// Mask for the `BRBE` field.
14196    pub const BRBE_MASK: u64 = 0b1111;
14197    /// Offset of the `ExtTrcBuff` field.
14198    pub const EXTTRCBUFF_SHIFT: u32 = 56;
14199    /// Mask for the `ExtTrcBuff` field.
14200    pub const EXTTRCBUFF_MASK: u64 = 0b1111;
14201    /// Offset of the `HPMN0` field.
14202    pub const HPMN0_SHIFT: u32 = 60;
14203    /// Mask for the `HPMN0` field.
14204    pub const HPMN0_MASK: u64 = 0b1111;
14205
14206    /// Returns the value of the `DebugVer` field.
14207    pub const fn debugver(self) -> u8 {
14208        ((self.bits() >> Self::DEBUGVER_SHIFT) & 0b1111) as u8
14209    }
14210
14211    /// Sets the value of the `DebugVer` field.
14212    pub const fn set_debugver(&mut self, value: u8) {
14213        let offset = Self::DEBUGVER_SHIFT;
14214        assert!(value & (Self::DEBUGVER_MASK as u8) == value);
14215        *self = Self::from_bits_retain(
14216            (self.bits() & !(Self::DEBUGVER_MASK << offset)) | ((value as u64) << offset),
14217        );
14218    }
14219
14220    /// Returns a copy with the `DebugVer` field set to the given value.
14221    pub const fn with_debugver(mut self, value: u8) -> Self {
14222        self.set_debugver(value);
14223        self
14224    }
14225
14226    /// Returns the value of the `TraceVer` field.
14227    pub const fn tracever(self) -> u8 {
14228        ((self.bits() >> Self::TRACEVER_SHIFT) & 0b1111) as u8
14229    }
14230
14231    /// Sets the value of the `TraceVer` field.
14232    pub const fn set_tracever(&mut self, value: u8) {
14233        let offset = Self::TRACEVER_SHIFT;
14234        assert!(value & (Self::TRACEVER_MASK as u8) == value);
14235        *self = Self::from_bits_retain(
14236            (self.bits() & !(Self::TRACEVER_MASK << offset)) | ((value as u64) << offset),
14237        );
14238    }
14239
14240    /// Returns a copy with the `TraceVer` field set to the given value.
14241    pub const fn with_tracever(mut self, value: u8) -> Self {
14242        self.set_tracever(value);
14243        self
14244    }
14245
14246    /// Returns the value of the `PMUVer` field.
14247    pub const fn pmuver(self) -> u8 {
14248        ((self.bits() >> Self::PMUVER_SHIFT) & 0b1111) as u8
14249    }
14250
14251    /// Sets the value of the `PMUVer` field.
14252    pub const fn set_pmuver(&mut self, value: u8) {
14253        let offset = Self::PMUVER_SHIFT;
14254        assert!(value & (Self::PMUVER_MASK as u8) == value);
14255        *self = Self::from_bits_retain(
14256            (self.bits() & !(Self::PMUVER_MASK << offset)) | ((value as u64) << offset),
14257        );
14258    }
14259
14260    /// Returns a copy with the `PMUVer` field set to the given value.
14261    pub const fn with_pmuver(mut self, value: u8) -> Self {
14262        self.set_pmuver(value);
14263        self
14264    }
14265
14266    /// Returns the value of the `BRPs` field.
14267    pub const fn brps(self) -> u8 {
14268        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
14269    }
14270
14271    /// Sets the value of the `BRPs` field.
14272    pub const fn set_brps(&mut self, value: u8) {
14273        let offset = Self::BRPS_SHIFT;
14274        assert!(value & (Self::BRPS_MASK as u8) == value);
14275        *self = Self::from_bits_retain(
14276            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u64) << offset),
14277        );
14278    }
14279
14280    /// Returns a copy with the `BRPs` field set to the given value.
14281    pub const fn with_brps(mut self, value: u8) -> Self {
14282        self.set_brps(value);
14283        self
14284    }
14285
14286    /// Returns the value of the `PMSS` field.
14287    pub const fn pmss(self) -> u8 {
14288        ((self.bits() >> Self::PMSS_SHIFT) & 0b1111) as u8
14289    }
14290
14291    /// Sets the value of the `PMSS` field.
14292    pub const fn set_pmss(&mut self, value: u8) {
14293        let offset = Self::PMSS_SHIFT;
14294        assert!(value & (Self::PMSS_MASK as u8) == value);
14295        *self = Self::from_bits_retain(
14296            (self.bits() & !(Self::PMSS_MASK << offset)) | ((value as u64) << offset),
14297        );
14298    }
14299
14300    /// Returns a copy with the `PMSS` field set to the given value.
14301    pub const fn with_pmss(mut self, value: u8) -> Self {
14302        self.set_pmss(value);
14303        self
14304    }
14305
14306    /// Returns the value of the `WRPs` field.
14307    pub const fn wrps(self) -> u8 {
14308        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
14309    }
14310
14311    /// Sets the value of the `WRPs` field.
14312    pub const fn set_wrps(&mut self, value: u8) {
14313        let offset = Self::WRPS_SHIFT;
14314        assert!(value & (Self::WRPS_MASK as u8) == value);
14315        *self = Self::from_bits_retain(
14316            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u64) << offset),
14317        );
14318    }
14319
14320    /// Returns a copy with the `WRPs` field set to the given value.
14321    pub const fn with_wrps(mut self, value: u8) -> Self {
14322        self.set_wrps(value);
14323        self
14324    }
14325
14326    /// Returns the value of the `SEBEP` field.
14327    pub const fn sebep(self) -> u8 {
14328        ((self.bits() >> Self::SEBEP_SHIFT) & 0b1111) as u8
14329    }
14330
14331    /// Sets the value of the `SEBEP` field.
14332    pub const fn set_sebep(&mut self, value: u8) {
14333        let offset = Self::SEBEP_SHIFT;
14334        assert!(value & (Self::SEBEP_MASK as u8) == value);
14335        *self = Self::from_bits_retain(
14336            (self.bits() & !(Self::SEBEP_MASK << offset)) | ((value as u64) << offset),
14337        );
14338    }
14339
14340    /// Returns a copy with the `SEBEP` field set to the given value.
14341    pub const fn with_sebep(mut self, value: u8) -> Self {
14342        self.set_sebep(value);
14343        self
14344    }
14345
14346    /// Returns the value of the `CTX_CMPs` field.
14347    pub const fn ctx_cmps(self) -> u8 {
14348        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
14349    }
14350
14351    /// Sets the value of the `CTX_CMPs` field.
14352    pub const fn set_ctx_cmps(&mut self, value: u8) {
14353        let offset = Self::CTX_CMPS_SHIFT;
14354        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
14355        *self = Self::from_bits_retain(
14356            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u64) << offset),
14357        );
14358    }
14359
14360    /// Returns a copy with the `CTX_CMPs` field set to the given value.
14361    pub const fn with_ctx_cmps(mut self, value: u8) -> Self {
14362        self.set_ctx_cmps(value);
14363        self
14364    }
14365
14366    /// Returns the value of the `PMSVer` field.
14367    pub const fn pmsver(self) -> u8 {
14368        ((self.bits() >> Self::PMSVER_SHIFT) & 0b1111) as u8
14369    }
14370
14371    /// Sets the value of the `PMSVer` field.
14372    pub const fn set_pmsver(&mut self, value: u8) {
14373        let offset = Self::PMSVER_SHIFT;
14374        assert!(value & (Self::PMSVER_MASK as u8) == value);
14375        *self = Self::from_bits_retain(
14376            (self.bits() & !(Self::PMSVER_MASK << offset)) | ((value as u64) << offset),
14377        );
14378    }
14379
14380    /// Returns a copy with the `PMSVer` field set to the given value.
14381    pub const fn with_pmsver(mut self, value: u8) -> Self {
14382        self.set_pmsver(value);
14383        self
14384    }
14385
14386    /// Returns the value of the `DoubleLock` field.
14387    pub const fn doublelock(self) -> u8 {
14388        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
14389    }
14390
14391    /// Sets the value of the `DoubleLock` field.
14392    pub const fn set_doublelock(&mut self, value: u8) {
14393        let offset = Self::DOUBLELOCK_SHIFT;
14394        assert!(value & (Self::DOUBLELOCK_MASK as u8) == value);
14395        *self = Self::from_bits_retain(
14396            (self.bits() & !(Self::DOUBLELOCK_MASK << offset)) | ((value as u64) << offset),
14397        );
14398    }
14399
14400    /// Returns a copy with the `DoubleLock` field set to the given value.
14401    pub const fn with_doublelock(mut self, value: u8) -> Self {
14402        self.set_doublelock(value);
14403        self
14404    }
14405
14406    /// Returns the value of the `TraceFilt` field.
14407    pub const fn tracefilt(self) -> u8 {
14408        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
14409    }
14410
14411    /// Sets the value of the `TraceFilt` field.
14412    pub const fn set_tracefilt(&mut self, value: u8) {
14413        let offset = Self::TRACEFILT_SHIFT;
14414        assert!(value & (Self::TRACEFILT_MASK as u8) == value);
14415        *self = Self::from_bits_retain(
14416            (self.bits() & !(Self::TRACEFILT_MASK << offset)) | ((value as u64) << offset),
14417        );
14418    }
14419
14420    /// Returns a copy with the `TraceFilt` field set to the given value.
14421    pub const fn with_tracefilt(mut self, value: u8) -> Self {
14422        self.set_tracefilt(value);
14423        self
14424    }
14425
14426    /// Returns the value of the `TraceBuffer` field.
14427    pub const fn tracebuffer(self) -> u8 {
14428        ((self.bits() >> Self::TRACEBUFFER_SHIFT) & 0b1111) as u8
14429    }
14430
14431    /// Sets the value of the `TraceBuffer` field.
14432    pub const fn set_tracebuffer(&mut self, value: u8) {
14433        let offset = Self::TRACEBUFFER_SHIFT;
14434        assert!(value & (Self::TRACEBUFFER_MASK as u8) == value);
14435        *self = Self::from_bits_retain(
14436            (self.bits() & !(Self::TRACEBUFFER_MASK << offset)) | ((value as u64) << offset),
14437        );
14438    }
14439
14440    /// Returns a copy with the `TraceBuffer` field set to the given value.
14441    pub const fn with_tracebuffer(mut self, value: u8) -> Self {
14442        self.set_tracebuffer(value);
14443        self
14444    }
14445
14446    /// Returns the value of the `MTPMU` field.
14447    pub const fn mtpmu(self) -> u8 {
14448        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
14449    }
14450
14451    /// Sets the value of the `MTPMU` field.
14452    pub const fn set_mtpmu(&mut self, value: u8) {
14453        let offset = Self::MTPMU_SHIFT;
14454        assert!(value & (Self::MTPMU_MASK as u8) == value);
14455        *self = Self::from_bits_retain(
14456            (self.bits() & !(Self::MTPMU_MASK << offset)) | ((value as u64) << offset),
14457        );
14458    }
14459
14460    /// Returns a copy with the `MTPMU` field set to the given value.
14461    pub const fn with_mtpmu(mut self, value: u8) -> Self {
14462        self.set_mtpmu(value);
14463        self
14464    }
14465
14466    /// Returns the value of the `BRBE` field.
14467    pub const fn brbe(self) -> u8 {
14468        ((self.bits() >> Self::BRBE_SHIFT) & 0b1111) as u8
14469    }
14470
14471    /// Sets the value of the `BRBE` field.
14472    pub const fn set_brbe(&mut self, value: u8) {
14473        let offset = Self::BRBE_SHIFT;
14474        assert!(value & (Self::BRBE_MASK as u8) == value);
14475        *self = Self::from_bits_retain(
14476            (self.bits() & !(Self::BRBE_MASK << offset)) | ((value as u64) << offset),
14477        );
14478    }
14479
14480    /// Returns a copy with the `BRBE` field set to the given value.
14481    pub const fn with_brbe(mut self, value: u8) -> Self {
14482        self.set_brbe(value);
14483        self
14484    }
14485
14486    /// Returns the value of the `ExtTrcBuff` field.
14487    pub const fn exttrcbuff(self) -> u8 {
14488        ((self.bits() >> Self::EXTTRCBUFF_SHIFT) & 0b1111) as u8
14489    }
14490
14491    /// Sets the value of the `ExtTrcBuff` field.
14492    pub const fn set_exttrcbuff(&mut self, value: u8) {
14493        let offset = Self::EXTTRCBUFF_SHIFT;
14494        assert!(value & (Self::EXTTRCBUFF_MASK as u8) == value);
14495        *self = Self::from_bits_retain(
14496            (self.bits() & !(Self::EXTTRCBUFF_MASK << offset)) | ((value as u64) << offset),
14497        );
14498    }
14499
14500    /// Returns a copy with the `ExtTrcBuff` field set to the given value.
14501    pub const fn with_exttrcbuff(mut self, value: u8) -> Self {
14502        self.set_exttrcbuff(value);
14503        self
14504    }
14505
14506    /// Returns the value of the `HPMN0` field.
14507    pub const fn hpmn0(self) -> u8 {
14508        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
14509    }
14510
14511    /// Sets the value of the `HPMN0` field.
14512    pub const fn set_hpmn0(&mut self, value: u8) {
14513        let offset = Self::HPMN0_SHIFT;
14514        assert!(value & (Self::HPMN0_MASK as u8) == value);
14515        *self = Self::from_bits_retain(
14516            (self.bits() & !(Self::HPMN0_MASK << offset)) | ((value as u64) << offset),
14517        );
14518    }
14519
14520    /// Returns a copy with the `HPMN0` field set to the given value.
14521    pub const fn with_hpmn0(mut self, value: u8) -> Self {
14522        self.set_hpmn0(value);
14523        self
14524    }
14525}
14526
14527#[cfg(feature = "el1")]
14528bitflags! {
14529    /// `ID_AA64DFR1_EL1` system register value.
14530    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14531    #[repr(transparent)]
14532    pub struct IdAa64dfr1El1: u64 {
14533    }
14534}
14535
14536#[cfg(feature = "el1")]
14537impl IdAa64dfr1El1 {
14538    /// Offset of the `SYSPMUID` field.
14539    pub const SYSPMUID_SHIFT: u32 = 0;
14540    /// Mask for the `SYSPMUID` field.
14541    pub const SYSPMUID_MASK: u64 = 0b11111111;
14542    /// Offset of the `BRPs` field.
14543    pub const BRPS_SHIFT: u32 = 8;
14544    /// Mask for the `BRPs` field.
14545    pub const BRPS_MASK: u64 = 0b11111111;
14546    /// Offset of the `WRPs` field.
14547    pub const WRPS_SHIFT: u32 = 16;
14548    /// Mask for the `WRPs` field.
14549    pub const WRPS_MASK: u64 = 0b11111111;
14550    /// Offset of the `CTX_CMPs` field.
14551    pub const CTX_CMPS_SHIFT: u32 = 24;
14552    /// Mask for the `CTX_CMPs` field.
14553    pub const CTX_CMPS_MASK: u64 = 0b11111111;
14554    /// Offset of the `SPMU` field.
14555    pub const SPMU_SHIFT: u32 = 32;
14556    /// Mask for the `SPMU` field.
14557    pub const SPMU_MASK: u64 = 0b1111;
14558    /// Offset of the `PMICNTR` field.
14559    pub const PMICNTR_SHIFT: u32 = 36;
14560    /// Mask for the `PMICNTR` field.
14561    pub const PMICNTR_MASK: u64 = 0b1111;
14562    /// Offset of the `ABLE` field.
14563    pub const ABLE_SHIFT: u32 = 40;
14564    /// Mask for the `ABLE` field.
14565    pub const ABLE_MASK: u64 = 0b1111;
14566    /// Offset of the `ITE` field.
14567    pub const ITE_SHIFT: u32 = 44;
14568    /// Mask for the `ITE` field.
14569    pub const ITE_MASK: u64 = 0b1111;
14570    /// Offset of the `EBEP` field.
14571    pub const EBEP_SHIFT: u32 = 48;
14572    /// Mask for the `EBEP` field.
14573    pub const EBEP_MASK: u64 = 0b1111;
14574    /// Offset of the `DPFZS` field.
14575    pub const DPFZS_SHIFT: u32 = 52;
14576    /// Mask for the `DPFZS` field.
14577    pub const DPFZS_MASK: u64 = 0b1111;
14578    /// Offset of the `ABL_CMPs` field.
14579    pub const ABL_CMPS_SHIFT: u32 = 56;
14580    /// Mask for the `ABL_CMPs` field.
14581    pub const ABL_CMPS_MASK: u64 = 0b11111111;
14582
14583    /// Returns the value of the `SYSPMUID` field.
14584    pub const fn syspmuid(self) -> u8 {
14585        ((self.bits() >> Self::SYSPMUID_SHIFT) & 0b11111111) as u8
14586    }
14587
14588    /// Sets the value of the `SYSPMUID` field.
14589    pub const fn set_syspmuid(&mut self, value: u8) {
14590        let offset = Self::SYSPMUID_SHIFT;
14591        assert!(value & (Self::SYSPMUID_MASK as u8) == value);
14592        *self = Self::from_bits_retain(
14593            (self.bits() & !(Self::SYSPMUID_MASK << offset)) | ((value as u64) << offset),
14594        );
14595    }
14596
14597    /// Returns a copy with the `SYSPMUID` field set to the given value.
14598    pub const fn with_syspmuid(mut self, value: u8) -> Self {
14599        self.set_syspmuid(value);
14600        self
14601    }
14602
14603    /// Returns the value of the `BRPs` field.
14604    pub const fn brps(self) -> u8 {
14605        ((self.bits() >> Self::BRPS_SHIFT) & 0b11111111) as u8
14606    }
14607
14608    /// Sets the value of the `BRPs` field.
14609    pub const fn set_brps(&mut self, value: u8) {
14610        let offset = Self::BRPS_SHIFT;
14611        assert!(value & (Self::BRPS_MASK as u8) == value);
14612        *self = Self::from_bits_retain(
14613            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u64) << offset),
14614        );
14615    }
14616
14617    /// Returns a copy with the `BRPs` field set to the given value.
14618    pub const fn with_brps(mut self, value: u8) -> Self {
14619        self.set_brps(value);
14620        self
14621    }
14622
14623    /// Returns the value of the `WRPs` field.
14624    pub const fn wrps(self) -> u8 {
14625        ((self.bits() >> Self::WRPS_SHIFT) & 0b11111111) as u8
14626    }
14627
14628    /// Sets the value of the `WRPs` field.
14629    pub const fn set_wrps(&mut self, value: u8) {
14630        let offset = Self::WRPS_SHIFT;
14631        assert!(value & (Self::WRPS_MASK as u8) == value);
14632        *self = Self::from_bits_retain(
14633            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u64) << offset),
14634        );
14635    }
14636
14637    /// Returns a copy with the `WRPs` field set to the given value.
14638    pub const fn with_wrps(mut self, value: u8) -> Self {
14639        self.set_wrps(value);
14640        self
14641    }
14642
14643    /// Returns the value of the `CTX_CMPs` field.
14644    pub const fn ctx_cmps(self) -> u8 {
14645        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b11111111) as u8
14646    }
14647
14648    /// Sets the value of the `CTX_CMPs` field.
14649    pub const fn set_ctx_cmps(&mut self, value: u8) {
14650        let offset = Self::CTX_CMPS_SHIFT;
14651        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
14652        *self = Self::from_bits_retain(
14653            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u64) << offset),
14654        );
14655    }
14656
14657    /// Returns a copy with the `CTX_CMPs` field set to the given value.
14658    pub const fn with_ctx_cmps(mut self, value: u8) -> Self {
14659        self.set_ctx_cmps(value);
14660        self
14661    }
14662
14663    /// Returns the value of the `SPMU` field.
14664    pub const fn spmu(self) -> u8 {
14665        ((self.bits() >> Self::SPMU_SHIFT) & 0b1111) as u8
14666    }
14667
14668    /// Sets the value of the `SPMU` field.
14669    pub const fn set_spmu(&mut self, value: u8) {
14670        let offset = Self::SPMU_SHIFT;
14671        assert!(value & (Self::SPMU_MASK as u8) == value);
14672        *self = Self::from_bits_retain(
14673            (self.bits() & !(Self::SPMU_MASK << offset)) | ((value as u64) << offset),
14674        );
14675    }
14676
14677    /// Returns a copy with the `SPMU` field set to the given value.
14678    pub const fn with_spmu(mut self, value: u8) -> Self {
14679        self.set_spmu(value);
14680        self
14681    }
14682
14683    /// Returns the value of the `PMICNTR` field.
14684    pub const fn pmicntr(self) -> u8 {
14685        ((self.bits() >> Self::PMICNTR_SHIFT) & 0b1111) as u8
14686    }
14687
14688    /// Sets the value of the `PMICNTR` field.
14689    pub const fn set_pmicntr(&mut self, value: u8) {
14690        let offset = Self::PMICNTR_SHIFT;
14691        assert!(value & (Self::PMICNTR_MASK as u8) == value);
14692        *self = Self::from_bits_retain(
14693            (self.bits() & !(Self::PMICNTR_MASK << offset)) | ((value as u64) << offset),
14694        );
14695    }
14696
14697    /// Returns a copy with the `PMICNTR` field set to the given value.
14698    pub const fn with_pmicntr(mut self, value: u8) -> Self {
14699        self.set_pmicntr(value);
14700        self
14701    }
14702
14703    /// Returns the value of the `ABLE` field.
14704    pub const fn able(self) -> u8 {
14705        ((self.bits() >> Self::ABLE_SHIFT) & 0b1111) as u8
14706    }
14707
14708    /// Sets the value of the `ABLE` field.
14709    pub const fn set_able(&mut self, value: u8) {
14710        let offset = Self::ABLE_SHIFT;
14711        assert!(value & (Self::ABLE_MASK as u8) == value);
14712        *self = Self::from_bits_retain(
14713            (self.bits() & !(Self::ABLE_MASK << offset)) | ((value as u64) << offset),
14714        );
14715    }
14716
14717    /// Returns a copy with the `ABLE` field set to the given value.
14718    pub const fn with_able(mut self, value: u8) -> Self {
14719        self.set_able(value);
14720        self
14721    }
14722
14723    /// Returns the value of the `ITE` field.
14724    pub const fn ite(self) -> u8 {
14725        ((self.bits() >> Self::ITE_SHIFT) & 0b1111) as u8
14726    }
14727
14728    /// Sets the value of the `ITE` field.
14729    pub const fn set_ite(&mut self, value: u8) {
14730        let offset = Self::ITE_SHIFT;
14731        assert!(value & (Self::ITE_MASK as u8) == value);
14732        *self = Self::from_bits_retain(
14733            (self.bits() & !(Self::ITE_MASK << offset)) | ((value as u64) << offset),
14734        );
14735    }
14736
14737    /// Returns a copy with the `ITE` field set to the given value.
14738    pub const fn with_ite(mut self, value: u8) -> Self {
14739        self.set_ite(value);
14740        self
14741    }
14742
14743    /// Returns the value of the `EBEP` field.
14744    pub const fn ebep(self) -> u8 {
14745        ((self.bits() >> Self::EBEP_SHIFT) & 0b1111) as u8
14746    }
14747
14748    /// Sets the value of the `EBEP` field.
14749    pub const fn set_ebep(&mut self, value: u8) {
14750        let offset = Self::EBEP_SHIFT;
14751        assert!(value & (Self::EBEP_MASK as u8) == value);
14752        *self = Self::from_bits_retain(
14753            (self.bits() & !(Self::EBEP_MASK << offset)) | ((value as u64) << offset),
14754        );
14755    }
14756
14757    /// Returns a copy with the `EBEP` field set to the given value.
14758    pub const fn with_ebep(mut self, value: u8) -> Self {
14759        self.set_ebep(value);
14760        self
14761    }
14762
14763    /// Returns the value of the `DPFZS` field.
14764    pub const fn dpfzs(self) -> u8 {
14765        ((self.bits() >> Self::DPFZS_SHIFT) & 0b1111) as u8
14766    }
14767
14768    /// Sets the value of the `DPFZS` field.
14769    pub const fn set_dpfzs(&mut self, value: u8) {
14770        let offset = Self::DPFZS_SHIFT;
14771        assert!(value & (Self::DPFZS_MASK as u8) == value);
14772        *self = Self::from_bits_retain(
14773            (self.bits() & !(Self::DPFZS_MASK << offset)) | ((value as u64) << offset),
14774        );
14775    }
14776
14777    /// Returns a copy with the `DPFZS` field set to the given value.
14778    pub const fn with_dpfzs(mut self, value: u8) -> Self {
14779        self.set_dpfzs(value);
14780        self
14781    }
14782
14783    /// Returns the value of the `ABL_CMPs` field.
14784    pub const fn abl_cmps(self) -> u8 {
14785        ((self.bits() >> Self::ABL_CMPS_SHIFT) & 0b11111111) as u8
14786    }
14787
14788    /// Sets the value of the `ABL_CMPs` field.
14789    pub const fn set_abl_cmps(&mut self, value: u8) {
14790        let offset = Self::ABL_CMPS_SHIFT;
14791        assert!(value & (Self::ABL_CMPS_MASK as u8) == value);
14792        *self = Self::from_bits_retain(
14793            (self.bits() & !(Self::ABL_CMPS_MASK << offset)) | ((value as u64) << offset),
14794        );
14795    }
14796
14797    /// Returns a copy with the `ABL_CMPs` field set to the given value.
14798    pub const fn with_abl_cmps(mut self, value: u8) -> Self {
14799        self.set_abl_cmps(value);
14800        self
14801    }
14802}
14803
14804#[cfg(feature = "el1")]
14805bitflags! {
14806    /// `ID_AA64ISAR1_EL1` system register value.
14807    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14808    #[repr(transparent)]
14809    pub struct IdAa64isar1El1: u64 {
14810    }
14811}
14812
14813#[cfg(feature = "el1")]
14814impl IdAa64isar1El1 {
14815    /// Offset of the `DPB` field.
14816    pub const DPB_SHIFT: u32 = 0;
14817    /// Mask for the `DPB` field.
14818    pub const DPB_MASK: u64 = 0b1111;
14819    /// Offset of the `APA` field.
14820    pub const APA_SHIFT: u32 = 4;
14821    /// Mask for the `APA` field.
14822    pub const APA_MASK: u64 = 0b1111;
14823    /// Offset of the `API` field.
14824    pub const API_SHIFT: u32 = 8;
14825    /// Mask for the `API` field.
14826    pub const API_MASK: u64 = 0b1111;
14827    /// Offset of the `JSCVT` field.
14828    pub const JSCVT_SHIFT: u32 = 12;
14829    /// Mask for the `JSCVT` field.
14830    pub const JSCVT_MASK: u64 = 0b1111;
14831    /// Offset of the `FCMA` field.
14832    pub const FCMA_SHIFT: u32 = 16;
14833    /// Mask for the `FCMA` field.
14834    pub const FCMA_MASK: u64 = 0b1111;
14835    /// Offset of the `LRCPC` field.
14836    pub const LRCPC_SHIFT: u32 = 20;
14837    /// Mask for the `LRCPC` field.
14838    pub const LRCPC_MASK: u64 = 0b1111;
14839    /// Offset of the `GPA` field.
14840    pub const GPA_SHIFT: u32 = 24;
14841    /// Mask for the `GPA` field.
14842    pub const GPA_MASK: u64 = 0b1111;
14843    /// Offset of the `GPI` field.
14844    pub const GPI_SHIFT: u32 = 28;
14845    /// Mask for the `GPI` field.
14846    pub const GPI_MASK: u64 = 0b1111;
14847    /// Offset of the `FRINTTS` field.
14848    pub const FRINTTS_SHIFT: u32 = 32;
14849    /// Mask for the `FRINTTS` field.
14850    pub const FRINTTS_MASK: u64 = 0b1111;
14851    /// Offset of the `SB` field.
14852    pub const SB_SHIFT: u32 = 36;
14853    /// Mask for the `SB` field.
14854    pub const SB_MASK: u64 = 0b1111;
14855    /// Offset of the `SPECRES` field.
14856    pub const SPECRES_SHIFT: u32 = 40;
14857    /// Mask for the `SPECRES` field.
14858    pub const SPECRES_MASK: u64 = 0b1111;
14859    /// Offset of the `BF16` field.
14860    pub const BF16_SHIFT: u32 = 44;
14861    /// Mask for the `BF16` field.
14862    pub const BF16_MASK: u64 = 0b1111;
14863    /// Offset of the `DGH` field.
14864    pub const DGH_SHIFT: u32 = 48;
14865    /// Mask for the `DGH` field.
14866    pub const DGH_MASK: u64 = 0b1111;
14867    /// Offset of the `I8MM` field.
14868    pub const I8MM_SHIFT: u32 = 52;
14869    /// Mask for the `I8MM` field.
14870    pub const I8MM_MASK: u64 = 0b1111;
14871    /// Offset of the `XS` field.
14872    pub const XS_SHIFT: u32 = 56;
14873    /// Mask for the `XS` field.
14874    pub const XS_MASK: u64 = 0b1111;
14875    /// Offset of the `LS64` field.
14876    pub const LS64_SHIFT: u32 = 60;
14877    /// Mask for the `LS64` field.
14878    pub const LS64_MASK: u64 = 0b1111;
14879
14880    /// Returns the value of the `DPB` field.
14881    pub const fn dpb(self) -> u8 {
14882        ((self.bits() >> Self::DPB_SHIFT) & 0b1111) as u8
14883    }
14884
14885    /// Sets the value of the `DPB` field.
14886    pub const fn set_dpb(&mut self, value: u8) {
14887        let offset = Self::DPB_SHIFT;
14888        assert!(value & (Self::DPB_MASK as u8) == value);
14889        *self = Self::from_bits_retain(
14890            (self.bits() & !(Self::DPB_MASK << offset)) | ((value as u64) << offset),
14891        );
14892    }
14893
14894    /// Returns a copy with the `DPB` field set to the given value.
14895    pub const fn with_dpb(mut self, value: u8) -> Self {
14896        self.set_dpb(value);
14897        self
14898    }
14899
14900    /// Returns the value of the `APA` field.
14901    pub const fn apa(self) -> u8 {
14902        ((self.bits() >> Self::APA_SHIFT) & 0b1111) as u8
14903    }
14904
14905    /// Sets the value of the `APA` field.
14906    pub const fn set_apa(&mut self, value: u8) {
14907        let offset = Self::APA_SHIFT;
14908        assert!(value & (Self::APA_MASK as u8) == value);
14909        *self = Self::from_bits_retain(
14910            (self.bits() & !(Self::APA_MASK << offset)) | ((value as u64) << offset),
14911        );
14912    }
14913
14914    /// Returns a copy with the `APA` field set to the given value.
14915    pub const fn with_apa(mut self, value: u8) -> Self {
14916        self.set_apa(value);
14917        self
14918    }
14919
14920    /// Returns the value of the `API` field.
14921    pub const fn api(self) -> u8 {
14922        ((self.bits() >> Self::API_SHIFT) & 0b1111) as u8
14923    }
14924
14925    /// Sets the value of the `API` field.
14926    pub const fn set_api(&mut self, value: u8) {
14927        let offset = Self::API_SHIFT;
14928        assert!(value & (Self::API_MASK as u8) == value);
14929        *self = Self::from_bits_retain(
14930            (self.bits() & !(Self::API_MASK << offset)) | ((value as u64) << offset),
14931        );
14932    }
14933
14934    /// Returns a copy with the `API` field set to the given value.
14935    pub const fn with_api(mut self, value: u8) -> Self {
14936        self.set_api(value);
14937        self
14938    }
14939
14940    /// Returns the value of the `JSCVT` field.
14941    pub const fn jscvt(self) -> u8 {
14942        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
14943    }
14944
14945    /// Sets the value of the `JSCVT` field.
14946    pub const fn set_jscvt(&mut self, value: u8) {
14947        let offset = Self::JSCVT_SHIFT;
14948        assert!(value & (Self::JSCVT_MASK as u8) == value);
14949        *self = Self::from_bits_retain(
14950            (self.bits() & !(Self::JSCVT_MASK << offset)) | ((value as u64) << offset),
14951        );
14952    }
14953
14954    /// Returns a copy with the `JSCVT` field set to the given value.
14955    pub const fn with_jscvt(mut self, value: u8) -> Self {
14956        self.set_jscvt(value);
14957        self
14958    }
14959
14960    /// Returns the value of the `FCMA` field.
14961    pub const fn fcma(self) -> u8 {
14962        ((self.bits() >> Self::FCMA_SHIFT) & 0b1111) as u8
14963    }
14964
14965    /// Sets the value of the `FCMA` field.
14966    pub const fn set_fcma(&mut self, value: u8) {
14967        let offset = Self::FCMA_SHIFT;
14968        assert!(value & (Self::FCMA_MASK as u8) == value);
14969        *self = Self::from_bits_retain(
14970            (self.bits() & !(Self::FCMA_MASK << offset)) | ((value as u64) << offset),
14971        );
14972    }
14973
14974    /// Returns a copy with the `FCMA` field set to the given value.
14975    pub const fn with_fcma(mut self, value: u8) -> Self {
14976        self.set_fcma(value);
14977        self
14978    }
14979
14980    /// Returns the value of the `LRCPC` field.
14981    pub const fn lrcpc(self) -> u8 {
14982        ((self.bits() >> Self::LRCPC_SHIFT) & 0b1111) as u8
14983    }
14984
14985    /// Sets the value of the `LRCPC` field.
14986    pub const fn set_lrcpc(&mut self, value: u8) {
14987        let offset = Self::LRCPC_SHIFT;
14988        assert!(value & (Self::LRCPC_MASK as u8) == value);
14989        *self = Self::from_bits_retain(
14990            (self.bits() & !(Self::LRCPC_MASK << offset)) | ((value as u64) << offset),
14991        );
14992    }
14993
14994    /// Returns a copy with the `LRCPC` field set to the given value.
14995    pub const fn with_lrcpc(mut self, value: u8) -> Self {
14996        self.set_lrcpc(value);
14997        self
14998    }
14999
15000    /// Returns the value of the `GPA` field.
15001    pub const fn gpa(self) -> u8 {
15002        ((self.bits() >> Self::GPA_SHIFT) & 0b1111) as u8
15003    }
15004
15005    /// Sets the value of the `GPA` field.
15006    pub const fn set_gpa(&mut self, value: u8) {
15007        let offset = Self::GPA_SHIFT;
15008        assert!(value & (Self::GPA_MASK as u8) == value);
15009        *self = Self::from_bits_retain(
15010            (self.bits() & !(Self::GPA_MASK << offset)) | ((value as u64) << offset),
15011        );
15012    }
15013
15014    /// Returns a copy with the `GPA` field set to the given value.
15015    pub const fn with_gpa(mut self, value: u8) -> Self {
15016        self.set_gpa(value);
15017        self
15018    }
15019
15020    /// Returns the value of the `GPI` field.
15021    pub const fn gpi(self) -> u8 {
15022        ((self.bits() >> Self::GPI_SHIFT) & 0b1111) as u8
15023    }
15024
15025    /// Sets the value of the `GPI` field.
15026    pub const fn set_gpi(&mut self, value: u8) {
15027        let offset = Self::GPI_SHIFT;
15028        assert!(value & (Self::GPI_MASK as u8) == value);
15029        *self = Self::from_bits_retain(
15030            (self.bits() & !(Self::GPI_MASK << offset)) | ((value as u64) << offset),
15031        );
15032    }
15033
15034    /// Returns a copy with the `GPI` field set to the given value.
15035    pub const fn with_gpi(mut self, value: u8) -> Self {
15036        self.set_gpi(value);
15037        self
15038    }
15039
15040    /// Returns the value of the `FRINTTS` field.
15041    pub const fn frintts(self) -> u8 {
15042        ((self.bits() >> Self::FRINTTS_SHIFT) & 0b1111) as u8
15043    }
15044
15045    /// Sets the value of the `FRINTTS` field.
15046    pub const fn set_frintts(&mut self, value: u8) {
15047        let offset = Self::FRINTTS_SHIFT;
15048        assert!(value & (Self::FRINTTS_MASK as u8) == value);
15049        *self = Self::from_bits_retain(
15050            (self.bits() & !(Self::FRINTTS_MASK << offset)) | ((value as u64) << offset),
15051        );
15052    }
15053
15054    /// Returns a copy with the `FRINTTS` field set to the given value.
15055    pub const fn with_frintts(mut self, value: u8) -> Self {
15056        self.set_frintts(value);
15057        self
15058    }
15059
15060    /// Returns the value of the `SB` field.
15061    pub const fn sb(self) -> u8 {
15062        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
15063    }
15064
15065    /// Sets the value of the `SB` field.
15066    pub const fn set_sb(&mut self, value: u8) {
15067        let offset = Self::SB_SHIFT;
15068        assert!(value & (Self::SB_MASK as u8) == value);
15069        *self = Self::from_bits_retain(
15070            (self.bits() & !(Self::SB_MASK << offset)) | ((value as u64) << offset),
15071        );
15072    }
15073
15074    /// Returns a copy with the `SB` field set to the given value.
15075    pub const fn with_sb(mut self, value: u8) -> Self {
15076        self.set_sb(value);
15077        self
15078    }
15079
15080    /// Returns the value of the `SPECRES` field.
15081    pub const fn specres(self) -> u8 {
15082        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
15083    }
15084
15085    /// Sets the value of the `SPECRES` field.
15086    pub const fn set_specres(&mut self, value: u8) {
15087        let offset = Self::SPECRES_SHIFT;
15088        assert!(value & (Self::SPECRES_MASK as u8) == value);
15089        *self = Self::from_bits_retain(
15090            (self.bits() & !(Self::SPECRES_MASK << offset)) | ((value as u64) << offset),
15091        );
15092    }
15093
15094    /// Returns a copy with the `SPECRES` field set to the given value.
15095    pub const fn with_specres(mut self, value: u8) -> Self {
15096        self.set_specres(value);
15097        self
15098    }
15099
15100    /// Returns the value of the `BF16` field.
15101    pub const fn bf16(self) -> u8 {
15102        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
15103    }
15104
15105    /// Sets the value of the `BF16` field.
15106    pub const fn set_bf16(&mut self, value: u8) {
15107        let offset = Self::BF16_SHIFT;
15108        assert!(value & (Self::BF16_MASK as u8) == value);
15109        *self = Self::from_bits_retain(
15110            (self.bits() & !(Self::BF16_MASK << offset)) | ((value as u64) << offset),
15111        );
15112    }
15113
15114    /// Returns a copy with the `BF16` field set to the given value.
15115    pub const fn with_bf16(mut self, value: u8) -> Self {
15116        self.set_bf16(value);
15117        self
15118    }
15119
15120    /// Returns the value of the `DGH` field.
15121    pub const fn dgh(self) -> u8 {
15122        ((self.bits() >> Self::DGH_SHIFT) & 0b1111) as u8
15123    }
15124
15125    /// Sets the value of the `DGH` field.
15126    pub const fn set_dgh(&mut self, value: u8) {
15127        let offset = Self::DGH_SHIFT;
15128        assert!(value & (Self::DGH_MASK as u8) == value);
15129        *self = Self::from_bits_retain(
15130            (self.bits() & !(Self::DGH_MASK << offset)) | ((value as u64) << offset),
15131        );
15132    }
15133
15134    /// Returns a copy with the `DGH` field set to the given value.
15135    pub const fn with_dgh(mut self, value: u8) -> Self {
15136        self.set_dgh(value);
15137        self
15138    }
15139
15140    /// Returns the value of the `I8MM` field.
15141    pub const fn i8mm(self) -> u8 {
15142        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
15143    }
15144
15145    /// Sets the value of the `I8MM` field.
15146    pub const fn set_i8mm(&mut self, value: u8) {
15147        let offset = Self::I8MM_SHIFT;
15148        assert!(value & (Self::I8MM_MASK as u8) == value);
15149        *self = Self::from_bits_retain(
15150            (self.bits() & !(Self::I8MM_MASK << offset)) | ((value as u64) << offset),
15151        );
15152    }
15153
15154    /// Returns a copy with the `I8MM` field set to the given value.
15155    pub const fn with_i8mm(mut self, value: u8) -> Self {
15156        self.set_i8mm(value);
15157        self
15158    }
15159
15160    /// Returns the value of the `XS` field.
15161    pub const fn xs(self) -> u8 {
15162        ((self.bits() >> Self::XS_SHIFT) & 0b1111) as u8
15163    }
15164
15165    /// Sets the value of the `XS` field.
15166    pub const fn set_xs(&mut self, value: u8) {
15167        let offset = Self::XS_SHIFT;
15168        assert!(value & (Self::XS_MASK as u8) == value);
15169        *self = Self::from_bits_retain(
15170            (self.bits() & !(Self::XS_MASK << offset)) | ((value as u64) << offset),
15171        );
15172    }
15173
15174    /// Returns a copy with the `XS` field set to the given value.
15175    pub const fn with_xs(mut self, value: u8) -> Self {
15176        self.set_xs(value);
15177        self
15178    }
15179
15180    /// Returns the value of the `LS64` field.
15181    pub const fn ls64(self) -> u8 {
15182        ((self.bits() >> Self::LS64_SHIFT) & 0b1111) as u8
15183    }
15184
15185    /// Sets the value of the `LS64` field.
15186    pub const fn set_ls64(&mut self, value: u8) {
15187        let offset = Self::LS64_SHIFT;
15188        assert!(value & (Self::LS64_MASK as u8) == value);
15189        *self = Self::from_bits_retain(
15190            (self.bits() & !(Self::LS64_MASK << offset)) | ((value as u64) << offset),
15191        );
15192    }
15193
15194    /// Returns a copy with the `LS64` field set to the given value.
15195    pub const fn with_ls64(mut self, value: u8) -> Self {
15196        self.set_ls64(value);
15197        self
15198    }
15199}
15200
15201#[cfg(feature = "el1")]
15202bitflags! {
15203    /// `ID_AA64ISAR2_EL1` system register value.
15204    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15205    #[repr(transparent)]
15206    pub struct IdAa64isar2El1: u64 {
15207    }
15208}
15209
15210#[cfg(feature = "el1")]
15211impl IdAa64isar2El1 {
15212    /// Offset of the `WFxT` field.
15213    pub const WFXT_SHIFT: u32 = 0;
15214    /// Mask for the `WFxT` field.
15215    pub const WFXT_MASK: u64 = 0b1111;
15216    /// Offset of the `RPRES` field.
15217    pub const RPRES_SHIFT: u32 = 4;
15218    /// Mask for the `RPRES` field.
15219    pub const RPRES_MASK: u64 = 0b1111;
15220    /// Offset of the `GPA3` field.
15221    pub const GPA3_SHIFT: u32 = 8;
15222    /// Mask for the `GPA3` field.
15223    pub const GPA3_MASK: u64 = 0b1111;
15224    /// Offset of the `APA3` field.
15225    pub const APA3_SHIFT: u32 = 12;
15226    /// Mask for the `APA3` field.
15227    pub const APA3_MASK: u64 = 0b1111;
15228    /// Offset of the `MOPS` field.
15229    pub const MOPS_SHIFT: u32 = 16;
15230    /// Mask for the `MOPS` field.
15231    pub const MOPS_MASK: u64 = 0b1111;
15232    /// Offset of the `BC` field.
15233    pub const BC_SHIFT: u32 = 20;
15234    /// Mask for the `BC` field.
15235    pub const BC_MASK: u64 = 0b1111;
15236    /// Offset of the `PAC_frac` field.
15237    pub const PAC_FRAC_SHIFT: u32 = 24;
15238    /// Mask for the `PAC_frac` field.
15239    pub const PAC_FRAC_MASK: u64 = 0b1111;
15240    /// Offset of the `CLRBHB` field.
15241    pub const CLRBHB_SHIFT: u32 = 28;
15242    /// Mask for the `CLRBHB` field.
15243    pub const CLRBHB_MASK: u64 = 0b1111;
15244    /// Offset of the `SYSREG_128` field.
15245    pub const SYSREG_128_SHIFT: u32 = 32;
15246    /// Mask for the `SYSREG_128` field.
15247    pub const SYSREG_128_MASK: u64 = 0b1111;
15248    /// Offset of the `SYSINSTR_128` field.
15249    pub const SYSINSTR_128_SHIFT: u32 = 36;
15250    /// Mask for the `SYSINSTR_128` field.
15251    pub const SYSINSTR_128_MASK: u64 = 0b1111;
15252    /// Offset of the `PRFMSLC` field.
15253    pub const PRFMSLC_SHIFT: u32 = 40;
15254    /// Mask for the `PRFMSLC` field.
15255    pub const PRFMSLC_MASK: u64 = 0b1111;
15256    /// Offset of the `PCDPHINT` field.
15257    pub const PCDPHINT_SHIFT: u32 = 44;
15258    /// Mask for the `PCDPHINT` field.
15259    pub const PCDPHINT_MASK: u64 = 0b1111;
15260    /// Offset of the `RPRFM` field.
15261    pub const RPRFM_SHIFT: u32 = 48;
15262    /// Mask for the `RPRFM` field.
15263    pub const RPRFM_MASK: u64 = 0b1111;
15264    /// Offset of the `CSSC` field.
15265    pub const CSSC_SHIFT: u32 = 52;
15266    /// Mask for the `CSSC` field.
15267    pub const CSSC_MASK: u64 = 0b1111;
15268    /// Offset of the `LUT` field.
15269    pub const LUT_SHIFT: u32 = 56;
15270    /// Mask for the `LUT` field.
15271    pub const LUT_MASK: u64 = 0b1111;
15272    /// Offset of the `ATS1A` field.
15273    pub const ATS1A_SHIFT: u32 = 60;
15274    /// Mask for the `ATS1A` field.
15275    pub const ATS1A_MASK: u64 = 0b1111;
15276
15277    /// Returns the value of the `WFxT` field.
15278    pub const fn wfxt(self) -> u8 {
15279        ((self.bits() >> Self::WFXT_SHIFT) & 0b1111) as u8
15280    }
15281
15282    /// Sets the value of the `WFxT` field.
15283    pub const fn set_wfxt(&mut self, value: u8) {
15284        let offset = Self::WFXT_SHIFT;
15285        assert!(value & (Self::WFXT_MASK as u8) == value);
15286        *self = Self::from_bits_retain(
15287            (self.bits() & !(Self::WFXT_MASK << offset)) | ((value as u64) << offset),
15288        );
15289    }
15290
15291    /// Returns a copy with the `WFxT` field set to the given value.
15292    pub const fn with_wfxt(mut self, value: u8) -> Self {
15293        self.set_wfxt(value);
15294        self
15295    }
15296
15297    /// Returns the value of the `RPRES` field.
15298    pub const fn rpres(self) -> u8 {
15299        ((self.bits() >> Self::RPRES_SHIFT) & 0b1111) as u8
15300    }
15301
15302    /// Sets the value of the `RPRES` field.
15303    pub const fn set_rpres(&mut self, value: u8) {
15304        let offset = Self::RPRES_SHIFT;
15305        assert!(value & (Self::RPRES_MASK as u8) == value);
15306        *self = Self::from_bits_retain(
15307            (self.bits() & !(Self::RPRES_MASK << offset)) | ((value as u64) << offset),
15308        );
15309    }
15310
15311    /// Returns a copy with the `RPRES` field set to the given value.
15312    pub const fn with_rpres(mut self, value: u8) -> Self {
15313        self.set_rpres(value);
15314        self
15315    }
15316
15317    /// Returns the value of the `GPA3` field.
15318    pub const fn gpa3(self) -> u8 {
15319        ((self.bits() >> Self::GPA3_SHIFT) & 0b1111) as u8
15320    }
15321
15322    /// Sets the value of the `GPA3` field.
15323    pub const fn set_gpa3(&mut self, value: u8) {
15324        let offset = Self::GPA3_SHIFT;
15325        assert!(value & (Self::GPA3_MASK as u8) == value);
15326        *self = Self::from_bits_retain(
15327            (self.bits() & !(Self::GPA3_MASK << offset)) | ((value as u64) << offset),
15328        );
15329    }
15330
15331    /// Returns a copy with the `GPA3` field set to the given value.
15332    pub const fn with_gpa3(mut self, value: u8) -> Self {
15333        self.set_gpa3(value);
15334        self
15335    }
15336
15337    /// Returns the value of the `APA3` field.
15338    pub const fn apa3(self) -> u8 {
15339        ((self.bits() >> Self::APA3_SHIFT) & 0b1111) as u8
15340    }
15341
15342    /// Sets the value of the `APA3` field.
15343    pub const fn set_apa3(&mut self, value: u8) {
15344        let offset = Self::APA3_SHIFT;
15345        assert!(value & (Self::APA3_MASK as u8) == value);
15346        *self = Self::from_bits_retain(
15347            (self.bits() & !(Self::APA3_MASK << offset)) | ((value as u64) << offset),
15348        );
15349    }
15350
15351    /// Returns a copy with the `APA3` field set to the given value.
15352    pub const fn with_apa3(mut self, value: u8) -> Self {
15353        self.set_apa3(value);
15354        self
15355    }
15356
15357    /// Returns the value of the `MOPS` field.
15358    pub const fn mops(self) -> u8 {
15359        ((self.bits() >> Self::MOPS_SHIFT) & 0b1111) as u8
15360    }
15361
15362    /// Sets the value of the `MOPS` field.
15363    pub const fn set_mops(&mut self, value: u8) {
15364        let offset = Self::MOPS_SHIFT;
15365        assert!(value & (Self::MOPS_MASK as u8) == value);
15366        *self = Self::from_bits_retain(
15367            (self.bits() & !(Self::MOPS_MASK << offset)) | ((value as u64) << offset),
15368        );
15369    }
15370
15371    /// Returns a copy with the `MOPS` field set to the given value.
15372    pub const fn with_mops(mut self, value: u8) -> Self {
15373        self.set_mops(value);
15374        self
15375    }
15376
15377    /// Returns the value of the `BC` field.
15378    pub const fn bc(self) -> u8 {
15379        ((self.bits() >> Self::BC_SHIFT) & 0b1111) as u8
15380    }
15381
15382    /// Sets the value of the `BC` field.
15383    pub const fn set_bc(&mut self, value: u8) {
15384        let offset = Self::BC_SHIFT;
15385        assert!(value & (Self::BC_MASK as u8) == value);
15386        *self = Self::from_bits_retain(
15387            (self.bits() & !(Self::BC_MASK << offset)) | ((value as u64) << offset),
15388        );
15389    }
15390
15391    /// Returns a copy with the `BC` field set to the given value.
15392    pub const fn with_bc(mut self, value: u8) -> Self {
15393        self.set_bc(value);
15394        self
15395    }
15396
15397    /// Returns the value of the `PAC_frac` field.
15398    pub const fn pac_frac(self) -> u8 {
15399        ((self.bits() >> Self::PAC_FRAC_SHIFT) & 0b1111) as u8
15400    }
15401
15402    /// Sets the value of the `PAC_frac` field.
15403    pub const fn set_pac_frac(&mut self, value: u8) {
15404        let offset = Self::PAC_FRAC_SHIFT;
15405        assert!(value & (Self::PAC_FRAC_MASK as u8) == value);
15406        *self = Self::from_bits_retain(
15407            (self.bits() & !(Self::PAC_FRAC_MASK << offset)) | ((value as u64) << offset),
15408        );
15409    }
15410
15411    /// Returns a copy with the `PAC_frac` field set to the given value.
15412    pub const fn with_pac_frac(mut self, value: u8) -> Self {
15413        self.set_pac_frac(value);
15414        self
15415    }
15416
15417    /// Returns the value of the `CLRBHB` field.
15418    pub const fn clrbhb(self) -> u8 {
15419        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
15420    }
15421
15422    /// Sets the value of the `CLRBHB` field.
15423    pub const fn set_clrbhb(&mut self, value: u8) {
15424        let offset = Self::CLRBHB_SHIFT;
15425        assert!(value & (Self::CLRBHB_MASK as u8) == value);
15426        *self = Self::from_bits_retain(
15427            (self.bits() & !(Self::CLRBHB_MASK << offset)) | ((value as u64) << offset),
15428        );
15429    }
15430
15431    /// Returns a copy with the `CLRBHB` field set to the given value.
15432    pub const fn with_clrbhb(mut self, value: u8) -> Self {
15433        self.set_clrbhb(value);
15434        self
15435    }
15436
15437    /// Returns the value of the `SYSREG_128` field.
15438    pub const fn sysreg_128(self) -> u8 {
15439        ((self.bits() >> Self::SYSREG_128_SHIFT) & 0b1111) as u8
15440    }
15441
15442    /// Sets the value of the `SYSREG_128` field.
15443    pub const fn set_sysreg_128(&mut self, value: u8) {
15444        let offset = Self::SYSREG_128_SHIFT;
15445        assert!(value & (Self::SYSREG_128_MASK as u8) == value);
15446        *self = Self::from_bits_retain(
15447            (self.bits() & !(Self::SYSREG_128_MASK << offset)) | ((value as u64) << offset),
15448        );
15449    }
15450
15451    /// Returns a copy with the `SYSREG_128` field set to the given value.
15452    pub const fn with_sysreg_128(mut self, value: u8) -> Self {
15453        self.set_sysreg_128(value);
15454        self
15455    }
15456
15457    /// Returns the value of the `SYSINSTR_128` field.
15458    pub const fn sysinstr_128(self) -> u8 {
15459        ((self.bits() >> Self::SYSINSTR_128_SHIFT) & 0b1111) as u8
15460    }
15461
15462    /// Sets the value of the `SYSINSTR_128` field.
15463    pub const fn set_sysinstr_128(&mut self, value: u8) {
15464        let offset = Self::SYSINSTR_128_SHIFT;
15465        assert!(value & (Self::SYSINSTR_128_MASK as u8) == value);
15466        *self = Self::from_bits_retain(
15467            (self.bits() & !(Self::SYSINSTR_128_MASK << offset)) | ((value as u64) << offset),
15468        );
15469    }
15470
15471    /// Returns a copy with the `SYSINSTR_128` field set to the given value.
15472    pub const fn with_sysinstr_128(mut self, value: u8) -> Self {
15473        self.set_sysinstr_128(value);
15474        self
15475    }
15476
15477    /// Returns the value of the `PRFMSLC` field.
15478    pub const fn prfmslc(self) -> u8 {
15479        ((self.bits() >> Self::PRFMSLC_SHIFT) & 0b1111) as u8
15480    }
15481
15482    /// Sets the value of the `PRFMSLC` field.
15483    pub const fn set_prfmslc(&mut self, value: u8) {
15484        let offset = Self::PRFMSLC_SHIFT;
15485        assert!(value & (Self::PRFMSLC_MASK as u8) == value);
15486        *self = Self::from_bits_retain(
15487            (self.bits() & !(Self::PRFMSLC_MASK << offset)) | ((value as u64) << offset),
15488        );
15489    }
15490
15491    /// Returns a copy with the `PRFMSLC` field set to the given value.
15492    pub const fn with_prfmslc(mut self, value: u8) -> Self {
15493        self.set_prfmslc(value);
15494        self
15495    }
15496
15497    /// Returns the value of the `PCDPHINT` field.
15498    pub const fn pcdphint(self) -> u8 {
15499        ((self.bits() >> Self::PCDPHINT_SHIFT) & 0b1111) as u8
15500    }
15501
15502    /// Sets the value of the `PCDPHINT` field.
15503    pub const fn set_pcdphint(&mut self, value: u8) {
15504        let offset = Self::PCDPHINT_SHIFT;
15505        assert!(value & (Self::PCDPHINT_MASK as u8) == value);
15506        *self = Self::from_bits_retain(
15507            (self.bits() & !(Self::PCDPHINT_MASK << offset)) | ((value as u64) << offset),
15508        );
15509    }
15510
15511    /// Returns a copy with the `PCDPHINT` field set to the given value.
15512    pub const fn with_pcdphint(mut self, value: u8) -> Self {
15513        self.set_pcdphint(value);
15514        self
15515    }
15516
15517    /// Returns the value of the `RPRFM` field.
15518    pub const fn rprfm(self) -> u8 {
15519        ((self.bits() >> Self::RPRFM_SHIFT) & 0b1111) as u8
15520    }
15521
15522    /// Sets the value of the `RPRFM` field.
15523    pub const fn set_rprfm(&mut self, value: u8) {
15524        let offset = Self::RPRFM_SHIFT;
15525        assert!(value & (Self::RPRFM_MASK as u8) == value);
15526        *self = Self::from_bits_retain(
15527            (self.bits() & !(Self::RPRFM_MASK << offset)) | ((value as u64) << offset),
15528        );
15529    }
15530
15531    /// Returns a copy with the `RPRFM` field set to the given value.
15532    pub const fn with_rprfm(mut self, value: u8) -> Self {
15533        self.set_rprfm(value);
15534        self
15535    }
15536
15537    /// Returns the value of the `CSSC` field.
15538    pub const fn cssc(self) -> u8 {
15539        ((self.bits() >> Self::CSSC_SHIFT) & 0b1111) as u8
15540    }
15541
15542    /// Sets the value of the `CSSC` field.
15543    pub const fn set_cssc(&mut self, value: u8) {
15544        let offset = Self::CSSC_SHIFT;
15545        assert!(value & (Self::CSSC_MASK as u8) == value);
15546        *self = Self::from_bits_retain(
15547            (self.bits() & !(Self::CSSC_MASK << offset)) | ((value as u64) << offset),
15548        );
15549    }
15550
15551    /// Returns a copy with the `CSSC` field set to the given value.
15552    pub const fn with_cssc(mut self, value: u8) -> Self {
15553        self.set_cssc(value);
15554        self
15555    }
15556
15557    /// Returns the value of the `LUT` field.
15558    pub const fn lut(self) -> u8 {
15559        ((self.bits() >> Self::LUT_SHIFT) & 0b1111) as u8
15560    }
15561
15562    /// Sets the value of the `LUT` field.
15563    pub const fn set_lut(&mut self, value: u8) {
15564        let offset = Self::LUT_SHIFT;
15565        assert!(value & (Self::LUT_MASK as u8) == value);
15566        *self = Self::from_bits_retain(
15567            (self.bits() & !(Self::LUT_MASK << offset)) | ((value as u64) << offset),
15568        );
15569    }
15570
15571    /// Returns a copy with the `LUT` field set to the given value.
15572    pub const fn with_lut(mut self, value: u8) -> Self {
15573        self.set_lut(value);
15574        self
15575    }
15576
15577    /// Returns the value of the `ATS1A` field.
15578    pub const fn ats1a(self) -> u8 {
15579        ((self.bits() >> Self::ATS1A_SHIFT) & 0b1111) as u8
15580    }
15581
15582    /// Sets the value of the `ATS1A` field.
15583    pub const fn set_ats1a(&mut self, value: u8) {
15584        let offset = Self::ATS1A_SHIFT;
15585        assert!(value & (Self::ATS1A_MASK as u8) == value);
15586        *self = Self::from_bits_retain(
15587            (self.bits() & !(Self::ATS1A_MASK << offset)) | ((value as u64) << offset),
15588        );
15589    }
15590
15591    /// Returns a copy with the `ATS1A` field set to the given value.
15592    pub const fn with_ats1a(mut self, value: u8) -> Self {
15593        self.set_ats1a(value);
15594        self
15595    }
15596}
15597
15598#[cfg(feature = "el1")]
15599bitflags! {
15600    /// `ID_AA64MMFR0_EL1` system register value.
15601    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15602    #[repr(transparent)]
15603    pub struct IdAa64mmfr0El1: u64 {
15604    }
15605}
15606
15607#[cfg(feature = "el1")]
15608impl IdAa64mmfr0El1 {
15609    /// Offset of the `PARange` field.
15610    pub const PARANGE_SHIFT: u32 = 0;
15611    /// Mask for the `PARange` field.
15612    pub const PARANGE_MASK: u64 = 0b1111;
15613    /// Offset of the `ASIDBits` field.
15614    pub const ASIDBITS_SHIFT: u32 = 4;
15615    /// Mask for the `ASIDBits` field.
15616    pub const ASIDBITS_MASK: u64 = 0b1111;
15617    /// Offset of the `BigEnd` field.
15618    pub const BIGEND_SHIFT: u32 = 8;
15619    /// Mask for the `BigEnd` field.
15620    pub const BIGEND_MASK: u64 = 0b1111;
15621    /// Offset of the `SNSMem` field.
15622    pub const SNSMEM_SHIFT: u32 = 12;
15623    /// Mask for the `SNSMem` field.
15624    pub const SNSMEM_MASK: u64 = 0b1111;
15625    /// Offset of the `BigEndEL0` field.
15626    pub const BIGENDEL0_SHIFT: u32 = 16;
15627    /// Mask for the `BigEndEL0` field.
15628    pub const BIGENDEL0_MASK: u64 = 0b1111;
15629    /// Offset of the `TGran16` field.
15630    pub const TGRAN16_SHIFT: u32 = 20;
15631    /// Mask for the `TGran16` field.
15632    pub const TGRAN16_MASK: u64 = 0b1111;
15633    /// Offset of the `TGran64` field.
15634    pub const TGRAN64_SHIFT: u32 = 24;
15635    /// Mask for the `TGran64` field.
15636    pub const TGRAN64_MASK: u64 = 0b1111;
15637    /// Offset of the `TGran4` field.
15638    pub const TGRAN4_SHIFT: u32 = 28;
15639    /// Mask for the `TGran4` field.
15640    pub const TGRAN4_MASK: u64 = 0b1111;
15641    /// Offset of the `TGran16_2` field.
15642    pub const TGRAN16_2_SHIFT: u32 = 32;
15643    /// Mask for the `TGran16_2` field.
15644    pub const TGRAN16_2_MASK: u64 = 0b1111;
15645    /// Offset of the `TGran64_2` field.
15646    pub const TGRAN64_2_SHIFT: u32 = 36;
15647    /// Mask for the `TGran64_2` field.
15648    pub const TGRAN64_2_MASK: u64 = 0b1111;
15649    /// Offset of the `TGran4_2` field.
15650    pub const TGRAN4_2_SHIFT: u32 = 40;
15651    /// Mask for the `TGran4_2` field.
15652    pub const TGRAN4_2_MASK: u64 = 0b1111;
15653    /// Offset of the `ExS` field.
15654    pub const EXS_SHIFT: u32 = 44;
15655    /// Mask for the `ExS` field.
15656    pub const EXS_MASK: u64 = 0b1111;
15657    /// Offset of the `FGT` field.
15658    pub const FGT_SHIFT: u32 = 56;
15659    /// Mask for the `FGT` field.
15660    pub const FGT_MASK: u64 = 0b1111;
15661    /// Offset of the `ECV` field.
15662    pub const ECV_SHIFT: u32 = 60;
15663    /// Mask for the `ECV` field.
15664    pub const ECV_MASK: u64 = 0b1111;
15665
15666    /// Returns the value of the `PARange` field.
15667    pub const fn parange(self) -> u8 {
15668        ((self.bits() >> Self::PARANGE_SHIFT) & 0b1111) as u8
15669    }
15670
15671    /// Sets the value of the `PARange` field.
15672    pub const fn set_parange(&mut self, value: u8) {
15673        let offset = Self::PARANGE_SHIFT;
15674        assert!(value & (Self::PARANGE_MASK as u8) == value);
15675        *self = Self::from_bits_retain(
15676            (self.bits() & !(Self::PARANGE_MASK << offset)) | ((value as u64) << offset),
15677        );
15678    }
15679
15680    /// Returns a copy with the `PARange` field set to the given value.
15681    pub const fn with_parange(mut self, value: u8) -> Self {
15682        self.set_parange(value);
15683        self
15684    }
15685
15686    /// Returns the value of the `ASIDBits` field.
15687    pub const fn asidbits(self) -> u8 {
15688        ((self.bits() >> Self::ASIDBITS_SHIFT) & 0b1111) as u8
15689    }
15690
15691    /// Sets the value of the `ASIDBits` field.
15692    pub const fn set_asidbits(&mut self, value: u8) {
15693        let offset = Self::ASIDBITS_SHIFT;
15694        assert!(value & (Self::ASIDBITS_MASK as u8) == value);
15695        *self = Self::from_bits_retain(
15696            (self.bits() & !(Self::ASIDBITS_MASK << offset)) | ((value as u64) << offset),
15697        );
15698    }
15699
15700    /// Returns a copy with the `ASIDBits` field set to the given value.
15701    pub const fn with_asidbits(mut self, value: u8) -> Self {
15702        self.set_asidbits(value);
15703        self
15704    }
15705
15706    /// Returns the value of the `BigEnd` field.
15707    pub const fn bigend(self) -> u8 {
15708        ((self.bits() >> Self::BIGEND_SHIFT) & 0b1111) as u8
15709    }
15710
15711    /// Sets the value of the `BigEnd` field.
15712    pub const fn set_bigend(&mut self, value: u8) {
15713        let offset = Self::BIGEND_SHIFT;
15714        assert!(value & (Self::BIGEND_MASK as u8) == value);
15715        *self = Self::from_bits_retain(
15716            (self.bits() & !(Self::BIGEND_MASK << offset)) | ((value as u64) << offset),
15717        );
15718    }
15719
15720    /// Returns a copy with the `BigEnd` field set to the given value.
15721    pub const fn with_bigend(mut self, value: u8) -> Self {
15722        self.set_bigend(value);
15723        self
15724    }
15725
15726    /// Returns the value of the `SNSMem` field.
15727    pub const fn snsmem(self) -> u8 {
15728        ((self.bits() >> Self::SNSMEM_SHIFT) & 0b1111) as u8
15729    }
15730
15731    /// Sets the value of the `SNSMem` field.
15732    pub const fn set_snsmem(&mut self, value: u8) {
15733        let offset = Self::SNSMEM_SHIFT;
15734        assert!(value & (Self::SNSMEM_MASK as u8) == value);
15735        *self = Self::from_bits_retain(
15736            (self.bits() & !(Self::SNSMEM_MASK << offset)) | ((value as u64) << offset),
15737        );
15738    }
15739
15740    /// Returns a copy with the `SNSMem` field set to the given value.
15741    pub const fn with_snsmem(mut self, value: u8) -> Self {
15742        self.set_snsmem(value);
15743        self
15744    }
15745
15746    /// Returns the value of the `BigEndEL0` field.
15747    pub const fn bigendel0(self) -> u8 {
15748        ((self.bits() >> Self::BIGENDEL0_SHIFT) & 0b1111) as u8
15749    }
15750
15751    /// Sets the value of the `BigEndEL0` field.
15752    pub const fn set_bigendel0(&mut self, value: u8) {
15753        let offset = Self::BIGENDEL0_SHIFT;
15754        assert!(value & (Self::BIGENDEL0_MASK as u8) == value);
15755        *self = Self::from_bits_retain(
15756            (self.bits() & !(Self::BIGENDEL0_MASK << offset)) | ((value as u64) << offset),
15757        );
15758    }
15759
15760    /// Returns a copy with the `BigEndEL0` field set to the given value.
15761    pub const fn with_bigendel0(mut self, value: u8) -> Self {
15762        self.set_bigendel0(value);
15763        self
15764    }
15765
15766    /// Returns the value of the `TGran16` field.
15767    pub const fn tgran16(self) -> u8 {
15768        ((self.bits() >> Self::TGRAN16_SHIFT) & 0b1111) as u8
15769    }
15770
15771    /// Sets the value of the `TGran16` field.
15772    pub const fn set_tgran16(&mut self, value: u8) {
15773        let offset = Self::TGRAN16_SHIFT;
15774        assert!(value & (Self::TGRAN16_MASK as u8) == value);
15775        *self = Self::from_bits_retain(
15776            (self.bits() & !(Self::TGRAN16_MASK << offset)) | ((value as u64) << offset),
15777        );
15778    }
15779
15780    /// Returns a copy with the `TGran16` field set to the given value.
15781    pub const fn with_tgran16(mut self, value: u8) -> Self {
15782        self.set_tgran16(value);
15783        self
15784    }
15785
15786    /// Returns the value of the `TGran64` field.
15787    pub const fn tgran64(self) -> u8 {
15788        ((self.bits() >> Self::TGRAN64_SHIFT) & 0b1111) as u8
15789    }
15790
15791    /// Sets the value of the `TGran64` field.
15792    pub const fn set_tgran64(&mut self, value: u8) {
15793        let offset = Self::TGRAN64_SHIFT;
15794        assert!(value & (Self::TGRAN64_MASK as u8) == value);
15795        *self = Self::from_bits_retain(
15796            (self.bits() & !(Self::TGRAN64_MASK << offset)) | ((value as u64) << offset),
15797        );
15798    }
15799
15800    /// Returns a copy with the `TGran64` field set to the given value.
15801    pub const fn with_tgran64(mut self, value: u8) -> Self {
15802        self.set_tgran64(value);
15803        self
15804    }
15805
15806    /// Returns the value of the `TGran4` field.
15807    pub const fn tgran4(self) -> u8 {
15808        ((self.bits() >> Self::TGRAN4_SHIFT) & 0b1111) as u8
15809    }
15810
15811    /// Sets the value of the `TGran4` field.
15812    pub const fn set_tgran4(&mut self, value: u8) {
15813        let offset = Self::TGRAN4_SHIFT;
15814        assert!(value & (Self::TGRAN4_MASK as u8) == value);
15815        *self = Self::from_bits_retain(
15816            (self.bits() & !(Self::TGRAN4_MASK << offset)) | ((value as u64) << offset),
15817        );
15818    }
15819
15820    /// Returns a copy with the `TGran4` field set to the given value.
15821    pub const fn with_tgran4(mut self, value: u8) -> Self {
15822        self.set_tgran4(value);
15823        self
15824    }
15825
15826    /// Returns the value of the `TGran16_2` field.
15827    pub const fn tgran16_2(self) -> u8 {
15828        ((self.bits() >> Self::TGRAN16_2_SHIFT) & 0b1111) as u8
15829    }
15830
15831    /// Sets the value of the `TGran16_2` field.
15832    pub const fn set_tgran16_2(&mut self, value: u8) {
15833        let offset = Self::TGRAN16_2_SHIFT;
15834        assert!(value & (Self::TGRAN16_2_MASK as u8) == value);
15835        *self = Self::from_bits_retain(
15836            (self.bits() & !(Self::TGRAN16_2_MASK << offset)) | ((value as u64) << offset),
15837        );
15838    }
15839
15840    /// Returns a copy with the `TGran16_2` field set to the given value.
15841    pub const fn with_tgran16_2(mut self, value: u8) -> Self {
15842        self.set_tgran16_2(value);
15843        self
15844    }
15845
15846    /// Returns the value of the `TGran64_2` field.
15847    pub const fn tgran64_2(self) -> u8 {
15848        ((self.bits() >> Self::TGRAN64_2_SHIFT) & 0b1111) as u8
15849    }
15850
15851    /// Sets the value of the `TGran64_2` field.
15852    pub const fn set_tgran64_2(&mut self, value: u8) {
15853        let offset = Self::TGRAN64_2_SHIFT;
15854        assert!(value & (Self::TGRAN64_2_MASK as u8) == value);
15855        *self = Self::from_bits_retain(
15856            (self.bits() & !(Self::TGRAN64_2_MASK << offset)) | ((value as u64) << offset),
15857        );
15858    }
15859
15860    /// Returns a copy with the `TGran64_2` field set to the given value.
15861    pub const fn with_tgran64_2(mut self, value: u8) -> Self {
15862        self.set_tgran64_2(value);
15863        self
15864    }
15865
15866    /// Returns the value of the `TGran4_2` field.
15867    pub const fn tgran4_2(self) -> u8 {
15868        ((self.bits() >> Self::TGRAN4_2_SHIFT) & 0b1111) as u8
15869    }
15870
15871    /// Sets the value of the `TGran4_2` field.
15872    pub const fn set_tgran4_2(&mut self, value: u8) {
15873        let offset = Self::TGRAN4_2_SHIFT;
15874        assert!(value & (Self::TGRAN4_2_MASK as u8) == value);
15875        *self = Self::from_bits_retain(
15876            (self.bits() & !(Self::TGRAN4_2_MASK << offset)) | ((value as u64) << offset),
15877        );
15878    }
15879
15880    /// Returns a copy with the `TGran4_2` field set to the given value.
15881    pub const fn with_tgran4_2(mut self, value: u8) -> Self {
15882        self.set_tgran4_2(value);
15883        self
15884    }
15885
15886    /// Returns the value of the `ExS` field.
15887    pub const fn exs(self) -> u8 {
15888        ((self.bits() >> Self::EXS_SHIFT) & 0b1111) as u8
15889    }
15890
15891    /// Sets the value of the `ExS` field.
15892    pub const fn set_exs(&mut self, value: u8) {
15893        let offset = Self::EXS_SHIFT;
15894        assert!(value & (Self::EXS_MASK as u8) == value);
15895        *self = Self::from_bits_retain(
15896            (self.bits() & !(Self::EXS_MASK << offset)) | ((value as u64) << offset),
15897        );
15898    }
15899
15900    /// Returns a copy with the `ExS` field set to the given value.
15901    pub const fn with_exs(mut self, value: u8) -> Self {
15902        self.set_exs(value);
15903        self
15904    }
15905
15906    /// Returns the value of the `FGT` field.
15907    pub const fn fgt(self) -> u8 {
15908        ((self.bits() >> Self::FGT_SHIFT) & 0b1111) as u8
15909    }
15910
15911    /// Sets the value of the `FGT` field.
15912    pub const fn set_fgt(&mut self, value: u8) {
15913        let offset = Self::FGT_SHIFT;
15914        assert!(value & (Self::FGT_MASK as u8) == value);
15915        *self = Self::from_bits_retain(
15916            (self.bits() & !(Self::FGT_MASK << offset)) | ((value as u64) << offset),
15917        );
15918    }
15919
15920    /// Returns a copy with the `FGT` field set to the given value.
15921    pub const fn with_fgt(mut self, value: u8) -> Self {
15922        self.set_fgt(value);
15923        self
15924    }
15925
15926    /// Returns the value of the `ECV` field.
15927    pub const fn ecv(self) -> u8 {
15928        ((self.bits() >> Self::ECV_SHIFT) & 0b1111) as u8
15929    }
15930
15931    /// Sets the value of the `ECV` field.
15932    pub const fn set_ecv(&mut self, value: u8) {
15933        let offset = Self::ECV_SHIFT;
15934        assert!(value & (Self::ECV_MASK as u8) == value);
15935        *self = Self::from_bits_retain(
15936            (self.bits() & !(Self::ECV_MASK << offset)) | ((value as u64) << offset),
15937        );
15938    }
15939
15940    /// Returns a copy with the `ECV` field set to the given value.
15941    pub const fn with_ecv(mut self, value: u8) -> Self {
15942        self.set_ecv(value);
15943        self
15944    }
15945}
15946
15947#[cfg(feature = "el1")]
15948bitflags! {
15949    /// `ID_AA64MMFR1_EL1` system register value.
15950    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15951    #[repr(transparent)]
15952    pub struct IdAa64mmfr1El1: u64 {
15953    }
15954}
15955
15956#[cfg(feature = "el1")]
15957impl IdAa64mmfr1El1 {
15958    /// Offset of the `HAFDBS` field.
15959    pub const HAFDBS_SHIFT: u32 = 0;
15960    /// Mask for the `HAFDBS` field.
15961    pub const HAFDBS_MASK: u64 = 0b1111;
15962    /// Offset of the `VMIDBits` field.
15963    pub const VMIDBITS_SHIFT: u32 = 4;
15964    /// Mask for the `VMIDBits` field.
15965    pub const VMIDBITS_MASK: u64 = 0b1111;
15966    /// Offset of the `VH` field.
15967    pub const VH_SHIFT: u32 = 8;
15968    /// Mask for the `VH` field.
15969    pub const VH_MASK: u64 = 0b1111;
15970    /// Offset of the `HPDS` field.
15971    pub const HPDS_SHIFT: u32 = 12;
15972    /// Mask for the `HPDS` field.
15973    pub const HPDS_MASK: u64 = 0b1111;
15974    /// Offset of the `LO` field.
15975    pub const LO_SHIFT: u32 = 16;
15976    /// Mask for the `LO` field.
15977    pub const LO_MASK: u64 = 0b1111;
15978    /// Offset of the `PAN` field.
15979    pub const PAN_SHIFT: u32 = 20;
15980    /// Mask for the `PAN` field.
15981    pub const PAN_MASK: u64 = 0b1111;
15982    /// Offset of the `SpecSEI` field.
15983    pub const SPECSEI_SHIFT: u32 = 24;
15984    /// Mask for the `SpecSEI` field.
15985    pub const SPECSEI_MASK: u64 = 0b1111;
15986    /// Offset of the `XNX` field.
15987    pub const XNX_SHIFT: u32 = 28;
15988    /// Mask for the `XNX` field.
15989    pub const XNX_MASK: u64 = 0b1111;
15990    /// Offset of the `TWED` field.
15991    pub const TWED_SHIFT: u32 = 32;
15992    /// Mask for the `TWED` field.
15993    pub const TWED_MASK: u64 = 0b1111;
15994    /// Offset of the `ETS` field.
15995    pub const ETS_SHIFT: u32 = 36;
15996    /// Mask for the `ETS` field.
15997    pub const ETS_MASK: u64 = 0b1111;
15998    /// Offset of the `HCX` field.
15999    pub const HCX_SHIFT: u32 = 40;
16000    /// Mask for the `HCX` field.
16001    pub const HCX_MASK: u64 = 0b1111;
16002    /// Offset of the `AFP` field.
16003    pub const AFP_SHIFT: u32 = 44;
16004    /// Mask for the `AFP` field.
16005    pub const AFP_MASK: u64 = 0b1111;
16006    /// Offset of the `nTLBPA` field.
16007    pub const NTLBPA_SHIFT: u32 = 48;
16008    /// Mask for the `nTLBPA` field.
16009    pub const NTLBPA_MASK: u64 = 0b1111;
16010    /// Offset of the `TIDCP1` field.
16011    pub const TIDCP1_SHIFT: u32 = 52;
16012    /// Mask for the `TIDCP1` field.
16013    pub const TIDCP1_MASK: u64 = 0b1111;
16014    /// Offset of the `CMOW` field.
16015    pub const CMOW_SHIFT: u32 = 56;
16016    /// Mask for the `CMOW` field.
16017    pub const CMOW_MASK: u64 = 0b1111;
16018    /// Offset of the `ECBHB` field.
16019    pub const ECBHB_SHIFT: u32 = 60;
16020    /// Mask for the `ECBHB` field.
16021    pub const ECBHB_MASK: u64 = 0b1111;
16022
16023    /// Returns the value of the `HAFDBS` field.
16024    pub const fn hafdbs(self) -> u8 {
16025        ((self.bits() >> Self::HAFDBS_SHIFT) & 0b1111) as u8
16026    }
16027
16028    /// Sets the value of the `HAFDBS` field.
16029    pub const fn set_hafdbs(&mut self, value: u8) {
16030        let offset = Self::HAFDBS_SHIFT;
16031        assert!(value & (Self::HAFDBS_MASK as u8) == value);
16032        *self = Self::from_bits_retain(
16033            (self.bits() & !(Self::HAFDBS_MASK << offset)) | ((value as u64) << offset),
16034        );
16035    }
16036
16037    /// Returns a copy with the `HAFDBS` field set to the given value.
16038    pub const fn with_hafdbs(mut self, value: u8) -> Self {
16039        self.set_hafdbs(value);
16040        self
16041    }
16042
16043    /// Returns the value of the `VMIDBits` field.
16044    pub const fn vmidbits(self) -> u8 {
16045        ((self.bits() >> Self::VMIDBITS_SHIFT) & 0b1111) as u8
16046    }
16047
16048    /// Sets the value of the `VMIDBits` field.
16049    pub const fn set_vmidbits(&mut self, value: u8) {
16050        let offset = Self::VMIDBITS_SHIFT;
16051        assert!(value & (Self::VMIDBITS_MASK as u8) == value);
16052        *self = Self::from_bits_retain(
16053            (self.bits() & !(Self::VMIDBITS_MASK << offset)) | ((value as u64) << offset),
16054        );
16055    }
16056
16057    /// Returns a copy with the `VMIDBits` field set to the given value.
16058    pub const fn with_vmidbits(mut self, value: u8) -> Self {
16059        self.set_vmidbits(value);
16060        self
16061    }
16062
16063    /// Returns the value of the `VH` field.
16064    pub const fn vh(self) -> u8 {
16065        ((self.bits() >> Self::VH_SHIFT) & 0b1111) as u8
16066    }
16067
16068    /// Sets the value of the `VH` field.
16069    pub const fn set_vh(&mut self, value: u8) {
16070        let offset = Self::VH_SHIFT;
16071        assert!(value & (Self::VH_MASK as u8) == value);
16072        *self = Self::from_bits_retain(
16073            (self.bits() & !(Self::VH_MASK << offset)) | ((value as u64) << offset),
16074        );
16075    }
16076
16077    /// Returns a copy with the `VH` field set to the given value.
16078    pub const fn with_vh(mut self, value: u8) -> Self {
16079        self.set_vh(value);
16080        self
16081    }
16082
16083    /// Returns the value of the `HPDS` field.
16084    pub const fn hpds(self) -> u8 {
16085        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
16086    }
16087
16088    /// Sets the value of the `HPDS` field.
16089    pub const fn set_hpds(&mut self, value: u8) {
16090        let offset = Self::HPDS_SHIFT;
16091        assert!(value & (Self::HPDS_MASK as u8) == value);
16092        *self = Self::from_bits_retain(
16093            (self.bits() & !(Self::HPDS_MASK << offset)) | ((value as u64) << offset),
16094        );
16095    }
16096
16097    /// Returns a copy with the `HPDS` field set to the given value.
16098    pub const fn with_hpds(mut self, value: u8) -> Self {
16099        self.set_hpds(value);
16100        self
16101    }
16102
16103    /// Returns the value of the `LO` field.
16104    pub const fn lo(self) -> u8 {
16105        ((self.bits() >> Self::LO_SHIFT) & 0b1111) as u8
16106    }
16107
16108    /// Sets the value of the `LO` field.
16109    pub const fn set_lo(&mut self, value: u8) {
16110        let offset = Self::LO_SHIFT;
16111        assert!(value & (Self::LO_MASK as u8) == value);
16112        *self = Self::from_bits_retain(
16113            (self.bits() & !(Self::LO_MASK << offset)) | ((value as u64) << offset),
16114        );
16115    }
16116
16117    /// Returns a copy with the `LO` field set to the given value.
16118    pub const fn with_lo(mut self, value: u8) -> Self {
16119        self.set_lo(value);
16120        self
16121    }
16122
16123    /// Returns the value of the `PAN` field.
16124    pub const fn pan(self) -> u8 {
16125        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
16126    }
16127
16128    /// Sets the value of the `PAN` field.
16129    pub const fn set_pan(&mut self, value: u8) {
16130        let offset = Self::PAN_SHIFT;
16131        assert!(value & (Self::PAN_MASK as u8) == value);
16132        *self = Self::from_bits_retain(
16133            (self.bits() & !(Self::PAN_MASK << offset)) | ((value as u64) << offset),
16134        );
16135    }
16136
16137    /// Returns a copy with the `PAN` field set to the given value.
16138    pub const fn with_pan(mut self, value: u8) -> Self {
16139        self.set_pan(value);
16140        self
16141    }
16142
16143    /// Returns the value of the `SpecSEI` field.
16144    pub const fn specsei(self) -> u8 {
16145        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
16146    }
16147
16148    /// Sets the value of the `SpecSEI` field.
16149    pub const fn set_specsei(&mut self, value: u8) {
16150        let offset = Self::SPECSEI_SHIFT;
16151        assert!(value & (Self::SPECSEI_MASK as u8) == value);
16152        *self = Self::from_bits_retain(
16153            (self.bits() & !(Self::SPECSEI_MASK << offset)) | ((value as u64) << offset),
16154        );
16155    }
16156
16157    /// Returns a copy with the `SpecSEI` field set to the given value.
16158    pub const fn with_specsei(mut self, value: u8) -> Self {
16159        self.set_specsei(value);
16160        self
16161    }
16162
16163    /// Returns the value of the `XNX` field.
16164    pub const fn xnx(self) -> u8 {
16165        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
16166    }
16167
16168    /// Sets the value of the `XNX` field.
16169    pub const fn set_xnx(&mut self, value: u8) {
16170        let offset = Self::XNX_SHIFT;
16171        assert!(value & (Self::XNX_MASK as u8) == value);
16172        *self = Self::from_bits_retain(
16173            (self.bits() & !(Self::XNX_MASK << offset)) | ((value as u64) << offset),
16174        );
16175    }
16176
16177    /// Returns a copy with the `XNX` field set to the given value.
16178    pub const fn with_xnx(mut self, value: u8) -> Self {
16179        self.set_xnx(value);
16180        self
16181    }
16182
16183    /// Returns the value of the `TWED` field.
16184    pub const fn twed(self) -> u8 {
16185        ((self.bits() >> Self::TWED_SHIFT) & 0b1111) as u8
16186    }
16187
16188    /// Sets the value of the `TWED` field.
16189    pub const fn set_twed(&mut self, value: u8) {
16190        let offset = Self::TWED_SHIFT;
16191        assert!(value & (Self::TWED_MASK as u8) == value);
16192        *self = Self::from_bits_retain(
16193            (self.bits() & !(Self::TWED_MASK << offset)) | ((value as u64) << offset),
16194        );
16195    }
16196
16197    /// Returns a copy with the `TWED` field set to the given value.
16198    pub const fn with_twed(mut self, value: u8) -> Self {
16199        self.set_twed(value);
16200        self
16201    }
16202
16203    /// Returns the value of the `ETS` field.
16204    pub const fn ets(self) -> u8 {
16205        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
16206    }
16207
16208    /// Sets the value of the `ETS` field.
16209    pub const fn set_ets(&mut self, value: u8) {
16210        let offset = Self::ETS_SHIFT;
16211        assert!(value & (Self::ETS_MASK as u8) == value);
16212        *self = Self::from_bits_retain(
16213            (self.bits() & !(Self::ETS_MASK << offset)) | ((value as u64) << offset),
16214        );
16215    }
16216
16217    /// Returns a copy with the `ETS` field set to the given value.
16218    pub const fn with_ets(mut self, value: u8) -> Self {
16219        self.set_ets(value);
16220        self
16221    }
16222
16223    /// Returns the value of the `HCX` field.
16224    pub const fn hcx(self) -> u8 {
16225        ((self.bits() >> Self::HCX_SHIFT) & 0b1111) as u8
16226    }
16227
16228    /// Sets the value of the `HCX` field.
16229    pub const fn set_hcx(&mut self, value: u8) {
16230        let offset = Self::HCX_SHIFT;
16231        assert!(value & (Self::HCX_MASK as u8) == value);
16232        *self = Self::from_bits_retain(
16233            (self.bits() & !(Self::HCX_MASK << offset)) | ((value as u64) << offset),
16234        );
16235    }
16236
16237    /// Returns a copy with the `HCX` field set to the given value.
16238    pub const fn with_hcx(mut self, value: u8) -> Self {
16239        self.set_hcx(value);
16240        self
16241    }
16242
16243    /// Returns the value of the `AFP` field.
16244    pub const fn afp(self) -> u8 {
16245        ((self.bits() >> Self::AFP_SHIFT) & 0b1111) as u8
16246    }
16247
16248    /// Sets the value of the `AFP` field.
16249    pub const fn set_afp(&mut self, value: u8) {
16250        let offset = Self::AFP_SHIFT;
16251        assert!(value & (Self::AFP_MASK as u8) == value);
16252        *self = Self::from_bits_retain(
16253            (self.bits() & !(Self::AFP_MASK << offset)) | ((value as u64) << offset),
16254        );
16255    }
16256
16257    /// Returns a copy with the `AFP` field set to the given value.
16258    pub const fn with_afp(mut self, value: u8) -> Self {
16259        self.set_afp(value);
16260        self
16261    }
16262
16263    /// Returns the value of the `nTLBPA` field.
16264    pub const fn ntlbpa(self) -> u8 {
16265        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
16266    }
16267
16268    /// Sets the value of the `nTLBPA` field.
16269    pub const fn set_ntlbpa(&mut self, value: u8) {
16270        let offset = Self::NTLBPA_SHIFT;
16271        assert!(value & (Self::NTLBPA_MASK as u8) == value);
16272        *self = Self::from_bits_retain(
16273            (self.bits() & !(Self::NTLBPA_MASK << offset)) | ((value as u64) << offset),
16274        );
16275    }
16276
16277    /// Returns a copy with the `nTLBPA` field set to the given value.
16278    pub const fn with_ntlbpa(mut self, value: u8) -> Self {
16279        self.set_ntlbpa(value);
16280        self
16281    }
16282
16283    /// Returns the value of the `TIDCP1` field.
16284    pub const fn tidcp1(self) -> u8 {
16285        ((self.bits() >> Self::TIDCP1_SHIFT) & 0b1111) as u8
16286    }
16287
16288    /// Sets the value of the `TIDCP1` field.
16289    pub const fn set_tidcp1(&mut self, value: u8) {
16290        let offset = Self::TIDCP1_SHIFT;
16291        assert!(value & (Self::TIDCP1_MASK as u8) == value);
16292        *self = Self::from_bits_retain(
16293            (self.bits() & !(Self::TIDCP1_MASK << offset)) | ((value as u64) << offset),
16294        );
16295    }
16296
16297    /// Returns a copy with the `TIDCP1` field set to the given value.
16298    pub const fn with_tidcp1(mut self, value: u8) -> Self {
16299        self.set_tidcp1(value);
16300        self
16301    }
16302
16303    /// Returns the value of the `CMOW` field.
16304    pub const fn cmow(self) -> u8 {
16305        ((self.bits() >> Self::CMOW_SHIFT) & 0b1111) as u8
16306    }
16307
16308    /// Sets the value of the `CMOW` field.
16309    pub const fn set_cmow(&mut self, value: u8) {
16310        let offset = Self::CMOW_SHIFT;
16311        assert!(value & (Self::CMOW_MASK as u8) == value);
16312        *self = Self::from_bits_retain(
16313            (self.bits() & !(Self::CMOW_MASK << offset)) | ((value as u64) << offset),
16314        );
16315    }
16316
16317    /// Returns a copy with the `CMOW` field set to the given value.
16318    pub const fn with_cmow(mut self, value: u8) -> Self {
16319        self.set_cmow(value);
16320        self
16321    }
16322
16323    /// Returns the value of the `ECBHB` field.
16324    pub const fn ecbhb(self) -> u8 {
16325        ((self.bits() >> Self::ECBHB_SHIFT) & 0b1111) as u8
16326    }
16327
16328    /// Sets the value of the `ECBHB` field.
16329    pub const fn set_ecbhb(&mut self, value: u8) {
16330        let offset = Self::ECBHB_SHIFT;
16331        assert!(value & (Self::ECBHB_MASK as u8) == value);
16332        *self = Self::from_bits_retain(
16333            (self.bits() & !(Self::ECBHB_MASK << offset)) | ((value as u64) << offset),
16334        );
16335    }
16336
16337    /// Returns a copy with the `ECBHB` field set to the given value.
16338    pub const fn with_ecbhb(mut self, value: u8) -> Self {
16339        self.set_ecbhb(value);
16340        self
16341    }
16342}
16343
16344#[cfg(feature = "el1")]
16345bitflags! {
16346    /// `ID_AA64MMFR2_EL1` system register value.
16347    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16348    #[repr(transparent)]
16349    pub struct IdAa64mmfr2El1: u64 {
16350    }
16351}
16352
16353#[cfg(feature = "el1")]
16354impl IdAa64mmfr2El1 {
16355    /// Offset of the `CnP` field.
16356    pub const CNP_SHIFT: u32 = 0;
16357    /// Mask for the `CnP` field.
16358    pub const CNP_MASK: u64 = 0b1111;
16359    /// Offset of the `UAO` field.
16360    pub const UAO_SHIFT: u32 = 4;
16361    /// Mask for the `UAO` field.
16362    pub const UAO_MASK: u64 = 0b1111;
16363    /// Offset of the `LSM` field.
16364    pub const LSM_SHIFT: u32 = 8;
16365    /// Mask for the `LSM` field.
16366    pub const LSM_MASK: u64 = 0b1111;
16367    /// Offset of the `IESB` field.
16368    pub const IESB_SHIFT: u32 = 12;
16369    /// Mask for the `IESB` field.
16370    pub const IESB_MASK: u64 = 0b1111;
16371    /// Offset of the `VARange` field.
16372    pub const VARANGE_SHIFT: u32 = 16;
16373    /// Mask for the `VARange` field.
16374    pub const VARANGE_MASK: u64 = 0b1111;
16375    /// Offset of the `CCIDX` field.
16376    pub const CCIDX_SHIFT: u32 = 20;
16377    /// Mask for the `CCIDX` field.
16378    pub const CCIDX_MASK: u64 = 0b1111;
16379    /// Offset of the `NV` field.
16380    pub const NV_SHIFT: u32 = 24;
16381    /// Mask for the `NV` field.
16382    pub const NV_MASK: u64 = 0b1111;
16383    /// Offset of the `ST` field.
16384    pub const ST_SHIFT: u32 = 28;
16385    /// Mask for the `ST` field.
16386    pub const ST_MASK: u64 = 0b1111;
16387    /// Offset of the `AT` field.
16388    pub const AT_SHIFT: u32 = 32;
16389    /// Mask for the `AT` field.
16390    pub const AT_MASK: u64 = 0b1111;
16391    /// Offset of the `IDS` field.
16392    pub const IDS_SHIFT: u32 = 36;
16393    /// Mask for the `IDS` field.
16394    pub const IDS_MASK: u64 = 0b1111;
16395    /// Offset of the `FWB` field.
16396    pub const FWB_SHIFT: u32 = 40;
16397    /// Mask for the `FWB` field.
16398    pub const FWB_MASK: u64 = 0b1111;
16399    /// Offset of the `TTL` field.
16400    pub const TTL_SHIFT: u32 = 48;
16401    /// Mask for the `TTL` field.
16402    pub const TTL_MASK: u64 = 0b1111;
16403    /// Offset of the `BBM` field.
16404    pub const BBM_SHIFT: u32 = 52;
16405    /// Mask for the `BBM` field.
16406    pub const BBM_MASK: u64 = 0b1111;
16407    /// Offset of the `EVT` field.
16408    pub const EVT_SHIFT: u32 = 56;
16409    /// Mask for the `EVT` field.
16410    pub const EVT_MASK: u64 = 0b1111;
16411    /// Offset of the `E0PD` field.
16412    pub const E0PD_SHIFT: u32 = 60;
16413    /// Mask for the `E0PD` field.
16414    pub const E0PD_MASK: u64 = 0b1111;
16415
16416    /// Returns the value of the `CnP` field.
16417    pub const fn cnp(self) -> u8 {
16418        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
16419    }
16420
16421    /// Sets the value of the `CnP` field.
16422    pub const fn set_cnp(&mut self, value: u8) {
16423        let offset = Self::CNP_SHIFT;
16424        assert!(value & (Self::CNP_MASK as u8) == value);
16425        *self = Self::from_bits_retain(
16426            (self.bits() & !(Self::CNP_MASK << offset)) | ((value as u64) << offset),
16427        );
16428    }
16429
16430    /// Returns a copy with the `CnP` field set to the given value.
16431    pub const fn with_cnp(mut self, value: u8) -> Self {
16432        self.set_cnp(value);
16433        self
16434    }
16435
16436    /// Returns the value of the `UAO` field.
16437    pub const fn uao(self) -> u8 {
16438        ((self.bits() >> Self::UAO_SHIFT) & 0b1111) as u8
16439    }
16440
16441    /// Sets the value of the `UAO` field.
16442    pub const fn set_uao(&mut self, value: u8) {
16443        let offset = Self::UAO_SHIFT;
16444        assert!(value & (Self::UAO_MASK as u8) == value);
16445        *self = Self::from_bits_retain(
16446            (self.bits() & !(Self::UAO_MASK << offset)) | ((value as u64) << offset),
16447        );
16448    }
16449
16450    /// Returns a copy with the `UAO` field set to the given value.
16451    pub const fn with_uao(mut self, value: u8) -> Self {
16452        self.set_uao(value);
16453        self
16454    }
16455
16456    /// Returns the value of the `LSM` field.
16457    pub const fn lsm(self) -> u8 {
16458        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
16459    }
16460
16461    /// Sets the value of the `LSM` field.
16462    pub const fn set_lsm(&mut self, value: u8) {
16463        let offset = Self::LSM_SHIFT;
16464        assert!(value & (Self::LSM_MASK as u8) == value);
16465        *self = Self::from_bits_retain(
16466            (self.bits() & !(Self::LSM_MASK << offset)) | ((value as u64) << offset),
16467        );
16468    }
16469
16470    /// Returns a copy with the `LSM` field set to the given value.
16471    pub const fn with_lsm(mut self, value: u8) -> Self {
16472        self.set_lsm(value);
16473        self
16474    }
16475
16476    /// Returns the value of the `IESB` field.
16477    pub const fn iesb(self) -> u8 {
16478        ((self.bits() >> Self::IESB_SHIFT) & 0b1111) as u8
16479    }
16480
16481    /// Sets the value of the `IESB` field.
16482    pub const fn set_iesb(&mut self, value: u8) {
16483        let offset = Self::IESB_SHIFT;
16484        assert!(value & (Self::IESB_MASK as u8) == value);
16485        *self = Self::from_bits_retain(
16486            (self.bits() & !(Self::IESB_MASK << offset)) | ((value as u64) << offset),
16487        );
16488    }
16489
16490    /// Returns a copy with the `IESB` field set to the given value.
16491    pub const fn with_iesb(mut self, value: u8) -> Self {
16492        self.set_iesb(value);
16493        self
16494    }
16495
16496    /// Returns the value of the `VARange` field.
16497    pub const fn varange(self) -> u8 {
16498        ((self.bits() >> Self::VARANGE_SHIFT) & 0b1111) as u8
16499    }
16500
16501    /// Sets the value of the `VARange` field.
16502    pub const fn set_varange(&mut self, value: u8) {
16503        let offset = Self::VARANGE_SHIFT;
16504        assert!(value & (Self::VARANGE_MASK as u8) == value);
16505        *self = Self::from_bits_retain(
16506            (self.bits() & !(Self::VARANGE_MASK << offset)) | ((value as u64) << offset),
16507        );
16508    }
16509
16510    /// Returns a copy with the `VARange` field set to the given value.
16511    pub const fn with_varange(mut self, value: u8) -> Self {
16512        self.set_varange(value);
16513        self
16514    }
16515
16516    /// Returns the value of the `CCIDX` field.
16517    pub const fn ccidx(self) -> u8 {
16518        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
16519    }
16520
16521    /// Sets the value of the `CCIDX` field.
16522    pub const fn set_ccidx(&mut self, value: u8) {
16523        let offset = Self::CCIDX_SHIFT;
16524        assert!(value & (Self::CCIDX_MASK as u8) == value);
16525        *self = Self::from_bits_retain(
16526            (self.bits() & !(Self::CCIDX_MASK << offset)) | ((value as u64) << offset),
16527        );
16528    }
16529
16530    /// Returns a copy with the `CCIDX` field set to the given value.
16531    pub const fn with_ccidx(mut self, value: u8) -> Self {
16532        self.set_ccidx(value);
16533        self
16534    }
16535
16536    /// Returns the value of the `NV` field.
16537    pub const fn nv(self) -> u8 {
16538        ((self.bits() >> Self::NV_SHIFT) & 0b1111) as u8
16539    }
16540
16541    /// Sets the value of the `NV` field.
16542    pub const fn set_nv(&mut self, value: u8) {
16543        let offset = Self::NV_SHIFT;
16544        assert!(value & (Self::NV_MASK as u8) == value);
16545        *self = Self::from_bits_retain(
16546            (self.bits() & !(Self::NV_MASK << offset)) | ((value as u64) << offset),
16547        );
16548    }
16549
16550    /// Returns a copy with the `NV` field set to the given value.
16551    pub const fn with_nv(mut self, value: u8) -> Self {
16552        self.set_nv(value);
16553        self
16554    }
16555
16556    /// Returns the value of the `ST` field.
16557    pub const fn st(self) -> u8 {
16558        ((self.bits() >> Self::ST_SHIFT) & 0b1111) as u8
16559    }
16560
16561    /// Sets the value of the `ST` field.
16562    pub const fn set_st(&mut self, value: u8) {
16563        let offset = Self::ST_SHIFT;
16564        assert!(value & (Self::ST_MASK as u8) == value);
16565        *self = Self::from_bits_retain(
16566            (self.bits() & !(Self::ST_MASK << offset)) | ((value as u64) << offset),
16567        );
16568    }
16569
16570    /// Returns a copy with the `ST` field set to the given value.
16571    pub const fn with_st(mut self, value: u8) -> Self {
16572        self.set_st(value);
16573        self
16574    }
16575
16576    /// Returns the value of the `AT` field.
16577    pub const fn at(self) -> u8 {
16578        ((self.bits() >> Self::AT_SHIFT) & 0b1111) as u8
16579    }
16580
16581    /// Sets the value of the `AT` field.
16582    pub const fn set_at(&mut self, value: u8) {
16583        let offset = Self::AT_SHIFT;
16584        assert!(value & (Self::AT_MASK as u8) == value);
16585        *self = Self::from_bits_retain(
16586            (self.bits() & !(Self::AT_MASK << offset)) | ((value as u64) << offset),
16587        );
16588    }
16589
16590    /// Returns a copy with the `AT` field set to the given value.
16591    pub const fn with_at(mut self, value: u8) -> Self {
16592        self.set_at(value);
16593        self
16594    }
16595
16596    /// Returns the value of the `IDS` field.
16597    pub const fn ids(self) -> u8 {
16598        ((self.bits() >> Self::IDS_SHIFT) & 0b1111) as u8
16599    }
16600
16601    /// Sets the value of the `IDS` field.
16602    pub const fn set_ids(&mut self, value: u8) {
16603        let offset = Self::IDS_SHIFT;
16604        assert!(value & (Self::IDS_MASK as u8) == value);
16605        *self = Self::from_bits_retain(
16606            (self.bits() & !(Self::IDS_MASK << offset)) | ((value as u64) << offset),
16607        );
16608    }
16609
16610    /// Returns a copy with the `IDS` field set to the given value.
16611    pub const fn with_ids(mut self, value: u8) -> Self {
16612        self.set_ids(value);
16613        self
16614    }
16615
16616    /// Returns the value of the `FWB` field.
16617    pub const fn fwb(self) -> u8 {
16618        ((self.bits() >> Self::FWB_SHIFT) & 0b1111) as u8
16619    }
16620
16621    /// Sets the value of the `FWB` field.
16622    pub const fn set_fwb(&mut self, value: u8) {
16623        let offset = Self::FWB_SHIFT;
16624        assert!(value & (Self::FWB_MASK as u8) == value);
16625        *self = Self::from_bits_retain(
16626            (self.bits() & !(Self::FWB_MASK << offset)) | ((value as u64) << offset),
16627        );
16628    }
16629
16630    /// Returns a copy with the `FWB` field set to the given value.
16631    pub const fn with_fwb(mut self, value: u8) -> Self {
16632        self.set_fwb(value);
16633        self
16634    }
16635
16636    /// Returns the value of the `TTL` field.
16637    pub const fn ttl(self) -> u8 {
16638        ((self.bits() >> Self::TTL_SHIFT) & 0b1111) as u8
16639    }
16640
16641    /// Sets the value of the `TTL` field.
16642    pub const fn set_ttl(&mut self, value: u8) {
16643        let offset = Self::TTL_SHIFT;
16644        assert!(value & (Self::TTL_MASK as u8) == value);
16645        *self = Self::from_bits_retain(
16646            (self.bits() & !(Self::TTL_MASK << offset)) | ((value as u64) << offset),
16647        );
16648    }
16649
16650    /// Returns a copy with the `TTL` field set to the given value.
16651    pub const fn with_ttl(mut self, value: u8) -> Self {
16652        self.set_ttl(value);
16653        self
16654    }
16655
16656    /// Returns the value of the `BBM` field.
16657    pub const fn bbm(self) -> u8 {
16658        ((self.bits() >> Self::BBM_SHIFT) & 0b1111) as u8
16659    }
16660
16661    /// Sets the value of the `BBM` field.
16662    pub const fn set_bbm(&mut self, value: u8) {
16663        let offset = Self::BBM_SHIFT;
16664        assert!(value & (Self::BBM_MASK as u8) == value);
16665        *self = Self::from_bits_retain(
16666            (self.bits() & !(Self::BBM_MASK << offset)) | ((value as u64) << offset),
16667        );
16668    }
16669
16670    /// Returns a copy with the `BBM` field set to the given value.
16671    pub const fn with_bbm(mut self, value: u8) -> Self {
16672        self.set_bbm(value);
16673        self
16674    }
16675
16676    /// Returns the value of the `EVT` field.
16677    pub const fn evt(self) -> u8 {
16678        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
16679    }
16680
16681    /// Sets the value of the `EVT` field.
16682    pub const fn set_evt(&mut self, value: u8) {
16683        let offset = Self::EVT_SHIFT;
16684        assert!(value & (Self::EVT_MASK as u8) == value);
16685        *self = Self::from_bits_retain(
16686            (self.bits() & !(Self::EVT_MASK << offset)) | ((value as u64) << offset),
16687        );
16688    }
16689
16690    /// Returns a copy with the `EVT` field set to the given value.
16691    pub const fn with_evt(mut self, value: u8) -> Self {
16692        self.set_evt(value);
16693        self
16694    }
16695
16696    /// Returns the value of the `E0PD` field.
16697    pub const fn e0pd(self) -> u8 {
16698        ((self.bits() >> Self::E0PD_SHIFT) & 0b1111) as u8
16699    }
16700
16701    /// Sets the value of the `E0PD` field.
16702    pub const fn set_e0pd(&mut self, value: u8) {
16703        let offset = Self::E0PD_SHIFT;
16704        assert!(value & (Self::E0PD_MASK as u8) == value);
16705        *self = Self::from_bits_retain(
16706            (self.bits() & !(Self::E0PD_MASK << offset)) | ((value as u64) << offset),
16707        );
16708    }
16709
16710    /// Returns a copy with the `E0PD` field set to the given value.
16711    pub const fn with_e0pd(mut self, value: u8) -> Self {
16712        self.set_e0pd(value);
16713        self
16714    }
16715}
16716
16717#[cfg(feature = "el1")]
16718bitflags! {
16719    /// `ID_AA64MMFR3_EL1` system register value.
16720    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16721    #[repr(transparent)]
16722    pub struct IdAa64mmfr3El1: u64 {
16723    }
16724}
16725
16726#[cfg(feature = "el1")]
16727impl IdAa64mmfr3El1 {
16728    /// Offset of the `TCRX` field.
16729    pub const TCRX_SHIFT: u32 = 0;
16730    /// Mask for the `TCRX` field.
16731    pub const TCRX_MASK: u64 = 0b1111;
16732    /// Offset of the `SCTLRX` field.
16733    pub const SCTLRX_SHIFT: u32 = 4;
16734    /// Mask for the `SCTLRX` field.
16735    pub const SCTLRX_MASK: u64 = 0b1111;
16736    /// Offset of the `S1PIE` field.
16737    pub const S1PIE_SHIFT: u32 = 8;
16738    /// Mask for the `S1PIE` field.
16739    pub const S1PIE_MASK: u64 = 0b1111;
16740    /// Offset of the `S2PIE` field.
16741    pub const S2PIE_SHIFT: u32 = 12;
16742    /// Mask for the `S2PIE` field.
16743    pub const S2PIE_MASK: u64 = 0b1111;
16744    /// Offset of the `S1POE` field.
16745    pub const S1POE_SHIFT: u32 = 16;
16746    /// Mask for the `S1POE` field.
16747    pub const S1POE_MASK: u64 = 0b1111;
16748    /// Offset of the `S2POE` field.
16749    pub const S2POE_SHIFT: u32 = 20;
16750    /// Mask for the `S2POE` field.
16751    pub const S2POE_MASK: u64 = 0b1111;
16752    /// Offset of the `AIE` field.
16753    pub const AIE_SHIFT: u32 = 24;
16754    /// Mask for the `AIE` field.
16755    pub const AIE_MASK: u64 = 0b1111;
16756    /// Offset of the `MEC` field.
16757    pub const MEC_SHIFT: u32 = 28;
16758    /// Mask for the `MEC` field.
16759    pub const MEC_MASK: u64 = 0b1111;
16760    /// Offset of the `D128` field.
16761    pub const D128_SHIFT: u32 = 32;
16762    /// Mask for the `D128` field.
16763    pub const D128_MASK: u64 = 0b1111;
16764    /// Offset of the `D128_2` field.
16765    pub const D128_2_SHIFT: u32 = 36;
16766    /// Mask for the `D128_2` field.
16767    pub const D128_2_MASK: u64 = 0b1111;
16768    /// Offset of the `SNERR` field.
16769    pub const SNERR_SHIFT: u32 = 40;
16770    /// Mask for the `SNERR` field.
16771    pub const SNERR_MASK: u64 = 0b1111;
16772    /// Offset of the `ANERR` field.
16773    pub const ANERR_SHIFT: u32 = 44;
16774    /// Mask for the `ANERR` field.
16775    pub const ANERR_MASK: u64 = 0b1111;
16776    /// Offset of the `SDERR` field.
16777    pub const SDERR_SHIFT: u32 = 52;
16778    /// Mask for the `SDERR` field.
16779    pub const SDERR_MASK: u64 = 0b1111;
16780    /// Offset of the `ADERR` field.
16781    pub const ADERR_SHIFT: u32 = 56;
16782    /// Mask for the `ADERR` field.
16783    pub const ADERR_MASK: u64 = 0b1111;
16784    /// Offset of the `Spec_FPACC` field.
16785    pub const SPEC_FPACC_SHIFT: u32 = 60;
16786    /// Mask for the `Spec_FPACC` field.
16787    pub const SPEC_FPACC_MASK: u64 = 0b1111;
16788
16789    /// Returns the value of the `TCRX` field.
16790    pub const fn tcrx(self) -> u8 {
16791        ((self.bits() >> Self::TCRX_SHIFT) & 0b1111) as u8
16792    }
16793
16794    /// Sets the value of the `TCRX` field.
16795    pub const fn set_tcrx(&mut self, value: u8) {
16796        let offset = Self::TCRX_SHIFT;
16797        assert!(value & (Self::TCRX_MASK as u8) == value);
16798        *self = Self::from_bits_retain(
16799            (self.bits() & !(Self::TCRX_MASK << offset)) | ((value as u64) << offset),
16800        );
16801    }
16802
16803    /// Returns a copy with the `TCRX` field set to the given value.
16804    pub const fn with_tcrx(mut self, value: u8) -> Self {
16805        self.set_tcrx(value);
16806        self
16807    }
16808
16809    /// Returns the value of the `SCTLRX` field.
16810    pub const fn sctlrx(self) -> u8 {
16811        ((self.bits() >> Self::SCTLRX_SHIFT) & 0b1111) as u8
16812    }
16813
16814    /// Sets the value of the `SCTLRX` field.
16815    pub const fn set_sctlrx(&mut self, value: u8) {
16816        let offset = Self::SCTLRX_SHIFT;
16817        assert!(value & (Self::SCTLRX_MASK as u8) == value);
16818        *self = Self::from_bits_retain(
16819            (self.bits() & !(Self::SCTLRX_MASK << offset)) | ((value as u64) << offset),
16820        );
16821    }
16822
16823    /// Returns a copy with the `SCTLRX` field set to the given value.
16824    pub const fn with_sctlrx(mut self, value: u8) -> Self {
16825        self.set_sctlrx(value);
16826        self
16827    }
16828
16829    /// Returns the value of the `S1PIE` field.
16830    pub const fn s1pie(self) -> u8 {
16831        ((self.bits() >> Self::S1PIE_SHIFT) & 0b1111) as u8
16832    }
16833
16834    /// Sets the value of the `S1PIE` field.
16835    pub const fn set_s1pie(&mut self, value: u8) {
16836        let offset = Self::S1PIE_SHIFT;
16837        assert!(value & (Self::S1PIE_MASK as u8) == value);
16838        *self = Self::from_bits_retain(
16839            (self.bits() & !(Self::S1PIE_MASK << offset)) | ((value as u64) << offset),
16840        );
16841    }
16842
16843    /// Returns a copy with the `S1PIE` field set to the given value.
16844    pub const fn with_s1pie(mut self, value: u8) -> Self {
16845        self.set_s1pie(value);
16846        self
16847    }
16848
16849    /// Returns the value of the `S2PIE` field.
16850    pub const fn s2pie(self) -> u8 {
16851        ((self.bits() >> Self::S2PIE_SHIFT) & 0b1111) as u8
16852    }
16853
16854    /// Sets the value of the `S2PIE` field.
16855    pub const fn set_s2pie(&mut self, value: u8) {
16856        let offset = Self::S2PIE_SHIFT;
16857        assert!(value & (Self::S2PIE_MASK as u8) == value);
16858        *self = Self::from_bits_retain(
16859            (self.bits() & !(Self::S2PIE_MASK << offset)) | ((value as u64) << offset),
16860        );
16861    }
16862
16863    /// Returns a copy with the `S2PIE` field set to the given value.
16864    pub const fn with_s2pie(mut self, value: u8) -> Self {
16865        self.set_s2pie(value);
16866        self
16867    }
16868
16869    /// Returns the value of the `S1POE` field.
16870    pub const fn s1poe(self) -> u8 {
16871        ((self.bits() >> Self::S1POE_SHIFT) & 0b1111) as u8
16872    }
16873
16874    /// Sets the value of the `S1POE` field.
16875    pub const fn set_s1poe(&mut self, value: u8) {
16876        let offset = Self::S1POE_SHIFT;
16877        assert!(value & (Self::S1POE_MASK as u8) == value);
16878        *self = Self::from_bits_retain(
16879            (self.bits() & !(Self::S1POE_MASK << offset)) | ((value as u64) << offset),
16880        );
16881    }
16882
16883    /// Returns a copy with the `S1POE` field set to the given value.
16884    pub const fn with_s1poe(mut self, value: u8) -> Self {
16885        self.set_s1poe(value);
16886        self
16887    }
16888
16889    /// Returns the value of the `S2POE` field.
16890    pub const fn s2poe(self) -> u8 {
16891        ((self.bits() >> Self::S2POE_SHIFT) & 0b1111) as u8
16892    }
16893
16894    /// Sets the value of the `S2POE` field.
16895    pub const fn set_s2poe(&mut self, value: u8) {
16896        let offset = Self::S2POE_SHIFT;
16897        assert!(value & (Self::S2POE_MASK as u8) == value);
16898        *self = Self::from_bits_retain(
16899            (self.bits() & !(Self::S2POE_MASK << offset)) | ((value as u64) << offset),
16900        );
16901    }
16902
16903    /// Returns a copy with the `S2POE` field set to the given value.
16904    pub const fn with_s2poe(mut self, value: u8) -> Self {
16905        self.set_s2poe(value);
16906        self
16907    }
16908
16909    /// Returns the value of the `AIE` field.
16910    pub const fn aie(self) -> u8 {
16911        ((self.bits() >> Self::AIE_SHIFT) & 0b1111) as u8
16912    }
16913
16914    /// Sets the value of the `AIE` field.
16915    pub const fn set_aie(&mut self, value: u8) {
16916        let offset = Self::AIE_SHIFT;
16917        assert!(value & (Self::AIE_MASK as u8) == value);
16918        *self = Self::from_bits_retain(
16919            (self.bits() & !(Self::AIE_MASK << offset)) | ((value as u64) << offset),
16920        );
16921    }
16922
16923    /// Returns a copy with the `AIE` field set to the given value.
16924    pub const fn with_aie(mut self, value: u8) -> Self {
16925        self.set_aie(value);
16926        self
16927    }
16928
16929    /// Returns the value of the `MEC` field.
16930    pub const fn mec(self) -> u8 {
16931        ((self.bits() >> Self::MEC_SHIFT) & 0b1111) as u8
16932    }
16933
16934    /// Sets the value of the `MEC` field.
16935    pub const fn set_mec(&mut self, value: u8) {
16936        let offset = Self::MEC_SHIFT;
16937        assert!(value & (Self::MEC_MASK as u8) == value);
16938        *self = Self::from_bits_retain(
16939            (self.bits() & !(Self::MEC_MASK << offset)) | ((value as u64) << offset),
16940        );
16941    }
16942
16943    /// Returns a copy with the `MEC` field set to the given value.
16944    pub const fn with_mec(mut self, value: u8) -> Self {
16945        self.set_mec(value);
16946        self
16947    }
16948
16949    /// Returns the value of the `D128` field.
16950    pub const fn d128(self) -> u8 {
16951        ((self.bits() >> Self::D128_SHIFT) & 0b1111) as u8
16952    }
16953
16954    /// Sets the value of the `D128` field.
16955    pub const fn set_d128(&mut self, value: u8) {
16956        let offset = Self::D128_SHIFT;
16957        assert!(value & (Self::D128_MASK as u8) == value);
16958        *self = Self::from_bits_retain(
16959            (self.bits() & !(Self::D128_MASK << offset)) | ((value as u64) << offset),
16960        );
16961    }
16962
16963    /// Returns a copy with the `D128` field set to the given value.
16964    pub const fn with_d128(mut self, value: u8) -> Self {
16965        self.set_d128(value);
16966        self
16967    }
16968
16969    /// Returns the value of the `D128_2` field.
16970    pub const fn d128_2(self) -> u8 {
16971        ((self.bits() >> Self::D128_2_SHIFT) & 0b1111) as u8
16972    }
16973
16974    /// Sets the value of the `D128_2` field.
16975    pub const fn set_d128_2(&mut self, value: u8) {
16976        let offset = Self::D128_2_SHIFT;
16977        assert!(value & (Self::D128_2_MASK as u8) == value);
16978        *self = Self::from_bits_retain(
16979            (self.bits() & !(Self::D128_2_MASK << offset)) | ((value as u64) << offset),
16980        );
16981    }
16982
16983    /// Returns a copy with the `D128_2` field set to the given value.
16984    pub const fn with_d128_2(mut self, value: u8) -> Self {
16985        self.set_d128_2(value);
16986        self
16987    }
16988
16989    /// Returns the value of the `SNERR` field.
16990    pub const fn snerr(self) -> u8 {
16991        ((self.bits() >> Self::SNERR_SHIFT) & 0b1111) as u8
16992    }
16993
16994    /// Sets the value of the `SNERR` field.
16995    pub const fn set_snerr(&mut self, value: u8) {
16996        let offset = Self::SNERR_SHIFT;
16997        assert!(value & (Self::SNERR_MASK as u8) == value);
16998        *self = Self::from_bits_retain(
16999            (self.bits() & !(Self::SNERR_MASK << offset)) | ((value as u64) << offset),
17000        );
17001    }
17002
17003    /// Returns a copy with the `SNERR` field set to the given value.
17004    pub const fn with_snerr(mut self, value: u8) -> Self {
17005        self.set_snerr(value);
17006        self
17007    }
17008
17009    /// Returns the value of the `ANERR` field.
17010    pub const fn anerr(self) -> u8 {
17011        ((self.bits() >> Self::ANERR_SHIFT) & 0b1111) as u8
17012    }
17013
17014    /// Sets the value of the `ANERR` field.
17015    pub const fn set_anerr(&mut self, value: u8) {
17016        let offset = Self::ANERR_SHIFT;
17017        assert!(value & (Self::ANERR_MASK as u8) == value);
17018        *self = Self::from_bits_retain(
17019            (self.bits() & !(Self::ANERR_MASK << offset)) | ((value as u64) << offset),
17020        );
17021    }
17022
17023    /// Returns a copy with the `ANERR` field set to the given value.
17024    pub const fn with_anerr(mut self, value: u8) -> Self {
17025        self.set_anerr(value);
17026        self
17027    }
17028
17029    /// Returns the value of the `SDERR` field.
17030    pub const fn sderr(self) -> u8 {
17031        ((self.bits() >> Self::SDERR_SHIFT) & 0b1111) as u8
17032    }
17033
17034    /// Sets the value of the `SDERR` field.
17035    pub const fn set_sderr(&mut self, value: u8) {
17036        let offset = Self::SDERR_SHIFT;
17037        assert!(value & (Self::SDERR_MASK as u8) == value);
17038        *self = Self::from_bits_retain(
17039            (self.bits() & !(Self::SDERR_MASK << offset)) | ((value as u64) << offset),
17040        );
17041    }
17042
17043    /// Returns a copy with the `SDERR` field set to the given value.
17044    pub const fn with_sderr(mut self, value: u8) -> Self {
17045        self.set_sderr(value);
17046        self
17047    }
17048
17049    /// Returns the value of the `ADERR` field.
17050    pub const fn aderr(self) -> u8 {
17051        ((self.bits() >> Self::ADERR_SHIFT) & 0b1111) as u8
17052    }
17053
17054    /// Sets the value of the `ADERR` field.
17055    pub const fn set_aderr(&mut self, value: u8) {
17056        let offset = Self::ADERR_SHIFT;
17057        assert!(value & (Self::ADERR_MASK as u8) == value);
17058        *self = Self::from_bits_retain(
17059            (self.bits() & !(Self::ADERR_MASK << offset)) | ((value as u64) << offset),
17060        );
17061    }
17062
17063    /// Returns a copy with the `ADERR` field set to the given value.
17064    pub const fn with_aderr(mut self, value: u8) -> Self {
17065        self.set_aderr(value);
17066        self
17067    }
17068
17069    /// Returns the value of the `Spec_FPACC` field.
17070    pub const fn spec_fpacc(self) -> u8 {
17071        ((self.bits() >> Self::SPEC_FPACC_SHIFT) & 0b1111) as u8
17072    }
17073
17074    /// Sets the value of the `Spec_FPACC` field.
17075    pub const fn set_spec_fpacc(&mut self, value: u8) {
17076        let offset = Self::SPEC_FPACC_SHIFT;
17077        assert!(value & (Self::SPEC_FPACC_MASK as u8) == value);
17078        *self = Self::from_bits_retain(
17079            (self.bits() & !(Self::SPEC_FPACC_MASK << offset)) | ((value as u64) << offset),
17080        );
17081    }
17082
17083    /// Returns a copy with the `Spec_FPACC` field set to the given value.
17084    pub const fn with_spec_fpacc(mut self, value: u8) -> Self {
17085        self.set_spec_fpacc(value);
17086        self
17087    }
17088}
17089
17090#[cfg(feature = "el1")]
17091bitflags! {
17092    /// `ID_AA64PFR0_EL1` system register value.
17093    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17094    #[repr(transparent)]
17095    pub struct IdAa64pfr0El1: u64 {
17096    }
17097}
17098
17099#[cfg(feature = "el1")]
17100impl IdAa64pfr0El1 {
17101    /// Offset of the `EL0` field.
17102    pub const EL0_SHIFT: u32 = 0;
17103    /// Mask for the `EL0` field.
17104    pub const EL0_MASK: u64 = 0b1111;
17105    /// Offset of the `EL1` field.
17106    pub const EL1_SHIFT: u32 = 4;
17107    /// Mask for the `EL1` field.
17108    pub const EL1_MASK: u64 = 0b1111;
17109    /// Offset of the `EL2` field.
17110    pub const EL2_SHIFT: u32 = 8;
17111    /// Mask for the `EL2` field.
17112    pub const EL2_MASK: u64 = 0b1111;
17113    /// Offset of the `EL3` field.
17114    pub const EL3_SHIFT: u32 = 12;
17115    /// Mask for the `EL3` field.
17116    pub const EL3_MASK: u64 = 0b1111;
17117    /// Offset of the `FP` field.
17118    pub const FP_SHIFT: u32 = 16;
17119    /// Mask for the `FP` field.
17120    pub const FP_MASK: u64 = 0b1111;
17121    /// Offset of the `AdvSIMD` field.
17122    pub const ADVSIMD_SHIFT: u32 = 20;
17123    /// Mask for the `AdvSIMD` field.
17124    pub const ADVSIMD_MASK: u64 = 0b1111;
17125    /// Offset of the `GIC` field.
17126    pub const GIC_SHIFT: u32 = 24;
17127    /// Mask for the `GIC` field.
17128    pub const GIC_MASK: u64 = 0b1111;
17129    /// Offset of the `RAS` field.
17130    pub const RAS_SHIFT: u32 = 28;
17131    /// Mask for the `RAS` field.
17132    pub const RAS_MASK: u64 = 0b1111;
17133    /// Offset of the `SVE` field.
17134    pub const SVE_SHIFT: u32 = 32;
17135    /// Mask for the `SVE` field.
17136    pub const SVE_MASK: u64 = 0b1111;
17137    /// Offset of the `SEL2` field.
17138    pub const SEL2_SHIFT: u32 = 36;
17139    /// Mask for the `SEL2` field.
17140    pub const SEL2_MASK: u64 = 0b1111;
17141    /// Offset of the `MPAM` field.
17142    pub const MPAM_SHIFT: u32 = 40;
17143    /// Mask for the `MPAM` field.
17144    pub const MPAM_MASK: u64 = 0b1111;
17145    /// Offset of the `AMU` field.
17146    pub const AMU_SHIFT: u32 = 44;
17147    /// Mask for the `AMU` field.
17148    pub const AMU_MASK: u64 = 0b1111;
17149    /// Offset of the `DIT` field.
17150    pub const DIT_SHIFT: u32 = 48;
17151    /// Mask for the `DIT` field.
17152    pub const DIT_MASK: u64 = 0b1111;
17153    /// Offset of the `RME` field.
17154    pub const RME_SHIFT: u32 = 52;
17155    /// Mask for the `RME` field.
17156    pub const RME_MASK: u64 = 0b1111;
17157    /// Offset of the `CSV2` field.
17158    pub const CSV2_SHIFT: u32 = 56;
17159    /// Mask for the `CSV2` field.
17160    pub const CSV2_MASK: u64 = 0b1111;
17161    /// Offset of the `CSV3` field.
17162    pub const CSV3_SHIFT: u32 = 60;
17163    /// Mask for the `CSV3` field.
17164    pub const CSV3_MASK: u64 = 0b1111;
17165
17166    /// Returns the value of the `EL0` field.
17167    pub const fn el0(self) -> u8 {
17168        ((self.bits() >> Self::EL0_SHIFT) & 0b1111) as u8
17169    }
17170
17171    /// Sets the value of the `EL0` field.
17172    pub const fn set_el0(&mut self, value: u8) {
17173        let offset = Self::EL0_SHIFT;
17174        assert!(value & (Self::EL0_MASK as u8) == value);
17175        *self = Self::from_bits_retain(
17176            (self.bits() & !(Self::EL0_MASK << offset)) | ((value as u64) << offset),
17177        );
17178    }
17179
17180    /// Returns a copy with the `EL0` field set to the given value.
17181    pub const fn with_el0(mut self, value: u8) -> Self {
17182        self.set_el0(value);
17183        self
17184    }
17185
17186    /// Returns the value of the `EL1` field.
17187    pub const fn el1(self) -> u8 {
17188        ((self.bits() >> Self::EL1_SHIFT) & 0b1111) as u8
17189    }
17190
17191    /// Sets the value of the `EL1` field.
17192    pub const fn set_el1(&mut self, value: u8) {
17193        let offset = Self::EL1_SHIFT;
17194        assert!(value & (Self::EL1_MASK as u8) == value);
17195        *self = Self::from_bits_retain(
17196            (self.bits() & !(Self::EL1_MASK << offset)) | ((value as u64) << offset),
17197        );
17198    }
17199
17200    /// Returns a copy with the `EL1` field set to the given value.
17201    pub const fn with_el1(mut self, value: u8) -> Self {
17202        self.set_el1(value);
17203        self
17204    }
17205
17206    /// Returns the value of the `EL2` field.
17207    pub const fn el2(self) -> u8 {
17208        ((self.bits() >> Self::EL2_SHIFT) & 0b1111) as u8
17209    }
17210
17211    /// Sets the value of the `EL2` field.
17212    pub const fn set_el2(&mut self, value: u8) {
17213        let offset = Self::EL2_SHIFT;
17214        assert!(value & (Self::EL2_MASK as u8) == value);
17215        *self = Self::from_bits_retain(
17216            (self.bits() & !(Self::EL2_MASK << offset)) | ((value as u64) << offset),
17217        );
17218    }
17219
17220    /// Returns a copy with the `EL2` field set to the given value.
17221    pub const fn with_el2(mut self, value: u8) -> Self {
17222        self.set_el2(value);
17223        self
17224    }
17225
17226    /// Returns the value of the `EL3` field.
17227    pub const fn el3(self) -> u8 {
17228        ((self.bits() >> Self::EL3_SHIFT) & 0b1111) as u8
17229    }
17230
17231    /// Sets the value of the `EL3` field.
17232    pub const fn set_el3(&mut self, value: u8) {
17233        let offset = Self::EL3_SHIFT;
17234        assert!(value & (Self::EL3_MASK as u8) == value);
17235        *self = Self::from_bits_retain(
17236            (self.bits() & !(Self::EL3_MASK << offset)) | ((value as u64) << offset),
17237        );
17238    }
17239
17240    /// Returns a copy with the `EL3` field set to the given value.
17241    pub const fn with_el3(mut self, value: u8) -> Self {
17242        self.set_el3(value);
17243        self
17244    }
17245
17246    /// Returns the value of the `FP` field.
17247    pub const fn fp(self) -> u8 {
17248        ((self.bits() >> Self::FP_SHIFT) & 0b1111) as u8
17249    }
17250
17251    /// Sets the value of the `FP` field.
17252    pub const fn set_fp(&mut self, value: u8) {
17253        let offset = Self::FP_SHIFT;
17254        assert!(value & (Self::FP_MASK as u8) == value);
17255        *self = Self::from_bits_retain(
17256            (self.bits() & !(Self::FP_MASK << offset)) | ((value as u64) << offset),
17257        );
17258    }
17259
17260    /// Returns a copy with the `FP` field set to the given value.
17261    pub const fn with_fp(mut self, value: u8) -> Self {
17262        self.set_fp(value);
17263        self
17264    }
17265
17266    /// Returns the value of the `AdvSIMD` field.
17267    pub const fn advsimd(self) -> u8 {
17268        ((self.bits() >> Self::ADVSIMD_SHIFT) & 0b1111) as u8
17269    }
17270
17271    /// Sets the value of the `AdvSIMD` field.
17272    pub const fn set_advsimd(&mut self, value: u8) {
17273        let offset = Self::ADVSIMD_SHIFT;
17274        assert!(value & (Self::ADVSIMD_MASK as u8) == value);
17275        *self = Self::from_bits_retain(
17276            (self.bits() & !(Self::ADVSIMD_MASK << offset)) | ((value as u64) << offset),
17277        );
17278    }
17279
17280    /// Returns a copy with the `AdvSIMD` field set to the given value.
17281    pub const fn with_advsimd(mut self, value: u8) -> Self {
17282        self.set_advsimd(value);
17283        self
17284    }
17285
17286    /// Returns the value of the `GIC` field.
17287    pub const fn gic(self) -> u8 {
17288        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
17289    }
17290
17291    /// Sets the value of the `GIC` field.
17292    pub const fn set_gic(&mut self, value: u8) {
17293        let offset = Self::GIC_SHIFT;
17294        assert!(value & (Self::GIC_MASK as u8) == value);
17295        *self = Self::from_bits_retain(
17296            (self.bits() & !(Self::GIC_MASK << offset)) | ((value as u64) << offset),
17297        );
17298    }
17299
17300    /// Returns a copy with the `GIC` field set to the given value.
17301    pub const fn with_gic(mut self, value: u8) -> Self {
17302        self.set_gic(value);
17303        self
17304    }
17305
17306    /// Returns the value of the `RAS` field.
17307    pub const fn ras(self) -> u8 {
17308        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
17309    }
17310
17311    /// Sets the value of the `RAS` field.
17312    pub const fn set_ras(&mut self, value: u8) {
17313        let offset = Self::RAS_SHIFT;
17314        assert!(value & (Self::RAS_MASK as u8) == value);
17315        *self = Self::from_bits_retain(
17316            (self.bits() & !(Self::RAS_MASK << offset)) | ((value as u64) << offset),
17317        );
17318    }
17319
17320    /// Returns a copy with the `RAS` field set to the given value.
17321    pub const fn with_ras(mut self, value: u8) -> Self {
17322        self.set_ras(value);
17323        self
17324    }
17325
17326    /// Returns the value of the `SVE` field.
17327    pub const fn sve(self) -> u8 {
17328        ((self.bits() >> Self::SVE_SHIFT) & 0b1111) as u8
17329    }
17330
17331    /// Sets the value of the `SVE` field.
17332    pub const fn set_sve(&mut self, value: u8) {
17333        let offset = Self::SVE_SHIFT;
17334        assert!(value & (Self::SVE_MASK as u8) == value);
17335        *self = Self::from_bits_retain(
17336            (self.bits() & !(Self::SVE_MASK << offset)) | ((value as u64) << offset),
17337        );
17338    }
17339
17340    /// Returns a copy with the `SVE` field set to the given value.
17341    pub const fn with_sve(mut self, value: u8) -> Self {
17342        self.set_sve(value);
17343        self
17344    }
17345
17346    /// Returns the value of the `SEL2` field.
17347    pub const fn sel2(self) -> u8 {
17348        ((self.bits() >> Self::SEL2_SHIFT) & 0b1111) as u8
17349    }
17350
17351    /// Sets the value of the `SEL2` field.
17352    pub const fn set_sel2(&mut self, value: u8) {
17353        let offset = Self::SEL2_SHIFT;
17354        assert!(value & (Self::SEL2_MASK as u8) == value);
17355        *self = Self::from_bits_retain(
17356            (self.bits() & !(Self::SEL2_MASK << offset)) | ((value as u64) << offset),
17357        );
17358    }
17359
17360    /// Returns a copy with the `SEL2` field set to the given value.
17361    pub const fn with_sel2(mut self, value: u8) -> Self {
17362        self.set_sel2(value);
17363        self
17364    }
17365
17366    /// Returns the value of the `MPAM` field.
17367    pub const fn mpam(self) -> u8 {
17368        ((self.bits() >> Self::MPAM_SHIFT) & 0b1111) as u8
17369    }
17370
17371    /// Sets the value of the `MPAM` field.
17372    pub const fn set_mpam(&mut self, value: u8) {
17373        let offset = Self::MPAM_SHIFT;
17374        assert!(value & (Self::MPAM_MASK as u8) == value);
17375        *self = Self::from_bits_retain(
17376            (self.bits() & !(Self::MPAM_MASK << offset)) | ((value as u64) << offset),
17377        );
17378    }
17379
17380    /// Returns a copy with the `MPAM` field set to the given value.
17381    pub const fn with_mpam(mut self, value: u8) -> Self {
17382        self.set_mpam(value);
17383        self
17384    }
17385
17386    /// Returns the value of the `AMU` field.
17387    pub const fn amu(self) -> u8 {
17388        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
17389    }
17390
17391    /// Sets the value of the `AMU` field.
17392    pub const fn set_amu(&mut self, value: u8) {
17393        let offset = Self::AMU_SHIFT;
17394        assert!(value & (Self::AMU_MASK as u8) == value);
17395        *self = Self::from_bits_retain(
17396            (self.bits() & !(Self::AMU_MASK << offset)) | ((value as u64) << offset),
17397        );
17398    }
17399
17400    /// Returns a copy with the `AMU` field set to the given value.
17401    pub const fn with_amu(mut self, value: u8) -> Self {
17402        self.set_amu(value);
17403        self
17404    }
17405
17406    /// Returns the value of the `DIT` field.
17407    pub const fn dit(self) -> u8 {
17408        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
17409    }
17410
17411    /// Sets the value of the `DIT` field.
17412    pub const fn set_dit(&mut self, value: u8) {
17413        let offset = Self::DIT_SHIFT;
17414        assert!(value & (Self::DIT_MASK as u8) == value);
17415        *self = Self::from_bits_retain(
17416            (self.bits() & !(Self::DIT_MASK << offset)) | ((value as u64) << offset),
17417        );
17418    }
17419
17420    /// Returns a copy with the `DIT` field set to the given value.
17421    pub const fn with_dit(mut self, value: u8) -> Self {
17422        self.set_dit(value);
17423        self
17424    }
17425
17426    /// Returns the value of the `RME` field.
17427    pub const fn rme(self) -> u8 {
17428        ((self.bits() >> Self::RME_SHIFT) & 0b1111) as u8
17429    }
17430
17431    /// Sets the value of the `RME` field.
17432    pub const fn set_rme(&mut self, value: u8) {
17433        let offset = Self::RME_SHIFT;
17434        assert!(value & (Self::RME_MASK as u8) == value);
17435        *self = Self::from_bits_retain(
17436            (self.bits() & !(Self::RME_MASK << offset)) | ((value as u64) << offset),
17437        );
17438    }
17439
17440    /// Returns a copy with the `RME` field set to the given value.
17441    pub const fn with_rme(mut self, value: u8) -> Self {
17442        self.set_rme(value);
17443        self
17444    }
17445
17446    /// Returns the value of the `CSV2` field.
17447    pub const fn csv2(self) -> u8 {
17448        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
17449    }
17450
17451    /// Sets the value of the `CSV2` field.
17452    pub const fn set_csv2(&mut self, value: u8) {
17453        let offset = Self::CSV2_SHIFT;
17454        assert!(value & (Self::CSV2_MASK as u8) == value);
17455        *self = Self::from_bits_retain(
17456            (self.bits() & !(Self::CSV2_MASK << offset)) | ((value as u64) << offset),
17457        );
17458    }
17459
17460    /// Returns a copy with the `CSV2` field set to the given value.
17461    pub const fn with_csv2(mut self, value: u8) -> Self {
17462        self.set_csv2(value);
17463        self
17464    }
17465
17466    /// Returns the value of the `CSV3` field.
17467    pub const fn csv3(self) -> u8 {
17468        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
17469    }
17470
17471    /// Sets the value of the `CSV3` field.
17472    pub const fn set_csv3(&mut self, value: u8) {
17473        let offset = Self::CSV3_SHIFT;
17474        assert!(value & (Self::CSV3_MASK as u8) == value);
17475        *self = Self::from_bits_retain(
17476            (self.bits() & !(Self::CSV3_MASK << offset)) | ((value as u64) << offset),
17477        );
17478    }
17479
17480    /// Returns a copy with the `CSV3` field set to the given value.
17481    pub const fn with_csv3(mut self, value: u8) -> Self {
17482        self.set_csv3(value);
17483        self
17484    }
17485}
17486
17487#[cfg(feature = "el1")]
17488bitflags! {
17489    /// `ID_AA64PFR1_EL1` system register value.
17490    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17491    #[repr(transparent)]
17492    pub struct IdAa64pfr1El1: u64 {
17493    }
17494}
17495
17496#[cfg(feature = "el1")]
17497impl IdAa64pfr1El1 {
17498    /// Offset of the `BT` field.
17499    pub const BT_SHIFT: u32 = 0;
17500    /// Mask for the `BT` field.
17501    pub const BT_MASK: u64 = 0b1111;
17502    /// Offset of the `SSBS` field.
17503    pub const SSBS_SHIFT: u32 = 4;
17504    /// Mask for the `SSBS` field.
17505    pub const SSBS_MASK: u64 = 0b1111;
17506    /// Offset of the `MTE` field.
17507    pub const MTE_SHIFT: u32 = 8;
17508    /// Mask for the `MTE` field.
17509    pub const MTE_MASK: u64 = 0b1111;
17510    /// Offset of the `RAS_frac` field.
17511    pub const RAS_FRAC_SHIFT: u32 = 12;
17512    /// Mask for the `RAS_frac` field.
17513    pub const RAS_FRAC_MASK: u64 = 0b1111;
17514    /// Offset of the `MPAM_frac` field.
17515    pub const MPAM_FRAC_SHIFT: u32 = 16;
17516    /// Mask for the `MPAM_frac` field.
17517    pub const MPAM_FRAC_MASK: u64 = 0b1111;
17518    /// Offset of the `SME` field.
17519    pub const SME_SHIFT: u32 = 24;
17520    /// Mask for the `SME` field.
17521    pub const SME_MASK: u64 = 0b1111;
17522    /// Offset of the `RNDR_trap` field.
17523    pub const RNDR_TRAP_SHIFT: u32 = 28;
17524    /// Mask for the `RNDR_trap` field.
17525    pub const RNDR_TRAP_MASK: u64 = 0b1111;
17526    /// Offset of the `CSV2_frac` field.
17527    pub const CSV2_FRAC_SHIFT: u32 = 32;
17528    /// Mask for the `CSV2_frac` field.
17529    pub const CSV2_FRAC_MASK: u64 = 0b1111;
17530    /// Offset of the `NMI` field.
17531    pub const NMI_SHIFT: u32 = 36;
17532    /// Mask for the `NMI` field.
17533    pub const NMI_MASK: u64 = 0b1111;
17534    /// Offset of the `MTE_frac` field.
17535    pub const MTE_FRAC_SHIFT: u32 = 40;
17536    /// Mask for the `MTE_frac` field.
17537    pub const MTE_FRAC_MASK: u64 = 0b1111;
17538    /// Offset of the `GCS` field.
17539    pub const GCS_SHIFT: u32 = 44;
17540    /// Mask for the `GCS` field.
17541    pub const GCS_MASK: u64 = 0b1111;
17542    /// Offset of the `THE` field.
17543    pub const THE_SHIFT: u32 = 48;
17544    /// Mask for the `THE` field.
17545    pub const THE_MASK: u64 = 0b1111;
17546    /// Offset of the `MTEX` field.
17547    pub const MTEX_SHIFT: u32 = 52;
17548    /// Mask for the `MTEX` field.
17549    pub const MTEX_MASK: u64 = 0b1111;
17550    /// Offset of the `DF2` field.
17551    pub const DF2_SHIFT: u32 = 56;
17552    /// Mask for the `DF2` field.
17553    pub const DF2_MASK: u64 = 0b1111;
17554    /// Offset of the `PFAR` field.
17555    pub const PFAR_SHIFT: u32 = 60;
17556    /// Mask for the `PFAR` field.
17557    pub const PFAR_MASK: u64 = 0b1111;
17558
17559    /// Returns the value of the `BT` field.
17560    pub const fn bt(self) -> u8 {
17561        ((self.bits() >> Self::BT_SHIFT) & 0b1111) as u8
17562    }
17563
17564    /// Sets the value of the `BT` field.
17565    pub const fn set_bt(&mut self, value: u8) {
17566        let offset = Self::BT_SHIFT;
17567        assert!(value & (Self::BT_MASK as u8) == value);
17568        *self = Self::from_bits_retain(
17569            (self.bits() & !(Self::BT_MASK << offset)) | ((value as u64) << offset),
17570        );
17571    }
17572
17573    /// Returns a copy with the `BT` field set to the given value.
17574    pub const fn with_bt(mut self, value: u8) -> Self {
17575        self.set_bt(value);
17576        self
17577    }
17578
17579    /// Returns the value of the `SSBS` field.
17580    pub const fn ssbs(self) -> u8 {
17581        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
17582    }
17583
17584    /// Sets the value of the `SSBS` field.
17585    pub const fn set_ssbs(&mut self, value: u8) {
17586        let offset = Self::SSBS_SHIFT;
17587        assert!(value & (Self::SSBS_MASK as u8) == value);
17588        *self = Self::from_bits_retain(
17589            (self.bits() & !(Self::SSBS_MASK << offset)) | ((value as u64) << offset),
17590        );
17591    }
17592
17593    /// Returns a copy with the `SSBS` field set to the given value.
17594    pub const fn with_ssbs(mut self, value: u8) -> Self {
17595        self.set_ssbs(value);
17596        self
17597    }
17598
17599    /// Returns the value of the `MTE` field.
17600    pub const fn mte(self) -> u8 {
17601        ((self.bits() >> Self::MTE_SHIFT) & 0b1111) as u8
17602    }
17603
17604    /// Sets the value of the `MTE` field.
17605    pub const fn set_mte(&mut self, value: u8) {
17606        let offset = Self::MTE_SHIFT;
17607        assert!(value & (Self::MTE_MASK as u8) == value);
17608        *self = Self::from_bits_retain(
17609            (self.bits() & !(Self::MTE_MASK << offset)) | ((value as u64) << offset),
17610        );
17611    }
17612
17613    /// Returns a copy with the `MTE` field set to the given value.
17614    pub const fn with_mte(mut self, value: u8) -> Self {
17615        self.set_mte(value);
17616        self
17617    }
17618
17619    /// Returns the value of the `RAS_frac` field.
17620    pub const fn ras_frac(self) -> u8 {
17621        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
17622    }
17623
17624    /// Sets the value of the `RAS_frac` field.
17625    pub const fn set_ras_frac(&mut self, value: u8) {
17626        let offset = Self::RAS_FRAC_SHIFT;
17627        assert!(value & (Self::RAS_FRAC_MASK as u8) == value);
17628        *self = Self::from_bits_retain(
17629            (self.bits() & !(Self::RAS_FRAC_MASK << offset)) | ((value as u64) << offset),
17630        );
17631    }
17632
17633    /// Returns a copy with the `RAS_frac` field set to the given value.
17634    pub const fn with_ras_frac(mut self, value: u8) -> Self {
17635        self.set_ras_frac(value);
17636        self
17637    }
17638
17639    /// Returns the value of the `MPAM_frac` field.
17640    pub const fn mpam_frac(self) -> u8 {
17641        ((self.bits() >> Self::MPAM_FRAC_SHIFT) & 0b1111) as u8
17642    }
17643
17644    /// Sets the value of the `MPAM_frac` field.
17645    pub const fn set_mpam_frac(&mut self, value: u8) {
17646        let offset = Self::MPAM_FRAC_SHIFT;
17647        assert!(value & (Self::MPAM_FRAC_MASK as u8) == value);
17648        *self = Self::from_bits_retain(
17649            (self.bits() & !(Self::MPAM_FRAC_MASK << offset)) | ((value as u64) << offset),
17650        );
17651    }
17652
17653    /// Returns a copy with the `MPAM_frac` field set to the given value.
17654    pub const fn with_mpam_frac(mut self, value: u8) -> Self {
17655        self.set_mpam_frac(value);
17656        self
17657    }
17658
17659    /// Returns the value of the `SME` field.
17660    pub const fn sme(self) -> u8 {
17661        ((self.bits() >> Self::SME_SHIFT) & 0b1111) as u8
17662    }
17663
17664    /// Sets the value of the `SME` field.
17665    pub const fn set_sme(&mut self, value: u8) {
17666        let offset = Self::SME_SHIFT;
17667        assert!(value & (Self::SME_MASK as u8) == value);
17668        *self = Self::from_bits_retain(
17669            (self.bits() & !(Self::SME_MASK << offset)) | ((value as u64) << offset),
17670        );
17671    }
17672
17673    /// Returns a copy with the `SME` field set to the given value.
17674    pub const fn with_sme(mut self, value: u8) -> Self {
17675        self.set_sme(value);
17676        self
17677    }
17678
17679    /// Returns the value of the `RNDR_trap` field.
17680    pub const fn rndr_trap(self) -> u8 {
17681        ((self.bits() >> Self::RNDR_TRAP_SHIFT) & 0b1111) as u8
17682    }
17683
17684    /// Sets the value of the `RNDR_trap` field.
17685    pub const fn set_rndr_trap(&mut self, value: u8) {
17686        let offset = Self::RNDR_TRAP_SHIFT;
17687        assert!(value & (Self::RNDR_TRAP_MASK as u8) == value);
17688        *self = Self::from_bits_retain(
17689            (self.bits() & !(Self::RNDR_TRAP_MASK << offset)) | ((value as u64) << offset),
17690        );
17691    }
17692
17693    /// Returns a copy with the `RNDR_trap` field set to the given value.
17694    pub const fn with_rndr_trap(mut self, value: u8) -> Self {
17695        self.set_rndr_trap(value);
17696        self
17697    }
17698
17699    /// Returns the value of the `CSV2_frac` field.
17700    pub const fn csv2_frac(self) -> u8 {
17701        ((self.bits() >> Self::CSV2_FRAC_SHIFT) & 0b1111) as u8
17702    }
17703
17704    /// Sets the value of the `CSV2_frac` field.
17705    pub const fn set_csv2_frac(&mut self, value: u8) {
17706        let offset = Self::CSV2_FRAC_SHIFT;
17707        assert!(value & (Self::CSV2_FRAC_MASK as u8) == value);
17708        *self = Self::from_bits_retain(
17709            (self.bits() & !(Self::CSV2_FRAC_MASK << offset)) | ((value as u64) << offset),
17710        );
17711    }
17712
17713    /// Returns a copy with the `CSV2_frac` field set to the given value.
17714    pub const fn with_csv2_frac(mut self, value: u8) -> Self {
17715        self.set_csv2_frac(value);
17716        self
17717    }
17718
17719    /// Returns the value of the `NMI` field.
17720    pub const fn nmi(self) -> u8 {
17721        ((self.bits() >> Self::NMI_SHIFT) & 0b1111) as u8
17722    }
17723
17724    /// Sets the value of the `NMI` field.
17725    pub const fn set_nmi(&mut self, value: u8) {
17726        let offset = Self::NMI_SHIFT;
17727        assert!(value & (Self::NMI_MASK as u8) == value);
17728        *self = Self::from_bits_retain(
17729            (self.bits() & !(Self::NMI_MASK << offset)) | ((value as u64) << offset),
17730        );
17731    }
17732
17733    /// Returns a copy with the `NMI` field set to the given value.
17734    pub const fn with_nmi(mut self, value: u8) -> Self {
17735        self.set_nmi(value);
17736        self
17737    }
17738
17739    /// Returns the value of the `MTE_frac` field.
17740    pub const fn mte_frac(self) -> u8 {
17741        ((self.bits() >> Self::MTE_FRAC_SHIFT) & 0b1111) as u8
17742    }
17743
17744    /// Sets the value of the `MTE_frac` field.
17745    pub const fn set_mte_frac(&mut self, value: u8) {
17746        let offset = Self::MTE_FRAC_SHIFT;
17747        assert!(value & (Self::MTE_FRAC_MASK as u8) == value);
17748        *self = Self::from_bits_retain(
17749            (self.bits() & !(Self::MTE_FRAC_MASK << offset)) | ((value as u64) << offset),
17750        );
17751    }
17752
17753    /// Returns a copy with the `MTE_frac` field set to the given value.
17754    pub const fn with_mte_frac(mut self, value: u8) -> Self {
17755        self.set_mte_frac(value);
17756        self
17757    }
17758
17759    /// Returns the value of the `GCS` field.
17760    pub const fn gcs(self) -> u8 {
17761        ((self.bits() >> Self::GCS_SHIFT) & 0b1111) as u8
17762    }
17763
17764    /// Sets the value of the `GCS` field.
17765    pub const fn set_gcs(&mut self, value: u8) {
17766        let offset = Self::GCS_SHIFT;
17767        assert!(value & (Self::GCS_MASK as u8) == value);
17768        *self = Self::from_bits_retain(
17769            (self.bits() & !(Self::GCS_MASK << offset)) | ((value as u64) << offset),
17770        );
17771    }
17772
17773    /// Returns a copy with the `GCS` field set to the given value.
17774    pub const fn with_gcs(mut self, value: u8) -> Self {
17775        self.set_gcs(value);
17776        self
17777    }
17778
17779    /// Returns the value of the `THE` field.
17780    pub const fn the(self) -> u8 {
17781        ((self.bits() >> Self::THE_SHIFT) & 0b1111) as u8
17782    }
17783
17784    /// Sets the value of the `THE` field.
17785    pub const fn set_the(&mut self, value: u8) {
17786        let offset = Self::THE_SHIFT;
17787        assert!(value & (Self::THE_MASK as u8) == value);
17788        *self = Self::from_bits_retain(
17789            (self.bits() & !(Self::THE_MASK << offset)) | ((value as u64) << offset),
17790        );
17791    }
17792
17793    /// Returns a copy with the `THE` field set to the given value.
17794    pub const fn with_the(mut self, value: u8) -> Self {
17795        self.set_the(value);
17796        self
17797    }
17798
17799    /// Returns the value of the `MTEX` field.
17800    pub const fn mtex(self) -> u8 {
17801        ((self.bits() >> Self::MTEX_SHIFT) & 0b1111) as u8
17802    }
17803
17804    /// Sets the value of the `MTEX` field.
17805    pub const fn set_mtex(&mut self, value: u8) {
17806        let offset = Self::MTEX_SHIFT;
17807        assert!(value & (Self::MTEX_MASK as u8) == value);
17808        *self = Self::from_bits_retain(
17809            (self.bits() & !(Self::MTEX_MASK << offset)) | ((value as u64) << offset),
17810        );
17811    }
17812
17813    /// Returns a copy with the `MTEX` field set to the given value.
17814    pub const fn with_mtex(mut self, value: u8) -> Self {
17815        self.set_mtex(value);
17816        self
17817    }
17818
17819    /// Returns the value of the `DF2` field.
17820    pub const fn df2(self) -> u8 {
17821        ((self.bits() >> Self::DF2_SHIFT) & 0b1111) as u8
17822    }
17823
17824    /// Sets the value of the `DF2` field.
17825    pub const fn set_df2(&mut self, value: u8) {
17826        let offset = Self::DF2_SHIFT;
17827        assert!(value & (Self::DF2_MASK as u8) == value);
17828        *self = Self::from_bits_retain(
17829            (self.bits() & !(Self::DF2_MASK << offset)) | ((value as u64) << offset),
17830        );
17831    }
17832
17833    /// Returns a copy with the `DF2` field set to the given value.
17834    pub const fn with_df2(mut self, value: u8) -> Self {
17835        self.set_df2(value);
17836        self
17837    }
17838
17839    /// Returns the value of the `PFAR` field.
17840    pub const fn pfar(self) -> u8 {
17841        ((self.bits() >> Self::PFAR_SHIFT) & 0b1111) as u8
17842    }
17843
17844    /// Sets the value of the `PFAR` field.
17845    pub const fn set_pfar(&mut self, value: u8) {
17846        let offset = Self::PFAR_SHIFT;
17847        assert!(value & (Self::PFAR_MASK as u8) == value);
17848        *self = Self::from_bits_retain(
17849            (self.bits() & !(Self::PFAR_MASK << offset)) | ((value as u64) << offset),
17850        );
17851    }
17852
17853    /// Returns a copy with the `PFAR` field set to the given value.
17854    pub const fn with_pfar(mut self, value: u8) -> Self {
17855        self.set_pfar(value);
17856        self
17857    }
17858}
17859
17860#[cfg(feature = "el1")]
17861bitflags! {
17862    /// `ID_AA64SMFR0_EL1` system register value.
17863    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17864    #[repr(transparent)]
17865    pub struct IdAa64smfr0El1: u64 {
17866        /// `SMOP4` bit.
17867        const SMOP4 = 1 << 0;
17868        /// `STMOP` bit.
17869        const STMOP = 1 << 16;
17870        /// `SFEXPA` bit.
17871        const SFEXPA = 1 << 23;
17872        /// `AES` bit.
17873        const AES = 1 << 24;
17874        /// `SBitPerm` bit.
17875        const SBITPERM = 1 << 25;
17876        /// `SF8DP2` bit.
17877        const SF8DP2 = 1 << 28;
17878        /// `SF8DP4` bit.
17879        const SF8DP4 = 1 << 29;
17880        /// `SF8FMA` bit.
17881        const SF8FMA = 1 << 30;
17882        /// `F32F32` bit.
17883        const F32F32 = 1 << 32;
17884        /// `BI32I32` bit.
17885        const BI32I32 = 1 << 33;
17886        /// `B16F32` bit.
17887        const B16F32 = 1 << 34;
17888        /// `F16F32` bit.
17889        const F16F32 = 1 << 35;
17890        /// `F8F32` bit.
17891        const F8F32 = 1 << 40;
17892        /// `F8F16` bit.
17893        const F8F16 = 1 << 41;
17894        /// `F16F16` bit.
17895        const F16F16 = 1 << 42;
17896        /// `B16B16` bit.
17897        const B16B16 = 1 << 43;
17898        /// `F64F64` bit.
17899        const F64F64 = 1 << 48;
17900        /// `LUTv2` bit.
17901        const LUTV2 = 1 << 60;
17902        /// `LUT6` bit.
17903        const LUT6 = 1 << 61;
17904        /// `FA64` bit.
17905        const FA64 = 1 << 63;
17906    }
17907}
17908
17909#[cfg(feature = "el1")]
17910impl IdAa64smfr0El1 {
17911    /// Offset of the `SMOP4` field.
17912    pub const SMOP4_SHIFT: u32 = 0;
17913    /// Offset of the `STMOP` field.
17914    pub const STMOP_SHIFT: u32 = 16;
17915    /// Offset of the `SFEXPA` field.
17916    pub const SFEXPA_SHIFT: u32 = 23;
17917    /// Offset of the `AES` field.
17918    pub const AES_SHIFT: u32 = 24;
17919    /// Offset of the `SBitPerm` field.
17920    pub const SBITPERM_SHIFT: u32 = 25;
17921    /// Offset of the `SF8DP2` field.
17922    pub const SF8DP2_SHIFT: u32 = 28;
17923    /// Offset of the `SF8DP4` field.
17924    pub const SF8DP4_SHIFT: u32 = 29;
17925    /// Offset of the `SF8FMA` field.
17926    pub const SF8FMA_SHIFT: u32 = 30;
17927    /// Offset of the `F32F32` field.
17928    pub const F32F32_SHIFT: u32 = 32;
17929    /// Offset of the `BI32I32` field.
17930    pub const BI32I32_SHIFT: u32 = 33;
17931    /// Offset of the `B16F32` field.
17932    pub const B16F32_SHIFT: u32 = 34;
17933    /// Offset of the `F16F32` field.
17934    pub const F16F32_SHIFT: u32 = 35;
17935    /// Offset of the `I8I32` field.
17936    pub const I8I32_SHIFT: u32 = 36;
17937    /// Mask for the `I8I32` field.
17938    pub const I8I32_MASK: u64 = 0b1111;
17939    /// Offset of the `F8F32` field.
17940    pub const F8F32_SHIFT: u32 = 40;
17941    /// Offset of the `F8F16` field.
17942    pub const F8F16_SHIFT: u32 = 41;
17943    /// Offset of the `F16F16` field.
17944    pub const F16F16_SHIFT: u32 = 42;
17945    /// Offset of the `B16B16` field.
17946    pub const B16B16_SHIFT: u32 = 43;
17947    /// Offset of the `I16I32` field.
17948    pub const I16I32_SHIFT: u32 = 44;
17949    /// Mask for the `I16I32` field.
17950    pub const I16I32_MASK: u64 = 0b1111;
17951    /// Offset of the `F64F64` field.
17952    pub const F64F64_SHIFT: u32 = 48;
17953    /// Offset of the `I16I64` field.
17954    pub const I16I64_SHIFT: u32 = 52;
17955    /// Mask for the `I16I64` field.
17956    pub const I16I64_MASK: u64 = 0b1111;
17957    /// Offset of the `SMEver` field.
17958    pub const SMEVER_SHIFT: u32 = 56;
17959    /// Mask for the `SMEver` field.
17960    pub const SMEVER_MASK: u64 = 0b1111;
17961    /// Offset of the `LUTv2` field.
17962    pub const LUTV2_SHIFT: u32 = 60;
17963    /// Offset of the `LUT6` field.
17964    pub const LUT6_SHIFT: u32 = 61;
17965    /// Offset of the `FA64` field.
17966    pub const FA64_SHIFT: u32 = 63;
17967
17968    /// Returns the value of the `I8I32` field.
17969    pub const fn i8i32(self) -> u8 {
17970        ((self.bits() >> Self::I8I32_SHIFT) & 0b1111) as u8
17971    }
17972
17973    /// Sets the value of the `I8I32` field.
17974    pub const fn set_i8i32(&mut self, value: u8) {
17975        let offset = Self::I8I32_SHIFT;
17976        assert!(value & (Self::I8I32_MASK as u8) == value);
17977        *self = Self::from_bits_retain(
17978            (self.bits() & !(Self::I8I32_MASK << offset)) | ((value as u64) << offset),
17979        );
17980    }
17981
17982    /// Returns a copy with the `I8I32` field set to the given value.
17983    pub const fn with_i8i32(mut self, value: u8) -> Self {
17984        self.set_i8i32(value);
17985        self
17986    }
17987
17988    /// Returns the value of the `I16I32` field.
17989    pub const fn i16i32(self) -> u8 {
17990        ((self.bits() >> Self::I16I32_SHIFT) & 0b1111) as u8
17991    }
17992
17993    /// Sets the value of the `I16I32` field.
17994    pub const fn set_i16i32(&mut self, value: u8) {
17995        let offset = Self::I16I32_SHIFT;
17996        assert!(value & (Self::I16I32_MASK as u8) == value);
17997        *self = Self::from_bits_retain(
17998            (self.bits() & !(Self::I16I32_MASK << offset)) | ((value as u64) << offset),
17999        );
18000    }
18001
18002    /// Returns a copy with the `I16I32` field set to the given value.
18003    pub const fn with_i16i32(mut self, value: u8) -> Self {
18004        self.set_i16i32(value);
18005        self
18006    }
18007
18008    /// Returns the value of the `I16I64` field.
18009    pub const fn i16i64(self) -> u8 {
18010        ((self.bits() >> Self::I16I64_SHIFT) & 0b1111) as u8
18011    }
18012
18013    /// Sets the value of the `I16I64` field.
18014    pub const fn set_i16i64(&mut self, value: u8) {
18015        let offset = Self::I16I64_SHIFT;
18016        assert!(value & (Self::I16I64_MASK as u8) == value);
18017        *self = Self::from_bits_retain(
18018            (self.bits() & !(Self::I16I64_MASK << offset)) | ((value as u64) << offset),
18019        );
18020    }
18021
18022    /// Returns a copy with the `I16I64` field set to the given value.
18023    pub const fn with_i16i64(mut self, value: u8) -> Self {
18024        self.set_i16i64(value);
18025        self
18026    }
18027
18028    /// Returns the value of the `SMEver` field.
18029    pub const fn smever(self) -> u8 {
18030        ((self.bits() >> Self::SMEVER_SHIFT) & 0b1111) as u8
18031    }
18032
18033    /// Sets the value of the `SMEver` field.
18034    pub const fn set_smever(&mut self, value: u8) {
18035        let offset = Self::SMEVER_SHIFT;
18036        assert!(value & (Self::SMEVER_MASK as u8) == value);
18037        *self = Self::from_bits_retain(
18038            (self.bits() & !(Self::SMEVER_MASK << offset)) | ((value as u64) << offset),
18039        );
18040    }
18041
18042    /// Returns a copy with the `SMEver` field set to the given value.
18043    pub const fn with_smever(mut self, value: u8) -> Self {
18044        self.set_smever(value);
18045        self
18046    }
18047}
18048
18049bitflags! {
18050    /// `ID_DFR0` system register value.
18051    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18052    #[repr(transparent)]
18053    pub struct IdDfr0: u32 {
18054    }
18055}
18056
18057impl IdDfr0 {
18058    /// Offset of the `CopDbg` field.
18059    pub const COPDBG_SHIFT: u32 = 0;
18060    /// Mask for the `CopDbg` field.
18061    pub const COPDBG_MASK: u32 = 0b1111;
18062    /// Offset of the `CopSDbg` field.
18063    pub const COPSDBG_SHIFT: u32 = 4;
18064    /// Mask for the `CopSDbg` field.
18065    pub const COPSDBG_MASK: u32 = 0b1111;
18066    /// Offset of the `MMapDbg` field.
18067    pub const MMAPDBG_SHIFT: u32 = 8;
18068    /// Mask for the `MMapDbg` field.
18069    pub const MMAPDBG_MASK: u32 = 0b1111;
18070    /// Offset of the `CopTrc` field.
18071    pub const COPTRC_SHIFT: u32 = 12;
18072    /// Mask for the `CopTrc` field.
18073    pub const COPTRC_MASK: u32 = 0b1111;
18074    /// Offset of the `MMapTrc` field.
18075    pub const MMAPTRC_SHIFT: u32 = 16;
18076    /// Mask for the `MMapTrc` field.
18077    pub const MMAPTRC_MASK: u32 = 0b1111;
18078    /// Offset of the `MProfDbg` field.
18079    pub const MPROFDBG_SHIFT: u32 = 20;
18080    /// Mask for the `MProfDbg` field.
18081    pub const MPROFDBG_MASK: u32 = 0b1111;
18082    /// Offset of the `PerfMon` field.
18083    pub const PERFMON_SHIFT: u32 = 24;
18084    /// Mask for the `PerfMon` field.
18085    pub const PERFMON_MASK: u32 = 0b1111;
18086    /// Offset of the `TraceFilt` field.
18087    pub const TRACEFILT_SHIFT: u32 = 28;
18088    /// Mask for the `TraceFilt` field.
18089    pub const TRACEFILT_MASK: u32 = 0b1111;
18090
18091    /// Returns the value of the `CopDbg` field.
18092    pub const fn copdbg(self) -> u8 {
18093        ((self.bits() >> Self::COPDBG_SHIFT) & 0b1111) as u8
18094    }
18095
18096    /// Sets the value of the `CopDbg` field.
18097    pub const fn set_copdbg(&mut self, value: u8) {
18098        let offset = Self::COPDBG_SHIFT;
18099        assert!(value & (Self::COPDBG_MASK as u8) == value);
18100        *self = Self::from_bits_retain(
18101            (self.bits() & !(Self::COPDBG_MASK << offset)) | ((value as u32) << offset),
18102        );
18103    }
18104
18105    /// Returns a copy with the `CopDbg` field set to the given value.
18106    pub const fn with_copdbg(mut self, value: u8) -> Self {
18107        self.set_copdbg(value);
18108        self
18109    }
18110
18111    /// Returns the value of the `CopSDbg` field.
18112    pub const fn copsdbg(self) -> u8 {
18113        ((self.bits() >> Self::COPSDBG_SHIFT) & 0b1111) as u8
18114    }
18115
18116    /// Sets the value of the `CopSDbg` field.
18117    pub const fn set_copsdbg(&mut self, value: u8) {
18118        let offset = Self::COPSDBG_SHIFT;
18119        assert!(value & (Self::COPSDBG_MASK as u8) == value);
18120        *self = Self::from_bits_retain(
18121            (self.bits() & !(Self::COPSDBG_MASK << offset)) | ((value as u32) << offset),
18122        );
18123    }
18124
18125    /// Returns a copy with the `CopSDbg` field set to the given value.
18126    pub const fn with_copsdbg(mut self, value: u8) -> Self {
18127        self.set_copsdbg(value);
18128        self
18129    }
18130
18131    /// Returns the value of the `MMapDbg` field.
18132    pub const fn mmapdbg(self) -> u8 {
18133        ((self.bits() >> Self::MMAPDBG_SHIFT) & 0b1111) as u8
18134    }
18135
18136    /// Sets the value of the `MMapDbg` field.
18137    pub const fn set_mmapdbg(&mut self, value: u8) {
18138        let offset = Self::MMAPDBG_SHIFT;
18139        assert!(value & (Self::MMAPDBG_MASK as u8) == value);
18140        *self = Self::from_bits_retain(
18141            (self.bits() & !(Self::MMAPDBG_MASK << offset)) | ((value as u32) << offset),
18142        );
18143    }
18144
18145    /// Returns a copy with the `MMapDbg` field set to the given value.
18146    pub const fn with_mmapdbg(mut self, value: u8) -> Self {
18147        self.set_mmapdbg(value);
18148        self
18149    }
18150
18151    /// Returns the value of the `CopTrc` field.
18152    pub const fn coptrc(self) -> u8 {
18153        ((self.bits() >> Self::COPTRC_SHIFT) & 0b1111) as u8
18154    }
18155
18156    /// Sets the value of the `CopTrc` field.
18157    pub const fn set_coptrc(&mut self, value: u8) {
18158        let offset = Self::COPTRC_SHIFT;
18159        assert!(value & (Self::COPTRC_MASK as u8) == value);
18160        *self = Self::from_bits_retain(
18161            (self.bits() & !(Self::COPTRC_MASK << offset)) | ((value as u32) << offset),
18162        );
18163    }
18164
18165    /// Returns a copy with the `CopTrc` field set to the given value.
18166    pub const fn with_coptrc(mut self, value: u8) -> Self {
18167        self.set_coptrc(value);
18168        self
18169    }
18170
18171    /// Returns the value of the `MMapTrc` field.
18172    pub const fn mmaptrc(self) -> u8 {
18173        ((self.bits() >> Self::MMAPTRC_SHIFT) & 0b1111) as u8
18174    }
18175
18176    /// Sets the value of the `MMapTrc` field.
18177    pub const fn set_mmaptrc(&mut self, value: u8) {
18178        let offset = Self::MMAPTRC_SHIFT;
18179        assert!(value & (Self::MMAPTRC_MASK as u8) == value);
18180        *self = Self::from_bits_retain(
18181            (self.bits() & !(Self::MMAPTRC_MASK << offset)) | ((value as u32) << offset),
18182        );
18183    }
18184
18185    /// Returns a copy with the `MMapTrc` field set to the given value.
18186    pub const fn with_mmaptrc(mut self, value: u8) -> Self {
18187        self.set_mmaptrc(value);
18188        self
18189    }
18190
18191    /// Returns the value of the `MProfDbg` field.
18192    pub const fn mprofdbg(self) -> u8 {
18193        ((self.bits() >> Self::MPROFDBG_SHIFT) & 0b1111) as u8
18194    }
18195
18196    /// Sets the value of the `MProfDbg` field.
18197    pub const fn set_mprofdbg(&mut self, value: u8) {
18198        let offset = Self::MPROFDBG_SHIFT;
18199        assert!(value & (Self::MPROFDBG_MASK as u8) == value);
18200        *self = Self::from_bits_retain(
18201            (self.bits() & !(Self::MPROFDBG_MASK << offset)) | ((value as u32) << offset),
18202        );
18203    }
18204
18205    /// Returns a copy with the `MProfDbg` field set to the given value.
18206    pub const fn with_mprofdbg(mut self, value: u8) -> Self {
18207        self.set_mprofdbg(value);
18208        self
18209    }
18210
18211    /// Returns the value of the `PerfMon` field.
18212    pub const fn perfmon(self) -> u8 {
18213        ((self.bits() >> Self::PERFMON_SHIFT) & 0b1111) as u8
18214    }
18215
18216    /// Sets the value of the `PerfMon` field.
18217    pub const fn set_perfmon(&mut self, value: u8) {
18218        let offset = Self::PERFMON_SHIFT;
18219        assert!(value & (Self::PERFMON_MASK as u8) == value);
18220        *self = Self::from_bits_retain(
18221            (self.bits() & !(Self::PERFMON_MASK << offset)) | ((value as u32) << offset),
18222        );
18223    }
18224
18225    /// Returns a copy with the `PerfMon` field set to the given value.
18226    pub const fn with_perfmon(mut self, value: u8) -> Self {
18227        self.set_perfmon(value);
18228        self
18229    }
18230
18231    /// Returns the value of the `TraceFilt` field.
18232    pub const fn tracefilt(self) -> u8 {
18233        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
18234    }
18235
18236    /// Sets the value of the `TraceFilt` field.
18237    pub const fn set_tracefilt(&mut self, value: u8) {
18238        let offset = Self::TRACEFILT_SHIFT;
18239        assert!(value & (Self::TRACEFILT_MASK as u8) == value);
18240        *self = Self::from_bits_retain(
18241            (self.bits() & !(Self::TRACEFILT_MASK << offset)) | ((value as u32) << offset),
18242        );
18243    }
18244
18245    /// Returns a copy with the `TraceFilt` field set to the given value.
18246    pub const fn with_tracefilt(mut self, value: u8) -> Self {
18247        self.set_tracefilt(value);
18248        self
18249    }
18250}
18251
18252bitflags! {
18253    /// `ID_DFR1` system register value.
18254    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18255    #[repr(transparent)]
18256    pub struct IdDfr1: u32 {
18257    }
18258}
18259
18260impl IdDfr1 {
18261    /// Offset of the `MTPMU` field.
18262    pub const MTPMU_SHIFT: u32 = 0;
18263    /// Mask for the `MTPMU` field.
18264    pub const MTPMU_MASK: u32 = 0b1111;
18265    /// Offset of the `HPMN0` field.
18266    pub const HPMN0_SHIFT: u32 = 4;
18267    /// Mask for the `HPMN0` field.
18268    pub const HPMN0_MASK: u32 = 0b1111;
18269
18270    /// Returns the value of the `MTPMU` field.
18271    pub const fn mtpmu(self) -> u8 {
18272        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
18273    }
18274
18275    /// Sets the value of the `MTPMU` field.
18276    pub const fn set_mtpmu(&mut self, value: u8) {
18277        let offset = Self::MTPMU_SHIFT;
18278        assert!(value & (Self::MTPMU_MASK as u8) == value);
18279        *self = Self::from_bits_retain(
18280            (self.bits() & !(Self::MTPMU_MASK << offset)) | ((value as u32) << offset),
18281        );
18282    }
18283
18284    /// Returns a copy with the `MTPMU` field set to the given value.
18285    pub const fn with_mtpmu(mut self, value: u8) -> Self {
18286        self.set_mtpmu(value);
18287        self
18288    }
18289
18290    /// Returns the value of the `HPMN0` field.
18291    pub const fn hpmn0(self) -> u8 {
18292        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
18293    }
18294
18295    /// Sets the value of the `HPMN0` field.
18296    pub const fn set_hpmn0(&mut self, value: u8) {
18297        let offset = Self::HPMN0_SHIFT;
18298        assert!(value & (Self::HPMN0_MASK as u8) == value);
18299        *self = Self::from_bits_retain(
18300            (self.bits() & !(Self::HPMN0_MASK << offset)) | ((value as u32) << offset),
18301        );
18302    }
18303
18304    /// Returns a copy with the `HPMN0` field set to the given value.
18305    pub const fn with_hpmn0(mut self, value: u8) -> Self {
18306        self.set_hpmn0(value);
18307        self
18308    }
18309}
18310
18311bitflags! {
18312    /// `ID_ISAR0` system register value.
18313    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18314    #[repr(transparent)]
18315    pub struct IdIsar0: u32 {
18316    }
18317}
18318
18319impl IdIsar0 {
18320    /// Offset of the `Swap` field.
18321    pub const SWAP_SHIFT: u32 = 0;
18322    /// Mask for the `Swap` field.
18323    pub const SWAP_MASK: u32 = 0b1111;
18324    /// Offset of the `BitCount` field.
18325    pub const BITCOUNT_SHIFT: u32 = 4;
18326    /// Mask for the `BitCount` field.
18327    pub const BITCOUNT_MASK: u32 = 0b1111;
18328    /// Offset of the `BitField` field.
18329    pub const BITFIELD_SHIFT: u32 = 8;
18330    /// Mask for the `BitField` field.
18331    pub const BITFIELD_MASK: u32 = 0b1111;
18332    /// Offset of the `CmpBranch` field.
18333    pub const CMPBRANCH_SHIFT: u32 = 12;
18334    /// Mask for the `CmpBranch` field.
18335    pub const CMPBRANCH_MASK: u32 = 0b1111;
18336    /// Offset of the `Coproc` field.
18337    pub const COPROC_SHIFT: u32 = 16;
18338    /// Mask for the `Coproc` field.
18339    pub const COPROC_MASK: u32 = 0b1111;
18340    /// Offset of the `Debug` field.
18341    pub const DEBUG_SHIFT: u32 = 20;
18342    /// Mask for the `Debug` field.
18343    pub const DEBUG_MASK: u32 = 0b1111;
18344    /// Offset of the `Divide` field.
18345    pub const DIVIDE_SHIFT: u32 = 24;
18346    /// Mask for the `Divide` field.
18347    pub const DIVIDE_MASK: u32 = 0b1111;
18348
18349    /// Returns the value of the `Swap` field.
18350    pub const fn swap(self) -> u8 {
18351        ((self.bits() >> Self::SWAP_SHIFT) & 0b1111) as u8
18352    }
18353
18354    /// Sets the value of the `Swap` field.
18355    pub const fn set_swap(&mut self, value: u8) {
18356        let offset = Self::SWAP_SHIFT;
18357        assert!(value & (Self::SWAP_MASK as u8) == value);
18358        *self = Self::from_bits_retain(
18359            (self.bits() & !(Self::SWAP_MASK << offset)) | ((value as u32) << offset),
18360        );
18361    }
18362
18363    /// Returns a copy with the `Swap` field set to the given value.
18364    pub const fn with_swap(mut self, value: u8) -> Self {
18365        self.set_swap(value);
18366        self
18367    }
18368
18369    /// Returns the value of the `BitCount` field.
18370    pub const fn bitcount(self) -> u8 {
18371        ((self.bits() >> Self::BITCOUNT_SHIFT) & 0b1111) as u8
18372    }
18373
18374    /// Sets the value of the `BitCount` field.
18375    pub const fn set_bitcount(&mut self, value: u8) {
18376        let offset = Self::BITCOUNT_SHIFT;
18377        assert!(value & (Self::BITCOUNT_MASK as u8) == value);
18378        *self = Self::from_bits_retain(
18379            (self.bits() & !(Self::BITCOUNT_MASK << offset)) | ((value as u32) << offset),
18380        );
18381    }
18382
18383    /// Returns a copy with the `BitCount` field set to the given value.
18384    pub const fn with_bitcount(mut self, value: u8) -> Self {
18385        self.set_bitcount(value);
18386        self
18387    }
18388
18389    /// Returns the value of the `BitField` field.
18390    pub const fn bitfield(self) -> u8 {
18391        ((self.bits() >> Self::BITFIELD_SHIFT) & 0b1111) as u8
18392    }
18393
18394    /// Sets the value of the `BitField` field.
18395    pub const fn set_bitfield(&mut self, value: u8) {
18396        let offset = Self::BITFIELD_SHIFT;
18397        assert!(value & (Self::BITFIELD_MASK as u8) == value);
18398        *self = Self::from_bits_retain(
18399            (self.bits() & !(Self::BITFIELD_MASK << offset)) | ((value as u32) << offset),
18400        );
18401    }
18402
18403    /// Returns a copy with the `BitField` field set to the given value.
18404    pub const fn with_bitfield(mut self, value: u8) -> Self {
18405        self.set_bitfield(value);
18406        self
18407    }
18408
18409    /// Returns the value of the `CmpBranch` field.
18410    pub const fn cmpbranch(self) -> u8 {
18411        ((self.bits() >> Self::CMPBRANCH_SHIFT) & 0b1111) as u8
18412    }
18413
18414    /// Sets the value of the `CmpBranch` field.
18415    pub const fn set_cmpbranch(&mut self, value: u8) {
18416        let offset = Self::CMPBRANCH_SHIFT;
18417        assert!(value & (Self::CMPBRANCH_MASK as u8) == value);
18418        *self = Self::from_bits_retain(
18419            (self.bits() & !(Self::CMPBRANCH_MASK << offset)) | ((value as u32) << offset),
18420        );
18421    }
18422
18423    /// Returns a copy with the `CmpBranch` field set to the given value.
18424    pub const fn with_cmpbranch(mut self, value: u8) -> Self {
18425        self.set_cmpbranch(value);
18426        self
18427    }
18428
18429    /// Returns the value of the `Coproc` field.
18430    pub const fn coproc(self) -> u8 {
18431        ((self.bits() >> Self::COPROC_SHIFT) & 0b1111) as u8
18432    }
18433
18434    /// Sets the value of the `Coproc` field.
18435    pub const fn set_coproc(&mut self, value: u8) {
18436        let offset = Self::COPROC_SHIFT;
18437        assert!(value & (Self::COPROC_MASK as u8) == value);
18438        *self = Self::from_bits_retain(
18439            (self.bits() & !(Self::COPROC_MASK << offset)) | ((value as u32) << offset),
18440        );
18441    }
18442
18443    /// Returns a copy with the `Coproc` field set to the given value.
18444    pub const fn with_coproc(mut self, value: u8) -> Self {
18445        self.set_coproc(value);
18446        self
18447    }
18448
18449    /// Returns the value of the `Debug` field.
18450    pub const fn debug(self) -> u8 {
18451        ((self.bits() >> Self::DEBUG_SHIFT) & 0b1111) as u8
18452    }
18453
18454    /// Sets the value of the `Debug` field.
18455    pub const fn set_debug(&mut self, value: u8) {
18456        let offset = Self::DEBUG_SHIFT;
18457        assert!(value & (Self::DEBUG_MASK as u8) == value);
18458        *self = Self::from_bits_retain(
18459            (self.bits() & !(Self::DEBUG_MASK << offset)) | ((value as u32) << offset),
18460        );
18461    }
18462
18463    /// Returns a copy with the `Debug` field set to the given value.
18464    pub const fn with_debug(mut self, value: u8) -> Self {
18465        self.set_debug(value);
18466        self
18467    }
18468
18469    /// Returns the value of the `Divide` field.
18470    pub const fn divide(self) -> u8 {
18471        ((self.bits() >> Self::DIVIDE_SHIFT) & 0b1111) as u8
18472    }
18473
18474    /// Sets the value of the `Divide` field.
18475    pub const fn set_divide(&mut self, value: u8) {
18476        let offset = Self::DIVIDE_SHIFT;
18477        assert!(value & (Self::DIVIDE_MASK as u8) == value);
18478        *self = Self::from_bits_retain(
18479            (self.bits() & !(Self::DIVIDE_MASK << offset)) | ((value as u32) << offset),
18480        );
18481    }
18482
18483    /// Returns a copy with the `Divide` field set to the given value.
18484    pub const fn with_divide(mut self, value: u8) -> Self {
18485        self.set_divide(value);
18486        self
18487    }
18488}
18489
18490bitflags! {
18491    /// `ID_ISAR1` system register value.
18492    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18493    #[repr(transparent)]
18494    pub struct IdIsar1: u32 {
18495    }
18496}
18497
18498impl IdIsar1 {
18499    /// Offset of the `Endian` field.
18500    pub const ENDIAN_SHIFT: u32 = 0;
18501    /// Mask for the `Endian` field.
18502    pub const ENDIAN_MASK: u32 = 0b1111;
18503    /// Offset of the `Except` field.
18504    pub const EXCEPT_SHIFT: u32 = 4;
18505    /// Mask for the `Except` field.
18506    pub const EXCEPT_MASK: u32 = 0b1111;
18507    /// Offset of the `Except_AR` field.
18508    pub const EXCEPT_AR_SHIFT: u32 = 8;
18509    /// Mask for the `Except_AR` field.
18510    pub const EXCEPT_AR_MASK: u32 = 0b1111;
18511    /// Offset of the `Extend` field.
18512    pub const EXTEND_SHIFT: u32 = 12;
18513    /// Mask for the `Extend` field.
18514    pub const EXTEND_MASK: u32 = 0b1111;
18515    /// Offset of the `IfThen` field.
18516    pub const IFTHEN_SHIFT: u32 = 16;
18517    /// Mask for the `IfThen` field.
18518    pub const IFTHEN_MASK: u32 = 0b1111;
18519    /// Offset of the `Immediate` field.
18520    pub const IMMEDIATE_SHIFT: u32 = 20;
18521    /// Mask for the `Immediate` field.
18522    pub const IMMEDIATE_MASK: u32 = 0b1111;
18523    /// Offset of the `Interwork` field.
18524    pub const INTERWORK_SHIFT: u32 = 24;
18525    /// Mask for the `Interwork` field.
18526    pub const INTERWORK_MASK: u32 = 0b1111;
18527    /// Offset of the `Jazelle` field.
18528    pub const JAZELLE_SHIFT: u32 = 28;
18529    /// Mask for the `Jazelle` field.
18530    pub const JAZELLE_MASK: u32 = 0b1111;
18531
18532    /// Returns the value of the `Endian` field.
18533    pub const fn endian(self) -> u8 {
18534        ((self.bits() >> Self::ENDIAN_SHIFT) & 0b1111) as u8
18535    }
18536
18537    /// Sets the value of the `Endian` field.
18538    pub const fn set_endian(&mut self, value: u8) {
18539        let offset = Self::ENDIAN_SHIFT;
18540        assert!(value & (Self::ENDIAN_MASK as u8) == value);
18541        *self = Self::from_bits_retain(
18542            (self.bits() & !(Self::ENDIAN_MASK << offset)) | ((value as u32) << offset),
18543        );
18544    }
18545
18546    /// Returns a copy with the `Endian` field set to the given value.
18547    pub const fn with_endian(mut self, value: u8) -> Self {
18548        self.set_endian(value);
18549        self
18550    }
18551
18552    /// Returns the value of the `Except` field.
18553    pub const fn except(self) -> u8 {
18554        ((self.bits() >> Self::EXCEPT_SHIFT) & 0b1111) as u8
18555    }
18556
18557    /// Sets the value of the `Except` field.
18558    pub const fn set_except(&mut self, value: u8) {
18559        let offset = Self::EXCEPT_SHIFT;
18560        assert!(value & (Self::EXCEPT_MASK as u8) == value);
18561        *self = Self::from_bits_retain(
18562            (self.bits() & !(Self::EXCEPT_MASK << offset)) | ((value as u32) << offset),
18563        );
18564    }
18565
18566    /// Returns a copy with the `Except` field set to the given value.
18567    pub const fn with_except(mut self, value: u8) -> Self {
18568        self.set_except(value);
18569        self
18570    }
18571
18572    /// Returns the value of the `Except_AR` field.
18573    pub const fn except_ar(self) -> u8 {
18574        ((self.bits() >> Self::EXCEPT_AR_SHIFT) & 0b1111) as u8
18575    }
18576
18577    /// Sets the value of the `Except_AR` field.
18578    pub const fn set_except_ar(&mut self, value: u8) {
18579        let offset = Self::EXCEPT_AR_SHIFT;
18580        assert!(value & (Self::EXCEPT_AR_MASK as u8) == value);
18581        *self = Self::from_bits_retain(
18582            (self.bits() & !(Self::EXCEPT_AR_MASK << offset)) | ((value as u32) << offset),
18583        );
18584    }
18585
18586    /// Returns a copy with the `Except_AR` field set to the given value.
18587    pub const fn with_except_ar(mut self, value: u8) -> Self {
18588        self.set_except_ar(value);
18589        self
18590    }
18591
18592    /// Returns the value of the `Extend` field.
18593    pub const fn extend_(self) -> u8 {
18594        ((self.bits() >> Self::EXTEND_SHIFT) & 0b1111) as u8
18595    }
18596
18597    /// Sets the value of the `Extend` field.
18598    pub const fn set_extend_(&mut self, value: u8) {
18599        let offset = Self::EXTEND_SHIFT;
18600        assert!(value & (Self::EXTEND_MASK as u8) == value);
18601        *self = Self::from_bits_retain(
18602            (self.bits() & !(Self::EXTEND_MASK << offset)) | ((value as u32) << offset),
18603        );
18604    }
18605
18606    /// Returns a copy with the `Extend` field set to the given value.
18607    pub const fn with_extend_(mut self, value: u8) -> Self {
18608        self.set_extend_(value);
18609        self
18610    }
18611
18612    /// Returns the value of the `IfThen` field.
18613    pub const fn ifthen(self) -> u8 {
18614        ((self.bits() >> Self::IFTHEN_SHIFT) & 0b1111) as u8
18615    }
18616
18617    /// Sets the value of the `IfThen` field.
18618    pub const fn set_ifthen(&mut self, value: u8) {
18619        let offset = Self::IFTHEN_SHIFT;
18620        assert!(value & (Self::IFTHEN_MASK as u8) == value);
18621        *self = Self::from_bits_retain(
18622            (self.bits() & !(Self::IFTHEN_MASK << offset)) | ((value as u32) << offset),
18623        );
18624    }
18625
18626    /// Returns a copy with the `IfThen` field set to the given value.
18627    pub const fn with_ifthen(mut self, value: u8) -> Self {
18628        self.set_ifthen(value);
18629        self
18630    }
18631
18632    /// Returns the value of the `Immediate` field.
18633    pub const fn immediate(self) -> u8 {
18634        ((self.bits() >> Self::IMMEDIATE_SHIFT) & 0b1111) as u8
18635    }
18636
18637    /// Sets the value of the `Immediate` field.
18638    pub const fn set_immediate(&mut self, value: u8) {
18639        let offset = Self::IMMEDIATE_SHIFT;
18640        assert!(value & (Self::IMMEDIATE_MASK as u8) == value);
18641        *self = Self::from_bits_retain(
18642            (self.bits() & !(Self::IMMEDIATE_MASK << offset)) | ((value as u32) << offset),
18643        );
18644    }
18645
18646    /// Returns a copy with the `Immediate` field set to the given value.
18647    pub const fn with_immediate(mut self, value: u8) -> Self {
18648        self.set_immediate(value);
18649        self
18650    }
18651
18652    /// Returns the value of the `Interwork` field.
18653    pub const fn interwork(self) -> u8 {
18654        ((self.bits() >> Self::INTERWORK_SHIFT) & 0b1111) as u8
18655    }
18656
18657    /// Sets the value of the `Interwork` field.
18658    pub const fn set_interwork(&mut self, value: u8) {
18659        let offset = Self::INTERWORK_SHIFT;
18660        assert!(value & (Self::INTERWORK_MASK as u8) == value);
18661        *self = Self::from_bits_retain(
18662            (self.bits() & !(Self::INTERWORK_MASK << offset)) | ((value as u32) << offset),
18663        );
18664    }
18665
18666    /// Returns a copy with the `Interwork` field set to the given value.
18667    pub const fn with_interwork(mut self, value: u8) -> Self {
18668        self.set_interwork(value);
18669        self
18670    }
18671
18672    /// Returns the value of the `Jazelle` field.
18673    pub const fn jazelle(self) -> u8 {
18674        ((self.bits() >> Self::JAZELLE_SHIFT) & 0b1111) as u8
18675    }
18676
18677    /// Sets the value of the `Jazelle` field.
18678    pub const fn set_jazelle(&mut self, value: u8) {
18679        let offset = Self::JAZELLE_SHIFT;
18680        assert!(value & (Self::JAZELLE_MASK as u8) == value);
18681        *self = Self::from_bits_retain(
18682            (self.bits() & !(Self::JAZELLE_MASK << offset)) | ((value as u32) << offset),
18683        );
18684    }
18685
18686    /// Returns a copy with the `Jazelle` field set to the given value.
18687    pub const fn with_jazelle(mut self, value: u8) -> Self {
18688        self.set_jazelle(value);
18689        self
18690    }
18691}
18692
18693bitflags! {
18694    /// `ID_ISAR2` system register value.
18695    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18696    #[repr(transparent)]
18697    pub struct IdIsar2: u32 {
18698    }
18699}
18700
18701impl IdIsar2 {
18702    /// Offset of the `LoadStore` field.
18703    pub const LOADSTORE_SHIFT: u32 = 0;
18704    /// Mask for the `LoadStore` field.
18705    pub const LOADSTORE_MASK: u32 = 0b1111;
18706    /// Offset of the `MemHint` field.
18707    pub const MEMHINT_SHIFT: u32 = 4;
18708    /// Mask for the `MemHint` field.
18709    pub const MEMHINT_MASK: u32 = 0b1111;
18710    /// Offset of the `MultiAccessInt` field.
18711    pub const MULTIACCESSINT_SHIFT: u32 = 8;
18712    /// Mask for the `MultiAccessInt` field.
18713    pub const MULTIACCESSINT_MASK: u32 = 0b1111;
18714    /// Offset of the `Mult` field.
18715    pub const MULT_SHIFT: u32 = 12;
18716    /// Mask for the `Mult` field.
18717    pub const MULT_MASK: u32 = 0b1111;
18718    /// Offset of the `MultS` field.
18719    pub const MULTS_SHIFT: u32 = 16;
18720    /// Mask for the `MultS` field.
18721    pub const MULTS_MASK: u32 = 0b1111;
18722    /// Offset of the `MultU` field.
18723    pub const MULTU_SHIFT: u32 = 20;
18724    /// Mask for the `MultU` field.
18725    pub const MULTU_MASK: u32 = 0b1111;
18726    /// Offset of the `PSR_AR` field.
18727    pub const PSR_AR_SHIFT: u32 = 24;
18728    /// Mask for the `PSR_AR` field.
18729    pub const PSR_AR_MASK: u32 = 0b1111;
18730    /// Offset of the `Reversal` field.
18731    pub const REVERSAL_SHIFT: u32 = 28;
18732    /// Mask for the `Reversal` field.
18733    pub const REVERSAL_MASK: u32 = 0b1111;
18734
18735    /// Returns the value of the `LoadStore` field.
18736    pub const fn loadstore(self) -> u8 {
18737        ((self.bits() >> Self::LOADSTORE_SHIFT) & 0b1111) as u8
18738    }
18739
18740    /// Sets the value of the `LoadStore` field.
18741    pub const fn set_loadstore(&mut self, value: u8) {
18742        let offset = Self::LOADSTORE_SHIFT;
18743        assert!(value & (Self::LOADSTORE_MASK as u8) == value);
18744        *self = Self::from_bits_retain(
18745            (self.bits() & !(Self::LOADSTORE_MASK << offset)) | ((value as u32) << offset),
18746        );
18747    }
18748
18749    /// Returns a copy with the `LoadStore` field set to the given value.
18750    pub const fn with_loadstore(mut self, value: u8) -> Self {
18751        self.set_loadstore(value);
18752        self
18753    }
18754
18755    /// Returns the value of the `MemHint` field.
18756    pub const fn memhint(self) -> u8 {
18757        ((self.bits() >> Self::MEMHINT_SHIFT) & 0b1111) as u8
18758    }
18759
18760    /// Sets the value of the `MemHint` field.
18761    pub const fn set_memhint(&mut self, value: u8) {
18762        let offset = Self::MEMHINT_SHIFT;
18763        assert!(value & (Self::MEMHINT_MASK as u8) == value);
18764        *self = Self::from_bits_retain(
18765            (self.bits() & !(Self::MEMHINT_MASK << offset)) | ((value as u32) << offset),
18766        );
18767    }
18768
18769    /// Returns a copy with the `MemHint` field set to the given value.
18770    pub const fn with_memhint(mut self, value: u8) -> Self {
18771        self.set_memhint(value);
18772        self
18773    }
18774
18775    /// Returns the value of the `MultiAccessInt` field.
18776    pub const fn multiaccessint(self) -> u8 {
18777        ((self.bits() >> Self::MULTIACCESSINT_SHIFT) & 0b1111) as u8
18778    }
18779
18780    /// Sets the value of the `MultiAccessInt` field.
18781    pub const fn set_multiaccessint(&mut self, value: u8) {
18782        let offset = Self::MULTIACCESSINT_SHIFT;
18783        assert!(value & (Self::MULTIACCESSINT_MASK as u8) == value);
18784        *self = Self::from_bits_retain(
18785            (self.bits() & !(Self::MULTIACCESSINT_MASK << offset)) | ((value as u32) << offset),
18786        );
18787    }
18788
18789    /// Returns a copy with the `MultiAccessInt` field set to the given value.
18790    pub const fn with_multiaccessint(mut self, value: u8) -> Self {
18791        self.set_multiaccessint(value);
18792        self
18793    }
18794
18795    /// Returns the value of the `Mult` field.
18796    pub const fn mult(self) -> u8 {
18797        ((self.bits() >> Self::MULT_SHIFT) & 0b1111) as u8
18798    }
18799
18800    /// Sets the value of the `Mult` field.
18801    pub const fn set_mult(&mut self, value: u8) {
18802        let offset = Self::MULT_SHIFT;
18803        assert!(value & (Self::MULT_MASK as u8) == value);
18804        *self = Self::from_bits_retain(
18805            (self.bits() & !(Self::MULT_MASK << offset)) | ((value as u32) << offset),
18806        );
18807    }
18808
18809    /// Returns a copy with the `Mult` field set to the given value.
18810    pub const fn with_mult(mut self, value: u8) -> Self {
18811        self.set_mult(value);
18812        self
18813    }
18814
18815    /// Returns the value of the `MultS` field.
18816    pub const fn mults(self) -> u8 {
18817        ((self.bits() >> Self::MULTS_SHIFT) & 0b1111) as u8
18818    }
18819
18820    /// Sets the value of the `MultS` field.
18821    pub const fn set_mults(&mut self, value: u8) {
18822        let offset = Self::MULTS_SHIFT;
18823        assert!(value & (Self::MULTS_MASK as u8) == value);
18824        *self = Self::from_bits_retain(
18825            (self.bits() & !(Self::MULTS_MASK << offset)) | ((value as u32) << offset),
18826        );
18827    }
18828
18829    /// Returns a copy with the `MultS` field set to the given value.
18830    pub const fn with_mults(mut self, value: u8) -> Self {
18831        self.set_mults(value);
18832        self
18833    }
18834
18835    /// Returns the value of the `MultU` field.
18836    pub const fn multu(self) -> u8 {
18837        ((self.bits() >> Self::MULTU_SHIFT) & 0b1111) as u8
18838    }
18839
18840    /// Sets the value of the `MultU` field.
18841    pub const fn set_multu(&mut self, value: u8) {
18842        let offset = Self::MULTU_SHIFT;
18843        assert!(value & (Self::MULTU_MASK as u8) == value);
18844        *self = Self::from_bits_retain(
18845            (self.bits() & !(Self::MULTU_MASK << offset)) | ((value as u32) << offset),
18846        );
18847    }
18848
18849    /// Returns a copy with the `MultU` field set to the given value.
18850    pub const fn with_multu(mut self, value: u8) -> Self {
18851        self.set_multu(value);
18852        self
18853    }
18854
18855    /// Returns the value of the `PSR_AR` field.
18856    pub const fn psr_ar(self) -> u8 {
18857        ((self.bits() >> Self::PSR_AR_SHIFT) & 0b1111) as u8
18858    }
18859
18860    /// Sets the value of the `PSR_AR` field.
18861    pub const fn set_psr_ar(&mut self, value: u8) {
18862        let offset = Self::PSR_AR_SHIFT;
18863        assert!(value & (Self::PSR_AR_MASK as u8) == value);
18864        *self = Self::from_bits_retain(
18865            (self.bits() & !(Self::PSR_AR_MASK << offset)) | ((value as u32) << offset),
18866        );
18867    }
18868
18869    /// Returns a copy with the `PSR_AR` field set to the given value.
18870    pub const fn with_psr_ar(mut self, value: u8) -> Self {
18871        self.set_psr_ar(value);
18872        self
18873    }
18874
18875    /// Returns the value of the `Reversal` field.
18876    pub const fn reversal(self) -> u8 {
18877        ((self.bits() >> Self::REVERSAL_SHIFT) & 0b1111) as u8
18878    }
18879
18880    /// Sets the value of the `Reversal` field.
18881    pub const fn set_reversal(&mut self, value: u8) {
18882        let offset = Self::REVERSAL_SHIFT;
18883        assert!(value & (Self::REVERSAL_MASK as u8) == value);
18884        *self = Self::from_bits_retain(
18885            (self.bits() & !(Self::REVERSAL_MASK << offset)) | ((value as u32) << offset),
18886        );
18887    }
18888
18889    /// Returns a copy with the `Reversal` field set to the given value.
18890    pub const fn with_reversal(mut self, value: u8) -> Self {
18891        self.set_reversal(value);
18892        self
18893    }
18894}
18895
18896bitflags! {
18897    /// `ID_ISAR3` system register value.
18898    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18899    #[repr(transparent)]
18900    pub struct IdIsar3: u32 {
18901    }
18902}
18903
18904impl IdIsar3 {
18905    /// Offset of the `Saturate` field.
18906    pub const SATURATE_SHIFT: u32 = 0;
18907    /// Mask for the `Saturate` field.
18908    pub const SATURATE_MASK: u32 = 0b1111;
18909    /// Offset of the `SIMD` field.
18910    pub const SIMD_SHIFT: u32 = 4;
18911    /// Mask for the `SIMD` field.
18912    pub const SIMD_MASK: u32 = 0b1111;
18913    /// Offset of the `SVC` field.
18914    pub const SVC_SHIFT: u32 = 8;
18915    /// Mask for the `SVC` field.
18916    pub const SVC_MASK: u32 = 0b1111;
18917    /// Offset of the `SynchPrim` field.
18918    pub const SYNCHPRIM_SHIFT: u32 = 12;
18919    /// Mask for the `SynchPrim` field.
18920    pub const SYNCHPRIM_MASK: u32 = 0b1111;
18921    /// Offset of the `TabBranch` field.
18922    pub const TABBRANCH_SHIFT: u32 = 16;
18923    /// Mask for the `TabBranch` field.
18924    pub const TABBRANCH_MASK: u32 = 0b1111;
18925    /// Offset of the `T32Copy` field.
18926    pub const T32COPY_SHIFT: u32 = 20;
18927    /// Mask for the `T32Copy` field.
18928    pub const T32COPY_MASK: u32 = 0b1111;
18929    /// Offset of the `TrueNOP` field.
18930    pub const TRUENOP_SHIFT: u32 = 24;
18931    /// Mask for the `TrueNOP` field.
18932    pub const TRUENOP_MASK: u32 = 0b1111;
18933    /// Offset of the `T32EE` field.
18934    pub const T32EE_SHIFT: u32 = 28;
18935    /// Mask for the `T32EE` field.
18936    pub const T32EE_MASK: u32 = 0b1111;
18937
18938    /// Returns the value of the `Saturate` field.
18939    pub const fn saturate(self) -> u8 {
18940        ((self.bits() >> Self::SATURATE_SHIFT) & 0b1111) as u8
18941    }
18942
18943    /// Sets the value of the `Saturate` field.
18944    pub const fn set_saturate(&mut self, value: u8) {
18945        let offset = Self::SATURATE_SHIFT;
18946        assert!(value & (Self::SATURATE_MASK as u8) == value);
18947        *self = Self::from_bits_retain(
18948            (self.bits() & !(Self::SATURATE_MASK << offset)) | ((value as u32) << offset),
18949        );
18950    }
18951
18952    /// Returns a copy with the `Saturate` field set to the given value.
18953    pub const fn with_saturate(mut self, value: u8) -> Self {
18954        self.set_saturate(value);
18955        self
18956    }
18957
18958    /// Returns the value of the `SIMD` field.
18959    pub const fn simd(self) -> u8 {
18960        ((self.bits() >> Self::SIMD_SHIFT) & 0b1111) as u8
18961    }
18962
18963    /// Sets the value of the `SIMD` field.
18964    pub const fn set_simd(&mut self, value: u8) {
18965        let offset = Self::SIMD_SHIFT;
18966        assert!(value & (Self::SIMD_MASK as u8) == value);
18967        *self = Self::from_bits_retain(
18968            (self.bits() & !(Self::SIMD_MASK << offset)) | ((value as u32) << offset),
18969        );
18970    }
18971
18972    /// Returns a copy with the `SIMD` field set to the given value.
18973    pub const fn with_simd(mut self, value: u8) -> Self {
18974        self.set_simd(value);
18975        self
18976    }
18977
18978    /// Returns the value of the `SVC` field.
18979    pub const fn svc(self) -> u8 {
18980        ((self.bits() >> Self::SVC_SHIFT) & 0b1111) as u8
18981    }
18982
18983    /// Sets the value of the `SVC` field.
18984    pub const fn set_svc(&mut self, value: u8) {
18985        let offset = Self::SVC_SHIFT;
18986        assert!(value & (Self::SVC_MASK as u8) == value);
18987        *self = Self::from_bits_retain(
18988            (self.bits() & !(Self::SVC_MASK << offset)) | ((value as u32) << offset),
18989        );
18990    }
18991
18992    /// Returns a copy with the `SVC` field set to the given value.
18993    pub const fn with_svc(mut self, value: u8) -> Self {
18994        self.set_svc(value);
18995        self
18996    }
18997
18998    /// Returns the value of the `SynchPrim` field.
18999    pub const fn synchprim(self) -> u8 {
19000        ((self.bits() >> Self::SYNCHPRIM_SHIFT) & 0b1111) as u8
19001    }
19002
19003    /// Sets the value of the `SynchPrim` field.
19004    pub const fn set_synchprim(&mut self, value: u8) {
19005        let offset = Self::SYNCHPRIM_SHIFT;
19006        assert!(value & (Self::SYNCHPRIM_MASK as u8) == value);
19007        *self = Self::from_bits_retain(
19008            (self.bits() & !(Self::SYNCHPRIM_MASK << offset)) | ((value as u32) << offset),
19009        );
19010    }
19011
19012    /// Returns a copy with the `SynchPrim` field set to the given value.
19013    pub const fn with_synchprim(mut self, value: u8) -> Self {
19014        self.set_synchprim(value);
19015        self
19016    }
19017
19018    /// Returns the value of the `TabBranch` field.
19019    pub const fn tabbranch(self) -> u8 {
19020        ((self.bits() >> Self::TABBRANCH_SHIFT) & 0b1111) as u8
19021    }
19022
19023    /// Sets the value of the `TabBranch` field.
19024    pub const fn set_tabbranch(&mut self, value: u8) {
19025        let offset = Self::TABBRANCH_SHIFT;
19026        assert!(value & (Self::TABBRANCH_MASK as u8) == value);
19027        *self = Self::from_bits_retain(
19028            (self.bits() & !(Self::TABBRANCH_MASK << offset)) | ((value as u32) << offset),
19029        );
19030    }
19031
19032    /// Returns a copy with the `TabBranch` field set to the given value.
19033    pub const fn with_tabbranch(mut self, value: u8) -> Self {
19034        self.set_tabbranch(value);
19035        self
19036    }
19037
19038    /// Returns the value of the `T32Copy` field.
19039    pub const fn t32copy(self) -> u8 {
19040        ((self.bits() >> Self::T32COPY_SHIFT) & 0b1111) as u8
19041    }
19042
19043    /// Sets the value of the `T32Copy` field.
19044    pub const fn set_t32copy(&mut self, value: u8) {
19045        let offset = Self::T32COPY_SHIFT;
19046        assert!(value & (Self::T32COPY_MASK as u8) == value);
19047        *self = Self::from_bits_retain(
19048            (self.bits() & !(Self::T32COPY_MASK << offset)) | ((value as u32) << offset),
19049        );
19050    }
19051
19052    /// Returns a copy with the `T32Copy` field set to the given value.
19053    pub const fn with_t32copy(mut self, value: u8) -> Self {
19054        self.set_t32copy(value);
19055        self
19056    }
19057
19058    /// Returns the value of the `TrueNOP` field.
19059    pub const fn truenop(self) -> u8 {
19060        ((self.bits() >> Self::TRUENOP_SHIFT) & 0b1111) as u8
19061    }
19062
19063    /// Sets the value of the `TrueNOP` field.
19064    pub const fn set_truenop(&mut self, value: u8) {
19065        let offset = Self::TRUENOP_SHIFT;
19066        assert!(value & (Self::TRUENOP_MASK as u8) == value);
19067        *self = Self::from_bits_retain(
19068            (self.bits() & !(Self::TRUENOP_MASK << offset)) | ((value as u32) << offset),
19069        );
19070    }
19071
19072    /// Returns a copy with the `TrueNOP` field set to the given value.
19073    pub const fn with_truenop(mut self, value: u8) -> Self {
19074        self.set_truenop(value);
19075        self
19076    }
19077
19078    /// Returns the value of the `T32EE` field.
19079    pub const fn t32ee(self) -> u8 {
19080        ((self.bits() >> Self::T32EE_SHIFT) & 0b1111) as u8
19081    }
19082
19083    /// Sets the value of the `T32EE` field.
19084    pub const fn set_t32ee(&mut self, value: u8) {
19085        let offset = Self::T32EE_SHIFT;
19086        assert!(value & (Self::T32EE_MASK as u8) == value);
19087        *self = Self::from_bits_retain(
19088            (self.bits() & !(Self::T32EE_MASK << offset)) | ((value as u32) << offset),
19089        );
19090    }
19091
19092    /// Returns a copy with the `T32EE` field set to the given value.
19093    pub const fn with_t32ee(mut self, value: u8) -> Self {
19094        self.set_t32ee(value);
19095        self
19096    }
19097}
19098
19099bitflags! {
19100    /// `ID_ISAR4` system register value.
19101    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19102    #[repr(transparent)]
19103    pub struct IdIsar4: u32 {
19104    }
19105}
19106
19107impl IdIsar4 {
19108    /// Offset of the `Unpriv` field.
19109    pub const UNPRIV_SHIFT: u32 = 0;
19110    /// Mask for the `Unpriv` field.
19111    pub const UNPRIV_MASK: u32 = 0b1111;
19112    /// Offset of the `WithShifts` field.
19113    pub const WITHSHIFTS_SHIFT: u32 = 4;
19114    /// Mask for the `WithShifts` field.
19115    pub const WITHSHIFTS_MASK: u32 = 0b1111;
19116    /// Offset of the `Writeback` field.
19117    pub const WRITEBACK_SHIFT: u32 = 8;
19118    /// Mask for the `Writeback` field.
19119    pub const WRITEBACK_MASK: u32 = 0b1111;
19120    /// Offset of the `SMC` field.
19121    pub const SMC_SHIFT: u32 = 12;
19122    /// Mask for the `SMC` field.
19123    pub const SMC_MASK: u32 = 0b1111;
19124    /// Offset of the `Barrier` field.
19125    pub const BARRIER_SHIFT: u32 = 16;
19126    /// Mask for the `Barrier` field.
19127    pub const BARRIER_MASK: u32 = 0b1111;
19128    /// Offset of the `SynchPrim_frac` field.
19129    pub const SYNCHPRIM_FRAC_SHIFT: u32 = 20;
19130    /// Mask for the `SynchPrim_frac` field.
19131    pub const SYNCHPRIM_FRAC_MASK: u32 = 0b1111;
19132    /// Offset of the `PSR_M` field.
19133    pub const PSR_M_SHIFT: u32 = 24;
19134    /// Mask for the `PSR_M` field.
19135    pub const PSR_M_MASK: u32 = 0b1111;
19136    /// Offset of the `SWP_frac` field.
19137    pub const SWP_FRAC_SHIFT: u32 = 28;
19138    /// Mask for the `SWP_frac` field.
19139    pub const SWP_FRAC_MASK: u32 = 0b1111;
19140
19141    /// Returns the value of the `Unpriv` field.
19142    pub const fn unpriv(self) -> u8 {
19143        ((self.bits() >> Self::UNPRIV_SHIFT) & 0b1111) as u8
19144    }
19145
19146    /// Sets the value of the `Unpriv` field.
19147    pub const fn set_unpriv(&mut self, value: u8) {
19148        let offset = Self::UNPRIV_SHIFT;
19149        assert!(value & (Self::UNPRIV_MASK as u8) == value);
19150        *self = Self::from_bits_retain(
19151            (self.bits() & !(Self::UNPRIV_MASK << offset)) | ((value as u32) << offset),
19152        );
19153    }
19154
19155    /// Returns a copy with the `Unpriv` field set to the given value.
19156    pub const fn with_unpriv(mut self, value: u8) -> Self {
19157        self.set_unpriv(value);
19158        self
19159    }
19160
19161    /// Returns the value of the `WithShifts` field.
19162    pub const fn withshifts(self) -> u8 {
19163        ((self.bits() >> Self::WITHSHIFTS_SHIFT) & 0b1111) as u8
19164    }
19165
19166    /// Sets the value of the `WithShifts` field.
19167    pub const fn set_withshifts(&mut self, value: u8) {
19168        let offset = Self::WITHSHIFTS_SHIFT;
19169        assert!(value & (Self::WITHSHIFTS_MASK as u8) == value);
19170        *self = Self::from_bits_retain(
19171            (self.bits() & !(Self::WITHSHIFTS_MASK << offset)) | ((value as u32) << offset),
19172        );
19173    }
19174
19175    /// Returns a copy with the `WithShifts` field set to the given value.
19176    pub const fn with_withshifts(mut self, value: u8) -> Self {
19177        self.set_withshifts(value);
19178        self
19179    }
19180
19181    /// Returns the value of the `Writeback` field.
19182    pub const fn writeback(self) -> u8 {
19183        ((self.bits() >> Self::WRITEBACK_SHIFT) & 0b1111) as u8
19184    }
19185
19186    /// Sets the value of the `Writeback` field.
19187    pub const fn set_writeback(&mut self, value: u8) {
19188        let offset = Self::WRITEBACK_SHIFT;
19189        assert!(value & (Self::WRITEBACK_MASK as u8) == value);
19190        *self = Self::from_bits_retain(
19191            (self.bits() & !(Self::WRITEBACK_MASK << offset)) | ((value as u32) << offset),
19192        );
19193    }
19194
19195    /// Returns a copy with the `Writeback` field set to the given value.
19196    pub const fn with_writeback(mut self, value: u8) -> Self {
19197        self.set_writeback(value);
19198        self
19199    }
19200
19201    /// Returns the value of the `SMC` field.
19202    pub const fn smc(self) -> u8 {
19203        ((self.bits() >> Self::SMC_SHIFT) & 0b1111) as u8
19204    }
19205
19206    /// Sets the value of the `SMC` field.
19207    pub const fn set_smc(&mut self, value: u8) {
19208        let offset = Self::SMC_SHIFT;
19209        assert!(value & (Self::SMC_MASK as u8) == value);
19210        *self = Self::from_bits_retain(
19211            (self.bits() & !(Self::SMC_MASK << offset)) | ((value as u32) << offset),
19212        );
19213    }
19214
19215    /// Returns a copy with the `SMC` field set to the given value.
19216    pub const fn with_smc(mut self, value: u8) -> Self {
19217        self.set_smc(value);
19218        self
19219    }
19220
19221    /// Returns the value of the `Barrier` field.
19222    pub const fn barrier(self) -> u8 {
19223        ((self.bits() >> Self::BARRIER_SHIFT) & 0b1111) as u8
19224    }
19225
19226    /// Sets the value of the `Barrier` field.
19227    pub const fn set_barrier(&mut self, value: u8) {
19228        let offset = Self::BARRIER_SHIFT;
19229        assert!(value & (Self::BARRIER_MASK as u8) == value);
19230        *self = Self::from_bits_retain(
19231            (self.bits() & !(Self::BARRIER_MASK << offset)) | ((value as u32) << offset),
19232        );
19233    }
19234
19235    /// Returns a copy with the `Barrier` field set to the given value.
19236    pub const fn with_barrier(mut self, value: u8) -> Self {
19237        self.set_barrier(value);
19238        self
19239    }
19240
19241    /// Returns the value of the `SynchPrim_frac` field.
19242    pub const fn synchprim_frac(self) -> u8 {
19243        ((self.bits() >> Self::SYNCHPRIM_FRAC_SHIFT) & 0b1111) as u8
19244    }
19245
19246    /// Sets the value of the `SynchPrim_frac` field.
19247    pub const fn set_synchprim_frac(&mut self, value: u8) {
19248        let offset = Self::SYNCHPRIM_FRAC_SHIFT;
19249        assert!(value & (Self::SYNCHPRIM_FRAC_MASK as u8) == value);
19250        *self = Self::from_bits_retain(
19251            (self.bits() & !(Self::SYNCHPRIM_FRAC_MASK << offset)) | ((value as u32) << offset),
19252        );
19253    }
19254
19255    /// Returns a copy with the `SynchPrim_frac` field set to the given value.
19256    pub const fn with_synchprim_frac(mut self, value: u8) -> Self {
19257        self.set_synchprim_frac(value);
19258        self
19259    }
19260
19261    /// Returns the value of the `PSR_M` field.
19262    pub const fn psr_m(self) -> u8 {
19263        ((self.bits() >> Self::PSR_M_SHIFT) & 0b1111) as u8
19264    }
19265
19266    /// Sets the value of the `PSR_M` field.
19267    pub const fn set_psr_m(&mut self, value: u8) {
19268        let offset = Self::PSR_M_SHIFT;
19269        assert!(value & (Self::PSR_M_MASK as u8) == value);
19270        *self = Self::from_bits_retain(
19271            (self.bits() & !(Self::PSR_M_MASK << offset)) | ((value as u32) << offset),
19272        );
19273    }
19274
19275    /// Returns a copy with the `PSR_M` field set to the given value.
19276    pub const fn with_psr_m(mut self, value: u8) -> Self {
19277        self.set_psr_m(value);
19278        self
19279    }
19280
19281    /// Returns the value of the `SWP_frac` field.
19282    pub const fn swp_frac(self) -> u8 {
19283        ((self.bits() >> Self::SWP_FRAC_SHIFT) & 0b1111) as u8
19284    }
19285
19286    /// Sets the value of the `SWP_frac` field.
19287    pub const fn set_swp_frac(&mut self, value: u8) {
19288        let offset = Self::SWP_FRAC_SHIFT;
19289        assert!(value & (Self::SWP_FRAC_MASK as u8) == value);
19290        *self = Self::from_bits_retain(
19291            (self.bits() & !(Self::SWP_FRAC_MASK << offset)) | ((value as u32) << offset),
19292        );
19293    }
19294
19295    /// Returns a copy with the `SWP_frac` field set to the given value.
19296    pub const fn with_swp_frac(mut self, value: u8) -> Self {
19297        self.set_swp_frac(value);
19298        self
19299    }
19300}
19301
19302bitflags! {
19303    /// `ID_ISAR5` system register value.
19304    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19305    #[repr(transparent)]
19306    pub struct IdIsar5: u32 {
19307    }
19308}
19309
19310impl IdIsar5 {
19311    /// Offset of the `SEVL` field.
19312    pub const SEVL_SHIFT: u32 = 0;
19313    /// Mask for the `SEVL` field.
19314    pub const SEVL_MASK: u32 = 0b1111;
19315    /// Offset of the `AES` field.
19316    pub const AES_SHIFT: u32 = 4;
19317    /// Mask for the `AES` field.
19318    pub const AES_MASK: u32 = 0b1111;
19319    /// Offset of the `SHA1` field.
19320    pub const SHA1_SHIFT: u32 = 8;
19321    /// Mask for the `SHA1` field.
19322    pub const SHA1_MASK: u32 = 0b1111;
19323    /// Offset of the `SHA2` field.
19324    pub const SHA2_SHIFT: u32 = 12;
19325    /// Mask for the `SHA2` field.
19326    pub const SHA2_MASK: u32 = 0b1111;
19327    /// Offset of the `CRC32` field.
19328    pub const CRC32_SHIFT: u32 = 16;
19329    /// Mask for the `CRC32` field.
19330    pub const CRC32_MASK: u32 = 0b1111;
19331    /// Offset of the `RDM` field.
19332    pub const RDM_SHIFT: u32 = 24;
19333    /// Mask for the `RDM` field.
19334    pub const RDM_MASK: u32 = 0b1111;
19335    /// Offset of the `VCMA` field.
19336    pub const VCMA_SHIFT: u32 = 28;
19337    /// Mask for the `VCMA` field.
19338    pub const VCMA_MASK: u32 = 0b1111;
19339
19340    /// Returns the value of the `SEVL` field.
19341    pub const fn sevl(self) -> u8 {
19342        ((self.bits() >> Self::SEVL_SHIFT) & 0b1111) as u8
19343    }
19344
19345    /// Sets the value of the `SEVL` field.
19346    pub const fn set_sevl(&mut self, value: u8) {
19347        let offset = Self::SEVL_SHIFT;
19348        assert!(value & (Self::SEVL_MASK as u8) == value);
19349        *self = Self::from_bits_retain(
19350            (self.bits() & !(Self::SEVL_MASK << offset)) | ((value as u32) << offset),
19351        );
19352    }
19353
19354    /// Returns a copy with the `SEVL` field set to the given value.
19355    pub const fn with_sevl(mut self, value: u8) -> Self {
19356        self.set_sevl(value);
19357        self
19358    }
19359
19360    /// Returns the value of the `AES` field.
19361    pub const fn aes(self) -> u8 {
19362        ((self.bits() >> Self::AES_SHIFT) & 0b1111) as u8
19363    }
19364
19365    /// Sets the value of the `AES` field.
19366    pub const fn set_aes(&mut self, value: u8) {
19367        let offset = Self::AES_SHIFT;
19368        assert!(value & (Self::AES_MASK as u8) == value);
19369        *self = Self::from_bits_retain(
19370            (self.bits() & !(Self::AES_MASK << offset)) | ((value as u32) << offset),
19371        );
19372    }
19373
19374    /// Returns a copy with the `AES` field set to the given value.
19375    pub const fn with_aes(mut self, value: u8) -> Self {
19376        self.set_aes(value);
19377        self
19378    }
19379
19380    /// Returns the value of the `SHA1` field.
19381    pub const fn sha1(self) -> u8 {
19382        ((self.bits() >> Self::SHA1_SHIFT) & 0b1111) as u8
19383    }
19384
19385    /// Sets the value of the `SHA1` field.
19386    pub const fn set_sha1(&mut self, value: u8) {
19387        let offset = Self::SHA1_SHIFT;
19388        assert!(value & (Self::SHA1_MASK as u8) == value);
19389        *self = Self::from_bits_retain(
19390            (self.bits() & !(Self::SHA1_MASK << offset)) | ((value as u32) << offset),
19391        );
19392    }
19393
19394    /// Returns a copy with the `SHA1` field set to the given value.
19395    pub const fn with_sha1(mut self, value: u8) -> Self {
19396        self.set_sha1(value);
19397        self
19398    }
19399
19400    /// Returns the value of the `SHA2` field.
19401    pub const fn sha2(self) -> u8 {
19402        ((self.bits() >> Self::SHA2_SHIFT) & 0b1111) as u8
19403    }
19404
19405    /// Sets the value of the `SHA2` field.
19406    pub const fn set_sha2(&mut self, value: u8) {
19407        let offset = Self::SHA2_SHIFT;
19408        assert!(value & (Self::SHA2_MASK as u8) == value);
19409        *self = Self::from_bits_retain(
19410            (self.bits() & !(Self::SHA2_MASK << offset)) | ((value as u32) << offset),
19411        );
19412    }
19413
19414    /// Returns a copy with the `SHA2` field set to the given value.
19415    pub const fn with_sha2(mut self, value: u8) -> Self {
19416        self.set_sha2(value);
19417        self
19418    }
19419
19420    /// Returns the value of the `CRC32` field.
19421    pub const fn crc32(self) -> u8 {
19422        ((self.bits() >> Self::CRC32_SHIFT) & 0b1111) as u8
19423    }
19424
19425    /// Sets the value of the `CRC32` field.
19426    pub const fn set_crc32(&mut self, value: u8) {
19427        let offset = Self::CRC32_SHIFT;
19428        assert!(value & (Self::CRC32_MASK as u8) == value);
19429        *self = Self::from_bits_retain(
19430            (self.bits() & !(Self::CRC32_MASK << offset)) | ((value as u32) << offset),
19431        );
19432    }
19433
19434    /// Returns a copy with the `CRC32` field set to the given value.
19435    pub const fn with_crc32(mut self, value: u8) -> Self {
19436        self.set_crc32(value);
19437        self
19438    }
19439
19440    /// Returns the value of the `RDM` field.
19441    pub const fn rdm(self) -> u8 {
19442        ((self.bits() >> Self::RDM_SHIFT) & 0b1111) as u8
19443    }
19444
19445    /// Sets the value of the `RDM` field.
19446    pub const fn set_rdm(&mut self, value: u8) {
19447        let offset = Self::RDM_SHIFT;
19448        assert!(value & (Self::RDM_MASK as u8) == value);
19449        *self = Self::from_bits_retain(
19450            (self.bits() & !(Self::RDM_MASK << offset)) | ((value as u32) << offset),
19451        );
19452    }
19453
19454    /// Returns a copy with the `RDM` field set to the given value.
19455    pub const fn with_rdm(mut self, value: u8) -> Self {
19456        self.set_rdm(value);
19457        self
19458    }
19459
19460    /// Returns the value of the `VCMA` field.
19461    pub const fn vcma(self) -> u8 {
19462        ((self.bits() >> Self::VCMA_SHIFT) & 0b1111) as u8
19463    }
19464
19465    /// Sets the value of the `VCMA` field.
19466    pub const fn set_vcma(&mut self, value: u8) {
19467        let offset = Self::VCMA_SHIFT;
19468        assert!(value & (Self::VCMA_MASK as u8) == value);
19469        *self = Self::from_bits_retain(
19470            (self.bits() & !(Self::VCMA_MASK << offset)) | ((value as u32) << offset),
19471        );
19472    }
19473
19474    /// Returns a copy with the `VCMA` field set to the given value.
19475    pub const fn with_vcma(mut self, value: u8) -> Self {
19476        self.set_vcma(value);
19477        self
19478    }
19479}
19480
19481bitflags! {
19482    /// `ID_ISAR6` system register value.
19483    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19484    #[repr(transparent)]
19485    pub struct IdIsar6: u32 {
19486    }
19487}
19488
19489impl IdIsar6 {
19490    /// Offset of the `JSCVT` field.
19491    pub const JSCVT_SHIFT: u32 = 0;
19492    /// Mask for the `JSCVT` field.
19493    pub const JSCVT_MASK: u32 = 0b1111;
19494    /// Offset of the `DP` field.
19495    pub const DP_SHIFT: u32 = 4;
19496    /// Mask for the `DP` field.
19497    pub const DP_MASK: u32 = 0b1111;
19498    /// Offset of the `FHM` field.
19499    pub const FHM_SHIFT: u32 = 8;
19500    /// Mask for the `FHM` field.
19501    pub const FHM_MASK: u32 = 0b1111;
19502    /// Offset of the `SB` field.
19503    pub const SB_SHIFT: u32 = 12;
19504    /// Mask for the `SB` field.
19505    pub const SB_MASK: u32 = 0b1111;
19506    /// Offset of the `SPECRES` field.
19507    pub const SPECRES_SHIFT: u32 = 16;
19508    /// Mask for the `SPECRES` field.
19509    pub const SPECRES_MASK: u32 = 0b1111;
19510    /// Offset of the `BF16` field.
19511    pub const BF16_SHIFT: u32 = 20;
19512    /// Mask for the `BF16` field.
19513    pub const BF16_MASK: u32 = 0b1111;
19514    /// Offset of the `I8MM` field.
19515    pub const I8MM_SHIFT: u32 = 24;
19516    /// Mask for the `I8MM` field.
19517    pub const I8MM_MASK: u32 = 0b1111;
19518    /// Offset of the `CLRBHB` field.
19519    pub const CLRBHB_SHIFT: u32 = 28;
19520    /// Mask for the `CLRBHB` field.
19521    pub const CLRBHB_MASK: u32 = 0b1111;
19522
19523    /// Returns the value of the `JSCVT` field.
19524    pub const fn jscvt(self) -> u8 {
19525        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
19526    }
19527
19528    /// Sets the value of the `JSCVT` field.
19529    pub const fn set_jscvt(&mut self, value: u8) {
19530        let offset = Self::JSCVT_SHIFT;
19531        assert!(value & (Self::JSCVT_MASK as u8) == value);
19532        *self = Self::from_bits_retain(
19533            (self.bits() & !(Self::JSCVT_MASK << offset)) | ((value as u32) << offset),
19534        );
19535    }
19536
19537    /// Returns a copy with the `JSCVT` field set to the given value.
19538    pub const fn with_jscvt(mut self, value: u8) -> Self {
19539        self.set_jscvt(value);
19540        self
19541    }
19542
19543    /// Returns the value of the `DP` field.
19544    pub const fn dp(self) -> u8 {
19545        ((self.bits() >> Self::DP_SHIFT) & 0b1111) as u8
19546    }
19547
19548    /// Sets the value of the `DP` field.
19549    pub const fn set_dp(&mut self, value: u8) {
19550        let offset = Self::DP_SHIFT;
19551        assert!(value & (Self::DP_MASK as u8) == value);
19552        *self = Self::from_bits_retain(
19553            (self.bits() & !(Self::DP_MASK << offset)) | ((value as u32) << offset),
19554        );
19555    }
19556
19557    /// Returns a copy with the `DP` field set to the given value.
19558    pub const fn with_dp(mut self, value: u8) -> Self {
19559        self.set_dp(value);
19560        self
19561    }
19562
19563    /// Returns the value of the `FHM` field.
19564    pub const fn fhm(self) -> u8 {
19565        ((self.bits() >> Self::FHM_SHIFT) & 0b1111) as u8
19566    }
19567
19568    /// Sets the value of the `FHM` field.
19569    pub const fn set_fhm(&mut self, value: u8) {
19570        let offset = Self::FHM_SHIFT;
19571        assert!(value & (Self::FHM_MASK as u8) == value);
19572        *self = Self::from_bits_retain(
19573            (self.bits() & !(Self::FHM_MASK << offset)) | ((value as u32) << offset),
19574        );
19575    }
19576
19577    /// Returns a copy with the `FHM` field set to the given value.
19578    pub const fn with_fhm(mut self, value: u8) -> Self {
19579        self.set_fhm(value);
19580        self
19581    }
19582
19583    /// Returns the value of the `SB` field.
19584    pub const fn sb(self) -> u8 {
19585        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
19586    }
19587
19588    /// Sets the value of the `SB` field.
19589    pub const fn set_sb(&mut self, value: u8) {
19590        let offset = Self::SB_SHIFT;
19591        assert!(value & (Self::SB_MASK as u8) == value);
19592        *self = Self::from_bits_retain(
19593            (self.bits() & !(Self::SB_MASK << offset)) | ((value as u32) << offset),
19594        );
19595    }
19596
19597    /// Returns a copy with the `SB` field set to the given value.
19598    pub const fn with_sb(mut self, value: u8) -> Self {
19599        self.set_sb(value);
19600        self
19601    }
19602
19603    /// Returns the value of the `SPECRES` field.
19604    pub const fn specres(self) -> u8 {
19605        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
19606    }
19607
19608    /// Sets the value of the `SPECRES` field.
19609    pub const fn set_specres(&mut self, value: u8) {
19610        let offset = Self::SPECRES_SHIFT;
19611        assert!(value & (Self::SPECRES_MASK as u8) == value);
19612        *self = Self::from_bits_retain(
19613            (self.bits() & !(Self::SPECRES_MASK << offset)) | ((value as u32) << offset),
19614        );
19615    }
19616
19617    /// Returns a copy with the `SPECRES` field set to the given value.
19618    pub const fn with_specres(mut self, value: u8) -> Self {
19619        self.set_specres(value);
19620        self
19621    }
19622
19623    /// Returns the value of the `BF16` field.
19624    pub const fn bf16(self) -> u8 {
19625        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
19626    }
19627
19628    /// Sets the value of the `BF16` field.
19629    pub const fn set_bf16(&mut self, value: u8) {
19630        let offset = Self::BF16_SHIFT;
19631        assert!(value & (Self::BF16_MASK as u8) == value);
19632        *self = Self::from_bits_retain(
19633            (self.bits() & !(Self::BF16_MASK << offset)) | ((value as u32) << offset),
19634        );
19635    }
19636
19637    /// Returns a copy with the `BF16` field set to the given value.
19638    pub const fn with_bf16(mut self, value: u8) -> Self {
19639        self.set_bf16(value);
19640        self
19641    }
19642
19643    /// Returns the value of the `I8MM` field.
19644    pub const fn i8mm(self) -> u8 {
19645        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
19646    }
19647
19648    /// Sets the value of the `I8MM` field.
19649    pub const fn set_i8mm(&mut self, value: u8) {
19650        let offset = Self::I8MM_SHIFT;
19651        assert!(value & (Self::I8MM_MASK as u8) == value);
19652        *self = Self::from_bits_retain(
19653            (self.bits() & !(Self::I8MM_MASK << offset)) | ((value as u32) << offset),
19654        );
19655    }
19656
19657    /// Returns a copy with the `I8MM` field set to the given value.
19658    pub const fn with_i8mm(mut self, value: u8) -> Self {
19659        self.set_i8mm(value);
19660        self
19661    }
19662
19663    /// Returns the value of the `CLRBHB` field.
19664    pub const fn clrbhb(self) -> u8 {
19665        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
19666    }
19667
19668    /// Sets the value of the `CLRBHB` field.
19669    pub const fn set_clrbhb(&mut self, value: u8) {
19670        let offset = Self::CLRBHB_SHIFT;
19671        assert!(value & (Self::CLRBHB_MASK as u8) == value);
19672        *self = Self::from_bits_retain(
19673            (self.bits() & !(Self::CLRBHB_MASK << offset)) | ((value as u32) << offset),
19674        );
19675    }
19676
19677    /// Returns a copy with the `CLRBHB` field set to the given value.
19678    pub const fn with_clrbhb(mut self, value: u8) -> Self {
19679        self.set_clrbhb(value);
19680        self
19681    }
19682}
19683
19684bitflags! {
19685    /// `ID_MMFR0` system register value.
19686    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19687    #[repr(transparent)]
19688    pub struct IdMmfr0: u32 {
19689    }
19690}
19691
19692impl IdMmfr0 {
19693    /// Offset of the `VMSA` field.
19694    pub const VMSA_SHIFT: u32 = 0;
19695    /// Mask for the `VMSA` field.
19696    pub const VMSA_MASK: u32 = 0b1111;
19697    /// Offset of the `PMSA` field.
19698    pub const PMSA_SHIFT: u32 = 4;
19699    /// Mask for the `PMSA` field.
19700    pub const PMSA_MASK: u32 = 0b1111;
19701    /// Offset of the `OuterShr` field.
19702    pub const OUTERSHR_SHIFT: u32 = 8;
19703    /// Mask for the `OuterShr` field.
19704    pub const OUTERSHR_MASK: u32 = 0b1111;
19705    /// Offset of the `ShareLvl` field.
19706    pub const SHARELVL_SHIFT: u32 = 12;
19707    /// Mask for the `ShareLvl` field.
19708    pub const SHARELVL_MASK: u32 = 0b1111;
19709    /// Offset of the `TCM` field.
19710    pub const TCM_SHIFT: u32 = 16;
19711    /// Mask for the `TCM` field.
19712    pub const TCM_MASK: u32 = 0b1111;
19713    /// Offset of the `AuxReg` field.
19714    pub const AUXREG_SHIFT: u32 = 20;
19715    /// Mask for the `AuxReg` field.
19716    pub const AUXREG_MASK: u32 = 0b1111;
19717    /// Offset of the `FCSE` field.
19718    pub const FCSE_SHIFT: u32 = 24;
19719    /// Mask for the `FCSE` field.
19720    pub const FCSE_MASK: u32 = 0b1111;
19721    /// Offset of the `InnerShr` field.
19722    pub const INNERSHR_SHIFT: u32 = 28;
19723    /// Mask for the `InnerShr` field.
19724    pub const INNERSHR_MASK: u32 = 0b1111;
19725
19726    /// Returns the value of the `VMSA` field.
19727    pub const fn vmsa(self) -> u8 {
19728        ((self.bits() >> Self::VMSA_SHIFT) & 0b1111) as u8
19729    }
19730
19731    /// Sets the value of the `VMSA` field.
19732    pub const fn set_vmsa(&mut self, value: u8) {
19733        let offset = Self::VMSA_SHIFT;
19734        assert!(value & (Self::VMSA_MASK as u8) == value);
19735        *self = Self::from_bits_retain(
19736            (self.bits() & !(Self::VMSA_MASK << offset)) | ((value as u32) << offset),
19737        );
19738    }
19739
19740    /// Returns a copy with the `VMSA` field set to the given value.
19741    pub const fn with_vmsa(mut self, value: u8) -> Self {
19742        self.set_vmsa(value);
19743        self
19744    }
19745
19746    /// Returns the value of the `PMSA` field.
19747    pub const fn pmsa(self) -> u8 {
19748        ((self.bits() >> Self::PMSA_SHIFT) & 0b1111) as u8
19749    }
19750
19751    /// Sets the value of the `PMSA` field.
19752    pub const fn set_pmsa(&mut self, value: u8) {
19753        let offset = Self::PMSA_SHIFT;
19754        assert!(value & (Self::PMSA_MASK as u8) == value);
19755        *self = Self::from_bits_retain(
19756            (self.bits() & !(Self::PMSA_MASK << offset)) | ((value as u32) << offset),
19757        );
19758    }
19759
19760    /// Returns a copy with the `PMSA` field set to the given value.
19761    pub const fn with_pmsa(mut self, value: u8) -> Self {
19762        self.set_pmsa(value);
19763        self
19764    }
19765
19766    /// Returns the value of the `OuterShr` field.
19767    pub const fn outershr(self) -> u8 {
19768        ((self.bits() >> Self::OUTERSHR_SHIFT) & 0b1111) as u8
19769    }
19770
19771    /// Sets the value of the `OuterShr` field.
19772    pub const fn set_outershr(&mut self, value: u8) {
19773        let offset = Self::OUTERSHR_SHIFT;
19774        assert!(value & (Self::OUTERSHR_MASK as u8) == value);
19775        *self = Self::from_bits_retain(
19776            (self.bits() & !(Self::OUTERSHR_MASK << offset)) | ((value as u32) << offset),
19777        );
19778    }
19779
19780    /// Returns a copy with the `OuterShr` field set to the given value.
19781    pub const fn with_outershr(mut self, value: u8) -> Self {
19782        self.set_outershr(value);
19783        self
19784    }
19785
19786    /// Returns the value of the `ShareLvl` field.
19787    pub const fn sharelvl(self) -> u8 {
19788        ((self.bits() >> Self::SHARELVL_SHIFT) & 0b1111) as u8
19789    }
19790
19791    /// Sets the value of the `ShareLvl` field.
19792    pub const fn set_sharelvl(&mut self, value: u8) {
19793        let offset = Self::SHARELVL_SHIFT;
19794        assert!(value & (Self::SHARELVL_MASK as u8) == value);
19795        *self = Self::from_bits_retain(
19796            (self.bits() & !(Self::SHARELVL_MASK << offset)) | ((value as u32) << offset),
19797        );
19798    }
19799
19800    /// Returns a copy with the `ShareLvl` field set to the given value.
19801    pub const fn with_sharelvl(mut self, value: u8) -> Self {
19802        self.set_sharelvl(value);
19803        self
19804    }
19805
19806    /// Returns the value of the `TCM` field.
19807    pub const fn tcm(self) -> u8 {
19808        ((self.bits() >> Self::TCM_SHIFT) & 0b1111) as u8
19809    }
19810
19811    /// Sets the value of the `TCM` field.
19812    pub const fn set_tcm(&mut self, value: u8) {
19813        let offset = Self::TCM_SHIFT;
19814        assert!(value & (Self::TCM_MASK as u8) == value);
19815        *self = Self::from_bits_retain(
19816            (self.bits() & !(Self::TCM_MASK << offset)) | ((value as u32) << offset),
19817        );
19818    }
19819
19820    /// Returns a copy with the `TCM` field set to the given value.
19821    pub const fn with_tcm(mut self, value: u8) -> Self {
19822        self.set_tcm(value);
19823        self
19824    }
19825
19826    /// Returns the value of the `AuxReg` field.
19827    pub const fn auxreg(self) -> u8 {
19828        ((self.bits() >> Self::AUXREG_SHIFT) & 0b1111) as u8
19829    }
19830
19831    /// Sets the value of the `AuxReg` field.
19832    pub const fn set_auxreg(&mut self, value: u8) {
19833        let offset = Self::AUXREG_SHIFT;
19834        assert!(value & (Self::AUXREG_MASK as u8) == value);
19835        *self = Self::from_bits_retain(
19836            (self.bits() & !(Self::AUXREG_MASK << offset)) | ((value as u32) << offset),
19837        );
19838    }
19839
19840    /// Returns a copy with the `AuxReg` field set to the given value.
19841    pub const fn with_auxreg(mut self, value: u8) -> Self {
19842        self.set_auxreg(value);
19843        self
19844    }
19845
19846    /// Returns the value of the `FCSE` field.
19847    pub const fn fcse(self) -> u8 {
19848        ((self.bits() >> Self::FCSE_SHIFT) & 0b1111) as u8
19849    }
19850
19851    /// Sets the value of the `FCSE` field.
19852    pub const fn set_fcse(&mut self, value: u8) {
19853        let offset = Self::FCSE_SHIFT;
19854        assert!(value & (Self::FCSE_MASK as u8) == value);
19855        *self = Self::from_bits_retain(
19856            (self.bits() & !(Self::FCSE_MASK << offset)) | ((value as u32) << offset),
19857        );
19858    }
19859
19860    /// Returns a copy with the `FCSE` field set to the given value.
19861    pub const fn with_fcse(mut self, value: u8) -> Self {
19862        self.set_fcse(value);
19863        self
19864    }
19865
19866    /// Returns the value of the `InnerShr` field.
19867    pub const fn innershr(self) -> u8 {
19868        ((self.bits() >> Self::INNERSHR_SHIFT) & 0b1111) as u8
19869    }
19870
19871    /// Sets the value of the `InnerShr` field.
19872    pub const fn set_innershr(&mut self, value: u8) {
19873        let offset = Self::INNERSHR_SHIFT;
19874        assert!(value & (Self::INNERSHR_MASK as u8) == value);
19875        *self = Self::from_bits_retain(
19876            (self.bits() & !(Self::INNERSHR_MASK << offset)) | ((value as u32) << offset),
19877        );
19878    }
19879
19880    /// Returns a copy with the `InnerShr` field set to the given value.
19881    pub const fn with_innershr(mut self, value: u8) -> Self {
19882        self.set_innershr(value);
19883        self
19884    }
19885}
19886
19887bitflags! {
19888    /// `ID_MMFR1` system register value.
19889    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19890    #[repr(transparent)]
19891    pub struct IdMmfr1: u32 {
19892    }
19893}
19894
19895impl IdMmfr1 {
19896    /// Offset of the `L1HvdVA` field.
19897    pub const L1HVDVA_SHIFT: u32 = 0;
19898    /// Mask for the `L1HvdVA` field.
19899    pub const L1HVDVA_MASK: u32 = 0b1111;
19900    /// Offset of the `L1UniVA` field.
19901    pub const L1UNIVA_SHIFT: u32 = 4;
19902    /// Mask for the `L1UniVA` field.
19903    pub const L1UNIVA_MASK: u32 = 0b1111;
19904    /// Offset of the `L1HvdSW` field.
19905    pub const L1HVDSW_SHIFT: u32 = 8;
19906    /// Mask for the `L1HvdSW` field.
19907    pub const L1HVDSW_MASK: u32 = 0b1111;
19908    /// Offset of the `L1UniSW` field.
19909    pub const L1UNISW_SHIFT: u32 = 12;
19910    /// Mask for the `L1UniSW` field.
19911    pub const L1UNISW_MASK: u32 = 0b1111;
19912    /// Offset of the `L1Hvd` field.
19913    pub const L1HVD_SHIFT: u32 = 16;
19914    /// Mask for the `L1Hvd` field.
19915    pub const L1HVD_MASK: u32 = 0b1111;
19916    /// Offset of the `L1Uni` field.
19917    pub const L1UNI_SHIFT: u32 = 20;
19918    /// Mask for the `L1Uni` field.
19919    pub const L1UNI_MASK: u32 = 0b1111;
19920    /// Offset of the `L1TstCln` field.
19921    pub const L1TSTCLN_SHIFT: u32 = 24;
19922    /// Mask for the `L1TstCln` field.
19923    pub const L1TSTCLN_MASK: u32 = 0b1111;
19924    /// Offset of the `BPred` field.
19925    pub const BPRED_SHIFT: u32 = 28;
19926    /// Mask for the `BPred` field.
19927    pub const BPRED_MASK: u32 = 0b1111;
19928
19929    /// Returns the value of the `L1HvdVA` field.
19930    pub const fn l1hvdva(self) -> u8 {
19931        ((self.bits() >> Self::L1HVDVA_SHIFT) & 0b1111) as u8
19932    }
19933
19934    /// Sets the value of the `L1HvdVA` field.
19935    pub const fn set_l1hvdva(&mut self, value: u8) {
19936        let offset = Self::L1HVDVA_SHIFT;
19937        assert!(value & (Self::L1HVDVA_MASK as u8) == value);
19938        *self = Self::from_bits_retain(
19939            (self.bits() & !(Self::L1HVDVA_MASK << offset)) | ((value as u32) << offset),
19940        );
19941    }
19942
19943    /// Returns a copy with the `L1HvdVA` field set to the given value.
19944    pub const fn with_l1hvdva(mut self, value: u8) -> Self {
19945        self.set_l1hvdva(value);
19946        self
19947    }
19948
19949    /// Returns the value of the `L1UniVA` field.
19950    pub const fn l1univa(self) -> u8 {
19951        ((self.bits() >> Self::L1UNIVA_SHIFT) & 0b1111) as u8
19952    }
19953
19954    /// Sets the value of the `L1UniVA` field.
19955    pub const fn set_l1univa(&mut self, value: u8) {
19956        let offset = Self::L1UNIVA_SHIFT;
19957        assert!(value & (Self::L1UNIVA_MASK as u8) == value);
19958        *self = Self::from_bits_retain(
19959            (self.bits() & !(Self::L1UNIVA_MASK << offset)) | ((value as u32) << offset),
19960        );
19961    }
19962
19963    /// Returns a copy with the `L1UniVA` field set to the given value.
19964    pub const fn with_l1univa(mut self, value: u8) -> Self {
19965        self.set_l1univa(value);
19966        self
19967    }
19968
19969    /// Returns the value of the `L1HvdSW` field.
19970    pub const fn l1hvdsw(self) -> u8 {
19971        ((self.bits() >> Self::L1HVDSW_SHIFT) & 0b1111) as u8
19972    }
19973
19974    /// Sets the value of the `L1HvdSW` field.
19975    pub const fn set_l1hvdsw(&mut self, value: u8) {
19976        let offset = Self::L1HVDSW_SHIFT;
19977        assert!(value & (Self::L1HVDSW_MASK as u8) == value);
19978        *self = Self::from_bits_retain(
19979            (self.bits() & !(Self::L1HVDSW_MASK << offset)) | ((value as u32) << offset),
19980        );
19981    }
19982
19983    /// Returns a copy with the `L1HvdSW` field set to the given value.
19984    pub const fn with_l1hvdsw(mut self, value: u8) -> Self {
19985        self.set_l1hvdsw(value);
19986        self
19987    }
19988
19989    /// Returns the value of the `L1UniSW` field.
19990    pub const fn l1unisw(self) -> u8 {
19991        ((self.bits() >> Self::L1UNISW_SHIFT) & 0b1111) as u8
19992    }
19993
19994    /// Sets the value of the `L1UniSW` field.
19995    pub const fn set_l1unisw(&mut self, value: u8) {
19996        let offset = Self::L1UNISW_SHIFT;
19997        assert!(value & (Self::L1UNISW_MASK as u8) == value);
19998        *self = Self::from_bits_retain(
19999            (self.bits() & !(Self::L1UNISW_MASK << offset)) | ((value as u32) << offset),
20000        );
20001    }
20002
20003    /// Returns a copy with the `L1UniSW` field set to the given value.
20004    pub const fn with_l1unisw(mut self, value: u8) -> Self {
20005        self.set_l1unisw(value);
20006        self
20007    }
20008
20009    /// Returns the value of the `L1Hvd` field.
20010    pub const fn l1hvd(self) -> u8 {
20011        ((self.bits() >> Self::L1HVD_SHIFT) & 0b1111) as u8
20012    }
20013
20014    /// Sets the value of the `L1Hvd` field.
20015    pub const fn set_l1hvd(&mut self, value: u8) {
20016        let offset = Self::L1HVD_SHIFT;
20017        assert!(value & (Self::L1HVD_MASK as u8) == value);
20018        *self = Self::from_bits_retain(
20019            (self.bits() & !(Self::L1HVD_MASK << offset)) | ((value as u32) << offset),
20020        );
20021    }
20022
20023    /// Returns a copy with the `L1Hvd` field set to the given value.
20024    pub const fn with_l1hvd(mut self, value: u8) -> Self {
20025        self.set_l1hvd(value);
20026        self
20027    }
20028
20029    /// Returns the value of the `L1Uni` field.
20030    pub const fn l1uni(self) -> u8 {
20031        ((self.bits() >> Self::L1UNI_SHIFT) & 0b1111) as u8
20032    }
20033
20034    /// Sets the value of the `L1Uni` field.
20035    pub const fn set_l1uni(&mut self, value: u8) {
20036        let offset = Self::L1UNI_SHIFT;
20037        assert!(value & (Self::L1UNI_MASK as u8) == value);
20038        *self = Self::from_bits_retain(
20039            (self.bits() & !(Self::L1UNI_MASK << offset)) | ((value as u32) << offset),
20040        );
20041    }
20042
20043    /// Returns a copy with the `L1Uni` field set to the given value.
20044    pub const fn with_l1uni(mut self, value: u8) -> Self {
20045        self.set_l1uni(value);
20046        self
20047    }
20048
20049    /// Returns the value of the `L1TstCln` field.
20050    pub const fn l1tstcln(self) -> u8 {
20051        ((self.bits() >> Self::L1TSTCLN_SHIFT) & 0b1111) as u8
20052    }
20053
20054    /// Sets the value of the `L1TstCln` field.
20055    pub const fn set_l1tstcln(&mut self, value: u8) {
20056        let offset = Self::L1TSTCLN_SHIFT;
20057        assert!(value & (Self::L1TSTCLN_MASK as u8) == value);
20058        *self = Self::from_bits_retain(
20059            (self.bits() & !(Self::L1TSTCLN_MASK << offset)) | ((value as u32) << offset),
20060        );
20061    }
20062
20063    /// Returns a copy with the `L1TstCln` field set to the given value.
20064    pub const fn with_l1tstcln(mut self, value: u8) -> Self {
20065        self.set_l1tstcln(value);
20066        self
20067    }
20068
20069    /// Returns the value of the `BPred` field.
20070    pub const fn bpred(self) -> u8 {
20071        ((self.bits() >> Self::BPRED_SHIFT) & 0b1111) as u8
20072    }
20073
20074    /// Sets the value of the `BPred` field.
20075    pub const fn set_bpred(&mut self, value: u8) {
20076        let offset = Self::BPRED_SHIFT;
20077        assert!(value & (Self::BPRED_MASK as u8) == value);
20078        *self = Self::from_bits_retain(
20079            (self.bits() & !(Self::BPRED_MASK << offset)) | ((value as u32) << offset),
20080        );
20081    }
20082
20083    /// Returns a copy with the `BPred` field set to the given value.
20084    pub const fn with_bpred(mut self, value: u8) -> Self {
20085        self.set_bpred(value);
20086        self
20087    }
20088}
20089
20090bitflags! {
20091    /// `ID_MMFR2` system register value.
20092    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20093    #[repr(transparent)]
20094    pub struct IdMmfr2: u32 {
20095    }
20096}
20097
20098impl IdMmfr2 {
20099    /// Offset of the `L1HvdFG` field.
20100    pub const L1HVDFG_SHIFT: u32 = 0;
20101    /// Mask for the `L1HvdFG` field.
20102    pub const L1HVDFG_MASK: u32 = 0b1111;
20103    /// Offset of the `L1HvdBG` field.
20104    pub const L1HVDBG_SHIFT: u32 = 4;
20105    /// Mask for the `L1HvdBG` field.
20106    pub const L1HVDBG_MASK: u32 = 0b1111;
20107    /// Offset of the `L1HvdRng` field.
20108    pub const L1HVDRNG_SHIFT: u32 = 8;
20109    /// Mask for the `L1HvdRng` field.
20110    pub const L1HVDRNG_MASK: u32 = 0b1111;
20111    /// Offset of the `HvdTLB` field.
20112    pub const HVDTLB_SHIFT: u32 = 12;
20113    /// Mask for the `HvdTLB` field.
20114    pub const HVDTLB_MASK: u32 = 0b1111;
20115    /// Offset of the `UniTLB` field.
20116    pub const UNITLB_SHIFT: u32 = 16;
20117    /// Mask for the `UniTLB` field.
20118    pub const UNITLB_MASK: u32 = 0b1111;
20119    /// Offset of the `MemBarr` field.
20120    pub const MEMBARR_SHIFT: u32 = 20;
20121    /// Mask for the `MemBarr` field.
20122    pub const MEMBARR_MASK: u32 = 0b1111;
20123    /// Offset of the `WFIStall` field.
20124    pub const WFISTALL_SHIFT: u32 = 24;
20125    /// Mask for the `WFIStall` field.
20126    pub const WFISTALL_MASK: u32 = 0b1111;
20127    /// Offset of the `HWAccFlg` field.
20128    pub const HWACCFLG_SHIFT: u32 = 28;
20129    /// Mask for the `HWAccFlg` field.
20130    pub const HWACCFLG_MASK: u32 = 0b1111;
20131
20132    /// Returns the value of the `L1HvdFG` field.
20133    pub const fn l1hvdfg(self) -> u8 {
20134        ((self.bits() >> Self::L1HVDFG_SHIFT) & 0b1111) as u8
20135    }
20136
20137    /// Sets the value of the `L1HvdFG` field.
20138    pub const fn set_l1hvdfg(&mut self, value: u8) {
20139        let offset = Self::L1HVDFG_SHIFT;
20140        assert!(value & (Self::L1HVDFG_MASK as u8) == value);
20141        *self = Self::from_bits_retain(
20142            (self.bits() & !(Self::L1HVDFG_MASK << offset)) | ((value as u32) << offset),
20143        );
20144    }
20145
20146    /// Returns a copy with the `L1HvdFG` field set to the given value.
20147    pub const fn with_l1hvdfg(mut self, value: u8) -> Self {
20148        self.set_l1hvdfg(value);
20149        self
20150    }
20151
20152    /// Returns the value of the `L1HvdBG` field.
20153    pub const fn l1hvdbg(self) -> u8 {
20154        ((self.bits() >> Self::L1HVDBG_SHIFT) & 0b1111) as u8
20155    }
20156
20157    /// Sets the value of the `L1HvdBG` field.
20158    pub const fn set_l1hvdbg(&mut self, value: u8) {
20159        let offset = Self::L1HVDBG_SHIFT;
20160        assert!(value & (Self::L1HVDBG_MASK as u8) == value);
20161        *self = Self::from_bits_retain(
20162            (self.bits() & !(Self::L1HVDBG_MASK << offset)) | ((value as u32) << offset),
20163        );
20164    }
20165
20166    /// Returns a copy with the `L1HvdBG` field set to the given value.
20167    pub const fn with_l1hvdbg(mut self, value: u8) -> Self {
20168        self.set_l1hvdbg(value);
20169        self
20170    }
20171
20172    /// Returns the value of the `L1HvdRng` field.
20173    pub const fn l1hvdrng(self) -> u8 {
20174        ((self.bits() >> Self::L1HVDRNG_SHIFT) & 0b1111) as u8
20175    }
20176
20177    /// Sets the value of the `L1HvdRng` field.
20178    pub const fn set_l1hvdrng(&mut self, value: u8) {
20179        let offset = Self::L1HVDRNG_SHIFT;
20180        assert!(value & (Self::L1HVDRNG_MASK as u8) == value);
20181        *self = Self::from_bits_retain(
20182            (self.bits() & !(Self::L1HVDRNG_MASK << offset)) | ((value as u32) << offset),
20183        );
20184    }
20185
20186    /// Returns a copy with the `L1HvdRng` field set to the given value.
20187    pub const fn with_l1hvdrng(mut self, value: u8) -> Self {
20188        self.set_l1hvdrng(value);
20189        self
20190    }
20191
20192    /// Returns the value of the `HvdTLB` field.
20193    pub const fn hvdtlb(self) -> u8 {
20194        ((self.bits() >> Self::HVDTLB_SHIFT) & 0b1111) as u8
20195    }
20196
20197    /// Sets the value of the `HvdTLB` field.
20198    pub const fn set_hvdtlb(&mut self, value: u8) {
20199        let offset = Self::HVDTLB_SHIFT;
20200        assert!(value & (Self::HVDTLB_MASK as u8) == value);
20201        *self = Self::from_bits_retain(
20202            (self.bits() & !(Self::HVDTLB_MASK << offset)) | ((value as u32) << offset),
20203        );
20204    }
20205
20206    /// Returns a copy with the `HvdTLB` field set to the given value.
20207    pub const fn with_hvdtlb(mut self, value: u8) -> Self {
20208        self.set_hvdtlb(value);
20209        self
20210    }
20211
20212    /// Returns the value of the `UniTLB` field.
20213    pub const fn unitlb(self) -> u8 {
20214        ((self.bits() >> Self::UNITLB_SHIFT) & 0b1111) as u8
20215    }
20216
20217    /// Sets the value of the `UniTLB` field.
20218    pub const fn set_unitlb(&mut self, value: u8) {
20219        let offset = Self::UNITLB_SHIFT;
20220        assert!(value & (Self::UNITLB_MASK as u8) == value);
20221        *self = Self::from_bits_retain(
20222            (self.bits() & !(Self::UNITLB_MASK << offset)) | ((value as u32) << offset),
20223        );
20224    }
20225
20226    /// Returns a copy with the `UniTLB` field set to the given value.
20227    pub const fn with_unitlb(mut self, value: u8) -> Self {
20228        self.set_unitlb(value);
20229        self
20230    }
20231
20232    /// Returns the value of the `MemBarr` field.
20233    pub const fn membarr(self) -> u8 {
20234        ((self.bits() >> Self::MEMBARR_SHIFT) & 0b1111) as u8
20235    }
20236
20237    /// Sets the value of the `MemBarr` field.
20238    pub const fn set_membarr(&mut self, value: u8) {
20239        let offset = Self::MEMBARR_SHIFT;
20240        assert!(value & (Self::MEMBARR_MASK as u8) == value);
20241        *self = Self::from_bits_retain(
20242            (self.bits() & !(Self::MEMBARR_MASK << offset)) | ((value as u32) << offset),
20243        );
20244    }
20245
20246    /// Returns a copy with the `MemBarr` field set to the given value.
20247    pub const fn with_membarr(mut self, value: u8) -> Self {
20248        self.set_membarr(value);
20249        self
20250    }
20251
20252    /// Returns the value of the `WFIStall` field.
20253    pub const fn wfistall(self) -> u8 {
20254        ((self.bits() >> Self::WFISTALL_SHIFT) & 0b1111) as u8
20255    }
20256
20257    /// Sets the value of the `WFIStall` field.
20258    pub const fn set_wfistall(&mut self, value: u8) {
20259        let offset = Self::WFISTALL_SHIFT;
20260        assert!(value & (Self::WFISTALL_MASK as u8) == value);
20261        *self = Self::from_bits_retain(
20262            (self.bits() & !(Self::WFISTALL_MASK << offset)) | ((value as u32) << offset),
20263        );
20264    }
20265
20266    /// Returns a copy with the `WFIStall` field set to the given value.
20267    pub const fn with_wfistall(mut self, value: u8) -> Self {
20268        self.set_wfistall(value);
20269        self
20270    }
20271
20272    /// Returns the value of the `HWAccFlg` field.
20273    pub const fn hwaccflg(self) -> u8 {
20274        ((self.bits() >> Self::HWACCFLG_SHIFT) & 0b1111) as u8
20275    }
20276
20277    /// Sets the value of the `HWAccFlg` field.
20278    pub const fn set_hwaccflg(&mut self, value: u8) {
20279        let offset = Self::HWACCFLG_SHIFT;
20280        assert!(value & (Self::HWACCFLG_MASK as u8) == value);
20281        *self = Self::from_bits_retain(
20282            (self.bits() & !(Self::HWACCFLG_MASK << offset)) | ((value as u32) << offset),
20283        );
20284    }
20285
20286    /// Returns a copy with the `HWAccFlg` field set to the given value.
20287    pub const fn with_hwaccflg(mut self, value: u8) -> Self {
20288        self.set_hwaccflg(value);
20289        self
20290    }
20291}
20292
20293bitflags! {
20294    /// `ID_MMFR3` system register value.
20295    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20296    #[repr(transparent)]
20297    pub struct IdMmfr3: u32 {
20298    }
20299}
20300
20301impl IdMmfr3 {
20302    /// Offset of the `CMaintVA` field.
20303    pub const CMAINTVA_SHIFT: u32 = 0;
20304    /// Mask for the `CMaintVA` field.
20305    pub const CMAINTVA_MASK: u32 = 0b1111;
20306    /// Offset of the `CMaintSW` field.
20307    pub const CMAINTSW_SHIFT: u32 = 4;
20308    /// Mask for the `CMaintSW` field.
20309    pub const CMAINTSW_MASK: u32 = 0b1111;
20310    /// Offset of the `BPMaint` field.
20311    pub const BPMAINT_SHIFT: u32 = 8;
20312    /// Mask for the `BPMaint` field.
20313    pub const BPMAINT_MASK: u32 = 0b1111;
20314    /// Offset of the `MaintBcst` field.
20315    pub const MAINTBCST_SHIFT: u32 = 12;
20316    /// Mask for the `MaintBcst` field.
20317    pub const MAINTBCST_MASK: u32 = 0b1111;
20318    /// Offset of the `PAN` field.
20319    pub const PAN_SHIFT: u32 = 16;
20320    /// Mask for the `PAN` field.
20321    pub const PAN_MASK: u32 = 0b1111;
20322    /// Offset of the `CohWalk` field.
20323    pub const COHWALK_SHIFT: u32 = 20;
20324    /// Mask for the `CohWalk` field.
20325    pub const COHWALK_MASK: u32 = 0b1111;
20326    /// Offset of the `CMemSz` field.
20327    pub const CMEMSZ_SHIFT: u32 = 24;
20328    /// Mask for the `CMemSz` field.
20329    pub const CMEMSZ_MASK: u32 = 0b1111;
20330    /// Offset of the `Supersec` field.
20331    pub const SUPERSEC_SHIFT: u32 = 28;
20332    /// Mask for the `Supersec` field.
20333    pub const SUPERSEC_MASK: u32 = 0b1111;
20334
20335    /// Returns the value of the `CMaintVA` field.
20336    pub const fn cmaintva(self) -> u8 {
20337        ((self.bits() >> Self::CMAINTVA_SHIFT) & 0b1111) as u8
20338    }
20339
20340    /// Sets the value of the `CMaintVA` field.
20341    pub const fn set_cmaintva(&mut self, value: u8) {
20342        let offset = Self::CMAINTVA_SHIFT;
20343        assert!(value & (Self::CMAINTVA_MASK as u8) == value);
20344        *self = Self::from_bits_retain(
20345            (self.bits() & !(Self::CMAINTVA_MASK << offset)) | ((value as u32) << offset),
20346        );
20347    }
20348
20349    /// Returns a copy with the `CMaintVA` field set to the given value.
20350    pub const fn with_cmaintva(mut self, value: u8) -> Self {
20351        self.set_cmaintva(value);
20352        self
20353    }
20354
20355    /// Returns the value of the `CMaintSW` field.
20356    pub const fn cmaintsw(self) -> u8 {
20357        ((self.bits() >> Self::CMAINTSW_SHIFT) & 0b1111) as u8
20358    }
20359
20360    /// Sets the value of the `CMaintSW` field.
20361    pub const fn set_cmaintsw(&mut self, value: u8) {
20362        let offset = Self::CMAINTSW_SHIFT;
20363        assert!(value & (Self::CMAINTSW_MASK as u8) == value);
20364        *self = Self::from_bits_retain(
20365            (self.bits() & !(Self::CMAINTSW_MASK << offset)) | ((value as u32) << offset),
20366        );
20367    }
20368
20369    /// Returns a copy with the `CMaintSW` field set to the given value.
20370    pub const fn with_cmaintsw(mut self, value: u8) -> Self {
20371        self.set_cmaintsw(value);
20372        self
20373    }
20374
20375    /// Returns the value of the `BPMaint` field.
20376    pub const fn bpmaint(self) -> u8 {
20377        ((self.bits() >> Self::BPMAINT_SHIFT) & 0b1111) as u8
20378    }
20379
20380    /// Sets the value of the `BPMaint` field.
20381    pub const fn set_bpmaint(&mut self, value: u8) {
20382        let offset = Self::BPMAINT_SHIFT;
20383        assert!(value & (Self::BPMAINT_MASK as u8) == value);
20384        *self = Self::from_bits_retain(
20385            (self.bits() & !(Self::BPMAINT_MASK << offset)) | ((value as u32) << offset),
20386        );
20387    }
20388
20389    /// Returns a copy with the `BPMaint` field set to the given value.
20390    pub const fn with_bpmaint(mut self, value: u8) -> Self {
20391        self.set_bpmaint(value);
20392        self
20393    }
20394
20395    /// Returns the value of the `MaintBcst` field.
20396    pub const fn maintbcst(self) -> u8 {
20397        ((self.bits() >> Self::MAINTBCST_SHIFT) & 0b1111) as u8
20398    }
20399
20400    /// Sets the value of the `MaintBcst` field.
20401    pub const fn set_maintbcst(&mut self, value: u8) {
20402        let offset = Self::MAINTBCST_SHIFT;
20403        assert!(value & (Self::MAINTBCST_MASK as u8) == value);
20404        *self = Self::from_bits_retain(
20405            (self.bits() & !(Self::MAINTBCST_MASK << offset)) | ((value as u32) << offset),
20406        );
20407    }
20408
20409    /// Returns a copy with the `MaintBcst` field set to the given value.
20410    pub const fn with_maintbcst(mut self, value: u8) -> Self {
20411        self.set_maintbcst(value);
20412        self
20413    }
20414
20415    /// Returns the value of the `PAN` field.
20416    pub const fn pan(self) -> u8 {
20417        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
20418    }
20419
20420    /// Sets the value of the `PAN` field.
20421    pub const fn set_pan(&mut self, value: u8) {
20422        let offset = Self::PAN_SHIFT;
20423        assert!(value & (Self::PAN_MASK as u8) == value);
20424        *self = Self::from_bits_retain(
20425            (self.bits() & !(Self::PAN_MASK << offset)) | ((value as u32) << offset),
20426        );
20427    }
20428
20429    /// Returns a copy with the `PAN` field set to the given value.
20430    pub const fn with_pan(mut self, value: u8) -> Self {
20431        self.set_pan(value);
20432        self
20433    }
20434
20435    /// Returns the value of the `CohWalk` field.
20436    pub const fn cohwalk(self) -> u8 {
20437        ((self.bits() >> Self::COHWALK_SHIFT) & 0b1111) as u8
20438    }
20439
20440    /// Sets the value of the `CohWalk` field.
20441    pub const fn set_cohwalk(&mut self, value: u8) {
20442        let offset = Self::COHWALK_SHIFT;
20443        assert!(value & (Self::COHWALK_MASK as u8) == value);
20444        *self = Self::from_bits_retain(
20445            (self.bits() & !(Self::COHWALK_MASK << offset)) | ((value as u32) << offset),
20446        );
20447    }
20448
20449    /// Returns a copy with the `CohWalk` field set to the given value.
20450    pub const fn with_cohwalk(mut self, value: u8) -> Self {
20451        self.set_cohwalk(value);
20452        self
20453    }
20454
20455    /// Returns the value of the `CMemSz` field.
20456    pub const fn cmemsz(self) -> u8 {
20457        ((self.bits() >> Self::CMEMSZ_SHIFT) & 0b1111) as u8
20458    }
20459
20460    /// Sets the value of the `CMemSz` field.
20461    pub const fn set_cmemsz(&mut self, value: u8) {
20462        let offset = Self::CMEMSZ_SHIFT;
20463        assert!(value & (Self::CMEMSZ_MASK as u8) == value);
20464        *self = Self::from_bits_retain(
20465            (self.bits() & !(Self::CMEMSZ_MASK << offset)) | ((value as u32) << offset),
20466        );
20467    }
20468
20469    /// Returns a copy with the `CMemSz` field set to the given value.
20470    pub const fn with_cmemsz(mut self, value: u8) -> Self {
20471        self.set_cmemsz(value);
20472        self
20473    }
20474
20475    /// Returns the value of the `Supersec` field.
20476    pub const fn supersec(self) -> u8 {
20477        ((self.bits() >> Self::SUPERSEC_SHIFT) & 0b1111) as u8
20478    }
20479
20480    /// Sets the value of the `Supersec` field.
20481    pub const fn set_supersec(&mut self, value: u8) {
20482        let offset = Self::SUPERSEC_SHIFT;
20483        assert!(value & (Self::SUPERSEC_MASK as u8) == value);
20484        *self = Self::from_bits_retain(
20485            (self.bits() & !(Self::SUPERSEC_MASK << offset)) | ((value as u32) << offset),
20486        );
20487    }
20488
20489    /// Returns a copy with the `Supersec` field set to the given value.
20490    pub const fn with_supersec(mut self, value: u8) -> Self {
20491        self.set_supersec(value);
20492        self
20493    }
20494}
20495
20496bitflags! {
20497    /// `ID_MMFR4` system register value.
20498    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20499    #[repr(transparent)]
20500    pub struct IdMmfr4: u32 {
20501    }
20502}
20503
20504impl IdMmfr4 {
20505    /// Offset of the `SpecSEI` field.
20506    pub const SPECSEI_SHIFT: u32 = 0;
20507    /// Mask for the `SpecSEI` field.
20508    pub const SPECSEI_MASK: u32 = 0b1111;
20509    /// Offset of the `AC2` field.
20510    pub const AC2_SHIFT: u32 = 4;
20511    /// Mask for the `AC2` field.
20512    pub const AC2_MASK: u32 = 0b1111;
20513    /// Offset of the `XNX` field.
20514    pub const XNX_SHIFT: u32 = 8;
20515    /// Mask for the `XNX` field.
20516    pub const XNX_MASK: u32 = 0b1111;
20517    /// Offset of the `CnP` field.
20518    pub const CNP_SHIFT: u32 = 12;
20519    /// Mask for the `CnP` field.
20520    pub const CNP_MASK: u32 = 0b1111;
20521    /// Offset of the `HPDS` field.
20522    pub const HPDS_SHIFT: u32 = 16;
20523    /// Mask for the `HPDS` field.
20524    pub const HPDS_MASK: u32 = 0b1111;
20525    /// Offset of the `LSM` field.
20526    pub const LSM_SHIFT: u32 = 20;
20527    /// Mask for the `LSM` field.
20528    pub const LSM_MASK: u32 = 0b1111;
20529    /// Offset of the `CCIDX` field.
20530    pub const CCIDX_SHIFT: u32 = 24;
20531    /// Mask for the `CCIDX` field.
20532    pub const CCIDX_MASK: u32 = 0b1111;
20533    /// Offset of the `EVT` field.
20534    pub const EVT_SHIFT: u32 = 28;
20535    /// Mask for the `EVT` field.
20536    pub const EVT_MASK: u32 = 0b1111;
20537
20538    /// Returns the value of the `SpecSEI` field.
20539    pub const fn specsei(self) -> u8 {
20540        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
20541    }
20542
20543    /// Sets the value of the `SpecSEI` field.
20544    pub const fn set_specsei(&mut self, value: u8) {
20545        let offset = Self::SPECSEI_SHIFT;
20546        assert!(value & (Self::SPECSEI_MASK as u8) == value);
20547        *self = Self::from_bits_retain(
20548            (self.bits() & !(Self::SPECSEI_MASK << offset)) | ((value as u32) << offset),
20549        );
20550    }
20551
20552    /// Returns a copy with the `SpecSEI` field set to the given value.
20553    pub const fn with_specsei(mut self, value: u8) -> Self {
20554        self.set_specsei(value);
20555        self
20556    }
20557
20558    /// Returns the value of the `AC2` field.
20559    pub const fn ac2(self) -> u8 {
20560        ((self.bits() >> Self::AC2_SHIFT) & 0b1111) as u8
20561    }
20562
20563    /// Sets the value of the `AC2` field.
20564    pub const fn set_ac2(&mut self, value: u8) {
20565        let offset = Self::AC2_SHIFT;
20566        assert!(value & (Self::AC2_MASK as u8) == value);
20567        *self = Self::from_bits_retain(
20568            (self.bits() & !(Self::AC2_MASK << offset)) | ((value as u32) << offset),
20569        );
20570    }
20571
20572    /// Returns a copy with the `AC2` field set to the given value.
20573    pub const fn with_ac2(mut self, value: u8) -> Self {
20574        self.set_ac2(value);
20575        self
20576    }
20577
20578    /// Returns the value of the `XNX` field.
20579    pub const fn xnx(self) -> u8 {
20580        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
20581    }
20582
20583    /// Sets the value of the `XNX` field.
20584    pub const fn set_xnx(&mut self, value: u8) {
20585        let offset = Self::XNX_SHIFT;
20586        assert!(value & (Self::XNX_MASK as u8) == value);
20587        *self = Self::from_bits_retain(
20588            (self.bits() & !(Self::XNX_MASK << offset)) | ((value as u32) << offset),
20589        );
20590    }
20591
20592    /// Returns a copy with the `XNX` field set to the given value.
20593    pub const fn with_xnx(mut self, value: u8) -> Self {
20594        self.set_xnx(value);
20595        self
20596    }
20597
20598    /// Returns the value of the `CnP` field.
20599    pub const fn cnp(self) -> u8 {
20600        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
20601    }
20602
20603    /// Sets the value of the `CnP` field.
20604    pub const fn set_cnp(&mut self, value: u8) {
20605        let offset = Self::CNP_SHIFT;
20606        assert!(value & (Self::CNP_MASK as u8) == value);
20607        *self = Self::from_bits_retain(
20608            (self.bits() & !(Self::CNP_MASK << offset)) | ((value as u32) << offset),
20609        );
20610    }
20611
20612    /// Returns a copy with the `CnP` field set to the given value.
20613    pub const fn with_cnp(mut self, value: u8) -> Self {
20614        self.set_cnp(value);
20615        self
20616    }
20617
20618    /// Returns the value of the `HPDS` field.
20619    pub const fn hpds(self) -> u8 {
20620        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
20621    }
20622
20623    /// Sets the value of the `HPDS` field.
20624    pub const fn set_hpds(&mut self, value: u8) {
20625        let offset = Self::HPDS_SHIFT;
20626        assert!(value & (Self::HPDS_MASK as u8) == value);
20627        *self = Self::from_bits_retain(
20628            (self.bits() & !(Self::HPDS_MASK << offset)) | ((value as u32) << offset),
20629        );
20630    }
20631
20632    /// Returns a copy with the `HPDS` field set to the given value.
20633    pub const fn with_hpds(mut self, value: u8) -> Self {
20634        self.set_hpds(value);
20635        self
20636    }
20637
20638    /// Returns the value of the `LSM` field.
20639    pub const fn lsm(self) -> u8 {
20640        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
20641    }
20642
20643    /// Sets the value of the `LSM` field.
20644    pub const fn set_lsm(&mut self, value: u8) {
20645        let offset = Self::LSM_SHIFT;
20646        assert!(value & (Self::LSM_MASK as u8) == value);
20647        *self = Self::from_bits_retain(
20648            (self.bits() & !(Self::LSM_MASK << offset)) | ((value as u32) << offset),
20649        );
20650    }
20651
20652    /// Returns a copy with the `LSM` field set to the given value.
20653    pub const fn with_lsm(mut self, value: u8) -> Self {
20654        self.set_lsm(value);
20655        self
20656    }
20657
20658    /// Returns the value of the `CCIDX` field.
20659    pub const fn ccidx(self) -> u8 {
20660        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
20661    }
20662
20663    /// Sets the value of the `CCIDX` field.
20664    pub const fn set_ccidx(&mut self, value: u8) {
20665        let offset = Self::CCIDX_SHIFT;
20666        assert!(value & (Self::CCIDX_MASK as u8) == value);
20667        *self = Self::from_bits_retain(
20668            (self.bits() & !(Self::CCIDX_MASK << offset)) | ((value as u32) << offset),
20669        );
20670    }
20671
20672    /// Returns a copy with the `CCIDX` field set to the given value.
20673    pub const fn with_ccidx(mut self, value: u8) -> Self {
20674        self.set_ccidx(value);
20675        self
20676    }
20677
20678    /// Returns the value of the `EVT` field.
20679    pub const fn evt(self) -> u8 {
20680        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
20681    }
20682
20683    /// Sets the value of the `EVT` field.
20684    pub const fn set_evt(&mut self, value: u8) {
20685        let offset = Self::EVT_SHIFT;
20686        assert!(value & (Self::EVT_MASK as u8) == value);
20687        *self = Self::from_bits_retain(
20688            (self.bits() & !(Self::EVT_MASK << offset)) | ((value as u32) << offset),
20689        );
20690    }
20691
20692    /// Returns a copy with the `EVT` field set to the given value.
20693    pub const fn with_evt(mut self, value: u8) -> Self {
20694        self.set_evt(value);
20695        self
20696    }
20697}
20698
20699bitflags! {
20700    /// `ID_MMFR5` system register value.
20701    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20702    #[repr(transparent)]
20703    pub struct IdMmfr5: u32 {
20704    }
20705}
20706
20707impl IdMmfr5 {
20708    /// Offset of the `ETS` field.
20709    pub const ETS_SHIFT: u32 = 0;
20710    /// Mask for the `ETS` field.
20711    pub const ETS_MASK: u32 = 0b1111;
20712    /// Offset of the `nTLBPA` field.
20713    pub const NTLBPA_SHIFT: u32 = 4;
20714    /// Mask for the `nTLBPA` field.
20715    pub const NTLBPA_MASK: u32 = 0b1111;
20716
20717    /// Returns the value of the `ETS` field.
20718    pub const fn ets(self) -> u8 {
20719        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
20720    }
20721
20722    /// Sets the value of the `ETS` field.
20723    pub const fn set_ets(&mut self, value: u8) {
20724        let offset = Self::ETS_SHIFT;
20725        assert!(value & (Self::ETS_MASK as u8) == value);
20726        *self = Self::from_bits_retain(
20727            (self.bits() & !(Self::ETS_MASK << offset)) | ((value as u32) << offset),
20728        );
20729    }
20730
20731    /// Returns a copy with the `ETS` field set to the given value.
20732    pub const fn with_ets(mut self, value: u8) -> Self {
20733        self.set_ets(value);
20734        self
20735    }
20736
20737    /// Returns the value of the `nTLBPA` field.
20738    pub const fn ntlbpa(self) -> u8 {
20739        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
20740    }
20741
20742    /// Sets the value of the `nTLBPA` field.
20743    pub const fn set_ntlbpa(&mut self, value: u8) {
20744        let offset = Self::NTLBPA_SHIFT;
20745        assert!(value & (Self::NTLBPA_MASK as u8) == value);
20746        *self = Self::from_bits_retain(
20747            (self.bits() & !(Self::NTLBPA_MASK << offset)) | ((value as u32) << offset),
20748        );
20749    }
20750
20751    /// Returns a copy with the `nTLBPA` field set to the given value.
20752    pub const fn with_ntlbpa(mut self, value: u8) -> Self {
20753        self.set_ntlbpa(value);
20754        self
20755    }
20756}
20757
20758bitflags! {
20759    /// `ID_PFR0` system register value.
20760    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20761    #[repr(transparent)]
20762    pub struct IdPfr0: u32 {
20763    }
20764}
20765
20766impl IdPfr0 {
20767    /// Offset of the `State0` field.
20768    pub const STATE0_SHIFT: u32 = 0;
20769    /// Mask for the `State0` field.
20770    pub const STATE0_MASK: u32 = 0b1111;
20771    /// Offset of the `State1` field.
20772    pub const STATE1_SHIFT: u32 = 4;
20773    /// Mask for the `State1` field.
20774    pub const STATE1_MASK: u32 = 0b1111;
20775    /// Offset of the `State2` field.
20776    pub const STATE2_SHIFT: u32 = 8;
20777    /// Mask for the `State2` field.
20778    pub const STATE2_MASK: u32 = 0b1111;
20779    /// Offset of the `State3` field.
20780    pub const STATE3_SHIFT: u32 = 12;
20781    /// Mask for the `State3` field.
20782    pub const STATE3_MASK: u32 = 0b1111;
20783    /// Offset of the `CSV2` field.
20784    pub const CSV2_SHIFT: u32 = 16;
20785    /// Mask for the `CSV2` field.
20786    pub const CSV2_MASK: u32 = 0b1111;
20787    /// Offset of the `AMU` field.
20788    pub const AMU_SHIFT: u32 = 20;
20789    /// Mask for the `AMU` field.
20790    pub const AMU_MASK: u32 = 0b1111;
20791    /// Offset of the `DIT` field.
20792    pub const DIT_SHIFT: u32 = 24;
20793    /// Mask for the `DIT` field.
20794    pub const DIT_MASK: u32 = 0b1111;
20795    /// Offset of the `RAS` field.
20796    pub const RAS_SHIFT: u32 = 28;
20797    /// Mask for the `RAS` field.
20798    pub const RAS_MASK: u32 = 0b1111;
20799
20800    /// Returns the value of the `State0` field.
20801    pub const fn state0(self) -> u8 {
20802        ((self.bits() >> Self::STATE0_SHIFT) & 0b1111) as u8
20803    }
20804
20805    /// Sets the value of the `State0` field.
20806    pub const fn set_state0(&mut self, value: u8) {
20807        let offset = Self::STATE0_SHIFT;
20808        assert!(value & (Self::STATE0_MASK as u8) == value);
20809        *self = Self::from_bits_retain(
20810            (self.bits() & !(Self::STATE0_MASK << offset)) | ((value as u32) << offset),
20811        );
20812    }
20813
20814    /// Returns a copy with the `State0` field set to the given value.
20815    pub const fn with_state0(mut self, value: u8) -> Self {
20816        self.set_state0(value);
20817        self
20818    }
20819
20820    /// Returns the value of the `State1` field.
20821    pub const fn state1(self) -> u8 {
20822        ((self.bits() >> Self::STATE1_SHIFT) & 0b1111) as u8
20823    }
20824
20825    /// Sets the value of the `State1` field.
20826    pub const fn set_state1(&mut self, value: u8) {
20827        let offset = Self::STATE1_SHIFT;
20828        assert!(value & (Self::STATE1_MASK as u8) == value);
20829        *self = Self::from_bits_retain(
20830            (self.bits() & !(Self::STATE1_MASK << offset)) | ((value as u32) << offset),
20831        );
20832    }
20833
20834    /// Returns a copy with the `State1` field set to the given value.
20835    pub const fn with_state1(mut self, value: u8) -> Self {
20836        self.set_state1(value);
20837        self
20838    }
20839
20840    /// Returns the value of the `State2` field.
20841    pub const fn state2(self) -> u8 {
20842        ((self.bits() >> Self::STATE2_SHIFT) & 0b1111) as u8
20843    }
20844
20845    /// Sets the value of the `State2` field.
20846    pub const fn set_state2(&mut self, value: u8) {
20847        let offset = Self::STATE2_SHIFT;
20848        assert!(value & (Self::STATE2_MASK as u8) == value);
20849        *self = Self::from_bits_retain(
20850            (self.bits() & !(Self::STATE2_MASK << offset)) | ((value as u32) << offset),
20851        );
20852    }
20853
20854    /// Returns a copy with the `State2` field set to the given value.
20855    pub const fn with_state2(mut self, value: u8) -> Self {
20856        self.set_state2(value);
20857        self
20858    }
20859
20860    /// Returns the value of the `State3` field.
20861    pub const fn state3(self) -> u8 {
20862        ((self.bits() >> Self::STATE3_SHIFT) & 0b1111) as u8
20863    }
20864
20865    /// Sets the value of the `State3` field.
20866    pub const fn set_state3(&mut self, value: u8) {
20867        let offset = Self::STATE3_SHIFT;
20868        assert!(value & (Self::STATE3_MASK as u8) == value);
20869        *self = Self::from_bits_retain(
20870            (self.bits() & !(Self::STATE3_MASK << offset)) | ((value as u32) << offset),
20871        );
20872    }
20873
20874    /// Returns a copy with the `State3` field set to the given value.
20875    pub const fn with_state3(mut self, value: u8) -> Self {
20876        self.set_state3(value);
20877        self
20878    }
20879
20880    /// Returns the value of the `CSV2` field.
20881    pub const fn csv2(self) -> u8 {
20882        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
20883    }
20884
20885    /// Sets the value of the `CSV2` field.
20886    pub const fn set_csv2(&mut self, value: u8) {
20887        let offset = Self::CSV2_SHIFT;
20888        assert!(value & (Self::CSV2_MASK as u8) == value);
20889        *self = Self::from_bits_retain(
20890            (self.bits() & !(Self::CSV2_MASK << offset)) | ((value as u32) << offset),
20891        );
20892    }
20893
20894    /// Returns a copy with the `CSV2` field set to the given value.
20895    pub const fn with_csv2(mut self, value: u8) -> Self {
20896        self.set_csv2(value);
20897        self
20898    }
20899
20900    /// Returns the value of the `AMU` field.
20901    pub const fn amu(self) -> u8 {
20902        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
20903    }
20904
20905    /// Sets the value of the `AMU` field.
20906    pub const fn set_amu(&mut self, value: u8) {
20907        let offset = Self::AMU_SHIFT;
20908        assert!(value & (Self::AMU_MASK as u8) == value);
20909        *self = Self::from_bits_retain(
20910            (self.bits() & !(Self::AMU_MASK << offset)) | ((value as u32) << offset),
20911        );
20912    }
20913
20914    /// Returns a copy with the `AMU` field set to the given value.
20915    pub const fn with_amu(mut self, value: u8) -> Self {
20916        self.set_amu(value);
20917        self
20918    }
20919
20920    /// Returns the value of the `DIT` field.
20921    pub const fn dit(self) -> u8 {
20922        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
20923    }
20924
20925    /// Sets the value of the `DIT` field.
20926    pub const fn set_dit(&mut self, value: u8) {
20927        let offset = Self::DIT_SHIFT;
20928        assert!(value & (Self::DIT_MASK as u8) == value);
20929        *self = Self::from_bits_retain(
20930            (self.bits() & !(Self::DIT_MASK << offset)) | ((value as u32) << offset),
20931        );
20932    }
20933
20934    /// Returns a copy with the `DIT` field set to the given value.
20935    pub const fn with_dit(mut self, value: u8) -> Self {
20936        self.set_dit(value);
20937        self
20938    }
20939
20940    /// Returns the value of the `RAS` field.
20941    pub const fn ras(self) -> u8 {
20942        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
20943    }
20944
20945    /// Sets the value of the `RAS` field.
20946    pub const fn set_ras(&mut self, value: u8) {
20947        let offset = Self::RAS_SHIFT;
20948        assert!(value & (Self::RAS_MASK as u8) == value);
20949        *self = Self::from_bits_retain(
20950            (self.bits() & !(Self::RAS_MASK << offset)) | ((value as u32) << offset),
20951        );
20952    }
20953
20954    /// Returns a copy with the `RAS` field set to the given value.
20955    pub const fn with_ras(mut self, value: u8) -> Self {
20956        self.set_ras(value);
20957        self
20958    }
20959}
20960
20961bitflags! {
20962    /// `ID_PFR1` system register value.
20963    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20964    #[repr(transparent)]
20965    pub struct IdPfr1: u32 {
20966    }
20967}
20968
20969impl IdPfr1 {
20970    /// Offset of the `ProgMod` field.
20971    pub const PROGMOD_SHIFT: u32 = 0;
20972    /// Mask for the `ProgMod` field.
20973    pub const PROGMOD_MASK: u32 = 0b1111;
20974    /// Offset of the `Security` field.
20975    pub const SECURITY_SHIFT: u32 = 4;
20976    /// Mask for the `Security` field.
20977    pub const SECURITY_MASK: u32 = 0b1111;
20978    /// Offset of the `MProgMod` field.
20979    pub const MPROGMOD_SHIFT: u32 = 8;
20980    /// Mask for the `MProgMod` field.
20981    pub const MPROGMOD_MASK: u32 = 0b1111;
20982    /// Offset of the `Virtualization` field.
20983    pub const VIRTUALIZATION_SHIFT: u32 = 12;
20984    /// Mask for the `Virtualization` field.
20985    pub const VIRTUALIZATION_MASK: u32 = 0b1111;
20986    /// Offset of the `GenTimer` field.
20987    pub const GENTIMER_SHIFT: u32 = 16;
20988    /// Mask for the `GenTimer` field.
20989    pub const GENTIMER_MASK: u32 = 0b1111;
20990    /// Offset of the `Sec_frac` field.
20991    pub const SEC_FRAC_SHIFT: u32 = 20;
20992    /// Mask for the `Sec_frac` field.
20993    pub const SEC_FRAC_MASK: u32 = 0b1111;
20994    /// Offset of the `Virt_frac` field.
20995    pub const VIRT_FRAC_SHIFT: u32 = 24;
20996    /// Mask for the `Virt_frac` field.
20997    pub const VIRT_FRAC_MASK: u32 = 0b1111;
20998    /// Offset of the `GIC` field.
20999    pub const GIC_SHIFT: u32 = 28;
21000    /// Mask for the `GIC` field.
21001    pub const GIC_MASK: u32 = 0b1111;
21002
21003    /// Returns the value of the `ProgMod` field.
21004    pub const fn progmod(self) -> u8 {
21005        ((self.bits() >> Self::PROGMOD_SHIFT) & 0b1111) as u8
21006    }
21007
21008    /// Sets the value of the `ProgMod` field.
21009    pub const fn set_progmod(&mut self, value: u8) {
21010        let offset = Self::PROGMOD_SHIFT;
21011        assert!(value & (Self::PROGMOD_MASK as u8) == value);
21012        *self = Self::from_bits_retain(
21013            (self.bits() & !(Self::PROGMOD_MASK << offset)) | ((value as u32) << offset),
21014        );
21015    }
21016
21017    /// Returns a copy with the `ProgMod` field set to the given value.
21018    pub const fn with_progmod(mut self, value: u8) -> Self {
21019        self.set_progmod(value);
21020        self
21021    }
21022
21023    /// Returns the value of the `Security` field.
21024    pub const fn security(self) -> u8 {
21025        ((self.bits() >> Self::SECURITY_SHIFT) & 0b1111) as u8
21026    }
21027
21028    /// Sets the value of the `Security` field.
21029    pub const fn set_security(&mut self, value: u8) {
21030        let offset = Self::SECURITY_SHIFT;
21031        assert!(value & (Self::SECURITY_MASK as u8) == value);
21032        *self = Self::from_bits_retain(
21033            (self.bits() & !(Self::SECURITY_MASK << offset)) | ((value as u32) << offset),
21034        );
21035    }
21036
21037    /// Returns a copy with the `Security` field set to the given value.
21038    pub const fn with_security(mut self, value: u8) -> Self {
21039        self.set_security(value);
21040        self
21041    }
21042
21043    /// Returns the value of the `MProgMod` field.
21044    pub const fn mprogmod(self) -> u8 {
21045        ((self.bits() >> Self::MPROGMOD_SHIFT) & 0b1111) as u8
21046    }
21047
21048    /// Sets the value of the `MProgMod` field.
21049    pub const fn set_mprogmod(&mut self, value: u8) {
21050        let offset = Self::MPROGMOD_SHIFT;
21051        assert!(value & (Self::MPROGMOD_MASK as u8) == value);
21052        *self = Self::from_bits_retain(
21053            (self.bits() & !(Self::MPROGMOD_MASK << offset)) | ((value as u32) << offset),
21054        );
21055    }
21056
21057    /// Returns a copy with the `MProgMod` field set to the given value.
21058    pub const fn with_mprogmod(mut self, value: u8) -> Self {
21059        self.set_mprogmod(value);
21060        self
21061    }
21062
21063    /// Returns the value of the `Virtualization` field.
21064    pub const fn virtualization(self) -> u8 {
21065        ((self.bits() >> Self::VIRTUALIZATION_SHIFT) & 0b1111) as u8
21066    }
21067
21068    /// Sets the value of the `Virtualization` field.
21069    pub const fn set_virtualization(&mut self, value: u8) {
21070        let offset = Self::VIRTUALIZATION_SHIFT;
21071        assert!(value & (Self::VIRTUALIZATION_MASK as u8) == value);
21072        *self = Self::from_bits_retain(
21073            (self.bits() & !(Self::VIRTUALIZATION_MASK << offset)) | ((value as u32) << offset),
21074        );
21075    }
21076
21077    /// Returns a copy with the `Virtualization` field set to the given value.
21078    pub const fn with_virtualization(mut self, value: u8) -> Self {
21079        self.set_virtualization(value);
21080        self
21081    }
21082
21083    /// Returns the value of the `GenTimer` field.
21084    pub const fn gentimer(self) -> u8 {
21085        ((self.bits() >> Self::GENTIMER_SHIFT) & 0b1111) as u8
21086    }
21087
21088    /// Sets the value of the `GenTimer` field.
21089    pub const fn set_gentimer(&mut self, value: u8) {
21090        let offset = Self::GENTIMER_SHIFT;
21091        assert!(value & (Self::GENTIMER_MASK as u8) == value);
21092        *self = Self::from_bits_retain(
21093            (self.bits() & !(Self::GENTIMER_MASK << offset)) | ((value as u32) << offset),
21094        );
21095    }
21096
21097    /// Returns a copy with the `GenTimer` field set to the given value.
21098    pub const fn with_gentimer(mut self, value: u8) -> Self {
21099        self.set_gentimer(value);
21100        self
21101    }
21102
21103    /// Returns the value of the `Sec_frac` field.
21104    pub const fn sec_frac(self) -> u8 {
21105        ((self.bits() >> Self::SEC_FRAC_SHIFT) & 0b1111) as u8
21106    }
21107
21108    /// Sets the value of the `Sec_frac` field.
21109    pub const fn set_sec_frac(&mut self, value: u8) {
21110        let offset = Self::SEC_FRAC_SHIFT;
21111        assert!(value & (Self::SEC_FRAC_MASK as u8) == value);
21112        *self = Self::from_bits_retain(
21113            (self.bits() & !(Self::SEC_FRAC_MASK << offset)) | ((value as u32) << offset),
21114        );
21115    }
21116
21117    /// Returns a copy with the `Sec_frac` field set to the given value.
21118    pub const fn with_sec_frac(mut self, value: u8) -> Self {
21119        self.set_sec_frac(value);
21120        self
21121    }
21122
21123    /// Returns the value of the `Virt_frac` field.
21124    pub const fn virt_frac(self) -> u8 {
21125        ((self.bits() >> Self::VIRT_FRAC_SHIFT) & 0b1111) as u8
21126    }
21127
21128    /// Sets the value of the `Virt_frac` field.
21129    pub const fn set_virt_frac(&mut self, value: u8) {
21130        let offset = Self::VIRT_FRAC_SHIFT;
21131        assert!(value & (Self::VIRT_FRAC_MASK as u8) == value);
21132        *self = Self::from_bits_retain(
21133            (self.bits() & !(Self::VIRT_FRAC_MASK << offset)) | ((value as u32) << offset),
21134        );
21135    }
21136
21137    /// Returns a copy with the `Virt_frac` field set to the given value.
21138    pub const fn with_virt_frac(mut self, value: u8) -> Self {
21139        self.set_virt_frac(value);
21140        self
21141    }
21142
21143    /// Returns the value of the `GIC` field.
21144    pub const fn gic(self) -> u8 {
21145        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
21146    }
21147
21148    /// Sets the value of the `GIC` field.
21149    pub const fn set_gic(&mut self, value: u8) {
21150        let offset = Self::GIC_SHIFT;
21151        assert!(value & (Self::GIC_MASK as u8) == value);
21152        *self = Self::from_bits_retain(
21153            (self.bits() & !(Self::GIC_MASK << offset)) | ((value as u32) << offset),
21154        );
21155    }
21156
21157    /// Returns a copy with the `GIC` field set to the given value.
21158    pub const fn with_gic(mut self, value: u8) -> Self {
21159        self.set_gic(value);
21160        self
21161    }
21162}
21163
21164bitflags! {
21165    /// `ID_PFR2` system register value.
21166    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21167    #[repr(transparent)]
21168    pub struct IdPfr2: u32 {
21169    }
21170}
21171
21172impl IdPfr2 {
21173    /// Offset of the `CSV3` field.
21174    pub const CSV3_SHIFT: u32 = 0;
21175    /// Mask for the `CSV3` field.
21176    pub const CSV3_MASK: u32 = 0b1111;
21177    /// Offset of the `SSBS` field.
21178    pub const SSBS_SHIFT: u32 = 4;
21179    /// Mask for the `SSBS` field.
21180    pub const SSBS_MASK: u32 = 0b1111;
21181    /// Offset of the `RAS_frac` field.
21182    pub const RAS_FRAC_SHIFT: u32 = 8;
21183    /// Mask for the `RAS_frac` field.
21184    pub const RAS_FRAC_MASK: u32 = 0b1111;
21185
21186    /// Returns the value of the `CSV3` field.
21187    pub const fn csv3(self) -> u8 {
21188        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
21189    }
21190
21191    /// Sets the value of the `CSV3` field.
21192    pub const fn set_csv3(&mut self, value: u8) {
21193        let offset = Self::CSV3_SHIFT;
21194        assert!(value & (Self::CSV3_MASK as u8) == value);
21195        *self = Self::from_bits_retain(
21196            (self.bits() & !(Self::CSV3_MASK << offset)) | ((value as u32) << offset),
21197        );
21198    }
21199
21200    /// Returns a copy with the `CSV3` field set to the given value.
21201    pub const fn with_csv3(mut self, value: u8) -> Self {
21202        self.set_csv3(value);
21203        self
21204    }
21205
21206    /// Returns the value of the `SSBS` field.
21207    pub const fn ssbs(self) -> u8 {
21208        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
21209    }
21210
21211    /// Sets the value of the `SSBS` field.
21212    pub const fn set_ssbs(&mut self, value: u8) {
21213        let offset = Self::SSBS_SHIFT;
21214        assert!(value & (Self::SSBS_MASK as u8) == value);
21215        *self = Self::from_bits_retain(
21216            (self.bits() & !(Self::SSBS_MASK << offset)) | ((value as u32) << offset),
21217        );
21218    }
21219
21220    /// Returns a copy with the `SSBS` field set to the given value.
21221    pub const fn with_ssbs(mut self, value: u8) -> Self {
21222        self.set_ssbs(value);
21223        self
21224    }
21225
21226    /// Returns the value of the `RAS_frac` field.
21227    pub const fn ras_frac(self) -> u8 {
21228        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
21229    }
21230
21231    /// Sets the value of the `RAS_frac` field.
21232    pub const fn set_ras_frac(&mut self, value: u8) {
21233        let offset = Self::RAS_FRAC_SHIFT;
21234        assert!(value & (Self::RAS_FRAC_MASK as u8) == value);
21235        *self = Self::from_bits_retain(
21236            (self.bits() & !(Self::RAS_FRAC_MASK << offset)) | ((value as u32) << offset),
21237        );
21238    }
21239
21240    /// Returns a copy with the `RAS_frac` field set to the given value.
21241    pub const fn with_ras_frac(mut self, value: u8) -> Self {
21242        self.set_ras_frac(value);
21243        self
21244    }
21245}
21246
21247bitflags! {
21248    /// `IFAR` system register value.
21249    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21250    #[repr(transparent)]
21251    pub struct Ifar: u32 {
21252    }
21253}
21254
21255impl Ifar {
21256    /// Offset of the `VA` field.
21257    pub const VA_SHIFT: u32 = 0;
21258    /// Mask for the `VA` field.
21259    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
21260
21261    /// Returns the value of the `VA` field.
21262    pub const fn va(self) -> u32 {
21263        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
21264    }
21265
21266    /// Sets the value of the `VA` field.
21267    pub const fn set_va(&mut self, value: u32) {
21268        let offset = Self::VA_SHIFT;
21269        assert!(value & (Self::VA_MASK as u32) == value);
21270        *self = Self::from_bits_retain(
21271            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
21272        );
21273    }
21274
21275    /// Returns a copy with the `VA` field set to the given value.
21276    pub const fn with_va(mut self, value: u32) -> Self {
21277        self.set_va(value);
21278        self
21279    }
21280}
21281
21282bitflags! {
21283    /// `IFSR` system register value.
21284    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21285    #[repr(transparent)]
21286    pub struct Ifsr: u32 {
21287        /// `LPAE` bit.
21288        const LPAE = 1 << 9;
21289        /// `ExT` bit.
21290        const EXT = 1 << 12;
21291        /// `FnV` bit.
21292        const FNV = 1 << 16;
21293    }
21294}
21295
21296impl Ifsr {
21297    /// Offset of the `STATUS` field.
21298    pub const STATUS_SHIFT: u32 = 0;
21299    /// Mask for the `STATUS` field.
21300    pub const STATUS_MASK: u32 = 0b111111;
21301    /// Offset of the `LPAE` field.
21302    pub const LPAE_SHIFT: u32 = 9;
21303    /// Offset of the `ExT` field.
21304    pub const EXT_SHIFT: u32 = 12;
21305    /// Offset of the `FnV` field.
21306    pub const FNV_SHIFT: u32 = 16;
21307
21308    /// Returns the value of the `STATUS` field.
21309    pub const fn status(self) -> u8 {
21310        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
21311    }
21312
21313    /// Sets the value of the `STATUS` field.
21314    pub const fn set_status(&mut self, value: u8) {
21315        let offset = Self::STATUS_SHIFT;
21316        assert!(value & (Self::STATUS_MASK as u8) == value);
21317        *self = Self::from_bits_retain(
21318            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
21319        );
21320    }
21321
21322    /// Returns a copy with the `STATUS` field set to the given value.
21323    pub const fn with_status(mut self, value: u8) -> Self {
21324        self.set_status(value);
21325        self
21326    }
21327}
21328
21329bitflags! {
21330    /// `ISR` system register value.
21331    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21332    #[repr(transparent)]
21333    pub struct Isr: u32 {
21334        /// `F` bit.
21335        const F = 1 << 6;
21336        /// `I` bit.
21337        const I = 1 << 7;
21338        /// `A` bit.
21339        const A = 1 << 8;
21340    }
21341}
21342
21343impl Isr {
21344    /// Offset of the `F` field.
21345    pub const F_SHIFT: u32 = 6;
21346    /// Offset of the `I` field.
21347    pub const I_SHIFT: u32 = 7;
21348    /// Offset of the `A` field.
21349    pub const A_SHIFT: u32 = 8;
21350}
21351
21352#[cfg(feature = "el1")]
21353bitflags! {
21354    /// `ISR_EL1` system register value.
21355    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21356    #[repr(transparent)]
21357    pub struct IsrEl1: u64 {
21358        /// `F` bit.
21359        const F = 1 << 6;
21360        /// `I` bit.
21361        const I = 1 << 7;
21362        /// `A` bit.
21363        const A = 1 << 8;
21364        /// `FS` bit.
21365        const FS = 1 << 9;
21366        /// `IS` bit.
21367        const IS = 1 << 10;
21368    }
21369}
21370
21371#[cfg(feature = "el1")]
21372impl IsrEl1 {
21373    /// Offset of the `F` field.
21374    pub const F_SHIFT: u32 = 6;
21375    /// Offset of the `I` field.
21376    pub const I_SHIFT: u32 = 7;
21377    /// Offset of the `A` field.
21378    pub const A_SHIFT: u32 = 8;
21379    /// Offset of the `FS` field.
21380    pub const FS_SHIFT: u32 = 9;
21381    /// Offset of the `IS` field.
21382    pub const IS_SHIFT: u32 = 10;
21383}
21384
21385bitflags! {
21386    /// `MAIR0` system register value.
21387    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21388    #[repr(transparent)]
21389    pub struct Mair0: u32 {
21390    }
21391}
21392
21393impl Mair0 {
21394    /// Offset of the `Attr<n>` field.
21395    pub const ATTR_SHIFT: u32 = 0;
21396    /// Mask for the `Attr<n>` field.
21397    pub const ATTR_MASK: u32 = 0b11111111;
21398
21399    /// Returns the value of the given `Attr<n>` field.
21400    pub const fn attr(self, n: u32) -> u8 {
21401        assert!(n < 4);
21402        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
21403    }
21404
21405    /// Sets the value of the `Attr<n>` field.
21406    pub const fn set_attr(&mut self, n: u32, value: u8) {
21407        assert!(n < 4);
21408        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
21409        assert!(value & (Self::ATTR_MASK as u8) == value);
21410        *self = Self::from_bits_retain(
21411            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
21412        );
21413    }
21414
21415    /// Returns a copy with the `Attr<n>` field set to the given value.
21416    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
21417        self.set_attr(n, value);
21418        self
21419    }
21420}
21421
21422bitflags! {
21423    /// `MAIR1` system register value.
21424    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21425    #[repr(transparent)]
21426    pub struct Mair1: u32 {
21427    }
21428}
21429
21430impl Mair1 {
21431    /// Offset of the `Attr<n>` field.
21432    pub const ATTR_SHIFT: u32 = 0;
21433    /// Mask for the `Attr<n>` field.
21434    pub const ATTR_MASK: u32 = 0b11111111;
21435
21436    /// Returns the value of the given `Attr<n>` field.
21437    pub const fn attr(self, n: u32) -> u8 {
21438        assert!(n >= 4 && n < 8);
21439        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
21440    }
21441
21442    /// Sets the value of the `Attr<n>` field.
21443    pub const fn set_attr(&mut self, n: u32, value: u8) {
21444        assert!(n >= 4 && n < 8);
21445        let offset = Self::ATTR_SHIFT + (n - 4) * 8;
21446        assert!(value & (Self::ATTR_MASK as u8) == value);
21447        *self = Self::from_bits_retain(
21448            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
21449        );
21450    }
21451
21452    /// Returns a copy with the `Attr<n>` field set to the given value.
21453    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
21454        self.set_attr(n, value);
21455        self
21456    }
21457}
21458
21459#[cfg(feature = "el1")]
21460bitflags! {
21461    /// `MAIR_EL1` system register value.
21462    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21463    #[repr(transparent)]
21464    pub struct MairEl1: u64 {
21465    }
21466}
21467
21468#[cfg(feature = "el1")]
21469impl MairEl1 {
21470    /// Offset of the `Attr<n>` field.
21471    pub const ATTR_SHIFT: u32 = 0;
21472    /// Mask for the `Attr<n>` field.
21473    pub const ATTR_MASK: u64 = 0b11111111;
21474
21475    /// Returns the value of the given `Attr<n>` field.
21476    pub const fn attr(self, n: u32) -> u8 {
21477        assert!(n < 8);
21478        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
21479    }
21480
21481    /// Sets the value of the `Attr<n>` field.
21482    pub const fn set_attr(&mut self, n: u32, value: u8) {
21483        assert!(n < 8);
21484        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
21485        assert!(value & (Self::ATTR_MASK as u8) == value);
21486        *self = Self::from_bits_retain(
21487            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
21488        );
21489    }
21490
21491    /// Returns a copy with the `Attr<n>` field set to the given value.
21492    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
21493        self.set_attr(n, value);
21494        self
21495    }
21496}
21497
21498#[cfg(feature = "el2")]
21499bitflags! {
21500    /// `MAIR_EL2` system register value.
21501    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21502    #[repr(transparent)]
21503    pub struct MairEl2: u64 {
21504    }
21505}
21506
21507#[cfg(feature = "el2")]
21508impl MairEl2 {
21509    /// Offset of the `Attr<n>` field.
21510    pub const ATTR_SHIFT: u32 = 0;
21511    /// Mask for the `Attr<n>` field.
21512    pub const ATTR_MASK: u64 = 0b11111111;
21513
21514    /// Returns the value of the given `Attr<n>` field.
21515    pub const fn attr(self, n: u32) -> u8 {
21516        assert!(n < 8);
21517        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
21518    }
21519
21520    /// Sets the value of the `Attr<n>` field.
21521    pub const fn set_attr(&mut self, n: u32, value: u8) {
21522        assert!(n < 8);
21523        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
21524        assert!(value & (Self::ATTR_MASK as u8) == value);
21525        *self = Self::from_bits_retain(
21526            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
21527        );
21528    }
21529
21530    /// Returns a copy with the `Attr<n>` field set to the given value.
21531    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
21532        self.set_attr(n, value);
21533        self
21534    }
21535}
21536
21537#[cfg(feature = "el3")]
21538bitflags! {
21539    /// `MAIR_EL3` system register value.
21540    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21541    #[repr(transparent)]
21542    pub struct MairEl3: u64 {
21543    }
21544}
21545
21546#[cfg(feature = "el3")]
21547impl MairEl3 {
21548    /// Offset of the `Attr<n>` field.
21549    pub const ATTR_SHIFT: u32 = 0;
21550    /// Mask for the `Attr<n>` field.
21551    pub const ATTR_MASK: u64 = 0b11111111;
21552
21553    /// Returns the value of the given `Attr<n>` field.
21554    pub const fn attr(self, n: u32) -> u8 {
21555        assert!(n < 8);
21556        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
21557    }
21558
21559    /// Sets the value of the `Attr<n>` field.
21560    pub const fn set_attr(&mut self, n: u32, value: u8) {
21561        assert!(n < 8);
21562        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
21563        assert!(value & (Self::ATTR_MASK as u8) == value);
21564        *self = Self::from_bits_retain(
21565            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
21566        );
21567    }
21568
21569    /// Returns a copy with the `Attr<n>` field set to the given value.
21570    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
21571        self.set_attr(n, value);
21572        self
21573    }
21574}
21575
21576#[cfg(feature = "el1")]
21577bitflags! {
21578    /// `MDCCINT_EL1` system register value.
21579    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21580    #[repr(transparent)]
21581    pub struct MdccintEl1: u64 {
21582        /// `TX` bit.
21583        const TX = 1 << 29;
21584        /// `RX` bit.
21585        const RX = 1 << 30;
21586    }
21587}
21588
21589#[cfg(feature = "el1")]
21590impl MdccintEl1 {
21591    /// Offset of the `TX` field.
21592    pub const TX_SHIFT: u32 = 29;
21593    /// Offset of the `RX` field.
21594    pub const RX_SHIFT: u32 = 30;
21595}
21596
21597#[cfg(feature = "el2")]
21598bitflags! {
21599    /// `MDCR_EL2` system register value.
21600    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21601    #[repr(transparent)]
21602    pub struct MdcrEl2: u64 {
21603        /// `TPMCR` bit.
21604        const TPMCR = 1 << 5;
21605        /// `TPM` bit.
21606        const TPM = 1 << 6;
21607        /// `HPME` bit.
21608        const HPME = 1 << 7;
21609        /// `TDE` bit.
21610        const TDE = 1 << 8;
21611        /// `TDA` bit.
21612        const TDA = 1 << 9;
21613        /// `TDOSA` bit.
21614        const TDOSA = 1 << 10;
21615        /// `TDRA` bit.
21616        const TDRA = 1 << 11;
21617        /// `TPMS` bit.
21618        const TPMS = 1 << 14;
21619        /// `EnSPM` bit.
21620        const ENSPM = 1 << 15;
21621        /// `HPMD` bit.
21622        const HPMD = 1 << 17;
21623        /// `TTRF` bit.
21624        const TTRF = 1 << 19;
21625        /// `HCCD` bit.
21626        const HCCD = 1 << 23;
21627        /// `HLP` bit.
21628        const HLP = 1 << 26;
21629        /// `TDCC` bit.
21630        const TDCC = 1 << 27;
21631        /// `MTPME` bit.
21632        const MTPME = 1 << 28;
21633        /// `HPMFZO` bit.
21634        const HPMFZO = 1 << 29;
21635        /// `HPMFZS` bit.
21636        const HPMFZS = 1 << 36;
21637        /// `EBWE` bit.
21638        const EBWE = 1 << 43;
21639        /// `EnSTEPOP` bit.
21640        const ENSTEPOP = 1 << 50;
21641    }
21642}
21643
21644#[cfg(feature = "el2")]
21645impl MdcrEl2 {
21646    /// Offset of the `HPMN` field.
21647    pub const HPMN_SHIFT: u32 = 0;
21648    /// Mask for the `HPMN` field.
21649    pub const HPMN_MASK: u64 = 0b11111;
21650    /// Offset of the `TPMCR` field.
21651    pub const TPMCR_SHIFT: u32 = 5;
21652    /// Offset of the `TPM` field.
21653    pub const TPM_SHIFT: u32 = 6;
21654    /// Offset of the `HPME` field.
21655    pub const HPME_SHIFT: u32 = 7;
21656    /// Offset of the `TDE` field.
21657    pub const TDE_SHIFT: u32 = 8;
21658    /// Offset of the `TDA` field.
21659    pub const TDA_SHIFT: u32 = 9;
21660    /// Offset of the `TDOSA` field.
21661    pub const TDOSA_SHIFT: u32 = 10;
21662    /// Offset of the `TDRA` field.
21663    pub const TDRA_SHIFT: u32 = 11;
21664    /// Offset of the `E2PB` field.
21665    pub const E2PB_SHIFT: u32 = 12;
21666    /// Mask for the `E2PB` field.
21667    pub const E2PB_MASK: u64 = 0b11;
21668    /// Offset of the `TPMS` field.
21669    pub const TPMS_SHIFT: u32 = 14;
21670    /// Offset of the `EnSPM` field.
21671    pub const ENSPM_SHIFT: u32 = 15;
21672    /// Offset of the `HPMD` field.
21673    pub const HPMD_SHIFT: u32 = 17;
21674    /// Offset of the `TTRF` field.
21675    pub const TTRF_SHIFT: u32 = 19;
21676    /// Offset of the `HCCD` field.
21677    pub const HCCD_SHIFT: u32 = 23;
21678    /// Offset of the `E2TB` field.
21679    pub const E2TB_SHIFT: u32 = 24;
21680    /// Mask for the `E2TB` field.
21681    pub const E2TB_MASK: u64 = 0b11;
21682    /// Offset of the `HLP` field.
21683    pub const HLP_SHIFT: u32 = 26;
21684    /// Offset of the `TDCC` field.
21685    pub const TDCC_SHIFT: u32 = 27;
21686    /// Offset of the `MTPME` field.
21687    pub const MTPME_SHIFT: u32 = 28;
21688    /// Offset of the `HPMFZO` field.
21689    pub const HPMFZO_SHIFT: u32 = 29;
21690    /// Offset of the `PMSSE` field.
21691    pub const PMSSE_SHIFT: u32 = 30;
21692    /// Mask for the `PMSSE` field.
21693    pub const PMSSE_MASK: u64 = 0b11;
21694    /// Offset of the `HPMFZS` field.
21695    pub const HPMFZS_SHIFT: u32 = 36;
21696    /// Offset of the `PMEE` field.
21697    pub const PMEE_SHIFT: u32 = 40;
21698    /// Mask for the `PMEE` field.
21699    pub const PMEE_MASK: u64 = 0b11;
21700    /// Offset of the `EBWE` field.
21701    pub const EBWE_SHIFT: u32 = 43;
21702    /// Offset of the `EnSTEPOP` field.
21703    pub const ENSTEPOP_SHIFT: u32 = 50;
21704
21705    /// Returns the value of the `HPMN` field.
21706    pub const fn hpmn(self) -> u8 {
21707        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
21708    }
21709
21710    /// Sets the value of the `HPMN` field.
21711    pub const fn set_hpmn(&mut self, value: u8) {
21712        let offset = Self::HPMN_SHIFT;
21713        assert!(value & (Self::HPMN_MASK as u8) == value);
21714        *self = Self::from_bits_retain(
21715            (self.bits() & !(Self::HPMN_MASK << offset)) | ((value as u64) << offset),
21716        );
21717    }
21718
21719    /// Returns a copy with the `HPMN` field set to the given value.
21720    pub const fn with_hpmn(mut self, value: u8) -> Self {
21721        self.set_hpmn(value);
21722        self
21723    }
21724
21725    /// Returns the value of the `E2PB` field.
21726    pub const fn e2pb(self) -> u8 {
21727        ((self.bits() >> Self::E2PB_SHIFT) & 0b11) as u8
21728    }
21729
21730    /// Sets the value of the `E2PB` field.
21731    pub const fn set_e2pb(&mut self, value: u8) {
21732        let offset = Self::E2PB_SHIFT;
21733        assert!(value & (Self::E2PB_MASK as u8) == value);
21734        *self = Self::from_bits_retain(
21735            (self.bits() & !(Self::E2PB_MASK << offset)) | ((value as u64) << offset),
21736        );
21737    }
21738
21739    /// Returns a copy with the `E2PB` field set to the given value.
21740    pub const fn with_e2pb(mut self, value: u8) -> Self {
21741        self.set_e2pb(value);
21742        self
21743    }
21744
21745    /// Returns the value of the `E2TB` field.
21746    pub const fn e2tb(self) -> u8 {
21747        ((self.bits() >> Self::E2TB_SHIFT) & 0b11) as u8
21748    }
21749
21750    /// Sets the value of the `E2TB` field.
21751    pub const fn set_e2tb(&mut self, value: u8) {
21752        let offset = Self::E2TB_SHIFT;
21753        assert!(value & (Self::E2TB_MASK as u8) == value);
21754        *self = Self::from_bits_retain(
21755            (self.bits() & !(Self::E2TB_MASK << offset)) | ((value as u64) << offset),
21756        );
21757    }
21758
21759    /// Returns a copy with the `E2TB` field set to the given value.
21760    pub const fn with_e2tb(mut self, value: u8) -> Self {
21761        self.set_e2tb(value);
21762        self
21763    }
21764
21765    /// Returns the value of the `PMSSE` field.
21766    pub const fn pmsse(self) -> u8 {
21767        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
21768    }
21769
21770    /// Sets the value of the `PMSSE` field.
21771    pub const fn set_pmsse(&mut self, value: u8) {
21772        let offset = Self::PMSSE_SHIFT;
21773        assert!(value & (Self::PMSSE_MASK as u8) == value);
21774        *self = Self::from_bits_retain(
21775            (self.bits() & !(Self::PMSSE_MASK << offset)) | ((value as u64) << offset),
21776        );
21777    }
21778
21779    /// Returns a copy with the `PMSSE` field set to the given value.
21780    pub const fn with_pmsse(mut self, value: u8) -> Self {
21781        self.set_pmsse(value);
21782        self
21783    }
21784
21785    /// Returns the value of the `PMEE` field.
21786    pub const fn pmee(self) -> u8 {
21787        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
21788    }
21789
21790    /// Sets the value of the `PMEE` field.
21791    pub const fn set_pmee(&mut self, value: u8) {
21792        let offset = Self::PMEE_SHIFT;
21793        assert!(value & (Self::PMEE_MASK as u8) == value);
21794        *self = Self::from_bits_retain(
21795            (self.bits() & !(Self::PMEE_MASK << offset)) | ((value as u64) << offset),
21796        );
21797    }
21798
21799    /// Returns a copy with the `PMEE` field set to the given value.
21800    pub const fn with_pmee(mut self, value: u8) -> Self {
21801        self.set_pmee(value);
21802        self
21803    }
21804}
21805
21806#[cfg(feature = "el3")]
21807bitflags! {
21808    /// `MDCR_EL3` system register value.
21809    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21810    #[repr(transparent)]
21811    pub struct MdcrEl3: u64 {
21812        /// Realm Trace enable. Enables tracing in Realm state.
21813        const RLTE = 1 << 0;
21814        /// `EPMADE` bit.
21815        const EPMADE = 1 << 2;
21816        /// `ETADE` bit.
21817        const ETADE = 1 << 3;
21818        /// `EDADE` bit.
21819        const EDADE = 1 << 4;
21820        /// Trap Performance Monitor register accesses
21821        const TPM = 1 << 6;
21822        /// Do not trap various PMUv3p9 related system register accesses to EL3.
21823        const ENPM2 = 1 << 7;
21824        /// `TDA` bit.
21825        const TDA = 1 << 9;
21826        /// `TDOSA` bit.
21827        const TDOSA = 1 << 10;
21828        /// 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.
21829        const NSPBE = 1 << 11;
21830        /// 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.
21831        const SDD = 1 << 16;
21832        /// Secure Performance Monitors Enable. Controls event counting in Secure state and EL3.
21833        const SPME = 1 << 17;
21834        /// Secure Trace enable. Enables tracing in Secure state.
21835        const STE = 1 << 18;
21836        /// Trap Trace Filter controls. Traps use of the Trace Filter control registers at EL2 and EL1 to EL3.
21837        const TTRF = 1 << 19;
21838        /// `EDAD` bit.
21839        const EDAD = 1 << 20;
21840        /// `EPMAD` bit.
21841        const EPMAD = 1 << 21;
21842        /// `ETAD` bit.
21843        const ETAD = 1 << 22;
21844        /// Secure Cycle Counter Disable. Prohibits PMCCNTR_EL0 from counting in Secure state.
21845        const SCCD = 1 << 23;
21846        /// 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.
21847        const NSTBE = 1 << 26;
21848        /// `TDCC` bit.
21849        const TDCC = 1 << 27;
21850        /// Multi-threaded PMU Enable. Enables use of the PMEVTYPER<n>_EL0.MT bits.
21851        const MTPME = 1 << 28;
21852        /// Monitor Cycle Counter Disable. Prohibits the Cycle Counter, PMCCNTR_EL0, from counting at EL3.
21853        const MCCD = 1 << 34;
21854        /// 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.
21855        const MPMX = 1 << 35;
21856        /// Trap accesses to PMSNEVFR_EL1. Controls access to Statistical Profiling PMSNEVFR_EL1 System register from EL2 and EL1.
21857        const ENPMSN = 1 << 36;
21858        /// `E3BREW` bit.
21859        const E3BREW = 1 << 37;
21860        /// `E3BREC` bit.
21861        const E3BREC = 1 << 38;
21862        /// `EnTB2` bit.
21863        const ENTB2 = 1 << 39;
21864        /// Enable access to SPE registers. When disabled, accesses to SPE registers generate a trap to EL3.
21865        const ENPMS3 = 1 << 42;
21866        /// `EBWE` bit.
21867        const EBWE = 1 << 43;
21868        /// `EnPMSS` bit.
21869        const ENPMSS = 1 << 44;
21870        /// `EnITE` bit.
21871        const ENITE = 1 << 47;
21872        /// `EnSTEPOP` bit.
21873        const ENSTEPOP = 1 << 50;
21874        /// `EnPMS4` bit.
21875        const ENPMS4 = 1 << 55;
21876    }
21877}
21878
21879#[cfg(feature = "el3")]
21880impl MdcrEl3 {
21881    /// Offset of the `RLTE` field.
21882    pub const RLTE_SHIFT: u32 = 0;
21883    /// Offset of the `EPMADE` field.
21884    pub const EPMADE_SHIFT: u32 = 2;
21885    /// Offset of the `ETADE` field.
21886    pub const ETADE_SHIFT: u32 = 3;
21887    /// Offset of the `EDADE` field.
21888    pub const EDADE_SHIFT: u32 = 4;
21889    /// Offset of the `TPM` field.
21890    pub const TPM_SHIFT: u32 = 6;
21891    /// Offset of the `EnPM2` field.
21892    pub const ENPM2_SHIFT: u32 = 7;
21893    /// Offset of the `TDA` field.
21894    pub const TDA_SHIFT: u32 = 9;
21895    /// Offset of the `TDOSA` field.
21896    pub const TDOSA_SHIFT: u32 = 10;
21897    /// Offset of the `NSPBE` field.
21898    pub const NSPBE_SHIFT: u32 = 11;
21899    /// Offset of the `NSPB` field.
21900    pub const NSPB_SHIFT: u32 = 12;
21901    /// Mask for the `NSPB` field.
21902    pub const NSPB_MASK: u64 = 0b11;
21903    /// Offset of the `SPD32` field.
21904    pub const SPD32_SHIFT: u32 = 14;
21905    /// Mask for the `SPD32` field.
21906    pub const SPD32_MASK: u64 = 0b11;
21907    /// Offset of the `SDD` field.
21908    pub const SDD_SHIFT: u32 = 16;
21909    /// Offset of the `SPME` field.
21910    pub const SPME_SHIFT: u32 = 17;
21911    /// Offset of the `STE` field.
21912    pub const STE_SHIFT: u32 = 18;
21913    /// Offset of the `TTRF` field.
21914    pub const TTRF_SHIFT: u32 = 19;
21915    /// Offset of the `EDAD` field.
21916    pub const EDAD_SHIFT: u32 = 20;
21917    /// Offset of the `EPMAD` field.
21918    pub const EPMAD_SHIFT: u32 = 21;
21919    /// Offset of the `ETAD` field.
21920    pub const ETAD_SHIFT: u32 = 22;
21921    /// Offset of the `SCCD` field.
21922    pub const SCCD_SHIFT: u32 = 23;
21923    /// Offset of the `NSTB` field.
21924    pub const NSTB_SHIFT: u32 = 24;
21925    /// Mask for the `NSTB` field.
21926    pub const NSTB_MASK: u64 = 0b11;
21927    /// Offset of the `NSTBE` field.
21928    pub const NSTBE_SHIFT: u32 = 26;
21929    /// Offset of the `TDCC` field.
21930    pub const TDCC_SHIFT: u32 = 27;
21931    /// Offset of the `MTPME` field.
21932    pub const MTPME_SHIFT: u32 = 28;
21933    /// Offset of the `PMSSE` field.
21934    pub const PMSSE_SHIFT: u32 = 30;
21935    /// Mask for the `PMSSE` field.
21936    pub const PMSSE_MASK: u64 = 0b11;
21937    /// Offset of the `SBRBE` field.
21938    pub const SBRBE_SHIFT: u32 = 32;
21939    /// Mask for the `SBRBE` field.
21940    pub const SBRBE_MASK: u64 = 0b11;
21941    /// Offset of the `MCCD` field.
21942    pub const MCCD_SHIFT: u32 = 34;
21943    /// Offset of the `MPMX` field.
21944    pub const MPMX_SHIFT: u32 = 35;
21945    /// Offset of the `EnPMSN` field.
21946    pub const ENPMSN_SHIFT: u32 = 36;
21947    /// Offset of the `E3BREW` field.
21948    pub const E3BREW_SHIFT: u32 = 37;
21949    /// Offset of the `E3BREC` field.
21950    pub const E3BREC_SHIFT: u32 = 38;
21951    /// Offset of the `EnTB2` field.
21952    pub const ENTB2_SHIFT: u32 = 39;
21953    /// Offset of the `PMEE` field.
21954    pub const PMEE_SHIFT: u32 = 40;
21955    /// Mask for the `PMEE` field.
21956    pub const PMEE_MASK: u64 = 0b11;
21957    /// Offset of the `EnPMS3` field.
21958    pub const ENPMS3_SHIFT: u32 = 42;
21959    /// Offset of the `EBWE` field.
21960    pub const EBWE_SHIFT: u32 = 43;
21961    /// Offset of the `EnPMSS` field.
21962    pub const ENPMSS_SHIFT: u32 = 44;
21963    /// Offset of the `EPMSSAD` field.
21964    pub const EPMSSAD_SHIFT: u32 = 45;
21965    /// Mask for the `EPMSSAD` field.
21966    pub const EPMSSAD_MASK: u64 = 0b11;
21967    /// Offset of the `EnITE` field.
21968    pub const ENITE_SHIFT: u32 = 47;
21969    /// Offset of the `ETBAD` field.
21970    pub const ETBAD_SHIFT: u32 = 48;
21971    /// Mask for the `ETBAD` field.
21972    pub const ETBAD_MASK: u64 = 0b11;
21973    /// Offset of the `EnSTEPOP` field.
21974    pub const ENSTEPOP_SHIFT: u32 = 50;
21975    /// Offset of the `PMSEE` field.
21976    pub const PMSEE_SHIFT: u32 = 51;
21977    /// Mask for the `PMSEE` field.
21978    pub const PMSEE_MASK: u64 = 0b11;
21979    /// Offset of the `TRBEE` field.
21980    pub const TRBEE_SHIFT: u32 = 53;
21981    /// Mask for the `TRBEE` field.
21982    pub const TRBEE_MASK: u64 = 0b11;
21983    /// Offset of the `EnPMS4` field.
21984    pub const ENPMS4_SHIFT: u32 = 55;
21985
21986    /// Returns the value of the `NSPB` field.
21987    pub const fn nspb(self) -> u8 {
21988        ((self.bits() >> Self::NSPB_SHIFT) & 0b11) as u8
21989    }
21990
21991    /// Sets the value of the `NSPB` field.
21992    pub const fn set_nspb(&mut self, value: u8) {
21993        let offset = Self::NSPB_SHIFT;
21994        assert!(value & (Self::NSPB_MASK as u8) == value);
21995        *self = Self::from_bits_retain(
21996            (self.bits() & !(Self::NSPB_MASK << offset)) | ((value as u64) << offset),
21997        );
21998    }
21999
22000    /// Returns a copy with the `NSPB` field set to the given value.
22001    pub const fn with_nspb(mut self, value: u8) -> Self {
22002        self.set_nspb(value);
22003        self
22004    }
22005
22006    /// Returns the value of the `SPD32` field.
22007    pub const fn spd32(self) -> u8 {
22008        ((self.bits() >> Self::SPD32_SHIFT) & 0b11) as u8
22009    }
22010
22011    /// Sets the value of the `SPD32` field.
22012    pub const fn set_spd32(&mut self, value: u8) {
22013        let offset = Self::SPD32_SHIFT;
22014        assert!(value & (Self::SPD32_MASK as u8) == value);
22015        *self = Self::from_bits_retain(
22016            (self.bits() & !(Self::SPD32_MASK << offset)) | ((value as u64) << offset),
22017        );
22018    }
22019
22020    /// Returns a copy with the `SPD32` field set to the given value.
22021    pub const fn with_spd32(mut self, value: u8) -> Self {
22022        self.set_spd32(value);
22023        self
22024    }
22025
22026    /// Returns the value of the `NSTB` field.
22027    pub const fn nstb(self) -> u8 {
22028        ((self.bits() >> Self::NSTB_SHIFT) & 0b11) as u8
22029    }
22030
22031    /// Sets the value of the `NSTB` field.
22032    pub const fn set_nstb(&mut self, value: u8) {
22033        let offset = Self::NSTB_SHIFT;
22034        assert!(value & (Self::NSTB_MASK as u8) == value);
22035        *self = Self::from_bits_retain(
22036            (self.bits() & !(Self::NSTB_MASK << offset)) | ((value as u64) << offset),
22037        );
22038    }
22039
22040    /// Returns a copy with the `NSTB` field set to the given value.
22041    pub const fn with_nstb(mut self, value: u8) -> Self {
22042        self.set_nstb(value);
22043        self
22044    }
22045
22046    /// Returns the value of the `PMSSE` field.
22047    pub const fn pmsse(self) -> u8 {
22048        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
22049    }
22050
22051    /// Sets the value of the `PMSSE` field.
22052    pub const fn set_pmsse(&mut self, value: u8) {
22053        let offset = Self::PMSSE_SHIFT;
22054        assert!(value & (Self::PMSSE_MASK as u8) == value);
22055        *self = Self::from_bits_retain(
22056            (self.bits() & !(Self::PMSSE_MASK << offset)) | ((value as u64) << offset),
22057        );
22058    }
22059
22060    /// Returns a copy with the `PMSSE` field set to the given value.
22061    pub const fn with_pmsse(mut self, value: u8) -> Self {
22062        self.set_pmsse(value);
22063        self
22064    }
22065
22066    /// Returns the value of the `SBRBE` field.
22067    pub const fn sbrbe(self) -> u8 {
22068        ((self.bits() >> Self::SBRBE_SHIFT) & 0b11) as u8
22069    }
22070
22071    /// Sets the value of the `SBRBE` field.
22072    pub const fn set_sbrbe(&mut self, value: u8) {
22073        let offset = Self::SBRBE_SHIFT;
22074        assert!(value & (Self::SBRBE_MASK as u8) == value);
22075        *self = Self::from_bits_retain(
22076            (self.bits() & !(Self::SBRBE_MASK << offset)) | ((value as u64) << offset),
22077        );
22078    }
22079
22080    /// Returns a copy with the `SBRBE` field set to the given value.
22081    pub const fn with_sbrbe(mut self, value: u8) -> Self {
22082        self.set_sbrbe(value);
22083        self
22084    }
22085
22086    /// Returns the value of the `PMEE` field.
22087    pub const fn pmee(self) -> u8 {
22088        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
22089    }
22090
22091    /// Sets the value of the `PMEE` field.
22092    pub const fn set_pmee(&mut self, value: u8) {
22093        let offset = Self::PMEE_SHIFT;
22094        assert!(value & (Self::PMEE_MASK as u8) == value);
22095        *self = Self::from_bits_retain(
22096            (self.bits() & !(Self::PMEE_MASK << offset)) | ((value as u64) << offset),
22097        );
22098    }
22099
22100    /// Returns a copy with the `PMEE` field set to the given value.
22101    pub const fn with_pmee(mut self, value: u8) -> Self {
22102        self.set_pmee(value);
22103        self
22104    }
22105
22106    /// Returns the value of the `EPMSSAD` field.
22107    pub const fn epmssad(self) -> u8 {
22108        ((self.bits() >> Self::EPMSSAD_SHIFT) & 0b11) as u8
22109    }
22110
22111    /// Sets the value of the `EPMSSAD` field.
22112    pub const fn set_epmssad(&mut self, value: u8) {
22113        let offset = Self::EPMSSAD_SHIFT;
22114        assert!(value & (Self::EPMSSAD_MASK as u8) == value);
22115        *self = Self::from_bits_retain(
22116            (self.bits() & !(Self::EPMSSAD_MASK << offset)) | ((value as u64) << offset),
22117        );
22118    }
22119
22120    /// Returns a copy with the `EPMSSAD` field set to the given value.
22121    pub const fn with_epmssad(mut self, value: u8) -> Self {
22122        self.set_epmssad(value);
22123        self
22124    }
22125
22126    /// Returns the value of the `ETBAD` field.
22127    pub const fn etbad(self) -> u8 {
22128        ((self.bits() >> Self::ETBAD_SHIFT) & 0b11) as u8
22129    }
22130
22131    /// Sets the value of the `ETBAD` field.
22132    pub const fn set_etbad(&mut self, value: u8) {
22133        let offset = Self::ETBAD_SHIFT;
22134        assert!(value & (Self::ETBAD_MASK as u8) == value);
22135        *self = Self::from_bits_retain(
22136            (self.bits() & !(Self::ETBAD_MASK << offset)) | ((value as u64) << offset),
22137        );
22138    }
22139
22140    /// Returns a copy with the `ETBAD` field set to the given value.
22141    pub const fn with_etbad(mut self, value: u8) -> Self {
22142        self.set_etbad(value);
22143        self
22144    }
22145
22146    /// Returns the value of the `PMSEE` field.
22147    pub const fn pmsee(self) -> u8 {
22148        ((self.bits() >> Self::PMSEE_SHIFT) & 0b11) as u8
22149    }
22150
22151    /// Sets the value of the `PMSEE` field.
22152    pub const fn set_pmsee(&mut self, value: u8) {
22153        let offset = Self::PMSEE_SHIFT;
22154        assert!(value & (Self::PMSEE_MASK as u8) == value);
22155        *self = Self::from_bits_retain(
22156            (self.bits() & !(Self::PMSEE_MASK << offset)) | ((value as u64) << offset),
22157        );
22158    }
22159
22160    /// Returns a copy with the `PMSEE` field set to the given value.
22161    pub const fn with_pmsee(mut self, value: u8) -> Self {
22162        self.set_pmsee(value);
22163        self
22164    }
22165
22166    /// Returns the value of the `TRBEE` field.
22167    pub const fn trbee(self) -> u8 {
22168        ((self.bits() >> Self::TRBEE_SHIFT) & 0b11) as u8
22169    }
22170
22171    /// Sets the value of the `TRBEE` field.
22172    pub const fn set_trbee(&mut self, value: u8) {
22173        let offset = Self::TRBEE_SHIFT;
22174        assert!(value & (Self::TRBEE_MASK as u8) == value);
22175        *self = Self::from_bits_retain(
22176            (self.bits() & !(Self::TRBEE_MASK << offset)) | ((value as u64) << offset),
22177        );
22178    }
22179
22180    /// Returns a copy with the `TRBEE` field set to the given value.
22181    pub const fn with_trbee(mut self, value: u8) -> Self {
22182        self.set_trbee(value);
22183        self
22184    }
22185}
22186
22187#[cfg(feature = "el1")]
22188bitflags! {
22189    /// `MDSCR_EL1` system register value.
22190    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22191    #[repr(transparent)]
22192    pub struct MdscrEl1: u64 {
22193        /// `SS` bit.
22194        const SS = 1 << 0;
22195        /// `ERR` bit.
22196        const ERR = 1 << 6;
22197        /// `TDCC` bit.
22198        const TDCC = 1 << 12;
22199        /// `KDE` bit.
22200        const KDE = 1 << 13;
22201        /// `HDE` bit.
22202        const HDE = 1 << 14;
22203        /// `MDE` bit.
22204        const MDE = 1 << 15;
22205        /// `SC2` bit.
22206        const SC2 = 1 << 19;
22207        /// `TDA` bit.
22208        const TDA = 1 << 21;
22209        /// `TXU` bit.
22210        const TXU = 1 << 26;
22211        /// `RXO` bit.
22212        const RXO = 1 << 27;
22213        /// `TXfull` bit.
22214        const TXFULL = 1 << 29;
22215        /// `RXfull` bit.
22216        const RXFULL = 1 << 30;
22217        /// `TFO` bit.
22218        const TFO = 1 << 31;
22219        /// `EMBWE` bit.
22220        const EMBWE = 1 << 32;
22221        /// `TTA` bit.
22222        const TTA = 1 << 33;
22223        /// `EnSPM` bit.
22224        const ENSPM = 1 << 34;
22225        /// `EHBWE` bit.
22226        const EHBWE = 1 << 35;
22227        /// `EnSTEPOP` bit.
22228        const ENSTEPOP = 1 << 50;
22229    }
22230}
22231
22232#[cfg(feature = "el1")]
22233impl MdscrEl1 {
22234    /// Offset of the `SS` field.
22235    pub const SS_SHIFT: u32 = 0;
22236    /// Offset of the `ERR` field.
22237    pub const ERR_SHIFT: u32 = 6;
22238    /// Offset of the `TDCC` field.
22239    pub const TDCC_SHIFT: u32 = 12;
22240    /// Offset of the `KDE` field.
22241    pub const KDE_SHIFT: u32 = 13;
22242    /// Offset of the `HDE` field.
22243    pub const HDE_SHIFT: u32 = 14;
22244    /// Offset of the `MDE` field.
22245    pub const MDE_SHIFT: u32 = 15;
22246    /// Offset of the `SC2` field.
22247    pub const SC2_SHIFT: u32 = 19;
22248    /// Offset of the `TDA` field.
22249    pub const TDA_SHIFT: u32 = 21;
22250    /// Offset of the `INTdis` field.
22251    pub const INTDIS_SHIFT: u32 = 22;
22252    /// Mask for the `INTdis` field.
22253    pub const INTDIS_MASK: u64 = 0b11;
22254    /// Offset of the `TXU` field.
22255    pub const TXU_SHIFT: u32 = 26;
22256    /// Offset of the `RXO` field.
22257    pub const RXO_SHIFT: u32 = 27;
22258    /// Offset of the `TXfull` field.
22259    pub const TXFULL_SHIFT: u32 = 29;
22260    /// Offset of the `RXfull` field.
22261    pub const RXFULL_SHIFT: u32 = 30;
22262    /// Offset of the `TFO` field.
22263    pub const TFO_SHIFT: u32 = 31;
22264    /// Offset of the `EMBWE` field.
22265    pub const EMBWE_SHIFT: u32 = 32;
22266    /// Offset of the `TTA` field.
22267    pub const TTA_SHIFT: u32 = 33;
22268    /// Offset of the `EnSPM` field.
22269    pub const ENSPM_SHIFT: u32 = 34;
22270    /// Offset of the `EHBWE` field.
22271    pub const EHBWE_SHIFT: u32 = 35;
22272    /// Offset of the `EnSTEPOP` field.
22273    pub const ENSTEPOP_SHIFT: u32 = 50;
22274
22275    /// Returns the value of the `INTdis` field.
22276    pub const fn intdis(self) -> u8 {
22277        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
22278    }
22279
22280    /// Sets the value of the `INTdis` field.
22281    pub const fn set_intdis(&mut self, value: u8) {
22282        let offset = Self::INTDIS_SHIFT;
22283        assert!(value & (Self::INTDIS_MASK as u8) == value);
22284        *self = Self::from_bits_retain(
22285            (self.bits() & !(Self::INTDIS_MASK << offset)) | ((value as u64) << offset),
22286        );
22287    }
22288
22289    /// Returns a copy with the `INTdis` field set to the given value.
22290    pub const fn with_intdis(mut self, value: u8) -> Self {
22291        self.set_intdis(value);
22292        self
22293    }
22294}
22295
22296bitflags! {
22297    /// `MIDR` system register value.
22298    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22299    #[repr(transparent)]
22300    pub struct Midr: u32 {
22301    }
22302}
22303
22304impl Midr {
22305    /// Offset of the `Revision` field.
22306    pub const REVISION_SHIFT: u32 = 0;
22307    /// Mask for the `Revision` field.
22308    pub const REVISION_MASK: u32 = 0b1111;
22309    /// Offset of the `PartNum` field.
22310    pub const PARTNUM_SHIFT: u32 = 4;
22311    /// Mask for the `PartNum` field.
22312    pub const PARTNUM_MASK: u32 = 0b111111111111;
22313    /// Offset of the `Architecture` field.
22314    pub const ARCHITECTURE_SHIFT: u32 = 16;
22315    /// Mask for the `Architecture` field.
22316    pub const ARCHITECTURE_MASK: u32 = 0b1111;
22317    /// Offset of the `Variant` field.
22318    pub const VARIANT_SHIFT: u32 = 20;
22319    /// Mask for the `Variant` field.
22320    pub const VARIANT_MASK: u32 = 0b1111;
22321    /// Offset of the `Implementer` field.
22322    pub const IMPLEMENTER_SHIFT: u32 = 24;
22323    /// Mask for the `Implementer` field.
22324    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
22325
22326    /// Returns the value of the `Revision` field.
22327    pub const fn revision(self) -> u8 {
22328        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
22329    }
22330
22331    /// Sets the value of the `Revision` field.
22332    pub const fn set_revision(&mut self, value: u8) {
22333        let offset = Self::REVISION_SHIFT;
22334        assert!(value & (Self::REVISION_MASK as u8) == value);
22335        *self = Self::from_bits_retain(
22336            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u32) << offset),
22337        );
22338    }
22339
22340    /// Returns a copy with the `Revision` field set to the given value.
22341    pub const fn with_revision(mut self, value: u8) -> Self {
22342        self.set_revision(value);
22343        self
22344    }
22345
22346    /// Returns the value of the `PartNum` field.
22347    pub const fn partnum(self) -> u16 {
22348        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
22349    }
22350
22351    /// Sets the value of the `PartNum` field.
22352    pub const fn set_partnum(&mut self, value: u16) {
22353        let offset = Self::PARTNUM_SHIFT;
22354        assert!(value & (Self::PARTNUM_MASK as u16) == value);
22355        *self = Self::from_bits_retain(
22356            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u32) << offset),
22357        );
22358    }
22359
22360    /// Returns a copy with the `PartNum` field set to the given value.
22361    pub const fn with_partnum(mut self, value: u16) -> Self {
22362        self.set_partnum(value);
22363        self
22364    }
22365
22366    /// Returns the value of the `Architecture` field.
22367    pub const fn architecture(self) -> u8 {
22368        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
22369    }
22370
22371    /// Sets the value of the `Architecture` field.
22372    pub const fn set_architecture(&mut self, value: u8) {
22373        let offset = Self::ARCHITECTURE_SHIFT;
22374        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
22375        *self = Self::from_bits_retain(
22376            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u32) << offset),
22377        );
22378    }
22379
22380    /// Returns a copy with the `Architecture` field set to the given value.
22381    pub const fn with_architecture(mut self, value: u8) -> Self {
22382        self.set_architecture(value);
22383        self
22384    }
22385
22386    /// Returns the value of the `Variant` field.
22387    pub const fn variant(self) -> u8 {
22388        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
22389    }
22390
22391    /// Sets the value of the `Variant` field.
22392    pub const fn set_variant(&mut self, value: u8) {
22393        let offset = Self::VARIANT_SHIFT;
22394        assert!(value & (Self::VARIANT_MASK as u8) == value);
22395        *self = Self::from_bits_retain(
22396            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u32) << offset),
22397        );
22398    }
22399
22400    /// Returns a copy with the `Variant` field set to the given value.
22401    pub const fn with_variant(mut self, value: u8) -> Self {
22402        self.set_variant(value);
22403        self
22404    }
22405
22406    /// Returns the value of the `Implementer` field.
22407    pub const fn implementer(self) -> u8 {
22408        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
22409    }
22410
22411    /// Sets the value of the `Implementer` field.
22412    pub const fn set_implementer(&mut self, value: u8) {
22413        let offset = Self::IMPLEMENTER_SHIFT;
22414        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
22415        *self = Self::from_bits_retain(
22416            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u32) << offset),
22417        );
22418    }
22419
22420    /// Returns a copy with the `Implementer` field set to the given value.
22421    pub const fn with_implementer(mut self, value: u8) -> Self {
22422        self.set_implementer(value);
22423        self
22424    }
22425}
22426
22427#[cfg(feature = "el1")]
22428bitflags! {
22429    /// `MIDR_EL1` system register value.
22430    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22431    #[repr(transparent)]
22432    pub struct MidrEl1: u64 {
22433    }
22434}
22435
22436#[cfg(feature = "el1")]
22437impl MidrEl1 {
22438    /// Offset of the `Revision` field.
22439    pub const REVISION_SHIFT: u32 = 0;
22440    /// Mask for the `Revision` field.
22441    pub const REVISION_MASK: u64 = 0b1111;
22442    /// Offset of the `PartNum` field.
22443    pub const PARTNUM_SHIFT: u32 = 4;
22444    /// Mask for the `PartNum` field.
22445    pub const PARTNUM_MASK: u64 = 0b111111111111;
22446    /// Offset of the `Architecture` field.
22447    pub const ARCHITECTURE_SHIFT: u32 = 16;
22448    /// Mask for the `Architecture` field.
22449    pub const ARCHITECTURE_MASK: u64 = 0b1111;
22450    /// Offset of the `Variant` field.
22451    pub const VARIANT_SHIFT: u32 = 20;
22452    /// Mask for the `Variant` field.
22453    pub const VARIANT_MASK: u64 = 0b1111;
22454    /// Offset of the `Implementer` field.
22455    pub const IMPLEMENTER_SHIFT: u32 = 24;
22456    /// Mask for the `Implementer` field.
22457    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
22458
22459    /// Returns the value of the `Revision` field.
22460    pub const fn revision(self) -> u8 {
22461        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
22462    }
22463
22464    /// Sets the value of the `Revision` field.
22465    pub const fn set_revision(&mut self, value: u8) {
22466        let offset = Self::REVISION_SHIFT;
22467        assert!(value & (Self::REVISION_MASK as u8) == value);
22468        *self = Self::from_bits_retain(
22469            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u64) << offset),
22470        );
22471    }
22472
22473    /// Returns a copy with the `Revision` field set to the given value.
22474    pub const fn with_revision(mut self, value: u8) -> Self {
22475        self.set_revision(value);
22476        self
22477    }
22478
22479    /// Returns the value of the `PartNum` field.
22480    pub const fn partnum(self) -> u16 {
22481        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
22482    }
22483
22484    /// Sets the value of the `PartNum` field.
22485    pub const fn set_partnum(&mut self, value: u16) {
22486        let offset = Self::PARTNUM_SHIFT;
22487        assert!(value & (Self::PARTNUM_MASK as u16) == value);
22488        *self = Self::from_bits_retain(
22489            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u64) << offset),
22490        );
22491    }
22492
22493    /// Returns a copy with the `PartNum` field set to the given value.
22494    pub const fn with_partnum(mut self, value: u16) -> Self {
22495        self.set_partnum(value);
22496        self
22497    }
22498
22499    /// Returns the value of the `Architecture` field.
22500    pub const fn architecture(self) -> u8 {
22501        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
22502    }
22503
22504    /// Sets the value of the `Architecture` field.
22505    pub const fn set_architecture(&mut self, value: u8) {
22506        let offset = Self::ARCHITECTURE_SHIFT;
22507        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
22508        *self = Self::from_bits_retain(
22509            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u64) << offset),
22510        );
22511    }
22512
22513    /// Returns a copy with the `Architecture` field set to the given value.
22514    pub const fn with_architecture(mut self, value: u8) -> Self {
22515        self.set_architecture(value);
22516        self
22517    }
22518
22519    /// Returns the value of the `Variant` field.
22520    pub const fn variant(self) -> u8 {
22521        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
22522    }
22523
22524    /// Sets the value of the `Variant` field.
22525    pub const fn set_variant(&mut self, value: u8) {
22526        let offset = Self::VARIANT_SHIFT;
22527        assert!(value & (Self::VARIANT_MASK as u8) == value);
22528        *self = Self::from_bits_retain(
22529            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u64) << offset),
22530        );
22531    }
22532
22533    /// Returns a copy with the `Variant` field set to the given value.
22534    pub const fn with_variant(mut self, value: u8) -> Self {
22535        self.set_variant(value);
22536        self
22537    }
22538
22539    /// Returns the value of the `Implementer` field.
22540    pub const fn implementer(self) -> u8 {
22541        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
22542    }
22543
22544    /// Sets the value of the `Implementer` field.
22545    pub const fn set_implementer(&mut self, value: u8) {
22546        let offset = Self::IMPLEMENTER_SHIFT;
22547        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
22548        *self = Self::from_bits_retain(
22549            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u64) << offset),
22550        );
22551    }
22552
22553    /// Returns a copy with the `Implementer` field set to the given value.
22554    pub const fn with_implementer(mut self, value: u8) -> Self {
22555        self.set_implementer(value);
22556        self
22557    }
22558}
22559
22560#[cfg(feature = "el2")]
22561bitflags! {
22562    /// `MPAM2_EL2` system register value.
22563    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22564    #[repr(transparent)]
22565    pub struct Mpam2El2: u64 {
22566        /// `TRAPMPAM1EL1` bit.
22567        const TRAPMPAM1EL1 = 1 << 48;
22568        /// `TRAPMPAM0EL1` bit.
22569        const TRAPMPAM0EL1 = 1 << 49;
22570        /// `EnMPAMSM` bit.
22571        const ENMPAMSM = 1 << 50;
22572        /// `ALTSP_FRCD` bit.
22573        const ALTSP_FRCD = 1 << 54;
22574        /// `ALTSP_EL2` bit.
22575        const ALTSP_EL2 = 1 << 55;
22576        /// `ALTSP_HFC` bit.
22577        const ALTSP_HFC = 1 << 56;
22578        /// `TIDR` bit.
22579        const TIDR = 1 << 58;
22580        /// `MPAMEN` bit.
22581        const MPAMEN = 1 << 63;
22582    }
22583}
22584
22585#[cfg(feature = "el2")]
22586impl Mpam2El2 {
22587    /// Offset of the `PARTID` field.
22588    pub const PARTID_SHIFT: u32 = 0;
22589    /// Mask for the `PARTID` field.
22590    pub const PARTID_MASK: u64 = 0b1111111111111111;
22591    /// Offset of the `PARTID_I` field.
22592    pub const PARTID_I_SHIFT: u32 = 0;
22593    /// Mask for the `PARTID_I` field.
22594    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
22595    /// Offset of the `PARTID_D` field.
22596    pub const PARTID_D_SHIFT: u32 = 16;
22597    /// Mask for the `PARTID_D` field.
22598    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
22599    /// Offset of the `altPARTID` field.
22600    pub const ALTPARTID_SHIFT: u32 = 16;
22601    /// Mask for the `altPARTID` field.
22602    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
22603    /// Offset of the `PMG` field.
22604    pub const PMG_SHIFT: u32 = 32;
22605    /// Mask for the `PMG` field.
22606    pub const PMG_MASK: u64 = 0b1111111111111111;
22607    /// Offset of the `PMG_I` field.
22608    pub const PMG_I_SHIFT: u32 = 32;
22609    /// Mask for the `PMG_I` field.
22610    pub const PMG_I_MASK: u64 = 0b11111111;
22611    /// Offset of the `PMG_D` field.
22612    pub const PMG_D_SHIFT: u32 = 40;
22613    /// Mask for the `PMG_D` field.
22614    pub const PMG_D_MASK: u64 = 0b11111111;
22615    /// Offset of the `TRAPMPAM1EL1` field.
22616    pub const TRAPMPAM1EL1_SHIFT: u32 = 48;
22617    /// Offset of the `altPMG` field.
22618    pub const ALTPMG_SHIFT: u32 = 48;
22619    /// Mask for the `altPMG` field.
22620    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
22621    /// Offset of the `TRAPMPAM0EL1` field.
22622    pub const TRAPMPAM0EL1_SHIFT: u32 = 49;
22623    /// Offset of the `EnMPAMSM` field.
22624    pub const ENMPAMSM_SHIFT: u32 = 50;
22625    /// Offset of the `ALTSP_FRCD` field.
22626    pub const ALTSP_FRCD_SHIFT: u32 = 54;
22627    /// Offset of the `ALTSP_EL2` field.
22628    pub const ALTSP_EL2_SHIFT: u32 = 55;
22629    /// Offset of the `ALTSP_HFC` field.
22630    pub const ALTSP_HFC_SHIFT: u32 = 56;
22631    /// Offset of the `TIDR` field.
22632    pub const TIDR_SHIFT: u32 = 58;
22633    /// Offset of the `MPAMEN` field.
22634    pub const MPAMEN_SHIFT: u32 = 63;
22635
22636    /// Returns the value of the `PARTID` field.
22637    pub const fn partid(self) -> u16 {
22638        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
22639    }
22640
22641    /// Sets the value of the `PARTID` field.
22642    pub const fn set_partid(&mut self, value: u16) {
22643        let offset = Self::PARTID_SHIFT;
22644        assert!(value & (Self::PARTID_MASK as u16) == value);
22645        *self = Self::from_bits_retain(
22646            (self.bits() & !(Self::PARTID_MASK << offset)) | ((value as u64) << offset),
22647        );
22648    }
22649
22650    /// Returns a copy with the `PARTID` field set to the given value.
22651    pub const fn with_partid(mut self, value: u16) -> Self {
22652        self.set_partid(value);
22653        self
22654    }
22655
22656    /// Returns the value of the `PARTID_I` field.
22657    pub const fn partid_i(self) -> u16 {
22658        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
22659    }
22660
22661    /// Sets the value of the `PARTID_I` field.
22662    pub const fn set_partid_i(&mut self, value: u16) {
22663        let offset = Self::PARTID_I_SHIFT;
22664        assert!(value & (Self::PARTID_I_MASK as u16) == value);
22665        *self = Self::from_bits_retain(
22666            (self.bits() & !(Self::PARTID_I_MASK << offset)) | ((value as u64) << offset),
22667        );
22668    }
22669
22670    /// Returns a copy with the `PARTID_I` field set to the given value.
22671    pub const fn with_partid_i(mut self, value: u16) -> Self {
22672        self.set_partid_i(value);
22673        self
22674    }
22675
22676    /// Returns the value of the `PARTID_D` field.
22677    pub const fn partid_d(self) -> u16 {
22678        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
22679    }
22680
22681    /// Sets the value of the `PARTID_D` field.
22682    pub const fn set_partid_d(&mut self, value: u16) {
22683        let offset = Self::PARTID_D_SHIFT;
22684        assert!(value & (Self::PARTID_D_MASK as u16) == value);
22685        *self = Self::from_bits_retain(
22686            (self.bits() & !(Self::PARTID_D_MASK << offset)) | ((value as u64) << offset),
22687        );
22688    }
22689
22690    /// Returns a copy with the `PARTID_D` field set to the given value.
22691    pub const fn with_partid_d(mut self, value: u16) -> Self {
22692        self.set_partid_d(value);
22693        self
22694    }
22695
22696    /// Returns the value of the `altPARTID` field.
22697    pub const fn altpartid(self) -> u16 {
22698        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
22699    }
22700
22701    /// Sets the value of the `altPARTID` field.
22702    pub const fn set_altpartid(&mut self, value: u16) {
22703        let offset = Self::ALTPARTID_SHIFT;
22704        assert!(value & (Self::ALTPARTID_MASK as u16) == value);
22705        *self = Self::from_bits_retain(
22706            (self.bits() & !(Self::ALTPARTID_MASK << offset)) | ((value as u64) << offset),
22707        );
22708    }
22709
22710    /// Returns a copy with the `altPARTID` field set to the given value.
22711    pub const fn with_altpartid(mut self, value: u16) -> Self {
22712        self.set_altpartid(value);
22713        self
22714    }
22715
22716    /// Returns the value of the `PMG` field.
22717    pub const fn pmg(self) -> u16 {
22718        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
22719    }
22720
22721    /// Sets the value of the `PMG` field.
22722    pub const fn set_pmg(&mut self, value: u16) {
22723        let offset = Self::PMG_SHIFT;
22724        assert!(value & (Self::PMG_MASK as u16) == value);
22725        *self = Self::from_bits_retain(
22726            (self.bits() & !(Self::PMG_MASK << offset)) | ((value as u64) << offset),
22727        );
22728    }
22729
22730    /// Returns a copy with the `PMG` field set to the given value.
22731    pub const fn with_pmg(mut self, value: u16) -> Self {
22732        self.set_pmg(value);
22733        self
22734    }
22735
22736    /// Returns the value of the `PMG_I` field.
22737    pub const fn pmg_i(self) -> u8 {
22738        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
22739    }
22740
22741    /// Sets the value of the `PMG_I` field.
22742    pub const fn set_pmg_i(&mut self, value: u8) {
22743        let offset = Self::PMG_I_SHIFT;
22744        assert!(value & (Self::PMG_I_MASK as u8) == value);
22745        *self = Self::from_bits_retain(
22746            (self.bits() & !(Self::PMG_I_MASK << offset)) | ((value as u64) << offset),
22747        );
22748    }
22749
22750    /// Returns a copy with the `PMG_I` field set to the given value.
22751    pub const fn with_pmg_i(mut self, value: u8) -> Self {
22752        self.set_pmg_i(value);
22753        self
22754    }
22755
22756    /// Returns the value of the `PMG_D` field.
22757    pub const fn pmg_d(self) -> u8 {
22758        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
22759    }
22760
22761    /// Sets the value of the `PMG_D` field.
22762    pub const fn set_pmg_d(&mut self, value: u8) {
22763        let offset = Self::PMG_D_SHIFT;
22764        assert!(value & (Self::PMG_D_MASK as u8) == value);
22765        *self = Self::from_bits_retain(
22766            (self.bits() & !(Self::PMG_D_MASK << offset)) | ((value as u64) << offset),
22767        );
22768    }
22769
22770    /// Returns a copy with the `PMG_D` field set to the given value.
22771    pub const fn with_pmg_d(mut self, value: u8) -> Self {
22772        self.set_pmg_d(value);
22773        self
22774    }
22775
22776    /// Returns the value of the `altPMG` field.
22777    pub const fn altpmg(self) -> u16 {
22778        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
22779    }
22780
22781    /// Sets the value of the `altPMG` field.
22782    pub const fn set_altpmg(&mut self, value: u16) {
22783        let offset = Self::ALTPMG_SHIFT;
22784        assert!(value & (Self::ALTPMG_MASK as u16) == value);
22785        *self = Self::from_bits_retain(
22786            (self.bits() & !(Self::ALTPMG_MASK << offset)) | ((value as u64) << offset),
22787        );
22788    }
22789
22790    /// Returns a copy with the `altPMG` field set to the given value.
22791    pub const fn with_altpmg(mut self, value: u16) -> Self {
22792        self.set_altpmg(value);
22793        self
22794    }
22795}
22796
22797#[cfg(feature = "el3")]
22798bitflags! {
22799    /// `MPAM3_EL3` system register value.
22800    ///
22801    /// Holds information to generate MPAM labels for memory requests when executing at EL3.
22802    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22803    #[repr(transparent)]
22804    pub struct Mpam3El3: u64 {
22805        /// `RT_ALTSP_NS` bit.
22806        const RT_ALTSP_NS = 1 << 52;
22807        /// `ALTSP_EL3` bit.
22808        const ALTSP_EL3 = 1 << 55;
22809        /// `ALTSP_HFC` bit.
22810        const ALTSP_HFC = 1 << 56;
22811        /// `ALTSP_HEN` bit.
22812        const ALTSP_HEN = 1 << 57;
22813        /// `FORCE_NS` bit.
22814        const FORCE_NS = 1 << 60;
22815        /// `SDEFLT` bit.
22816        const SDEFLT = 1 << 61;
22817        /// Trap direct accesses to MPAM System registers that are not UNDEFINED from all ELn lower than EL3.
22818        const TRAPLOWER = 1 << 62;
22819        /// 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.
22820        const MPAMEN = 1 << 63;
22821    }
22822}
22823
22824#[cfg(feature = "el3")]
22825impl Mpam3El3 {
22826    /// Offset of the `PARTID` field.
22827    pub const PARTID_SHIFT: u32 = 0;
22828    /// Mask for the `PARTID` field.
22829    pub const PARTID_MASK: u64 = 0b1111111111111111;
22830    /// Offset of the `PARTID_I` field.
22831    pub const PARTID_I_SHIFT: u32 = 0;
22832    /// Mask for the `PARTID_I` field.
22833    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
22834    /// Offset of the `PARTID_D` field.
22835    pub const PARTID_D_SHIFT: u32 = 16;
22836    /// Mask for the `PARTID_D` field.
22837    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
22838    /// Offset of the `altPARTID` field.
22839    pub const ALTPARTID_SHIFT: u32 = 16;
22840    /// Mask for the `altPARTID` field.
22841    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
22842    /// Offset of the `PMG` field.
22843    pub const PMG_SHIFT: u32 = 32;
22844    /// Mask for the `PMG` field.
22845    pub const PMG_MASK: u64 = 0b1111111111111111;
22846    /// Offset of the `PMG_I` field.
22847    pub const PMG_I_SHIFT: u32 = 32;
22848    /// Mask for the `PMG_I` field.
22849    pub const PMG_I_MASK: u64 = 0b11111111;
22850    /// Offset of the `PMG_D` field.
22851    pub const PMG_D_SHIFT: u32 = 40;
22852    /// Mask for the `PMG_D` field.
22853    pub const PMG_D_MASK: u64 = 0b11111111;
22854    /// Offset of the `altPMG` field.
22855    pub const ALTPMG_SHIFT: u32 = 48;
22856    /// Mask for the `altPMG` field.
22857    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
22858    /// Offset of the `RT_ALTSP_NS` field.
22859    pub const RT_ALTSP_NS_SHIFT: u32 = 52;
22860    /// Offset of the `ALTSP_EL3` field.
22861    pub const ALTSP_EL3_SHIFT: u32 = 55;
22862    /// Offset of the `ALTSP_HFC` field.
22863    pub const ALTSP_HFC_SHIFT: u32 = 56;
22864    /// Offset of the `ALTSP_HEN` field.
22865    pub const ALTSP_HEN_SHIFT: u32 = 57;
22866    /// Offset of the `FORCE_NS` field.
22867    pub const FORCE_NS_SHIFT: u32 = 60;
22868    /// Offset of the `SDEFLT` field.
22869    pub const SDEFLT_SHIFT: u32 = 61;
22870    /// Offset of the `TRAPLOWER` field.
22871    pub const TRAPLOWER_SHIFT: u32 = 62;
22872    /// Offset of the `MPAMEN` field.
22873    pub const MPAMEN_SHIFT: u32 = 63;
22874
22875    /// Returns the value of the `PARTID` field.
22876    pub const fn partid(self) -> u16 {
22877        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
22878    }
22879
22880    /// Sets the value of the `PARTID` field.
22881    pub const fn set_partid(&mut self, value: u16) {
22882        let offset = Self::PARTID_SHIFT;
22883        assert!(value & (Self::PARTID_MASK as u16) == value);
22884        *self = Self::from_bits_retain(
22885            (self.bits() & !(Self::PARTID_MASK << offset)) | ((value as u64) << offset),
22886        );
22887    }
22888
22889    /// Returns a copy with the `PARTID` field set to the given value.
22890    pub const fn with_partid(mut self, value: u16) -> Self {
22891        self.set_partid(value);
22892        self
22893    }
22894
22895    /// Returns the value of the `PARTID_I` field.
22896    pub const fn partid_i(self) -> u16 {
22897        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
22898    }
22899
22900    /// Sets the value of the `PARTID_I` field.
22901    pub const fn set_partid_i(&mut self, value: u16) {
22902        let offset = Self::PARTID_I_SHIFT;
22903        assert!(value & (Self::PARTID_I_MASK as u16) == value);
22904        *self = Self::from_bits_retain(
22905            (self.bits() & !(Self::PARTID_I_MASK << offset)) | ((value as u64) << offset),
22906        );
22907    }
22908
22909    /// Returns a copy with the `PARTID_I` field set to the given value.
22910    pub const fn with_partid_i(mut self, value: u16) -> Self {
22911        self.set_partid_i(value);
22912        self
22913    }
22914
22915    /// Returns the value of the `PARTID_D` field.
22916    pub const fn partid_d(self) -> u16 {
22917        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
22918    }
22919
22920    /// Sets the value of the `PARTID_D` field.
22921    pub const fn set_partid_d(&mut self, value: u16) {
22922        let offset = Self::PARTID_D_SHIFT;
22923        assert!(value & (Self::PARTID_D_MASK as u16) == value);
22924        *self = Self::from_bits_retain(
22925            (self.bits() & !(Self::PARTID_D_MASK << offset)) | ((value as u64) << offset),
22926        );
22927    }
22928
22929    /// Returns a copy with the `PARTID_D` field set to the given value.
22930    pub const fn with_partid_d(mut self, value: u16) -> Self {
22931        self.set_partid_d(value);
22932        self
22933    }
22934
22935    /// Returns the value of the `altPARTID` field.
22936    pub const fn altpartid(self) -> u16 {
22937        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
22938    }
22939
22940    /// Sets the value of the `altPARTID` field.
22941    pub const fn set_altpartid(&mut self, value: u16) {
22942        let offset = Self::ALTPARTID_SHIFT;
22943        assert!(value & (Self::ALTPARTID_MASK as u16) == value);
22944        *self = Self::from_bits_retain(
22945            (self.bits() & !(Self::ALTPARTID_MASK << offset)) | ((value as u64) << offset),
22946        );
22947    }
22948
22949    /// Returns a copy with the `altPARTID` field set to the given value.
22950    pub const fn with_altpartid(mut self, value: u16) -> Self {
22951        self.set_altpartid(value);
22952        self
22953    }
22954
22955    /// Returns the value of the `PMG` field.
22956    pub const fn pmg(self) -> u16 {
22957        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
22958    }
22959
22960    /// Sets the value of the `PMG` field.
22961    pub const fn set_pmg(&mut self, value: u16) {
22962        let offset = Self::PMG_SHIFT;
22963        assert!(value & (Self::PMG_MASK as u16) == value);
22964        *self = Self::from_bits_retain(
22965            (self.bits() & !(Self::PMG_MASK << offset)) | ((value as u64) << offset),
22966        );
22967    }
22968
22969    /// Returns a copy with the `PMG` field set to the given value.
22970    pub const fn with_pmg(mut self, value: u16) -> Self {
22971        self.set_pmg(value);
22972        self
22973    }
22974
22975    /// Returns the value of the `PMG_I` field.
22976    pub const fn pmg_i(self) -> u8 {
22977        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
22978    }
22979
22980    /// Sets the value of the `PMG_I` field.
22981    pub const fn set_pmg_i(&mut self, value: u8) {
22982        let offset = Self::PMG_I_SHIFT;
22983        assert!(value & (Self::PMG_I_MASK as u8) == value);
22984        *self = Self::from_bits_retain(
22985            (self.bits() & !(Self::PMG_I_MASK << offset)) | ((value as u64) << offset),
22986        );
22987    }
22988
22989    /// Returns a copy with the `PMG_I` field set to the given value.
22990    pub const fn with_pmg_i(mut self, value: u8) -> Self {
22991        self.set_pmg_i(value);
22992        self
22993    }
22994
22995    /// Returns the value of the `PMG_D` field.
22996    pub const fn pmg_d(self) -> u8 {
22997        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
22998    }
22999
23000    /// Sets the value of the `PMG_D` field.
23001    pub const fn set_pmg_d(&mut self, value: u8) {
23002        let offset = Self::PMG_D_SHIFT;
23003        assert!(value & (Self::PMG_D_MASK as u8) == value);
23004        *self = Self::from_bits_retain(
23005            (self.bits() & !(Self::PMG_D_MASK << offset)) | ((value as u64) << offset),
23006        );
23007    }
23008
23009    /// Returns a copy with the `PMG_D` field set to the given value.
23010    pub const fn with_pmg_d(mut self, value: u8) -> Self {
23011        self.set_pmg_d(value);
23012        self
23013    }
23014
23015    /// Returns the value of the `altPMG` field.
23016    pub const fn altpmg(self) -> u16 {
23017        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
23018    }
23019
23020    /// Sets the value of the `altPMG` field.
23021    pub const fn set_altpmg(&mut self, value: u16) {
23022        let offset = Self::ALTPMG_SHIFT;
23023        assert!(value & (Self::ALTPMG_MASK as u16) == value);
23024        *self = Self::from_bits_retain(
23025            (self.bits() & !(Self::ALTPMG_MASK << offset)) | ((value as u64) << offset),
23026        );
23027    }
23028
23029    /// Returns a copy with the `altPMG` field set to the given value.
23030    pub const fn with_altpmg(mut self, value: u16) -> Self {
23031        self.set_altpmg(value);
23032        self
23033    }
23034}
23035
23036#[cfg(feature = "el2")]
23037bitflags! {
23038    /// `MPAMHCR_EL2` system register value.
23039    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23040    #[repr(transparent)]
23041    pub struct MpamhcrEl2: u64 {
23042        /// `EL0_VPMEN` bit.
23043        const EL0_VPMEN = 1 << 0;
23044        /// `EL1_VPMEN` bit.
23045        const EL1_VPMEN = 1 << 1;
23046        /// `VPMEN` bit.
23047        const VPMEN = 1 << 2;
23048        /// `VMMEN` bit.
23049        const VMMEN = 1 << 3;
23050        /// `SMVPMEN` bit.
23051        const SMVPMEN = 1 << 4;
23052        /// `SMVMMEN` bit.
23053        const SMVMMEN = 1 << 5;
23054        /// `GSTAPP_PLK` bit.
23055        const GSTAPP_PLK = 1 << 8;
23056        /// `TRAP_MPAMIDR_EL1` bit.
23057        const TRAP_MPAMIDR_EL1 = 1 << 31;
23058        /// `nTRAPMPAM1EL1` bit.
23059        const NTRAPMPAM1EL1 = 1 << 48;
23060        /// `nTRAPMPAM0EL1` bit.
23061        const NTRAPMPAM0EL1 = 1 << 49;
23062        /// `nTRAPMPAMSM` bit.
23063        const NTRAPMPAMSM = 1 << 50;
23064        /// `nTIDR` bit.
23065        const NTIDR = 1 << 58;
23066    }
23067}
23068
23069#[cfg(feature = "el2")]
23070impl MpamhcrEl2 {
23071    /// Offset of the `EL0_VPMEN` field.
23072    pub const EL0_VPMEN_SHIFT: u32 = 0;
23073    /// Offset of the `EL1_VPMEN` field.
23074    pub const EL1_VPMEN_SHIFT: u32 = 1;
23075    /// Offset of the `VPMEN` field.
23076    pub const VPMEN_SHIFT: u32 = 2;
23077    /// Offset of the `VMMEN` field.
23078    pub const VMMEN_SHIFT: u32 = 3;
23079    /// Offset of the `SMVPMEN` field.
23080    pub const SMVPMEN_SHIFT: u32 = 4;
23081    /// Offset of the `SMVMMEN` field.
23082    pub const SMVMMEN_SHIFT: u32 = 5;
23083    /// Offset of the `GSTAPP_PLK` field.
23084    pub const GSTAPP_PLK_SHIFT: u32 = 8;
23085    /// Offset of the `TRAP_MPAMIDR_EL1` field.
23086    pub const TRAP_MPAMIDR_EL1_SHIFT: u32 = 31;
23087    /// Offset of the `nTRAPMPAM1EL1` field.
23088    pub const NTRAPMPAM1EL1_SHIFT: u32 = 48;
23089    /// Offset of the `nTRAPMPAM0EL1` field.
23090    pub const NTRAPMPAM0EL1_SHIFT: u32 = 49;
23091    /// Offset of the `nTRAPMPAMSM` field.
23092    pub const NTRAPMPAMSM_SHIFT: u32 = 50;
23093    /// Offset of the `nTIDR` field.
23094    pub const NTIDR_SHIFT: u32 = 58;
23095}
23096
23097#[cfg(feature = "el1")]
23098bitflags! {
23099    /// `MPAMIDR_EL1` system register value.
23100    ///
23101    /// Indicates the maximum PARTID and PMG values supported in the implementation and the support for other optional features.
23102    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23103    #[repr(transparent)]
23104    pub struct MpamidrEl1: u64 {
23105        /// Indicates support for MPAM virtualization.
23106        const HAS_HCR = 1 << 17;
23107        /// `HAS_ALT_ID` bit.
23108        const HAS_ALT_ID = 1 << 21;
23109        /// `HAS_INSTR_ALT_ID` bit.
23110        const HAS_INSTR_ALT_ID = 1 << 22;
23111        /// `HAS_BW_CTRL` bit.
23112        const HAS_BW_CTRL = 1 << 56;
23113        /// `HAS_ALTSP` bit.
23114        const HAS_ALTSP = 1 << 57;
23115        /// `HAS_TIDR` bit.
23116        const HAS_TIDR = 1 << 58;
23117        /// `SP4` bit.
23118        const SP4 = 1 << 59;
23119        /// `HAS_FORCE_NS` bit.
23120        const HAS_FORCE_NS = 1 << 60;
23121        /// `HAS_SDEFLT` bit.
23122        const HAS_SDEFLT = 1 << 61;
23123    }
23124}
23125
23126#[cfg(feature = "el1")]
23127impl MpamidrEl1 {
23128    /// Offset of the `PARTID_MAX` field.
23129    pub const PARTID_MAX_SHIFT: u32 = 0;
23130    /// Mask for the `PARTID_MAX` field.
23131    pub const PARTID_MAX_MASK: u64 = 0b1111111111111111;
23132    /// Offset of the `HAS_HCR` field.
23133    pub const HAS_HCR_SHIFT: u32 = 17;
23134    /// Offset of the `VPMR_MAX` field.
23135    pub const VPMR_MAX_SHIFT: u32 = 18;
23136    /// Mask for the `VPMR_MAX` field.
23137    pub const VPMR_MAX_MASK: u64 = 0b111;
23138    /// Offset of the `HAS_ALT_ID` field.
23139    pub const HAS_ALT_ID_SHIFT: u32 = 21;
23140    /// Offset of the `HAS_INSTR_ALT_ID` field.
23141    pub const HAS_INSTR_ALT_ID_SHIFT: u32 = 22;
23142    /// Offset of the `HAS_BW_CTRL` field.
23143    pub const HAS_BW_CTRL_SHIFT: u32 = 56;
23144    /// Offset of the `HAS_ALTSP` field.
23145    pub const HAS_ALTSP_SHIFT: u32 = 57;
23146    /// Offset of the `HAS_TIDR` field.
23147    pub const HAS_TIDR_SHIFT: u32 = 58;
23148    /// Offset of the `SP4` field.
23149    pub const SP4_SHIFT: u32 = 59;
23150    /// Offset of the `HAS_FORCE_NS` field.
23151    pub const HAS_FORCE_NS_SHIFT: u32 = 60;
23152    /// Offset of the `HAS_SDEFLT` field.
23153    pub const HAS_SDEFLT_SHIFT: u32 = 61;
23154
23155    /// Returns the value of the `PARTID_MAX` field.
23156    pub const fn partid_max(self) -> u16 {
23157        ((self.bits() >> Self::PARTID_MAX_SHIFT) & 0b1111111111111111) as u16
23158    }
23159
23160    /// Sets the value of the `PARTID_MAX` field.
23161    pub const fn set_partid_max(&mut self, value: u16) {
23162        let offset = Self::PARTID_MAX_SHIFT;
23163        assert!(value & (Self::PARTID_MAX_MASK as u16) == value);
23164        *self = Self::from_bits_retain(
23165            (self.bits() & !(Self::PARTID_MAX_MASK << offset)) | ((value as u64) << offset),
23166        );
23167    }
23168
23169    /// Returns a copy with the `PARTID_MAX` field set to the given value.
23170    pub const fn with_partid_max(mut self, value: u16) -> Self {
23171        self.set_partid_max(value);
23172        self
23173    }
23174
23175    /// Returns the value of the `VPMR_MAX` field.
23176    ///
23177    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
23178    pub const fn vpmr_max(self) -> u8 {
23179        ((self.bits() >> Self::VPMR_MAX_SHIFT) & 0b111) as u8
23180    }
23181
23182    /// Sets the value of the `VPMR_MAX` field.
23183    ///
23184    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
23185    pub const fn set_vpmr_max(&mut self, value: u8) {
23186        let offset = Self::VPMR_MAX_SHIFT;
23187        assert!(value & (Self::VPMR_MAX_MASK as u8) == value);
23188        *self = Self::from_bits_retain(
23189            (self.bits() & !(Self::VPMR_MAX_MASK << offset)) | ((value as u64) << offset),
23190        );
23191    }
23192
23193    /// Returns a copy with the `VPMR_MAX` field set to the given value.
23194    ///
23195    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
23196    pub const fn with_vpmr_max(mut self, value: u8) -> Self {
23197        self.set_vpmr_max(value);
23198        self
23199    }
23200}
23201
23202#[cfg(feature = "el2")]
23203bitflags! {
23204    /// `MPAMVPM0_EL2` system register value.
23205    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23206    #[repr(transparent)]
23207    pub struct Mpamvpm0El2: u64 {
23208    }
23209}
23210
23211#[cfg(feature = "el2")]
23212impl Mpamvpm0El2 {
23213    /// Offset of the `PhyPARTID0` field.
23214    pub const PHYPARTID0_SHIFT: u32 = 0;
23215    /// Mask for the `PhyPARTID0` field.
23216    pub const PHYPARTID0_MASK: u64 = 0b1111111111111111;
23217    /// Offset of the `PhyPARTID1` field.
23218    pub const PHYPARTID1_SHIFT: u32 = 16;
23219    /// Mask for the `PhyPARTID1` field.
23220    pub const PHYPARTID1_MASK: u64 = 0b1111111111111111;
23221    /// Offset of the `PhyPARTID2` field.
23222    pub const PHYPARTID2_SHIFT: u32 = 32;
23223    /// Mask for the `PhyPARTID2` field.
23224    pub const PHYPARTID2_MASK: u64 = 0b1111111111111111;
23225    /// Offset of the `PhyPARTID3` field.
23226    pub const PHYPARTID3_SHIFT: u32 = 48;
23227    /// Mask for the `PhyPARTID3` field.
23228    pub const PHYPARTID3_MASK: u64 = 0b1111111111111111;
23229
23230    /// Returns the value of the `PhyPARTID0` field.
23231    pub const fn phypartid0(self) -> u16 {
23232        ((self.bits() >> Self::PHYPARTID0_SHIFT) & 0b1111111111111111) as u16
23233    }
23234
23235    /// Sets the value of the `PhyPARTID0` field.
23236    pub const fn set_phypartid0(&mut self, value: u16) {
23237        let offset = Self::PHYPARTID0_SHIFT;
23238        assert!(value & (Self::PHYPARTID0_MASK as u16) == value);
23239        *self = Self::from_bits_retain(
23240            (self.bits() & !(Self::PHYPARTID0_MASK << offset)) | ((value as u64) << offset),
23241        );
23242    }
23243
23244    /// Returns a copy with the `PhyPARTID0` field set to the given value.
23245    pub const fn with_phypartid0(mut self, value: u16) -> Self {
23246        self.set_phypartid0(value);
23247        self
23248    }
23249
23250    /// Returns the value of the `PhyPARTID1` field.
23251    pub const fn phypartid1(self) -> u16 {
23252        ((self.bits() >> Self::PHYPARTID1_SHIFT) & 0b1111111111111111) as u16
23253    }
23254
23255    /// Sets the value of the `PhyPARTID1` field.
23256    pub const fn set_phypartid1(&mut self, value: u16) {
23257        let offset = Self::PHYPARTID1_SHIFT;
23258        assert!(value & (Self::PHYPARTID1_MASK as u16) == value);
23259        *self = Self::from_bits_retain(
23260            (self.bits() & !(Self::PHYPARTID1_MASK << offset)) | ((value as u64) << offset),
23261        );
23262    }
23263
23264    /// Returns a copy with the `PhyPARTID1` field set to the given value.
23265    pub const fn with_phypartid1(mut self, value: u16) -> Self {
23266        self.set_phypartid1(value);
23267        self
23268    }
23269
23270    /// Returns the value of the `PhyPARTID2` field.
23271    pub const fn phypartid2(self) -> u16 {
23272        ((self.bits() >> Self::PHYPARTID2_SHIFT) & 0b1111111111111111) as u16
23273    }
23274
23275    /// Sets the value of the `PhyPARTID2` field.
23276    pub const fn set_phypartid2(&mut self, value: u16) {
23277        let offset = Self::PHYPARTID2_SHIFT;
23278        assert!(value & (Self::PHYPARTID2_MASK as u16) == value);
23279        *self = Self::from_bits_retain(
23280            (self.bits() & !(Self::PHYPARTID2_MASK << offset)) | ((value as u64) << offset),
23281        );
23282    }
23283
23284    /// Returns a copy with the `PhyPARTID2` field set to the given value.
23285    pub const fn with_phypartid2(mut self, value: u16) -> Self {
23286        self.set_phypartid2(value);
23287        self
23288    }
23289
23290    /// Returns the value of the `PhyPARTID3` field.
23291    pub const fn phypartid3(self) -> u16 {
23292        ((self.bits() >> Self::PHYPARTID3_SHIFT) & 0b1111111111111111) as u16
23293    }
23294
23295    /// Sets the value of the `PhyPARTID3` field.
23296    pub const fn set_phypartid3(&mut self, value: u16) {
23297        let offset = Self::PHYPARTID3_SHIFT;
23298        assert!(value & (Self::PHYPARTID3_MASK as u16) == value);
23299        *self = Self::from_bits_retain(
23300            (self.bits() & !(Self::PHYPARTID3_MASK << offset)) | ((value as u64) << offset),
23301        );
23302    }
23303
23304    /// Returns a copy with the `PhyPARTID3` field set to the given value.
23305    pub const fn with_phypartid3(mut self, value: u16) -> Self {
23306        self.set_phypartid3(value);
23307        self
23308    }
23309}
23310
23311#[cfg(feature = "el2")]
23312bitflags! {
23313    /// `MPAMVPM1_EL2` system register value.
23314    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23315    #[repr(transparent)]
23316    pub struct Mpamvpm1El2: u64 {
23317    }
23318}
23319
23320#[cfg(feature = "el2")]
23321impl Mpamvpm1El2 {
23322    /// Offset of the `PhyPARTID4` field.
23323    pub const PHYPARTID4_SHIFT: u32 = 0;
23324    /// Mask for the `PhyPARTID4` field.
23325    pub const PHYPARTID4_MASK: u64 = 0b1111111111111111;
23326    /// Offset of the `PhyPARTID5` field.
23327    pub const PHYPARTID5_SHIFT: u32 = 16;
23328    /// Mask for the `PhyPARTID5` field.
23329    pub const PHYPARTID5_MASK: u64 = 0b1111111111111111;
23330    /// Offset of the `PhyPARTID6` field.
23331    pub const PHYPARTID6_SHIFT: u32 = 32;
23332    /// Mask for the `PhyPARTID6` field.
23333    pub const PHYPARTID6_MASK: u64 = 0b1111111111111111;
23334    /// Offset of the `PhyPARTID7` field.
23335    pub const PHYPARTID7_SHIFT: u32 = 48;
23336    /// Mask for the `PhyPARTID7` field.
23337    pub const PHYPARTID7_MASK: u64 = 0b1111111111111111;
23338
23339    /// Returns the value of the `PhyPARTID4` field.
23340    pub const fn phypartid4(self) -> u16 {
23341        ((self.bits() >> Self::PHYPARTID4_SHIFT) & 0b1111111111111111) as u16
23342    }
23343
23344    /// Sets the value of the `PhyPARTID4` field.
23345    pub const fn set_phypartid4(&mut self, value: u16) {
23346        let offset = Self::PHYPARTID4_SHIFT;
23347        assert!(value & (Self::PHYPARTID4_MASK as u16) == value);
23348        *self = Self::from_bits_retain(
23349            (self.bits() & !(Self::PHYPARTID4_MASK << offset)) | ((value as u64) << offset),
23350        );
23351    }
23352
23353    /// Returns a copy with the `PhyPARTID4` field set to the given value.
23354    pub const fn with_phypartid4(mut self, value: u16) -> Self {
23355        self.set_phypartid4(value);
23356        self
23357    }
23358
23359    /// Returns the value of the `PhyPARTID5` field.
23360    pub const fn phypartid5(self) -> u16 {
23361        ((self.bits() >> Self::PHYPARTID5_SHIFT) & 0b1111111111111111) as u16
23362    }
23363
23364    /// Sets the value of the `PhyPARTID5` field.
23365    pub const fn set_phypartid5(&mut self, value: u16) {
23366        let offset = Self::PHYPARTID5_SHIFT;
23367        assert!(value & (Self::PHYPARTID5_MASK as u16) == value);
23368        *self = Self::from_bits_retain(
23369            (self.bits() & !(Self::PHYPARTID5_MASK << offset)) | ((value as u64) << offset),
23370        );
23371    }
23372
23373    /// Returns a copy with the `PhyPARTID5` field set to the given value.
23374    pub const fn with_phypartid5(mut self, value: u16) -> Self {
23375        self.set_phypartid5(value);
23376        self
23377    }
23378
23379    /// Returns the value of the `PhyPARTID6` field.
23380    pub const fn phypartid6(self) -> u16 {
23381        ((self.bits() >> Self::PHYPARTID6_SHIFT) & 0b1111111111111111) as u16
23382    }
23383
23384    /// Sets the value of the `PhyPARTID6` field.
23385    pub const fn set_phypartid6(&mut self, value: u16) {
23386        let offset = Self::PHYPARTID6_SHIFT;
23387        assert!(value & (Self::PHYPARTID6_MASK as u16) == value);
23388        *self = Self::from_bits_retain(
23389            (self.bits() & !(Self::PHYPARTID6_MASK << offset)) | ((value as u64) << offset),
23390        );
23391    }
23392
23393    /// Returns a copy with the `PhyPARTID6` field set to the given value.
23394    pub const fn with_phypartid6(mut self, value: u16) -> Self {
23395        self.set_phypartid6(value);
23396        self
23397    }
23398
23399    /// Returns the value of the `PhyPARTID7` field.
23400    pub const fn phypartid7(self) -> u16 {
23401        ((self.bits() >> Self::PHYPARTID7_SHIFT) & 0b1111111111111111) as u16
23402    }
23403
23404    /// Sets the value of the `PhyPARTID7` field.
23405    pub const fn set_phypartid7(&mut self, value: u16) {
23406        let offset = Self::PHYPARTID7_SHIFT;
23407        assert!(value & (Self::PHYPARTID7_MASK as u16) == value);
23408        *self = Self::from_bits_retain(
23409            (self.bits() & !(Self::PHYPARTID7_MASK << offset)) | ((value as u64) << offset),
23410        );
23411    }
23412
23413    /// Returns a copy with the `PhyPARTID7` field set to the given value.
23414    pub const fn with_phypartid7(mut self, value: u16) -> Self {
23415        self.set_phypartid7(value);
23416        self
23417    }
23418}
23419
23420#[cfg(feature = "el2")]
23421bitflags! {
23422    /// `MPAMVPM2_EL2` system register value.
23423    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23424    #[repr(transparent)]
23425    pub struct Mpamvpm2El2: u64 {
23426    }
23427}
23428
23429#[cfg(feature = "el2")]
23430impl Mpamvpm2El2 {
23431    /// Offset of the `PhyPARTID8` field.
23432    pub const PHYPARTID8_SHIFT: u32 = 0;
23433    /// Mask for the `PhyPARTID8` field.
23434    pub const PHYPARTID8_MASK: u64 = 0b1111111111111111;
23435    /// Offset of the `PhyPARTID9` field.
23436    pub const PHYPARTID9_SHIFT: u32 = 16;
23437    /// Mask for the `PhyPARTID9` field.
23438    pub const PHYPARTID9_MASK: u64 = 0b1111111111111111;
23439    /// Offset of the `PhyPARTID10` field.
23440    pub const PHYPARTID10_SHIFT: u32 = 32;
23441    /// Mask for the `PhyPARTID10` field.
23442    pub const PHYPARTID10_MASK: u64 = 0b1111111111111111;
23443    /// Offset of the `PhyPARTID11` field.
23444    pub const PHYPARTID11_SHIFT: u32 = 48;
23445    /// Mask for the `PhyPARTID11` field.
23446    pub const PHYPARTID11_MASK: u64 = 0b1111111111111111;
23447
23448    /// Returns the value of the `PhyPARTID8` field.
23449    pub const fn phypartid8(self) -> u16 {
23450        ((self.bits() >> Self::PHYPARTID8_SHIFT) & 0b1111111111111111) as u16
23451    }
23452
23453    /// Sets the value of the `PhyPARTID8` field.
23454    pub const fn set_phypartid8(&mut self, value: u16) {
23455        let offset = Self::PHYPARTID8_SHIFT;
23456        assert!(value & (Self::PHYPARTID8_MASK as u16) == value);
23457        *self = Self::from_bits_retain(
23458            (self.bits() & !(Self::PHYPARTID8_MASK << offset)) | ((value as u64) << offset),
23459        );
23460    }
23461
23462    /// Returns a copy with the `PhyPARTID8` field set to the given value.
23463    pub const fn with_phypartid8(mut self, value: u16) -> Self {
23464        self.set_phypartid8(value);
23465        self
23466    }
23467
23468    /// Returns the value of the `PhyPARTID9` field.
23469    pub const fn phypartid9(self) -> u16 {
23470        ((self.bits() >> Self::PHYPARTID9_SHIFT) & 0b1111111111111111) as u16
23471    }
23472
23473    /// Sets the value of the `PhyPARTID9` field.
23474    pub const fn set_phypartid9(&mut self, value: u16) {
23475        let offset = Self::PHYPARTID9_SHIFT;
23476        assert!(value & (Self::PHYPARTID9_MASK as u16) == value);
23477        *self = Self::from_bits_retain(
23478            (self.bits() & !(Self::PHYPARTID9_MASK << offset)) | ((value as u64) << offset),
23479        );
23480    }
23481
23482    /// Returns a copy with the `PhyPARTID9` field set to the given value.
23483    pub const fn with_phypartid9(mut self, value: u16) -> Self {
23484        self.set_phypartid9(value);
23485        self
23486    }
23487
23488    /// Returns the value of the `PhyPARTID10` field.
23489    pub const fn phypartid10(self) -> u16 {
23490        ((self.bits() >> Self::PHYPARTID10_SHIFT) & 0b1111111111111111) as u16
23491    }
23492
23493    /// Sets the value of the `PhyPARTID10` field.
23494    pub const fn set_phypartid10(&mut self, value: u16) {
23495        let offset = Self::PHYPARTID10_SHIFT;
23496        assert!(value & (Self::PHYPARTID10_MASK as u16) == value);
23497        *self = Self::from_bits_retain(
23498            (self.bits() & !(Self::PHYPARTID10_MASK << offset)) | ((value as u64) << offset),
23499        );
23500    }
23501
23502    /// Returns a copy with the `PhyPARTID10` field set to the given value.
23503    pub const fn with_phypartid10(mut self, value: u16) -> Self {
23504        self.set_phypartid10(value);
23505        self
23506    }
23507
23508    /// Returns the value of the `PhyPARTID11` field.
23509    pub const fn phypartid11(self) -> u16 {
23510        ((self.bits() >> Self::PHYPARTID11_SHIFT) & 0b1111111111111111) as u16
23511    }
23512
23513    /// Sets the value of the `PhyPARTID11` field.
23514    pub const fn set_phypartid11(&mut self, value: u16) {
23515        let offset = Self::PHYPARTID11_SHIFT;
23516        assert!(value & (Self::PHYPARTID11_MASK as u16) == value);
23517        *self = Self::from_bits_retain(
23518            (self.bits() & !(Self::PHYPARTID11_MASK << offset)) | ((value as u64) << offset),
23519        );
23520    }
23521
23522    /// Returns a copy with the `PhyPARTID11` field set to the given value.
23523    pub const fn with_phypartid11(mut self, value: u16) -> Self {
23524        self.set_phypartid11(value);
23525        self
23526    }
23527}
23528
23529#[cfg(feature = "el2")]
23530bitflags! {
23531    /// `MPAMVPM3_EL2` system register value.
23532    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23533    #[repr(transparent)]
23534    pub struct Mpamvpm3El2: u64 {
23535    }
23536}
23537
23538#[cfg(feature = "el2")]
23539impl Mpamvpm3El2 {
23540    /// Offset of the `PhyPARTID12` field.
23541    pub const PHYPARTID12_SHIFT: u32 = 0;
23542    /// Mask for the `PhyPARTID12` field.
23543    pub const PHYPARTID12_MASK: u64 = 0b1111111111111111;
23544    /// Offset of the `PhyPARTID13` field.
23545    pub const PHYPARTID13_SHIFT: u32 = 16;
23546    /// Mask for the `PhyPARTID13` field.
23547    pub const PHYPARTID13_MASK: u64 = 0b1111111111111111;
23548    /// Offset of the `PhyPARTID14` field.
23549    pub const PHYPARTID14_SHIFT: u32 = 32;
23550    /// Mask for the `PhyPARTID14` field.
23551    pub const PHYPARTID14_MASK: u64 = 0b1111111111111111;
23552    /// Offset of the `PhyPARTID15` field.
23553    pub const PHYPARTID15_SHIFT: u32 = 48;
23554    /// Mask for the `PhyPARTID15` field.
23555    pub const PHYPARTID15_MASK: u64 = 0b1111111111111111;
23556
23557    /// Returns the value of the `PhyPARTID12` field.
23558    pub const fn phypartid12(self) -> u16 {
23559        ((self.bits() >> Self::PHYPARTID12_SHIFT) & 0b1111111111111111) as u16
23560    }
23561
23562    /// Sets the value of the `PhyPARTID12` field.
23563    pub const fn set_phypartid12(&mut self, value: u16) {
23564        let offset = Self::PHYPARTID12_SHIFT;
23565        assert!(value & (Self::PHYPARTID12_MASK as u16) == value);
23566        *self = Self::from_bits_retain(
23567            (self.bits() & !(Self::PHYPARTID12_MASK << offset)) | ((value as u64) << offset),
23568        );
23569    }
23570
23571    /// Returns a copy with the `PhyPARTID12` field set to the given value.
23572    pub const fn with_phypartid12(mut self, value: u16) -> Self {
23573        self.set_phypartid12(value);
23574        self
23575    }
23576
23577    /// Returns the value of the `PhyPARTID13` field.
23578    pub const fn phypartid13(self) -> u16 {
23579        ((self.bits() >> Self::PHYPARTID13_SHIFT) & 0b1111111111111111) as u16
23580    }
23581
23582    /// Sets the value of the `PhyPARTID13` field.
23583    pub const fn set_phypartid13(&mut self, value: u16) {
23584        let offset = Self::PHYPARTID13_SHIFT;
23585        assert!(value & (Self::PHYPARTID13_MASK as u16) == value);
23586        *self = Self::from_bits_retain(
23587            (self.bits() & !(Self::PHYPARTID13_MASK << offset)) | ((value as u64) << offset),
23588        );
23589    }
23590
23591    /// Returns a copy with the `PhyPARTID13` field set to the given value.
23592    pub const fn with_phypartid13(mut self, value: u16) -> Self {
23593        self.set_phypartid13(value);
23594        self
23595    }
23596
23597    /// Returns the value of the `PhyPARTID14` field.
23598    pub const fn phypartid14(self) -> u16 {
23599        ((self.bits() >> Self::PHYPARTID14_SHIFT) & 0b1111111111111111) as u16
23600    }
23601
23602    /// Sets the value of the `PhyPARTID14` field.
23603    pub const fn set_phypartid14(&mut self, value: u16) {
23604        let offset = Self::PHYPARTID14_SHIFT;
23605        assert!(value & (Self::PHYPARTID14_MASK as u16) == value);
23606        *self = Self::from_bits_retain(
23607            (self.bits() & !(Self::PHYPARTID14_MASK << offset)) | ((value as u64) << offset),
23608        );
23609    }
23610
23611    /// Returns a copy with the `PhyPARTID14` field set to the given value.
23612    pub const fn with_phypartid14(mut self, value: u16) -> Self {
23613        self.set_phypartid14(value);
23614        self
23615    }
23616
23617    /// Returns the value of the `PhyPARTID15` field.
23618    pub const fn phypartid15(self) -> u16 {
23619        ((self.bits() >> Self::PHYPARTID15_SHIFT) & 0b1111111111111111) as u16
23620    }
23621
23622    /// Sets the value of the `PhyPARTID15` field.
23623    pub const fn set_phypartid15(&mut self, value: u16) {
23624        let offset = Self::PHYPARTID15_SHIFT;
23625        assert!(value & (Self::PHYPARTID15_MASK as u16) == value);
23626        *self = Self::from_bits_retain(
23627            (self.bits() & !(Self::PHYPARTID15_MASK << offset)) | ((value as u64) << offset),
23628        );
23629    }
23630
23631    /// Returns a copy with the `PhyPARTID15` field set to the given value.
23632    pub const fn with_phypartid15(mut self, value: u16) -> Self {
23633        self.set_phypartid15(value);
23634        self
23635    }
23636}
23637
23638#[cfg(feature = "el2")]
23639bitflags! {
23640    /// `MPAMVPM4_EL2` system register value.
23641    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23642    #[repr(transparent)]
23643    pub struct Mpamvpm4El2: u64 {
23644    }
23645}
23646
23647#[cfg(feature = "el2")]
23648impl Mpamvpm4El2 {
23649    /// Offset of the `PhyPARTID16` field.
23650    pub const PHYPARTID16_SHIFT: u32 = 0;
23651    /// Mask for the `PhyPARTID16` field.
23652    pub const PHYPARTID16_MASK: u64 = 0b1111111111111111;
23653    /// Offset of the `PhyPARTID17` field.
23654    pub const PHYPARTID17_SHIFT: u32 = 16;
23655    /// Mask for the `PhyPARTID17` field.
23656    pub const PHYPARTID17_MASK: u64 = 0b1111111111111111;
23657    /// Offset of the `PhyPARTID18` field.
23658    pub const PHYPARTID18_SHIFT: u32 = 32;
23659    /// Mask for the `PhyPARTID18` field.
23660    pub const PHYPARTID18_MASK: u64 = 0b1111111111111111;
23661    /// Offset of the `PhyPARTID19` field.
23662    pub const PHYPARTID19_SHIFT: u32 = 48;
23663    /// Mask for the `PhyPARTID19` field.
23664    pub const PHYPARTID19_MASK: u64 = 0b1111111111111111;
23665
23666    /// Returns the value of the `PhyPARTID16` field.
23667    pub const fn phypartid16(self) -> u16 {
23668        ((self.bits() >> Self::PHYPARTID16_SHIFT) & 0b1111111111111111) as u16
23669    }
23670
23671    /// Sets the value of the `PhyPARTID16` field.
23672    pub const fn set_phypartid16(&mut self, value: u16) {
23673        let offset = Self::PHYPARTID16_SHIFT;
23674        assert!(value & (Self::PHYPARTID16_MASK as u16) == value);
23675        *self = Self::from_bits_retain(
23676            (self.bits() & !(Self::PHYPARTID16_MASK << offset)) | ((value as u64) << offset),
23677        );
23678    }
23679
23680    /// Returns a copy with the `PhyPARTID16` field set to the given value.
23681    pub const fn with_phypartid16(mut self, value: u16) -> Self {
23682        self.set_phypartid16(value);
23683        self
23684    }
23685
23686    /// Returns the value of the `PhyPARTID17` field.
23687    pub const fn phypartid17(self) -> u16 {
23688        ((self.bits() >> Self::PHYPARTID17_SHIFT) & 0b1111111111111111) as u16
23689    }
23690
23691    /// Sets the value of the `PhyPARTID17` field.
23692    pub const fn set_phypartid17(&mut self, value: u16) {
23693        let offset = Self::PHYPARTID17_SHIFT;
23694        assert!(value & (Self::PHYPARTID17_MASK as u16) == value);
23695        *self = Self::from_bits_retain(
23696            (self.bits() & !(Self::PHYPARTID17_MASK << offset)) | ((value as u64) << offset),
23697        );
23698    }
23699
23700    /// Returns a copy with the `PhyPARTID17` field set to the given value.
23701    pub const fn with_phypartid17(mut self, value: u16) -> Self {
23702        self.set_phypartid17(value);
23703        self
23704    }
23705
23706    /// Returns the value of the `PhyPARTID18` field.
23707    pub const fn phypartid18(self) -> u16 {
23708        ((self.bits() >> Self::PHYPARTID18_SHIFT) & 0b1111111111111111) as u16
23709    }
23710
23711    /// Sets the value of the `PhyPARTID18` field.
23712    pub const fn set_phypartid18(&mut self, value: u16) {
23713        let offset = Self::PHYPARTID18_SHIFT;
23714        assert!(value & (Self::PHYPARTID18_MASK as u16) == value);
23715        *self = Self::from_bits_retain(
23716            (self.bits() & !(Self::PHYPARTID18_MASK << offset)) | ((value as u64) << offset),
23717        );
23718    }
23719
23720    /// Returns a copy with the `PhyPARTID18` field set to the given value.
23721    pub const fn with_phypartid18(mut self, value: u16) -> Self {
23722        self.set_phypartid18(value);
23723        self
23724    }
23725
23726    /// Returns the value of the `PhyPARTID19` field.
23727    pub const fn phypartid19(self) -> u16 {
23728        ((self.bits() >> Self::PHYPARTID19_SHIFT) & 0b1111111111111111) as u16
23729    }
23730
23731    /// Sets the value of the `PhyPARTID19` field.
23732    pub const fn set_phypartid19(&mut self, value: u16) {
23733        let offset = Self::PHYPARTID19_SHIFT;
23734        assert!(value & (Self::PHYPARTID19_MASK as u16) == value);
23735        *self = Self::from_bits_retain(
23736            (self.bits() & !(Self::PHYPARTID19_MASK << offset)) | ((value as u64) << offset),
23737        );
23738    }
23739
23740    /// Returns a copy with the `PhyPARTID19` field set to the given value.
23741    pub const fn with_phypartid19(mut self, value: u16) -> Self {
23742        self.set_phypartid19(value);
23743        self
23744    }
23745}
23746
23747#[cfg(feature = "el2")]
23748bitflags! {
23749    /// `MPAMVPM5_EL2` system register value.
23750    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23751    #[repr(transparent)]
23752    pub struct Mpamvpm5El2: u64 {
23753    }
23754}
23755
23756#[cfg(feature = "el2")]
23757impl Mpamvpm5El2 {
23758    /// Offset of the `PhyPARTID20` field.
23759    pub const PHYPARTID20_SHIFT: u32 = 0;
23760    /// Mask for the `PhyPARTID20` field.
23761    pub const PHYPARTID20_MASK: u64 = 0b1111111111111111;
23762    /// Offset of the `PhyPARTID21` field.
23763    pub const PHYPARTID21_SHIFT: u32 = 16;
23764    /// Mask for the `PhyPARTID21` field.
23765    pub const PHYPARTID21_MASK: u64 = 0b1111111111111111;
23766    /// Offset of the `PhyPARTID22` field.
23767    pub const PHYPARTID22_SHIFT: u32 = 32;
23768    /// Mask for the `PhyPARTID22` field.
23769    pub const PHYPARTID22_MASK: u64 = 0b1111111111111111;
23770    /// Offset of the `PhyPARTID23` field.
23771    pub const PHYPARTID23_SHIFT: u32 = 48;
23772    /// Mask for the `PhyPARTID23` field.
23773    pub const PHYPARTID23_MASK: u64 = 0b1111111111111111;
23774
23775    /// Returns the value of the `PhyPARTID20` field.
23776    pub const fn phypartid20(self) -> u16 {
23777        ((self.bits() >> Self::PHYPARTID20_SHIFT) & 0b1111111111111111) as u16
23778    }
23779
23780    /// Sets the value of the `PhyPARTID20` field.
23781    pub const fn set_phypartid20(&mut self, value: u16) {
23782        let offset = Self::PHYPARTID20_SHIFT;
23783        assert!(value & (Self::PHYPARTID20_MASK as u16) == value);
23784        *self = Self::from_bits_retain(
23785            (self.bits() & !(Self::PHYPARTID20_MASK << offset)) | ((value as u64) << offset),
23786        );
23787    }
23788
23789    /// Returns a copy with the `PhyPARTID20` field set to the given value.
23790    pub const fn with_phypartid20(mut self, value: u16) -> Self {
23791        self.set_phypartid20(value);
23792        self
23793    }
23794
23795    /// Returns the value of the `PhyPARTID21` field.
23796    pub const fn phypartid21(self) -> u16 {
23797        ((self.bits() >> Self::PHYPARTID21_SHIFT) & 0b1111111111111111) as u16
23798    }
23799
23800    /// Sets the value of the `PhyPARTID21` field.
23801    pub const fn set_phypartid21(&mut self, value: u16) {
23802        let offset = Self::PHYPARTID21_SHIFT;
23803        assert!(value & (Self::PHYPARTID21_MASK as u16) == value);
23804        *self = Self::from_bits_retain(
23805            (self.bits() & !(Self::PHYPARTID21_MASK << offset)) | ((value as u64) << offset),
23806        );
23807    }
23808
23809    /// Returns a copy with the `PhyPARTID21` field set to the given value.
23810    pub const fn with_phypartid21(mut self, value: u16) -> Self {
23811        self.set_phypartid21(value);
23812        self
23813    }
23814
23815    /// Returns the value of the `PhyPARTID22` field.
23816    pub const fn phypartid22(self) -> u16 {
23817        ((self.bits() >> Self::PHYPARTID22_SHIFT) & 0b1111111111111111) as u16
23818    }
23819
23820    /// Sets the value of the `PhyPARTID22` field.
23821    pub const fn set_phypartid22(&mut self, value: u16) {
23822        let offset = Self::PHYPARTID22_SHIFT;
23823        assert!(value & (Self::PHYPARTID22_MASK as u16) == value);
23824        *self = Self::from_bits_retain(
23825            (self.bits() & !(Self::PHYPARTID22_MASK << offset)) | ((value as u64) << offset),
23826        );
23827    }
23828
23829    /// Returns a copy with the `PhyPARTID22` field set to the given value.
23830    pub const fn with_phypartid22(mut self, value: u16) -> Self {
23831        self.set_phypartid22(value);
23832        self
23833    }
23834
23835    /// Returns the value of the `PhyPARTID23` field.
23836    pub const fn phypartid23(self) -> u16 {
23837        ((self.bits() >> Self::PHYPARTID23_SHIFT) & 0b1111111111111111) as u16
23838    }
23839
23840    /// Sets the value of the `PhyPARTID23` field.
23841    pub const fn set_phypartid23(&mut self, value: u16) {
23842        let offset = Self::PHYPARTID23_SHIFT;
23843        assert!(value & (Self::PHYPARTID23_MASK as u16) == value);
23844        *self = Self::from_bits_retain(
23845            (self.bits() & !(Self::PHYPARTID23_MASK << offset)) | ((value as u64) << offset),
23846        );
23847    }
23848
23849    /// Returns a copy with the `PhyPARTID23` field set to the given value.
23850    pub const fn with_phypartid23(mut self, value: u16) -> Self {
23851        self.set_phypartid23(value);
23852        self
23853    }
23854}
23855
23856#[cfg(feature = "el2")]
23857bitflags! {
23858    /// `MPAMVPM6_EL2` system register value.
23859    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23860    #[repr(transparent)]
23861    pub struct Mpamvpm6El2: u64 {
23862    }
23863}
23864
23865#[cfg(feature = "el2")]
23866impl Mpamvpm6El2 {
23867    /// Offset of the `PhyPARTID24` field.
23868    pub const PHYPARTID24_SHIFT: u32 = 0;
23869    /// Mask for the `PhyPARTID24` field.
23870    pub const PHYPARTID24_MASK: u64 = 0b1111111111111111;
23871    /// Offset of the `PhyPARTID25` field.
23872    pub const PHYPARTID25_SHIFT: u32 = 16;
23873    /// Mask for the `PhyPARTID25` field.
23874    pub const PHYPARTID25_MASK: u64 = 0b1111111111111111;
23875    /// Offset of the `PhyPARTID26` field.
23876    pub const PHYPARTID26_SHIFT: u32 = 32;
23877    /// Mask for the `PhyPARTID26` field.
23878    pub const PHYPARTID26_MASK: u64 = 0b1111111111111111;
23879    /// Offset of the `PhyPARTID27` field.
23880    pub const PHYPARTID27_SHIFT: u32 = 48;
23881    /// Mask for the `PhyPARTID27` field.
23882    pub const PHYPARTID27_MASK: u64 = 0b1111111111111111;
23883
23884    /// Returns the value of the `PhyPARTID24` field.
23885    pub const fn phypartid24(self) -> u16 {
23886        ((self.bits() >> Self::PHYPARTID24_SHIFT) & 0b1111111111111111) as u16
23887    }
23888
23889    /// Sets the value of the `PhyPARTID24` field.
23890    pub const fn set_phypartid24(&mut self, value: u16) {
23891        let offset = Self::PHYPARTID24_SHIFT;
23892        assert!(value & (Self::PHYPARTID24_MASK as u16) == value);
23893        *self = Self::from_bits_retain(
23894            (self.bits() & !(Self::PHYPARTID24_MASK << offset)) | ((value as u64) << offset),
23895        );
23896    }
23897
23898    /// Returns a copy with the `PhyPARTID24` field set to the given value.
23899    pub const fn with_phypartid24(mut self, value: u16) -> Self {
23900        self.set_phypartid24(value);
23901        self
23902    }
23903
23904    /// Returns the value of the `PhyPARTID25` field.
23905    pub const fn phypartid25(self) -> u16 {
23906        ((self.bits() >> Self::PHYPARTID25_SHIFT) & 0b1111111111111111) as u16
23907    }
23908
23909    /// Sets the value of the `PhyPARTID25` field.
23910    pub const fn set_phypartid25(&mut self, value: u16) {
23911        let offset = Self::PHYPARTID25_SHIFT;
23912        assert!(value & (Self::PHYPARTID25_MASK as u16) == value);
23913        *self = Self::from_bits_retain(
23914            (self.bits() & !(Self::PHYPARTID25_MASK << offset)) | ((value as u64) << offset),
23915        );
23916    }
23917
23918    /// Returns a copy with the `PhyPARTID25` field set to the given value.
23919    pub const fn with_phypartid25(mut self, value: u16) -> Self {
23920        self.set_phypartid25(value);
23921        self
23922    }
23923
23924    /// Returns the value of the `PhyPARTID26` field.
23925    pub const fn phypartid26(self) -> u16 {
23926        ((self.bits() >> Self::PHYPARTID26_SHIFT) & 0b1111111111111111) as u16
23927    }
23928
23929    /// Sets the value of the `PhyPARTID26` field.
23930    pub const fn set_phypartid26(&mut self, value: u16) {
23931        let offset = Self::PHYPARTID26_SHIFT;
23932        assert!(value & (Self::PHYPARTID26_MASK as u16) == value);
23933        *self = Self::from_bits_retain(
23934            (self.bits() & !(Self::PHYPARTID26_MASK << offset)) | ((value as u64) << offset),
23935        );
23936    }
23937
23938    /// Returns a copy with the `PhyPARTID26` field set to the given value.
23939    pub const fn with_phypartid26(mut self, value: u16) -> Self {
23940        self.set_phypartid26(value);
23941        self
23942    }
23943
23944    /// Returns the value of the `PhyPARTID27` field.
23945    pub const fn phypartid27(self) -> u16 {
23946        ((self.bits() >> Self::PHYPARTID27_SHIFT) & 0b1111111111111111) as u16
23947    }
23948
23949    /// Sets the value of the `PhyPARTID27` field.
23950    pub const fn set_phypartid27(&mut self, value: u16) {
23951        let offset = Self::PHYPARTID27_SHIFT;
23952        assert!(value & (Self::PHYPARTID27_MASK as u16) == value);
23953        *self = Self::from_bits_retain(
23954            (self.bits() & !(Self::PHYPARTID27_MASK << offset)) | ((value as u64) << offset),
23955        );
23956    }
23957
23958    /// Returns a copy with the `PhyPARTID27` field set to the given value.
23959    pub const fn with_phypartid27(mut self, value: u16) -> Self {
23960        self.set_phypartid27(value);
23961        self
23962    }
23963}
23964
23965#[cfg(feature = "el2")]
23966bitflags! {
23967    /// `MPAMVPM7_EL2` system register value.
23968    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23969    #[repr(transparent)]
23970    pub struct Mpamvpm7El2: u64 {
23971    }
23972}
23973
23974#[cfg(feature = "el2")]
23975impl Mpamvpm7El2 {
23976    /// Offset of the `PhyPARTID28` field.
23977    pub const PHYPARTID28_SHIFT: u32 = 0;
23978    /// Mask for the `PhyPARTID28` field.
23979    pub const PHYPARTID28_MASK: u64 = 0b1111111111111111;
23980    /// Offset of the `PhyPARTID29` field.
23981    pub const PHYPARTID29_SHIFT: u32 = 16;
23982    /// Mask for the `PhyPARTID29` field.
23983    pub const PHYPARTID29_MASK: u64 = 0b1111111111111111;
23984    /// Offset of the `PhyPARTID30` field.
23985    pub const PHYPARTID30_SHIFT: u32 = 32;
23986    /// Mask for the `PhyPARTID30` field.
23987    pub const PHYPARTID30_MASK: u64 = 0b1111111111111111;
23988    /// Offset of the `PhyPARTID31` field.
23989    pub const PHYPARTID31_SHIFT: u32 = 48;
23990    /// Mask for the `PhyPARTID31` field.
23991    pub const PHYPARTID31_MASK: u64 = 0b1111111111111111;
23992
23993    /// Returns the value of the `PhyPARTID28` field.
23994    pub const fn phypartid28(self) -> u16 {
23995        ((self.bits() >> Self::PHYPARTID28_SHIFT) & 0b1111111111111111) as u16
23996    }
23997
23998    /// Sets the value of the `PhyPARTID28` field.
23999    pub const fn set_phypartid28(&mut self, value: u16) {
24000        let offset = Self::PHYPARTID28_SHIFT;
24001        assert!(value & (Self::PHYPARTID28_MASK as u16) == value);
24002        *self = Self::from_bits_retain(
24003            (self.bits() & !(Self::PHYPARTID28_MASK << offset)) | ((value as u64) << offset),
24004        );
24005    }
24006
24007    /// Returns a copy with the `PhyPARTID28` field set to the given value.
24008    pub const fn with_phypartid28(mut self, value: u16) -> Self {
24009        self.set_phypartid28(value);
24010        self
24011    }
24012
24013    /// Returns the value of the `PhyPARTID29` field.
24014    pub const fn phypartid29(self) -> u16 {
24015        ((self.bits() >> Self::PHYPARTID29_SHIFT) & 0b1111111111111111) as u16
24016    }
24017
24018    /// Sets the value of the `PhyPARTID29` field.
24019    pub const fn set_phypartid29(&mut self, value: u16) {
24020        let offset = Self::PHYPARTID29_SHIFT;
24021        assert!(value & (Self::PHYPARTID29_MASK as u16) == value);
24022        *self = Self::from_bits_retain(
24023            (self.bits() & !(Self::PHYPARTID29_MASK << offset)) | ((value as u64) << offset),
24024        );
24025    }
24026
24027    /// Returns a copy with the `PhyPARTID29` field set to the given value.
24028    pub const fn with_phypartid29(mut self, value: u16) -> Self {
24029        self.set_phypartid29(value);
24030        self
24031    }
24032
24033    /// Returns the value of the `PhyPARTID30` field.
24034    pub const fn phypartid30(self) -> u16 {
24035        ((self.bits() >> Self::PHYPARTID30_SHIFT) & 0b1111111111111111) as u16
24036    }
24037
24038    /// Sets the value of the `PhyPARTID30` field.
24039    pub const fn set_phypartid30(&mut self, value: u16) {
24040        let offset = Self::PHYPARTID30_SHIFT;
24041        assert!(value & (Self::PHYPARTID30_MASK as u16) == value);
24042        *self = Self::from_bits_retain(
24043            (self.bits() & !(Self::PHYPARTID30_MASK << offset)) | ((value as u64) << offset),
24044        );
24045    }
24046
24047    /// Returns a copy with the `PhyPARTID30` field set to the given value.
24048    pub const fn with_phypartid30(mut self, value: u16) -> Self {
24049        self.set_phypartid30(value);
24050        self
24051    }
24052
24053    /// Returns the value of the `PhyPARTID31` field.
24054    pub const fn phypartid31(self) -> u16 {
24055        ((self.bits() >> Self::PHYPARTID31_SHIFT) & 0b1111111111111111) as u16
24056    }
24057
24058    /// Sets the value of the `PhyPARTID31` field.
24059    pub const fn set_phypartid31(&mut self, value: u16) {
24060        let offset = Self::PHYPARTID31_SHIFT;
24061        assert!(value & (Self::PHYPARTID31_MASK as u16) == value);
24062        *self = Self::from_bits_retain(
24063            (self.bits() & !(Self::PHYPARTID31_MASK << offset)) | ((value as u64) << offset),
24064        );
24065    }
24066
24067    /// Returns a copy with the `PhyPARTID31` field set to the given value.
24068    pub const fn with_phypartid31(mut self, value: u16) -> Self {
24069        self.set_phypartid31(value);
24070        self
24071    }
24072}
24073
24074#[cfg(feature = "el2")]
24075bitflags! {
24076    /// `MPAMVPMV_EL2` system register value.
24077    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24078    #[repr(transparent)]
24079    pub struct MpamvpmvEl2: u64 {
24080        /// `VPM_V<m>` bit 0.
24081        const VPM_V0 = 1 << 0;
24082        /// `VPM_V<m>` bit 1.
24083        const VPM_V1 = 1 << 1;
24084        /// `VPM_V<m>` bit 2.
24085        const VPM_V2 = 1 << 2;
24086        /// `VPM_V<m>` bit 3.
24087        const VPM_V3 = 1 << 3;
24088        /// `VPM_V<m>` bit 4.
24089        const VPM_V4 = 1 << 4;
24090        /// `VPM_V<m>` bit 5.
24091        const VPM_V5 = 1 << 5;
24092        /// `VPM_V<m>` bit 6.
24093        const VPM_V6 = 1 << 6;
24094        /// `VPM_V<m>` bit 7.
24095        const VPM_V7 = 1 << 7;
24096        /// `VPM_V<m>` bit 8.
24097        const VPM_V8 = 1 << 8;
24098        /// `VPM_V<m>` bit 9.
24099        const VPM_V9 = 1 << 9;
24100        /// `VPM_V<m>` bit 10.
24101        const VPM_V10 = 1 << 10;
24102        /// `VPM_V<m>` bit 11.
24103        const VPM_V11 = 1 << 11;
24104        /// `VPM_V<m>` bit 12.
24105        const VPM_V12 = 1 << 12;
24106        /// `VPM_V<m>` bit 13.
24107        const VPM_V13 = 1 << 13;
24108        /// `VPM_V<m>` bit 14.
24109        const VPM_V14 = 1 << 14;
24110        /// `VPM_V<m>` bit 15.
24111        const VPM_V15 = 1 << 15;
24112        /// `VPM_V<m>` bit 16.
24113        const VPM_V16 = 1 << 16;
24114        /// `VPM_V<m>` bit 17.
24115        const VPM_V17 = 1 << 17;
24116        /// `VPM_V<m>` bit 18.
24117        const VPM_V18 = 1 << 18;
24118        /// `VPM_V<m>` bit 19.
24119        const VPM_V19 = 1 << 19;
24120        /// `VPM_V<m>` bit 20.
24121        const VPM_V20 = 1 << 20;
24122        /// `VPM_V<m>` bit 21.
24123        const VPM_V21 = 1 << 21;
24124        /// `VPM_V<m>` bit 22.
24125        const VPM_V22 = 1 << 22;
24126        /// `VPM_V<m>` bit 23.
24127        const VPM_V23 = 1 << 23;
24128        /// `VPM_V<m>` bit 24.
24129        const VPM_V24 = 1 << 24;
24130        /// `VPM_V<m>` bit 25.
24131        const VPM_V25 = 1 << 25;
24132        /// `VPM_V<m>` bit 26.
24133        const VPM_V26 = 1 << 26;
24134        /// `VPM_V<m>` bit 27.
24135        const VPM_V27 = 1 << 27;
24136        /// `VPM_V<m>` bit 28.
24137        const VPM_V28 = 1 << 28;
24138        /// `VPM_V<m>` bit 29.
24139        const VPM_V29 = 1 << 29;
24140        /// `VPM_V<m>` bit 30.
24141        const VPM_V30 = 1 << 30;
24142        /// `VPM_V<m>` bit 31.
24143        const VPM_V31 = 1 << 31;
24144    }
24145}
24146
24147#[cfg(feature = "el2")]
24148impl MpamvpmvEl2 {
24149    /// Offset of the `VPM_V<m>` field.
24150    pub const VPM_V_SHIFT: u32 = 0;
24151}
24152
24153bitflags! {
24154    /// `MPIDR` system register value.
24155    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24156    #[repr(transparent)]
24157    pub struct Mpidr: u32 {
24158        /// `MT` bit.
24159        const MT = 1 << 24;
24160        /// `U` bit.
24161        const U = 1 << 30;
24162        /// `M` bit.
24163        const M = 1 << 31;
24164    }
24165}
24166
24167impl Mpidr {
24168    /// Offset of the `Aff0` field.
24169    pub const AFF0_SHIFT: u32 = 0;
24170    /// Mask for the `Aff0` field.
24171    pub const AFF0_MASK: u32 = 0b11111111;
24172    /// Offset of the `Aff1` field.
24173    pub const AFF1_SHIFT: u32 = 8;
24174    /// Mask for the `Aff1` field.
24175    pub const AFF1_MASK: u32 = 0b11111111;
24176    /// Offset of the `Aff2` field.
24177    pub const AFF2_SHIFT: u32 = 16;
24178    /// Mask for the `Aff2` field.
24179    pub const AFF2_MASK: u32 = 0b11111111;
24180    /// Offset of the `MT` field.
24181    pub const MT_SHIFT: u32 = 24;
24182    /// Offset of the `U` field.
24183    pub const U_SHIFT: u32 = 30;
24184    /// Offset of the `M` field.
24185    pub const M_SHIFT: u32 = 31;
24186
24187    /// Returns the value of the `Aff0` field.
24188    pub const fn aff0(self) -> u8 {
24189        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
24190    }
24191
24192    /// Sets the value of the `Aff0` field.
24193    pub const fn set_aff0(&mut self, value: u8) {
24194        let offset = Self::AFF0_SHIFT;
24195        assert!(value & (Self::AFF0_MASK as u8) == value);
24196        *self = Self::from_bits_retain(
24197            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u32) << offset),
24198        );
24199    }
24200
24201    /// Returns a copy with the `Aff0` field set to the given value.
24202    pub const fn with_aff0(mut self, value: u8) -> Self {
24203        self.set_aff0(value);
24204        self
24205    }
24206
24207    /// Returns the value of the `Aff1` field.
24208    pub const fn aff1(self) -> u8 {
24209        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
24210    }
24211
24212    /// Sets the value of the `Aff1` field.
24213    pub const fn set_aff1(&mut self, value: u8) {
24214        let offset = Self::AFF1_SHIFT;
24215        assert!(value & (Self::AFF1_MASK as u8) == value);
24216        *self = Self::from_bits_retain(
24217            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u32) << offset),
24218        );
24219    }
24220
24221    /// Returns a copy with the `Aff1` field set to the given value.
24222    pub const fn with_aff1(mut self, value: u8) -> Self {
24223        self.set_aff1(value);
24224        self
24225    }
24226
24227    /// Returns the value of the `Aff2` field.
24228    pub const fn aff2(self) -> u8 {
24229        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
24230    }
24231
24232    /// Sets the value of the `Aff2` field.
24233    pub const fn set_aff2(&mut self, value: u8) {
24234        let offset = Self::AFF2_SHIFT;
24235        assert!(value & (Self::AFF2_MASK as u8) == value);
24236        *self = Self::from_bits_retain(
24237            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u32) << offset),
24238        );
24239    }
24240
24241    /// Returns a copy with the `Aff2` field set to the given value.
24242    pub const fn with_aff2(mut self, value: u8) -> Self {
24243        self.set_aff2(value);
24244        self
24245    }
24246}
24247
24248#[cfg(feature = "el1")]
24249bitflags! {
24250    /// `MPIDR_EL1` system register value.
24251    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24252    #[repr(transparent)]
24253    pub struct MpidrEl1: u64 {
24254        /// RES1 bits in the `MPIDR_EL1` register.
24255        const RES1 = 0b10000000000000000000000000000000;
24256        /// `MT` bit.
24257        const MT = 1 << 24;
24258        /// `U` bit.
24259        const U = 1 << 30;
24260    }
24261}
24262
24263#[cfg(feature = "el1")]
24264impl MpidrEl1 {
24265    /// Offset of the `Aff0` field.
24266    pub const AFF0_SHIFT: u32 = 0;
24267    /// Mask for the `Aff0` field.
24268    pub const AFF0_MASK: u64 = 0b11111111;
24269    /// Offset of the `Aff1` field.
24270    pub const AFF1_SHIFT: u32 = 8;
24271    /// Mask for the `Aff1` field.
24272    pub const AFF1_MASK: u64 = 0b11111111;
24273    /// Offset of the `Aff2` field.
24274    pub const AFF2_SHIFT: u32 = 16;
24275    /// Mask for the `Aff2` field.
24276    pub const AFF2_MASK: u64 = 0b11111111;
24277    /// Offset of the `MT` field.
24278    pub const MT_SHIFT: u32 = 24;
24279    /// Offset of the `U` field.
24280    pub const U_SHIFT: u32 = 30;
24281    /// Offset of the `Aff3` field.
24282    pub const AFF3_SHIFT: u32 = 32;
24283    /// Mask for the `Aff3` field.
24284    pub const AFF3_MASK: u64 = 0b11111111;
24285
24286    /// Returns the value of the `Aff0` field.
24287    pub const fn aff0(self) -> u8 {
24288        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
24289    }
24290
24291    /// Sets the value of the `Aff0` field.
24292    pub const fn set_aff0(&mut self, value: u8) {
24293        let offset = Self::AFF0_SHIFT;
24294        assert!(value & (Self::AFF0_MASK as u8) == value);
24295        *self = Self::from_bits_retain(
24296            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u64) << offset),
24297        );
24298    }
24299
24300    /// Returns a copy with the `Aff0` field set to the given value.
24301    pub const fn with_aff0(mut self, value: u8) -> Self {
24302        self.set_aff0(value);
24303        self
24304    }
24305
24306    /// Returns the value of the `Aff1` field.
24307    pub const fn aff1(self) -> u8 {
24308        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
24309    }
24310
24311    /// Sets the value of the `Aff1` field.
24312    pub const fn set_aff1(&mut self, value: u8) {
24313        let offset = Self::AFF1_SHIFT;
24314        assert!(value & (Self::AFF1_MASK as u8) == value);
24315        *self = Self::from_bits_retain(
24316            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
24317        );
24318    }
24319
24320    /// Returns a copy with the `Aff1` field set to the given value.
24321    pub const fn with_aff1(mut self, value: u8) -> Self {
24322        self.set_aff1(value);
24323        self
24324    }
24325
24326    /// Returns the value of the `Aff2` field.
24327    pub const fn aff2(self) -> u8 {
24328        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
24329    }
24330
24331    /// Sets the value of the `Aff2` field.
24332    pub const fn set_aff2(&mut self, value: u8) {
24333        let offset = Self::AFF2_SHIFT;
24334        assert!(value & (Self::AFF2_MASK as u8) == value);
24335        *self = Self::from_bits_retain(
24336            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
24337        );
24338    }
24339
24340    /// Returns a copy with the `Aff2` field set to the given value.
24341    pub const fn with_aff2(mut self, value: u8) -> Self {
24342        self.set_aff2(value);
24343        self
24344    }
24345
24346    /// Returns the value of the `Aff3` field.
24347    pub const fn aff3(self) -> u8 {
24348        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
24349    }
24350
24351    /// Sets the value of the `Aff3` field.
24352    pub const fn set_aff3(&mut self, value: u8) {
24353        let offset = Self::AFF3_SHIFT;
24354        assert!(value & (Self::AFF3_MASK as u8) == value);
24355        *self = Self::from_bits_retain(
24356            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
24357        );
24358    }
24359
24360    /// Returns a copy with the `Aff3` field set to the given value.
24361    pub const fn with_aff3(mut self, value: u8) -> Self {
24362        self.set_aff3(value);
24363        self
24364    }
24365}
24366
24367bitflags! {
24368    /// `MVBAR` system register value.
24369    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24370    #[repr(transparent)]
24371    pub struct Mvbar: u32 {
24372    }
24373}
24374
24375impl Mvbar {
24376    /// Offset of the `Reserved` field.
24377    pub const RESERVED_SHIFT: u32 = 0;
24378    /// Mask for the `Reserved` field.
24379    pub const RESERVED_MASK: u32 = 0b11111;
24380    /// Offset of the `VBA` field.
24381    pub const VBA_SHIFT: u32 = 5;
24382    /// Mask for the `VBA` field.
24383    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
24384
24385    /// Returns the value of the `Reserved` field.
24386    pub const fn reserved(self) -> u8 {
24387        ((self.bits() >> Self::RESERVED_SHIFT) & 0b11111) as u8
24388    }
24389
24390    /// Sets the value of the `Reserved` field.
24391    pub const fn set_reserved(&mut self, value: u8) {
24392        let offset = Self::RESERVED_SHIFT;
24393        assert!(value & (Self::RESERVED_MASK as u8) == value);
24394        *self = Self::from_bits_retain(
24395            (self.bits() & !(Self::RESERVED_MASK << offset)) | ((value as u32) << offset),
24396        );
24397    }
24398
24399    /// Returns a copy with the `Reserved` field set to the given value.
24400    pub const fn with_reserved(mut self, value: u8) -> Self {
24401        self.set_reserved(value);
24402        self
24403    }
24404
24405    /// Returns the value of the `VBA` field.
24406    pub const fn vba(self) -> u32 {
24407        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
24408    }
24409
24410    /// Sets the value of the `VBA` field.
24411    pub const fn set_vba(&mut self, value: u32) {
24412        let offset = Self::VBA_SHIFT;
24413        assert!(value & (Self::VBA_MASK as u32) == value);
24414        *self = Self::from_bits_retain(
24415            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
24416        );
24417    }
24418
24419    /// Returns a copy with the `VBA` field set to the given value.
24420    pub const fn with_vba(mut self, value: u32) -> Self {
24421        self.set_vba(value);
24422        self
24423    }
24424}
24425
24426bitflags! {
24427    /// `NMRR` system register value.
24428    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24429    #[repr(transparent)]
24430    pub struct Nmrr: u32 {
24431    }
24432}
24433
24434impl Nmrr {
24435    /// Offset of the `IR<n>` field.
24436    pub const IR_SHIFT: u32 = 0;
24437    /// Mask for the `IR<n>` field.
24438    pub const IR_MASK: u32 = 0b11;
24439    /// Offset of the `OR<n>` field.
24440    pub const OR_SHIFT: u32 = 16;
24441    /// Mask for the `OR<n>` field.
24442    pub const OR_MASK: u32 = 0b11;
24443
24444    /// Returns the value of the given `IR<n>` field.
24445    pub const fn ir(self, n: u32) -> u8 {
24446        assert!(n < 8);
24447        ((self.bits() >> (Self::IR_SHIFT + (n - 0) * 2)) & 0b11) as u8
24448    }
24449
24450    /// Sets the value of the `IR<n>` field.
24451    pub const fn set_ir(&mut self, n: u32, value: u8) {
24452        assert!(n < 8);
24453        let offset = Self::IR_SHIFT + (n - 0) * 2;
24454        assert!(value & (Self::IR_MASK as u8) == value);
24455        *self = Self::from_bits_retain(
24456            (self.bits() & !(Self::IR_MASK << offset)) | ((value as u32) << offset),
24457        );
24458    }
24459
24460    /// Returns a copy with the `IR<n>` field set to the given value.
24461    pub const fn with_ir(mut self, n: u32, value: u8) -> Self {
24462        self.set_ir(n, value);
24463        self
24464    }
24465
24466    /// Returns the value of the given `OR<n>` field.
24467    pub const fn or(self, n: u32) -> u8 {
24468        assert!(n < 8);
24469        ((self.bits() >> (Self::OR_SHIFT + (n - 0) * 2)) & 0b11) as u8
24470    }
24471
24472    /// Sets the value of the `OR<n>` field.
24473    pub const fn set_or(&mut self, n: u32, value: u8) {
24474        assert!(n < 8);
24475        let offset = Self::OR_SHIFT + (n - 0) * 2;
24476        assert!(value & (Self::OR_MASK as u8) == value);
24477        *self = Self::from_bits_retain(
24478            (self.bits() & !(Self::OR_MASK << offset)) | ((value as u32) << offset),
24479        );
24480    }
24481
24482    /// Returns a copy with the `OR<n>` field set to the given value.
24483    pub const fn with_or(mut self, n: u32, value: u8) -> Self {
24484        self.set_or(n, value);
24485        self
24486    }
24487}
24488
24489bitflags! {
24490    /// `NSACR` system register value.
24491    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24492    #[repr(transparent)]
24493    pub struct Nsacr: u32 {
24494        /// `cp10` bit.
24495        const CP10 = 1 << 10;
24496        /// `cp11` bit.
24497        const CP11 = 1 << 11;
24498        /// `NSASEDIS` bit.
24499        const NSASEDIS = 1 << 15;
24500        /// `NSTRCDIS` bit.
24501        const NSTRCDIS = 1 << 20;
24502    }
24503}
24504
24505impl Nsacr {
24506    /// Offset of the `cp10` field.
24507    pub const CP10_SHIFT: u32 = 10;
24508    /// Offset of the `cp11` field.
24509    pub const CP11_SHIFT: u32 = 11;
24510    /// Offset of the `NSASEDIS` field.
24511    pub const NSASEDIS_SHIFT: u32 = 15;
24512    /// Offset of the `NSTRCDIS` field.
24513    pub const NSTRCDIS_SHIFT: u32 = 20;
24514}
24515
24516bitflags! {
24517    /// `PAR` system register value.
24518    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24519    #[repr(transparent)]
24520    pub struct Par: u64 {
24521        /// `F` bit.
24522        const F = 1 << 0;
24523        /// `SS` bit.
24524        const SS = 1 << 1;
24525        /// `FS[5]` bit.
24526        const FS_5 = 1 << 6;
24527        /// `S2WLK` bit.
24528        const S2WLK = 1 << 8;
24529        /// `FSTAGE` bit.
24530        const FSTAGE = 1 << 9;
24531        /// `NS` bit.
24532        const NS = 1 << 9;
24533        /// `NOS` bit.
24534        const NOS = 1 << 10;
24535        /// `LPAE` bit.
24536        const LPAE = 1 << 11;
24537    }
24538}
24539
24540impl Par {
24541    /// Offset of the `F` field.
24542    pub const F_SHIFT: u32 = 0;
24543    /// Offset of the `FST` field.
24544    pub const FST_SHIFT: u32 = 1;
24545    /// Mask for the `FST` field.
24546    pub const FST_MASK: u64 = 0b111111;
24547    /// Offset of the `FS[4:0]` field.
24548    pub const FS_4_0_SHIFT: u32 = 1;
24549    /// Mask for the `FS[4:0]` field.
24550    pub const FS_4_0_MASK: u64 = 0b11111;
24551    /// Offset of the `SS` field.
24552    pub const SS_SHIFT: u32 = 1;
24553    /// Offset of the `Outer[1:0]` field.
24554    pub const OUTER_1_0_SHIFT: u32 = 2;
24555    /// Mask for the `Outer[1:0]` field.
24556    pub const OUTER_1_0_MASK: u64 = 0b11;
24557    /// Offset of the `Inner[2:0]` field.
24558    pub const INNER_2_0_SHIFT: u32 = 4;
24559    /// Mask for the `Inner[2:0]` field.
24560    pub const INNER_2_0_MASK: u64 = 0b111;
24561    /// Offset of the `FS[5]` field.
24562    pub const FS_5_SHIFT: u32 = 6;
24563    /// Offset of the `S2WLK` field.
24564    pub const S2WLK_SHIFT: u32 = 8;
24565    /// Offset of the `FSTAGE` field.
24566    pub const FSTAGE_SHIFT: u32 = 9;
24567    /// Offset of the `NS` field.
24568    pub const NS_SHIFT: u32 = 9;
24569    /// Offset of the `NOS` field.
24570    pub const NOS_SHIFT: u32 = 10;
24571    /// Offset of the `LPAE` field.
24572    pub const LPAE_SHIFT: u32 = 11;
24573    /// Offset of the `ATTR` field.
24574    pub const ATTR_SHIFT: u32 = 56;
24575    /// Mask for the `ATTR` field.
24576    pub const ATTR_MASK: u64 = 0b11111111;
24577
24578    /// Returns the value of the `FST` field.
24579    pub const fn fst(self) -> u8 {
24580        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
24581    }
24582
24583    /// Sets the value of the `FST` field.
24584    pub const fn set_fst(&mut self, value: u8) {
24585        let offset = Self::FST_SHIFT;
24586        assert!(value & (Self::FST_MASK as u8) == value);
24587        *self = Self::from_bits_retain(
24588            (self.bits() & !(Self::FST_MASK << offset)) | ((value as u64) << offset),
24589        );
24590    }
24591
24592    /// Returns a copy with the `FST` field set to the given value.
24593    pub const fn with_fst(mut self, value: u8) -> Self {
24594        self.set_fst(value);
24595        self
24596    }
24597
24598    /// Returns the value of the `FS[4:0]` field.
24599    pub const fn fs_4_0(self) -> u8 {
24600        ((self.bits() >> Self::FS_4_0_SHIFT) & 0b11111) as u8
24601    }
24602
24603    /// Sets the value of the `FS[4:0]` field.
24604    pub const fn set_fs_4_0(&mut self, value: u8) {
24605        let offset = Self::FS_4_0_SHIFT;
24606        assert!(value & (Self::FS_4_0_MASK as u8) == value);
24607        *self = Self::from_bits_retain(
24608            (self.bits() & !(Self::FS_4_0_MASK << offset)) | ((value as u64) << offset),
24609        );
24610    }
24611
24612    /// Returns a copy with the `FS[4:0]` field set to the given value.
24613    pub const fn with_fs_4_0(mut self, value: u8) -> Self {
24614        self.set_fs_4_0(value);
24615        self
24616    }
24617
24618    /// Returns the value of the `Outer[1:0]` field.
24619    pub const fn outer_1_0(self) -> u8 {
24620        ((self.bits() >> Self::OUTER_1_0_SHIFT) & 0b11) as u8
24621    }
24622
24623    /// Sets the value of the `Outer[1:0]` field.
24624    pub const fn set_outer_1_0(&mut self, value: u8) {
24625        let offset = Self::OUTER_1_0_SHIFT;
24626        assert!(value & (Self::OUTER_1_0_MASK as u8) == value);
24627        *self = Self::from_bits_retain(
24628            (self.bits() & !(Self::OUTER_1_0_MASK << offset)) | ((value as u64) << offset),
24629        );
24630    }
24631
24632    /// Returns a copy with the `Outer[1:0]` field set to the given value.
24633    pub const fn with_outer_1_0(mut self, value: u8) -> Self {
24634        self.set_outer_1_0(value);
24635        self
24636    }
24637
24638    /// Returns the value of the `Inner[2:0]` field.
24639    pub const fn inner_2_0(self) -> u8 {
24640        ((self.bits() >> Self::INNER_2_0_SHIFT) & 0b111) as u8
24641    }
24642
24643    /// Sets the value of the `Inner[2:0]` field.
24644    pub const fn set_inner_2_0(&mut self, value: u8) {
24645        let offset = Self::INNER_2_0_SHIFT;
24646        assert!(value & (Self::INNER_2_0_MASK as u8) == value);
24647        *self = Self::from_bits_retain(
24648            (self.bits() & !(Self::INNER_2_0_MASK << offset)) | ((value as u64) << offset),
24649        );
24650    }
24651
24652    /// Returns a copy with the `Inner[2:0]` field set to the given value.
24653    pub const fn with_inner_2_0(mut self, value: u8) -> Self {
24654        self.set_inner_2_0(value);
24655        self
24656    }
24657
24658    /// Returns the value of the `ATTR` field.
24659    pub const fn attr(self) -> u8 {
24660        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
24661    }
24662
24663    /// Sets the value of the `ATTR` field.
24664    pub const fn set_attr(&mut self, value: u8) {
24665        let offset = Self::ATTR_SHIFT;
24666        assert!(value & (Self::ATTR_MASK as u8) == value);
24667        *self = Self::from_bits_retain(
24668            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
24669        );
24670    }
24671
24672    /// Returns a copy with the `ATTR` field set to the given value.
24673    pub const fn with_attr(mut self, value: u8) -> Self {
24674        self.set_attr(value);
24675        self
24676    }
24677}
24678
24679#[cfg(feature = "el1")]
24680bitflags! {
24681    /// `PAR_EL1` system register value.
24682    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24683    #[repr(transparent)]
24684    pub struct ParEl1: u64 {
24685        /// RES1 bits in the `PAR_EL1` register.
24686        const RES1 = 0b100000000000;
24687        /// `F` bit.
24688        const F = 1 << 0;
24689        /// `PTW` bit.
24690        const PTW = 1 << 8;
24691        /// `NS` bit.
24692        const NS = 1 << 9;
24693        /// `S` bit.
24694        const S = 1 << 9;
24695        /// `NSE` bit.
24696        const NSE = 1 << 11;
24697        /// `AssuredOnly` bit.
24698        const ASSUREDONLY = 1 << 12;
24699        /// `TopLevel` bit.
24700        const TOPLEVEL = 1 << 13;
24701        /// `Overlay` bit.
24702        const OVERLAY = 1 << 14;
24703        /// `DirtyBit` bit.
24704        const DIRTYBIT = 1 << 15;
24705    }
24706}
24707
24708#[cfg(feature = "el1")]
24709impl ParEl1 {
24710    /// Offset of the `F` field.
24711    pub const F_SHIFT: u32 = 0;
24712    /// Offset of the `FST` field.
24713    pub const FST_SHIFT: u32 = 1;
24714    /// Mask for the `FST` field.
24715    pub const FST_MASK: u64 = 0b111111;
24716    /// Offset of the `SH` field.
24717    pub const SH_SHIFT: u32 = 7;
24718    /// Mask for the `SH` field.
24719    pub const SH_MASK: u64 = 0b11;
24720    /// Offset of the `PTW` field.
24721    pub const PTW_SHIFT: u32 = 8;
24722    /// Offset of the `NS` field.
24723    pub const NS_SHIFT: u32 = 9;
24724    /// Offset of the `S` field.
24725    pub const S_SHIFT: u32 = 9;
24726    /// Offset of the `NSE` field.
24727    pub const NSE_SHIFT: u32 = 11;
24728    /// Offset of the `AssuredOnly` field.
24729    pub const ASSUREDONLY_SHIFT: u32 = 12;
24730    /// Offset of the `PA[47:12]` field.
24731    pub const PA_47_12_SHIFT: u32 = 12;
24732    /// Mask for the `PA[47:12]` field.
24733    pub const PA_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
24734    /// Offset of the `TopLevel` field.
24735    pub const TOPLEVEL_SHIFT: u32 = 13;
24736    /// Offset of the `Overlay` field.
24737    pub const OVERLAY_SHIFT: u32 = 14;
24738    /// Offset of the `DirtyBit` field.
24739    pub const DIRTYBIT_SHIFT: u32 = 15;
24740    /// Offset of the `PA[51:48]` field.
24741    pub const PA_51_48_SHIFT: u32 = 48;
24742    /// Mask for the `PA[51:48]` field.
24743    pub const PA_51_48_MASK: u64 = 0b1111;
24744    /// Offset of the `ATTR` field.
24745    pub const ATTR_SHIFT: u32 = 56;
24746    /// Mask for the `ATTR` field.
24747    pub const ATTR_MASK: u64 = 0b11111111;
24748
24749    /// Returns the value of the `FST` field.
24750    pub const fn fst(self) -> u8 {
24751        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
24752    }
24753
24754    /// Sets the value of the `FST` field.
24755    pub const fn set_fst(&mut self, value: u8) {
24756        let offset = Self::FST_SHIFT;
24757        assert!(value & (Self::FST_MASK as u8) == value);
24758        *self = Self::from_bits_retain(
24759            (self.bits() & !(Self::FST_MASK << offset)) | ((value as u64) << offset),
24760        );
24761    }
24762
24763    /// Returns a copy with the `FST` field set to the given value.
24764    pub const fn with_fst(mut self, value: u8) -> Self {
24765        self.set_fst(value);
24766        self
24767    }
24768
24769    /// Returns the value of the `SH` field.
24770    pub const fn sh(self) -> u8 {
24771        ((self.bits() >> Self::SH_SHIFT) & 0b11) as u8
24772    }
24773
24774    /// Sets the value of the `SH` field.
24775    pub const fn set_sh(&mut self, value: u8) {
24776        let offset = Self::SH_SHIFT;
24777        assert!(value & (Self::SH_MASK as u8) == value);
24778        *self = Self::from_bits_retain(
24779            (self.bits() & !(Self::SH_MASK << offset)) | ((value as u64) << offset),
24780        );
24781    }
24782
24783    /// Returns a copy with the `SH` field set to the given value.
24784    pub const fn with_sh(mut self, value: u8) -> Self {
24785        self.set_sh(value);
24786        self
24787    }
24788
24789    /// Returns the value of the `PA[47:12]` field.
24790    pub const fn pa_47_12(self) -> u64 {
24791        ((self.bits() >> Self::PA_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
24792    }
24793
24794    /// Sets the value of the `PA[47:12]` field.
24795    pub const fn set_pa_47_12(&mut self, value: u64) {
24796        let offset = Self::PA_47_12_SHIFT;
24797        assert!(value & (Self::PA_47_12_MASK as u64) == value);
24798        *self = Self::from_bits_retain(
24799            (self.bits() & !(Self::PA_47_12_MASK << offset)) | ((value as u64) << offset),
24800        );
24801    }
24802
24803    /// Returns a copy with the `PA[47:12]` field set to the given value.
24804    pub const fn with_pa_47_12(mut self, value: u64) -> Self {
24805        self.set_pa_47_12(value);
24806        self
24807    }
24808
24809    /// Returns the value of the `PA[51:48]` field.
24810    pub const fn pa_51_48(self) -> u8 {
24811        ((self.bits() >> Self::PA_51_48_SHIFT) & 0b1111) as u8
24812    }
24813
24814    /// Sets the value of the `PA[51:48]` field.
24815    pub const fn set_pa_51_48(&mut self, value: u8) {
24816        let offset = Self::PA_51_48_SHIFT;
24817        assert!(value & (Self::PA_51_48_MASK as u8) == value);
24818        *self = Self::from_bits_retain(
24819            (self.bits() & !(Self::PA_51_48_MASK << offset)) | ((value as u64) << offset),
24820        );
24821    }
24822
24823    /// Returns a copy with the `PA[51:48]` field set to the given value.
24824    pub const fn with_pa_51_48(mut self, value: u8) -> Self {
24825        self.set_pa_51_48(value);
24826        self
24827    }
24828
24829    /// Returns the value of the `ATTR` field.
24830    pub const fn attr(self) -> u8 {
24831        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
24832    }
24833
24834    /// Sets the value of the `ATTR` field.
24835    pub const fn set_attr(&mut self, value: u8) {
24836        let offset = Self::ATTR_SHIFT;
24837        assert!(value & (Self::ATTR_MASK as u8) == value);
24838        *self = Self::from_bits_retain(
24839            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
24840        );
24841    }
24842
24843    /// Returns a copy with the `ATTR` field set to the given value.
24844    pub const fn with_attr(mut self, value: u8) -> Self {
24845        self.set_attr(value);
24846        self
24847    }
24848}
24849
24850bitflags! {
24851    /// `PMCCFILTR` system register value.
24852    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24853    #[repr(transparent)]
24854    pub struct Pmccfiltr: u32 {
24855        /// `RLU` bit.
24856        const RLU = 1 << 21;
24857        /// `NSH` bit.
24858        const NSH = 1 << 27;
24859        /// `NSU` bit.
24860        const NSU = 1 << 28;
24861        /// `NSK` bit.
24862        const NSK = 1 << 29;
24863        /// `U` bit.
24864        const U = 1 << 30;
24865        /// `P` bit.
24866        const P = 1 << 31;
24867    }
24868}
24869
24870impl Pmccfiltr {
24871    /// Offset of the `RLU` field.
24872    pub const RLU_SHIFT: u32 = 21;
24873    /// Offset of the `NSH` field.
24874    pub const NSH_SHIFT: u32 = 27;
24875    /// Offset of the `NSU` field.
24876    pub const NSU_SHIFT: u32 = 28;
24877    /// Offset of the `NSK` field.
24878    pub const NSK_SHIFT: u32 = 29;
24879    /// Offset of the `U` field.
24880    pub const U_SHIFT: u32 = 30;
24881    /// Offset of the `P` field.
24882    pub const P_SHIFT: u32 = 31;
24883}
24884
24885bitflags! {
24886    /// `PMCCNTR` system register value.
24887    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24888    #[repr(transparent)]
24889    pub struct Pmccntr: u64 {
24890    }
24891}
24892
24893impl Pmccntr {
24894    /// Offset of the `CCNT` field.
24895    pub const CCNT_SHIFT: u32 = 0;
24896    /// Mask for the `CCNT` field.
24897    pub const CCNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
24898
24899    /// Returns the value of the `CCNT` field.
24900    pub const fn ccnt(self) -> u64 {
24901        ((self.bits() >> Self::CCNT_SHIFT)
24902            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
24903    }
24904
24905    /// Sets the value of the `CCNT` field.
24906    pub const fn set_ccnt(&mut self, value: u64) {
24907        let offset = Self::CCNT_SHIFT;
24908        assert!(value & (Self::CCNT_MASK as u64) == value);
24909        *self = Self::from_bits_retain(
24910            (self.bits() & !(Self::CCNT_MASK << offset)) | ((value as u64) << offset),
24911        );
24912    }
24913
24914    /// Returns a copy with the `CCNT` field set to the given value.
24915    pub const fn with_ccnt(mut self, value: u64) -> Self {
24916        self.set_ccnt(value);
24917        self
24918    }
24919}
24920
24921bitflags! {
24922    /// `PMCEID0` system register value.
24923    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24924    #[repr(transparent)]
24925    pub struct Pmceid0: u32 {
24926        /// `ID<n>` bit 0.
24927        const ID0 = 1 << 0;
24928        /// `ID<n>` bit 1.
24929        const ID1 = 1 << 1;
24930        /// `ID<n>` bit 2.
24931        const ID2 = 1 << 2;
24932        /// `ID<n>` bit 3.
24933        const ID3 = 1 << 3;
24934        /// `ID<n>` bit 4.
24935        const ID4 = 1 << 4;
24936        /// `ID<n>` bit 5.
24937        const ID5 = 1 << 5;
24938        /// `ID<n>` bit 6.
24939        const ID6 = 1 << 6;
24940        /// `ID<n>` bit 7.
24941        const ID7 = 1 << 7;
24942        /// `ID<n>` bit 8.
24943        const ID8 = 1 << 8;
24944        /// `ID<n>` bit 9.
24945        const ID9 = 1 << 9;
24946        /// `ID<n>` bit 10.
24947        const ID10 = 1 << 10;
24948        /// `ID<n>` bit 11.
24949        const ID11 = 1 << 11;
24950        /// `ID<n>` bit 12.
24951        const ID12 = 1 << 12;
24952        /// `ID<n>` bit 13.
24953        const ID13 = 1 << 13;
24954        /// `ID<n>` bit 14.
24955        const ID14 = 1 << 14;
24956        /// `ID<n>` bit 15.
24957        const ID15 = 1 << 15;
24958        /// `ID<n>` bit 16.
24959        const ID16 = 1 << 16;
24960        /// `ID<n>` bit 17.
24961        const ID17 = 1 << 17;
24962        /// `ID<n>` bit 18.
24963        const ID18 = 1 << 18;
24964        /// `ID<n>` bit 19.
24965        const ID19 = 1 << 19;
24966        /// `ID<n>` bit 20.
24967        const ID20 = 1 << 20;
24968        /// `ID<n>` bit 21.
24969        const ID21 = 1 << 21;
24970        /// `ID<n>` bit 22.
24971        const ID22 = 1 << 22;
24972        /// `ID<n>` bit 23.
24973        const ID23 = 1 << 23;
24974        /// `ID<n>` bit 24.
24975        const ID24 = 1 << 24;
24976        /// `ID<n>` bit 25.
24977        const ID25 = 1 << 25;
24978        /// `ID<n>` bit 26.
24979        const ID26 = 1 << 26;
24980        /// `ID<n>` bit 27.
24981        const ID27 = 1 << 27;
24982        /// `ID<n>` bit 28.
24983        const ID28 = 1 << 28;
24984        /// `ID<n>` bit 29.
24985        const ID29 = 1 << 29;
24986        /// `ID<n>` bit 30.
24987        const ID30 = 1 << 30;
24988        /// `ID<n>` bit 31.
24989        const ID31 = 1 << 31;
24990    }
24991}
24992
24993impl Pmceid0 {
24994    /// Offset of the `ID<n>` field.
24995    pub const ID_SHIFT: u32 = 0;
24996}
24997
24998bitflags! {
24999    /// `PMCEID1` system register value.
25000    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25001    #[repr(transparent)]
25002    pub struct Pmceid1: u32 {
25003        /// `ID<n>` bit 0.
25004        const ID0 = 1 << 0;
25005        /// `ID<n>` bit 1.
25006        const ID1 = 1 << 1;
25007        /// `ID<n>` bit 2.
25008        const ID2 = 1 << 2;
25009        /// `ID<n>` bit 3.
25010        const ID3 = 1 << 3;
25011        /// `ID<n>` bit 4.
25012        const ID4 = 1 << 4;
25013        /// `ID<n>` bit 5.
25014        const ID5 = 1 << 5;
25015        /// `ID<n>` bit 6.
25016        const ID6 = 1 << 6;
25017        /// `ID<n>` bit 7.
25018        const ID7 = 1 << 7;
25019        /// `ID<n>` bit 8.
25020        const ID8 = 1 << 8;
25021        /// `ID<n>` bit 9.
25022        const ID9 = 1 << 9;
25023        /// `ID<n>` bit 10.
25024        const ID10 = 1 << 10;
25025        /// `ID<n>` bit 11.
25026        const ID11 = 1 << 11;
25027        /// `ID<n>` bit 12.
25028        const ID12 = 1 << 12;
25029        /// `ID<n>` bit 13.
25030        const ID13 = 1 << 13;
25031        /// `ID<n>` bit 14.
25032        const ID14 = 1 << 14;
25033        /// `ID<n>` bit 15.
25034        const ID15 = 1 << 15;
25035        /// `ID<n>` bit 16.
25036        const ID16 = 1 << 16;
25037        /// `ID<n>` bit 17.
25038        const ID17 = 1 << 17;
25039        /// `ID<n>` bit 18.
25040        const ID18 = 1 << 18;
25041        /// `ID<n>` bit 19.
25042        const ID19 = 1 << 19;
25043        /// `ID<n>` bit 20.
25044        const ID20 = 1 << 20;
25045        /// `ID<n>` bit 21.
25046        const ID21 = 1 << 21;
25047        /// `ID<n>` bit 22.
25048        const ID22 = 1 << 22;
25049        /// `ID<n>` bit 23.
25050        const ID23 = 1 << 23;
25051        /// `ID<n>` bit 24.
25052        const ID24 = 1 << 24;
25053        /// `ID<n>` bit 25.
25054        const ID25 = 1 << 25;
25055        /// `ID<n>` bit 26.
25056        const ID26 = 1 << 26;
25057        /// `ID<n>` bit 27.
25058        const ID27 = 1 << 27;
25059        /// `ID<n>` bit 28.
25060        const ID28 = 1 << 28;
25061        /// `ID<n>` bit 29.
25062        const ID29 = 1 << 29;
25063        /// `ID<n>` bit 30.
25064        const ID30 = 1 << 30;
25065        /// `ID<n>` bit 31.
25066        const ID31 = 1 << 31;
25067    }
25068}
25069
25070impl Pmceid1 {
25071    /// Offset of the `ID<n>` field.
25072    pub const ID_SHIFT: u32 = 0;
25073}
25074
25075bitflags! {
25076    /// `PMCEID2` system register value.
25077    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25078    #[repr(transparent)]
25079    pub struct Pmceid2: u32 {
25080        /// `IDhi<n>` bit 0.
25081        const IDHI0 = 1 << 0;
25082        /// `IDhi<n>` bit 1.
25083        const IDHI1 = 1 << 1;
25084        /// `IDhi<n>` bit 2.
25085        const IDHI2 = 1 << 2;
25086        /// `IDhi<n>` bit 3.
25087        const IDHI3 = 1 << 3;
25088        /// `IDhi<n>` bit 4.
25089        const IDHI4 = 1 << 4;
25090        /// `IDhi<n>` bit 5.
25091        const IDHI5 = 1 << 5;
25092        /// `IDhi<n>` bit 6.
25093        const IDHI6 = 1 << 6;
25094        /// `IDhi<n>` bit 7.
25095        const IDHI7 = 1 << 7;
25096        /// `IDhi<n>` bit 8.
25097        const IDHI8 = 1 << 8;
25098        /// `IDhi<n>` bit 9.
25099        const IDHI9 = 1 << 9;
25100        /// `IDhi<n>` bit 10.
25101        const IDHI10 = 1 << 10;
25102        /// `IDhi<n>` bit 11.
25103        const IDHI11 = 1 << 11;
25104        /// `IDhi<n>` bit 12.
25105        const IDHI12 = 1 << 12;
25106        /// `IDhi<n>` bit 13.
25107        const IDHI13 = 1 << 13;
25108        /// `IDhi<n>` bit 14.
25109        const IDHI14 = 1 << 14;
25110        /// `IDhi<n>` bit 15.
25111        const IDHI15 = 1 << 15;
25112        /// `IDhi<n>` bit 16.
25113        const IDHI16 = 1 << 16;
25114        /// `IDhi<n>` bit 17.
25115        const IDHI17 = 1 << 17;
25116        /// `IDhi<n>` bit 18.
25117        const IDHI18 = 1 << 18;
25118        /// `IDhi<n>` bit 19.
25119        const IDHI19 = 1 << 19;
25120        /// `IDhi<n>` bit 20.
25121        const IDHI20 = 1 << 20;
25122        /// `IDhi<n>` bit 21.
25123        const IDHI21 = 1 << 21;
25124        /// `IDhi<n>` bit 22.
25125        const IDHI22 = 1 << 22;
25126        /// `IDhi<n>` bit 23.
25127        const IDHI23 = 1 << 23;
25128        /// `IDhi<n>` bit 24.
25129        const IDHI24 = 1 << 24;
25130        /// `IDhi<n>` bit 25.
25131        const IDHI25 = 1 << 25;
25132        /// `IDhi<n>` bit 26.
25133        const IDHI26 = 1 << 26;
25134        /// `IDhi<n>` bit 27.
25135        const IDHI27 = 1 << 27;
25136        /// `IDhi<n>` bit 28.
25137        const IDHI28 = 1 << 28;
25138        /// `IDhi<n>` bit 29.
25139        const IDHI29 = 1 << 29;
25140        /// `IDhi<n>` bit 30.
25141        const IDHI30 = 1 << 30;
25142        /// `IDhi<n>` bit 31.
25143        const IDHI31 = 1 << 31;
25144    }
25145}
25146
25147impl Pmceid2 {
25148    /// Offset of the `IDhi<n>` field.
25149    pub const IDHI_SHIFT: u32 = 0;
25150}
25151
25152bitflags! {
25153    /// `PMCEID3` system register value.
25154    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25155    #[repr(transparent)]
25156    pub struct Pmceid3: u32 {
25157        /// `IDhi<n>` bit 0.
25158        const IDHI0 = 1 << 0;
25159        /// `IDhi<n>` bit 1.
25160        const IDHI1 = 1 << 1;
25161        /// `IDhi<n>` bit 2.
25162        const IDHI2 = 1 << 2;
25163        /// `IDhi<n>` bit 3.
25164        const IDHI3 = 1 << 3;
25165        /// `IDhi<n>` bit 4.
25166        const IDHI4 = 1 << 4;
25167        /// `IDhi<n>` bit 5.
25168        const IDHI5 = 1 << 5;
25169        /// `IDhi<n>` bit 6.
25170        const IDHI6 = 1 << 6;
25171        /// `IDhi<n>` bit 7.
25172        const IDHI7 = 1 << 7;
25173        /// `IDhi<n>` bit 8.
25174        const IDHI8 = 1 << 8;
25175        /// `IDhi<n>` bit 9.
25176        const IDHI9 = 1 << 9;
25177        /// `IDhi<n>` bit 10.
25178        const IDHI10 = 1 << 10;
25179        /// `IDhi<n>` bit 11.
25180        const IDHI11 = 1 << 11;
25181        /// `IDhi<n>` bit 12.
25182        const IDHI12 = 1 << 12;
25183        /// `IDhi<n>` bit 13.
25184        const IDHI13 = 1 << 13;
25185        /// `IDhi<n>` bit 14.
25186        const IDHI14 = 1 << 14;
25187        /// `IDhi<n>` bit 15.
25188        const IDHI15 = 1 << 15;
25189        /// `IDhi<n>` bit 16.
25190        const IDHI16 = 1 << 16;
25191        /// `IDhi<n>` bit 17.
25192        const IDHI17 = 1 << 17;
25193        /// `IDhi<n>` bit 18.
25194        const IDHI18 = 1 << 18;
25195        /// `IDhi<n>` bit 19.
25196        const IDHI19 = 1 << 19;
25197        /// `IDhi<n>` bit 20.
25198        const IDHI20 = 1 << 20;
25199        /// `IDhi<n>` bit 21.
25200        const IDHI21 = 1 << 21;
25201        /// `IDhi<n>` bit 22.
25202        const IDHI22 = 1 << 22;
25203        /// `IDhi<n>` bit 23.
25204        const IDHI23 = 1 << 23;
25205        /// `IDhi<n>` bit 24.
25206        const IDHI24 = 1 << 24;
25207        /// `IDhi<n>` bit 25.
25208        const IDHI25 = 1 << 25;
25209        /// `IDhi<n>` bit 26.
25210        const IDHI26 = 1 << 26;
25211        /// `IDhi<n>` bit 27.
25212        const IDHI27 = 1 << 27;
25213        /// `IDhi<n>` bit 28.
25214        const IDHI28 = 1 << 28;
25215        /// `IDhi<n>` bit 29.
25216        const IDHI29 = 1 << 29;
25217        /// `IDhi<n>` bit 30.
25218        const IDHI30 = 1 << 30;
25219        /// `IDhi<n>` bit 31.
25220        const IDHI31 = 1 << 31;
25221    }
25222}
25223
25224impl Pmceid3 {
25225    /// Offset of the `IDhi<n>` field.
25226    pub const IDHI_SHIFT: u32 = 0;
25227}
25228
25229bitflags! {
25230    /// `PMCNTENCLR` system register value.
25231    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25232    #[repr(transparent)]
25233    pub struct Pmcntenclr: u32 {
25234        /// `P<m>` bit 0.
25235        const P0 = 1 << 0;
25236        /// `P<m>` bit 1.
25237        const P1 = 1 << 1;
25238        /// `P<m>` bit 2.
25239        const P2 = 1 << 2;
25240        /// `P<m>` bit 3.
25241        const P3 = 1 << 3;
25242        /// `P<m>` bit 4.
25243        const P4 = 1 << 4;
25244        /// `P<m>` bit 5.
25245        const P5 = 1 << 5;
25246        /// `P<m>` bit 6.
25247        const P6 = 1 << 6;
25248        /// `P<m>` bit 7.
25249        const P7 = 1 << 7;
25250        /// `P<m>` bit 8.
25251        const P8 = 1 << 8;
25252        /// `P<m>` bit 9.
25253        const P9 = 1 << 9;
25254        /// `P<m>` bit 10.
25255        const P10 = 1 << 10;
25256        /// `P<m>` bit 11.
25257        const P11 = 1 << 11;
25258        /// `P<m>` bit 12.
25259        const P12 = 1 << 12;
25260        /// `P<m>` bit 13.
25261        const P13 = 1 << 13;
25262        /// `P<m>` bit 14.
25263        const P14 = 1 << 14;
25264        /// `P<m>` bit 15.
25265        const P15 = 1 << 15;
25266        /// `P<m>` bit 16.
25267        const P16 = 1 << 16;
25268        /// `P<m>` bit 17.
25269        const P17 = 1 << 17;
25270        /// `P<m>` bit 18.
25271        const P18 = 1 << 18;
25272        /// `P<m>` bit 19.
25273        const P19 = 1 << 19;
25274        /// `P<m>` bit 20.
25275        const P20 = 1 << 20;
25276        /// `P<m>` bit 21.
25277        const P21 = 1 << 21;
25278        /// `P<m>` bit 22.
25279        const P22 = 1 << 22;
25280        /// `P<m>` bit 23.
25281        const P23 = 1 << 23;
25282        /// `P<m>` bit 24.
25283        const P24 = 1 << 24;
25284        /// `P<m>` bit 25.
25285        const P25 = 1 << 25;
25286        /// `P<m>` bit 26.
25287        const P26 = 1 << 26;
25288        /// `P<m>` bit 27.
25289        const P27 = 1 << 27;
25290        /// `P<m>` bit 28.
25291        const P28 = 1 << 28;
25292        /// `P<m>` bit 29.
25293        const P29 = 1 << 29;
25294        /// `P<m>` bit 30.
25295        const P30 = 1 << 30;
25296        /// `C` bit.
25297        const C = 1 << 31;
25298    }
25299}
25300
25301impl Pmcntenclr {
25302    /// Offset of the `P<m>` field.
25303    pub const P_SHIFT: u32 = 0;
25304    /// Offset of the `C` field.
25305    pub const C_SHIFT: u32 = 31;
25306}
25307
25308bitflags! {
25309    /// `PMCNTENSET` system register value.
25310    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25311    #[repr(transparent)]
25312    pub struct Pmcntenset: u32 {
25313        /// `P<m>` bit 0.
25314        const P0 = 1 << 0;
25315        /// `P<m>` bit 1.
25316        const P1 = 1 << 1;
25317        /// `P<m>` bit 2.
25318        const P2 = 1 << 2;
25319        /// `P<m>` bit 3.
25320        const P3 = 1 << 3;
25321        /// `P<m>` bit 4.
25322        const P4 = 1 << 4;
25323        /// `P<m>` bit 5.
25324        const P5 = 1 << 5;
25325        /// `P<m>` bit 6.
25326        const P6 = 1 << 6;
25327        /// `P<m>` bit 7.
25328        const P7 = 1 << 7;
25329        /// `P<m>` bit 8.
25330        const P8 = 1 << 8;
25331        /// `P<m>` bit 9.
25332        const P9 = 1 << 9;
25333        /// `P<m>` bit 10.
25334        const P10 = 1 << 10;
25335        /// `P<m>` bit 11.
25336        const P11 = 1 << 11;
25337        /// `P<m>` bit 12.
25338        const P12 = 1 << 12;
25339        /// `P<m>` bit 13.
25340        const P13 = 1 << 13;
25341        /// `P<m>` bit 14.
25342        const P14 = 1 << 14;
25343        /// `P<m>` bit 15.
25344        const P15 = 1 << 15;
25345        /// `P<m>` bit 16.
25346        const P16 = 1 << 16;
25347        /// `P<m>` bit 17.
25348        const P17 = 1 << 17;
25349        /// `P<m>` bit 18.
25350        const P18 = 1 << 18;
25351        /// `P<m>` bit 19.
25352        const P19 = 1 << 19;
25353        /// `P<m>` bit 20.
25354        const P20 = 1 << 20;
25355        /// `P<m>` bit 21.
25356        const P21 = 1 << 21;
25357        /// `P<m>` bit 22.
25358        const P22 = 1 << 22;
25359        /// `P<m>` bit 23.
25360        const P23 = 1 << 23;
25361        /// `P<m>` bit 24.
25362        const P24 = 1 << 24;
25363        /// `P<m>` bit 25.
25364        const P25 = 1 << 25;
25365        /// `P<m>` bit 26.
25366        const P26 = 1 << 26;
25367        /// `P<m>` bit 27.
25368        const P27 = 1 << 27;
25369        /// `P<m>` bit 28.
25370        const P28 = 1 << 28;
25371        /// `P<m>` bit 29.
25372        const P29 = 1 << 29;
25373        /// `P<m>` bit 30.
25374        const P30 = 1 << 30;
25375        /// `C` bit.
25376        const C = 1 << 31;
25377    }
25378}
25379
25380impl Pmcntenset {
25381    /// Offset of the `P<m>` field.
25382    pub const P_SHIFT: u32 = 0;
25383    /// Offset of the `C` field.
25384    pub const C_SHIFT: u32 = 31;
25385}
25386
25387bitflags! {
25388    /// `PMCR` system register value.
25389    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25390    #[repr(transparent)]
25391    pub struct Pmcr: u32 {
25392        /// `E` bit.
25393        const E = 1 << 0;
25394        /// `P` bit.
25395        const P = 1 << 1;
25396        /// `C` bit.
25397        const C = 1 << 2;
25398        /// `D` bit.
25399        const D = 1 << 3;
25400        /// `X` bit.
25401        const X = 1 << 4;
25402        /// `DP` bit.
25403        const DP = 1 << 5;
25404        /// `LC` bit.
25405        const LC = 1 << 6;
25406        /// `LP` bit.
25407        const LP = 1 << 7;
25408        /// `FZO` bit.
25409        const FZO = 1 << 9;
25410    }
25411}
25412
25413impl Pmcr {
25414    /// Offset of the `E` field.
25415    pub const E_SHIFT: u32 = 0;
25416    /// Offset of the `P` field.
25417    pub const P_SHIFT: u32 = 1;
25418    /// Offset of the `C` field.
25419    pub const C_SHIFT: u32 = 2;
25420    /// Offset of the `D` field.
25421    pub const D_SHIFT: u32 = 3;
25422    /// Offset of the `X` field.
25423    pub const X_SHIFT: u32 = 4;
25424    /// Offset of the `DP` field.
25425    pub const DP_SHIFT: u32 = 5;
25426    /// Offset of the `LC` field.
25427    pub const LC_SHIFT: u32 = 6;
25428    /// Offset of the `LP` field.
25429    pub const LP_SHIFT: u32 = 7;
25430    /// Offset of the `FZO` field.
25431    pub const FZO_SHIFT: u32 = 9;
25432    /// Offset of the `N` field.
25433    pub const N_SHIFT: u32 = 11;
25434    /// Mask for the `N` field.
25435    pub const N_MASK: u32 = 0b11111;
25436    /// Offset of the `IDCODE` field.
25437    pub const IDCODE_SHIFT: u32 = 16;
25438    /// Mask for the `IDCODE` field.
25439    pub const IDCODE_MASK: u32 = 0b11111111;
25440    /// Offset of the `IMP` field.
25441    pub const IMP_SHIFT: u32 = 24;
25442    /// Mask for the `IMP` field.
25443    pub const IMP_MASK: u32 = 0b11111111;
25444
25445    /// Returns the value of the `N` field.
25446    pub const fn n(self) -> u8 {
25447        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
25448    }
25449
25450    /// Sets the value of the `N` field.
25451    pub const fn set_n(&mut self, value: u8) {
25452        let offset = Self::N_SHIFT;
25453        assert!(value & (Self::N_MASK as u8) == value);
25454        *self = Self::from_bits_retain(
25455            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
25456        );
25457    }
25458
25459    /// Returns a copy with the `N` field set to the given value.
25460    pub const fn with_n(mut self, value: u8) -> Self {
25461        self.set_n(value);
25462        self
25463    }
25464
25465    /// Returns the value of the `IDCODE` field.
25466    pub const fn idcode(self) -> u8 {
25467        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
25468    }
25469
25470    /// Sets the value of the `IDCODE` field.
25471    pub const fn set_idcode(&mut self, value: u8) {
25472        let offset = Self::IDCODE_SHIFT;
25473        assert!(value & (Self::IDCODE_MASK as u8) == value);
25474        *self = Self::from_bits_retain(
25475            (self.bits() & !(Self::IDCODE_MASK << offset)) | ((value as u32) << offset),
25476        );
25477    }
25478
25479    /// Returns a copy with the `IDCODE` field set to the given value.
25480    pub const fn with_idcode(mut self, value: u8) -> Self {
25481        self.set_idcode(value);
25482        self
25483    }
25484
25485    /// Returns the value of the `IMP` field.
25486    pub const fn imp(self) -> u8 {
25487        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
25488    }
25489
25490    /// Sets the value of the `IMP` field.
25491    pub const fn set_imp(&mut self, value: u8) {
25492        let offset = Self::IMP_SHIFT;
25493        assert!(value & (Self::IMP_MASK as u8) == value);
25494        *self = Self::from_bits_retain(
25495            (self.bits() & !(Self::IMP_MASK << offset)) | ((value as u32) << offset),
25496        );
25497    }
25498
25499    /// Returns a copy with the `IMP` field set to the given value.
25500    pub const fn with_imp(mut self, value: u8) -> Self {
25501        self.set_imp(value);
25502        self
25503    }
25504}
25505
25506bitflags! {
25507    /// `PMCR_EL0` system register value.
25508    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25509    #[repr(transparent)]
25510    pub struct PmcrEl0: u64 {
25511        /// Enable. Affected counters are enabled by PMCNTENSET_EL0.
25512        const E = 1 << 0;
25513        /// Event counter reset. Reset all affected event counters PMEVCNTR<n>_EL0 to zero.
25514        const P = 1 << 1;
25515        /// Cycle counter reset. Reset PMCCNTR_EL0 to zero.
25516        const C = 1 << 2;
25517        /// Clock divider. If set PMCCNTR_EL0 counts once every 64 clock cycles.
25518        const D = 1 << 3;
25519        /// Enable export of events in an IMPLEMENTATION DEFINED PMU event export bus. If set, export events where not prohibited.
25520        const X = 1 << 4;
25521        /// If set, cycle counting by PMCCNTR_EL0 is disabled in prohibited regions.
25522        const DP = 1 << 5;
25523        /// `LC` bit.
25524        const LC = 1 << 6;
25525        /// `LP` bit.
25526        const LP = 1 << 7;
25527        /// `FZO` bit.
25528        const FZO = 1 << 9;
25529        /// `FZS` bit.
25530        const FZS = 1 << 32;
25531    }
25532}
25533
25534impl PmcrEl0 {
25535    /// Offset of the `E` field.
25536    pub const E_SHIFT: u32 = 0;
25537    /// Offset of the `P` field.
25538    pub const P_SHIFT: u32 = 1;
25539    /// Offset of the `C` field.
25540    pub const C_SHIFT: u32 = 2;
25541    /// Offset of the `D` field.
25542    pub const D_SHIFT: u32 = 3;
25543    /// Offset of the `X` field.
25544    pub const X_SHIFT: u32 = 4;
25545    /// Offset of the `DP` field.
25546    pub const DP_SHIFT: u32 = 5;
25547    /// Offset of the `LC` field.
25548    pub const LC_SHIFT: u32 = 6;
25549    /// Offset of the `LP` field.
25550    pub const LP_SHIFT: u32 = 7;
25551    /// Offset of the `FZO` field.
25552    pub const FZO_SHIFT: u32 = 9;
25553    /// Offset of the `N` field.
25554    pub const N_SHIFT: u32 = 11;
25555    /// Mask for the `N` field.
25556    pub const N_MASK: u64 = 0b11111;
25557    /// Offset of the `IDCODE` field.
25558    pub const IDCODE_SHIFT: u32 = 16;
25559    /// Mask for the `IDCODE` field.
25560    pub const IDCODE_MASK: u64 = 0b11111111;
25561    /// Offset of the `IMP` field.
25562    pub const IMP_SHIFT: u32 = 24;
25563    /// Mask for the `IMP` field.
25564    pub const IMP_MASK: u64 = 0b11111111;
25565    /// Offset of the `FZS` field.
25566    pub const FZS_SHIFT: u32 = 32;
25567
25568    /// Returns the value of the `N` field.
25569    pub const fn n(self) -> u8 {
25570        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
25571    }
25572
25573    /// Sets the value of the `N` field.
25574    pub const fn set_n(&mut self, value: u8) {
25575        let offset = Self::N_SHIFT;
25576        assert!(value & (Self::N_MASK as u8) == value);
25577        *self = Self::from_bits_retain(
25578            (self.bits() & !(Self::N_MASK << offset)) | ((value as u64) << offset),
25579        );
25580    }
25581
25582    /// Returns a copy with the `N` field set to the given value.
25583    pub const fn with_n(mut self, value: u8) -> Self {
25584        self.set_n(value);
25585        self
25586    }
25587
25588    /// Returns the value of the `IDCODE` field.
25589    pub const fn idcode(self) -> u8 {
25590        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
25591    }
25592
25593    /// Sets the value of the `IDCODE` field.
25594    pub const fn set_idcode(&mut self, value: u8) {
25595        let offset = Self::IDCODE_SHIFT;
25596        assert!(value & (Self::IDCODE_MASK as u8) == value);
25597        *self = Self::from_bits_retain(
25598            (self.bits() & !(Self::IDCODE_MASK << offset)) | ((value as u64) << offset),
25599        );
25600    }
25601
25602    /// Returns a copy with the `IDCODE` field set to the given value.
25603    pub const fn with_idcode(mut self, value: u8) -> Self {
25604        self.set_idcode(value);
25605        self
25606    }
25607
25608    /// Returns the value of the `IMP` field.
25609    pub const fn imp(self) -> u8 {
25610        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
25611    }
25612
25613    /// Sets the value of the `IMP` field.
25614    pub const fn set_imp(&mut self, value: u8) {
25615        let offset = Self::IMP_SHIFT;
25616        assert!(value & (Self::IMP_MASK as u8) == value);
25617        *self = Self::from_bits_retain(
25618            (self.bits() & !(Self::IMP_MASK << offset)) | ((value as u64) << offset),
25619        );
25620    }
25621
25622    /// Returns a copy with the `IMP` field set to the given value.
25623    pub const fn with_imp(mut self, value: u8) -> Self {
25624        self.set_imp(value);
25625        self
25626    }
25627}
25628
25629bitflags! {
25630    /// `PMINTENCLR` system register value.
25631    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25632    #[repr(transparent)]
25633    pub struct Pmintenclr: u32 {
25634        /// `P<m>` bit 0.
25635        const P0 = 1 << 0;
25636        /// `P<m>` bit 1.
25637        const P1 = 1 << 1;
25638        /// `P<m>` bit 2.
25639        const P2 = 1 << 2;
25640        /// `P<m>` bit 3.
25641        const P3 = 1 << 3;
25642        /// `P<m>` bit 4.
25643        const P4 = 1 << 4;
25644        /// `P<m>` bit 5.
25645        const P5 = 1 << 5;
25646        /// `P<m>` bit 6.
25647        const P6 = 1 << 6;
25648        /// `P<m>` bit 7.
25649        const P7 = 1 << 7;
25650        /// `P<m>` bit 8.
25651        const P8 = 1 << 8;
25652        /// `P<m>` bit 9.
25653        const P9 = 1 << 9;
25654        /// `P<m>` bit 10.
25655        const P10 = 1 << 10;
25656        /// `P<m>` bit 11.
25657        const P11 = 1 << 11;
25658        /// `P<m>` bit 12.
25659        const P12 = 1 << 12;
25660        /// `P<m>` bit 13.
25661        const P13 = 1 << 13;
25662        /// `P<m>` bit 14.
25663        const P14 = 1 << 14;
25664        /// `P<m>` bit 15.
25665        const P15 = 1 << 15;
25666        /// `P<m>` bit 16.
25667        const P16 = 1 << 16;
25668        /// `P<m>` bit 17.
25669        const P17 = 1 << 17;
25670        /// `P<m>` bit 18.
25671        const P18 = 1 << 18;
25672        /// `P<m>` bit 19.
25673        const P19 = 1 << 19;
25674        /// `P<m>` bit 20.
25675        const P20 = 1 << 20;
25676        /// `P<m>` bit 21.
25677        const P21 = 1 << 21;
25678        /// `P<m>` bit 22.
25679        const P22 = 1 << 22;
25680        /// `P<m>` bit 23.
25681        const P23 = 1 << 23;
25682        /// `P<m>` bit 24.
25683        const P24 = 1 << 24;
25684        /// `P<m>` bit 25.
25685        const P25 = 1 << 25;
25686        /// `P<m>` bit 26.
25687        const P26 = 1 << 26;
25688        /// `P<m>` bit 27.
25689        const P27 = 1 << 27;
25690        /// `P<m>` bit 28.
25691        const P28 = 1 << 28;
25692        /// `P<m>` bit 29.
25693        const P29 = 1 << 29;
25694        /// `P<m>` bit 30.
25695        const P30 = 1 << 30;
25696        /// `C` bit.
25697        const C = 1 << 31;
25698    }
25699}
25700
25701impl Pmintenclr {
25702    /// Offset of the `P<m>` field.
25703    pub const P_SHIFT: u32 = 0;
25704    /// Offset of the `C` field.
25705    pub const C_SHIFT: u32 = 31;
25706}
25707
25708bitflags! {
25709    /// `PMINTENSET` system register value.
25710    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25711    #[repr(transparent)]
25712    pub struct Pmintenset: u32 {
25713        /// `P<m>` bit 0.
25714        const P0 = 1 << 0;
25715        /// `P<m>` bit 1.
25716        const P1 = 1 << 1;
25717        /// `P<m>` bit 2.
25718        const P2 = 1 << 2;
25719        /// `P<m>` bit 3.
25720        const P3 = 1 << 3;
25721        /// `P<m>` bit 4.
25722        const P4 = 1 << 4;
25723        /// `P<m>` bit 5.
25724        const P5 = 1 << 5;
25725        /// `P<m>` bit 6.
25726        const P6 = 1 << 6;
25727        /// `P<m>` bit 7.
25728        const P7 = 1 << 7;
25729        /// `P<m>` bit 8.
25730        const P8 = 1 << 8;
25731        /// `P<m>` bit 9.
25732        const P9 = 1 << 9;
25733        /// `P<m>` bit 10.
25734        const P10 = 1 << 10;
25735        /// `P<m>` bit 11.
25736        const P11 = 1 << 11;
25737        /// `P<m>` bit 12.
25738        const P12 = 1 << 12;
25739        /// `P<m>` bit 13.
25740        const P13 = 1 << 13;
25741        /// `P<m>` bit 14.
25742        const P14 = 1 << 14;
25743        /// `P<m>` bit 15.
25744        const P15 = 1 << 15;
25745        /// `P<m>` bit 16.
25746        const P16 = 1 << 16;
25747        /// `P<m>` bit 17.
25748        const P17 = 1 << 17;
25749        /// `P<m>` bit 18.
25750        const P18 = 1 << 18;
25751        /// `P<m>` bit 19.
25752        const P19 = 1 << 19;
25753        /// `P<m>` bit 20.
25754        const P20 = 1 << 20;
25755        /// `P<m>` bit 21.
25756        const P21 = 1 << 21;
25757        /// `P<m>` bit 22.
25758        const P22 = 1 << 22;
25759        /// `P<m>` bit 23.
25760        const P23 = 1 << 23;
25761        /// `P<m>` bit 24.
25762        const P24 = 1 << 24;
25763        /// `P<m>` bit 25.
25764        const P25 = 1 << 25;
25765        /// `P<m>` bit 26.
25766        const P26 = 1 << 26;
25767        /// `P<m>` bit 27.
25768        const P27 = 1 << 27;
25769        /// `P<m>` bit 28.
25770        const P28 = 1 << 28;
25771        /// `P<m>` bit 29.
25772        const P29 = 1 << 29;
25773        /// `P<m>` bit 30.
25774        const P30 = 1 << 30;
25775        /// `C` bit.
25776        const C = 1 << 31;
25777    }
25778}
25779
25780impl Pmintenset {
25781    /// Offset of the `P<m>` field.
25782    pub const P_SHIFT: u32 = 0;
25783    /// Offset of the `C` field.
25784    pub const C_SHIFT: u32 = 31;
25785}
25786
25787bitflags! {
25788    /// `PMMIR` system register value.
25789    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25790    #[repr(transparent)]
25791    pub struct Pmmir: u32 {
25792    }
25793}
25794
25795impl Pmmir {
25796    /// Offset of the `SLOTS` field.
25797    pub const SLOTS_SHIFT: u32 = 0;
25798    /// Mask for the `SLOTS` field.
25799    pub const SLOTS_MASK: u32 = 0b11111111;
25800    /// Offset of the `BUS_SLOTS` field.
25801    pub const BUS_SLOTS_SHIFT: u32 = 8;
25802    /// Mask for the `BUS_SLOTS` field.
25803    pub const BUS_SLOTS_MASK: u32 = 0b11111111;
25804    /// Offset of the `BUS_WIDTH` field.
25805    pub const BUS_WIDTH_SHIFT: u32 = 16;
25806    /// Mask for the `BUS_WIDTH` field.
25807    pub const BUS_WIDTH_MASK: u32 = 0b1111;
25808    /// Offset of the `THWIDTH` field.
25809    pub const THWIDTH_SHIFT: u32 = 20;
25810    /// Mask for the `THWIDTH` field.
25811    pub const THWIDTH_MASK: u32 = 0b1111;
25812    /// Offset of the `EDGE` field.
25813    pub const EDGE_SHIFT: u32 = 24;
25814    /// Mask for the `EDGE` field.
25815    pub const EDGE_MASK: u32 = 0b1111;
25816
25817    /// Returns the value of the `SLOTS` field.
25818    pub const fn slots(self) -> u8 {
25819        ((self.bits() >> Self::SLOTS_SHIFT) & 0b11111111) as u8
25820    }
25821
25822    /// Sets the value of the `SLOTS` field.
25823    pub const fn set_slots(&mut self, value: u8) {
25824        let offset = Self::SLOTS_SHIFT;
25825        assert!(value & (Self::SLOTS_MASK as u8) == value);
25826        *self = Self::from_bits_retain(
25827            (self.bits() & !(Self::SLOTS_MASK << offset)) | ((value as u32) << offset),
25828        );
25829    }
25830
25831    /// Returns a copy with the `SLOTS` field set to the given value.
25832    pub const fn with_slots(mut self, value: u8) -> Self {
25833        self.set_slots(value);
25834        self
25835    }
25836
25837    /// Returns the value of the `BUS_SLOTS` field.
25838    pub const fn bus_slots(self) -> u8 {
25839        ((self.bits() >> Self::BUS_SLOTS_SHIFT) & 0b11111111) as u8
25840    }
25841
25842    /// Sets the value of the `BUS_SLOTS` field.
25843    pub const fn set_bus_slots(&mut self, value: u8) {
25844        let offset = Self::BUS_SLOTS_SHIFT;
25845        assert!(value & (Self::BUS_SLOTS_MASK as u8) == value);
25846        *self = Self::from_bits_retain(
25847            (self.bits() & !(Self::BUS_SLOTS_MASK << offset)) | ((value as u32) << offset),
25848        );
25849    }
25850
25851    /// Returns a copy with the `BUS_SLOTS` field set to the given value.
25852    pub const fn with_bus_slots(mut self, value: u8) -> Self {
25853        self.set_bus_slots(value);
25854        self
25855    }
25856
25857    /// Returns the value of the `BUS_WIDTH` field.
25858    pub const fn bus_width(self) -> u8 {
25859        ((self.bits() >> Self::BUS_WIDTH_SHIFT) & 0b1111) as u8
25860    }
25861
25862    /// Sets the value of the `BUS_WIDTH` field.
25863    pub const fn set_bus_width(&mut self, value: u8) {
25864        let offset = Self::BUS_WIDTH_SHIFT;
25865        assert!(value & (Self::BUS_WIDTH_MASK as u8) == value);
25866        *self = Self::from_bits_retain(
25867            (self.bits() & !(Self::BUS_WIDTH_MASK << offset)) | ((value as u32) << offset),
25868        );
25869    }
25870
25871    /// Returns a copy with the `BUS_WIDTH` field set to the given value.
25872    pub const fn with_bus_width(mut self, value: u8) -> Self {
25873        self.set_bus_width(value);
25874        self
25875    }
25876
25877    /// Returns the value of the `THWIDTH` field.
25878    pub const fn thwidth(self) -> u8 {
25879        ((self.bits() >> Self::THWIDTH_SHIFT) & 0b1111) as u8
25880    }
25881
25882    /// Sets the value of the `THWIDTH` field.
25883    pub const fn set_thwidth(&mut self, value: u8) {
25884        let offset = Self::THWIDTH_SHIFT;
25885        assert!(value & (Self::THWIDTH_MASK as u8) == value);
25886        *self = Self::from_bits_retain(
25887            (self.bits() & !(Self::THWIDTH_MASK << offset)) | ((value as u32) << offset),
25888        );
25889    }
25890
25891    /// Returns a copy with the `THWIDTH` field set to the given value.
25892    pub const fn with_thwidth(mut self, value: u8) -> Self {
25893        self.set_thwidth(value);
25894        self
25895    }
25896
25897    /// Returns the value of the `EDGE` field.
25898    pub const fn edge(self) -> u8 {
25899        ((self.bits() >> Self::EDGE_SHIFT) & 0b1111) as u8
25900    }
25901
25902    /// Sets the value of the `EDGE` field.
25903    pub const fn set_edge(&mut self, value: u8) {
25904        let offset = Self::EDGE_SHIFT;
25905        assert!(value & (Self::EDGE_MASK as u8) == value);
25906        *self = Self::from_bits_retain(
25907            (self.bits() & !(Self::EDGE_MASK << offset)) | ((value as u32) << offset),
25908        );
25909    }
25910
25911    /// Returns a copy with the `EDGE` field set to the given value.
25912    pub const fn with_edge(mut self, value: u8) -> Self {
25913        self.set_edge(value);
25914        self
25915    }
25916}
25917
25918bitflags! {
25919    /// `PMOVSR` system register value.
25920    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25921    #[repr(transparent)]
25922    pub struct Pmovsr: u32 {
25923        /// `P<m>` bit 0.
25924        const P0 = 1 << 0;
25925        /// `P<m>` bit 1.
25926        const P1 = 1 << 1;
25927        /// `P<m>` bit 2.
25928        const P2 = 1 << 2;
25929        /// `P<m>` bit 3.
25930        const P3 = 1 << 3;
25931        /// `P<m>` bit 4.
25932        const P4 = 1 << 4;
25933        /// `P<m>` bit 5.
25934        const P5 = 1 << 5;
25935        /// `P<m>` bit 6.
25936        const P6 = 1 << 6;
25937        /// `P<m>` bit 7.
25938        const P7 = 1 << 7;
25939        /// `P<m>` bit 8.
25940        const P8 = 1 << 8;
25941        /// `P<m>` bit 9.
25942        const P9 = 1 << 9;
25943        /// `P<m>` bit 10.
25944        const P10 = 1 << 10;
25945        /// `P<m>` bit 11.
25946        const P11 = 1 << 11;
25947        /// `P<m>` bit 12.
25948        const P12 = 1 << 12;
25949        /// `P<m>` bit 13.
25950        const P13 = 1 << 13;
25951        /// `P<m>` bit 14.
25952        const P14 = 1 << 14;
25953        /// `P<m>` bit 15.
25954        const P15 = 1 << 15;
25955        /// `P<m>` bit 16.
25956        const P16 = 1 << 16;
25957        /// `P<m>` bit 17.
25958        const P17 = 1 << 17;
25959        /// `P<m>` bit 18.
25960        const P18 = 1 << 18;
25961        /// `P<m>` bit 19.
25962        const P19 = 1 << 19;
25963        /// `P<m>` bit 20.
25964        const P20 = 1 << 20;
25965        /// `P<m>` bit 21.
25966        const P21 = 1 << 21;
25967        /// `P<m>` bit 22.
25968        const P22 = 1 << 22;
25969        /// `P<m>` bit 23.
25970        const P23 = 1 << 23;
25971        /// `P<m>` bit 24.
25972        const P24 = 1 << 24;
25973        /// `P<m>` bit 25.
25974        const P25 = 1 << 25;
25975        /// `P<m>` bit 26.
25976        const P26 = 1 << 26;
25977        /// `P<m>` bit 27.
25978        const P27 = 1 << 27;
25979        /// `P<m>` bit 28.
25980        const P28 = 1 << 28;
25981        /// `P<m>` bit 29.
25982        const P29 = 1 << 29;
25983        /// `P<m>` bit 30.
25984        const P30 = 1 << 30;
25985        /// `C` bit.
25986        const C = 1 << 31;
25987    }
25988}
25989
25990impl Pmovsr {
25991    /// Offset of the `P<m>` field.
25992    pub const P_SHIFT: u32 = 0;
25993    /// Offset of the `C` field.
25994    pub const C_SHIFT: u32 = 31;
25995}
25996
25997bitflags! {
25998    /// `PMOVSSET` system register value.
25999    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26000    #[repr(transparent)]
26001    pub struct Pmovsset: u32 {
26002        /// `P<m>` bit 0.
26003        const P0 = 1 << 0;
26004        /// `P<m>` bit 1.
26005        const P1 = 1 << 1;
26006        /// `P<m>` bit 2.
26007        const P2 = 1 << 2;
26008        /// `P<m>` bit 3.
26009        const P3 = 1 << 3;
26010        /// `P<m>` bit 4.
26011        const P4 = 1 << 4;
26012        /// `P<m>` bit 5.
26013        const P5 = 1 << 5;
26014        /// `P<m>` bit 6.
26015        const P6 = 1 << 6;
26016        /// `P<m>` bit 7.
26017        const P7 = 1 << 7;
26018        /// `P<m>` bit 8.
26019        const P8 = 1 << 8;
26020        /// `P<m>` bit 9.
26021        const P9 = 1 << 9;
26022        /// `P<m>` bit 10.
26023        const P10 = 1 << 10;
26024        /// `P<m>` bit 11.
26025        const P11 = 1 << 11;
26026        /// `P<m>` bit 12.
26027        const P12 = 1 << 12;
26028        /// `P<m>` bit 13.
26029        const P13 = 1 << 13;
26030        /// `P<m>` bit 14.
26031        const P14 = 1 << 14;
26032        /// `P<m>` bit 15.
26033        const P15 = 1 << 15;
26034        /// `P<m>` bit 16.
26035        const P16 = 1 << 16;
26036        /// `P<m>` bit 17.
26037        const P17 = 1 << 17;
26038        /// `P<m>` bit 18.
26039        const P18 = 1 << 18;
26040        /// `P<m>` bit 19.
26041        const P19 = 1 << 19;
26042        /// `P<m>` bit 20.
26043        const P20 = 1 << 20;
26044        /// `P<m>` bit 21.
26045        const P21 = 1 << 21;
26046        /// `P<m>` bit 22.
26047        const P22 = 1 << 22;
26048        /// `P<m>` bit 23.
26049        const P23 = 1 << 23;
26050        /// `P<m>` bit 24.
26051        const P24 = 1 << 24;
26052        /// `P<m>` bit 25.
26053        const P25 = 1 << 25;
26054        /// `P<m>` bit 26.
26055        const P26 = 1 << 26;
26056        /// `P<m>` bit 27.
26057        const P27 = 1 << 27;
26058        /// `P<m>` bit 28.
26059        const P28 = 1 << 28;
26060        /// `P<m>` bit 29.
26061        const P29 = 1 << 29;
26062        /// `P<m>` bit 30.
26063        const P30 = 1 << 30;
26064        /// `C` bit.
26065        const C = 1 << 31;
26066    }
26067}
26068
26069impl Pmovsset {
26070    /// Offset of the `P<m>` field.
26071    pub const P_SHIFT: u32 = 0;
26072    /// Offset of the `C` field.
26073    pub const C_SHIFT: u32 = 31;
26074}
26075
26076bitflags! {
26077    /// `PMSELR` system register value.
26078    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26079    #[repr(transparent)]
26080    pub struct Pmselr: u32 {
26081    }
26082}
26083
26084impl Pmselr {
26085    /// Offset of the `SEL` field.
26086    pub const SEL_SHIFT: u32 = 0;
26087    /// Mask for the `SEL` field.
26088    pub const SEL_MASK: u32 = 0b11111;
26089
26090    /// Returns the value of the `SEL` field.
26091    pub const fn sel(self) -> u8 {
26092        ((self.bits() >> Self::SEL_SHIFT) & 0b11111) as u8
26093    }
26094
26095    /// Sets the value of the `SEL` field.
26096    pub const fn set_sel(&mut self, value: u8) {
26097        let offset = Self::SEL_SHIFT;
26098        assert!(value & (Self::SEL_MASK as u8) == value);
26099        *self = Self::from_bits_retain(
26100            (self.bits() & !(Self::SEL_MASK << offset)) | ((value as u32) << offset),
26101        );
26102    }
26103
26104    /// Returns a copy with the `SEL` field set to the given value.
26105    pub const fn with_sel(mut self, value: u8) -> Self {
26106        self.set_sel(value);
26107        self
26108    }
26109}
26110
26111bitflags! {
26112    /// `PMSWINC` system register value.
26113    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26114    #[repr(transparent)]
26115    pub struct Pmswinc: u32 {
26116        /// `P<m>` bit 0.
26117        const P0 = 1 << 0;
26118        /// `P<m>` bit 1.
26119        const P1 = 1 << 1;
26120        /// `P<m>` bit 2.
26121        const P2 = 1 << 2;
26122        /// `P<m>` bit 3.
26123        const P3 = 1 << 3;
26124        /// `P<m>` bit 4.
26125        const P4 = 1 << 4;
26126        /// `P<m>` bit 5.
26127        const P5 = 1 << 5;
26128        /// `P<m>` bit 6.
26129        const P6 = 1 << 6;
26130        /// `P<m>` bit 7.
26131        const P7 = 1 << 7;
26132        /// `P<m>` bit 8.
26133        const P8 = 1 << 8;
26134        /// `P<m>` bit 9.
26135        const P9 = 1 << 9;
26136        /// `P<m>` bit 10.
26137        const P10 = 1 << 10;
26138        /// `P<m>` bit 11.
26139        const P11 = 1 << 11;
26140        /// `P<m>` bit 12.
26141        const P12 = 1 << 12;
26142        /// `P<m>` bit 13.
26143        const P13 = 1 << 13;
26144        /// `P<m>` bit 14.
26145        const P14 = 1 << 14;
26146        /// `P<m>` bit 15.
26147        const P15 = 1 << 15;
26148        /// `P<m>` bit 16.
26149        const P16 = 1 << 16;
26150        /// `P<m>` bit 17.
26151        const P17 = 1 << 17;
26152        /// `P<m>` bit 18.
26153        const P18 = 1 << 18;
26154        /// `P<m>` bit 19.
26155        const P19 = 1 << 19;
26156        /// `P<m>` bit 20.
26157        const P20 = 1 << 20;
26158        /// `P<m>` bit 21.
26159        const P21 = 1 << 21;
26160        /// `P<m>` bit 22.
26161        const P22 = 1 << 22;
26162        /// `P<m>` bit 23.
26163        const P23 = 1 << 23;
26164        /// `P<m>` bit 24.
26165        const P24 = 1 << 24;
26166        /// `P<m>` bit 25.
26167        const P25 = 1 << 25;
26168        /// `P<m>` bit 26.
26169        const P26 = 1 << 26;
26170        /// `P<m>` bit 27.
26171        const P27 = 1 << 27;
26172        /// `P<m>` bit 28.
26173        const P28 = 1 << 28;
26174        /// `P<m>` bit 29.
26175        const P29 = 1 << 29;
26176        /// `P<m>` bit 30.
26177        const P30 = 1 << 30;
26178    }
26179}
26180
26181impl Pmswinc {
26182    /// Offset of the `P<m>` field.
26183    pub const P_SHIFT: u32 = 0;
26184}
26185
26186bitflags! {
26187    /// `PMUSERENR` system register value.
26188    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26189    #[repr(transparent)]
26190    pub struct Pmuserenr: u32 {
26191        /// `EN` bit.
26192        const EN = 1 << 0;
26193        /// `SW` bit.
26194        const SW = 1 << 1;
26195        /// `CR` bit.
26196        const CR = 1 << 2;
26197        /// `ER` bit.
26198        const ER = 1 << 3;
26199        /// `TID` bit.
26200        const TID = 1 << 6;
26201    }
26202}
26203
26204impl Pmuserenr {
26205    /// Offset of the `EN` field.
26206    pub const EN_SHIFT: u32 = 0;
26207    /// Offset of the `SW` field.
26208    pub const SW_SHIFT: u32 = 1;
26209    /// Offset of the `CR` field.
26210    pub const CR_SHIFT: u32 = 2;
26211    /// Offset of the `ER` field.
26212    pub const ER_SHIFT: u32 = 3;
26213    /// Offset of the `TID` field.
26214    pub const TID_SHIFT: u32 = 6;
26215}
26216
26217bitflags! {
26218    /// `PMXEVTYPER` system register value.
26219    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26220    #[repr(transparent)]
26221    pub struct Pmxevtyper: u32 {
26222    }
26223}
26224
26225impl Pmxevtyper {
26226    /// Offset of the `ETR` field.
26227    pub const ETR_SHIFT: u32 = 0;
26228    /// Mask for the `ETR` field.
26229    pub const ETR_MASK: u32 = 0b11111111111111111111111111111111;
26230
26231    /// Returns the value of the `ETR` field.
26232    pub const fn etr(self) -> u32 {
26233        ((self.bits() >> Self::ETR_SHIFT) & 0b11111111111111111111111111111111) as u32
26234    }
26235
26236    /// Sets the value of the `ETR` field.
26237    pub const fn set_etr(&mut self, value: u32) {
26238        let offset = Self::ETR_SHIFT;
26239        assert!(value & (Self::ETR_MASK as u32) == value);
26240        *self = Self::from_bits_retain(
26241            (self.bits() & !(Self::ETR_MASK << offset)) | ((value as u32) << offset),
26242        );
26243    }
26244
26245    /// Returns a copy with the `ETR` field set to the given value.
26246    pub const fn with_etr(mut self, value: u32) -> Self {
26247        self.set_etr(value);
26248        self
26249    }
26250}
26251
26252bitflags! {
26253    /// `PRRR` system register value.
26254    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26255    #[repr(transparent)]
26256    pub struct Prrr: u32 {
26257        /// `DS0` bit.
26258        const DS0 = 1 << 16;
26259        /// `DS1` bit.
26260        const DS1 = 1 << 17;
26261        /// `NS0` bit.
26262        const NS0 = 1 << 18;
26263        /// `NS1` bit.
26264        const NS1 = 1 << 19;
26265        /// `NOS<n>` bit 0.
26266        const NOS0 = 1 << 24;
26267        /// `NOS<n>` bit 1.
26268        const NOS1 = 1 << 25;
26269        /// `NOS<n>` bit 2.
26270        const NOS2 = 1 << 26;
26271        /// `NOS<n>` bit 3.
26272        const NOS3 = 1 << 27;
26273        /// `NOS<n>` bit 4.
26274        const NOS4 = 1 << 28;
26275        /// `NOS<n>` bit 5.
26276        const NOS5 = 1 << 29;
26277        /// `NOS<n>` bit 6.
26278        const NOS6 = 1 << 30;
26279        /// `NOS<n>` bit 7.
26280        const NOS7 = 1 << 31;
26281    }
26282}
26283
26284impl Prrr {
26285    /// Offset of the `TR<n>` field.
26286    pub const TR_SHIFT: u32 = 0;
26287    /// Mask for the `TR<n>` field.
26288    pub const TR_MASK: u32 = 0b11;
26289    /// Offset of the `DS0` field.
26290    pub const DS0_SHIFT: u32 = 16;
26291    /// Offset of the `DS1` field.
26292    pub const DS1_SHIFT: u32 = 17;
26293    /// Offset of the `NS0` field.
26294    pub const NS0_SHIFT: u32 = 18;
26295    /// Offset of the `NS1` field.
26296    pub const NS1_SHIFT: u32 = 19;
26297    /// Offset of the `NOS<n>` field.
26298    pub const NOS_SHIFT: u32 = 24;
26299
26300    /// Returns the value of the given `TR<n>` field.
26301    pub const fn tr(self, n: u32) -> u8 {
26302        assert!(n < 8);
26303        ((self.bits() >> (Self::TR_SHIFT + (n - 0) * 2)) & 0b11) as u8
26304    }
26305
26306    /// Sets the value of the `TR<n>` field.
26307    pub const fn set_tr(&mut self, n: u32, value: u8) {
26308        assert!(n < 8);
26309        let offset = Self::TR_SHIFT + (n - 0) * 2;
26310        assert!(value & (Self::TR_MASK as u8) == value);
26311        *self = Self::from_bits_retain(
26312            (self.bits() & !(Self::TR_MASK << offset)) | ((value as u32) << offset),
26313        );
26314    }
26315
26316    /// Returns a copy with the `TR<n>` field set to the given value.
26317    pub const fn with_tr(mut self, n: u32, value: u8) -> Self {
26318        self.set_tr(n, value);
26319        self
26320    }
26321}
26322
26323#[cfg(feature = "el1")]
26324bitflags! {
26325    /// `RGSR_EL1` system register value.
26326    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26327    #[repr(transparent)]
26328    pub struct RgsrEl1: u64 {
26329    }
26330}
26331
26332#[cfg(feature = "el1")]
26333impl RgsrEl1 {
26334    /// Offset of the `TAG` field.
26335    pub const TAG_SHIFT: u32 = 0;
26336    /// Mask for the `TAG` field.
26337    pub const TAG_MASK: u64 = 0b1111;
26338    /// Offset of the `SEED` field.
26339    pub const SEED_SHIFT: u32 = 8;
26340    /// Mask for the `SEED` field.
26341    pub const SEED_MASK: u64 = 0b1111111111111111;
26342
26343    /// Returns the value of the `TAG` field.
26344    pub const fn tag(self) -> u8 {
26345        ((self.bits() >> Self::TAG_SHIFT) & 0b1111) as u8
26346    }
26347
26348    /// Sets the value of the `TAG` field.
26349    pub const fn set_tag(&mut self, value: u8) {
26350        let offset = Self::TAG_SHIFT;
26351        assert!(value & (Self::TAG_MASK as u8) == value);
26352        *self = Self::from_bits_retain(
26353            (self.bits() & !(Self::TAG_MASK << offset)) | ((value as u64) << offset),
26354        );
26355    }
26356
26357    /// Returns a copy with the `TAG` field set to the given value.
26358    pub const fn with_tag(mut self, value: u8) -> Self {
26359        self.set_tag(value);
26360        self
26361    }
26362
26363    /// Returns the value of the `SEED` field.
26364    pub const fn seed(self) -> u16 {
26365        ((self.bits() >> Self::SEED_SHIFT) & 0b1111111111111111) as u16
26366    }
26367
26368    /// Sets the value of the `SEED` field.
26369    pub const fn set_seed(&mut self, value: u16) {
26370        let offset = Self::SEED_SHIFT;
26371        assert!(value & (Self::SEED_MASK as u16) == value);
26372        *self = Self::from_bits_retain(
26373            (self.bits() & !(Self::SEED_MASK << offset)) | ((value as u64) << offset),
26374        );
26375    }
26376
26377    /// Returns a copy with the `SEED` field set to the given value.
26378    pub const fn with_seed(mut self, value: u16) -> Self {
26379        self.set_seed(value);
26380        self
26381    }
26382}
26383
26384bitflags! {
26385    /// `RMR` system register value.
26386    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26387    #[repr(transparent)]
26388    pub struct Rmr: u32 {
26389        /// `AA64` bit.
26390        const AA64 = 1 << 0;
26391        /// `RR` bit.
26392        const RR = 1 << 1;
26393    }
26394}
26395
26396impl Rmr {
26397    /// Offset of the `AA64` field.
26398    pub const AA64_SHIFT: u32 = 0;
26399    /// Offset of the `RR` field.
26400    pub const RR_SHIFT: u32 = 1;
26401}
26402
26403bitflags! {
26404    /// `RVBAR` system register value.
26405    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26406    #[repr(transparent)]
26407    pub struct Rvbar: u32 {
26408        /// RES1 bits in the `RVBAR` register.
26409        const RES1 = 0b1;
26410    }
26411}
26412
26413impl Rvbar {
26414    /// Offset of the `ResetAddress` field.
26415    pub const RESETADDRESS_SHIFT: u32 = 1;
26416    /// Mask for the `ResetAddress` field.
26417    pub const RESETADDRESS_MASK: u32 = 0b1111111111111111111111111111111;
26418
26419    /// Returns the value of the `ResetAddress` field.
26420    pub const fn resetaddress(self) -> u32 {
26421        ((self.bits() >> Self::RESETADDRESS_SHIFT) & 0b1111111111111111111111111111111) as u32
26422    }
26423
26424    /// Sets the value of the `ResetAddress` field.
26425    pub const fn set_resetaddress(&mut self, value: u32) {
26426        let offset = Self::RESETADDRESS_SHIFT;
26427        assert!(value & (Self::RESETADDRESS_MASK as u32) == value);
26428        *self = Self::from_bits_retain(
26429            (self.bits() & !(Self::RESETADDRESS_MASK << offset)) | ((value as u32) << offset),
26430        );
26431    }
26432
26433    /// Returns a copy with the `ResetAddress` field set to the given value.
26434    pub const fn with_resetaddress(mut self, value: u32) -> Self {
26435        self.set_resetaddress(value);
26436        self
26437    }
26438}
26439
26440bitflags! {
26441    /// `SCR` system register value.
26442    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26443    #[repr(transparent)]
26444    pub struct Scr: u32 {
26445        /// `NS` bit.
26446        const NS = 1 << 0;
26447        /// `IRQ` bit.
26448        const IRQ = 1 << 1;
26449        /// `FIQ` bit.
26450        const FIQ = 1 << 2;
26451        /// `EA` bit.
26452        const EA = 1 << 3;
26453        /// `FW` bit.
26454        const FW = 1 << 4;
26455        /// `AW` bit.
26456        const AW = 1 << 5;
26457        /// `nET` bit.
26458        const NET = 1 << 6;
26459        /// `SCD` bit.
26460        const SCD = 1 << 7;
26461        /// `HCE` bit.
26462        const HCE = 1 << 8;
26463        /// `SIF` bit.
26464        const SIF = 1 << 9;
26465        /// `TWI` bit.
26466        const TWI = 1 << 12;
26467        /// `TWE` bit.
26468        const TWE = 1 << 13;
26469        /// `TERR` bit.
26470        const TERR = 1 << 15;
26471    }
26472}
26473
26474impl Scr {
26475    /// Offset of the `NS` field.
26476    pub const NS_SHIFT: u32 = 0;
26477    /// Offset of the `IRQ` field.
26478    pub const IRQ_SHIFT: u32 = 1;
26479    /// Offset of the `FIQ` field.
26480    pub const FIQ_SHIFT: u32 = 2;
26481    /// Offset of the `EA` field.
26482    pub const EA_SHIFT: u32 = 3;
26483    /// Offset of the `FW` field.
26484    pub const FW_SHIFT: u32 = 4;
26485    /// Offset of the `AW` field.
26486    pub const AW_SHIFT: u32 = 5;
26487    /// Offset of the `nET` field.
26488    pub const NET_SHIFT: u32 = 6;
26489    /// Offset of the `SCD` field.
26490    pub const SCD_SHIFT: u32 = 7;
26491    /// Offset of the `HCE` field.
26492    pub const HCE_SHIFT: u32 = 8;
26493    /// Offset of the `SIF` field.
26494    pub const SIF_SHIFT: u32 = 9;
26495    /// Offset of the `TWI` field.
26496    pub const TWI_SHIFT: u32 = 12;
26497    /// Offset of the `TWE` field.
26498    pub const TWE_SHIFT: u32 = 13;
26499    /// Offset of the `TERR` field.
26500    pub const TERR_SHIFT: u32 = 15;
26501}
26502
26503#[cfg(feature = "el3")]
26504bitflags! {
26505    /// `SCR_EL3` system register value.
26506    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26507    #[repr(transparent)]
26508    pub struct ScrEl3: u64 {
26509        /// RES1 bits in the `SCR_EL3` register.
26510        const RES1 = 0b110000;
26511        /// Non-secure.
26512        const NS = 1 << 0;
26513        /// Take physical IRQs at EL3.
26514        const IRQ = 1 << 1;
26515        /// Take physical FIQs at EL3.
26516        const FIQ = 1 << 2;
26517        /// Take external abort and SError exceptions at EL3.
26518        const EA = 1 << 3;
26519        /// Disable SMC instructions.
26520        const SMD = 1 << 7;
26521        /// Enable HVC instructions.
26522        const HCE = 1 << 8;
26523        /// Disable execution from non-secure memory.
26524        const SIF = 1 << 9;
26525        /// Enable AArch64 in lower ELs.
26526        const RW = 1 << 10;
26527        /// Trap physical secure timer to EL3.
26528        const ST = 1 << 11;
26529        /// Trap WFI to EL3.
26530        const TWI = 1 << 12;
26531        /// Trap WFE to EL3.
26532        const TWE = 1 << 13;
26533        /// Trap LOR register access to EL3.
26534        const TLOR = 1 << 14;
26535        /// Trap error record register access to EL3.
26536        const TERR = 1 << 15;
26537        /// Don't trap PAC key registers to EL3.
26538        const APK = 1 << 16;
26539        /// Don't trap PAuth instructions to EL3.
26540        const API = 1 << 17;
26541        /// Enable Secure EL2.
26542        const EEL2 = 1 << 18;
26543        /// Synchronous external aborts are taken as SErrors.
26544        const EASE = 1 << 19;
26545        /// Take SError exceptions at EL3.
26546        const NMEA = 1 << 20;
26547        /// Enable fault injection at lower ELs.
26548        const FIEN = 1 << 21;
26549        /// Trap ID group 3 registers to EL3.
26550        const TID3 = 1 << 22;
26551        /// Trap ID group 5 register to EL3.
26552        const TID5 = 1 << 23;
26553        /// `POE2En` bit.
26554        const POE2EN = 1 << 24;
26555        /// Enable SCXT at lower ELs.
26556        const ENSCXT = 1 << 25;
26557        /// Enable memory tagging at lower ELs.
26558        const ATA = 1 << 26;
26559        /// Enable fine-grained traps to EL2.
26560        const FGTEN = 1 << 27;
26561        /// Enable access to CNTPOFF_EL2.
26562        const ECVEN = 1 << 28;
26563        /// Enable a configurable delay for WFE traps.
26564        const TWEDEN = 1 << 29;
26565        /// Enable activity monitors virtual offsets.
26566        const AMVOFFEN = 1 << 35;
26567        /// Enable ST64BV0 at lower ELs.
26568        const ENAS0 = 1 << 36;
26569        /// Enable ACCDATA_EL1 at lower ELs.
26570        const ADEN = 1 << 37;
26571        /// Enable HCRX_EL2.
26572        const HXEN = 1 << 38;
26573        /// Enable guarded control stack.
26574        const GCSEN = 1 << 39;
26575        /// Trap RNDR and RNDRRS to EL3.
26576        const TRNDR = 1 << 40;
26577        /// Enable TPIDR2_EL0 at lower ELs.
26578        const ENTP2 = 1 << 41;
26579        /// Enable RCW and RCWS mask registers at lower ELs.
26580        const RCWMASKEN = 1 << 42;
26581        /// Enable TCR2_ELx registers at lower ELs.
26582        const TCR2EN = 1 << 43;
26583        /// Enable SCTLR2_ELx registers at lower ELs.
26584        const SCTLR2EN = 1 << 44;
26585        /// Enable permission indirection and overlay registers at lower ELs.
26586        const PIEN = 1 << 45;
26587        /// Enable MAIR2_ELx and AMAIR2_ELx at lower ELs.
26588        const AIEN = 1 << 46;
26589        /// Enable 128-bit system registers at  lower ELs.
26590        const D128EN = 1 << 47;
26591        /// Route GPFs to EL3.
26592        const GPF = 1 << 48;
26593        /// Enable MECID registers at EL2.
26594        const MECEN = 1 << 49;
26595        /// Enable access to FPMR at lower ELs.
26596        const ENFPM = 1 << 50;
26597        /// Take synchronous external abort and physical SError exception to EL3.
26598        const TMEA = 1 << 51;
26599        /// Trap writes to Error Record registers to EL3.
26600        const TWERR = 1 << 52;
26601        /// Enable access to physical fault address registers at lower ELs.
26602        const PFAREN = 1 << 53;
26603        /// Enable access to mask registers at lower ELs.
26604        const SRMASKEN = 1 << 54;
26605        /// Enable implementation-defined 128-bit system registers.
26606        const ENIDCP128 = 1 << 55;
26607        /// `VTLBIDEn` bit.
26608        const VTLBIDEN = 1 << 56;
26609        /// A delegated SError exception is pending.
26610        const DSE = 1 << 57;
26611        /// Enable delegated SError exceptions.
26612        const ENDSE = 1 << 58;
26613        /// Enable fine-grained traps to EL2.
26614        const FGTEN2 = 1 << 59;
26615        /// Enable HDBSSBR_EL2 and HDBSSPROD_EL2 registers at EL2.
26616        const HDBSSEN = 1 << 60;
26617        /// Enable HACDBSBR_EL2 and HACDBSCONS_EL2 registers at EL2.
26618        const HACDBSEN = 1 << 61;
26619        /// Non-secure realm world bit.
26620        const NSE = 1 << 62;
26621        /// `TPLIMEn` bit.
26622        const TPLIMEN = 1 << 63;
26623    }
26624}
26625
26626#[cfg(feature = "el3")]
26627impl ScrEl3 {
26628    /// Offset of the `NS` field.
26629    pub const NS_SHIFT: u32 = 0;
26630    /// Offset of the `IRQ` field.
26631    pub const IRQ_SHIFT: u32 = 1;
26632    /// Offset of the `FIQ` field.
26633    pub const FIQ_SHIFT: u32 = 2;
26634    /// Offset of the `EA` field.
26635    pub const EA_SHIFT: u32 = 3;
26636    /// Offset of the `SMD` field.
26637    pub const SMD_SHIFT: u32 = 7;
26638    /// Offset of the `HCE` field.
26639    pub const HCE_SHIFT: u32 = 8;
26640    /// Offset of the `SIF` field.
26641    pub const SIF_SHIFT: u32 = 9;
26642    /// Offset of the `RW` field.
26643    pub const RW_SHIFT: u32 = 10;
26644    /// Offset of the `ST` field.
26645    pub const ST_SHIFT: u32 = 11;
26646    /// Offset of the `TWI` field.
26647    pub const TWI_SHIFT: u32 = 12;
26648    /// Offset of the `TWE` field.
26649    pub const TWE_SHIFT: u32 = 13;
26650    /// Offset of the `TLOR` field.
26651    pub const TLOR_SHIFT: u32 = 14;
26652    /// Offset of the `TERR` field.
26653    pub const TERR_SHIFT: u32 = 15;
26654    /// Offset of the `APK` field.
26655    pub const APK_SHIFT: u32 = 16;
26656    /// Offset of the `API` field.
26657    pub const API_SHIFT: u32 = 17;
26658    /// Offset of the `EEL2` field.
26659    pub const EEL2_SHIFT: u32 = 18;
26660    /// Offset of the `EASE` field.
26661    pub const EASE_SHIFT: u32 = 19;
26662    /// Offset of the `NMEA` field.
26663    pub const NMEA_SHIFT: u32 = 20;
26664    /// Offset of the `FIEN` field.
26665    pub const FIEN_SHIFT: u32 = 21;
26666    /// Offset of the `TID3` field.
26667    pub const TID3_SHIFT: u32 = 22;
26668    /// Offset of the `TID5` field.
26669    pub const TID5_SHIFT: u32 = 23;
26670    /// Offset of the `POE2En` field.
26671    pub const POE2EN_SHIFT: u32 = 24;
26672    /// Offset of the `EnSCXT` field.
26673    pub const ENSCXT_SHIFT: u32 = 25;
26674    /// Offset of the `ATA` field.
26675    pub const ATA_SHIFT: u32 = 26;
26676    /// Offset of the `FGTEn` field.
26677    pub const FGTEN_SHIFT: u32 = 27;
26678    /// Offset of the `ECVEn` field.
26679    pub const ECVEN_SHIFT: u32 = 28;
26680    /// Offset of the `TWEDEn` field.
26681    pub const TWEDEN_SHIFT: u32 = 29;
26682    /// Offset of the `TWEDEL` field.
26683    pub const TWEDEL_SHIFT: u32 = 30;
26684    /// Mask for the `TWEDEL` field.
26685    pub const TWEDEL_MASK: u64 = 0b1111;
26686    /// Offset of the `AMVOFFEN` field.
26687    pub const AMVOFFEN_SHIFT: u32 = 35;
26688    /// Offset of the `EnAS0` field.
26689    pub const ENAS0_SHIFT: u32 = 36;
26690    /// Offset of the `ADEn` field.
26691    pub const ADEN_SHIFT: u32 = 37;
26692    /// Offset of the `HXEn` field.
26693    pub const HXEN_SHIFT: u32 = 38;
26694    /// Offset of the `GCSEn` field.
26695    pub const GCSEN_SHIFT: u32 = 39;
26696    /// Offset of the `TRNDR` field.
26697    pub const TRNDR_SHIFT: u32 = 40;
26698    /// Offset of the `EnTP2` field.
26699    pub const ENTP2_SHIFT: u32 = 41;
26700    /// Offset of the `RCWMASKEn` field.
26701    pub const RCWMASKEN_SHIFT: u32 = 42;
26702    /// Offset of the `TCR2En` field.
26703    pub const TCR2EN_SHIFT: u32 = 43;
26704    /// Offset of the `SCTLR2En` field.
26705    pub const SCTLR2EN_SHIFT: u32 = 44;
26706    /// Offset of the `PIEn` field.
26707    pub const PIEN_SHIFT: u32 = 45;
26708    /// Offset of the `AIEn` field.
26709    pub const AIEN_SHIFT: u32 = 46;
26710    /// Offset of the `D128En` field.
26711    pub const D128EN_SHIFT: u32 = 47;
26712    /// Offset of the `GPF` field.
26713    pub const GPF_SHIFT: u32 = 48;
26714    /// Offset of the `MECEn` field.
26715    pub const MECEN_SHIFT: u32 = 49;
26716    /// Offset of the `EnFPM` field.
26717    pub const ENFPM_SHIFT: u32 = 50;
26718    /// Offset of the `TMEA` field.
26719    pub const TMEA_SHIFT: u32 = 51;
26720    /// Offset of the `TWERR` field.
26721    pub const TWERR_SHIFT: u32 = 52;
26722    /// Offset of the `PFAREn` field.
26723    pub const PFAREN_SHIFT: u32 = 53;
26724    /// Offset of the `SRMASKEn` field.
26725    pub const SRMASKEN_SHIFT: u32 = 54;
26726    /// Offset of the `EnIDCP128` field.
26727    pub const ENIDCP128_SHIFT: u32 = 55;
26728    /// Offset of the `VTLBIDEn` field.
26729    pub const VTLBIDEN_SHIFT: u32 = 56;
26730    /// Offset of the `DSE` field.
26731    pub const DSE_SHIFT: u32 = 57;
26732    /// Offset of the `EnDSE` field.
26733    pub const ENDSE_SHIFT: u32 = 58;
26734    /// Offset of the `FGTEn2` field.
26735    pub const FGTEN2_SHIFT: u32 = 59;
26736    /// Offset of the `HDBSSEn` field.
26737    pub const HDBSSEN_SHIFT: u32 = 60;
26738    /// Offset of the `HACDBSEn` field.
26739    pub const HACDBSEN_SHIFT: u32 = 61;
26740    /// Offset of the `NSE` field.
26741    pub const NSE_SHIFT: u32 = 62;
26742    /// Offset of the `TPLIMEn` field.
26743    pub const TPLIMEN_SHIFT: u32 = 63;
26744
26745    /// Returns the value of the `TWEDEL` field.
26746    pub const fn twedel(self) -> u8 {
26747        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
26748    }
26749
26750    /// Sets the value of the `TWEDEL` field.
26751    pub const fn set_twedel(&mut self, value: u8) {
26752        let offset = Self::TWEDEL_SHIFT;
26753        assert!(value & (Self::TWEDEL_MASK as u8) == value);
26754        *self = Self::from_bits_retain(
26755            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
26756        );
26757    }
26758
26759    /// Returns a copy with the `TWEDEL` field set to the given value.
26760    pub const fn with_twedel(mut self, value: u8) -> Self {
26761        self.set_twedel(value);
26762        self
26763    }
26764}
26765
26766bitflags! {
26767    /// `SCTLR` system register value.
26768    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26769    #[repr(transparent)]
26770    pub struct Sctlr: u32 {
26771        /// RES1 bits in the `SCTLR` register.
26772        const RES1 = 0b10000000000100000000000;
26773        /// `M` bit.
26774        const M = 1 << 0;
26775        /// `A` bit.
26776        const A = 1 << 1;
26777        /// `C` bit.
26778        const C = 1 << 2;
26779        /// `nTLSMD` bit.
26780        const NTLSMD = 1 << 3;
26781        /// `LSMAOE` bit.
26782        const LSMAOE = 1 << 4;
26783        /// `CP15BEN` bit.
26784        const CP15BEN = 1 << 5;
26785        /// `UNK` bit.
26786        const UNK = 1 << 6;
26787        /// `ITD` bit.
26788        const ITD = 1 << 7;
26789        /// `SED` bit.
26790        const SED = 1 << 8;
26791        /// `EnRCTX` bit.
26792        const ENRCTX = 1 << 10;
26793        /// `I` bit.
26794        const I = 1 << 12;
26795        /// `V` bit.
26796        const V = 1 << 13;
26797        /// `nTWI` bit.
26798        const NTWI = 1 << 16;
26799        /// `nTWE` bit.
26800        const NTWE = 1 << 18;
26801        /// `WXN` bit.
26802        const WXN = 1 << 19;
26803        /// `UWXN` bit.
26804        const UWXN = 1 << 20;
26805        /// `SPAN` bit.
26806        const SPAN = 1 << 23;
26807        /// `EE` bit.
26808        const EE = 1 << 25;
26809        /// `TRE` bit.
26810        const TRE = 1 << 28;
26811        /// `AFE` bit.
26812        const AFE = 1 << 29;
26813        /// `TE` bit.
26814        const TE = 1 << 30;
26815        /// `DSSBS` bit.
26816        const DSSBS = 1 << 31;
26817    }
26818}
26819
26820impl Sctlr {
26821    /// Offset of the `M` field.
26822    pub const M_SHIFT: u32 = 0;
26823    /// Offset of the `A` field.
26824    pub const A_SHIFT: u32 = 1;
26825    /// Offset of the `C` field.
26826    pub const C_SHIFT: u32 = 2;
26827    /// Offset of the `nTLSMD` field.
26828    pub const NTLSMD_SHIFT: u32 = 3;
26829    /// Offset of the `LSMAOE` field.
26830    pub const LSMAOE_SHIFT: u32 = 4;
26831    /// Offset of the `CP15BEN` field.
26832    pub const CP15BEN_SHIFT: u32 = 5;
26833    /// Offset of the `UNK` field.
26834    pub const UNK_SHIFT: u32 = 6;
26835    /// Offset of the `ITD` field.
26836    pub const ITD_SHIFT: u32 = 7;
26837    /// Offset of the `SED` field.
26838    pub const SED_SHIFT: u32 = 8;
26839    /// Offset of the `EnRCTX` field.
26840    pub const ENRCTX_SHIFT: u32 = 10;
26841    /// Offset of the `I` field.
26842    pub const I_SHIFT: u32 = 12;
26843    /// Offset of the `V` field.
26844    pub const V_SHIFT: u32 = 13;
26845    /// Offset of the `nTWI` field.
26846    pub const NTWI_SHIFT: u32 = 16;
26847    /// Offset of the `nTWE` field.
26848    pub const NTWE_SHIFT: u32 = 18;
26849    /// Offset of the `WXN` field.
26850    pub const WXN_SHIFT: u32 = 19;
26851    /// Offset of the `UWXN` field.
26852    pub const UWXN_SHIFT: u32 = 20;
26853    /// Offset of the `SPAN` field.
26854    pub const SPAN_SHIFT: u32 = 23;
26855    /// Offset of the `EE` field.
26856    pub const EE_SHIFT: u32 = 25;
26857    /// Offset of the `TRE` field.
26858    pub const TRE_SHIFT: u32 = 28;
26859    /// Offset of the `AFE` field.
26860    pub const AFE_SHIFT: u32 = 29;
26861    /// Offset of the `TE` field.
26862    pub const TE_SHIFT: u32 = 30;
26863    /// Offset of the `DSSBS` field.
26864    pub const DSSBS_SHIFT: u32 = 31;
26865}
26866
26867#[cfg(feature = "el3")]
26868bitflags! {
26869    /// `SCTLR2_EL3` system register value.
26870    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26871    #[repr(transparent)]
26872    pub struct Sctlr2El3: u64 {
26873        /// `EMEC` bit.
26874        const EMEC = 1 << 1;
26875        /// `EnADERR` bit.
26876        const ENADERR = 1 << 3;
26877        /// `EnANERR` bit.
26878        const ENANERR = 1 << 4;
26879        /// `EnPACM` bit.
26880        const ENPACM = 1 << 7;
26881        /// `CPTA` bit.
26882        const CPTA = 1 << 9;
26883        /// `CPTM` bit.
26884        const CPTM = 1 << 11;
26885        /// `DTZ` bit.
26886        const DTZ = 1 << 14;
26887        /// `TEIS` bit.
26888        const TEIS = 1 << 15;
26889        /// `TEOS` bit.
26890        const TEOS = 1 << 16;
26891        /// `VT` bit.
26892        const VT = 1 << 17;
26893        /// `BTD` bit.
26894        const BTD = 1 << 24;
26895    }
26896}
26897
26898#[cfg(feature = "el3")]
26899impl Sctlr2El3 {
26900    /// Offset of the `EMEC` field.
26901    pub const EMEC_SHIFT: u32 = 1;
26902    /// Offset of the `EnADERR` field.
26903    pub const ENADERR_SHIFT: u32 = 3;
26904    /// Offset of the `EnANERR` field.
26905    pub const ENANERR_SHIFT: u32 = 4;
26906    /// Offset of the `EnPACM` field.
26907    pub const ENPACM_SHIFT: u32 = 7;
26908    /// Offset of the `CPTA` field.
26909    pub const CPTA_SHIFT: u32 = 9;
26910    /// Offset of the `CPTM` field.
26911    pub const CPTM_SHIFT: u32 = 11;
26912    /// Offset of the `DTZ` field.
26913    pub const DTZ_SHIFT: u32 = 14;
26914    /// Offset of the `TEIS` field.
26915    pub const TEIS_SHIFT: u32 = 15;
26916    /// Offset of the `TEOS` field.
26917    pub const TEOS_SHIFT: u32 = 16;
26918    /// Offset of the `VT` field.
26919    pub const VT_SHIFT: u32 = 17;
26920    /// Offset of the `BTD` field.
26921    pub const BTD_SHIFT: u32 = 24;
26922}
26923
26924#[cfg(feature = "el1")]
26925bitflags! {
26926    /// `SCTLR_EL1` system register value.
26927    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26928    #[repr(transparent)]
26929    pub struct SctlrEl1: u64 {
26930        /// `M` bit.
26931        const M = 1 << 0;
26932        /// `A` bit.
26933        const A = 1 << 1;
26934        /// `C` bit.
26935        const C = 1 << 2;
26936        /// `SA` bit.
26937        const SA = 1 << 3;
26938        /// `SA0` bit.
26939        const SA0 = 1 << 4;
26940        /// `CP15BEN` bit.
26941        const CP15BEN = 1 << 5;
26942        /// `nAA` bit.
26943        const NAA = 1 << 6;
26944        /// `ITD` bit.
26945        const ITD = 1 << 7;
26946        /// `SED` bit.
26947        const SED = 1 << 8;
26948        /// `UMA` bit.
26949        const UMA = 1 << 9;
26950        /// `EnRCTX` bit.
26951        const ENRCTX = 1 << 10;
26952        /// `EOS` bit.
26953        const EOS = 1 << 11;
26954        /// `I` bit.
26955        const I = 1 << 12;
26956        /// `EnDB` bit.
26957        const ENDB = 1 << 13;
26958        /// `DZE` bit.
26959        const DZE = 1 << 14;
26960        /// `UCT` bit.
26961        const UCT = 1 << 15;
26962        /// `nTWI` bit.
26963        const NTWI = 1 << 16;
26964        /// `nTWE` bit.
26965        const NTWE = 1 << 18;
26966        /// `WXN` bit.
26967        const WXN = 1 << 19;
26968        /// `TSCXT` bit.
26969        const TSCXT = 1 << 20;
26970        /// `IESB` bit.
26971        const IESB = 1 << 21;
26972        /// `EIS` bit.
26973        const EIS = 1 << 22;
26974        /// Do not set Privileged Access Never, on taking an exception to EL1.
26975        const SPAN = 1 << 23;
26976        /// `UCI` bit.
26977        const UCI = 1 << 26;
26978        /// `EnDA` bit.
26979        const ENDA = 1 << 27;
26980        /// `nTLSMD` bit.
26981        const NTLSMD = 1 << 28;
26982        /// `LSMAOE` bit.
26983        const LSMAOE = 1 << 29;
26984        /// Enable pointer authentication using APIBKey_EL1.
26985        const ENIB = 1 << 30;
26986        /// Enable pointer authentication using APIAKey_EL1.
26987        const ENIA = 1 << 31;
26988        /// `CMOW` bit.
26989        const CMOW = 1 << 32;
26990        /// `MSCEn` bit.
26991        const MSCEN = 1 << 33;
26992        /// `EnFPM` bit.
26993        const ENFPM = 1 << 34;
26994        /// `BT0` bit.
26995        const BT0 = 1 << 35;
26996        /// `BT1` bit.
26997        const BT1 = 1 << 36;
26998        /// `ITFSB` bit.
26999        const ITFSB = 1 << 37;
27000        /// `ATA0` bit.
27001        const ATA0 = 1 << 42;
27002        /// `ATA` bit.
27003        const ATA = 1 << 43;
27004        /// Default PSTATE.SSBS value on Exception Entry.
27005        const DSSBS = 1 << 44;
27006        /// `TWEDEn` bit.
27007        const TWEDEN = 1 << 45;
27008        /// `EnASR` bit.
27009        const ENASR = 1 << 54;
27010        /// `EnAS0` bit.
27011        const ENAS0 = 1 << 55;
27012        /// `EnALS` bit.
27013        const ENALS = 1 << 56;
27014        /// `EPAN` bit.
27015        const EPAN = 1 << 57;
27016        /// `TCSO0` bit.
27017        const TCSO0 = 1 << 58;
27018        /// `TCSO` bit.
27019        const TCSO = 1 << 59;
27020        /// `EnTP2` bit.
27021        const ENTP2 = 1 << 60;
27022        /// `NMI` bit.
27023        const NMI = 1 << 61;
27024        /// SP Interrupt Mask enable.
27025        const SPINTMASK = 1 << 62;
27026        /// `TIDCP` bit.
27027        const TIDCP = 1 << 63;
27028    }
27029}
27030
27031#[cfg(feature = "el1")]
27032impl SctlrEl1 {
27033    /// Offset of the `M` field.
27034    pub const M_SHIFT: u32 = 0;
27035    /// Offset of the `A` field.
27036    pub const A_SHIFT: u32 = 1;
27037    /// Offset of the `C` field.
27038    pub const C_SHIFT: u32 = 2;
27039    /// Offset of the `SA` field.
27040    pub const SA_SHIFT: u32 = 3;
27041    /// Offset of the `SA0` field.
27042    pub const SA0_SHIFT: u32 = 4;
27043    /// Offset of the `CP15BEN` field.
27044    pub const CP15BEN_SHIFT: u32 = 5;
27045    /// Offset of the `nAA` field.
27046    pub const NAA_SHIFT: u32 = 6;
27047    /// Offset of the `ITD` field.
27048    pub const ITD_SHIFT: u32 = 7;
27049    /// Offset of the `SED` field.
27050    pub const SED_SHIFT: u32 = 8;
27051    /// Offset of the `UMA` field.
27052    pub const UMA_SHIFT: u32 = 9;
27053    /// Offset of the `EnRCTX` field.
27054    pub const ENRCTX_SHIFT: u32 = 10;
27055    /// Offset of the `EOS` field.
27056    pub const EOS_SHIFT: u32 = 11;
27057    /// Offset of the `I` field.
27058    pub const I_SHIFT: u32 = 12;
27059    /// Offset of the `EnDB` field.
27060    pub const ENDB_SHIFT: u32 = 13;
27061    /// Offset of the `DZE` field.
27062    pub const DZE_SHIFT: u32 = 14;
27063    /// Offset of the `UCT` field.
27064    pub const UCT_SHIFT: u32 = 15;
27065    /// Offset of the `nTWI` field.
27066    pub const NTWI_SHIFT: u32 = 16;
27067    /// Offset of the `nTWE` field.
27068    pub const NTWE_SHIFT: u32 = 18;
27069    /// Offset of the `WXN` field.
27070    pub const WXN_SHIFT: u32 = 19;
27071    /// Offset of the `TSCXT` field.
27072    pub const TSCXT_SHIFT: u32 = 20;
27073    /// Offset of the `IESB` field.
27074    pub const IESB_SHIFT: u32 = 21;
27075    /// Offset of the `EIS` field.
27076    pub const EIS_SHIFT: u32 = 22;
27077    /// Offset of the `SPAN` field.
27078    pub const SPAN_SHIFT: u32 = 23;
27079    /// Offset of the `UCI` field.
27080    pub const UCI_SHIFT: u32 = 26;
27081    /// Offset of the `EnDA` field.
27082    pub const ENDA_SHIFT: u32 = 27;
27083    /// Offset of the `nTLSMD` field.
27084    pub const NTLSMD_SHIFT: u32 = 28;
27085    /// Offset of the `LSMAOE` field.
27086    pub const LSMAOE_SHIFT: u32 = 29;
27087    /// Offset of the `EnIB` field.
27088    pub const ENIB_SHIFT: u32 = 30;
27089    /// Offset of the `EnIA` field.
27090    pub const ENIA_SHIFT: u32 = 31;
27091    /// Offset of the `CMOW` field.
27092    pub const CMOW_SHIFT: u32 = 32;
27093    /// Offset of the `MSCEn` field.
27094    pub const MSCEN_SHIFT: u32 = 33;
27095    /// Offset of the `EnFPM` field.
27096    pub const ENFPM_SHIFT: u32 = 34;
27097    /// Offset of the `BT0` field.
27098    pub const BT0_SHIFT: u32 = 35;
27099    /// Offset of the `BT1` field.
27100    pub const BT1_SHIFT: u32 = 36;
27101    /// Offset of the `ITFSB` field.
27102    pub const ITFSB_SHIFT: u32 = 37;
27103    /// Offset of the `TCF0` field.
27104    pub const TCF0_SHIFT: u32 = 38;
27105    /// Mask for the `TCF0` field.
27106    pub const TCF0_MASK: u64 = 0b11;
27107    /// Offset of the `TCF` field.
27108    pub const TCF_SHIFT: u32 = 40;
27109    /// Mask for the `TCF` field.
27110    pub const TCF_MASK: u64 = 0b11;
27111    /// Offset of the `ATA0` field.
27112    pub const ATA0_SHIFT: u32 = 42;
27113    /// Offset of the `ATA` field.
27114    pub const ATA_SHIFT: u32 = 43;
27115    /// Offset of the `DSSBS` field.
27116    pub const DSSBS_SHIFT: u32 = 44;
27117    /// Offset of the `TWEDEn` field.
27118    pub const TWEDEN_SHIFT: u32 = 45;
27119    /// Offset of the `TWEDEL` field.
27120    pub const TWEDEL_SHIFT: u32 = 46;
27121    /// Mask for the `TWEDEL` field.
27122    pub const TWEDEL_MASK: u64 = 0b1111;
27123    /// Offset of the `EnASR` field.
27124    pub const ENASR_SHIFT: u32 = 54;
27125    /// Offset of the `EnAS0` field.
27126    pub const ENAS0_SHIFT: u32 = 55;
27127    /// Offset of the `EnALS` field.
27128    pub const ENALS_SHIFT: u32 = 56;
27129    /// Offset of the `EPAN` field.
27130    pub const EPAN_SHIFT: u32 = 57;
27131    /// Offset of the `TCSO0` field.
27132    pub const TCSO0_SHIFT: u32 = 58;
27133    /// Offset of the `TCSO` field.
27134    pub const TCSO_SHIFT: u32 = 59;
27135    /// Offset of the `EnTP2` field.
27136    pub const ENTP2_SHIFT: u32 = 60;
27137    /// Offset of the `NMI` field.
27138    pub const NMI_SHIFT: u32 = 61;
27139    /// Offset of the `SPINTMASK` field.
27140    pub const SPINTMASK_SHIFT: u32 = 62;
27141    /// Offset of the `TIDCP` field.
27142    pub const TIDCP_SHIFT: u32 = 63;
27143
27144    /// Returns the value of the `TCF0` field.
27145    pub const fn tcf0(self) -> u8 {
27146        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
27147    }
27148
27149    /// Sets the value of the `TCF0` field.
27150    pub const fn set_tcf0(&mut self, value: u8) {
27151        let offset = Self::TCF0_SHIFT;
27152        assert!(value & (Self::TCF0_MASK as u8) == value);
27153        *self = Self::from_bits_retain(
27154            (self.bits() & !(Self::TCF0_MASK << offset)) | ((value as u64) << offset),
27155        );
27156    }
27157
27158    /// Returns a copy with the `TCF0` field set to the given value.
27159    pub const fn with_tcf0(mut self, value: u8) -> Self {
27160        self.set_tcf0(value);
27161        self
27162    }
27163
27164    /// Returns the value of the `TCF` field.
27165    pub const fn tcf(self) -> u8 {
27166        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
27167    }
27168
27169    /// Sets the value of the `TCF` field.
27170    pub const fn set_tcf(&mut self, value: u8) {
27171        let offset = Self::TCF_SHIFT;
27172        assert!(value & (Self::TCF_MASK as u8) == value);
27173        *self = Self::from_bits_retain(
27174            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
27175        );
27176    }
27177
27178    /// Returns a copy with the `TCF` field set to the given value.
27179    pub const fn with_tcf(mut self, value: u8) -> Self {
27180        self.set_tcf(value);
27181        self
27182    }
27183
27184    /// Returns the value of the `TWEDEL` field.
27185    pub const fn twedel(self) -> u8 {
27186        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
27187    }
27188
27189    /// Sets the value of the `TWEDEL` field.
27190    pub const fn set_twedel(&mut self, value: u8) {
27191        let offset = Self::TWEDEL_SHIFT;
27192        assert!(value & (Self::TWEDEL_MASK as u8) == value);
27193        *self = Self::from_bits_retain(
27194            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
27195        );
27196    }
27197
27198    /// Returns a copy with the `TWEDEL` field set to the given value.
27199    pub const fn with_twedel(mut self, value: u8) -> Self {
27200        self.set_twedel(value);
27201        self
27202    }
27203}
27204
27205#[cfg(feature = "el2")]
27206bitflags! {
27207    /// `SCTLR_EL2` system register value.
27208    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27209    #[repr(transparent)]
27210    pub struct SctlrEl2: u64 {
27211        /// `M` bit.
27212        const M = 1 << 0;
27213        /// `A` bit.
27214        const A = 1 << 1;
27215        /// `C` bit.
27216        const C = 1 << 2;
27217        /// `SA` bit.
27218        const SA = 1 << 3;
27219        /// `SA0` bit.
27220        const SA0 = 1 << 4;
27221        /// `CP15BEN` bit.
27222        const CP15BEN = 1 << 5;
27223        /// `nAA` bit.
27224        const NAA = 1 << 6;
27225        /// `SED` bit.
27226        const SED = 1 << 8;
27227        /// `UMA` bit.
27228        const UMA = 1 << 9;
27229        /// `EnRCTX` bit.
27230        const ENRCTX = 1 << 10;
27231        /// `EOS` bit.
27232        const EOS = 1 << 11;
27233        /// `I` bit.
27234        const I = 1 << 12;
27235        /// `EnDB` bit.
27236        const ENDB = 1 << 13;
27237        /// `DZE` bit.
27238        const DZE = 1 << 14;
27239        /// `UCT` bit.
27240        const UCT = 1 << 15;
27241        /// `nTWI` bit.
27242        const NTWI = 1 << 16;
27243        /// `nTWE` bit.
27244        const NTWE = 1 << 18;
27245        /// `WXN` bit.
27246        const WXN = 1 << 19;
27247        /// `IESB` bit.
27248        const IESB = 1 << 21;
27249        /// `EIS` bit.
27250        const EIS = 1 << 22;
27251        /// Do not set Privileged Access Never, on taking an exception to EL2.
27252        const SPAN = 1 << 23;
27253        /// `UCI` bit.
27254        const UCI = 1 << 26;
27255        /// `EnDA` bit.
27256        const ENDA = 1 << 27;
27257        /// `nTLSMD` bit.
27258        const NTLSMD = 1 << 28;
27259        /// `LSMAOE` bit.
27260        const LSMAOE = 1 << 29;
27261        /// Enable pointer authentication using APIBKey_EL1.
27262        const ENIB = 1 << 30;
27263        /// Enable pointer authentication using APIAKey_EL1.
27264        const ENIA = 1 << 31;
27265        /// `CMOW` bit.
27266        const CMOW = 1 << 32;
27267        /// `MSCEn` bit.
27268        const MSCEN = 1 << 33;
27269        /// `EnFPM` bit.
27270        const ENFPM = 1 << 34;
27271        /// `BT0` bit.
27272        const BT0 = 1 << 35;
27273        /// `BT` bit.
27274        const BT = 1 << 36;
27275        /// `ITFSB` bit.
27276        const ITFSB = 1 << 37;
27277        /// `ATA0` bit.
27278        const ATA0 = 1 << 42;
27279        /// `ATA` bit.
27280        const ATA = 1 << 43;
27281        /// Default PSTATE.SSBS value on Exception Entry.
27282        const DSSBS = 1 << 44;
27283        /// `TWEDEn` bit.
27284        const TWEDEN = 1 << 45;
27285        /// `EnASR` bit.
27286        const ENASR = 1 << 54;
27287        /// `EnAS0` bit.
27288        const ENAS0 = 1 << 55;
27289        /// `EnALS` bit.
27290        const ENALS = 1 << 56;
27291        /// `EPAN` bit.
27292        const EPAN = 1 << 57;
27293        /// `TCSO0` bit.
27294        const TCSO0 = 1 << 58;
27295        /// `TCSO` bit.
27296        const TCSO = 1 << 59;
27297        /// `EnTP2` bit.
27298        const ENTP2 = 1 << 60;
27299        /// `NMI` bit.
27300        const NMI = 1 << 61;
27301        /// SP Interrupt Mask enable.
27302        const SPINTMASK = 1 << 62;
27303        /// `TIDCP` bit.
27304        const TIDCP = 1 << 63;
27305    }
27306}
27307
27308#[cfg(feature = "el2")]
27309impl SctlrEl2 {
27310    /// Offset of the `M` field.
27311    pub const M_SHIFT: u32 = 0;
27312    /// Offset of the `A` field.
27313    pub const A_SHIFT: u32 = 1;
27314    /// Offset of the `C` field.
27315    pub const C_SHIFT: u32 = 2;
27316    /// Offset of the `SA` field.
27317    pub const SA_SHIFT: u32 = 3;
27318    /// Offset of the `SA0` field.
27319    pub const SA0_SHIFT: u32 = 4;
27320    /// Offset of the `CP15BEN` field.
27321    pub const CP15BEN_SHIFT: u32 = 5;
27322    /// Offset of the `nAA` field.
27323    pub const NAA_SHIFT: u32 = 6;
27324    /// Offset of the `SED` field.
27325    pub const SED_SHIFT: u32 = 8;
27326    /// Offset of the `UMA` field.
27327    pub const UMA_SHIFT: u32 = 9;
27328    /// Offset of the `EnRCTX` field.
27329    pub const ENRCTX_SHIFT: u32 = 10;
27330    /// Offset of the `EOS` field.
27331    pub const EOS_SHIFT: u32 = 11;
27332    /// Offset of the `I` field.
27333    pub const I_SHIFT: u32 = 12;
27334    /// Offset of the `EnDB` field.
27335    pub const ENDB_SHIFT: u32 = 13;
27336    /// Offset of the `DZE` field.
27337    pub const DZE_SHIFT: u32 = 14;
27338    /// Offset of the `UCT` field.
27339    pub const UCT_SHIFT: u32 = 15;
27340    /// Offset of the `nTWI` field.
27341    pub const NTWI_SHIFT: u32 = 16;
27342    /// Offset of the `nTWE` field.
27343    pub const NTWE_SHIFT: u32 = 18;
27344    /// Offset of the `WXN` field.
27345    pub const WXN_SHIFT: u32 = 19;
27346    /// Offset of the `IESB` field.
27347    pub const IESB_SHIFT: u32 = 21;
27348    /// Offset of the `EIS` field.
27349    pub const EIS_SHIFT: u32 = 22;
27350    /// Offset of the `SPAN` field.
27351    pub const SPAN_SHIFT: u32 = 23;
27352    /// Offset of the `UCI` field.
27353    pub const UCI_SHIFT: u32 = 26;
27354    /// Offset of the `EnDA` field.
27355    pub const ENDA_SHIFT: u32 = 27;
27356    /// Offset of the `nTLSMD` field.
27357    pub const NTLSMD_SHIFT: u32 = 28;
27358    /// Offset of the `LSMAOE` field.
27359    pub const LSMAOE_SHIFT: u32 = 29;
27360    /// Offset of the `EnIB` field.
27361    pub const ENIB_SHIFT: u32 = 30;
27362    /// Offset of the `EnIA` field.
27363    pub const ENIA_SHIFT: u32 = 31;
27364    /// Offset of the `CMOW` field.
27365    pub const CMOW_SHIFT: u32 = 32;
27366    /// Offset of the `MSCEn` field.
27367    pub const MSCEN_SHIFT: u32 = 33;
27368    /// Offset of the `EnFPM` field.
27369    pub const ENFPM_SHIFT: u32 = 34;
27370    /// Offset of the `BT0` field.
27371    pub const BT0_SHIFT: u32 = 35;
27372    /// Offset of the `BT` field.
27373    pub const BT_SHIFT: u32 = 36;
27374    /// Offset of the `ITFSB` field.
27375    pub const ITFSB_SHIFT: u32 = 37;
27376    /// Offset of the `TCF0` field.
27377    pub const TCF0_SHIFT: u32 = 38;
27378    /// Mask for the `TCF0` field.
27379    pub const TCF0_MASK: u64 = 0b11;
27380    /// Offset of the `TCF` field.
27381    pub const TCF_SHIFT: u32 = 40;
27382    /// Mask for the `TCF` field.
27383    pub const TCF_MASK: u64 = 0b11;
27384    /// Offset of the `ATA0` field.
27385    pub const ATA0_SHIFT: u32 = 42;
27386    /// Offset of the `ATA` field.
27387    pub const ATA_SHIFT: u32 = 43;
27388    /// Offset of the `DSSBS` field.
27389    pub const DSSBS_SHIFT: u32 = 44;
27390    /// Offset of the `TWEDEn` field.
27391    pub const TWEDEN_SHIFT: u32 = 45;
27392    /// Offset of the `TWEDEL` field.
27393    pub const TWEDEL_SHIFT: u32 = 46;
27394    /// Mask for the `TWEDEL` field.
27395    pub const TWEDEL_MASK: u64 = 0b1111;
27396    /// Offset of the `EnASR` field.
27397    pub const ENASR_SHIFT: u32 = 54;
27398    /// Offset of the `EnAS0` field.
27399    pub const ENAS0_SHIFT: u32 = 55;
27400    /// Offset of the `EnALS` field.
27401    pub const ENALS_SHIFT: u32 = 56;
27402    /// Offset of the `EPAN` field.
27403    pub const EPAN_SHIFT: u32 = 57;
27404    /// Offset of the `TCSO0` field.
27405    pub const TCSO0_SHIFT: u32 = 58;
27406    /// Offset of the `TCSO` field.
27407    pub const TCSO_SHIFT: u32 = 59;
27408    /// Offset of the `EnTP2` field.
27409    pub const ENTP2_SHIFT: u32 = 60;
27410    /// Offset of the `NMI` field.
27411    pub const NMI_SHIFT: u32 = 61;
27412    /// Offset of the `SPINTMASK` field.
27413    pub const SPINTMASK_SHIFT: u32 = 62;
27414    /// Offset of the `TIDCP` field.
27415    pub const TIDCP_SHIFT: u32 = 63;
27416
27417    /// Returns the value of the `TCF0` field.
27418    pub const fn tcf0(self) -> u8 {
27419        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
27420    }
27421
27422    /// Sets the value of the `TCF0` field.
27423    pub const fn set_tcf0(&mut self, value: u8) {
27424        let offset = Self::TCF0_SHIFT;
27425        assert!(value & (Self::TCF0_MASK as u8) == value);
27426        *self = Self::from_bits_retain(
27427            (self.bits() & !(Self::TCF0_MASK << offset)) | ((value as u64) << offset),
27428        );
27429    }
27430
27431    /// Returns a copy with the `TCF0` field set to the given value.
27432    pub const fn with_tcf0(mut self, value: u8) -> Self {
27433        self.set_tcf0(value);
27434        self
27435    }
27436
27437    /// Returns the value of the `TCF` field.
27438    pub const fn tcf(self) -> u8 {
27439        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
27440    }
27441
27442    /// Sets the value of the `TCF` field.
27443    pub const fn set_tcf(&mut self, value: u8) {
27444        let offset = Self::TCF_SHIFT;
27445        assert!(value & (Self::TCF_MASK as u8) == value);
27446        *self = Self::from_bits_retain(
27447            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
27448        );
27449    }
27450
27451    /// Returns a copy with the `TCF` field set to the given value.
27452    pub const fn with_tcf(mut self, value: u8) -> Self {
27453        self.set_tcf(value);
27454        self
27455    }
27456
27457    /// Returns the value of the `TWEDEL` field.
27458    pub const fn twedel(self) -> u8 {
27459        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
27460    }
27461
27462    /// Sets the value of the `TWEDEL` field.
27463    pub const fn set_twedel(&mut self, value: u8) {
27464        let offset = Self::TWEDEL_SHIFT;
27465        assert!(value & (Self::TWEDEL_MASK as u8) == value);
27466        *self = Self::from_bits_retain(
27467            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
27468        );
27469    }
27470
27471    /// Returns a copy with the `TWEDEL` field set to the given value.
27472    pub const fn with_twedel(mut self, value: u8) -> Self {
27473        self.set_twedel(value);
27474        self
27475    }
27476}
27477
27478#[cfg(feature = "el3")]
27479bitflags! {
27480    /// `SCTLR_EL3` system register value.
27481    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27482    #[repr(transparent)]
27483    pub struct SctlrEl3: u64 {
27484        /// RES1 bits in the `SCTLR_EL3` register.
27485        const RES1 = 0b110000100001010000000000110000;
27486        /// MMU enable for EL3 stage 1 address translation.
27487        const M = 1 << 0;
27488        /// Alignment check enable.
27489        const A = 1 << 1;
27490        /// Cacheability control, for data accesses at EL3.
27491        const C = 1 << 2;
27492        /// SP alignment check enable.
27493        const SA = 1 << 3;
27494        /// `nAA` bit.
27495        const NAA = 1 << 6;
27496        /// `EOS` bit.
27497        const EOS = 1 << 11;
27498        /// Cacheability control, for instruction accesses at EL3.
27499        const I = 1 << 12;
27500        /// `EnDB` bit.
27501        const ENDB = 1 << 13;
27502        /// 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.
27503        const WXN = 1 << 19;
27504        /// Enable Implicit Error Synchronization events.
27505        const IESB = 1 << 21;
27506        /// `EIS` bit.
27507        const EIS = 1 << 22;
27508        /// `EnDA` bit.
27509        const ENDA = 1 << 27;
27510        /// Enable pointer authentication using APIBKey_EL1.
27511        const ENIB = 1 << 30;
27512        /// Enable pointer authentication using APIAKey_EL1.
27513        const ENIA = 1 << 31;
27514        /// `BT` bit.
27515        const BT = 1 << 36;
27516        /// `ITFSB` bit.
27517        const ITFSB = 1 << 37;
27518        /// `ATA` bit.
27519        const ATA = 1 << 43;
27520        /// `DSSBS` bit.
27521        const DSSBS = 1 << 44;
27522        /// `TCSO` bit.
27523        const TCSO = 1 << 59;
27524        /// `NMI` bit.
27525        const NMI = 1 << 61;
27526        /// `SPINTMASK` bit.
27527        const SPINTMASK = 1 << 62;
27528    }
27529}
27530
27531#[cfg(feature = "el3")]
27532impl SctlrEl3 {
27533    /// Offset of the `M` field.
27534    pub const M_SHIFT: u32 = 0;
27535    /// Offset of the `A` field.
27536    pub const A_SHIFT: u32 = 1;
27537    /// Offset of the `C` field.
27538    pub const C_SHIFT: u32 = 2;
27539    /// Offset of the `SA` field.
27540    pub const SA_SHIFT: u32 = 3;
27541    /// Offset of the `nAA` field.
27542    pub const NAA_SHIFT: u32 = 6;
27543    /// Offset of the `EOS` field.
27544    pub const EOS_SHIFT: u32 = 11;
27545    /// Offset of the `I` field.
27546    pub const I_SHIFT: u32 = 12;
27547    /// Offset of the `EnDB` field.
27548    pub const ENDB_SHIFT: u32 = 13;
27549    /// Offset of the `WXN` field.
27550    pub const WXN_SHIFT: u32 = 19;
27551    /// Offset of the `IESB` field.
27552    pub const IESB_SHIFT: u32 = 21;
27553    /// Offset of the `EIS` field.
27554    pub const EIS_SHIFT: u32 = 22;
27555    /// Offset of the `EnDA` field.
27556    pub const ENDA_SHIFT: u32 = 27;
27557    /// Offset of the `EnIB` field.
27558    pub const ENIB_SHIFT: u32 = 30;
27559    /// Offset of the `EnIA` field.
27560    pub const ENIA_SHIFT: u32 = 31;
27561    /// Offset of the `BT` field.
27562    pub const BT_SHIFT: u32 = 36;
27563    /// Offset of the `ITFSB` field.
27564    pub const ITFSB_SHIFT: u32 = 37;
27565    /// Offset of the `TCF` field.
27566    pub const TCF_SHIFT: u32 = 40;
27567    /// Mask for the `TCF` field.
27568    pub const TCF_MASK: u64 = 0b11;
27569    /// Offset of the `ATA` field.
27570    pub const ATA_SHIFT: u32 = 43;
27571    /// Offset of the `DSSBS` field.
27572    pub const DSSBS_SHIFT: u32 = 44;
27573    /// Offset of the `TCSO` field.
27574    pub const TCSO_SHIFT: u32 = 59;
27575    /// Offset of the `NMI` field.
27576    pub const NMI_SHIFT: u32 = 61;
27577    /// Offset of the `SPINTMASK` field.
27578    pub const SPINTMASK_SHIFT: u32 = 62;
27579
27580    /// Returns the value of the `TCF` field.
27581    pub const fn tcf(self) -> u8 {
27582        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
27583    }
27584
27585    /// Sets the value of the `TCF` field.
27586    pub const fn set_tcf(&mut self, value: u8) {
27587        let offset = Self::TCF_SHIFT;
27588        assert!(value & (Self::TCF_MASK as u8) == value);
27589        *self = Self::from_bits_retain(
27590            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
27591        );
27592    }
27593
27594    /// Returns a copy with the `TCF` field set to the given value.
27595    pub const fn with_tcf(mut self, value: u8) -> Self {
27596        self.set_tcf(value);
27597        self
27598    }
27599}
27600
27601bitflags! {
27602    /// `SDCR` system register value.
27603    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27604    #[repr(transparent)]
27605    pub struct Sdcr: u32 {
27606        /// `SPME` bit.
27607        const SPME = 1 << 17;
27608        /// `STE` bit.
27609        const STE = 1 << 18;
27610        /// `TTRF` bit.
27611        const TTRF = 1 << 19;
27612        /// `EDAD` bit.
27613        const EDAD = 1 << 20;
27614        /// `EPMAD` bit.
27615        const EPMAD = 1 << 21;
27616        /// `SCCD` bit.
27617        const SCCD = 1 << 23;
27618        /// `TDCC` bit.
27619        const TDCC = 1 << 27;
27620        /// `MTPME` bit.
27621        const MTPME = 1 << 28;
27622    }
27623}
27624
27625impl Sdcr {
27626    /// Offset of the `SPD` field.
27627    pub const SPD_SHIFT: u32 = 14;
27628    /// Mask for the `SPD` field.
27629    pub const SPD_MASK: u32 = 0b11;
27630    /// Offset of the `SPME` field.
27631    pub const SPME_SHIFT: u32 = 17;
27632    /// Offset of the `STE` field.
27633    pub const STE_SHIFT: u32 = 18;
27634    /// Offset of the `TTRF` field.
27635    pub const TTRF_SHIFT: u32 = 19;
27636    /// Offset of the `EDAD` field.
27637    pub const EDAD_SHIFT: u32 = 20;
27638    /// Offset of the `EPMAD` field.
27639    pub const EPMAD_SHIFT: u32 = 21;
27640    /// Offset of the `SCCD` field.
27641    pub const SCCD_SHIFT: u32 = 23;
27642    /// Offset of the `TDCC` field.
27643    pub const TDCC_SHIFT: u32 = 27;
27644    /// Offset of the `MTPME` field.
27645    pub const MTPME_SHIFT: u32 = 28;
27646
27647    /// Returns the value of the `SPD` field.
27648    pub const fn spd(self) -> u8 {
27649        ((self.bits() >> Self::SPD_SHIFT) & 0b11) as u8
27650    }
27651
27652    /// Sets the value of the `SPD` field.
27653    pub const fn set_spd(&mut self, value: u8) {
27654        let offset = Self::SPD_SHIFT;
27655        assert!(value & (Self::SPD_MASK as u8) == value);
27656        *self = Self::from_bits_retain(
27657            (self.bits() & !(Self::SPD_MASK << offset)) | ((value as u32) << offset),
27658        );
27659    }
27660
27661    /// Returns a copy with the `SPD` field set to the given value.
27662    pub const fn with_spd(mut self, value: u8) -> Self {
27663        self.set_spd(value);
27664        self
27665    }
27666}
27667
27668bitflags! {
27669    /// `SDER` system register value.
27670    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27671    #[repr(transparent)]
27672    pub struct Sder: u32 {
27673        /// `SUIDEN` bit.
27674        const SUIDEN = 1 << 0;
27675        /// `SUNIDEN` bit.
27676        const SUNIDEN = 1 << 1;
27677    }
27678}
27679
27680impl Sder {
27681    /// Offset of the `SUIDEN` field.
27682    pub const SUIDEN_SHIFT: u32 = 0;
27683    /// Offset of the `SUNIDEN` field.
27684    pub const SUNIDEN_SHIFT: u32 = 1;
27685}
27686
27687#[cfg(feature = "el3")]
27688bitflags! {
27689    /// `SMCR_EL3` system register value.
27690    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27691    #[repr(transparent)]
27692    pub struct SmcrEl3: u64 {
27693        /// `EZT0` bit.
27694        const EZT0 = 1 << 30;
27695        /// `FA64` bit.
27696        const FA64 = 1 << 31;
27697    }
27698}
27699
27700#[cfg(feature = "el3")]
27701impl SmcrEl3 {
27702    /// Offset of the `LEN` field.
27703    pub const LEN_SHIFT: u32 = 0;
27704    /// Mask for the `LEN` field.
27705    pub const LEN_MASK: u64 = 0b1111;
27706    /// Offset of the `EZT0` field.
27707    pub const EZT0_SHIFT: u32 = 30;
27708    /// Offset of the `FA64` field.
27709    pub const FA64_SHIFT: u32 = 31;
27710
27711    /// Returns the value of the `LEN` field.
27712    pub const fn len(self) -> u8 {
27713        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
27714    }
27715
27716    /// Sets the value of the `LEN` field.
27717    pub const fn set_len(&mut self, value: u8) {
27718        let offset = Self::LEN_SHIFT;
27719        assert!(value & (Self::LEN_MASK as u8) == value);
27720        *self = Self::from_bits_retain(
27721            (self.bits() & !(Self::LEN_MASK << offset)) | ((value as u64) << offset),
27722        );
27723    }
27724
27725    /// Returns a copy with the `LEN` field set to the given value.
27726    pub const fn with_len(mut self, value: u8) -> Self {
27727        self.set_len(value);
27728        self
27729    }
27730}
27731
27732#[cfg(feature = "el1")]
27733bitflags! {
27734    /// `SPSR_EL1` system register value.
27735    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27736    #[repr(transparent)]
27737    pub struct SpsrEl1: u64 {
27738        /// `M[4]` bit.
27739        const M_4 = 1 << 4;
27740        /// `T` bit.
27741        const T = 1 << 5;
27742        /// `F` bit.
27743        const F = 1 << 6;
27744        /// `I` bit.
27745        const I = 1 << 7;
27746        /// `A` bit.
27747        const A = 1 << 8;
27748        /// `D` bit.
27749        const D = 1 << 9;
27750        /// `E` bit.
27751        const E = 1 << 9;
27752        /// `ALLINT` bit.
27753        const ALLINT = 1 << 13;
27754        /// `BTYPE2` bit.
27755        const BTYPE2 = 1 << 14;
27756        /// `IL` bit.
27757        const IL = 1 << 20;
27758        /// `SS` bit.
27759        const SS = 1 << 21;
27760        /// `PAN` bit.
27761        const PAN = 1 << 22;
27762        /// `UAO` bit.
27763        const UAO = 1 << 23;
27764        /// `DIT` bit.
27765        const DIT = 1 << 24;
27766        /// `TCO` bit.
27767        const TCO = 1 << 25;
27768        /// `Q` bit.
27769        const Q = 1 << 27;
27770        /// `V` bit.
27771        const V = 1 << 28;
27772        /// `C` bit.
27773        const C = 1 << 29;
27774        /// `Z` bit.
27775        const Z = 1 << 30;
27776        /// `N` bit.
27777        const N = 1 << 31;
27778        /// `PM` bit.
27779        const PM = 1 << 32;
27780        /// `PPEND` bit.
27781        const PPEND = 1 << 33;
27782        /// `EXLOCK` bit.
27783        const EXLOCK = 1 << 34;
27784        /// `PACM` bit.
27785        const PACM = 1 << 35;
27786        /// `UINJ` bit.
27787        const UINJ = 1 << 36;
27788    }
27789}
27790
27791#[cfg(feature = "el1")]
27792impl SpsrEl1 {
27793    /// Offset of the `M[3:0]` field.
27794    pub const M_3_0_SHIFT: u32 = 0;
27795    /// Mask for the `M[3:0]` field.
27796    pub const M_3_0_MASK: u64 = 0b1111;
27797    /// Offset of the `M[4]` field.
27798    pub const M_4_SHIFT: u32 = 4;
27799    /// Offset of the `T` field.
27800    pub const T_SHIFT: u32 = 5;
27801    /// Offset of the `F` field.
27802    pub const F_SHIFT: u32 = 6;
27803    /// Offset of the `I` field.
27804    pub const I_SHIFT: u32 = 7;
27805    /// Offset of the `A` field.
27806    pub const A_SHIFT: u32 = 8;
27807    /// Offset of the `D` field.
27808    pub const D_SHIFT: u32 = 9;
27809    /// Offset of the `E` field.
27810    pub const E_SHIFT: u32 = 9;
27811    /// Offset of the `BTYPE` field.
27812    pub const BTYPE_SHIFT: u32 = 10;
27813    /// Mask for the `BTYPE` field.
27814    pub const BTYPE_MASK: u64 = 0b11;
27815    /// Offset of the `ALLINT` field.
27816    pub const ALLINT_SHIFT: u32 = 13;
27817    /// Offset of the `BTYPE2` field.
27818    pub const BTYPE2_SHIFT: u32 = 14;
27819    /// Offset of the `GE` field.
27820    pub const GE_SHIFT: u32 = 16;
27821    /// Mask for the `GE` field.
27822    pub const GE_MASK: u64 = 0b1111;
27823    /// Offset of the `IL` field.
27824    pub const IL_SHIFT: u32 = 20;
27825    /// Offset of the `SS` field.
27826    pub const SS_SHIFT: u32 = 21;
27827    /// Offset of the `PAN` field.
27828    pub const PAN_SHIFT: u32 = 22;
27829    /// Offset of the `UAO` field.
27830    pub const UAO_SHIFT: u32 = 23;
27831    /// Offset of the `DIT` field.
27832    pub const DIT_SHIFT: u32 = 24;
27833    /// Offset of the `TCO` field.
27834    pub const TCO_SHIFT: u32 = 25;
27835    /// Offset of the `Q` field.
27836    pub const Q_SHIFT: u32 = 27;
27837    /// Offset of the `V` field.
27838    pub const V_SHIFT: u32 = 28;
27839    /// Offset of the `C` field.
27840    pub const C_SHIFT: u32 = 29;
27841    /// Offset of the `Z` field.
27842    pub const Z_SHIFT: u32 = 30;
27843    /// Offset of the `N` field.
27844    pub const N_SHIFT: u32 = 31;
27845    /// Offset of the `PM` field.
27846    pub const PM_SHIFT: u32 = 32;
27847    /// Offset of the `PPEND` field.
27848    pub const PPEND_SHIFT: u32 = 33;
27849    /// Offset of the `EXLOCK` field.
27850    pub const EXLOCK_SHIFT: u32 = 34;
27851    /// Offset of the `PACM` field.
27852    pub const PACM_SHIFT: u32 = 35;
27853    /// Offset of the `UINJ` field.
27854    pub const UINJ_SHIFT: u32 = 36;
27855
27856    /// Returns the value of the `M[3:0]` field.
27857    pub const fn m_3_0(self) -> u8 {
27858        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
27859    }
27860
27861    /// Sets the value of the `M[3:0]` field.
27862    pub const fn set_m_3_0(&mut self, value: u8) {
27863        let offset = Self::M_3_0_SHIFT;
27864        assert!(value & (Self::M_3_0_MASK as u8) == value);
27865        *self = Self::from_bits_retain(
27866            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
27867        );
27868    }
27869
27870    /// Returns a copy with the `M[3:0]` field set to the given value.
27871    pub const fn with_m_3_0(mut self, value: u8) -> Self {
27872        self.set_m_3_0(value);
27873        self
27874    }
27875
27876    /// Returns the value of the `BTYPE` field.
27877    pub const fn btype(self) -> u8 {
27878        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
27879    }
27880
27881    /// Sets the value of the `BTYPE` field.
27882    pub const fn set_btype(&mut self, value: u8) {
27883        let offset = Self::BTYPE_SHIFT;
27884        assert!(value & (Self::BTYPE_MASK as u8) == value);
27885        *self = Self::from_bits_retain(
27886            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
27887        );
27888    }
27889
27890    /// Returns a copy with the `BTYPE` field set to the given value.
27891    pub const fn with_btype(mut self, value: u8) -> Self {
27892        self.set_btype(value);
27893        self
27894    }
27895
27896    /// Returns the value of the `GE` field.
27897    pub const fn ge(self) -> u8 {
27898        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
27899    }
27900
27901    /// Sets the value of the `GE` field.
27902    pub const fn set_ge(&mut self, value: u8) {
27903        let offset = Self::GE_SHIFT;
27904        assert!(value & (Self::GE_MASK as u8) == value);
27905        *self = Self::from_bits_retain(
27906            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
27907        );
27908    }
27909
27910    /// Returns a copy with the `GE` field set to the given value.
27911    pub const fn with_ge(mut self, value: u8) -> Self {
27912        self.set_ge(value);
27913        self
27914    }
27915}
27916
27917#[cfg(feature = "el2")]
27918bitflags! {
27919    /// `SPSR_EL2` system register value.
27920    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27921    #[repr(transparent)]
27922    pub struct SpsrEl2: u64 {
27923        /// `M[4]` bit.
27924        const M_4 = 1 << 4;
27925        /// `T` bit.
27926        const T = 1 << 5;
27927        /// `F` bit.
27928        const F = 1 << 6;
27929        /// `I` bit.
27930        const I = 1 << 7;
27931        /// `A` bit.
27932        const A = 1 << 8;
27933        /// `D` bit.
27934        const D = 1 << 9;
27935        /// `E` bit.
27936        const E = 1 << 9;
27937        /// `ALLINT` bit.
27938        const ALLINT = 1 << 13;
27939        /// `BTYPE2` bit.
27940        const BTYPE2 = 1 << 14;
27941        /// `IL` bit.
27942        const IL = 1 << 20;
27943        /// `SS` bit.
27944        const SS = 1 << 21;
27945        /// `PAN` bit.
27946        const PAN = 1 << 22;
27947        /// `UAO` bit.
27948        const UAO = 1 << 23;
27949        /// `DIT` bit.
27950        const DIT = 1 << 24;
27951        /// `TCO` bit.
27952        const TCO = 1 << 25;
27953        /// `Q` bit.
27954        const Q = 1 << 27;
27955        /// `V` bit.
27956        const V = 1 << 28;
27957        /// `C` bit.
27958        const C = 1 << 29;
27959        /// `Z` bit.
27960        const Z = 1 << 30;
27961        /// `N` bit.
27962        const N = 1 << 31;
27963        /// `PM` bit.
27964        const PM = 1 << 32;
27965        /// `PPEND` bit.
27966        const PPEND = 1 << 33;
27967        /// `EXLOCK` bit.
27968        const EXLOCK = 1 << 34;
27969        /// `PACM` bit.
27970        const PACM = 1 << 35;
27971        /// `UINJ` bit.
27972        const UINJ = 1 << 36;
27973    }
27974}
27975
27976#[cfg(feature = "el2")]
27977impl SpsrEl2 {
27978    /// Offset of the `M[3:0]` field.
27979    pub const M_3_0_SHIFT: u32 = 0;
27980    /// Mask for the `M[3:0]` field.
27981    pub const M_3_0_MASK: u64 = 0b1111;
27982    /// Offset of the `M[4]` field.
27983    pub const M_4_SHIFT: u32 = 4;
27984    /// Offset of the `T` field.
27985    pub const T_SHIFT: u32 = 5;
27986    /// Offset of the `F` field.
27987    pub const F_SHIFT: u32 = 6;
27988    /// Offset of the `I` field.
27989    pub const I_SHIFT: u32 = 7;
27990    /// Offset of the `A` field.
27991    pub const A_SHIFT: u32 = 8;
27992    /// Offset of the `D` field.
27993    pub const D_SHIFT: u32 = 9;
27994    /// Offset of the `E` field.
27995    pub const E_SHIFT: u32 = 9;
27996    /// Offset of the `BTYPE` field.
27997    pub const BTYPE_SHIFT: u32 = 10;
27998    /// Mask for the `BTYPE` field.
27999    pub const BTYPE_MASK: u64 = 0b11;
28000    /// Offset of the `ALLINT` field.
28001    pub const ALLINT_SHIFT: u32 = 13;
28002    /// Offset of the `BTYPE2` field.
28003    pub const BTYPE2_SHIFT: u32 = 14;
28004    /// Offset of the `GE` field.
28005    pub const GE_SHIFT: u32 = 16;
28006    /// Mask for the `GE` field.
28007    pub const GE_MASK: u64 = 0b1111;
28008    /// Offset of the `IL` field.
28009    pub const IL_SHIFT: u32 = 20;
28010    /// Offset of the `SS` field.
28011    pub const SS_SHIFT: u32 = 21;
28012    /// Offset of the `PAN` field.
28013    pub const PAN_SHIFT: u32 = 22;
28014    /// Offset of the `UAO` field.
28015    pub const UAO_SHIFT: u32 = 23;
28016    /// Offset of the `DIT` field.
28017    pub const DIT_SHIFT: u32 = 24;
28018    /// Offset of the `TCO` field.
28019    pub const TCO_SHIFT: u32 = 25;
28020    /// Offset of the `Q` field.
28021    pub const Q_SHIFT: u32 = 27;
28022    /// Offset of the `V` field.
28023    pub const V_SHIFT: u32 = 28;
28024    /// Offset of the `C` field.
28025    pub const C_SHIFT: u32 = 29;
28026    /// Offset of the `Z` field.
28027    pub const Z_SHIFT: u32 = 30;
28028    /// Offset of the `N` field.
28029    pub const N_SHIFT: u32 = 31;
28030    /// Offset of the `PM` field.
28031    pub const PM_SHIFT: u32 = 32;
28032    /// Offset of the `PPEND` field.
28033    pub const PPEND_SHIFT: u32 = 33;
28034    /// Offset of the `EXLOCK` field.
28035    pub const EXLOCK_SHIFT: u32 = 34;
28036    /// Offset of the `PACM` field.
28037    pub const PACM_SHIFT: u32 = 35;
28038    /// Offset of the `UINJ` field.
28039    pub const UINJ_SHIFT: u32 = 36;
28040
28041    /// Returns the value of the `M[3:0]` field.
28042    pub const fn m_3_0(self) -> u8 {
28043        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
28044    }
28045
28046    /// Sets the value of the `M[3:0]` field.
28047    pub const fn set_m_3_0(&mut self, value: u8) {
28048        let offset = Self::M_3_0_SHIFT;
28049        assert!(value & (Self::M_3_0_MASK as u8) == value);
28050        *self = Self::from_bits_retain(
28051            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
28052        );
28053    }
28054
28055    /// Returns a copy with the `M[3:0]` field set to the given value.
28056    pub const fn with_m_3_0(mut self, value: u8) -> Self {
28057        self.set_m_3_0(value);
28058        self
28059    }
28060
28061    /// Returns the value of the `BTYPE` field.
28062    pub const fn btype(self) -> u8 {
28063        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
28064    }
28065
28066    /// Sets the value of the `BTYPE` field.
28067    pub const fn set_btype(&mut self, value: u8) {
28068        let offset = Self::BTYPE_SHIFT;
28069        assert!(value & (Self::BTYPE_MASK as u8) == value);
28070        *self = Self::from_bits_retain(
28071            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
28072        );
28073    }
28074
28075    /// Returns a copy with the `BTYPE` field set to the given value.
28076    pub const fn with_btype(mut self, value: u8) -> Self {
28077        self.set_btype(value);
28078        self
28079    }
28080
28081    /// Returns the value of the `GE` field.
28082    pub const fn ge(self) -> u8 {
28083        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
28084    }
28085
28086    /// Sets the value of the `GE` field.
28087    pub const fn set_ge(&mut self, value: u8) {
28088        let offset = Self::GE_SHIFT;
28089        assert!(value & (Self::GE_MASK as u8) == value);
28090        *self = Self::from_bits_retain(
28091            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
28092        );
28093    }
28094
28095    /// Returns a copy with the `GE` field set to the given value.
28096    pub const fn with_ge(mut self, value: u8) -> Self {
28097        self.set_ge(value);
28098        self
28099    }
28100}
28101
28102#[cfg(feature = "el3")]
28103bitflags! {
28104    /// `SPSR_EL3` system register value.
28105    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28106    #[repr(transparent)]
28107    pub struct SpsrEl3: u64 {
28108        /// `M[4]` bit.
28109        const M_4 = 1 << 4;
28110        /// `T` bit.
28111        const T = 1 << 5;
28112        /// `F` bit.
28113        const F = 1 << 6;
28114        /// `I` bit.
28115        const I = 1 << 7;
28116        /// `A` bit.
28117        const A = 1 << 8;
28118        /// `D` bit.
28119        const D = 1 << 9;
28120        /// `E` bit.
28121        const E = 1 << 9;
28122        /// `ALLINT` bit.
28123        const ALLINT = 1 << 13;
28124        /// `BTYPE2` bit.
28125        const BTYPE2 = 1 << 14;
28126        /// `IL` bit.
28127        const IL = 1 << 20;
28128        /// `SS` bit.
28129        const SS = 1 << 21;
28130        /// `PAN` bit.
28131        const PAN = 1 << 22;
28132        /// `UAO` bit.
28133        const UAO = 1 << 23;
28134        /// `DIT` bit.
28135        const DIT = 1 << 24;
28136        /// `TCO` bit.
28137        const TCO = 1 << 25;
28138        /// `Q` bit.
28139        const Q = 1 << 27;
28140        /// `V` bit.
28141        const V = 1 << 28;
28142        /// `C` bit.
28143        const C = 1 << 29;
28144        /// `Z` bit.
28145        const Z = 1 << 30;
28146        /// `N` bit.
28147        const N = 1 << 31;
28148        /// `PM` bit.
28149        const PM = 1 << 32;
28150        /// `PPEND` bit.
28151        const PPEND = 1 << 33;
28152        /// `EXLOCK` bit.
28153        const EXLOCK = 1 << 34;
28154        /// `PACM` bit.
28155        const PACM = 1 << 35;
28156        /// `UINJ` bit.
28157        const UINJ = 1 << 36;
28158    }
28159}
28160
28161#[cfg(feature = "el3")]
28162impl SpsrEl3 {
28163    /// Offset of the `M[3:0]` field.
28164    pub const M_3_0_SHIFT: u32 = 0;
28165    /// Mask for the `M[3:0]` field.
28166    pub const M_3_0_MASK: u64 = 0b1111;
28167    /// Offset of the `M[4]` field.
28168    pub const M_4_SHIFT: u32 = 4;
28169    /// Offset of the `T` field.
28170    pub const T_SHIFT: u32 = 5;
28171    /// Offset of the `F` field.
28172    pub const F_SHIFT: u32 = 6;
28173    /// Offset of the `I` field.
28174    pub const I_SHIFT: u32 = 7;
28175    /// Offset of the `A` field.
28176    pub const A_SHIFT: u32 = 8;
28177    /// Offset of the `D` field.
28178    pub const D_SHIFT: u32 = 9;
28179    /// Offset of the `E` field.
28180    pub const E_SHIFT: u32 = 9;
28181    /// Offset of the `BTYPE` field.
28182    pub const BTYPE_SHIFT: u32 = 10;
28183    /// Mask for the `BTYPE` field.
28184    pub const BTYPE_MASK: u64 = 0b11;
28185    /// Offset of the `ALLINT` field.
28186    pub const ALLINT_SHIFT: u32 = 13;
28187    /// Offset of the `BTYPE2` field.
28188    pub const BTYPE2_SHIFT: u32 = 14;
28189    /// Offset of the `GE` field.
28190    pub const GE_SHIFT: u32 = 16;
28191    /// Mask for the `GE` field.
28192    pub const GE_MASK: u64 = 0b1111;
28193    /// Offset of the `IL` field.
28194    pub const IL_SHIFT: u32 = 20;
28195    /// Offset of the `SS` field.
28196    pub const SS_SHIFT: u32 = 21;
28197    /// Offset of the `PAN` field.
28198    pub const PAN_SHIFT: u32 = 22;
28199    /// Offset of the `UAO` field.
28200    pub const UAO_SHIFT: u32 = 23;
28201    /// Offset of the `DIT` field.
28202    pub const DIT_SHIFT: u32 = 24;
28203    /// Offset of the `TCO` field.
28204    pub const TCO_SHIFT: u32 = 25;
28205    /// Offset of the `Q` field.
28206    pub const Q_SHIFT: u32 = 27;
28207    /// Offset of the `V` field.
28208    pub const V_SHIFT: u32 = 28;
28209    /// Offset of the `C` field.
28210    pub const C_SHIFT: u32 = 29;
28211    /// Offset of the `Z` field.
28212    pub const Z_SHIFT: u32 = 30;
28213    /// Offset of the `N` field.
28214    pub const N_SHIFT: u32 = 31;
28215    /// Offset of the `PM` field.
28216    pub const PM_SHIFT: u32 = 32;
28217    /// Offset of the `PPEND` field.
28218    pub const PPEND_SHIFT: u32 = 33;
28219    /// Offset of the `EXLOCK` field.
28220    pub const EXLOCK_SHIFT: u32 = 34;
28221    /// Offset of the `PACM` field.
28222    pub const PACM_SHIFT: u32 = 35;
28223    /// Offset of the `UINJ` field.
28224    pub const UINJ_SHIFT: u32 = 36;
28225
28226    /// Returns the value of the `M[3:0]` field.
28227    pub const fn m_3_0(self) -> u8 {
28228        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
28229    }
28230
28231    /// Sets the value of the `M[3:0]` field.
28232    pub const fn set_m_3_0(&mut self, value: u8) {
28233        let offset = Self::M_3_0_SHIFT;
28234        assert!(value & (Self::M_3_0_MASK as u8) == value);
28235        *self = Self::from_bits_retain(
28236            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
28237        );
28238    }
28239
28240    /// Returns a copy with the `M[3:0]` field set to the given value.
28241    pub const fn with_m_3_0(mut self, value: u8) -> Self {
28242        self.set_m_3_0(value);
28243        self
28244    }
28245
28246    /// Returns the value of the `BTYPE` field.
28247    pub const fn btype(self) -> u8 {
28248        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
28249    }
28250
28251    /// Sets the value of the `BTYPE` field.
28252    pub const fn set_btype(&mut self, value: u8) {
28253        let offset = Self::BTYPE_SHIFT;
28254        assert!(value & (Self::BTYPE_MASK as u8) == value);
28255        *self = Self::from_bits_retain(
28256            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
28257        );
28258    }
28259
28260    /// Returns a copy with the `BTYPE` field set to the given value.
28261    pub const fn with_btype(mut self, value: u8) -> Self {
28262        self.set_btype(value);
28263        self
28264    }
28265
28266    /// Returns the value of the `GE` field.
28267    pub const fn ge(self) -> u8 {
28268        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
28269    }
28270
28271    /// Sets the value of the `GE` field.
28272    pub const fn set_ge(&mut self, value: u8) {
28273        let offset = Self::GE_SHIFT;
28274        assert!(value & (Self::GE_MASK as u8) == value);
28275        *self = Self::from_bits_retain(
28276            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
28277        );
28278    }
28279
28280    /// Returns a copy with the `GE` field set to the given value.
28281    pub const fn with_ge(mut self, value: u8) -> Self {
28282        self.set_ge(value);
28283        self
28284    }
28285}
28286
28287#[cfg(feature = "el1")]
28288bitflags! {
28289    /// `SP_EL1` system register value.
28290    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28291    #[repr(transparent)]
28292    pub struct SpEl1: u64 {
28293    }
28294}
28295
28296#[cfg(feature = "el1")]
28297impl SpEl1 {
28298    /// Offset of the `StackPointer` field.
28299    pub const STACKPOINTER_SHIFT: u32 = 0;
28300    /// Mask for the `StackPointer` field.
28301    pub const STACKPOINTER_MASK: u64 =
28302        0b1111111111111111111111111111111111111111111111111111111111111111;
28303
28304    /// Returns the value of the `StackPointer` field.
28305    pub const fn stackpointer(self) -> u64 {
28306        ((self.bits() >> Self::STACKPOINTER_SHIFT)
28307            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
28308    }
28309
28310    /// Sets the value of the `StackPointer` field.
28311    pub const fn set_stackpointer(&mut self, value: u64) {
28312        let offset = Self::STACKPOINTER_SHIFT;
28313        assert!(value & (Self::STACKPOINTER_MASK as u64) == value);
28314        *self = Self::from_bits_retain(
28315            (self.bits() & !(Self::STACKPOINTER_MASK << offset)) | ((value as u64) << offset),
28316        );
28317    }
28318
28319    /// Returns a copy with the `StackPointer` field set to the given value.
28320    pub const fn with_stackpointer(mut self, value: u64) -> Self {
28321        self.set_stackpointer(value);
28322        self
28323    }
28324}
28325
28326#[cfg(feature = "el2")]
28327bitflags! {
28328    /// `SP_EL2` system register value.
28329    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28330    #[repr(transparent)]
28331    pub struct SpEl2: u64 {
28332    }
28333}
28334
28335#[cfg(feature = "el2")]
28336impl SpEl2 {
28337    /// Offset of the `StackPointer` field.
28338    pub const STACKPOINTER_SHIFT: u32 = 0;
28339    /// Mask for the `StackPointer` field.
28340    pub const STACKPOINTER_MASK: u64 =
28341        0b1111111111111111111111111111111111111111111111111111111111111111;
28342
28343    /// Returns the value of the `StackPointer` field.
28344    pub const fn stackpointer(self) -> u64 {
28345        ((self.bits() >> Self::STACKPOINTER_SHIFT)
28346            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
28347    }
28348
28349    /// Sets the value of the `StackPointer` field.
28350    pub const fn set_stackpointer(&mut self, value: u64) {
28351        let offset = Self::STACKPOINTER_SHIFT;
28352        assert!(value & (Self::STACKPOINTER_MASK as u64) == value);
28353        *self = Self::from_bits_retain(
28354            (self.bits() & !(Self::STACKPOINTER_MASK << offset)) | ((value as u64) << offset),
28355        );
28356    }
28357
28358    /// Returns a copy with the `StackPointer` field set to the given value.
28359    pub const fn with_stackpointer(mut self, value: u64) -> Self {
28360        self.set_stackpointer(value);
28361        self
28362    }
28363}
28364
28365bitflags! {
28366    /// `SVCR` system register value.
28367    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28368    #[repr(transparent)]
28369    pub struct Svcr: u64 {
28370        /// `SM` bit.
28371        const SM = 1 << 0;
28372        /// `ZA` bit.
28373        const ZA = 1 << 1;
28374    }
28375}
28376
28377impl Svcr {
28378    /// Offset of the `SM` field.
28379    pub const SM_SHIFT: u32 = 0;
28380    /// Offset of the `ZA` field.
28381    pub const ZA_SHIFT: u32 = 1;
28382}
28383
28384#[cfg(feature = "el1")]
28385bitflags! {
28386    /// `TCR2_EL1` system register value.
28387    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28388    #[repr(transparent)]
28389    pub struct Tcr2El1: u64 {
28390        /// `PnCH` bit.
28391        const PNCH = 1 << 0;
28392        /// `PIE` bit.
28393        const PIE = 1 << 1;
28394        /// `E0POE` bit.
28395        const E0POE = 1 << 2;
28396        /// `POE` bit.
28397        const POE = 1 << 3;
28398        /// `AIE` bit.
28399        const AIE = 1 << 4;
28400        /// `D128` bit.
28401        const D128 = 1 << 5;
28402        /// `PTTWI` bit.
28403        const PTTWI = 1 << 10;
28404        /// `HAFT` bit.
28405        const HAFT = 1 << 11;
28406        /// `DisCH0` bit.
28407        const DISCH0 = 1 << 14;
28408        /// `DisCH1` bit.
28409        const DISCH1 = 1 << 15;
28410        /// `A2` bit.
28411        const A2 = 1 << 16;
28412        /// `FNG0` bit.
28413        const FNG0 = 1 << 17;
28414        /// `FNG1` bit.
28415        const FNG1 = 1 << 18;
28416        /// `POE2F` bit.
28417        const POE2F = 1 << 19;
28418        /// `FNGNA0` bit.
28419        const FNGNA0 = 1 << 20;
28420        /// `FNGNA1` bit.
28421        const FNGNA1 = 1 << 21;
28422        /// `TVAD0` bit.
28423        const TVAD0 = 1 << 35;
28424        /// `TVAD1` bit.
28425        const TVAD1 = 1 << 36;
28426    }
28427}
28428
28429#[cfg(feature = "el1")]
28430impl Tcr2El1 {
28431    /// Offset of the `PnCH` field.
28432    pub const PNCH_SHIFT: u32 = 0;
28433    /// Offset of the `PIE` field.
28434    pub const PIE_SHIFT: u32 = 1;
28435    /// Offset of the `E0POE` field.
28436    pub const E0POE_SHIFT: u32 = 2;
28437    /// Offset of the `POE` field.
28438    pub const POE_SHIFT: u32 = 3;
28439    /// Offset of the `AIE` field.
28440    pub const AIE_SHIFT: u32 = 4;
28441    /// Offset of the `D128` field.
28442    pub const D128_SHIFT: u32 = 5;
28443    /// Offset of the `PTTWI` field.
28444    pub const PTTWI_SHIFT: u32 = 10;
28445    /// Offset of the `HAFT` field.
28446    pub const HAFT_SHIFT: u32 = 11;
28447    /// Offset of the `DisCH0` field.
28448    pub const DISCH0_SHIFT: u32 = 14;
28449    /// Offset of the `DisCH1` field.
28450    pub const DISCH1_SHIFT: u32 = 15;
28451    /// Offset of the `A2` field.
28452    pub const A2_SHIFT: u32 = 16;
28453    /// Offset of the `FNG0` field.
28454    pub const FNG0_SHIFT: u32 = 17;
28455    /// Offset of the `FNG1` field.
28456    pub const FNG1_SHIFT: u32 = 18;
28457    /// Offset of the `POE2F` field.
28458    pub const POE2F_SHIFT: u32 = 19;
28459    /// Offset of the `FNGNA0` field.
28460    pub const FNGNA0_SHIFT: u32 = 20;
28461    /// Offset of the `FNGNA1` field.
28462    pub const FNGNA1_SHIFT: u32 = 21;
28463    /// Offset of the `POIW` field.
28464    pub const POIW_SHIFT: u32 = 22;
28465    /// Mask for the `POIW` field.
28466    pub const POIW_MASK: u64 = 0b111;
28467    /// Offset of the `VTB0` field.
28468    pub const VTB0_SHIFT: u32 = 25;
28469    /// Mask for the `VTB0` field.
28470    pub const VTB0_MASK: u64 = 0b11111;
28471    /// Offset of the `VTB1` field.
28472    pub const VTB1_SHIFT: u32 = 30;
28473    /// Mask for the `VTB1` field.
28474    pub const VTB1_MASK: u64 = 0b11111;
28475    /// Offset of the `TVAD0` field.
28476    pub const TVAD0_SHIFT: u32 = 35;
28477    /// Offset of the `TVAD1` field.
28478    pub const TVAD1_SHIFT: u32 = 36;
28479
28480    /// Returns the value of the `POIW` field.
28481    pub const fn poiw(self) -> u8 {
28482        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
28483    }
28484
28485    /// Sets the value of the `POIW` field.
28486    pub const fn set_poiw(&mut self, value: u8) {
28487        let offset = Self::POIW_SHIFT;
28488        assert!(value & (Self::POIW_MASK as u8) == value);
28489        *self = Self::from_bits_retain(
28490            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
28491        );
28492    }
28493
28494    /// Returns a copy with the `POIW` field set to the given value.
28495    pub const fn with_poiw(mut self, value: u8) -> Self {
28496        self.set_poiw(value);
28497        self
28498    }
28499
28500    /// Returns the value of the `VTB0` field.
28501    pub const fn vtb0(self) -> u8 {
28502        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
28503    }
28504
28505    /// Sets the value of the `VTB0` field.
28506    pub const fn set_vtb0(&mut self, value: u8) {
28507        let offset = Self::VTB0_SHIFT;
28508        assert!(value & (Self::VTB0_MASK as u8) == value);
28509        *self = Self::from_bits_retain(
28510            (self.bits() & !(Self::VTB0_MASK << offset)) | ((value as u64) << offset),
28511        );
28512    }
28513
28514    /// Returns a copy with the `VTB0` field set to the given value.
28515    pub const fn with_vtb0(mut self, value: u8) -> Self {
28516        self.set_vtb0(value);
28517        self
28518    }
28519
28520    /// Returns the value of the `VTB1` field.
28521    pub const fn vtb1(self) -> u8 {
28522        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
28523    }
28524
28525    /// Sets the value of the `VTB1` field.
28526    pub const fn set_vtb1(&mut self, value: u8) {
28527        let offset = Self::VTB1_SHIFT;
28528        assert!(value & (Self::VTB1_MASK as u8) == value);
28529        *self = Self::from_bits_retain(
28530            (self.bits() & !(Self::VTB1_MASK << offset)) | ((value as u64) << offset),
28531        );
28532    }
28533
28534    /// Returns a copy with the `VTB1` field set to the given value.
28535    pub const fn with_vtb1(mut self, value: u8) -> Self {
28536        self.set_vtb1(value);
28537        self
28538    }
28539}
28540
28541#[cfg(feature = "el2")]
28542bitflags! {
28543    /// `TCR2_EL2` system register value.
28544    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28545    #[repr(transparent)]
28546    pub struct Tcr2El2: u64 {
28547        /// `PnCH` bit.
28548        const PNCH = 1 << 0;
28549        /// `PIE` bit.
28550        const PIE = 1 << 1;
28551        /// `E0POE` bit.
28552        const E0POE = 1 << 2;
28553        /// `POE` bit.
28554        const POE = 1 << 3;
28555        /// `AIE` bit.
28556        const AIE = 1 << 4;
28557        /// `D128` bit.
28558        const D128 = 1 << 5;
28559        /// `PTTWI` bit.
28560        const PTTWI = 1 << 10;
28561        /// `HAFT` bit.
28562        const HAFT = 1 << 11;
28563        /// `AMEC0` bit.
28564        const AMEC0 = 1 << 12;
28565        /// `AMEC1` bit.
28566        const AMEC1 = 1 << 13;
28567        /// `DisCH0` bit.
28568        const DISCH0 = 1 << 14;
28569        /// `DisCH1` bit.
28570        const DISCH1 = 1 << 15;
28571        /// `A2` bit.
28572        const A2 = 1 << 16;
28573        /// `FNG0` bit.
28574        const FNG0 = 1 << 17;
28575        /// `FNG1` bit.
28576        const FNG1 = 1 << 18;
28577        /// `POE2F` bit.
28578        const POE2F = 1 << 19;
28579        /// `TVAD0` bit.
28580        const TVAD0 = 1 << 35;
28581        /// `TVAD1` bit.
28582        const TVAD1 = 1 << 36;
28583    }
28584}
28585
28586#[cfg(feature = "el2")]
28587impl Tcr2El2 {
28588    /// Offset of the `PnCH` field.
28589    pub const PNCH_SHIFT: u32 = 0;
28590    /// Offset of the `PIE` field.
28591    pub const PIE_SHIFT: u32 = 1;
28592    /// Offset of the `E0POE` field.
28593    pub const E0POE_SHIFT: u32 = 2;
28594    /// Offset of the `POE` field.
28595    pub const POE_SHIFT: u32 = 3;
28596    /// Offset of the `AIE` field.
28597    pub const AIE_SHIFT: u32 = 4;
28598    /// Offset of the `D128` field.
28599    pub const D128_SHIFT: u32 = 5;
28600    /// Offset of the `PTTWI` field.
28601    pub const PTTWI_SHIFT: u32 = 10;
28602    /// Offset of the `HAFT` field.
28603    pub const HAFT_SHIFT: u32 = 11;
28604    /// Offset of the `AMEC0` field.
28605    pub const AMEC0_SHIFT: u32 = 12;
28606    /// Offset of the `AMEC1` field.
28607    pub const AMEC1_SHIFT: u32 = 13;
28608    /// Offset of the `DisCH0` field.
28609    pub const DISCH0_SHIFT: u32 = 14;
28610    /// Offset of the `DisCH1` field.
28611    pub const DISCH1_SHIFT: u32 = 15;
28612    /// Offset of the `A2` field.
28613    pub const A2_SHIFT: u32 = 16;
28614    /// Offset of the `FNG0` field.
28615    pub const FNG0_SHIFT: u32 = 17;
28616    /// Offset of the `FNG1` field.
28617    pub const FNG1_SHIFT: u32 = 18;
28618    /// Offset of the `POE2F` field.
28619    pub const POE2F_SHIFT: u32 = 19;
28620    /// Offset of the `POIW` field.
28621    pub const POIW_SHIFT: u32 = 22;
28622    /// Mask for the `POIW` field.
28623    pub const POIW_MASK: u64 = 0b111;
28624    /// Offset of the `VTB0` field.
28625    pub const VTB0_SHIFT: u32 = 25;
28626    /// Mask for the `VTB0` field.
28627    pub const VTB0_MASK: u64 = 0b11111;
28628    /// Offset of the `VTB1` field.
28629    pub const VTB1_SHIFT: u32 = 30;
28630    /// Mask for the `VTB1` field.
28631    pub const VTB1_MASK: u64 = 0b11111;
28632    /// Offset of the `TVAD0` field.
28633    pub const TVAD0_SHIFT: u32 = 35;
28634    /// Offset of the `TVAD1` field.
28635    pub const TVAD1_SHIFT: u32 = 36;
28636
28637    /// Returns the value of the `POIW` field.
28638    pub const fn poiw(self) -> u8 {
28639        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
28640    }
28641
28642    /// Sets the value of the `POIW` field.
28643    pub const fn set_poiw(&mut self, value: u8) {
28644        let offset = Self::POIW_SHIFT;
28645        assert!(value & (Self::POIW_MASK as u8) == value);
28646        *self = Self::from_bits_retain(
28647            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
28648        );
28649    }
28650
28651    /// Returns a copy with the `POIW` field set to the given value.
28652    pub const fn with_poiw(mut self, value: u8) -> Self {
28653        self.set_poiw(value);
28654        self
28655    }
28656
28657    /// Returns the value of the `VTB0` field.
28658    pub const fn vtb0(self) -> u8 {
28659        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
28660    }
28661
28662    /// Sets the value of the `VTB0` field.
28663    pub const fn set_vtb0(&mut self, value: u8) {
28664        let offset = Self::VTB0_SHIFT;
28665        assert!(value & (Self::VTB0_MASK as u8) == value);
28666        *self = Self::from_bits_retain(
28667            (self.bits() & !(Self::VTB0_MASK << offset)) | ((value as u64) << offset),
28668        );
28669    }
28670
28671    /// Returns a copy with the `VTB0` field set to the given value.
28672    pub const fn with_vtb0(mut self, value: u8) -> Self {
28673        self.set_vtb0(value);
28674        self
28675    }
28676
28677    /// Returns the value of the `VTB1` field.
28678    pub const fn vtb1(self) -> u8 {
28679        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
28680    }
28681
28682    /// Sets the value of the `VTB1` field.
28683    pub const fn set_vtb1(&mut self, value: u8) {
28684        let offset = Self::VTB1_SHIFT;
28685        assert!(value & (Self::VTB1_MASK as u8) == value);
28686        *self = Self::from_bits_retain(
28687            (self.bits() & !(Self::VTB1_MASK << offset)) | ((value as u64) << offset),
28688        );
28689    }
28690
28691    /// Returns a copy with the `VTB1` field set to the given value.
28692    pub const fn with_vtb1(mut self, value: u8) -> Self {
28693        self.set_vtb1(value);
28694        self
28695    }
28696}
28697
28698#[cfg(feature = "el1")]
28699bitflags! {
28700    /// `TCR_EL1` system register value.
28701    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28702    #[repr(transparent)]
28703    pub struct TcrEl1: u64 {
28704        /// `EPD0` bit.
28705        const EPD0 = 1 << 7;
28706        /// `A1` bit.
28707        const A1 = 1 << 22;
28708        /// `EPD1` bit.
28709        const EPD1 = 1 << 23;
28710        /// `AS` bit.
28711        const AS = 1 << 36;
28712        /// `TBI0` bit.
28713        const TBI0 = 1 << 37;
28714        /// `TBI1` bit.
28715        const TBI1 = 1 << 38;
28716        /// `HA` bit.
28717        const HA = 1 << 39;
28718        /// `HD` bit.
28719        const HD = 1 << 40;
28720        /// `HPD0` bit.
28721        const HPD0 = 1 << 41;
28722        /// `HPD1` bit.
28723        const HPD1 = 1 << 42;
28724        /// `HWU059` bit.
28725        const HWU059 = 1 << 43;
28726        /// `HWU060` bit.
28727        const HWU060 = 1 << 44;
28728        /// `HWU061` bit.
28729        const HWU061 = 1 << 45;
28730        /// `HWU062` bit.
28731        const HWU062 = 1 << 46;
28732        /// `HWU159` bit.
28733        const HWU159 = 1 << 47;
28734        /// `HWU160` bit.
28735        const HWU160 = 1 << 48;
28736        /// `HWU161` bit.
28737        const HWU161 = 1 << 49;
28738        /// `HWU162` bit.
28739        const HWU162 = 1 << 50;
28740        /// `TBID0` bit.
28741        const TBID0 = 1 << 51;
28742        /// `TBID1` bit.
28743        const TBID1 = 1 << 52;
28744        /// `NFD0` bit.
28745        const NFD0 = 1 << 53;
28746        /// `NFD1` bit.
28747        const NFD1 = 1 << 54;
28748        /// `E0PD0` bit.
28749        const E0PD0 = 1 << 55;
28750        /// `E0PD1` bit.
28751        const E0PD1 = 1 << 56;
28752        /// `TCMA0` bit.
28753        const TCMA0 = 1 << 57;
28754        /// `TCMA1` bit.
28755        const TCMA1 = 1 << 58;
28756        /// `DS` bit.
28757        const DS = 1 << 59;
28758        /// `MTX0` bit.
28759        const MTX0 = 1 << 60;
28760        /// `MTX1` bit.
28761        const MTX1 = 1 << 61;
28762    }
28763}
28764
28765#[cfg(feature = "el1")]
28766impl TcrEl1 {
28767    /// Offset of the `T0SZ` field.
28768    pub const T0SZ_SHIFT: u32 = 0;
28769    /// Mask for the `T0SZ` field.
28770    pub const T0SZ_MASK: u64 = 0b111111;
28771    /// Offset of the `EPD0` field.
28772    pub const EPD0_SHIFT: u32 = 7;
28773    /// Offset of the `IRGN0` field.
28774    pub const IRGN0_SHIFT: u32 = 8;
28775    /// Mask for the `IRGN0` field.
28776    pub const IRGN0_MASK: u64 = 0b11;
28777    /// Offset of the `ORGN0` field.
28778    pub const ORGN0_SHIFT: u32 = 10;
28779    /// Mask for the `ORGN0` field.
28780    pub const ORGN0_MASK: u64 = 0b11;
28781    /// Offset of the `SH0` field.
28782    pub const SH0_SHIFT: u32 = 12;
28783    /// Mask for the `SH0` field.
28784    pub const SH0_MASK: u64 = 0b11;
28785    /// Offset of the `TG0` field.
28786    pub const TG0_SHIFT: u32 = 14;
28787    /// Mask for the `TG0` field.
28788    pub const TG0_MASK: u64 = 0b11;
28789    /// Offset of the `T1SZ` field.
28790    pub const T1SZ_SHIFT: u32 = 16;
28791    /// Mask for the `T1SZ` field.
28792    pub const T1SZ_MASK: u64 = 0b111111;
28793    /// Offset of the `A1` field.
28794    pub const A1_SHIFT: u32 = 22;
28795    /// Offset of the `EPD1` field.
28796    pub const EPD1_SHIFT: u32 = 23;
28797    /// Offset of the `IRGN1` field.
28798    pub const IRGN1_SHIFT: u32 = 24;
28799    /// Mask for the `IRGN1` field.
28800    pub const IRGN1_MASK: u64 = 0b11;
28801    /// Offset of the `ORGN1` field.
28802    pub const ORGN1_SHIFT: u32 = 26;
28803    /// Mask for the `ORGN1` field.
28804    pub const ORGN1_MASK: u64 = 0b11;
28805    /// Offset of the `SH1` field.
28806    pub const SH1_SHIFT: u32 = 28;
28807    /// Mask for the `SH1` field.
28808    pub const SH1_MASK: u64 = 0b11;
28809    /// Offset of the `TG1` field.
28810    pub const TG1_SHIFT: u32 = 30;
28811    /// Mask for the `TG1` field.
28812    pub const TG1_MASK: u64 = 0b11;
28813    /// Offset of the `IPS` field.
28814    pub const IPS_SHIFT: u32 = 32;
28815    /// Mask for the `IPS` field.
28816    pub const IPS_MASK: u64 = 0b111;
28817    /// Offset of the `AS` field.
28818    pub const AS_SHIFT: u32 = 36;
28819    /// Offset of the `TBI0` field.
28820    pub const TBI0_SHIFT: u32 = 37;
28821    /// Offset of the `TBI1` field.
28822    pub const TBI1_SHIFT: u32 = 38;
28823    /// Offset of the `HA` field.
28824    pub const HA_SHIFT: u32 = 39;
28825    /// Offset of the `HD` field.
28826    pub const HD_SHIFT: u32 = 40;
28827    /// Offset of the `HPD0` field.
28828    pub const HPD0_SHIFT: u32 = 41;
28829    /// Offset of the `HPD1` field.
28830    pub const HPD1_SHIFT: u32 = 42;
28831    /// Offset of the `HWU059` field.
28832    pub const HWU059_SHIFT: u32 = 43;
28833    /// Offset of the `HWU060` field.
28834    pub const HWU060_SHIFT: u32 = 44;
28835    /// Offset of the `HWU061` field.
28836    pub const HWU061_SHIFT: u32 = 45;
28837    /// Offset of the `HWU062` field.
28838    pub const HWU062_SHIFT: u32 = 46;
28839    /// Offset of the `HWU159` field.
28840    pub const HWU159_SHIFT: u32 = 47;
28841    /// Offset of the `HWU160` field.
28842    pub const HWU160_SHIFT: u32 = 48;
28843    /// Offset of the `HWU161` field.
28844    pub const HWU161_SHIFT: u32 = 49;
28845    /// Offset of the `HWU162` field.
28846    pub const HWU162_SHIFT: u32 = 50;
28847    /// Offset of the `TBID0` field.
28848    pub const TBID0_SHIFT: u32 = 51;
28849    /// Offset of the `TBID1` field.
28850    pub const TBID1_SHIFT: u32 = 52;
28851    /// Offset of the `NFD0` field.
28852    pub const NFD0_SHIFT: u32 = 53;
28853    /// Offset of the `NFD1` field.
28854    pub const NFD1_SHIFT: u32 = 54;
28855    /// Offset of the `E0PD0` field.
28856    pub const E0PD0_SHIFT: u32 = 55;
28857    /// Offset of the `E0PD1` field.
28858    pub const E0PD1_SHIFT: u32 = 56;
28859    /// Offset of the `TCMA0` field.
28860    pub const TCMA0_SHIFT: u32 = 57;
28861    /// Offset of the `TCMA1` field.
28862    pub const TCMA1_SHIFT: u32 = 58;
28863    /// Offset of the `DS` field.
28864    pub const DS_SHIFT: u32 = 59;
28865    /// Offset of the `MTX0` field.
28866    pub const MTX0_SHIFT: u32 = 60;
28867    /// Offset of the `MTX1` field.
28868    pub const MTX1_SHIFT: u32 = 61;
28869
28870    /// Returns the value of the `T0SZ` field.
28871    pub const fn t0sz(self) -> u8 {
28872        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
28873    }
28874
28875    /// Sets the value of the `T0SZ` field.
28876    pub const fn set_t0sz(&mut self, value: u8) {
28877        let offset = Self::T0SZ_SHIFT;
28878        assert!(value & (Self::T0SZ_MASK as u8) == value);
28879        *self = Self::from_bits_retain(
28880            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
28881        );
28882    }
28883
28884    /// Returns a copy with the `T0SZ` field set to the given value.
28885    pub const fn with_t0sz(mut self, value: u8) -> Self {
28886        self.set_t0sz(value);
28887        self
28888    }
28889
28890    /// Returns the value of the `IRGN0` field.
28891    pub const fn irgn0(self) -> u8 {
28892        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
28893    }
28894
28895    /// Sets the value of the `IRGN0` field.
28896    pub const fn set_irgn0(&mut self, value: u8) {
28897        let offset = Self::IRGN0_SHIFT;
28898        assert!(value & (Self::IRGN0_MASK as u8) == value);
28899        *self = Self::from_bits_retain(
28900            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
28901        );
28902    }
28903
28904    /// Returns a copy with the `IRGN0` field set to the given value.
28905    pub const fn with_irgn0(mut self, value: u8) -> Self {
28906        self.set_irgn0(value);
28907        self
28908    }
28909
28910    /// Returns the value of the `ORGN0` field.
28911    pub const fn orgn0(self) -> u8 {
28912        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
28913    }
28914
28915    /// Sets the value of the `ORGN0` field.
28916    pub const fn set_orgn0(&mut self, value: u8) {
28917        let offset = Self::ORGN0_SHIFT;
28918        assert!(value & (Self::ORGN0_MASK as u8) == value);
28919        *self = Self::from_bits_retain(
28920            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
28921        );
28922    }
28923
28924    /// Returns a copy with the `ORGN0` field set to the given value.
28925    pub const fn with_orgn0(mut self, value: u8) -> Self {
28926        self.set_orgn0(value);
28927        self
28928    }
28929
28930    /// Returns the value of the `SH0` field.
28931    pub const fn sh0(self) -> u8 {
28932        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
28933    }
28934
28935    /// Sets the value of the `SH0` field.
28936    pub const fn set_sh0(&mut self, value: u8) {
28937        let offset = Self::SH0_SHIFT;
28938        assert!(value & (Self::SH0_MASK as u8) == value);
28939        *self = Self::from_bits_retain(
28940            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
28941        );
28942    }
28943
28944    /// Returns a copy with the `SH0` field set to the given value.
28945    pub const fn with_sh0(mut self, value: u8) -> Self {
28946        self.set_sh0(value);
28947        self
28948    }
28949
28950    /// Returns the value of the `TG0` field.
28951    pub const fn tg0(self) -> u8 {
28952        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
28953    }
28954
28955    /// Sets the value of the `TG0` field.
28956    pub const fn set_tg0(&mut self, value: u8) {
28957        let offset = Self::TG0_SHIFT;
28958        assert!(value & (Self::TG0_MASK as u8) == value);
28959        *self = Self::from_bits_retain(
28960            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
28961        );
28962    }
28963
28964    /// Returns a copy with the `TG0` field set to the given value.
28965    pub const fn with_tg0(mut self, value: u8) -> Self {
28966        self.set_tg0(value);
28967        self
28968    }
28969
28970    /// Returns the value of the `T1SZ` field.
28971    pub const fn t1sz(self) -> u8 {
28972        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
28973    }
28974
28975    /// Sets the value of the `T1SZ` field.
28976    pub const fn set_t1sz(&mut self, value: u8) {
28977        let offset = Self::T1SZ_SHIFT;
28978        assert!(value & (Self::T1SZ_MASK as u8) == value);
28979        *self = Self::from_bits_retain(
28980            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u64) << offset),
28981        );
28982    }
28983
28984    /// Returns a copy with the `T1SZ` field set to the given value.
28985    pub const fn with_t1sz(mut self, value: u8) -> Self {
28986        self.set_t1sz(value);
28987        self
28988    }
28989
28990    /// Returns the value of the `IRGN1` field.
28991    pub const fn irgn1(self) -> u8 {
28992        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
28993    }
28994
28995    /// Sets the value of the `IRGN1` field.
28996    pub const fn set_irgn1(&mut self, value: u8) {
28997        let offset = Self::IRGN1_SHIFT;
28998        assert!(value & (Self::IRGN1_MASK as u8) == value);
28999        *self = Self::from_bits_retain(
29000            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u64) << offset),
29001        );
29002    }
29003
29004    /// Returns a copy with the `IRGN1` field set to the given value.
29005    pub const fn with_irgn1(mut self, value: u8) -> Self {
29006        self.set_irgn1(value);
29007        self
29008    }
29009
29010    /// Returns the value of the `ORGN1` field.
29011    pub const fn orgn1(self) -> u8 {
29012        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
29013    }
29014
29015    /// Sets the value of the `ORGN1` field.
29016    pub const fn set_orgn1(&mut self, value: u8) {
29017        let offset = Self::ORGN1_SHIFT;
29018        assert!(value & (Self::ORGN1_MASK as u8) == value);
29019        *self = Self::from_bits_retain(
29020            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u64) << offset),
29021        );
29022    }
29023
29024    /// Returns a copy with the `ORGN1` field set to the given value.
29025    pub const fn with_orgn1(mut self, value: u8) -> Self {
29026        self.set_orgn1(value);
29027        self
29028    }
29029
29030    /// Returns the value of the `SH1` field.
29031    pub const fn sh1(self) -> u8 {
29032        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
29033    }
29034
29035    /// Sets the value of the `SH1` field.
29036    pub const fn set_sh1(&mut self, value: u8) {
29037        let offset = Self::SH1_SHIFT;
29038        assert!(value & (Self::SH1_MASK as u8) == value);
29039        *self = Self::from_bits_retain(
29040            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u64) << offset),
29041        );
29042    }
29043
29044    /// Returns a copy with the `SH1` field set to the given value.
29045    pub const fn with_sh1(mut self, value: u8) -> Self {
29046        self.set_sh1(value);
29047        self
29048    }
29049
29050    /// Returns the value of the `TG1` field.
29051    pub const fn tg1(self) -> u8 {
29052        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
29053    }
29054
29055    /// Sets the value of the `TG1` field.
29056    pub const fn set_tg1(&mut self, value: u8) {
29057        let offset = Self::TG1_SHIFT;
29058        assert!(value & (Self::TG1_MASK as u8) == value);
29059        *self = Self::from_bits_retain(
29060            (self.bits() & !(Self::TG1_MASK << offset)) | ((value as u64) << offset),
29061        );
29062    }
29063
29064    /// Returns a copy with the `TG1` field set to the given value.
29065    pub const fn with_tg1(mut self, value: u8) -> Self {
29066        self.set_tg1(value);
29067        self
29068    }
29069
29070    /// Returns the value of the `IPS` field.
29071    pub const fn ips(self) -> u8 {
29072        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
29073    }
29074
29075    /// Sets the value of the `IPS` field.
29076    pub const fn set_ips(&mut self, value: u8) {
29077        let offset = Self::IPS_SHIFT;
29078        assert!(value & (Self::IPS_MASK as u8) == value);
29079        *self = Self::from_bits_retain(
29080            (self.bits() & !(Self::IPS_MASK << offset)) | ((value as u64) << offset),
29081        );
29082    }
29083
29084    /// Returns a copy with the `IPS` field set to the given value.
29085    pub const fn with_ips(mut self, value: u8) -> Self {
29086        self.set_ips(value);
29087        self
29088    }
29089}
29090
29091#[cfg(feature = "el2")]
29092bitflags! {
29093    /// `TCR_EL2` system register value.
29094    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29095    #[repr(transparent)]
29096    pub struct TcrEl2: u64 {
29097        /// RES1 bits in the `TCR_EL2` register.
29098        const RES1 = 0b10000000100000000000000000000000;
29099        /// `EPD0` bit.
29100        const EPD0 = 1 << 7;
29101        /// `TBI` bit.
29102        const TBI = 1 << 20;
29103        /// `A1` bit.
29104        const A1 = 1 << 22;
29105        /// `EPD1` bit.
29106        const EPD1 = 1 << 23;
29107        /// `HPD` bit.
29108        const HPD = 1 << 24;
29109        /// `HWU59` bit.
29110        const HWU59 = 1 << 25;
29111        /// `HWU60` bit.
29112        const HWU60 = 1 << 26;
29113        /// `HWU61` bit.
29114        const HWU61 = 1 << 27;
29115        /// `HWU62` bit.
29116        const HWU62 = 1 << 28;
29117        /// `TBID` bit.
29118        const TBID = 1 << 29;
29119        /// `TCMA` bit.
29120        const TCMA = 1 << 30;
29121        /// `MTX` bit.
29122        const MTX = 1 << 33;
29123        /// `AS` bit.
29124        const AS = 1 << 36;
29125        /// `TBI0` bit.
29126        const TBI0 = 1 << 37;
29127        /// `TBI1` bit.
29128        const TBI1 = 1 << 38;
29129        /// `HPD0` bit.
29130        const HPD0 = 1 << 41;
29131        /// `HPD1` bit.
29132        const HPD1 = 1 << 42;
29133        /// `HWU059` bit.
29134        const HWU059 = 1 << 43;
29135        /// `HWU060` bit.
29136        const HWU060 = 1 << 44;
29137        /// `HWU061` bit.
29138        const HWU061 = 1 << 45;
29139        /// `HWU062` bit.
29140        const HWU062 = 1 << 46;
29141        /// `HWU159` bit.
29142        const HWU159 = 1 << 47;
29143        /// `HWU160` bit.
29144        const HWU160 = 1 << 48;
29145        /// `HWU161` bit.
29146        const HWU161 = 1 << 49;
29147        /// `HWU162` bit.
29148        const HWU162 = 1 << 50;
29149        /// `TBID0` bit.
29150        const TBID0 = 1 << 51;
29151        /// `TBID1` bit.
29152        const TBID1 = 1 << 52;
29153        /// `NFD0` bit.
29154        const NFD0 = 1 << 53;
29155        /// `TVAD` bit.
29156        const TVAD = 1 << 53;
29157        /// `NFD1` bit.
29158        const NFD1 = 1 << 54;
29159        /// `E0PD0` bit.
29160        const E0PD0 = 1 << 55;
29161        /// `E0PD1` bit.
29162        const E0PD1 = 1 << 56;
29163        /// `TCMA0` bit.
29164        const TCMA0 = 1 << 57;
29165        /// `TCMA1` bit.
29166        const TCMA1 = 1 << 58;
29167        /// `MTX0` bit.
29168        const MTX0 = 1 << 60;
29169        /// `MTX1` bit.
29170        const MTX1 = 1 << 61;
29171    }
29172}
29173
29174#[cfg(feature = "el2")]
29175impl TcrEl2 {
29176    /// Offset of the `T0SZ` field.
29177    pub const T0SZ_SHIFT: u32 = 0;
29178    /// Mask for the `T0SZ` field.
29179    pub const T0SZ_MASK: u64 = 0b111111;
29180    /// Offset of the `EPD0` field.
29181    pub const EPD0_SHIFT: u32 = 7;
29182    /// Offset of the `IRGN0` field.
29183    pub const IRGN0_SHIFT: u32 = 8;
29184    /// Mask for the `IRGN0` field.
29185    pub const IRGN0_MASK: u64 = 0b11;
29186    /// Offset of the `ORGN0` field.
29187    pub const ORGN0_SHIFT: u32 = 10;
29188    /// Mask for the `ORGN0` field.
29189    pub const ORGN0_MASK: u64 = 0b11;
29190    /// Offset of the `SH0` field.
29191    pub const SH0_SHIFT: u32 = 12;
29192    /// Mask for the `SH0` field.
29193    pub const SH0_MASK: u64 = 0b11;
29194    /// Offset of the `TG0` field.
29195    pub const TG0_SHIFT: u32 = 14;
29196    /// Mask for the `TG0` field.
29197    pub const TG0_MASK: u64 = 0b11;
29198    /// Offset of the `PS` field.
29199    pub const PS_SHIFT: u32 = 16;
29200    /// Mask for the `PS` field.
29201    pub const PS_MASK: u64 = 0b111;
29202    /// Offset of the `T1SZ` field.
29203    pub const T1SZ_SHIFT: u32 = 16;
29204    /// Mask for the `T1SZ` field.
29205    pub const T1SZ_MASK: u64 = 0b111111;
29206    /// Offset of the `TBI` field.
29207    pub const TBI_SHIFT: u32 = 20;
29208    /// Offset of the `A1` field.
29209    pub const A1_SHIFT: u32 = 22;
29210    /// Offset of the `EPD1` field.
29211    pub const EPD1_SHIFT: u32 = 23;
29212    /// Offset of the `HPD` field.
29213    pub const HPD_SHIFT: u32 = 24;
29214    /// Offset of the `IRGN1` field.
29215    pub const IRGN1_SHIFT: u32 = 24;
29216    /// Mask for the `IRGN1` field.
29217    pub const IRGN1_MASK: u64 = 0b11;
29218    /// Offset of the `HWU59` field.
29219    pub const HWU59_SHIFT: u32 = 25;
29220    /// Offset of the `HWU60` field.
29221    pub const HWU60_SHIFT: u32 = 26;
29222    /// Offset of the `ORGN1` field.
29223    pub const ORGN1_SHIFT: u32 = 26;
29224    /// Mask for the `ORGN1` field.
29225    pub const ORGN1_MASK: u64 = 0b11;
29226    /// Offset of the `HWU61` field.
29227    pub const HWU61_SHIFT: u32 = 27;
29228    /// Offset of the `HWU62` field.
29229    pub const HWU62_SHIFT: u32 = 28;
29230    /// Offset of the `SH1` field.
29231    pub const SH1_SHIFT: u32 = 28;
29232    /// Mask for the `SH1` field.
29233    pub const SH1_MASK: u64 = 0b11;
29234    /// Offset of the `TBID` field.
29235    pub const TBID_SHIFT: u32 = 29;
29236    /// Offset of the `TCMA` field.
29237    pub const TCMA_SHIFT: u32 = 30;
29238    /// Offset of the `TG1` field.
29239    pub const TG1_SHIFT: u32 = 30;
29240    /// Mask for the `TG1` field.
29241    pub const TG1_MASK: u64 = 0b11;
29242    /// Offset of the `IPS` field.
29243    pub const IPS_SHIFT: u32 = 32;
29244    /// Mask for the `IPS` field.
29245    pub const IPS_MASK: u64 = 0b111;
29246    /// Offset of the `MTX` field.
29247    pub const MTX_SHIFT: u32 = 33;
29248    /// Offset of the `AS` field.
29249    pub const AS_SHIFT: u32 = 36;
29250    /// Offset of the `TBI0` field.
29251    pub const TBI0_SHIFT: u32 = 37;
29252    /// Offset of the `TBI1` field.
29253    pub const TBI1_SHIFT: u32 = 38;
29254    /// Offset of the `HPD0` field.
29255    pub const HPD0_SHIFT: u32 = 41;
29256    /// Offset of the `HPD1` field.
29257    pub const HPD1_SHIFT: u32 = 42;
29258    /// Offset of the `HWU059` field.
29259    pub const HWU059_SHIFT: u32 = 43;
29260    /// Offset of the `HWU060` field.
29261    pub const HWU060_SHIFT: u32 = 44;
29262    /// Offset of the `HWU061` field.
29263    pub const HWU061_SHIFT: u32 = 45;
29264    /// Offset of the `HWU062` field.
29265    pub const HWU062_SHIFT: u32 = 46;
29266    /// Offset of the `HWU159` field.
29267    pub const HWU159_SHIFT: u32 = 47;
29268    /// Offset of the `HWU160` field.
29269    pub const HWU160_SHIFT: u32 = 48;
29270    /// Offset of the `VTB` field.
29271    pub const VTB_SHIFT: u32 = 48;
29272    /// Mask for the `VTB` field.
29273    pub const VTB_MASK: u64 = 0b11111;
29274    /// Offset of the `HWU161` field.
29275    pub const HWU161_SHIFT: u32 = 49;
29276    /// Offset of the `HWU162` field.
29277    pub const HWU162_SHIFT: u32 = 50;
29278    /// Offset of the `TBID0` field.
29279    pub const TBID0_SHIFT: u32 = 51;
29280    /// Offset of the `TBID1` field.
29281    pub const TBID1_SHIFT: u32 = 52;
29282    /// Offset of the `NFD0` field.
29283    pub const NFD0_SHIFT: u32 = 53;
29284    /// Offset of the `TVAD` field.
29285    pub const TVAD_SHIFT: u32 = 53;
29286    /// Offset of the `NFD1` field.
29287    pub const NFD1_SHIFT: u32 = 54;
29288    /// Offset of the `E0PD0` field.
29289    pub const E0PD0_SHIFT: u32 = 55;
29290    /// Offset of the `E0PD1` field.
29291    pub const E0PD1_SHIFT: u32 = 56;
29292    /// Offset of the `TCMA0` field.
29293    pub const TCMA0_SHIFT: u32 = 57;
29294    /// Offset of the `TCMA1` field.
29295    pub const TCMA1_SHIFT: u32 = 58;
29296    /// Offset of the `MTX0` field.
29297    pub const MTX0_SHIFT: u32 = 60;
29298    /// Offset of the `MTX1` field.
29299    pub const MTX1_SHIFT: u32 = 61;
29300
29301    /// Returns the value of the `T0SZ` field.
29302    pub const fn t0sz(self) -> u8 {
29303        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
29304    }
29305
29306    /// Sets the value of the `T0SZ` field.
29307    pub const fn set_t0sz(&mut self, value: u8) {
29308        let offset = Self::T0SZ_SHIFT;
29309        assert!(value & (Self::T0SZ_MASK as u8) == value);
29310        *self = Self::from_bits_retain(
29311            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
29312        );
29313    }
29314
29315    /// Returns a copy with the `T0SZ` field set to the given value.
29316    pub const fn with_t0sz(mut self, value: u8) -> Self {
29317        self.set_t0sz(value);
29318        self
29319    }
29320
29321    /// Returns the value of the `IRGN0` field.
29322    pub const fn irgn0(self) -> u8 {
29323        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
29324    }
29325
29326    /// Sets the value of the `IRGN0` field.
29327    pub const fn set_irgn0(&mut self, value: u8) {
29328        let offset = Self::IRGN0_SHIFT;
29329        assert!(value & (Self::IRGN0_MASK as u8) == value);
29330        *self = Self::from_bits_retain(
29331            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
29332        );
29333    }
29334
29335    /// Returns a copy with the `IRGN0` field set to the given value.
29336    pub const fn with_irgn0(mut self, value: u8) -> Self {
29337        self.set_irgn0(value);
29338        self
29339    }
29340
29341    /// Returns the value of the `ORGN0` field.
29342    pub const fn orgn0(self) -> u8 {
29343        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
29344    }
29345
29346    /// Sets the value of the `ORGN0` field.
29347    pub const fn set_orgn0(&mut self, value: u8) {
29348        let offset = Self::ORGN0_SHIFT;
29349        assert!(value & (Self::ORGN0_MASK as u8) == value);
29350        *self = Self::from_bits_retain(
29351            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
29352        );
29353    }
29354
29355    /// Returns a copy with the `ORGN0` field set to the given value.
29356    pub const fn with_orgn0(mut self, value: u8) -> Self {
29357        self.set_orgn0(value);
29358        self
29359    }
29360
29361    /// Returns the value of the `SH0` field.
29362    pub const fn sh0(self) -> u8 {
29363        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
29364    }
29365
29366    /// Sets the value of the `SH0` field.
29367    pub const fn set_sh0(&mut self, value: u8) {
29368        let offset = Self::SH0_SHIFT;
29369        assert!(value & (Self::SH0_MASK as u8) == value);
29370        *self = Self::from_bits_retain(
29371            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
29372        );
29373    }
29374
29375    /// Returns a copy with the `SH0` field set to the given value.
29376    pub const fn with_sh0(mut self, value: u8) -> Self {
29377        self.set_sh0(value);
29378        self
29379    }
29380
29381    /// Returns the value of the `TG0` field.
29382    pub const fn tg0(self) -> u8 {
29383        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
29384    }
29385
29386    /// Sets the value of the `TG0` field.
29387    pub const fn set_tg0(&mut self, value: u8) {
29388        let offset = Self::TG0_SHIFT;
29389        assert!(value & (Self::TG0_MASK as u8) == value);
29390        *self = Self::from_bits_retain(
29391            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
29392        );
29393    }
29394
29395    /// Returns a copy with the `TG0` field set to the given value.
29396    pub const fn with_tg0(mut self, value: u8) -> Self {
29397        self.set_tg0(value);
29398        self
29399    }
29400
29401    /// Returns the value of the `PS` field.
29402    pub const fn ps(self) -> u8 {
29403        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
29404    }
29405
29406    /// Sets the value of the `PS` field.
29407    pub const fn set_ps(&mut self, value: u8) {
29408        let offset = Self::PS_SHIFT;
29409        assert!(value & (Self::PS_MASK as u8) == value);
29410        *self = Self::from_bits_retain(
29411            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
29412        );
29413    }
29414
29415    /// Returns a copy with the `PS` field set to the given value.
29416    pub const fn with_ps(mut self, value: u8) -> Self {
29417        self.set_ps(value);
29418        self
29419    }
29420
29421    /// Returns the value of the `T1SZ` field.
29422    pub const fn t1sz(self) -> u8 {
29423        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
29424    }
29425
29426    /// Sets the value of the `T1SZ` field.
29427    pub const fn set_t1sz(&mut self, value: u8) {
29428        let offset = Self::T1SZ_SHIFT;
29429        assert!(value & (Self::T1SZ_MASK as u8) == value);
29430        *self = Self::from_bits_retain(
29431            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u64) << offset),
29432        );
29433    }
29434
29435    /// Returns a copy with the `T1SZ` field set to the given value.
29436    pub const fn with_t1sz(mut self, value: u8) -> Self {
29437        self.set_t1sz(value);
29438        self
29439    }
29440
29441    /// Returns the value of the `IRGN1` field.
29442    pub const fn irgn1(self) -> u8 {
29443        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
29444    }
29445
29446    /// Sets the value of the `IRGN1` field.
29447    pub const fn set_irgn1(&mut self, value: u8) {
29448        let offset = Self::IRGN1_SHIFT;
29449        assert!(value & (Self::IRGN1_MASK as u8) == value);
29450        *self = Self::from_bits_retain(
29451            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u64) << offset),
29452        );
29453    }
29454
29455    /// Returns a copy with the `IRGN1` field set to the given value.
29456    pub const fn with_irgn1(mut self, value: u8) -> Self {
29457        self.set_irgn1(value);
29458        self
29459    }
29460
29461    /// Returns the value of the `ORGN1` field.
29462    pub const fn orgn1(self) -> u8 {
29463        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
29464    }
29465
29466    /// Sets the value of the `ORGN1` field.
29467    pub const fn set_orgn1(&mut self, value: u8) {
29468        let offset = Self::ORGN1_SHIFT;
29469        assert!(value & (Self::ORGN1_MASK as u8) == value);
29470        *self = Self::from_bits_retain(
29471            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u64) << offset),
29472        );
29473    }
29474
29475    /// Returns a copy with the `ORGN1` field set to the given value.
29476    pub const fn with_orgn1(mut self, value: u8) -> Self {
29477        self.set_orgn1(value);
29478        self
29479    }
29480
29481    /// Returns the value of the `SH1` field.
29482    pub const fn sh1(self) -> u8 {
29483        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
29484    }
29485
29486    /// Sets the value of the `SH1` field.
29487    pub const fn set_sh1(&mut self, value: u8) {
29488        let offset = Self::SH1_SHIFT;
29489        assert!(value & (Self::SH1_MASK as u8) == value);
29490        *self = Self::from_bits_retain(
29491            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u64) << offset),
29492        );
29493    }
29494
29495    /// Returns a copy with the `SH1` field set to the given value.
29496    pub const fn with_sh1(mut self, value: u8) -> Self {
29497        self.set_sh1(value);
29498        self
29499    }
29500
29501    /// Returns the value of the `TG1` field.
29502    pub const fn tg1(self) -> u8 {
29503        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
29504    }
29505
29506    /// Sets the value of the `TG1` field.
29507    pub const fn set_tg1(&mut self, value: u8) {
29508        let offset = Self::TG1_SHIFT;
29509        assert!(value & (Self::TG1_MASK as u8) == value);
29510        *self = Self::from_bits_retain(
29511            (self.bits() & !(Self::TG1_MASK << offset)) | ((value as u64) << offset),
29512        );
29513    }
29514
29515    /// Returns a copy with the `TG1` field set to the given value.
29516    pub const fn with_tg1(mut self, value: u8) -> Self {
29517        self.set_tg1(value);
29518        self
29519    }
29520
29521    /// Returns the value of the `IPS` field.
29522    pub const fn ips(self) -> u8 {
29523        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
29524    }
29525
29526    /// Sets the value of the `IPS` field.
29527    pub const fn set_ips(&mut self, value: u8) {
29528        let offset = Self::IPS_SHIFT;
29529        assert!(value & (Self::IPS_MASK as u8) == value);
29530        *self = Self::from_bits_retain(
29531            (self.bits() & !(Self::IPS_MASK << offset)) | ((value as u64) << offset),
29532        );
29533    }
29534
29535    /// Returns a copy with the `IPS` field set to the given value.
29536    pub const fn with_ips(mut self, value: u8) -> Self {
29537        self.set_ips(value);
29538        self
29539    }
29540
29541    /// Returns the value of the `VTB` field.
29542    pub const fn vtb(self) -> u8 {
29543        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
29544    }
29545
29546    /// Sets the value of the `VTB` field.
29547    pub const fn set_vtb(&mut self, value: u8) {
29548        let offset = Self::VTB_SHIFT;
29549        assert!(value & (Self::VTB_MASK as u8) == value);
29550        *self = Self::from_bits_retain(
29551            (self.bits() & !(Self::VTB_MASK << offset)) | ((value as u64) << offset),
29552        );
29553    }
29554
29555    /// Returns a copy with the `VTB` field set to the given value.
29556    pub const fn with_vtb(mut self, value: u8) -> Self {
29557        self.set_vtb(value);
29558        self
29559    }
29560}
29561
29562#[cfg(feature = "el3")]
29563bitflags! {
29564    /// `TCR_EL3` system register value.
29565    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29566    #[repr(transparent)]
29567    pub struct TcrEl3: u64 {
29568        /// RES1 bits in the `TCR_EL3` register.
29569        const RES1 = 0b10000000100000000000000000000000;
29570        /// `TBI` bit.
29571        const TBI = 1 << 20;
29572        /// `HA` bit.
29573        const HA = 1 << 21;
29574        /// `HD` bit.
29575        const HD = 1 << 22;
29576        /// `HPD` bit.
29577        const HPD = 1 << 24;
29578        /// `HWU59` bit.
29579        const HWU59 = 1 << 25;
29580        /// `HWU60` bit.
29581        const HWU60 = 1 << 26;
29582        /// `HWU61` bit.
29583        const HWU61 = 1 << 27;
29584        /// `HWU62` bit.
29585        const HWU62 = 1 << 28;
29586        /// `TBID` bit.
29587        const TBID = 1 << 29;
29588        /// `TCMA` bit.
29589        const TCMA = 1 << 30;
29590        /// `DS` bit.
29591        const DS = 1 << 32;
29592        /// `MTX` bit.
29593        const MTX = 1 << 33;
29594        /// `PnCH` bit.
29595        const PNCH = 1 << 34;
29596        /// `PIE` bit.
29597        const PIE = 1 << 35;
29598        /// `POE` bit.
29599        const POE = 1 << 36;
29600        /// `AIE` bit.
29601        const AIE = 1 << 37;
29602        /// `D128` bit.
29603        const D128 = 1 << 38;
29604        /// `PTTWI` bit.
29605        const PTTWI = 1 << 41;
29606        /// `HAFT` bit.
29607        const HAFT = 1 << 42;
29608        /// `DisCH0` bit.
29609        const DISCH0 = 1 << 43;
29610        /// `POE2F` bit.
29611        const POE2F = 1 << 44;
29612        /// `TVAD` bit.
29613        const TVAD = 1 << 53;
29614    }
29615}
29616
29617#[cfg(feature = "el3")]
29618impl TcrEl3 {
29619    /// Offset of the `T0SZ` field.
29620    pub const T0SZ_SHIFT: u32 = 0;
29621    /// Mask for the `T0SZ` field.
29622    pub const T0SZ_MASK: u64 = 0b111111;
29623    /// Offset of the `IRGN0` field.
29624    pub const IRGN0_SHIFT: u32 = 8;
29625    /// Mask for the `IRGN0` field.
29626    pub const IRGN0_MASK: u64 = 0b11;
29627    /// Offset of the `ORGN0` field.
29628    pub const ORGN0_SHIFT: u32 = 10;
29629    /// Mask for the `ORGN0` field.
29630    pub const ORGN0_MASK: u64 = 0b11;
29631    /// Offset of the `SH0` field.
29632    pub const SH0_SHIFT: u32 = 12;
29633    /// Mask for the `SH0` field.
29634    pub const SH0_MASK: u64 = 0b11;
29635    /// Offset of the `TG0` field.
29636    pub const TG0_SHIFT: u32 = 14;
29637    /// Mask for the `TG0` field.
29638    pub const TG0_MASK: u64 = 0b11;
29639    /// Offset of the `PS` field.
29640    pub const PS_SHIFT: u32 = 16;
29641    /// Mask for the `PS` field.
29642    pub const PS_MASK: u64 = 0b111;
29643    /// Offset of the `TBI` field.
29644    pub const TBI_SHIFT: u32 = 20;
29645    /// Offset of the `HA` field.
29646    pub const HA_SHIFT: u32 = 21;
29647    /// Offset of the `HD` field.
29648    pub const HD_SHIFT: u32 = 22;
29649    /// Offset of the `HPD` field.
29650    pub const HPD_SHIFT: u32 = 24;
29651    /// Offset of the `HWU59` field.
29652    pub const HWU59_SHIFT: u32 = 25;
29653    /// Offset of the `HWU60` field.
29654    pub const HWU60_SHIFT: u32 = 26;
29655    /// Offset of the `HWU61` field.
29656    pub const HWU61_SHIFT: u32 = 27;
29657    /// Offset of the `HWU62` field.
29658    pub const HWU62_SHIFT: u32 = 28;
29659    /// Offset of the `TBID` field.
29660    pub const TBID_SHIFT: u32 = 29;
29661    /// Offset of the `TCMA` field.
29662    pub const TCMA_SHIFT: u32 = 30;
29663    /// Offset of the `DS` field.
29664    pub const DS_SHIFT: u32 = 32;
29665    /// Offset of the `MTX` field.
29666    pub const MTX_SHIFT: u32 = 33;
29667    /// Offset of the `PnCH` field.
29668    pub const PNCH_SHIFT: u32 = 34;
29669    /// Offset of the `PIE` field.
29670    pub const PIE_SHIFT: u32 = 35;
29671    /// Offset of the `POE` field.
29672    pub const POE_SHIFT: u32 = 36;
29673    /// Offset of the `AIE` field.
29674    pub const AIE_SHIFT: u32 = 37;
29675    /// Offset of the `D128` field.
29676    pub const D128_SHIFT: u32 = 38;
29677    /// Offset of the `PTTWI` field.
29678    pub const PTTWI_SHIFT: u32 = 41;
29679    /// Offset of the `HAFT` field.
29680    pub const HAFT_SHIFT: u32 = 42;
29681    /// Offset of the `DisCH0` field.
29682    pub const DISCH0_SHIFT: u32 = 43;
29683    /// Offset of the `POE2F` field.
29684    pub const POE2F_SHIFT: u32 = 44;
29685    /// Offset of the `POIW` field.
29686    pub const POIW_SHIFT: u32 = 45;
29687    /// Mask for the `POIW` field.
29688    pub const POIW_MASK: u64 = 0b111;
29689    /// Offset of the `VTB` field.
29690    pub const VTB_SHIFT: u32 = 48;
29691    /// Mask for the `VTB` field.
29692    pub const VTB_MASK: u64 = 0b11111;
29693    /// Offset of the `TVAD` field.
29694    pub const TVAD_SHIFT: u32 = 53;
29695
29696    /// Returns the value of the `T0SZ` field.
29697    pub const fn t0sz(self) -> u8 {
29698        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
29699    }
29700
29701    /// Sets the value of the `T0SZ` field.
29702    pub const fn set_t0sz(&mut self, value: u8) {
29703        let offset = Self::T0SZ_SHIFT;
29704        assert!(value & (Self::T0SZ_MASK as u8) == value);
29705        *self = Self::from_bits_retain(
29706            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
29707        );
29708    }
29709
29710    /// Returns a copy with the `T0SZ` field set to the given value.
29711    pub const fn with_t0sz(mut self, value: u8) -> Self {
29712        self.set_t0sz(value);
29713        self
29714    }
29715
29716    /// Returns the value of the `IRGN0` field.
29717    pub const fn irgn0(self) -> u8 {
29718        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
29719    }
29720
29721    /// Sets the value of the `IRGN0` field.
29722    pub const fn set_irgn0(&mut self, value: u8) {
29723        let offset = Self::IRGN0_SHIFT;
29724        assert!(value & (Self::IRGN0_MASK as u8) == value);
29725        *self = Self::from_bits_retain(
29726            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
29727        );
29728    }
29729
29730    /// Returns a copy with the `IRGN0` field set to the given value.
29731    pub const fn with_irgn0(mut self, value: u8) -> Self {
29732        self.set_irgn0(value);
29733        self
29734    }
29735
29736    /// Returns the value of the `ORGN0` field.
29737    pub const fn orgn0(self) -> u8 {
29738        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
29739    }
29740
29741    /// Sets the value of the `ORGN0` field.
29742    pub const fn set_orgn0(&mut self, value: u8) {
29743        let offset = Self::ORGN0_SHIFT;
29744        assert!(value & (Self::ORGN0_MASK as u8) == value);
29745        *self = Self::from_bits_retain(
29746            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
29747        );
29748    }
29749
29750    /// Returns a copy with the `ORGN0` field set to the given value.
29751    pub const fn with_orgn0(mut self, value: u8) -> Self {
29752        self.set_orgn0(value);
29753        self
29754    }
29755
29756    /// Returns the value of the `SH0` field.
29757    pub const fn sh0(self) -> u8 {
29758        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
29759    }
29760
29761    /// Sets the value of the `SH0` field.
29762    pub const fn set_sh0(&mut self, value: u8) {
29763        let offset = Self::SH0_SHIFT;
29764        assert!(value & (Self::SH0_MASK as u8) == value);
29765        *self = Self::from_bits_retain(
29766            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
29767        );
29768    }
29769
29770    /// Returns a copy with the `SH0` field set to the given value.
29771    pub const fn with_sh0(mut self, value: u8) -> Self {
29772        self.set_sh0(value);
29773        self
29774    }
29775
29776    /// Returns the value of the `TG0` field.
29777    pub const fn tg0(self) -> u8 {
29778        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
29779    }
29780
29781    /// Sets the value of the `TG0` field.
29782    pub const fn set_tg0(&mut self, value: u8) {
29783        let offset = Self::TG0_SHIFT;
29784        assert!(value & (Self::TG0_MASK as u8) == value);
29785        *self = Self::from_bits_retain(
29786            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
29787        );
29788    }
29789
29790    /// Returns a copy with the `TG0` field set to the given value.
29791    pub const fn with_tg0(mut self, value: u8) -> Self {
29792        self.set_tg0(value);
29793        self
29794    }
29795
29796    /// Returns the value of the `PS` field.
29797    pub const fn ps(self) -> u8 {
29798        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
29799    }
29800
29801    /// Sets the value of the `PS` field.
29802    pub const fn set_ps(&mut self, value: u8) {
29803        let offset = Self::PS_SHIFT;
29804        assert!(value & (Self::PS_MASK as u8) == value);
29805        *self = Self::from_bits_retain(
29806            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
29807        );
29808    }
29809
29810    /// Returns a copy with the `PS` field set to the given value.
29811    pub const fn with_ps(mut self, value: u8) -> Self {
29812        self.set_ps(value);
29813        self
29814    }
29815
29816    /// Returns the value of the `POIW` field.
29817    pub const fn poiw(self) -> u8 {
29818        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
29819    }
29820
29821    /// Sets the value of the `POIW` field.
29822    pub const fn set_poiw(&mut self, value: u8) {
29823        let offset = Self::POIW_SHIFT;
29824        assert!(value & (Self::POIW_MASK as u8) == value);
29825        *self = Self::from_bits_retain(
29826            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
29827        );
29828    }
29829
29830    /// Returns a copy with the `POIW` field set to the given value.
29831    pub const fn with_poiw(mut self, value: u8) -> Self {
29832        self.set_poiw(value);
29833        self
29834    }
29835
29836    /// Returns the value of the `VTB` field.
29837    pub const fn vtb(self) -> u8 {
29838        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
29839    }
29840
29841    /// Sets the value of the `VTB` field.
29842    pub const fn set_vtb(&mut self, value: u8) {
29843        let offset = Self::VTB_SHIFT;
29844        assert!(value & (Self::VTB_MASK as u8) == value);
29845        *self = Self::from_bits_retain(
29846            (self.bits() & !(Self::VTB_MASK << offset)) | ((value as u64) << offset),
29847        );
29848    }
29849
29850    /// Returns a copy with the `VTB` field set to the given value.
29851    pub const fn with_vtb(mut self, value: u8) -> Self {
29852        self.set_vtb(value);
29853        self
29854    }
29855}
29856
29857#[cfg(feature = "el1")]
29858bitflags! {
29859    /// `TFSRE0_EL1` system register value.
29860    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29861    #[repr(transparent)]
29862    pub struct Tfsre0El1: u64 {
29863        /// `TF0` bit.
29864        const TF0 = 1 << 0;
29865        /// `TF1` bit.
29866        const TF1 = 1 << 1;
29867    }
29868}
29869
29870#[cfg(feature = "el1")]
29871impl Tfsre0El1 {
29872    /// Offset of the `TF0` field.
29873    pub const TF0_SHIFT: u32 = 0;
29874    /// Offset of the `TF1` field.
29875    pub const TF1_SHIFT: u32 = 1;
29876}
29877
29878#[cfg(feature = "el1")]
29879bitflags! {
29880    /// `TFSR_EL1` system register value.
29881    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29882    #[repr(transparent)]
29883    pub struct TfsrEl1: u64 {
29884        /// `TF0` bit.
29885        const TF0 = 1 << 0;
29886        /// `TF1` bit.
29887        const TF1 = 1 << 1;
29888    }
29889}
29890
29891#[cfg(feature = "el1")]
29892impl TfsrEl1 {
29893    /// Offset of the `TF0` field.
29894    pub const TF0_SHIFT: u32 = 0;
29895    /// Offset of the `TF1` field.
29896    pub const TF1_SHIFT: u32 = 1;
29897}
29898
29899#[cfg(feature = "el2")]
29900bitflags! {
29901    /// `TFSR_EL2` system register value.
29902    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29903    #[repr(transparent)]
29904    pub struct TfsrEl2: u64 {
29905        /// `TF0` bit.
29906        const TF0 = 1 << 0;
29907        /// `TF1` bit.
29908        const TF1 = 1 << 1;
29909    }
29910}
29911
29912#[cfg(feature = "el2")]
29913impl TfsrEl2 {
29914    /// Offset of the `TF0` field.
29915    pub const TF0_SHIFT: u32 = 0;
29916    /// Offset of the `TF1` field.
29917    pub const TF1_SHIFT: u32 = 1;
29918}
29919
29920bitflags! {
29921    /// `TLBTR` system register value.
29922    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29923    #[repr(transparent)]
29924    pub struct Tlbtr: u32 {
29925        /// `nU` bit.
29926        const NU = 1 << 0;
29927    }
29928}
29929
29930impl Tlbtr {
29931    /// Offset of the `nU` field.
29932    pub const NU_SHIFT: u32 = 0;
29933}
29934
29935bitflags! {
29936    /// `TPIDRPRW` system register value.
29937    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29938    #[repr(transparent)]
29939    pub struct Tpidrprw: u32 {
29940    }
29941}
29942
29943impl Tpidrprw {
29944    /// Offset of the `TID` field.
29945    pub const TID_SHIFT: u32 = 0;
29946    /// Mask for the `TID` field.
29947    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
29948
29949    /// Returns the value of the `TID` field.
29950    pub const fn tid(self) -> u32 {
29951        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
29952    }
29953
29954    /// Sets the value of the `TID` field.
29955    pub const fn set_tid(&mut self, value: u32) {
29956        let offset = Self::TID_SHIFT;
29957        assert!(value & (Self::TID_MASK as u32) == value);
29958        *self = Self::from_bits_retain(
29959            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
29960        );
29961    }
29962
29963    /// Returns a copy with the `TID` field set to the given value.
29964    pub const fn with_tid(mut self, value: u32) -> Self {
29965        self.set_tid(value);
29966        self
29967    }
29968}
29969
29970bitflags! {
29971    /// `TPIDRRO_EL0` system register value.
29972    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29973    #[repr(transparent)]
29974    pub struct TpidrroEl0: u64 {
29975    }
29976}
29977
29978impl TpidrroEl0 {
29979    /// Offset of the `ThreadID` field.
29980    pub const THREADID_SHIFT: u32 = 0;
29981    /// Mask for the `ThreadID` field.
29982    pub const THREADID_MASK: u64 =
29983        0b1111111111111111111111111111111111111111111111111111111111111111;
29984
29985    /// Returns the value of the `ThreadID` field.
29986    pub const fn threadid(self) -> u64 {
29987        ((self.bits() >> Self::THREADID_SHIFT)
29988            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
29989    }
29990
29991    /// Sets the value of the `ThreadID` field.
29992    pub const fn set_threadid(&mut self, value: u64) {
29993        let offset = Self::THREADID_SHIFT;
29994        assert!(value & (Self::THREADID_MASK as u64) == value);
29995        *self = Self::from_bits_retain(
29996            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
29997        );
29998    }
29999
30000    /// Returns a copy with the `ThreadID` field set to the given value.
30001    pub const fn with_threadid(mut self, value: u64) -> Self {
30002        self.set_threadid(value);
30003        self
30004    }
30005}
30006
30007bitflags! {
30008    /// `TPIDRURO` system register value.
30009    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30010    #[repr(transparent)]
30011    pub struct Tpidruro: u32 {
30012    }
30013}
30014
30015impl Tpidruro {
30016    /// Offset of the `TID` field.
30017    pub const TID_SHIFT: u32 = 0;
30018    /// Mask for the `TID` field.
30019    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
30020
30021    /// Returns the value of the `TID` field.
30022    pub const fn tid(self) -> u32 {
30023        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
30024    }
30025
30026    /// Sets the value of the `TID` field.
30027    pub const fn set_tid(&mut self, value: u32) {
30028        let offset = Self::TID_SHIFT;
30029        assert!(value & (Self::TID_MASK as u32) == value);
30030        *self = Self::from_bits_retain(
30031            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
30032        );
30033    }
30034
30035    /// Returns a copy with the `TID` field set to the given value.
30036    pub const fn with_tid(mut self, value: u32) -> Self {
30037        self.set_tid(value);
30038        self
30039    }
30040}
30041
30042bitflags! {
30043    /// `TPIDRURW` system register value.
30044    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30045    #[repr(transparent)]
30046    pub struct Tpidrurw: u32 {
30047    }
30048}
30049
30050impl Tpidrurw {
30051    /// Offset of the `TID` field.
30052    pub const TID_SHIFT: u32 = 0;
30053    /// Mask for the `TID` field.
30054    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
30055
30056    /// Returns the value of the `TID` field.
30057    pub const fn tid(self) -> u32 {
30058        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
30059    }
30060
30061    /// Sets the value of the `TID` field.
30062    pub const fn set_tid(&mut self, value: u32) {
30063        let offset = Self::TID_SHIFT;
30064        assert!(value & (Self::TID_MASK as u32) == value);
30065        *self = Self::from_bits_retain(
30066            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
30067        );
30068    }
30069
30070    /// Returns a copy with the `TID` field set to the given value.
30071    pub const fn with_tid(mut self, value: u32) -> Self {
30072        self.set_tid(value);
30073        self
30074    }
30075}
30076
30077bitflags! {
30078    /// `TPIDR_EL0` system register value.
30079    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30080    #[repr(transparent)]
30081    pub struct TpidrEl0: u64 {
30082    }
30083}
30084
30085impl TpidrEl0 {
30086    /// Offset of the `ThreadID` field.
30087    pub const THREADID_SHIFT: u32 = 0;
30088    /// Mask for the `ThreadID` field.
30089    pub const THREADID_MASK: u64 =
30090        0b1111111111111111111111111111111111111111111111111111111111111111;
30091
30092    /// Returns the value of the `ThreadID` field.
30093    pub const fn threadid(self) -> u64 {
30094        ((self.bits() >> Self::THREADID_SHIFT)
30095            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
30096    }
30097
30098    /// Sets the value of the `ThreadID` field.
30099    pub const fn set_threadid(&mut self, value: u64) {
30100        let offset = Self::THREADID_SHIFT;
30101        assert!(value & (Self::THREADID_MASK as u64) == value);
30102        *self = Self::from_bits_retain(
30103            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
30104        );
30105    }
30106
30107    /// Returns a copy with the `ThreadID` field set to the given value.
30108    pub const fn with_threadid(mut self, value: u64) -> Self {
30109        self.set_threadid(value);
30110        self
30111    }
30112}
30113
30114#[cfg(feature = "el1")]
30115bitflags! {
30116    /// `TPIDR_EL1` system register value.
30117    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30118    #[repr(transparent)]
30119    pub struct TpidrEl1: u64 {
30120    }
30121}
30122
30123#[cfg(feature = "el1")]
30124impl TpidrEl1 {
30125    /// Offset of the `ThreadID` field.
30126    pub const THREADID_SHIFT: u32 = 0;
30127    /// Mask for the `ThreadID` field.
30128    pub const THREADID_MASK: u64 =
30129        0b1111111111111111111111111111111111111111111111111111111111111111;
30130
30131    /// Returns the value of the `ThreadID` field.
30132    pub const fn threadid(self) -> u64 {
30133        ((self.bits() >> Self::THREADID_SHIFT)
30134            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
30135    }
30136
30137    /// Sets the value of the `ThreadID` field.
30138    pub const fn set_threadid(&mut self, value: u64) {
30139        let offset = Self::THREADID_SHIFT;
30140        assert!(value & (Self::THREADID_MASK as u64) == value);
30141        *self = Self::from_bits_retain(
30142            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
30143        );
30144    }
30145
30146    /// Returns a copy with the `ThreadID` field set to the given value.
30147    pub const fn with_threadid(mut self, value: u64) -> Self {
30148        self.set_threadid(value);
30149        self
30150    }
30151}
30152
30153#[cfg(feature = "el2")]
30154bitflags! {
30155    /// `TPIDR_EL2` system register value.
30156    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30157    #[repr(transparent)]
30158    pub struct TpidrEl2: u64 {
30159    }
30160}
30161
30162#[cfg(feature = "el2")]
30163impl TpidrEl2 {
30164    /// Offset of the `ThreadID` field.
30165    pub const THREADID_SHIFT: u32 = 0;
30166    /// Mask for the `ThreadID` field.
30167    pub const THREADID_MASK: u64 =
30168        0b1111111111111111111111111111111111111111111111111111111111111111;
30169
30170    /// Returns the value of the `ThreadID` field.
30171    pub const fn threadid(self) -> u64 {
30172        ((self.bits() >> Self::THREADID_SHIFT)
30173            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
30174    }
30175
30176    /// Sets the value of the `ThreadID` field.
30177    pub const fn set_threadid(&mut self, value: u64) {
30178        let offset = Self::THREADID_SHIFT;
30179        assert!(value & (Self::THREADID_MASK as u64) == value);
30180        *self = Self::from_bits_retain(
30181            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
30182        );
30183    }
30184
30185    /// Returns a copy with the `ThreadID` field set to the given value.
30186    pub const fn with_threadid(mut self, value: u64) -> Self {
30187        self.set_threadid(value);
30188        self
30189    }
30190}
30191
30192#[cfg(feature = "el3")]
30193bitflags! {
30194    /// `TPIDR_EL3` system register value.
30195    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30196    #[repr(transparent)]
30197    pub struct TpidrEl3: u64 {
30198    }
30199}
30200
30201#[cfg(feature = "el3")]
30202impl TpidrEl3 {
30203    /// Offset of the `ThreadID` field.
30204    pub const THREADID_SHIFT: u32 = 0;
30205    /// Mask for the `ThreadID` field.
30206    pub const THREADID_MASK: u64 =
30207        0b1111111111111111111111111111111111111111111111111111111111111111;
30208
30209    /// Returns the value of the `ThreadID` field.
30210    pub const fn threadid(self) -> u64 {
30211        ((self.bits() >> Self::THREADID_SHIFT)
30212            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
30213    }
30214
30215    /// Sets the value of the `ThreadID` field.
30216    pub const fn set_threadid(&mut self, value: u64) {
30217        let offset = Self::THREADID_SHIFT;
30218        assert!(value & (Self::THREADID_MASK as u64) == value);
30219        *self = Self::from_bits_retain(
30220            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
30221        );
30222    }
30223
30224    /// Returns a copy with the `ThreadID` field set to the given value.
30225    pub const fn with_threadid(mut self, value: u64) -> Self {
30226        self.set_threadid(value);
30227        self
30228    }
30229}
30230
30231bitflags! {
30232    /// `TRFCR` system register value.
30233    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30234    #[repr(transparent)]
30235    pub struct Trfcr: u32 {
30236        /// `E0TRE` bit.
30237        const E0TRE = 1 << 0;
30238        /// `E1TRE` bit.
30239        const E1TRE = 1 << 1;
30240    }
30241}
30242
30243impl Trfcr {
30244    /// Offset of the `E0TRE` field.
30245    pub const E0TRE_SHIFT: u32 = 0;
30246    /// Offset of the `E1TRE` field.
30247    pub const E1TRE_SHIFT: u32 = 1;
30248    /// Offset of the `TS` field.
30249    pub const TS_SHIFT: u32 = 5;
30250    /// Mask for the `TS` field.
30251    pub const TS_MASK: u32 = 0b11;
30252
30253    /// Returns the value of the `TS` field.
30254    pub const fn ts(self) -> u8 {
30255        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
30256    }
30257
30258    /// Sets the value of the `TS` field.
30259    pub const fn set_ts(&mut self, value: u8) {
30260        let offset = Self::TS_SHIFT;
30261        assert!(value & (Self::TS_MASK as u8) == value);
30262        *self = Self::from_bits_retain(
30263            (self.bits() & !(Self::TS_MASK << offset)) | ((value as u32) << offset),
30264        );
30265    }
30266
30267    /// Returns a copy with the `TS` field set to the given value.
30268    pub const fn with_ts(mut self, value: u8) -> Self {
30269        self.set_ts(value);
30270        self
30271    }
30272}
30273
30274bitflags! {
30275    /// `TTBCR` system register value.
30276    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30277    #[repr(transparent)]
30278    pub struct Ttbcr: u32 {
30279        /// `PD0` bit.
30280        const PD0 = 1 << 4;
30281        /// `PD1` bit.
30282        const PD1 = 1 << 5;
30283        /// `T2E` bit.
30284        const T2E = 1 << 6;
30285        /// `EPD0` bit.
30286        const EPD0 = 1 << 7;
30287        /// `A1` bit.
30288        const A1 = 1 << 22;
30289        /// `EPD1` bit.
30290        const EPD1 = 1 << 23;
30291        /// `EAE` bit.
30292        const EAE = 1 << 31;
30293    }
30294}
30295
30296impl Ttbcr {
30297    /// Offset of the `N` field.
30298    pub const N_SHIFT: u32 = 0;
30299    /// Mask for the `N` field.
30300    pub const N_MASK: u32 = 0b111;
30301    /// Offset of the `T0SZ` field.
30302    pub const T0SZ_SHIFT: u32 = 0;
30303    /// Mask for the `T0SZ` field.
30304    pub const T0SZ_MASK: u32 = 0b111;
30305    /// Offset of the `PD0` field.
30306    pub const PD0_SHIFT: u32 = 4;
30307    /// Offset of the `PD1` field.
30308    pub const PD1_SHIFT: u32 = 5;
30309    /// Offset of the `T2E` field.
30310    pub const T2E_SHIFT: u32 = 6;
30311    /// Offset of the `EPD0` field.
30312    pub const EPD0_SHIFT: u32 = 7;
30313    /// Offset of the `IRGN0` field.
30314    pub const IRGN0_SHIFT: u32 = 8;
30315    /// Mask for the `IRGN0` field.
30316    pub const IRGN0_MASK: u32 = 0b11;
30317    /// Offset of the `ORGN0` field.
30318    pub const ORGN0_SHIFT: u32 = 10;
30319    /// Mask for the `ORGN0` field.
30320    pub const ORGN0_MASK: u32 = 0b11;
30321    /// Offset of the `SH0` field.
30322    pub const SH0_SHIFT: u32 = 12;
30323    /// Mask for the `SH0` field.
30324    pub const SH0_MASK: u32 = 0b11;
30325    /// Offset of the `T1SZ` field.
30326    pub const T1SZ_SHIFT: u32 = 16;
30327    /// Mask for the `T1SZ` field.
30328    pub const T1SZ_MASK: u32 = 0b111;
30329    /// Offset of the `A1` field.
30330    pub const A1_SHIFT: u32 = 22;
30331    /// Offset of the `EPD1` field.
30332    pub const EPD1_SHIFT: u32 = 23;
30333    /// Offset of the `IRGN1` field.
30334    pub const IRGN1_SHIFT: u32 = 24;
30335    /// Mask for the `IRGN1` field.
30336    pub const IRGN1_MASK: u32 = 0b11;
30337    /// Offset of the `ORGN1` field.
30338    pub const ORGN1_SHIFT: u32 = 26;
30339    /// Mask for the `ORGN1` field.
30340    pub const ORGN1_MASK: u32 = 0b11;
30341    /// Offset of the `SH1` field.
30342    pub const SH1_SHIFT: u32 = 28;
30343    /// Mask for the `SH1` field.
30344    pub const SH1_MASK: u32 = 0b11;
30345    /// Offset of the `EAE` field.
30346    pub const EAE_SHIFT: u32 = 31;
30347
30348    /// Returns the value of the `N` field.
30349    pub const fn n(self) -> u8 {
30350        ((self.bits() >> Self::N_SHIFT) & 0b111) as u8
30351    }
30352
30353    /// Sets the value of the `N` field.
30354    pub const fn set_n(&mut self, value: u8) {
30355        let offset = Self::N_SHIFT;
30356        assert!(value & (Self::N_MASK as u8) == value);
30357        *self = Self::from_bits_retain(
30358            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
30359        );
30360    }
30361
30362    /// Returns a copy with the `N` field set to the given value.
30363    pub const fn with_n(mut self, value: u8) -> Self {
30364        self.set_n(value);
30365        self
30366    }
30367
30368    /// Returns the value of the `T0SZ` field.
30369    pub const fn t0sz(self) -> u8 {
30370        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
30371    }
30372
30373    /// Sets the value of the `T0SZ` field.
30374    pub const fn set_t0sz(&mut self, value: u8) {
30375        let offset = Self::T0SZ_SHIFT;
30376        assert!(value & (Self::T0SZ_MASK as u8) == value);
30377        *self = Self::from_bits_retain(
30378            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
30379        );
30380    }
30381
30382    /// Returns a copy with the `T0SZ` field set to the given value.
30383    pub const fn with_t0sz(mut self, value: u8) -> Self {
30384        self.set_t0sz(value);
30385        self
30386    }
30387
30388    /// Returns the value of the `IRGN0` field.
30389    pub const fn irgn0(self) -> u8 {
30390        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
30391    }
30392
30393    /// Sets the value of the `IRGN0` field.
30394    pub const fn set_irgn0(&mut self, value: u8) {
30395        let offset = Self::IRGN0_SHIFT;
30396        assert!(value & (Self::IRGN0_MASK as u8) == value);
30397        *self = Self::from_bits_retain(
30398            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
30399        );
30400    }
30401
30402    /// Returns a copy with the `IRGN0` field set to the given value.
30403    pub const fn with_irgn0(mut self, value: u8) -> Self {
30404        self.set_irgn0(value);
30405        self
30406    }
30407
30408    /// Returns the value of the `ORGN0` field.
30409    pub const fn orgn0(self) -> u8 {
30410        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
30411    }
30412
30413    /// Sets the value of the `ORGN0` field.
30414    pub const fn set_orgn0(&mut self, value: u8) {
30415        let offset = Self::ORGN0_SHIFT;
30416        assert!(value & (Self::ORGN0_MASK as u8) == value);
30417        *self = Self::from_bits_retain(
30418            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
30419        );
30420    }
30421
30422    /// Returns a copy with the `ORGN0` field set to the given value.
30423    pub const fn with_orgn0(mut self, value: u8) -> Self {
30424        self.set_orgn0(value);
30425        self
30426    }
30427
30428    /// Returns the value of the `SH0` field.
30429    pub const fn sh0(self) -> u8 {
30430        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
30431    }
30432
30433    /// Sets the value of the `SH0` field.
30434    pub const fn set_sh0(&mut self, value: u8) {
30435        let offset = Self::SH0_SHIFT;
30436        assert!(value & (Self::SH0_MASK as u8) == value);
30437        *self = Self::from_bits_retain(
30438            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
30439        );
30440    }
30441
30442    /// Returns a copy with the `SH0` field set to the given value.
30443    pub const fn with_sh0(mut self, value: u8) -> Self {
30444        self.set_sh0(value);
30445        self
30446    }
30447
30448    /// Returns the value of the `T1SZ` field.
30449    pub const fn t1sz(self) -> u8 {
30450        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111) as u8
30451    }
30452
30453    /// Sets the value of the `T1SZ` field.
30454    pub const fn set_t1sz(&mut self, value: u8) {
30455        let offset = Self::T1SZ_SHIFT;
30456        assert!(value & (Self::T1SZ_MASK as u8) == value);
30457        *self = Self::from_bits_retain(
30458            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u32) << offset),
30459        );
30460    }
30461
30462    /// Returns a copy with the `T1SZ` field set to the given value.
30463    pub const fn with_t1sz(mut self, value: u8) -> Self {
30464        self.set_t1sz(value);
30465        self
30466    }
30467
30468    /// Returns the value of the `IRGN1` field.
30469    pub const fn irgn1(self) -> u8 {
30470        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
30471    }
30472
30473    /// Sets the value of the `IRGN1` field.
30474    pub const fn set_irgn1(&mut self, value: u8) {
30475        let offset = Self::IRGN1_SHIFT;
30476        assert!(value & (Self::IRGN1_MASK as u8) == value);
30477        *self = Self::from_bits_retain(
30478            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u32) << offset),
30479        );
30480    }
30481
30482    /// Returns a copy with the `IRGN1` field set to the given value.
30483    pub const fn with_irgn1(mut self, value: u8) -> Self {
30484        self.set_irgn1(value);
30485        self
30486    }
30487
30488    /// Returns the value of the `ORGN1` field.
30489    pub const fn orgn1(self) -> u8 {
30490        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
30491    }
30492
30493    /// Sets the value of the `ORGN1` field.
30494    pub const fn set_orgn1(&mut self, value: u8) {
30495        let offset = Self::ORGN1_SHIFT;
30496        assert!(value & (Self::ORGN1_MASK as u8) == value);
30497        *self = Self::from_bits_retain(
30498            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u32) << offset),
30499        );
30500    }
30501
30502    /// Returns a copy with the `ORGN1` field set to the given value.
30503    pub const fn with_orgn1(mut self, value: u8) -> Self {
30504        self.set_orgn1(value);
30505        self
30506    }
30507
30508    /// Returns the value of the `SH1` field.
30509    pub const fn sh1(self) -> u8 {
30510        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
30511    }
30512
30513    /// Sets the value of the `SH1` field.
30514    pub const fn set_sh1(&mut self, value: u8) {
30515        let offset = Self::SH1_SHIFT;
30516        assert!(value & (Self::SH1_MASK as u8) == value);
30517        *self = Self::from_bits_retain(
30518            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u32) << offset),
30519        );
30520    }
30521
30522    /// Returns a copy with the `SH1` field set to the given value.
30523    pub const fn with_sh1(mut self, value: u8) -> Self {
30524        self.set_sh1(value);
30525        self
30526    }
30527}
30528
30529bitflags! {
30530    /// `TTBCR2` system register value.
30531    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30532    #[repr(transparent)]
30533    pub struct Ttbcr2: u32 {
30534        /// `HPD0` bit.
30535        const HPD0 = 1 << 9;
30536        /// `HPD1` bit.
30537        const HPD1 = 1 << 10;
30538        /// `HWU059` bit.
30539        const HWU059 = 1 << 11;
30540        /// `HWU060` bit.
30541        const HWU060 = 1 << 12;
30542        /// `HWU061` bit.
30543        const HWU061 = 1 << 13;
30544        /// `HWU062` bit.
30545        const HWU062 = 1 << 14;
30546        /// `HWU159` bit.
30547        const HWU159 = 1 << 15;
30548        /// `HWU160` bit.
30549        const HWU160 = 1 << 16;
30550        /// `HWU161` bit.
30551        const HWU161 = 1 << 17;
30552        /// `HWU162` bit.
30553        const HWU162 = 1 << 18;
30554    }
30555}
30556
30557impl Ttbcr2 {
30558    /// Offset of the `HPD0` field.
30559    pub const HPD0_SHIFT: u32 = 9;
30560    /// Offset of the `HPD1` field.
30561    pub const HPD1_SHIFT: u32 = 10;
30562    /// Offset of the `HWU059` field.
30563    pub const HWU059_SHIFT: u32 = 11;
30564    /// Offset of the `HWU060` field.
30565    pub const HWU060_SHIFT: u32 = 12;
30566    /// Offset of the `HWU061` field.
30567    pub const HWU061_SHIFT: u32 = 13;
30568    /// Offset of the `HWU062` field.
30569    pub const HWU062_SHIFT: u32 = 14;
30570    /// Offset of the `HWU159` field.
30571    pub const HWU159_SHIFT: u32 = 15;
30572    /// Offset of the `HWU160` field.
30573    pub const HWU160_SHIFT: u32 = 16;
30574    /// Offset of the `HWU161` field.
30575    pub const HWU161_SHIFT: u32 = 17;
30576    /// Offset of the `HWU162` field.
30577    pub const HWU162_SHIFT: u32 = 18;
30578}
30579
30580bitflags! {
30581    /// `TTBR0` system register value.
30582    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30583    #[repr(transparent)]
30584    pub struct Ttbr0: u64 {
30585        /// `CnP` bit.
30586        const CNP = 1 << 0;
30587        /// `S` bit.
30588        const S = 1 << 1;
30589        /// `IMP` bit.
30590        const IMP = 1 << 2;
30591        /// `NOS` bit.
30592        const NOS = 1 << 5;
30593    }
30594}
30595
30596impl Ttbr0 {
30597    /// Offset of the `CnP` field.
30598    pub const CNP_SHIFT: u32 = 0;
30599    /// Offset of the `BADDR` field.
30600    pub const BADDR_SHIFT: u32 = 1;
30601    /// Mask for the `BADDR` field.
30602    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
30603    /// Offset of the `S` field.
30604    pub const S_SHIFT: u32 = 1;
30605    /// Offset of the `IMP` field.
30606    pub const IMP_SHIFT: u32 = 2;
30607    /// Offset of the `RGN` field.
30608    pub const RGN_SHIFT: u32 = 3;
30609    /// Mask for the `RGN` field.
30610    pub const RGN_MASK: u64 = 0b11;
30611    /// Offset of the `NOS` field.
30612    pub const NOS_SHIFT: u32 = 5;
30613    /// Offset of the `TTB0` field.
30614    pub const TTB0_SHIFT: u32 = 7;
30615    /// Mask for the `TTB0` field.
30616    pub const TTB0_MASK: u64 = 0b1111111111111111111111111;
30617    /// Offset of the `ASID` field.
30618    pub const ASID_SHIFT: u32 = 48;
30619    /// Mask for the `ASID` field.
30620    pub const ASID_MASK: u64 = 0b11111111;
30621
30622    /// Returns the value of the `BADDR` field.
30623    pub const fn baddr(self) -> u64 {
30624        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
30625            as u64
30626    }
30627
30628    /// Sets the value of the `BADDR` field.
30629    pub const fn set_baddr(&mut self, value: u64) {
30630        let offset = Self::BADDR_SHIFT;
30631        assert!(value & (Self::BADDR_MASK as u64) == value);
30632        *self = Self::from_bits_retain(
30633            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
30634        );
30635    }
30636
30637    /// Returns a copy with the `BADDR` field set to the given value.
30638    pub const fn with_baddr(mut self, value: u64) -> Self {
30639        self.set_baddr(value);
30640        self
30641    }
30642
30643    /// Returns the value of the `RGN` field.
30644    pub const fn rgn(self) -> u8 {
30645        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
30646    }
30647
30648    /// Sets the value of the `RGN` field.
30649    pub const fn set_rgn(&mut self, value: u8) {
30650        let offset = Self::RGN_SHIFT;
30651        assert!(value & (Self::RGN_MASK as u8) == value);
30652        *self = Self::from_bits_retain(
30653            (self.bits() & !(Self::RGN_MASK << offset)) | ((value as u64) << offset),
30654        );
30655    }
30656
30657    /// Returns a copy with the `RGN` field set to the given value.
30658    pub const fn with_rgn(mut self, value: u8) -> Self {
30659        self.set_rgn(value);
30660        self
30661    }
30662
30663    /// Returns the value of the `TTB0` field.
30664    pub const fn ttb0(self) -> u32 {
30665        ((self.bits() >> Self::TTB0_SHIFT) & 0b1111111111111111111111111) as u32
30666    }
30667
30668    /// Sets the value of the `TTB0` field.
30669    pub const fn set_ttb0(&mut self, value: u32) {
30670        let offset = Self::TTB0_SHIFT;
30671        assert!(value & (Self::TTB0_MASK as u32) == value);
30672        *self = Self::from_bits_retain(
30673            (self.bits() & !(Self::TTB0_MASK << offset)) | ((value as u64) << offset),
30674        );
30675    }
30676
30677    /// Returns a copy with the `TTB0` field set to the given value.
30678    pub const fn with_ttb0(mut self, value: u32) -> Self {
30679        self.set_ttb0(value);
30680        self
30681    }
30682
30683    /// Returns the value of the `ASID` field.
30684    pub const fn asid(self) -> u8 {
30685        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
30686    }
30687
30688    /// Sets the value of the `ASID` field.
30689    pub const fn set_asid(&mut self, value: u8) {
30690        let offset = Self::ASID_SHIFT;
30691        assert!(value & (Self::ASID_MASK as u8) == value);
30692        *self = Self::from_bits_retain(
30693            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
30694        );
30695    }
30696
30697    /// Returns a copy with the `ASID` field set to the given value.
30698    pub const fn with_asid(mut self, value: u8) -> Self {
30699        self.set_asid(value);
30700        self
30701    }
30702}
30703
30704#[cfg(feature = "el1")]
30705bitflags! {
30706    /// `TTBR0_EL1` system register value.
30707    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30708    #[repr(transparent)]
30709    pub struct Ttbr0El1: u64 {
30710        /// `CnP` bit.
30711        const CNP = 1 << 0;
30712    }
30713}
30714
30715#[cfg(feature = "el1")]
30716impl Ttbr0El1 {
30717    /// Offset of the `CnP` field.
30718    pub const CNP_SHIFT: u32 = 0;
30719    /// Offset of the `BADDR[47:1]` field.
30720    pub const BADDR_47_1_SHIFT: u32 = 1;
30721    /// Mask for the `BADDR[47:1]` field.
30722    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
30723    /// Offset of the `SKL` field.
30724    pub const SKL_SHIFT: u32 = 1;
30725    /// Mask for the `SKL` field.
30726    pub const SKL_MASK: u64 = 0b11;
30727    /// Offset of the `ASID` field.
30728    pub const ASID_SHIFT: u32 = 48;
30729    /// Mask for the `ASID` field.
30730    pub const ASID_MASK: u64 = 0b1111111111111111;
30731
30732    /// Returns the value of the `BADDR[47:1]` field.
30733    pub const fn baddr_47_1(self) -> u64 {
30734        ((self.bits() >> Self::BADDR_47_1_SHIFT)
30735            & 0b11111111111111111111111111111111111111111111111) as u64
30736    }
30737
30738    /// Sets the value of the `BADDR[47:1]` field.
30739    pub const fn set_baddr_47_1(&mut self, value: u64) {
30740        let offset = Self::BADDR_47_1_SHIFT;
30741        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
30742        *self = Self::from_bits_retain(
30743            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
30744        );
30745    }
30746
30747    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
30748    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
30749        self.set_baddr_47_1(value);
30750        self
30751    }
30752
30753    /// Returns the value of the `SKL` field.
30754    pub const fn skl(self) -> u8 {
30755        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
30756    }
30757
30758    /// Sets the value of the `SKL` field.
30759    pub const fn set_skl(&mut self, value: u8) {
30760        let offset = Self::SKL_SHIFT;
30761        assert!(value & (Self::SKL_MASK as u8) == value);
30762        *self = Self::from_bits_retain(
30763            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
30764        );
30765    }
30766
30767    /// Returns a copy with the `SKL` field set to the given value.
30768    pub const fn with_skl(mut self, value: u8) -> Self {
30769        self.set_skl(value);
30770        self
30771    }
30772
30773    /// Returns the value of the `ASID` field.
30774    pub const fn asid(self) -> u16 {
30775        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
30776    }
30777
30778    /// Sets the value of the `ASID` field.
30779    pub const fn set_asid(&mut self, value: u16) {
30780        let offset = Self::ASID_SHIFT;
30781        assert!(value & (Self::ASID_MASK as u16) == value);
30782        *self = Self::from_bits_retain(
30783            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
30784        );
30785    }
30786
30787    /// Returns a copy with the `ASID` field set to the given value.
30788    pub const fn with_asid(mut self, value: u16) -> Self {
30789        self.set_asid(value);
30790        self
30791    }
30792}
30793
30794#[cfg(feature = "el2")]
30795bitflags! {
30796    /// `TTBR0_EL2` system register value.
30797    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30798    #[repr(transparent)]
30799    pub struct Ttbr0El2: u64 {
30800        /// `CnP` bit.
30801        const CNP = 1 << 0;
30802    }
30803}
30804
30805#[cfg(feature = "el2")]
30806impl Ttbr0El2 {
30807    /// Offset of the `CnP` field.
30808    pub const CNP_SHIFT: u32 = 0;
30809    /// Offset of the `BADDR[47:1]` field.
30810    pub const BADDR_47_1_SHIFT: u32 = 1;
30811    /// Mask for the `BADDR[47:1]` field.
30812    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
30813    /// Offset of the `SKL` field.
30814    pub const SKL_SHIFT: u32 = 1;
30815    /// Mask for the `SKL` field.
30816    pub const SKL_MASK: u64 = 0b11;
30817    /// Offset of the `ASID` field.
30818    pub const ASID_SHIFT: u32 = 48;
30819    /// Mask for the `ASID` field.
30820    pub const ASID_MASK: u64 = 0b1111111111111111;
30821
30822    /// Returns the value of the `BADDR[47:1]` field.
30823    pub const fn baddr_47_1(self) -> u64 {
30824        ((self.bits() >> Self::BADDR_47_1_SHIFT)
30825            & 0b11111111111111111111111111111111111111111111111) as u64
30826    }
30827
30828    /// Sets the value of the `BADDR[47:1]` field.
30829    pub const fn set_baddr_47_1(&mut self, value: u64) {
30830        let offset = Self::BADDR_47_1_SHIFT;
30831        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
30832        *self = Self::from_bits_retain(
30833            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
30834        );
30835    }
30836
30837    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
30838    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
30839        self.set_baddr_47_1(value);
30840        self
30841    }
30842
30843    /// Returns the value of the `SKL` field.
30844    pub const fn skl(self) -> u8 {
30845        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
30846    }
30847
30848    /// Sets the value of the `SKL` field.
30849    pub const fn set_skl(&mut self, value: u8) {
30850        let offset = Self::SKL_SHIFT;
30851        assert!(value & (Self::SKL_MASK as u8) == value);
30852        *self = Self::from_bits_retain(
30853            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
30854        );
30855    }
30856
30857    /// Returns a copy with the `SKL` field set to the given value.
30858    pub const fn with_skl(mut self, value: u8) -> Self {
30859        self.set_skl(value);
30860        self
30861    }
30862
30863    /// Returns the value of the `ASID` field.
30864    pub const fn asid(self) -> u16 {
30865        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
30866    }
30867
30868    /// Sets the value of the `ASID` field.
30869    pub const fn set_asid(&mut self, value: u16) {
30870        let offset = Self::ASID_SHIFT;
30871        assert!(value & (Self::ASID_MASK as u16) == value);
30872        *self = Self::from_bits_retain(
30873            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
30874        );
30875    }
30876
30877    /// Returns a copy with the `ASID` field set to the given value.
30878    pub const fn with_asid(mut self, value: u16) -> Self {
30879        self.set_asid(value);
30880        self
30881    }
30882}
30883
30884#[cfg(feature = "el3")]
30885bitflags! {
30886    /// `TTBR0_EL3` system register value.
30887    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30888    #[repr(transparent)]
30889    pub struct Ttbr0El3: u64 {
30890        /// `CnP` bit.
30891        const CNP = 1 << 0;
30892    }
30893}
30894
30895#[cfg(feature = "el3")]
30896impl Ttbr0El3 {
30897    /// Offset of the `CnP` field.
30898    pub const CNP_SHIFT: u32 = 0;
30899    /// Offset of the `SKL` field.
30900    pub const SKL_SHIFT: u32 = 1;
30901    /// Mask for the `SKL` field.
30902    pub const SKL_MASK: u64 = 0b11;
30903
30904    /// Returns the value of the `SKL` field.
30905    pub const fn skl(self) -> u8 {
30906        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
30907    }
30908
30909    /// Sets the value of the `SKL` field.
30910    pub const fn set_skl(&mut self, value: u8) {
30911        let offset = Self::SKL_SHIFT;
30912        assert!(value & (Self::SKL_MASK as u8) == value);
30913        *self = Self::from_bits_retain(
30914            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
30915        );
30916    }
30917
30918    /// Returns a copy with the `SKL` field set to the given value.
30919    pub const fn with_skl(mut self, value: u8) -> Self {
30920        self.set_skl(value);
30921        self
30922    }
30923}
30924
30925bitflags! {
30926    /// `TTBR1` system register value.
30927    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30928    #[repr(transparent)]
30929    pub struct Ttbr1: u64 {
30930        /// `CnP` bit.
30931        const CNP = 1 << 0;
30932        /// `S` bit.
30933        const S = 1 << 1;
30934        /// `IMP` bit.
30935        const IMP = 1 << 2;
30936        /// `NOS` bit.
30937        const NOS = 1 << 5;
30938    }
30939}
30940
30941impl Ttbr1 {
30942    /// Offset of the `CnP` field.
30943    pub const CNP_SHIFT: u32 = 0;
30944    /// Offset of the `BADDR` field.
30945    pub const BADDR_SHIFT: u32 = 1;
30946    /// Mask for the `BADDR` field.
30947    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
30948    /// Offset of the `S` field.
30949    pub const S_SHIFT: u32 = 1;
30950    /// Offset of the `IMP` field.
30951    pub const IMP_SHIFT: u32 = 2;
30952    /// Offset of the `RGN` field.
30953    pub const RGN_SHIFT: u32 = 3;
30954    /// Mask for the `RGN` field.
30955    pub const RGN_MASK: u64 = 0b11;
30956    /// Offset of the `NOS` field.
30957    pub const NOS_SHIFT: u32 = 5;
30958    /// Offset of the `TTB1` field.
30959    pub const TTB1_SHIFT: u32 = 7;
30960    /// Mask for the `TTB1` field.
30961    pub const TTB1_MASK: u64 = 0b1111111111111111111111111;
30962    /// Offset of the `ASID` field.
30963    pub const ASID_SHIFT: u32 = 48;
30964    /// Mask for the `ASID` field.
30965    pub const ASID_MASK: u64 = 0b11111111;
30966
30967    /// Returns the value of the `BADDR` field.
30968    pub const fn baddr(self) -> u64 {
30969        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
30970            as u64
30971    }
30972
30973    /// Sets the value of the `BADDR` field.
30974    pub const fn set_baddr(&mut self, value: u64) {
30975        let offset = Self::BADDR_SHIFT;
30976        assert!(value & (Self::BADDR_MASK as u64) == value);
30977        *self = Self::from_bits_retain(
30978            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
30979        );
30980    }
30981
30982    /// Returns a copy with the `BADDR` field set to the given value.
30983    pub const fn with_baddr(mut self, value: u64) -> Self {
30984        self.set_baddr(value);
30985        self
30986    }
30987
30988    /// Returns the value of the `RGN` field.
30989    pub const fn rgn(self) -> u8 {
30990        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
30991    }
30992
30993    /// Sets the value of the `RGN` field.
30994    pub const fn set_rgn(&mut self, value: u8) {
30995        let offset = Self::RGN_SHIFT;
30996        assert!(value & (Self::RGN_MASK as u8) == value);
30997        *self = Self::from_bits_retain(
30998            (self.bits() & !(Self::RGN_MASK << offset)) | ((value as u64) << offset),
30999        );
31000    }
31001
31002    /// Returns a copy with the `RGN` field set to the given value.
31003    pub const fn with_rgn(mut self, value: u8) -> Self {
31004        self.set_rgn(value);
31005        self
31006    }
31007
31008    /// Returns the value of the `TTB1` field.
31009    pub const fn ttb1(self) -> u32 {
31010        ((self.bits() >> Self::TTB1_SHIFT) & 0b1111111111111111111111111) as u32
31011    }
31012
31013    /// Sets the value of the `TTB1` field.
31014    pub const fn set_ttb1(&mut self, value: u32) {
31015        let offset = Self::TTB1_SHIFT;
31016        assert!(value & (Self::TTB1_MASK as u32) == value);
31017        *self = Self::from_bits_retain(
31018            (self.bits() & !(Self::TTB1_MASK << offset)) | ((value as u64) << offset),
31019        );
31020    }
31021
31022    /// Returns a copy with the `TTB1` field set to the given value.
31023    pub const fn with_ttb1(mut self, value: u32) -> Self {
31024        self.set_ttb1(value);
31025        self
31026    }
31027
31028    /// Returns the value of the `ASID` field.
31029    pub const fn asid(self) -> u8 {
31030        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
31031    }
31032
31033    /// Sets the value of the `ASID` field.
31034    pub const fn set_asid(&mut self, value: u8) {
31035        let offset = Self::ASID_SHIFT;
31036        assert!(value & (Self::ASID_MASK as u8) == value);
31037        *self = Self::from_bits_retain(
31038            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
31039        );
31040    }
31041
31042    /// Returns a copy with the `ASID` field set to the given value.
31043    pub const fn with_asid(mut self, value: u8) -> Self {
31044        self.set_asid(value);
31045        self
31046    }
31047}
31048
31049#[cfg(feature = "el1")]
31050bitflags! {
31051    /// `TTBR1_EL1` system register value.
31052    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31053    #[repr(transparent)]
31054    pub struct Ttbr1El1: u64 {
31055        /// `CnP` bit.
31056        const CNP = 1 << 0;
31057    }
31058}
31059
31060#[cfg(feature = "el1")]
31061impl Ttbr1El1 {
31062    /// Offset of the `CnP` field.
31063    pub const CNP_SHIFT: u32 = 0;
31064    /// Offset of the `BADDR[47:1]` field.
31065    pub const BADDR_47_1_SHIFT: u32 = 1;
31066    /// Mask for the `BADDR[47:1]` field.
31067    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
31068    /// Offset of the `SKL` field.
31069    pub const SKL_SHIFT: u32 = 1;
31070    /// Mask for the `SKL` field.
31071    pub const SKL_MASK: u64 = 0b11;
31072    /// Offset of the `ASID` field.
31073    pub const ASID_SHIFT: u32 = 48;
31074    /// Mask for the `ASID` field.
31075    pub const ASID_MASK: u64 = 0b1111111111111111;
31076
31077    /// Returns the value of the `BADDR[47:1]` field.
31078    pub const fn baddr_47_1(self) -> u64 {
31079        ((self.bits() >> Self::BADDR_47_1_SHIFT)
31080            & 0b11111111111111111111111111111111111111111111111) as u64
31081    }
31082
31083    /// Sets the value of the `BADDR[47:1]` field.
31084    pub const fn set_baddr_47_1(&mut self, value: u64) {
31085        let offset = Self::BADDR_47_1_SHIFT;
31086        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
31087        *self = Self::from_bits_retain(
31088            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
31089        );
31090    }
31091
31092    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
31093    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
31094        self.set_baddr_47_1(value);
31095        self
31096    }
31097
31098    /// Returns the value of the `SKL` field.
31099    pub const fn skl(self) -> u8 {
31100        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
31101    }
31102
31103    /// Sets the value of the `SKL` field.
31104    pub const fn set_skl(&mut self, value: u8) {
31105        let offset = Self::SKL_SHIFT;
31106        assert!(value & (Self::SKL_MASK as u8) == value);
31107        *self = Self::from_bits_retain(
31108            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
31109        );
31110    }
31111
31112    /// Returns a copy with the `SKL` field set to the given value.
31113    pub const fn with_skl(mut self, value: u8) -> Self {
31114        self.set_skl(value);
31115        self
31116    }
31117
31118    /// Returns the value of the `ASID` field.
31119    pub const fn asid(self) -> u16 {
31120        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
31121    }
31122
31123    /// Sets the value of the `ASID` field.
31124    pub const fn set_asid(&mut self, value: u16) {
31125        let offset = Self::ASID_SHIFT;
31126        assert!(value & (Self::ASID_MASK as u16) == value);
31127        *self = Self::from_bits_retain(
31128            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
31129        );
31130    }
31131
31132    /// Returns a copy with the `ASID` field set to the given value.
31133    pub const fn with_asid(mut self, value: u16) -> Self {
31134        self.set_asid(value);
31135        self
31136    }
31137}
31138
31139#[cfg(feature = "el2")]
31140bitflags! {
31141    /// `TTBR1_EL2` system register value.
31142    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31143    #[repr(transparent)]
31144    pub struct Ttbr1El2: u64 {
31145        /// `CnP` bit.
31146        const CNP = 1 << 0;
31147    }
31148}
31149
31150#[cfg(feature = "el2")]
31151impl Ttbr1El2 {
31152    /// Offset of the `CnP` field.
31153    pub const CNP_SHIFT: u32 = 0;
31154    /// Offset of the `BADDR[47:1]` field.
31155    pub const BADDR_47_1_SHIFT: u32 = 1;
31156    /// Mask for the `BADDR[47:1]` field.
31157    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
31158    /// Offset of the `SKL` field.
31159    pub const SKL_SHIFT: u32 = 1;
31160    /// Mask for the `SKL` field.
31161    pub const SKL_MASK: u64 = 0b11;
31162    /// Offset of the `ASID` field.
31163    pub const ASID_SHIFT: u32 = 48;
31164    /// Mask for the `ASID` field.
31165    pub const ASID_MASK: u64 = 0b1111111111111111;
31166
31167    /// Returns the value of the `BADDR[47:1]` field.
31168    pub const fn baddr_47_1(self) -> u64 {
31169        ((self.bits() >> Self::BADDR_47_1_SHIFT)
31170            & 0b11111111111111111111111111111111111111111111111) as u64
31171    }
31172
31173    /// Sets the value of the `BADDR[47:1]` field.
31174    pub const fn set_baddr_47_1(&mut self, value: u64) {
31175        let offset = Self::BADDR_47_1_SHIFT;
31176        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
31177        *self = Self::from_bits_retain(
31178            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
31179        );
31180    }
31181
31182    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
31183    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
31184        self.set_baddr_47_1(value);
31185        self
31186    }
31187
31188    /// Returns the value of the `SKL` field.
31189    pub const fn skl(self) -> u8 {
31190        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
31191    }
31192
31193    /// Sets the value of the `SKL` field.
31194    pub const fn set_skl(&mut self, value: u8) {
31195        let offset = Self::SKL_SHIFT;
31196        assert!(value & (Self::SKL_MASK as u8) == value);
31197        *self = Self::from_bits_retain(
31198            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
31199        );
31200    }
31201
31202    /// Returns a copy with the `SKL` field set to the given value.
31203    pub const fn with_skl(mut self, value: u8) -> Self {
31204        self.set_skl(value);
31205        self
31206    }
31207
31208    /// Returns the value of the `ASID` field.
31209    pub const fn asid(self) -> u16 {
31210        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
31211    }
31212
31213    /// Sets the value of the `ASID` field.
31214    pub const fn set_asid(&mut self, value: u16) {
31215        let offset = Self::ASID_SHIFT;
31216        assert!(value & (Self::ASID_MASK as u16) == value);
31217        *self = Self::from_bits_retain(
31218            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
31219        );
31220    }
31221
31222    /// Returns a copy with the `ASID` field set to the given value.
31223    pub const fn with_asid(mut self, value: u16) -> Self {
31224        self.set_asid(value);
31225        self
31226    }
31227}
31228
31229bitflags! {
31230    /// `VBAR` system register value.
31231    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31232    #[repr(transparent)]
31233    pub struct Vbar: u32 {
31234    }
31235}
31236
31237impl Vbar {
31238    /// Offset of the `VBA` field.
31239    pub const VBA_SHIFT: u32 = 5;
31240    /// Mask for the `VBA` field.
31241    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
31242
31243    /// Returns the value of the `VBA` field.
31244    pub const fn vba(self) -> u32 {
31245        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
31246    }
31247
31248    /// Sets the value of the `VBA` field.
31249    pub const fn set_vba(&mut self, value: u32) {
31250        let offset = Self::VBA_SHIFT;
31251        assert!(value & (Self::VBA_MASK as u32) == value);
31252        *self = Self::from_bits_retain(
31253            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
31254        );
31255    }
31256
31257    /// Returns a copy with the `VBA` field set to the given value.
31258    pub const fn with_vba(mut self, value: u32) -> Self {
31259        self.set_vba(value);
31260        self
31261    }
31262}
31263
31264#[cfg(feature = "el1")]
31265bitflags! {
31266    /// `VBAR_EL1` system register value.
31267    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31268    #[repr(transparent)]
31269    pub struct VbarEl1: u64 {
31270        /// `UT` bit.
31271        const UT = 1 << 0;
31272    }
31273}
31274
31275#[cfg(feature = "el1")]
31276impl VbarEl1 {
31277    /// Offset of the `UT` field.
31278    pub const UT_SHIFT: u32 = 0;
31279    /// Offset of the `VBA` field.
31280    pub const VBA_SHIFT: u32 = 11;
31281    /// Mask for the `VBA` field.
31282    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
31283
31284    /// Returns the value of the `VBA` field.
31285    pub const fn vba(self) -> u64 {
31286        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
31287            as u64
31288    }
31289
31290    /// Sets the value of the `VBA` field.
31291    pub const fn set_vba(&mut self, value: u64) {
31292        let offset = Self::VBA_SHIFT;
31293        assert!(value & (Self::VBA_MASK as u64) == value);
31294        *self = Self::from_bits_retain(
31295            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u64) << offset),
31296        );
31297    }
31298
31299    /// Returns a copy with the `VBA` field set to the given value.
31300    pub const fn with_vba(mut self, value: u64) -> Self {
31301        self.set_vba(value);
31302        self
31303    }
31304}
31305
31306#[cfg(feature = "el2")]
31307bitflags! {
31308    /// `VBAR_EL2` system register value.
31309    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31310    #[repr(transparent)]
31311    pub struct VbarEl2: u64 {
31312        /// `UT` bit.
31313        const UT = 1 << 0;
31314    }
31315}
31316
31317#[cfg(feature = "el2")]
31318impl VbarEl2 {
31319    /// Offset of the `UT` field.
31320    pub const UT_SHIFT: u32 = 0;
31321    /// Offset of the `VBA` field.
31322    pub const VBA_SHIFT: u32 = 11;
31323    /// Mask for the `VBA` field.
31324    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
31325
31326    /// Returns the value of the `VBA` field.
31327    pub const fn vba(self) -> u64 {
31328        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
31329            as u64
31330    }
31331
31332    /// Sets the value of the `VBA` field.
31333    pub const fn set_vba(&mut self, value: u64) {
31334        let offset = Self::VBA_SHIFT;
31335        assert!(value & (Self::VBA_MASK as u64) == value);
31336        *self = Self::from_bits_retain(
31337            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u64) << offset),
31338        );
31339    }
31340
31341    /// Returns a copy with the `VBA` field set to the given value.
31342    pub const fn with_vba(mut self, value: u64) -> Self {
31343        self.set_vba(value);
31344        self
31345    }
31346}
31347
31348bitflags! {
31349    /// `VDFSR` system register value.
31350    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31351    #[repr(transparent)]
31352    pub struct Vdfsr: u32 {
31353        /// `ExT` bit.
31354        const EXT = 1 << 12;
31355    }
31356}
31357
31358impl Vdfsr {
31359    /// Offset of the `ExT` field.
31360    pub const EXT_SHIFT: u32 = 12;
31361    /// Offset of the `AET` field.
31362    pub const AET_SHIFT: u32 = 14;
31363    /// Mask for the `AET` field.
31364    pub const AET_MASK: u32 = 0b11;
31365
31366    /// Returns the value of the `AET` field.
31367    pub const fn aet(self) -> u8 {
31368        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
31369    }
31370
31371    /// Sets the value of the `AET` field.
31372    pub const fn set_aet(&mut self, value: u8) {
31373        let offset = Self::AET_SHIFT;
31374        assert!(value & (Self::AET_MASK as u8) == value);
31375        *self = Self::from_bits_retain(
31376            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
31377        );
31378    }
31379
31380    /// Returns a copy with the `AET` field set to the given value.
31381    pub const fn with_aet(mut self, value: u8) -> Self {
31382        self.set_aet(value);
31383        self
31384    }
31385}
31386
31387bitflags! {
31388    /// `VDISR` system register value.
31389    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31390    #[repr(transparent)]
31391    pub struct Vdisr: u32 {
31392        /// `LPAE` bit.
31393        const LPAE = 1 << 9;
31394        /// `ExT` bit.
31395        const EXT = 1 << 12;
31396        /// `A` bit.
31397        const A = 1 << 31;
31398    }
31399}
31400
31401impl Vdisr {
31402    /// Offset of the `STATUS` field.
31403    pub const STATUS_SHIFT: u32 = 0;
31404    /// Mask for the `STATUS` field.
31405    pub const STATUS_MASK: u32 = 0b111111;
31406    /// Offset of the `LPAE` field.
31407    pub const LPAE_SHIFT: u32 = 9;
31408    /// Offset of the `ExT` field.
31409    pub const EXT_SHIFT: u32 = 12;
31410    /// Offset of the `AET` field.
31411    pub const AET_SHIFT: u32 = 14;
31412    /// Mask for the `AET` field.
31413    pub const AET_MASK: u32 = 0b11;
31414    /// Offset of the `A` field.
31415    pub const A_SHIFT: u32 = 31;
31416
31417    /// Returns the value of the `STATUS` field.
31418    pub const fn status(self) -> u8 {
31419        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
31420    }
31421
31422    /// Sets the value of the `STATUS` field.
31423    pub const fn set_status(&mut self, value: u8) {
31424        let offset = Self::STATUS_SHIFT;
31425        assert!(value & (Self::STATUS_MASK as u8) == value);
31426        *self = Self::from_bits_retain(
31427            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
31428        );
31429    }
31430
31431    /// Returns a copy with the `STATUS` field set to the given value.
31432    pub const fn with_status(mut self, value: u8) -> Self {
31433        self.set_status(value);
31434        self
31435    }
31436
31437    /// Returns the value of the `AET` field.
31438    pub const fn aet(self) -> u8 {
31439        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
31440    }
31441
31442    /// Sets the value of the `AET` field.
31443    pub const fn set_aet(&mut self, value: u8) {
31444        let offset = Self::AET_SHIFT;
31445        assert!(value & (Self::AET_MASK as u8) == value);
31446        *self = Self::from_bits_retain(
31447            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
31448        );
31449    }
31450
31451    /// Returns a copy with the `AET` field set to the given value.
31452    pub const fn with_aet(mut self, value: u8) -> Self {
31453        self.set_aet(value);
31454        self
31455    }
31456}
31457
31458#[cfg(feature = "el2")]
31459bitflags! {
31460    /// `VDISR_EL2` system register value.
31461    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31462    #[repr(transparent)]
31463    pub struct VdisrEl2: u64 {
31464        /// `LPAE` bit.
31465        const LPAE = 1 << 9;
31466        /// `ExT` bit.
31467        const EXT = 1 << 12;
31468        /// `IDS` bit.
31469        const IDS = 1 << 24;
31470        /// `A` bit.
31471        const A = 1 << 31;
31472    }
31473}
31474
31475#[cfg(feature = "el2")]
31476impl VdisrEl2 {
31477    /// Offset of the `ISS` field.
31478    pub const ISS_SHIFT: u32 = 0;
31479    /// Mask for the `ISS` field.
31480    pub const ISS_MASK: u64 = 0b111111111111111111111111;
31481    /// Offset of the `STATUS` field.
31482    pub const STATUS_SHIFT: u32 = 0;
31483    /// Mask for the `STATUS` field.
31484    pub const STATUS_MASK: u64 = 0b111111;
31485    /// Offset of the `LPAE` field.
31486    pub const LPAE_SHIFT: u32 = 9;
31487    /// Offset of the `ExT` field.
31488    pub const EXT_SHIFT: u32 = 12;
31489    /// Offset of the `AET` field.
31490    pub const AET_SHIFT: u32 = 14;
31491    /// Mask for the `AET` field.
31492    pub const AET_MASK: u64 = 0b11;
31493    /// Offset of the `IDS` field.
31494    pub const IDS_SHIFT: u32 = 24;
31495    /// Offset of the `A` field.
31496    pub const A_SHIFT: u32 = 31;
31497
31498    /// Returns the value of the `ISS` field.
31499    pub const fn iss(self) -> u32 {
31500        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
31501    }
31502
31503    /// Sets the value of the `ISS` field.
31504    pub const fn set_iss(&mut self, value: u32) {
31505        let offset = Self::ISS_SHIFT;
31506        assert!(value & (Self::ISS_MASK as u32) == value);
31507        *self = Self::from_bits_retain(
31508            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
31509        );
31510    }
31511
31512    /// Returns a copy with the `ISS` field set to the given value.
31513    pub const fn with_iss(mut self, value: u32) -> Self {
31514        self.set_iss(value);
31515        self
31516    }
31517
31518    /// Returns the value of the `STATUS` field.
31519    pub const fn status(self) -> u8 {
31520        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
31521    }
31522
31523    /// Sets the value of the `STATUS` field.
31524    pub const fn set_status(&mut self, value: u8) {
31525        let offset = Self::STATUS_SHIFT;
31526        assert!(value & (Self::STATUS_MASK as u8) == value);
31527        *self = Self::from_bits_retain(
31528            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u64) << offset),
31529        );
31530    }
31531
31532    /// Returns a copy with the `STATUS` field set to the given value.
31533    pub const fn with_status(mut self, value: u8) -> Self {
31534        self.set_status(value);
31535        self
31536    }
31537
31538    /// Returns the value of the `AET` field.
31539    pub const fn aet(self) -> u8 {
31540        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
31541    }
31542
31543    /// Sets the value of the `AET` field.
31544    pub const fn set_aet(&mut self, value: u8) {
31545        let offset = Self::AET_SHIFT;
31546        assert!(value & (Self::AET_MASK as u8) == value);
31547        *self = Self::from_bits_retain(
31548            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
31549        );
31550    }
31551
31552    /// Returns a copy with the `AET` field set to the given value.
31553    pub const fn with_aet(mut self, value: u8) -> Self {
31554        self.set_aet(value);
31555        self
31556    }
31557}
31558
31559bitflags! {
31560    /// `VMPIDR` system register value.
31561    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31562    #[repr(transparent)]
31563    pub struct Vmpidr: u32 {
31564        /// `MT` bit.
31565        const MT = 1 << 24;
31566        /// `U` bit.
31567        const U = 1 << 30;
31568        /// `M` bit.
31569        const M = 1 << 31;
31570    }
31571}
31572
31573impl Vmpidr {
31574    /// Offset of the `Aff0` field.
31575    pub const AFF0_SHIFT: u32 = 0;
31576    /// Mask for the `Aff0` field.
31577    pub const AFF0_MASK: u32 = 0b11111111;
31578    /// Offset of the `Aff1` field.
31579    pub const AFF1_SHIFT: u32 = 8;
31580    /// Mask for the `Aff1` field.
31581    pub const AFF1_MASK: u32 = 0b11111111;
31582    /// Offset of the `Aff2` field.
31583    pub const AFF2_SHIFT: u32 = 16;
31584    /// Mask for the `Aff2` field.
31585    pub const AFF2_MASK: u32 = 0b11111111;
31586    /// Offset of the `MT` field.
31587    pub const MT_SHIFT: u32 = 24;
31588    /// Offset of the `U` field.
31589    pub const U_SHIFT: u32 = 30;
31590    /// Offset of the `M` field.
31591    pub const M_SHIFT: u32 = 31;
31592
31593    /// Returns the value of the `Aff0` field.
31594    pub const fn aff0(self) -> u8 {
31595        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
31596    }
31597
31598    /// Sets the value of the `Aff0` field.
31599    pub const fn set_aff0(&mut self, value: u8) {
31600        let offset = Self::AFF0_SHIFT;
31601        assert!(value & (Self::AFF0_MASK as u8) == value);
31602        *self = Self::from_bits_retain(
31603            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u32) << offset),
31604        );
31605    }
31606
31607    /// Returns a copy with the `Aff0` field set to the given value.
31608    pub const fn with_aff0(mut self, value: u8) -> Self {
31609        self.set_aff0(value);
31610        self
31611    }
31612
31613    /// Returns the value of the `Aff1` field.
31614    pub const fn aff1(self) -> u8 {
31615        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
31616    }
31617
31618    /// Sets the value of the `Aff1` field.
31619    pub const fn set_aff1(&mut self, value: u8) {
31620        let offset = Self::AFF1_SHIFT;
31621        assert!(value & (Self::AFF1_MASK as u8) == value);
31622        *self = Self::from_bits_retain(
31623            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u32) << offset),
31624        );
31625    }
31626
31627    /// Returns a copy with the `Aff1` field set to the given value.
31628    pub const fn with_aff1(mut self, value: u8) -> Self {
31629        self.set_aff1(value);
31630        self
31631    }
31632
31633    /// Returns the value of the `Aff2` field.
31634    pub const fn aff2(self) -> u8 {
31635        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
31636    }
31637
31638    /// Sets the value of the `Aff2` field.
31639    pub const fn set_aff2(&mut self, value: u8) {
31640        let offset = Self::AFF2_SHIFT;
31641        assert!(value & (Self::AFF2_MASK as u8) == value);
31642        *self = Self::from_bits_retain(
31643            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u32) << offset),
31644        );
31645    }
31646
31647    /// Returns a copy with the `Aff2` field set to the given value.
31648    pub const fn with_aff2(mut self, value: u8) -> Self {
31649        self.set_aff2(value);
31650        self
31651    }
31652}
31653
31654#[cfg(feature = "el2")]
31655bitflags! {
31656    /// `VMPIDR_EL2` system register value.
31657    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31658    #[repr(transparent)]
31659    pub struct VmpidrEl2: u64 {
31660        /// RES1 bits in the `VMPIDR_EL2` register.
31661        const RES1 = 0b10000000000000000000000000000000;
31662        /// `MT` bit.
31663        const MT = 1 << 24;
31664        /// `U` bit.
31665        const U = 1 << 30;
31666    }
31667}
31668
31669#[cfg(feature = "el2")]
31670impl VmpidrEl2 {
31671    /// Offset of the `Aff0` field.
31672    pub const AFF0_SHIFT: u32 = 0;
31673    /// Mask for the `Aff0` field.
31674    pub const AFF0_MASK: u64 = 0b11111111;
31675    /// Offset of the `Aff1` field.
31676    pub const AFF1_SHIFT: u32 = 8;
31677    /// Mask for the `Aff1` field.
31678    pub const AFF1_MASK: u64 = 0b11111111;
31679    /// Offset of the `Aff2` field.
31680    pub const AFF2_SHIFT: u32 = 16;
31681    /// Mask for the `Aff2` field.
31682    pub const AFF2_MASK: u64 = 0b11111111;
31683    /// Offset of the `MT` field.
31684    pub const MT_SHIFT: u32 = 24;
31685    /// Offset of the `U` field.
31686    pub const U_SHIFT: u32 = 30;
31687    /// Offset of the `Aff3` field.
31688    pub const AFF3_SHIFT: u32 = 32;
31689    /// Mask for the `Aff3` field.
31690    pub const AFF3_MASK: u64 = 0b11111111;
31691
31692    /// Returns the value of the `Aff0` field.
31693    pub const fn aff0(self) -> u8 {
31694        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
31695    }
31696
31697    /// Sets the value of the `Aff0` field.
31698    pub const fn set_aff0(&mut self, value: u8) {
31699        let offset = Self::AFF0_SHIFT;
31700        assert!(value & (Self::AFF0_MASK as u8) == value);
31701        *self = Self::from_bits_retain(
31702            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u64) << offset),
31703        );
31704    }
31705
31706    /// Returns a copy with the `Aff0` field set to the given value.
31707    pub const fn with_aff0(mut self, value: u8) -> Self {
31708        self.set_aff0(value);
31709        self
31710    }
31711
31712    /// Returns the value of the `Aff1` field.
31713    pub const fn aff1(self) -> u8 {
31714        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
31715    }
31716
31717    /// Sets the value of the `Aff1` field.
31718    pub const fn set_aff1(&mut self, value: u8) {
31719        let offset = Self::AFF1_SHIFT;
31720        assert!(value & (Self::AFF1_MASK as u8) == value);
31721        *self = Self::from_bits_retain(
31722            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
31723        );
31724    }
31725
31726    /// Returns a copy with the `Aff1` field set to the given value.
31727    pub const fn with_aff1(mut self, value: u8) -> Self {
31728        self.set_aff1(value);
31729        self
31730    }
31731
31732    /// Returns the value of the `Aff2` field.
31733    pub const fn aff2(self) -> u8 {
31734        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
31735    }
31736
31737    /// Sets the value of the `Aff2` field.
31738    pub const fn set_aff2(&mut self, value: u8) {
31739        let offset = Self::AFF2_SHIFT;
31740        assert!(value & (Self::AFF2_MASK as u8) == value);
31741        *self = Self::from_bits_retain(
31742            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
31743        );
31744    }
31745
31746    /// Returns a copy with the `Aff2` field set to the given value.
31747    pub const fn with_aff2(mut self, value: u8) -> Self {
31748        self.set_aff2(value);
31749        self
31750    }
31751
31752    /// Returns the value of the `Aff3` field.
31753    pub const fn aff3(self) -> u8 {
31754        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
31755    }
31756
31757    /// Sets the value of the `Aff3` field.
31758    pub const fn set_aff3(&mut self, value: u8) {
31759        let offset = Self::AFF3_SHIFT;
31760        assert!(value & (Self::AFF3_MASK as u8) == value);
31761        *self = Self::from_bits_retain(
31762            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
31763        );
31764    }
31765
31766    /// Returns a copy with the `Aff3` field set to the given value.
31767    pub const fn with_aff3(mut self, value: u8) -> Self {
31768        self.set_aff3(value);
31769        self
31770    }
31771}
31772
31773bitflags! {
31774    /// `VPIDR` system register value.
31775    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31776    #[repr(transparent)]
31777    pub struct Vpidr: u32 {
31778    }
31779}
31780
31781impl Vpidr {
31782    /// Offset of the `Revision` field.
31783    pub const REVISION_SHIFT: u32 = 0;
31784    /// Mask for the `Revision` field.
31785    pub const REVISION_MASK: u32 = 0b1111;
31786    /// Offset of the `PartNum` field.
31787    pub const PARTNUM_SHIFT: u32 = 4;
31788    /// Mask for the `PartNum` field.
31789    pub const PARTNUM_MASK: u32 = 0b111111111111;
31790    /// Offset of the `Architecture` field.
31791    pub const ARCHITECTURE_SHIFT: u32 = 16;
31792    /// Mask for the `Architecture` field.
31793    pub const ARCHITECTURE_MASK: u32 = 0b1111;
31794    /// Offset of the `Variant` field.
31795    pub const VARIANT_SHIFT: u32 = 20;
31796    /// Mask for the `Variant` field.
31797    pub const VARIANT_MASK: u32 = 0b1111;
31798    /// Offset of the `Implementer` field.
31799    pub const IMPLEMENTER_SHIFT: u32 = 24;
31800    /// Mask for the `Implementer` field.
31801    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
31802
31803    /// Returns the value of the `Revision` field.
31804    pub const fn revision(self) -> u8 {
31805        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
31806    }
31807
31808    /// Sets the value of the `Revision` field.
31809    pub const fn set_revision(&mut self, value: u8) {
31810        let offset = Self::REVISION_SHIFT;
31811        assert!(value & (Self::REVISION_MASK as u8) == value);
31812        *self = Self::from_bits_retain(
31813            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u32) << offset),
31814        );
31815    }
31816
31817    /// Returns a copy with the `Revision` field set to the given value.
31818    pub const fn with_revision(mut self, value: u8) -> Self {
31819        self.set_revision(value);
31820        self
31821    }
31822
31823    /// Returns the value of the `PartNum` field.
31824    pub const fn partnum(self) -> u16 {
31825        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
31826    }
31827
31828    /// Sets the value of the `PartNum` field.
31829    pub const fn set_partnum(&mut self, value: u16) {
31830        let offset = Self::PARTNUM_SHIFT;
31831        assert!(value & (Self::PARTNUM_MASK as u16) == value);
31832        *self = Self::from_bits_retain(
31833            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u32) << offset),
31834        );
31835    }
31836
31837    /// Returns a copy with the `PartNum` field set to the given value.
31838    pub const fn with_partnum(mut self, value: u16) -> Self {
31839        self.set_partnum(value);
31840        self
31841    }
31842
31843    /// Returns the value of the `Architecture` field.
31844    pub const fn architecture(self) -> u8 {
31845        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
31846    }
31847
31848    /// Sets the value of the `Architecture` field.
31849    pub const fn set_architecture(&mut self, value: u8) {
31850        let offset = Self::ARCHITECTURE_SHIFT;
31851        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
31852        *self = Self::from_bits_retain(
31853            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u32) << offset),
31854        );
31855    }
31856
31857    /// Returns a copy with the `Architecture` field set to the given value.
31858    pub const fn with_architecture(mut self, value: u8) -> Self {
31859        self.set_architecture(value);
31860        self
31861    }
31862
31863    /// Returns the value of the `Variant` field.
31864    pub const fn variant(self) -> u8 {
31865        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
31866    }
31867
31868    /// Sets the value of the `Variant` field.
31869    pub const fn set_variant(&mut self, value: u8) {
31870        let offset = Self::VARIANT_SHIFT;
31871        assert!(value & (Self::VARIANT_MASK as u8) == value);
31872        *self = Self::from_bits_retain(
31873            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u32) << offset),
31874        );
31875    }
31876
31877    /// Returns a copy with the `Variant` field set to the given value.
31878    pub const fn with_variant(mut self, value: u8) -> Self {
31879        self.set_variant(value);
31880        self
31881    }
31882
31883    /// Returns the value of the `Implementer` field.
31884    pub const fn implementer(self) -> u8 {
31885        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
31886    }
31887
31888    /// Sets the value of the `Implementer` field.
31889    pub const fn set_implementer(&mut self, value: u8) {
31890        let offset = Self::IMPLEMENTER_SHIFT;
31891        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
31892        *self = Self::from_bits_retain(
31893            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u32) << offset),
31894        );
31895    }
31896
31897    /// Returns a copy with the `Implementer` field set to the given value.
31898    pub const fn with_implementer(mut self, value: u8) -> Self {
31899        self.set_implementer(value);
31900        self
31901    }
31902}
31903
31904#[cfg(feature = "el2")]
31905bitflags! {
31906    /// `VPIDR_EL2` system register value.
31907    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31908    #[repr(transparent)]
31909    pub struct VpidrEl2: u64 {
31910    }
31911}
31912
31913#[cfg(feature = "el2")]
31914impl VpidrEl2 {
31915    /// Offset of the `Revision` field.
31916    pub const REVISION_SHIFT: u32 = 0;
31917    /// Mask for the `Revision` field.
31918    pub const REVISION_MASK: u64 = 0b1111;
31919    /// Offset of the `PartNum` field.
31920    pub const PARTNUM_SHIFT: u32 = 4;
31921    /// Mask for the `PartNum` field.
31922    pub const PARTNUM_MASK: u64 = 0b111111111111;
31923    /// Offset of the `Architecture` field.
31924    pub const ARCHITECTURE_SHIFT: u32 = 16;
31925    /// Mask for the `Architecture` field.
31926    pub const ARCHITECTURE_MASK: u64 = 0b1111;
31927    /// Offset of the `Variant` field.
31928    pub const VARIANT_SHIFT: u32 = 20;
31929    /// Mask for the `Variant` field.
31930    pub const VARIANT_MASK: u64 = 0b1111;
31931    /// Offset of the `Implementer` field.
31932    pub const IMPLEMENTER_SHIFT: u32 = 24;
31933    /// Mask for the `Implementer` field.
31934    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
31935
31936    /// Returns the value of the `Revision` field.
31937    pub const fn revision(self) -> u8 {
31938        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
31939    }
31940
31941    /// Sets the value of the `Revision` field.
31942    pub const fn set_revision(&mut self, value: u8) {
31943        let offset = Self::REVISION_SHIFT;
31944        assert!(value & (Self::REVISION_MASK as u8) == value);
31945        *self = Self::from_bits_retain(
31946            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u64) << offset),
31947        );
31948    }
31949
31950    /// Returns a copy with the `Revision` field set to the given value.
31951    pub const fn with_revision(mut self, value: u8) -> Self {
31952        self.set_revision(value);
31953        self
31954    }
31955
31956    /// Returns the value of the `PartNum` field.
31957    pub const fn partnum(self) -> u16 {
31958        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
31959    }
31960
31961    /// Sets the value of the `PartNum` field.
31962    pub const fn set_partnum(&mut self, value: u16) {
31963        let offset = Self::PARTNUM_SHIFT;
31964        assert!(value & (Self::PARTNUM_MASK as u16) == value);
31965        *self = Self::from_bits_retain(
31966            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u64) << offset),
31967        );
31968    }
31969
31970    /// Returns a copy with the `PartNum` field set to the given value.
31971    pub const fn with_partnum(mut self, value: u16) -> Self {
31972        self.set_partnum(value);
31973        self
31974    }
31975
31976    /// Returns the value of the `Architecture` field.
31977    pub const fn architecture(self) -> u8 {
31978        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
31979    }
31980
31981    /// Sets the value of the `Architecture` field.
31982    pub const fn set_architecture(&mut self, value: u8) {
31983        let offset = Self::ARCHITECTURE_SHIFT;
31984        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
31985        *self = Self::from_bits_retain(
31986            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u64) << offset),
31987        );
31988    }
31989
31990    /// Returns a copy with the `Architecture` field set to the given value.
31991    pub const fn with_architecture(mut self, value: u8) -> Self {
31992        self.set_architecture(value);
31993        self
31994    }
31995
31996    /// Returns the value of the `Variant` field.
31997    pub const fn variant(self) -> u8 {
31998        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
31999    }
32000
32001    /// Sets the value of the `Variant` field.
32002    pub const fn set_variant(&mut self, value: u8) {
32003        let offset = Self::VARIANT_SHIFT;
32004        assert!(value & (Self::VARIANT_MASK as u8) == value);
32005        *self = Self::from_bits_retain(
32006            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u64) << offset),
32007        );
32008    }
32009
32010    /// Returns a copy with the `Variant` field set to the given value.
32011    pub const fn with_variant(mut self, value: u8) -> Self {
32012        self.set_variant(value);
32013        self
32014    }
32015
32016    /// Returns the value of the `Implementer` field.
32017    pub const fn implementer(self) -> u8 {
32018        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
32019    }
32020
32021    /// Sets the value of the `Implementer` field.
32022    pub const fn set_implementer(&mut self, value: u8) {
32023        let offset = Self::IMPLEMENTER_SHIFT;
32024        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
32025        *self = Self::from_bits_retain(
32026            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u64) << offset),
32027        );
32028    }
32029
32030    /// Returns a copy with the `Implementer` field set to the given value.
32031    pub const fn with_implementer(mut self, value: u8) -> Self {
32032        self.set_implementer(value);
32033        self
32034    }
32035}
32036
32037#[cfg(feature = "el2")]
32038bitflags! {
32039    /// `VSESR_EL2` system register value.
32040    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
32041    #[repr(transparent)]
32042    pub struct VsesrEl2: u64 {
32043        /// `ExT` bit.
32044        const EXT = 1 << 12;
32045        /// `IDS` bit.
32046        const IDS = 1 << 24;
32047    }
32048}
32049
32050#[cfg(feature = "el2")]
32051impl VsesrEl2 {
32052    /// Offset of the `ISS` field.
32053    pub const ISS_SHIFT: u32 = 0;
32054    /// Mask for the `ISS` field.
32055    pub const ISS_MASK: u64 = 0b111111111111111111111111;
32056    /// Offset of the `ExT` field.
32057    pub const EXT_SHIFT: u32 = 12;
32058    /// Offset of the `AET` field.
32059    pub const AET_SHIFT: u32 = 14;
32060    /// Mask for the `AET` field.
32061    pub const AET_MASK: u64 = 0b11;
32062    /// Offset of the `IDS` field.
32063    pub const IDS_SHIFT: u32 = 24;
32064
32065    /// Returns the value of the `ISS` field.
32066    pub const fn iss(self) -> u32 {
32067        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
32068    }
32069
32070    /// Sets the value of the `ISS` field.
32071    pub const fn set_iss(&mut self, value: u32) {
32072        let offset = Self::ISS_SHIFT;
32073        assert!(value & (Self::ISS_MASK as u32) == value);
32074        *self = Self::from_bits_retain(
32075            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
32076        );
32077    }
32078
32079    /// Returns a copy with the `ISS` field set to the given value.
32080    pub const fn with_iss(mut self, value: u32) -> Self {
32081        self.set_iss(value);
32082        self
32083    }
32084
32085    /// Returns the value of the `AET` field.
32086    pub const fn aet(self) -> u8 {
32087        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
32088    }
32089
32090    /// Sets the value of the `AET` field.
32091    pub const fn set_aet(&mut self, value: u8) {
32092        let offset = Self::AET_SHIFT;
32093        assert!(value & (Self::AET_MASK as u8) == value);
32094        *self = Self::from_bits_retain(
32095            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
32096        );
32097    }
32098
32099    /// Returns a copy with the `AET` field set to the given value.
32100    pub const fn with_aet(mut self, value: u8) -> Self {
32101        self.set_aet(value);
32102        self
32103    }
32104}
32105
32106bitflags! {
32107    /// `VTCR` system register value.
32108    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
32109    #[repr(transparent)]
32110    pub struct Vtcr: u32 {
32111        /// RES1 bits in the `VTCR` register.
32112        const RES1 = 0b10000000000000000000000000000000;
32113        /// `S` bit.
32114        const S = 1 << 4;
32115        /// `HWU59` bit.
32116        const HWU59 = 1 << 25;
32117        /// `HWU60` bit.
32118        const HWU60 = 1 << 26;
32119        /// `HWU61` bit.
32120        const HWU61 = 1 << 27;
32121        /// `HWU62` bit.
32122        const HWU62 = 1 << 28;
32123    }
32124}
32125
32126impl Vtcr {
32127    /// Offset of the `T0SZ` field.
32128    pub const T0SZ_SHIFT: u32 = 0;
32129    /// Mask for the `T0SZ` field.
32130    pub const T0SZ_MASK: u32 = 0b1111;
32131    /// Offset of the `S` field.
32132    pub const S_SHIFT: u32 = 4;
32133    /// Offset of the `SL0` field.
32134    pub const SL0_SHIFT: u32 = 6;
32135    /// Mask for the `SL0` field.
32136    pub const SL0_MASK: u32 = 0b11;
32137    /// Offset of the `IRGN0` field.
32138    pub const IRGN0_SHIFT: u32 = 8;
32139    /// Mask for the `IRGN0` field.
32140    pub const IRGN0_MASK: u32 = 0b11;
32141    /// Offset of the `ORGN0` field.
32142    pub const ORGN0_SHIFT: u32 = 10;
32143    /// Mask for the `ORGN0` field.
32144    pub const ORGN0_MASK: u32 = 0b11;
32145    /// Offset of the `SH0` field.
32146    pub const SH0_SHIFT: u32 = 12;
32147    /// Mask for the `SH0` field.
32148    pub const SH0_MASK: u32 = 0b11;
32149    /// Offset of the `HWU59` field.
32150    pub const HWU59_SHIFT: u32 = 25;
32151    /// Offset of the `HWU60` field.
32152    pub const HWU60_SHIFT: u32 = 26;
32153    /// Offset of the `HWU61` field.
32154    pub const HWU61_SHIFT: u32 = 27;
32155    /// Offset of the `HWU62` field.
32156    pub const HWU62_SHIFT: u32 = 28;
32157
32158    /// Returns the value of the `T0SZ` field.
32159    pub const fn t0sz(self) -> u8 {
32160        ((self.bits() >> Self::T0SZ_SHIFT) & 0b1111) as u8
32161    }
32162
32163    /// Sets the value of the `T0SZ` field.
32164    pub const fn set_t0sz(&mut self, value: u8) {
32165        let offset = Self::T0SZ_SHIFT;
32166        assert!(value & (Self::T0SZ_MASK as u8) == value);
32167        *self = Self::from_bits_retain(
32168            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
32169        );
32170    }
32171
32172    /// Returns a copy with the `T0SZ` field set to the given value.
32173    pub const fn with_t0sz(mut self, value: u8) -> Self {
32174        self.set_t0sz(value);
32175        self
32176    }
32177
32178    /// Returns the value of the `SL0` field.
32179    pub const fn sl0(self) -> u8 {
32180        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
32181    }
32182
32183    /// Sets the value of the `SL0` field.
32184    pub const fn set_sl0(&mut self, value: u8) {
32185        let offset = Self::SL0_SHIFT;
32186        assert!(value & (Self::SL0_MASK as u8) == value);
32187        *self = Self::from_bits_retain(
32188            (self.bits() & !(Self::SL0_MASK << offset)) | ((value as u32) << offset),
32189        );
32190    }
32191
32192    /// Returns a copy with the `SL0` field set to the given value.
32193    pub const fn with_sl0(mut self, value: u8) -> Self {
32194        self.set_sl0(value);
32195        self
32196    }
32197
32198    /// Returns the value of the `IRGN0` field.
32199    pub const fn irgn0(self) -> u8 {
32200        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
32201    }
32202
32203    /// Sets the value of the `IRGN0` field.
32204    pub const fn set_irgn0(&mut self, value: u8) {
32205        let offset = Self::IRGN0_SHIFT;
32206        assert!(value & (Self::IRGN0_MASK as u8) == value);
32207        *self = Self::from_bits_retain(
32208            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
32209        );
32210    }
32211
32212    /// Returns a copy with the `IRGN0` field set to the given value.
32213    pub const fn with_irgn0(mut self, value: u8) -> Self {
32214        self.set_irgn0(value);
32215        self
32216    }
32217
32218    /// Returns the value of the `ORGN0` field.
32219    pub const fn orgn0(self) -> u8 {
32220        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
32221    }
32222
32223    /// Sets the value of the `ORGN0` field.
32224    pub const fn set_orgn0(&mut self, value: u8) {
32225        let offset = Self::ORGN0_SHIFT;
32226        assert!(value & (Self::ORGN0_MASK as u8) == value);
32227        *self = Self::from_bits_retain(
32228            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
32229        );
32230    }
32231
32232    /// Returns a copy with the `ORGN0` field set to the given value.
32233    pub const fn with_orgn0(mut self, value: u8) -> Self {
32234        self.set_orgn0(value);
32235        self
32236    }
32237
32238    /// Returns the value of the `SH0` field.
32239    pub const fn sh0(self) -> u8 {
32240        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
32241    }
32242
32243    /// Sets the value of the `SH0` field.
32244    pub const fn set_sh0(&mut self, value: u8) {
32245        let offset = Self::SH0_SHIFT;
32246        assert!(value & (Self::SH0_MASK as u8) == value);
32247        *self = Self::from_bits_retain(
32248            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
32249        );
32250    }
32251
32252    /// Returns a copy with the `SH0` field set to the given value.
32253    pub const fn with_sh0(mut self, value: u8) -> Self {
32254        self.set_sh0(value);
32255        self
32256    }
32257}
32258
32259#[cfg(feature = "el2")]
32260bitflags! {
32261    /// `VTCR_EL2` system register value.
32262    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
32263    #[repr(transparent)]
32264    pub struct VtcrEl2: u64 {
32265        /// RES1 bits in the `VTCR_EL2` register.
32266        const RES1 = 0b10000000000000000000000000000000;
32267        /// `VS` bit.
32268        const VS = 1 << 19;
32269        /// `HA` bit.
32270        const HA = 1 << 21;
32271        /// `HD` bit.
32272        const HD = 1 << 22;
32273        /// `HWU59` bit.
32274        const HWU59 = 1 << 25;
32275        /// `HWU60` bit.
32276        const HWU60 = 1 << 26;
32277        /// `HWU61` bit.
32278        const HWU61 = 1 << 27;
32279        /// `HWU62` bit.
32280        const HWU62 = 1 << 28;
32281        /// `NSW` bit.
32282        const NSW = 1 << 29;
32283        /// `NSA` bit.
32284        const NSA = 1 << 30;
32285        /// `DS` bit.
32286        const DS = 1 << 32;
32287        /// `SL2` bit.
32288        const SL2 = 1 << 33;
32289        /// `AssuredOnly` bit.
32290        const ASSUREDONLY = 1 << 34;
32291        /// `TL1` bit.
32292        const TL1 = 1 << 35;
32293        /// `S2PIE` bit.
32294        const S2PIE = 1 << 36;
32295        /// `S2POE` bit.
32296        const S2POE = 1 << 37;
32297        /// `D128` bit.
32298        const D128 = 1 << 38;
32299        /// `GCSH` bit.
32300        const GCSH = 1 << 40;
32301        /// `TL0` bit.
32302        const TL0 = 1 << 41;
32303        /// `HAFT` bit.
32304        const HAFT = 1 << 44;
32305        /// `HDBSS` bit.
32306        const HDBSS = 1 << 45;
32307    }
32308}
32309
32310#[cfg(feature = "el2")]
32311impl VtcrEl2 {
32312    /// Offset of the `T0SZ` field.
32313    pub const T0SZ_SHIFT: u32 = 0;
32314    /// Mask for the `T0SZ` field.
32315    pub const T0SZ_MASK: u64 = 0b111111;
32316    /// Offset of the `SL0` field.
32317    pub const SL0_SHIFT: u32 = 6;
32318    /// Mask for the `SL0` field.
32319    pub const SL0_MASK: u64 = 0b11;
32320    /// Offset of the `IRGN0` field.
32321    pub const IRGN0_SHIFT: u32 = 8;
32322    /// Mask for the `IRGN0` field.
32323    pub const IRGN0_MASK: u64 = 0b11;
32324    /// Offset of the `ORGN0` field.
32325    pub const ORGN0_SHIFT: u32 = 10;
32326    /// Mask for the `ORGN0` field.
32327    pub const ORGN0_MASK: u64 = 0b11;
32328    /// Offset of the `SH0` field.
32329    pub const SH0_SHIFT: u32 = 12;
32330    /// Mask for the `SH0` field.
32331    pub const SH0_MASK: u64 = 0b11;
32332    /// Offset of the `TG0` field.
32333    pub const TG0_SHIFT: u32 = 14;
32334    /// Mask for the `TG0` field.
32335    pub const TG0_MASK: u64 = 0b11;
32336    /// Offset of the `PS` field.
32337    pub const PS_SHIFT: u32 = 16;
32338    /// Mask for the `PS` field.
32339    pub const PS_MASK: u64 = 0b111;
32340    /// Offset of the `VS` field.
32341    pub const VS_SHIFT: u32 = 19;
32342    /// Offset of the `HA` field.
32343    pub const HA_SHIFT: u32 = 21;
32344    /// Offset of the `HD` field.
32345    pub const HD_SHIFT: u32 = 22;
32346    /// Offset of the `HWU59` field.
32347    pub const HWU59_SHIFT: u32 = 25;
32348    /// Offset of the `HWU60` field.
32349    pub const HWU60_SHIFT: u32 = 26;
32350    /// Offset of the `HWU61` field.
32351    pub const HWU61_SHIFT: u32 = 27;
32352    /// Offset of the `HWU62` field.
32353    pub const HWU62_SHIFT: u32 = 28;
32354    /// Offset of the `NSW` field.
32355    pub const NSW_SHIFT: u32 = 29;
32356    /// Offset of the `NSA` field.
32357    pub const NSA_SHIFT: u32 = 30;
32358    /// Offset of the `DS` field.
32359    pub const DS_SHIFT: u32 = 32;
32360    /// Offset of the `SL2` field.
32361    pub const SL2_SHIFT: u32 = 33;
32362    /// Offset of the `AssuredOnly` field.
32363    pub const ASSUREDONLY_SHIFT: u32 = 34;
32364    /// Offset of the `TL1` field.
32365    pub const TL1_SHIFT: u32 = 35;
32366    /// Offset of the `S2PIE` field.
32367    pub const S2PIE_SHIFT: u32 = 36;
32368    /// Offset of the `S2POE` field.
32369    pub const S2POE_SHIFT: u32 = 37;
32370    /// Offset of the `D128` field.
32371    pub const D128_SHIFT: u32 = 38;
32372    /// Offset of the `GCSH` field.
32373    pub const GCSH_SHIFT: u32 = 40;
32374    /// Offset of the `TL0` field.
32375    pub const TL0_SHIFT: u32 = 41;
32376    /// Offset of the `HAFT` field.
32377    pub const HAFT_SHIFT: u32 = 44;
32378    /// Offset of the `HDBSS` field.
32379    pub const HDBSS_SHIFT: u32 = 45;
32380
32381    /// Returns the value of the `T0SZ` field.
32382    pub const fn t0sz(self) -> u8 {
32383        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
32384    }
32385
32386    /// Sets the value of the `T0SZ` field.
32387    pub const fn set_t0sz(&mut self, value: u8) {
32388        let offset = Self::T0SZ_SHIFT;
32389        assert!(value & (Self::T0SZ_MASK as u8) == value);
32390        *self = Self::from_bits_retain(
32391            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
32392        );
32393    }
32394
32395    /// Returns a copy with the `T0SZ` field set to the given value.
32396    pub const fn with_t0sz(mut self, value: u8) -> Self {
32397        self.set_t0sz(value);
32398        self
32399    }
32400
32401    /// Returns the value of the `SL0` field.
32402    pub const fn sl0(self) -> u8 {
32403        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
32404    }
32405
32406    /// Sets the value of the `SL0` field.
32407    pub const fn set_sl0(&mut self, value: u8) {
32408        let offset = Self::SL0_SHIFT;
32409        assert!(value & (Self::SL0_MASK as u8) == value);
32410        *self = Self::from_bits_retain(
32411            (self.bits() & !(Self::SL0_MASK << offset)) | ((value as u64) << offset),
32412        );
32413    }
32414
32415    /// Returns a copy with the `SL0` field set to the given value.
32416    pub const fn with_sl0(mut self, value: u8) -> Self {
32417        self.set_sl0(value);
32418        self
32419    }
32420
32421    /// Returns the value of the `IRGN0` field.
32422    pub const fn irgn0(self) -> u8 {
32423        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
32424    }
32425
32426    /// Sets the value of the `IRGN0` field.
32427    pub const fn set_irgn0(&mut self, value: u8) {
32428        let offset = Self::IRGN0_SHIFT;
32429        assert!(value & (Self::IRGN0_MASK as u8) == value);
32430        *self = Self::from_bits_retain(
32431            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
32432        );
32433    }
32434
32435    /// Returns a copy with the `IRGN0` field set to the given value.
32436    pub const fn with_irgn0(mut self, value: u8) -> Self {
32437        self.set_irgn0(value);
32438        self
32439    }
32440
32441    /// Returns the value of the `ORGN0` field.
32442    pub const fn orgn0(self) -> u8 {
32443        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
32444    }
32445
32446    /// Sets the value of the `ORGN0` field.
32447    pub const fn set_orgn0(&mut self, value: u8) {
32448        let offset = Self::ORGN0_SHIFT;
32449        assert!(value & (Self::ORGN0_MASK as u8) == value);
32450        *self = Self::from_bits_retain(
32451            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
32452        );
32453    }
32454
32455    /// Returns a copy with the `ORGN0` field set to the given value.
32456    pub const fn with_orgn0(mut self, value: u8) -> Self {
32457        self.set_orgn0(value);
32458        self
32459    }
32460
32461    /// Returns the value of the `SH0` field.
32462    pub const fn sh0(self) -> u8 {
32463        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
32464    }
32465
32466    /// Sets the value of the `SH0` field.
32467    pub const fn set_sh0(&mut self, value: u8) {
32468        let offset = Self::SH0_SHIFT;
32469        assert!(value & (Self::SH0_MASK as u8) == value);
32470        *self = Self::from_bits_retain(
32471            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
32472        );
32473    }
32474
32475    /// Returns a copy with the `SH0` field set to the given value.
32476    pub const fn with_sh0(mut self, value: u8) -> Self {
32477        self.set_sh0(value);
32478        self
32479    }
32480
32481    /// Returns the value of the `TG0` field.
32482    pub const fn tg0(self) -> u8 {
32483        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
32484    }
32485
32486    /// Sets the value of the `TG0` field.
32487    pub const fn set_tg0(&mut self, value: u8) {
32488        let offset = Self::TG0_SHIFT;
32489        assert!(value & (Self::TG0_MASK as u8) == value);
32490        *self = Self::from_bits_retain(
32491            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
32492        );
32493    }
32494
32495    /// Returns a copy with the `TG0` field set to the given value.
32496    pub const fn with_tg0(mut self, value: u8) -> Self {
32497        self.set_tg0(value);
32498        self
32499    }
32500
32501    /// Returns the value of the `PS` field.
32502    pub const fn ps(self) -> u8 {
32503        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
32504    }
32505
32506    /// Sets the value of the `PS` field.
32507    pub const fn set_ps(&mut self, value: u8) {
32508        let offset = Self::PS_SHIFT;
32509        assert!(value & (Self::PS_MASK as u8) == value);
32510        *self = Self::from_bits_retain(
32511            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
32512        );
32513    }
32514
32515    /// Returns a copy with the `PS` field set to the given value.
32516    pub const fn with_ps(mut self, value: u8) -> Self {
32517        self.set_ps(value);
32518        self
32519    }
32520}
32521
32522bitflags! {
32523    /// `VTTBR` system register value.
32524    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
32525    #[repr(transparent)]
32526    pub struct Vttbr: u64 {
32527        /// `CnP` bit.
32528        const CNP = 1 << 0;
32529    }
32530}
32531
32532impl Vttbr {
32533    /// Offset of the `CnP` field.
32534    pub const CNP_SHIFT: u32 = 0;
32535    /// Offset of the `BADDR` field.
32536    pub const BADDR_SHIFT: u32 = 1;
32537    /// Mask for the `BADDR` field.
32538    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
32539    /// Offset of the `VMID` field.
32540    pub const VMID_SHIFT: u32 = 48;
32541    /// Mask for the `VMID` field.
32542    pub const VMID_MASK: u64 = 0b11111111;
32543
32544    /// Returns the value of the `BADDR` field.
32545    pub const fn baddr(self) -> u64 {
32546        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
32547            as u64
32548    }
32549
32550    /// Sets the value of the `BADDR` field.
32551    pub const fn set_baddr(&mut self, value: u64) {
32552        let offset = Self::BADDR_SHIFT;
32553        assert!(value & (Self::BADDR_MASK as u64) == value);
32554        *self = Self::from_bits_retain(
32555            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
32556        );
32557    }
32558
32559    /// Returns a copy with the `BADDR` field set to the given value.
32560    pub const fn with_baddr(mut self, value: u64) -> Self {
32561        self.set_baddr(value);
32562        self
32563    }
32564
32565    /// Returns the value of the `VMID` field.
32566    pub const fn vmid(self) -> u8 {
32567        ((self.bits() >> Self::VMID_SHIFT) & 0b11111111) as u8
32568    }
32569
32570    /// Sets the value of the `VMID` field.
32571    pub const fn set_vmid(&mut self, value: u8) {
32572        let offset = Self::VMID_SHIFT;
32573        assert!(value & (Self::VMID_MASK as u8) == value);
32574        *self = Self::from_bits_retain(
32575            (self.bits() & !(Self::VMID_MASK << offset)) | ((value as u64) << offset),
32576        );
32577    }
32578
32579    /// Returns a copy with the `VMID` field set to the given value.
32580    pub const fn with_vmid(mut self, value: u8) -> Self {
32581        self.set_vmid(value);
32582        self
32583    }
32584}
32585
32586#[cfg(feature = "el2")]
32587bitflags! {
32588    /// `VTTBR_EL2` system register value.
32589    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
32590    #[repr(transparent)]
32591    pub struct VttbrEl2: u64 {
32592        /// `CnP` bit.
32593        const CNP = 1 << 0;
32594    }
32595}
32596
32597#[cfg(feature = "el2")]
32598impl VttbrEl2 {
32599    /// Offset of the `CnP` field.
32600    pub const CNP_SHIFT: u32 = 0;
32601    /// Offset of the `BADDR` field.
32602    pub const BADDR_SHIFT: u32 = 1;
32603    /// Mask for the `BADDR` field.
32604    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
32605    /// Offset of the `SKL` field.
32606    pub const SKL_SHIFT: u32 = 1;
32607    /// Mask for the `SKL` field.
32608    pub const SKL_MASK: u64 = 0b11;
32609    /// Offset of the `VMID` field.
32610    pub const VMID_SHIFT: u32 = 48;
32611    /// Mask for the `VMID` field.
32612    pub const VMID_MASK: u64 = 0b1111111111111111;
32613
32614    /// Returns the value of the `BADDR` field.
32615    pub const fn baddr(self) -> u64 {
32616        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
32617            as u64
32618    }
32619
32620    /// Sets the value of the `BADDR` field.
32621    pub const fn set_baddr(&mut self, value: u64) {
32622        let offset = Self::BADDR_SHIFT;
32623        assert!(value & (Self::BADDR_MASK as u64) == value);
32624        *self = Self::from_bits_retain(
32625            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
32626        );
32627    }
32628
32629    /// Returns a copy with the `BADDR` field set to the given value.
32630    pub const fn with_baddr(mut self, value: u64) -> Self {
32631        self.set_baddr(value);
32632        self
32633    }
32634
32635    /// Returns the value of the `SKL` field.
32636    pub const fn skl(self) -> u8 {
32637        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
32638    }
32639
32640    /// Sets the value of the `SKL` field.
32641    pub const fn set_skl(&mut self, value: u8) {
32642        let offset = Self::SKL_SHIFT;
32643        assert!(value & (Self::SKL_MASK as u8) == value);
32644        *self = Self::from_bits_retain(
32645            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
32646        );
32647    }
32648
32649    /// Returns a copy with the `SKL` field set to the given value.
32650    pub const fn with_skl(mut self, value: u8) -> Self {
32651        self.set_skl(value);
32652        self
32653    }
32654
32655    /// Returns the value of the `VMID` field.
32656    pub const fn vmid(self) -> u16 {
32657        ((self.bits() >> Self::VMID_SHIFT) & 0b1111111111111111) as u16
32658    }
32659
32660    /// Sets the value of the `VMID` field.
32661    pub const fn set_vmid(&mut self, value: u16) {
32662        let offset = Self::VMID_SHIFT;
32663        assert!(value & (Self::VMID_MASK as u16) == value);
32664        *self = Self::from_bits_retain(
32665            (self.bits() & !(Self::VMID_MASK << offset)) | ((value as u64) << offset),
32666        );
32667    }
32668
32669    /// Returns a copy with the `VMID` field set to the given value.
32670    pub const fn with_vmid(mut self, value: u16) -> Self {
32671        self.set_vmid(value);
32672        self
32673    }
32674}
32675
32676#[cfg(feature = "el3")]
32677bitflags! {
32678    /// `ZCR_EL3` system register value.
32679    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
32680    #[repr(transparent)]
32681    pub struct ZcrEl3: u64 {
32682    }
32683}
32684
32685#[cfg(feature = "el3")]
32686impl ZcrEl3 {
32687    /// Offset of the `LEN` field.
32688    pub const LEN_SHIFT: u32 = 0;
32689    /// Mask for the `LEN` field.
32690    pub const LEN_MASK: u64 = 0b1111;
32691
32692    /// Returns the value of the `LEN` field.
32693    pub const fn len(self) -> u8 {
32694        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
32695    }
32696
32697    /// Sets the value of the `LEN` field.
32698    pub const fn set_len(&mut self, value: u8) {
32699        let offset = Self::LEN_SHIFT;
32700        assert!(value & (Self::LEN_MASK as u8) == value);
32701        *self = Self::from_bits_retain(
32702            (self.bits() & !(Self::LEN_MASK << offset)) | ((value as u64) << offset),
32703        );
32704    }
32705
32706    /// Returns a copy with the `LEN` field set to the given value.
32707    pub const fn with_len(mut self, value: u8) -> Self {
32708        self.set_len(value);
32709        self
32710    }
32711}
32712
32713#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32714read_write_sysreg!(actlr: (p15, 0, c0, c1, 1), u32, safe_read, fake::SYSREGS);
32715#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32716read_write_sysreg!(actlr2: (p15, 0, c0, c1, 3), u32, safe_read, fake::SYSREGS);
32717#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32718read_write_sysreg!(actlr_el1, u64, safe_read, fake::SYSREGS);
32719#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32720read_write_sysreg!(actlr_el2, u64, safe_read, fake::SYSREGS);
32721#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32722read_write_sysreg!(adfsr: (p15, 0, c1, c5, 0), u32, safe_read, fake::SYSREGS);
32723#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32724read_write_sysreg!(afsr0_el1, u64, safe_read, fake::SYSREGS);
32725#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32726read_write_sysreg!(afsr0_el2, u64, safe_read, fake::SYSREGS);
32727#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32728read_write_sysreg!(afsr1_el1, u64, safe_read, fake::SYSREGS);
32729#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32730read_write_sysreg!(afsr1_el2, u64, safe_read, fake::SYSREGS);
32731#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32732read_sysreg!(aidr: (p15, 1, c0, c0, 7), u32, safe, fake::SYSREGS);
32733#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32734read_write_sysreg!(aifsr: (p15, 0, c1, c5, 1), u32, safe_read, fake::SYSREGS);
32735#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32736read_write_sysreg!(amair0: (p15, 0, c3, c10, 0), u32, safe_read, fake::SYSREGS);
32737#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32738read_write_sysreg!(amair1: (p15, 0, c3, c10, 1), u32, safe_read, fake::SYSREGS);
32739#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32740read_write_sysreg!(amair_el1, u64, safe_read, fake::SYSREGS);
32741#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32742read_write_sysreg!(amair_el2, u64, safe_read, fake::SYSREGS);
32743#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32744read_sysreg!(amcfgr: (p15, 0, c2, c13, 1), u32: Amcfgr, safe, fake::SYSREGS);
32745#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32746read_sysreg!(amcfgr_el0: s3_3_c13_c2_1, u64: AmcfgrEl0, safe, fake::SYSREGS);
32747#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32748read_sysreg!(amcgcr: (p15, 0, c2, c13, 2), u32: Amcgcr, safe, fake::SYSREGS);
32749#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32750read_sysreg!(amcgcr_el0: s3_3_c13_c2_2, u64: AmcgcrEl0, safe, fake::SYSREGS);
32751#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32752read_write_sysreg!(amcntenclr0: (p15, 0, c2, c13, 4), u32: Amcntenclr0, safe_read, safe_write, fake::SYSREGS);
32753#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32754read_write_sysreg!(amcntenclr0_el0: s3_3_c13_c2_4, u64: Amcntenclr0El0, safe_read, safe_write, fake::SYSREGS);
32755#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32756read_write_sysreg!(amcntenclr1: (p15, 0, c3, c13, 0), u32: Amcntenclr1, safe_read, safe_write, fake::SYSREGS);
32757#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32758read_write_sysreg!(amcntenclr1_el0: s3_3_c13_c3_0, u64: Amcntenclr1El0, safe_read, safe_write, fake::SYSREGS);
32759#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32760read_write_sysreg!(amcntenset0: (p15, 0, c2, c13, 5), u32: Amcntenset0, safe_read, safe_write, fake::SYSREGS);
32761#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32762read_write_sysreg!(amcntenset0_el0: s3_3_c13_c2_5, u64: Amcntenset0El0, safe_read, safe_write, fake::SYSREGS);
32763#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32764read_write_sysreg!(amcntenset1: (p15, 0, c3, c13, 1), u32: Amcntenset1, safe_read, safe_write, fake::SYSREGS);
32765#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32766read_write_sysreg!(amcntenset1_el0: s3_3_c13_c3_1, u64: Amcntenset1El0, safe_read, safe_write, fake::SYSREGS);
32767#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32768read_write_sysreg!(amcr: (p15, 0, c2, c13, 0), u32: Amcr, safe_read, safe_write, fake::SYSREGS);
32769#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32770read_write_sysreg!(amcr_el0: s3_3_c13_c2_0, u64: AmcrEl0, safe_read, safe_write, fake::SYSREGS);
32771#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32772read_write_sysreg!(amevcntr00: (p15, 0, c0), u64: Amevcntr00, safe_read, safe_write, fake::SYSREGS);
32773#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32774read_write_sysreg!(amevcntr00_el0: s3_3_c13_c4_0, u64: Amevcntr00El0, safe_read, safe_write, fake::SYSREGS);
32775#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32776read_write_sysreg!(amevcntr01: (p15, 1, c0), u64: Amevcntr01, safe_read, safe_write, fake::SYSREGS);
32777#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32778read_write_sysreg!(amevcntr01_el0: s3_3_c13_c4_1, u64: Amevcntr01El0, safe_read, safe_write, fake::SYSREGS);
32779#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32780read_write_sysreg!(amevcntr02: (p15, 2, c0), u64: Amevcntr02, safe_read, safe_write, fake::SYSREGS);
32781#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32782read_write_sysreg!(amevcntr02_el0: s3_3_c13_c4_2, u64: Amevcntr02El0, safe_read, safe_write, fake::SYSREGS);
32783#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32784read_write_sysreg!(amevcntr03: (p15, 3, c0), u64: Amevcntr03, safe_read, safe_write, fake::SYSREGS);
32785#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32786read_write_sysreg!(amevcntr03_el0: s3_3_c13_c4_3, u64: Amevcntr03El0, safe_read, safe_write, fake::SYSREGS);
32787#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32788read_write_sysreg!(amevcntr10_el0: s3_3_c13_c12_0, u64: Amevcntr10El0, safe_read, safe_write, fake::SYSREGS);
32789#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32790read_write_sysreg!(amevcntr110_el0: s3_3_c13_c13_2, u64: Amevcntr110El0, safe_read, safe_write, fake::SYSREGS);
32791#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32792read_write_sysreg!(amevcntr111_el0: s3_3_c13_c13_3, u64: Amevcntr111El0, safe_read, safe_write, fake::SYSREGS);
32793#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32794read_write_sysreg!(amevcntr112_el0: s3_3_c13_c13_4, u64: Amevcntr112El0, safe_read, safe_write, fake::SYSREGS);
32795#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32796read_write_sysreg!(amevcntr113_el0: s3_3_c13_c13_5, u64: Amevcntr113El0, safe_read, safe_write, fake::SYSREGS);
32797#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32798read_write_sysreg!(amevcntr114_el0: s3_3_c13_c13_6, u64: Amevcntr114El0, safe_read, safe_write, fake::SYSREGS);
32799#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32800read_write_sysreg!(amevcntr115_el0: s3_3_c13_c13_7, u64: Amevcntr115El0, safe_read, safe_write, fake::SYSREGS);
32801#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32802read_write_sysreg!(amevcntr11_el0: s3_3_c13_c12_1, u64: Amevcntr11El0, safe_read, safe_write, fake::SYSREGS);
32803#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32804read_write_sysreg!(amevcntr12_el0: s3_3_c13_c12_2, u64: Amevcntr12El0, safe_read, safe_write, fake::SYSREGS);
32805#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32806read_write_sysreg!(amevcntr13_el0: s3_3_c13_c12_3, u64: Amevcntr13El0, safe_read, safe_write, fake::SYSREGS);
32807#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32808read_write_sysreg!(amevcntr14_el0: s3_3_c13_c12_4, u64: Amevcntr14El0, safe_read, safe_write, fake::SYSREGS);
32809#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32810read_write_sysreg!(amevcntr15_el0: s3_3_c13_c12_5, u64: Amevcntr15El0, safe_read, safe_write, fake::SYSREGS);
32811#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32812read_write_sysreg!(amevcntr16_el0: s3_3_c13_c12_6, u64: Amevcntr16El0, safe_read, safe_write, fake::SYSREGS);
32813#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32814read_write_sysreg!(amevcntr17_el0: s3_3_c13_c12_7, u64: Amevcntr17El0, safe_read, safe_write, fake::SYSREGS);
32815#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32816read_write_sysreg!(amevcntr18_el0: s3_3_c13_c13_0, u64: Amevcntr18El0, safe_read, safe_write, fake::SYSREGS);
32817#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32818read_write_sysreg!(amevcntr19_el0: s3_3_c13_c13_1, u64: Amevcntr19El0, safe_read, safe_write, fake::SYSREGS);
32819#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32820read_write_sysreg!(amuserenr: (p15, 0, c2, c13, 3), u32: Amuserenr, safe_read, safe_write, fake::SYSREGS);
32821#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32822read_write_sysreg!(amuserenr_el0: s3_3_c13_c2_3, u64: AmuserenrEl0, safe_read, safe_write, fake::SYSREGS);
32823#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32824read_write_sysreg!(apiakeyhi_el1: s3_0_c2_c1_1, u64: ApiakeyhiEl1, safe_read, fake::SYSREGS);
32825#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32826read_write_sysreg!(apiakeylo_el1: s3_0_c2_c1_0, u64: ApiakeyloEl1, safe_read, fake::SYSREGS);
32827#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32828read_sysreg!(ccsidr: (p15, 1, c0, c0, 0), u32: Ccsidr, safe, fake::SYSREGS);
32829#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32830read_sysreg!(ccsidr2: (p15, 1, c0, c0, 2), u32: Ccsidr2, safe, fake::SYSREGS);
32831#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32832read_sysreg!(ccsidr_el1, u64: CcsidrEl1, safe, fake::SYSREGS);
32833#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32834read_sysreg!(clidr: (p15, 1, c0, c0, 1), u32: Clidr, safe, fake::SYSREGS);
32835#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32836read_sysreg!(clidr_el1, u64: ClidrEl1, safe, fake::SYSREGS);
32837#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32838read_write_sysreg!(cntfrq: (p15, 0, c0, c14, 0), u32: Cntfrq, safe_read, fake::SYSREGS);
32839#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32840read_write_sysreg!(cntfrq_el0, u64: CntfrqEl0, safe_read, safe_write, fake::SYSREGS);
32841#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32842read_write_sysreg!(cnthctl: (p15, 4, c1, c14, 0), u32: Cnthctl, safe_read, fake::SYSREGS);
32843#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32844read_write_sysreg!(cnthctl_el2, u64: CnthctlEl2, safe_read, safe_write, fake::SYSREGS);
32845#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32846read_write_sysreg!(cnthps_ctl: (p15, 0, c2, c14, 1), u32: CnthpsCtl, safe_read, fake::SYSREGS);
32847#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32848read_write_sysreg!(cnthps_ctl_el2: s3_4_c14_c5_1, u64: CnthpsCtlEl2, safe_read, safe_write, fake::SYSREGS);
32849#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32850read_write_sysreg!(cnthps_cval: (p15, 2, c14), u64: CnthpsCval, safe_read, fake::SYSREGS);
32851#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32852read_write_sysreg!(cnthps_cval_el2: s3_4_c14_c5_2, u64: CnthpsCvalEl2, safe_read, safe_write, fake::SYSREGS);
32853#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32854read_write_sysreg!(cnthps_tval: (p15, 0, c2, c14, 0), u32: CnthpsTval, safe_read, fake::SYSREGS);
32855#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32856read_write_sysreg!(cnthps_tval_el2: s3_4_c14_c5_0, u64: CnthpsTvalEl2, safe_read, safe_write, fake::SYSREGS);
32857#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32858read_write_sysreg!(cnthp_ctl: (p15, 0, c2, c14, 1), u32: CnthpCtl, safe_read, fake::SYSREGS);
32859#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32860read_write_sysreg!(cnthp_ctl_el2: s3_4_c14_c2_1, u64: CnthpCtlEl2, safe_read, safe_write, fake::SYSREGS);
32861#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32862read_write_sysreg!(cnthp_cval: (p15, 2, c14), u64: CnthpCval, safe_read, fake::SYSREGS);
32863#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32864read_write_sysreg!(cnthp_cval_el2: s3_4_c14_c2_2, u64: CnthpCvalEl2, safe_read, safe_write, fake::SYSREGS);
32865#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32866read_write_sysreg!(cnthp_tval: (p15, 0, c2, c14, 0), u32: CnthpTval, safe_read, fake::SYSREGS);
32867#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32868read_write_sysreg!(cnthp_tval_el2: s3_4_c14_c2_0, u64: CnthpTvalEl2, safe_read, safe_write, fake::SYSREGS);
32869#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32870read_write_sysreg!(cnthvs_ctl: (p15, 0, c3, c14, 1), u32: CnthvsCtl, safe_read, fake::SYSREGS);
32871#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32872read_write_sysreg!(cnthvs_ctl_el2: s3_4_c14_c4_1, u64: CnthvsCtlEl2, safe_read, safe_write, fake::SYSREGS);
32873#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32874read_write_sysreg!(cnthvs_cval: (p15, 3, c14), u64: CnthvsCval, safe_read, fake::SYSREGS);
32875#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32876read_write_sysreg!(cnthvs_cval_el2: s3_4_c14_c4_2, u64: CnthvsCvalEl2, safe_read, safe_write, fake::SYSREGS);
32877#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32878read_write_sysreg!(cnthvs_tval: (p15, 0, c3, c14, 0), u32: CnthvsTval, safe_read, fake::SYSREGS);
32879#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32880read_write_sysreg!(cnthvs_tval_el2: s3_4_c14_c4_0, u64: CnthvsTvalEl2, safe_read, safe_write, fake::SYSREGS);
32881#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32882read_write_sysreg!(cnthv_ctl: (p15, 0, c3, c14, 1), u32: CnthvCtl, safe_read, fake::SYSREGS);
32883#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32884read_write_sysreg!(cnthv_ctl_el2: s3_4_c14_c3_1, u64: CnthvCtlEl2, safe_read, safe_write, fake::SYSREGS);
32885#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32886read_write_sysreg!(cnthv_cval: (p15, 3, c14), u64: CnthvCval, safe_read, fake::SYSREGS);
32887#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32888read_write_sysreg!(cnthv_cval_el2: s3_4_c14_c3_2, u64: CnthvCvalEl2, safe_read, safe_write, fake::SYSREGS);
32889#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32890read_write_sysreg!(cnthv_tval: (p15, 0, c3, c14, 0), u32: CnthvTval, safe_read, fake::SYSREGS);
32891#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32892read_write_sysreg!(cnthv_tval_el2: s3_4_c14_c3_0, u64: CnthvTvalEl2, safe_read, safe_write, fake::SYSREGS);
32893#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32894read_write_sysreg!(cntkctl: (p15, 0, c1, c14, 0), u32: Cntkctl, safe_read, fake::SYSREGS);
32895#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32896read_write_sysreg!(cntkctl_el1, u64: CntkctlEl1, safe_read, safe_write, fake::SYSREGS);
32897#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32898read_sysreg!(cntpct: (p15, 0, c14), u64: Cntpct, safe, fake::SYSREGS);
32899#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32900read_sysreg!(cntpctss: (p15, 8, c14), u64: Cntpctss, safe, fake::SYSREGS);
32901#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32902read_sysreg!(cntpctss_el0: s3_3_c14_c0_5, u64: CntpctssEl0, safe, fake::SYSREGS);
32903#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32904read_sysreg!(cntpct_el0, u64: CntpctEl0, safe, fake::SYSREGS);
32905#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32906read_write_sysreg!(cntpoff_el2: s3_4_c14_c0_6, u64: CntpoffEl2, safe_read, safe_write, fake::SYSREGS);
32907#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32908read_write_sysreg!(cntps_ctl_el1, u64: CntpsCtlEl1, safe_read, safe_write, fake::SYSREGS);
32909#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32910read_write_sysreg!(cntps_cval_el1, u64: CntpsCvalEl1, safe_read, safe_write, fake::SYSREGS);
32911#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32912read_write_sysreg!(cntps_tval_el1, u64: CntpsTvalEl1, safe_read, safe_write, fake::SYSREGS);
32913#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32914read_write_sysreg!(cntp_ctl: (p15, 0, c2, c14, 1), u32: CntpCtl, safe_read, fake::SYSREGS);
32915#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32916read_write_sysreg!(cntp_ctl_el0, u64: CntpCtlEl0, safe_read, safe_write, fake::SYSREGS);
32917#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32918read_write_sysreg!(cntp_cval: (p15, 2, c14), u64: CntpCval, safe_read, fake::SYSREGS);
32919#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32920read_write_sysreg!(cntp_cval_el0, u64: CntpCvalEl0, safe_read, safe_write, fake::SYSREGS);
32921#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32922read_write_sysreg!(cntp_tval: (p15, 0, c2, c14, 0), u32: CntpTval, safe_read, fake::SYSREGS);
32923#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32924read_write_sysreg!(cntp_tval_el0, u64: CntpTvalEl0, safe_read, safe_write, fake::SYSREGS);
32925#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32926read_sysreg!(cntvct: (p15, 1, c14), u64: Cntvct, safe, fake::SYSREGS);
32927#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32928read_sysreg!(cntvctss: (p15, 9, c14), u64: Cntvctss, safe, fake::SYSREGS);
32929#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32930read_sysreg!(cntvctss_el0: s3_3_c14_c0_6, u64: CntvctssEl0, safe, fake::SYSREGS);
32931#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32932read_sysreg!(cntvct_el0, u64: CntvctEl0, safe, fake::SYSREGS);
32933#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32934read_write_sysreg!(cntvoff: (p15, 4, c14), u64: Cntvoff, safe_read, fake::SYSREGS);
32935#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32936read_write_sysreg!(cntvoff_el2, u64: CntvoffEl2, safe_read, safe_write, fake::SYSREGS);
32937#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32938read_write_sysreg!(cntv_ctl: (p15, 0, c3, c14, 1), u32: CntvCtl, safe_read, fake::SYSREGS);
32939#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32940read_write_sysreg!(cntv_ctl_el0, u64: CntvCtlEl0, safe_read, safe_write, fake::SYSREGS);
32941#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32942read_write_sysreg!(cntv_cval: (p15, 3, c14), u64: CntvCval, safe_read, fake::SYSREGS);
32943#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32944read_write_sysreg!(cntv_cval_el0, u64: CntvCvalEl0, safe_read, safe_write, fake::SYSREGS);
32945#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32946read_write_sysreg!(cntv_tval: (p15, 0, c3, c14, 0), u32: CntvTval, safe_read, fake::SYSREGS);
32947#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32948read_write_sysreg!(cntv_tval_el0, u64: CntvTvalEl0, safe_read, safe_write, fake::SYSREGS);
32949#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32950read_write_sysreg!(contextidr: (p15, 0, c0, c13, 1), u32: Contextidr, safe_read, fake::SYSREGS);
32951#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32952read_write_sysreg!(contextidr_el1, u64: ContextidrEl1, safe_read, safe_write, fake::SYSREGS);
32953#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32954read_write_sysreg!(contextidr_el2: s3_4_c13_c0_1, u64: ContextidrEl2, safe_read, safe_write, fake::SYSREGS);
32955#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32956read_write_sysreg!(cpacr: (p15, 0, c0, c1, 2), u32: Cpacr, safe_read, fake::SYSREGS);
32957#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32958read_write_sysreg!(cpacr_el1, u64: CpacrEl1, safe_read, fake::SYSREGS);
32959#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32960read_write_sysreg!(cptr_el2, u64: CptrEl2, safe_read, fake::SYSREGS);
32961#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32962read_write_sysreg!(cptr_el3, u64: CptrEl3, safe_read, fake::SYSREGS);
32963#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32964read_write_sysreg!(csselr: (p15, 2, c0, c0, 0), u32: Csselr, safe_read, fake::SYSREGS);
32965#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32966read_write_sysreg!(csselr_el1, u64: CsselrEl1, safe_read, safe_write, fake::SYSREGS);
32967#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32968read_sysreg!(ctr: (p15, 0, c0, c0, 1), u32: Ctr, safe, fake::SYSREGS);
32969#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32970read_sysreg!(ctr_el0, u64: CtrEl0, safe, fake::SYSREGS);
32971#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32972read_sysreg!(currentel, u64: Currentel, safe, fake::SYSREGS);
32973#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32974read_write_sysreg!(dacr: (p15, 0, c0, c3, 0), u32: Dacr, safe_read, fake::SYSREGS);
32975#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32976read_sysreg!(dbgauthstatus: (p14, 0, c14, c7, 6), u32: Dbgauthstatus, safe, fake::SYSREGS);
32977#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32978read_write_sysreg!(dbgclaimclr: (p14, 0, c9, c7, 6), u32: Dbgclaimclr, safe_read, fake::SYSREGS);
32979#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32980read_write_sysreg!(dbgclaimset: (p14, 0, c8, c7, 6), u32: Dbgclaimset, safe_read, fake::SYSREGS);
32981#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32982read_write_sysreg!(dbgdccint: (p14, 0, c2, c0, 0), u32: Dbgdccint, safe_read, fake::SYSREGS);
32983#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32984read_sysreg!(dbgdevid: (p14, 0, c2, c7, 7), u32: Dbgdevid, safe, fake::SYSREGS);
32985#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32986read_sysreg!(dbgdevid1: (p14, 0, c1, c7, 7), u32: Dbgdevid1, safe, fake::SYSREGS);
32987#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32988read_sysreg!(dbgdevid2: (p14, 0, c0, c7, 7), u32, safe, fake::SYSREGS);
32989#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32990read_sysreg!(dbgdidr: (p14, 0, c0, c0, 0), u32: Dbgdidr, safe, fake::SYSREGS);
32991#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32992read_sysreg!(dbgdrar: (p14, 0, c1), u64: Dbgdrar, safe, fake::SYSREGS);
32993#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32994read_sysreg!(dbgdsar: (p14, 0, c2), u64, safe, fake::SYSREGS);
32995#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32996read_write_sysreg!(dbgdscrext: (p14, 0, c2, c0, 2), u32: Dbgdscrext, safe_read, fake::SYSREGS);
32997#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32998read_sysreg!(dbgdscrint: (p14, 0, c1, c0, 0), u32: Dbgdscrint, safe, fake::SYSREGS);
32999#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33000read_write_sysreg!(dbgdtrrxext: (p14, 0, c0, c0, 2), u32: Dbgdtrrxext, safe_read, fake::SYSREGS);
33001#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33002read_sysreg!(dbgdtrrxint: (p14, 0, c5, c0, 0), u32: Dbgdtrrxint, safe, fake::SYSREGS);
33003#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33004read_write_sysreg!(dbgdtrtxext: (p14, 0, c3, c0, 2), u32: Dbgdtrtxext, safe_read, fake::SYSREGS);
33005#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33006write_sysreg!(dbgdtrtxint: (p14, 0, c5, c0, 0), u32: Dbgdtrtxint, fake::SYSREGS);
33007#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33008read_write_sysreg!(dbgosdlr: (p14, 0, c3, c1, 4), u32: Dbgosdlr, safe_read, fake::SYSREGS);
33009#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33010read_write_sysreg!(dbgoseccr: (p14, 0, c6, c0, 2), u32: Dbgoseccr, safe_read, fake::SYSREGS);
33011#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33012write_sysreg!(dbgoslar: (p14, 0, c0, c1, 4), u32: Dbgoslar, fake::SYSREGS);
33013#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33014read_sysreg!(dbgoslsr: (p14, 0, c1, c1, 4), u32: Dbgoslsr, safe, fake::SYSREGS);
33015#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33016read_write_sysreg!(dbgprcr: (p14, 0, c4, c1, 4), u32: Dbgprcr, safe_read, fake::SYSREGS);
33017#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33018read_write_sysreg!(dbgvcr: (p14, 0, c7, c0, 0), u32: Dbgvcr, safe_read, fake::SYSREGS);
33019#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33020read_write_sysreg!(dbgwfar: (p14, 0, c6, c0, 0), u32, safe_read, fake::SYSREGS);
33021#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33022read_write_sysreg!(dfar: (p15, 0, c0, c6, 0), u32: Dfar, safe_read, fake::SYSREGS);
33023#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33024read_write_sysreg!(dfsr: (p15, 0, c0, c5, 0), u32: Dfsr, safe_read, fake::SYSREGS);
33025#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33026read_write_sysreg!(disr: (p15, 0, c1, c12, 1), u32: Disr, safe_read, fake::SYSREGS);
33027#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33028read_write_sysreg!(disr_el1: s3_0_c12_c1_1, u64: DisrEl1, safe_read, safe_write, fake::SYSREGS);
33029#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
33030read_write_sysreg!(dit: s3_3_c4_c2_5, u64: Dit, safe_read, safe_write, fake::SYSREGS);
33031#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33032read_write_sysreg!(dlr: (p15, 3, c5, c4, 1), u32: Dlr, safe_read, fake::SYSREGS);
33033#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33034read_write_sysreg!(dspsr: (p15, 3, c5, c4, 0), u32: Dspsr, safe_read, fake::SYSREGS);
33035#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33036read_write_sysreg!(dspsr2: (p15, 3, c5, c4, 2), u32: Dspsr2, safe_read, fake::SYSREGS);
33037#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33038read_write_sysreg!(elr_el1, u64: ElrEl1, safe_read, fake::SYSREGS);
33039#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33040read_write_sysreg!(elr_el2, u64: ElrEl2, safe_read, fake::SYSREGS);
33041#[cfg(all(any(test, feature = "fakes", target_arch = "arm"), feature = "el2"))]
33042read_write_sysreg!(elr_hyp, u32: ElrHyp, safe_read, fake::SYSREGS);
33043#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33044read_sysreg!(erridr: (p15, 0, c3, c5, 0), u32: Erridr, safe, fake::SYSREGS);
33045#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33046read_write_sysreg!(errselr: (p15, 0, c3, c5, 1), u32: Errselr, safe_read, fake::SYSREGS);
33047#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33048read_write_sysreg!(erxaddr: (p15, 0, c4, c5, 3), u32: Erxaddr, safe_read, fake::SYSREGS);
33049#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33050read_write_sysreg!(erxaddr2: (p15, 0, c4, c5, 7), u32: Erxaddr2, safe_read, fake::SYSREGS);
33051#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33052read_write_sysreg!(erxctlr: (p15, 0, c4, c5, 1), u32: Erxctlr, safe_read, fake::SYSREGS);
33053#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33054read_write_sysreg!(erxctlr2: (p15, 0, c4, c5, 5), u32: Erxctlr2, safe_read, fake::SYSREGS);
33055#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33056read_sysreg!(erxfr: (p15, 0, c4, c5, 0), u32: Erxfr, safe, fake::SYSREGS);
33057#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33058read_sysreg!(erxfr2: (p15, 0, c4, c5, 4), u32: Erxfr2, safe, fake::SYSREGS);
33059#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33060read_write_sysreg!(erxmisc0: (p15, 0, c5, c5, 0), u32: Erxmisc0, safe_read, fake::SYSREGS);
33061#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33062read_write_sysreg!(erxmisc1: (p15, 0, c5, c5, 1), u32: Erxmisc1, safe_read, fake::SYSREGS);
33063#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33064read_write_sysreg!(erxmisc2: (p15, 0, c5, c5, 4), u32: Erxmisc2, safe_read, fake::SYSREGS);
33065#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33066read_write_sysreg!(erxmisc3: (p15, 0, c5, c5, 5), u32: Erxmisc3, safe_read, fake::SYSREGS);
33067#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33068read_write_sysreg!(erxmisc4: (p15, 0, c5, c5, 2), u32: Erxmisc4, safe_read, fake::SYSREGS);
33069#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33070read_write_sysreg!(erxmisc5: (p15, 0, c5, c5, 3), u32: Erxmisc5, safe_read, fake::SYSREGS);
33071#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33072read_write_sysreg!(erxmisc6: (p15, 0, c5, c5, 6), u32: Erxmisc6, safe_read, fake::SYSREGS);
33073#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33074read_write_sysreg!(erxmisc7: (p15, 0, c5, c5, 7), u32: Erxmisc7, safe_read, fake::SYSREGS);
33075#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33076read_write_sysreg!(erxstatus: (p15, 0, c4, c5, 2), u32: Erxstatus, safe_read, fake::SYSREGS);
33077#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33078read_write_sysreg!(esr_el1, u64: EsrEl1, safe_read, safe_write, fake::SYSREGS);
33079#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33080read_write_sysreg!(esr_el2, u64: EsrEl2, safe_read, safe_write, fake::SYSREGS);
33081#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33082read_write_sysreg!(esr_el3, u64: EsrEl3, safe_read, safe_write, fake::SYSREGS);
33083#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33084read_write_sysreg!(far_el1, u64: FarEl1, safe_read, fake::SYSREGS);
33085#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33086read_write_sysreg!(far_el2, u64: FarEl2, safe_read, fake::SYSREGS);
33087#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33088read_write_sysreg!(fcseidr: (p15, 0, c0, c13, 0), u32, safe_read, fake::SYSREGS);
33089#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33090read_write_sysreg!(gcr_el1: s3_0_c1_c0_6, u64: GcrEl1, safe_read, fake::SYSREGS);
33091#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33092read_write_sysreg!(gcscr_el1: s3_0_c2_c5_0, u64: GcscrEl1, safe_read, fake::SYSREGS);
33093#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33094read_write_sysreg!(gcscr_el2: s3_4_c2_c5_0, u64: GcscrEl2, safe_read, fake::SYSREGS);
33095#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33096read_write_sysreg!(gpccr_el3: s3_6_c2_c1_6, u64: GpccrEl3, safe_read, fake::SYSREGS);
33097#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33098read_write_sysreg!(gptbr_el3: s3_6_c2_c1_4, u64: GptbrEl3, safe_read, fake::SYSREGS);
33099#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33100read_write_sysreg!(hacr: (p15, 4, c1, c1, 7), u32, safe_read, fake::SYSREGS);
33101#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33102read_write_sysreg!(hacr_el2, u64, safe_read, fake::SYSREGS);
33103#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33104read_write_sysreg!(hactlr: (p15, 4, c0, c1, 1), u32, safe_read, fake::SYSREGS);
33105#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33106read_write_sysreg!(hactlr2: (p15, 4, c0, c1, 3), u32, safe_read, fake::SYSREGS);
33107#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33108read_write_sysreg!(hadfsr: (p15, 4, c1, c5, 0), u32, safe_read, fake::SYSREGS);
33109#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33110read_write_sysreg!(hafgrtr_el2: s3_4_c3_c1_6, u64: HafgrtrEl2, safe_read, fake::SYSREGS);
33111#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33112read_write_sysreg!(haifsr: (p15, 4, c1, c5, 1), u32, safe_read, fake::SYSREGS);
33113#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33114read_write_sysreg!(hamair0: (p15, 4, c3, c10, 0), u32, safe_read, fake::SYSREGS);
33115#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33116read_write_sysreg!(hamair1: (p15, 4, c3, c10, 1), u32, safe_read, fake::SYSREGS);
33117#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33118read_write_sysreg!(hcptr: (p15, 4, c1, c1, 2), u32: Hcptr, safe_read, fake::SYSREGS);
33119#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33120read_write_sysreg!(hcr: (p15, 4, c1, c1, 0), u32: Hcr, safe_read, fake::SYSREGS);
33121#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33122read_write_sysreg!(hcr2: (p15, 4, c1, c1, 4), u32: Hcr2, safe_read, fake::SYSREGS);
33123#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33124read_write_sysreg!(hcrx_el2: s3_4_c1_c2_2, u64: HcrxEl2, safe_read, fake::SYSREGS);
33125#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33126read_write_sysreg!(hcr_el2, u64: HcrEl2, safe_read, fake::SYSREGS);
33127#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33128read_write_sysreg!(hdcr: (p15, 4, c1, c1, 1), u32: Hdcr, safe_read, fake::SYSREGS);
33129#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33130read_write_sysreg!(hdfar: (p15, 4, c0, c6, 0), u32: Hdfar, safe_read, fake::SYSREGS);
33131#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33132read_write_sysreg!(hdfgrtr2_el2: s3_4_c3_c1_0, u64: Hdfgrtr2El2, safe_read, fake::SYSREGS);
33133#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33134read_write_sysreg!(hdfgrtr_el2: s3_4_c3_c1_4, u64: HdfgrtrEl2, safe_read, fake::SYSREGS);
33135#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33136read_write_sysreg!(hdfgwtr2_el2: s3_4_c3_c1_1, u64: Hdfgwtr2El2, safe_read, fake::SYSREGS);
33137#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33138read_write_sysreg!(hdfgwtr_el2: s3_4_c3_c1_5, u64: HdfgwtrEl2, safe_read, fake::SYSREGS);
33139#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33140read_write_sysreg!(hfgitr2_el2: s3_4_c3_c1_7, u64: Hfgitr2El2, safe_read, fake::SYSREGS);
33141#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33142read_write_sysreg!(hfgitr_el2: s3_4_c1_c1_6, u64: HfgitrEl2, safe_read, fake::SYSREGS);
33143#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33144read_write_sysreg!(hfgrtr2_el2: s3_4_c3_c1_2, u64: Hfgrtr2El2, safe_read, fake::SYSREGS);
33145#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33146read_write_sysreg!(hfgrtr_el2: s3_4_c1_c1_4, u64: HfgrtrEl2, safe_read, fake::SYSREGS);
33147#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33148read_write_sysreg!(hfgwtr2_el2: s3_4_c3_c1_3, u64: Hfgwtr2El2, safe_read, fake::SYSREGS);
33149#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33150read_write_sysreg!(hfgwtr_el2: s3_4_c1_c1_5, u64: HfgwtrEl2, safe_read, fake::SYSREGS);
33151#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33152read_write_sysreg!(hifar: (p15, 4, c0, c6, 2), u32: Hifar, safe_read, fake::SYSREGS);
33153#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33154read_write_sysreg!(hmair0: (p15, 4, c2, c10, 0), u32: Hmair0, safe_read, fake::SYSREGS);
33155#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33156read_write_sysreg!(hmair1: (p15, 4, c2, c10, 1), u32: Hmair1, safe_read, fake::SYSREGS);
33157#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33158read_write_sysreg!(hpfar: (p15, 4, c0, c6, 4), u32: Hpfar, safe_read, fake::SYSREGS);
33159#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33160read_write_sysreg!(hpfar_el2, u64: HpfarEl2, safe_read, fake::SYSREGS);
33161#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33162read_write_sysreg!(hrmr: (p15, 4, c0, c12, 2), u32: Hrmr, safe_read, fake::SYSREGS);
33163#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33164read_write_sysreg!(hsctlr: (p15, 4, c0, c1, 0), u32: Hsctlr, safe_read, fake::SYSREGS);
33165#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33166read_write_sysreg!(hsr: (p15, 4, c2, c5, 0), u32: Hsr, safe_read, fake::SYSREGS);
33167#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33168read_write_sysreg!(hstr: (p15, 4, c1, c1, 3), u32, safe_read, fake::SYSREGS);
33169#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33170read_write_sysreg!(hstr_el2, u64, safe_read, safe_write, fake::SYSREGS);
33171#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33172read_write_sysreg!(htcr: (p15, 4, c0, c2, 2), u32: Htcr, safe_read, fake::SYSREGS);
33173#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33174read_write_sysreg!(htpidr: (p15, 4, c0, c13, 2), u32: Htpidr, safe_read, fake::SYSREGS);
33175#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33176read_write_sysreg!(htrfcr: (p15, 4, c2, c1, 1), u32: Htrfcr, safe_read, fake::SYSREGS);
33177#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33178read_write_sysreg!(httbr: (p15, 4, c2), u64: Httbr, safe_read, fake::SYSREGS);
33179#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33180read_write_sysreg!(hvbar: (p15, 4, c0, c12, 0), u32: Hvbar, safe_read, fake::SYSREGS);
33181#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33182read_write_sysreg!(icc_ap0r0_el1: s3_0_c12_c8_4, u64, safe_read, fake::SYSREGS);
33183#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33184read_write_sysreg!(icc_ap0r1_el1: s3_0_c12_c8_5, u64, safe_read, fake::SYSREGS);
33185#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33186read_write_sysreg!(icc_ap0r2_el1: s3_0_c12_c8_6, u64, safe_read, fake::SYSREGS);
33187#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33188read_write_sysreg!(icc_ap0r3_el1: s3_0_c12_c8_7, u64, safe_read, fake::SYSREGS);
33189#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33190read_write_sysreg!(icc_ap1r0_el1: s3_0_c12_c9_0, u64: IccAp1r0El1, safe_read, fake::SYSREGS);
33191#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33192read_write_sysreg!(icc_ap1r1_el1: s3_0_c12_c9_1, u64, safe_read, fake::SYSREGS);
33193#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33194read_write_sysreg!(icc_ap1r2_el1: s3_0_c12_c9_2, u64, safe_read, fake::SYSREGS);
33195#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33196read_write_sysreg!(icc_ap1r3_el1: s3_0_c12_c9_3, u64, safe_read, fake::SYSREGS);
33197#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33198write_sysreg!(icc_asgi1r: (p15, 1, c12), u64: IccAsgi1r, safe, fake::SYSREGS);
33199#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33200write_sysreg!(icc_asgi1r_el1: s3_0_c12_c11_6, u64: IccAsgi1rEl1, safe, fake::SYSREGS);
33201#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33202read_write_sysreg!(icc_bpr0: (p15, 0, c8, c12, 3), u32: IccBpr0, safe_read, safe_write, fake::SYSREGS);
33203#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33204read_write_sysreg!(icc_bpr0_el1: s3_0_c12_c8_3, u64: IccBpr0El1, safe_read, safe_write, fake::SYSREGS);
33205#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33206read_write_sysreg!(icc_bpr1: (p15, 0, c12, c12, 3), u32: IccBpr1, safe_read, safe_write, fake::SYSREGS);
33207#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33208read_write_sysreg!(icc_bpr1_el1: s3_0_c12_c12_3, u64: IccBpr1El1, safe_read, safe_write, fake::SYSREGS);
33209#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33210read_write_sysreg!(icc_ctlr: (p15, 0, c12, c12, 4), u32: IccCtlr, safe_read, safe_write, fake::SYSREGS);
33211#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33212read_write_sysreg!(icc_ctlr_el1: s3_0_c12_c12_4, u64: IccCtlrEl1, safe_read, safe_write, fake::SYSREGS);
33213#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33214read_write_sysreg!(icc_ctlr_el3: s3_6_c12_c12_4, u64: IccCtlrEl3, safe_read, safe_write, fake::SYSREGS);
33215#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33216write_sysreg!(icc_dir: (p15, 0, c11, c12, 1), u32: IccDir, safe, fake::SYSREGS);
33217#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33218write_sysreg!(icc_dir_el1: s3_0_c12_c11_1, u64: IccDirEl1, safe, fake::SYSREGS);
33219#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33220write_sysreg!(icc_eoir0: (p15, 0, c8, c12, 1), u32: IccEoir0, safe, fake::SYSREGS);
33221#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33222write_sysreg!(icc_eoir0_el1: s3_0_c12_c8_1, u64: IccEoir0El1, safe, fake::SYSREGS);
33223#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33224write_sysreg!(icc_eoir1: (p15, 0, c12, c12, 1), u32: IccEoir1, safe, fake::SYSREGS);
33225#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33226write_sysreg!(icc_eoir1_el1: s3_0_c12_c12_1, u64: IccEoir1El1, safe, fake::SYSREGS);
33227#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33228read_sysreg!(icc_hppir0: (p15, 0, c8, c12, 2), u32: IccHppir0, safe, fake::SYSREGS);
33229#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33230read_sysreg!(icc_hppir0_el1: s3_0_c12_c8_2, u64: IccHppir0El1, safe, fake::SYSREGS);
33231#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33232read_sysreg!(icc_hppir1: (p15, 0, c12, c12, 2), u32: IccHppir1, safe, fake::SYSREGS);
33233#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33234read_sysreg!(icc_hppir1_el1: s3_0_c12_c12_2, u64: IccHppir1El1, safe, fake::SYSREGS);
33235#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33236read_write_sysreg!(icc_hsre: (p15, 4, c9, c12, 5), u32: IccHsre, safe_read, fake::SYSREGS);
33237#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33238read_sysreg!(icc_iar0: (p15, 0, c8, c12, 0), u32: IccIar0, safe, fake::SYSREGS);
33239#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33240read_sysreg!(icc_iar0_el1: s3_0_c12_c8_0, u64: IccIar0El1, safe, fake::SYSREGS);
33241#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33242read_sysreg!(icc_iar1: (p15, 0, c12, c12, 0), u32: IccIar1, safe, fake::SYSREGS);
33243#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33244read_sysreg!(icc_iar1_el1: s3_0_c12_c12_0, u64: IccIar1El1, safe, fake::SYSREGS);
33245#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33246read_write_sysreg!(icc_igrpen0: (p15, 0, c12, c12, 6), u32: IccIgrpen0, safe_read, safe_write, fake::SYSREGS);
33247#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33248read_write_sysreg!(icc_igrpen0_el1: s3_0_c12_c12_6, u64: IccIgrpen0El1, safe_read, safe_write, fake::SYSREGS);
33249#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33250read_write_sysreg!(icc_igrpen1: (p15, 0, c12, c12, 7), u32: IccIgrpen1, safe_read, safe_write, fake::SYSREGS);
33251#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33252read_write_sysreg!(icc_igrpen1_el1: s3_0_c12_c12_7, u64: IccIgrpen1El1, safe_read, safe_write, fake::SYSREGS);
33253#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33254read_write_sysreg!(icc_igrpen1_el3: s3_6_c12_c12_7, u64: IccIgrpen1El3, safe_read, safe_write, fake::SYSREGS);
33255#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33256read_write_sysreg!(icc_mctlr: (p15, 6, c12, c12, 4), u32: IccMctlr, safe_read, safe_write, fake::SYSREGS);
33257#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33258read_write_sysreg!(icc_mgrpen1: (p15, 6, c12, c12, 7), u32: IccMgrpen1, safe_read, safe_write, fake::SYSREGS);
33259#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33260read_write_sysreg!(icc_msre: (p15, 6, c12, c12, 5), u32: IccMsre, safe_read, fake::SYSREGS);
33261#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33262read_sysreg!(icc_nmiar1_el1: s3_0_c12_c9_5, u64: IccNmiar1El1, safe, fake::SYSREGS);
33263#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33264read_write_sysreg!(icc_pmr: (p15, 0, c6, c4, 0), u32: IccPmr, safe_read, safe_write, fake::SYSREGS);
33265#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33266read_write_sysreg!(icc_pmr_el1: s3_0_c4_c6_0, u64: IccPmrEl1, safe_read, safe_write, fake::SYSREGS);
33267#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33268read_sysreg!(icc_rpr: (p15, 0, c11, c12, 3), u32: IccRpr, safe, fake::SYSREGS);
33269#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33270read_sysreg!(icc_rpr_el1: s3_0_c12_c11_3, u64: IccRprEl1, safe, fake::SYSREGS);
33271#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33272write_sysreg!(icc_sgi0r: (p15, 2, c12), u64: IccSgi0r, safe, fake::SYSREGS);
33273#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33274write_sysreg!(icc_sgi0r_el1: s3_0_c12_c11_7, u64: IccSgi0rEl1, safe, fake::SYSREGS);
33275#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33276write_sysreg!(icc_sgi1r: (p15, 0, c12), u64: IccSgi1r, safe, fake::SYSREGS);
33277#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33278write_sysreg!(icc_sgi1r_el1: s3_0_c12_c11_5, u64: IccSgi1rEl1, safe, fake::SYSREGS);
33279#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33280read_write_sysreg!(icc_sre: (p15, 0, c12, c12, 5), u32: IccSre, safe_read, fake::SYSREGS);
33281#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33282read_write_sysreg!(icc_sre_el1: s3_0_c12_c12_5, u64: IccSreEl1, safe_read, fake::SYSREGS);
33283#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33284read_write_sysreg!(icc_sre_el2: s3_4_c12_c9_5, u64: IccSreEl2, safe_read, fake::SYSREGS);
33285#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33286read_write_sysreg! {
33287    /// # Safety
33288    ///
33289    /// The SRE bit of `icc_sre_el3` must not be changed from 1 to 0, as this can result in unpredictable behaviour.
33290    icc_sre_el3: s3_6_c12_c12_5, u64: IccSreEl3, safe_read, fake::SYSREGS
33291}
33292#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33293read_write_sysreg!(ich_hcr_el2: s3_4_c12_c11_0, u64: IchHcrEl2, safe_read, fake::SYSREGS);
33294#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33295read_write_sysreg!(ich_vmcr_el2: s3_4_c12_c11_7, u64: IchVmcrEl2, safe_read, safe_write, fake::SYSREGS);
33296#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33297read_sysreg!(id_aa64dfr0_el1, u64: IdAa64dfr0El1, safe, fake::SYSREGS);
33298#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33299read_sysreg!(id_aa64dfr1_el1, u64: IdAa64dfr1El1, safe, fake::SYSREGS);
33300#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33301read_sysreg!(id_aa64isar1_el1, u64: IdAa64isar1El1, safe, fake::SYSREGS);
33302#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33303read_sysreg!(id_aa64isar2_el1, u64: IdAa64isar2El1, safe, fake::SYSREGS);
33304#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33305read_sysreg!(id_aa64mmfr0_el1, u64: IdAa64mmfr0El1, safe, fake::SYSREGS);
33306#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33307read_sysreg!(id_aa64mmfr1_el1, u64: IdAa64mmfr1El1, safe, fake::SYSREGS);
33308#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33309read_sysreg!(id_aa64mmfr2_el1, u64: IdAa64mmfr2El1, safe, fake::SYSREGS);
33310#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33311read_sysreg!(id_aa64mmfr3_el1, u64: IdAa64mmfr3El1, safe, fake::SYSREGS);
33312#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33313read_sysreg!(id_aa64pfr0_el1, u64: IdAa64pfr0El1, safe, fake::SYSREGS);
33314#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33315read_sysreg!(id_aa64pfr1_el1, u64: IdAa64pfr1El1, safe, fake::SYSREGS);
33316#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33317read_sysreg!(id_aa64smfr0_el1: s3_0_c0_c4_5, u64: IdAa64smfr0El1, safe, fake::SYSREGS);
33318#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33319read_sysreg!(id_afr0: (p15, 0, c1, c0, 3), u32, safe, fake::SYSREGS);
33320#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33321read_sysreg!(id_dfr0: (p15, 0, c1, c0, 2), u32: IdDfr0, safe, fake::SYSREGS);
33322#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33323read_sysreg!(id_dfr1: (p15, 0, c3, c0, 5), u32: IdDfr1, safe, fake::SYSREGS);
33324#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33325read_sysreg!(id_isar0: (p15, 0, c2, c0, 0), u32: IdIsar0, safe, fake::SYSREGS);
33326#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33327read_sysreg!(id_isar1: (p15, 0, c2, c0, 1), u32: IdIsar1, safe, fake::SYSREGS);
33328#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33329read_sysreg!(id_isar2: (p15, 0, c2, c0, 2), u32: IdIsar2, safe, fake::SYSREGS);
33330#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33331read_sysreg!(id_isar3: (p15, 0, c2, c0, 3), u32: IdIsar3, safe, fake::SYSREGS);
33332#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33333read_sysreg!(id_isar4: (p15, 0, c2, c0, 4), u32: IdIsar4, safe, fake::SYSREGS);
33334#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33335read_sysreg!(id_isar5: (p15, 0, c2, c0, 5), u32: IdIsar5, safe, fake::SYSREGS);
33336#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33337read_sysreg!(id_isar6: (p15, 0, c2, c0, 7), u32: IdIsar6, safe, fake::SYSREGS);
33338#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33339read_sysreg!(id_mmfr0: (p15, 0, c1, c0, 4), u32: IdMmfr0, safe, fake::SYSREGS);
33340#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33341read_sysreg!(id_mmfr1: (p15, 0, c1, c0, 5), u32: IdMmfr1, safe, fake::SYSREGS);
33342#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33343read_sysreg!(id_mmfr2: (p15, 0, c1, c0, 6), u32: IdMmfr2, safe, fake::SYSREGS);
33344#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33345read_sysreg!(id_mmfr3: (p15, 0, c1, c0, 7), u32: IdMmfr3, safe, fake::SYSREGS);
33346#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33347read_sysreg!(id_mmfr4: (p15, 0, c2, c0, 6), u32: IdMmfr4, safe, fake::SYSREGS);
33348#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33349read_sysreg!(id_mmfr5: (p15, 0, c3, c0, 6), u32: IdMmfr5, safe, fake::SYSREGS);
33350#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33351read_sysreg!(id_pfr0: (p15, 0, c1, c0, 0), u32: IdPfr0, safe, fake::SYSREGS);
33352#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33353read_sysreg!(id_pfr1: (p15, 0, c1, c0, 1), u32: IdPfr1, safe, fake::SYSREGS);
33354#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33355read_sysreg!(id_pfr2: (p15, 0, c3, c0, 4), u32: IdPfr2, safe, fake::SYSREGS);
33356#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33357read_write_sysreg!(ifar: (p15, 0, c0, c6, 2), u32: Ifar, safe_read, fake::SYSREGS);
33358#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33359read_write_sysreg!(ifsr: (p15, 0, c0, c5, 1), u32: Ifsr, safe_read, fake::SYSREGS);
33360#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33361read_sysreg!(isr: (p15, 0, c1, c12, 0), u32: Isr, safe, fake::SYSREGS);
33362#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33363read_sysreg!(isr_el1, u64: IsrEl1, safe, fake::SYSREGS);
33364#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33365read_sysreg!(jidr: (p14, 7, c0, c0, 0), u32, safe, fake::SYSREGS);
33366#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33367read_write_sysreg!(jmcr: (p14, 7, c0, c2, 0), u32, safe_read, fake::SYSREGS);
33368#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33369read_write_sysreg!(joscr: (p14, 7, c0, c1, 0), u32, safe_read, fake::SYSREGS);
33370#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33371read_write_sysreg!(mair0: (p15, 0, c2, c10, 0), u32: Mair0, safe_read, fake::SYSREGS);
33372#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33373read_write_sysreg!(mair1: (p15, 0, c2, c10, 1), u32: Mair1, safe_read, fake::SYSREGS);
33374#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33375read_write_sysreg!(mair_el1, u64: MairEl1, safe_read, fake::SYSREGS);
33376#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33377read_write_sysreg!(mair_el2, u64: MairEl2, safe_read, fake::SYSREGS);
33378#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33379read_write_sysreg! {
33380    /// # Safety
33381    ///
33382    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 memory attribute indirection register.
33383    mair_el3, u64: MairEl3, safe_read, fake::SYSREGS
33384}
33385#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33386read_write_sysreg!(mdccint_el1, u64: MdccintEl1, safe_read, safe_write, fake::SYSREGS);
33387#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33388read_write_sysreg!(mdcr_el2, u64: MdcrEl2, safe_read, safe_write, fake::SYSREGS);
33389#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33390read_write_sysreg!(mdcr_el3, u64: MdcrEl3, safe_read, safe_write, fake::SYSREGS);
33391#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33392read_write_sysreg!(mdscr_el1, u64: MdscrEl1, safe_read, safe_write, fake::SYSREGS);
33393#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33394read_sysreg!(midr: (p15, 0, c0, c0, 0), u32: Midr, safe, fake::SYSREGS);
33395#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33396read_sysreg!(midr_el1, u64: MidrEl1, safe, fake::SYSREGS);
33397#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33398read_write_sysreg!(mpam2_el2: s3_4_c10_c5_0, u64: Mpam2El2, safe_read, fake::SYSREGS);
33399#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33400read_write_sysreg!(mpam3_el3: s3_6_c10_c5_0, u64: Mpam3El3, safe_read, fake::SYSREGS);
33401#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33402read_write_sysreg!(mpamhcr_el2: s3_4_c10_c4_0, u64: MpamhcrEl2, safe_read, fake::SYSREGS);
33403#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33404read_sysreg!(mpamidr_el1: s3_0_c10_c4_4, u64: MpamidrEl1, safe, fake::SYSREGS);
33405#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33406read_write_sysreg!(mpamvpm0_el2: s3_4_c10_c6_0, u64: Mpamvpm0El2, safe_read, fake::SYSREGS);
33407#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33408read_write_sysreg!(mpamvpm1_el2: s3_4_c10_c6_1, u64: Mpamvpm1El2, safe_read, fake::SYSREGS);
33409#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33410read_write_sysreg!(mpamvpm2_el2: s3_4_c10_c6_2, u64: Mpamvpm2El2, safe_read, fake::SYSREGS);
33411#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33412read_write_sysreg!(mpamvpm3_el2: s3_4_c10_c6_3, u64: Mpamvpm3El2, safe_read, fake::SYSREGS);
33413#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33414read_write_sysreg!(mpamvpm4_el2: s3_4_c10_c6_4, u64: Mpamvpm4El2, safe_read, fake::SYSREGS);
33415#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33416read_write_sysreg!(mpamvpm5_el2: s3_4_c10_c6_5, u64: Mpamvpm5El2, safe_read, fake::SYSREGS);
33417#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33418read_write_sysreg!(mpamvpm6_el2: s3_4_c10_c6_6, u64: Mpamvpm6El2, safe_read, fake::SYSREGS);
33419#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33420read_write_sysreg!(mpamvpm7_el2: s3_4_c10_c6_7, u64: Mpamvpm7El2, safe_read, fake::SYSREGS);
33421#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33422read_write_sysreg!(mpamvpmv_el2: s3_4_c10_c4_1, u64: MpamvpmvEl2, safe_read, fake::SYSREGS);
33423#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33424read_sysreg!(mpidr: (p15, 0, c0, c0, 5), u32: Mpidr, safe, fake::SYSREGS);
33425#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33426read_sysreg!(mpidr_el1, u64: MpidrEl1, safe, fake::SYSREGS);
33427#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33428read_write_sysreg!(mvbar: (p15, 0, c0, c12, 1), u32: Mvbar, safe_read, fake::SYSREGS);
33429#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33430read_write_sysreg!(nmrr: (p15, 0, c2, c10, 1), u32: Nmrr, safe_read, fake::SYSREGS);
33431#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33432read_write_sysreg!(nsacr: (p15, 0, c1, c1, 2), u32: Nsacr, safe_read, fake::SYSREGS);
33433#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33434read_write_sysreg!(par: (p15, 0, c7), u64: Par, safe_read, fake::SYSREGS);
33435#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33436read_write_sysreg!(par_el1, u64: ParEl1, safe_read, fake::SYSREGS);
33437#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33438read_write_sysreg!(pmccfiltr: (p15, 0, c15, c14, 7), u32: Pmccfiltr, safe_read, fake::SYSREGS);
33439#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33440read_write_sysreg!(pmccntr: (p15, 0, c9), u64: Pmccntr, safe_read, fake::SYSREGS);
33441#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33442read_sysreg!(pmceid0: (p15, 0, c12, c9, 6), u32: Pmceid0, safe, fake::SYSREGS);
33443#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33444read_sysreg!(pmceid1: (p15, 0, c12, c9, 7), u32: Pmceid1, safe, fake::SYSREGS);
33445#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33446read_sysreg!(pmceid2: (p15, 0, c14, c9, 4), u32: Pmceid2, safe, fake::SYSREGS);
33447#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33448read_sysreg!(pmceid3: (p15, 0, c14, c9, 5), u32: Pmceid3, safe, fake::SYSREGS);
33449#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33450read_write_sysreg!(pmcntenclr: (p15, 0, c12, c9, 2), u32: Pmcntenclr, safe_read, fake::SYSREGS);
33451#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33452read_write_sysreg!(pmcntenset: (p15, 0, c12, c9, 1), u32: Pmcntenset, safe_read, fake::SYSREGS);
33453#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33454read_write_sysreg!(pmcr: (p15, 0, c12, c9, 0), u32: Pmcr, safe_read, fake::SYSREGS);
33455#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
33456read_write_sysreg!(pmcr_el0: s3_3_c9_c12_0, u64: PmcrEl0, safe_read, safe_write, fake::SYSREGS);
33457#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33458read_write_sysreg!(pmintenclr: (p15, 0, c14, c9, 2), u32: Pmintenclr, safe_read, fake::SYSREGS);
33459#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33460read_write_sysreg!(pmintenset: (p15, 0, c14, c9, 1), u32: Pmintenset, safe_read, fake::SYSREGS);
33461#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33462read_sysreg!(pmmir: (p15, 0, c14, c9, 6), u32: Pmmir, safe, fake::SYSREGS);
33463#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33464read_write_sysreg!(pmovsr: (p15, 0, c12, c9, 3), u32: Pmovsr, safe_read, fake::SYSREGS);
33465#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33466read_write_sysreg!(pmovsset: (p15, 0, c14, c9, 3), u32: Pmovsset, safe_read, fake::SYSREGS);
33467#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33468read_write_sysreg!(pmselr: (p15, 0, c12, c9, 5), u32: Pmselr, safe_read, fake::SYSREGS);
33469#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33470write_sysreg!(pmswinc: (p15, 0, c12, c9, 4), u32: Pmswinc, fake::SYSREGS);
33471#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33472read_write_sysreg!(pmuserenr: (p15, 0, c14, c9, 0), u32: Pmuserenr, safe_read, fake::SYSREGS);
33473#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33474read_write_sysreg!(pmxevtyper: (p15, 0, c13, c9, 1), u32: Pmxevtyper, safe_read, fake::SYSREGS);
33475#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33476read_write_sysreg!(prrr: (p15, 0, c2, c10, 0), u32: Prrr, safe_read, fake::SYSREGS);
33477#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33478read_sysreg!(revidr: (p15, 0, c0, c0, 6), u32, safe, fake::SYSREGS);
33479#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33480read_write_sysreg!(rgsr_el1: s3_0_c1_c0_5, u64: RgsrEl1, safe_read, safe_write, fake::SYSREGS);
33481#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33482read_write_sysreg!(rmr: (p15, 0, c0, c12, 2), u32: Rmr, safe_read, fake::SYSREGS);
33483#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33484read_sysreg!(rvbar: (p15, 0, c0, c12, 1), u32: Rvbar, safe, fake::SYSREGS);
33485#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33486read_write_sysreg!(scr: (p15, 0, c1, c1, 0), u32: Scr, safe_read, fake::SYSREGS);
33487#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33488read_write_sysreg!(scr_el3, u64: ScrEl3, safe_read, fake::SYSREGS);
33489#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33490read_write_sysreg!(sctlr: (p15, 0, c0, c1, 0), u32: Sctlr, safe_read, fake::SYSREGS);
33491#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33492read_write_sysreg!(sctlr2_el3: s3_6_c1_c0_3, u64: Sctlr2El3, safe_read, fake::SYSREGS);
33493#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33494read_write_sysreg!(sctlr_el1, u64: SctlrEl1, safe_read, fake::SYSREGS);
33495#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33496read_write_sysreg!(sctlr_el2, u64: SctlrEl2, safe_read, fake::SYSREGS);
33497#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33498read_write_sysreg! {
33499    /// # Safety
33500    ///
33501    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 system control register.
33502    sctlr_el3, u64: SctlrEl3, safe_read, fake::SYSREGS
33503}
33504#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33505read_write_sysreg!(sdcr: (p15, 0, c3, c1, 1), u32: Sdcr, safe_read, fake::SYSREGS);
33506#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33507read_write_sysreg!(sder: (p15, 0, c1, c1, 1), u32: Sder, safe_read, fake::SYSREGS);
33508#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33509read_write_sysreg!(smcr_el3: s3_6_c1_c2_6, u64: SmcrEl3, safe_read, fake::SYSREGS);
33510#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33511read_write_sysreg!(spsr_el1, u64: SpsrEl1, safe_read, fake::SYSREGS);
33512#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33513read_write_sysreg!(spsr_el2, u64: SpsrEl2, safe_read, fake::SYSREGS);
33514#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33515read_write_sysreg!(spsr_el3, u64: SpsrEl3, safe_read, fake::SYSREGS);
33516#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33517read_write_sysreg!(sp_el1, u64: SpEl1, safe_read, fake::SYSREGS);
33518#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33519read_write_sysreg!(sp_el2, u64: SpEl2, safe_read, fake::SYSREGS);
33520#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
33521read_write_sysreg!(svcr: s3_3_c4_c2_2, u64: Svcr, safe_read, fake::SYSREGS);
33522#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33523read_sysreg!(tcmtr: (p15, 0, c0, c0, 2), u32, safe, fake::SYSREGS);
33524#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33525read_write_sysreg!(tcr2_el1: s3_0_c2_c0_3, u64: Tcr2El1, safe_read, fake::SYSREGS);
33526#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33527read_write_sysreg!(tcr2_el2: s3_4_c2_c0_3, u64: Tcr2El2, safe_read, fake::SYSREGS);
33528#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33529read_write_sysreg!(tcr_el1, u64: TcrEl1, safe_read, fake::SYSREGS);
33530#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33531read_write_sysreg!(tcr_el2, u64: TcrEl2, safe_read, fake::SYSREGS);
33532#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33533read_write_sysreg! {
33534    /// # Safety
33535    ///
33536    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 translation control register.
33537    tcr_el3, u64: TcrEl3, safe_read, fake::SYSREGS
33538}
33539#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33540read_write_sysreg!(tfsre0_el1: s3_0_c5_c6_1, u64: Tfsre0El1, safe_read, safe_write, fake::SYSREGS);
33541#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33542read_write_sysreg!(tfsr_el1: s3_0_c5_c6_0, u64: TfsrEl1, safe_read, safe_write, fake::SYSREGS);
33543#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33544read_write_sysreg!(tfsr_el2: s3_4_c5_c6_0, u64: TfsrEl2, safe_read, safe_write, fake::SYSREGS);
33545#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33546read_sysreg!(tlbtr: (p15, 0, c0, c0, 3), u32: Tlbtr, safe, fake::SYSREGS);
33547#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33548read_write_sysreg!(tpidrprw: (p15, 0, c0, c13, 4), u32: Tpidrprw, safe_read, fake::SYSREGS);
33549#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
33550read_write_sysreg!(tpidrro_el0, u64: TpidrroEl0, safe_read, fake::SYSREGS);
33551#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33552read_write_sysreg!(tpidruro: (p15, 0, c0, c13, 3), u32: Tpidruro, safe_read, fake::SYSREGS);
33553#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33554read_write_sysreg!(tpidrurw: (p15, 0, c0, c13, 2), u32: Tpidrurw, safe_read, fake::SYSREGS);
33555#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
33556read_write_sysreg!(tpidr_el0, u64: TpidrEl0, safe_read, fake::SYSREGS);
33557#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33558read_write_sysreg!(tpidr_el1, u64: TpidrEl1, safe_read, fake::SYSREGS);
33559#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33560read_write_sysreg!(tpidr_el2, u64: TpidrEl2, safe_read, fake::SYSREGS);
33561#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33562read_write_sysreg!(tpidr_el3, u64: TpidrEl3, safe_read, fake::SYSREGS);
33563#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33564read_write_sysreg!(trfcr: (p15, 0, c2, c1, 1), u32: Trfcr, safe_read, fake::SYSREGS);
33565#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33566read_write_sysreg!(ttbcr: (p15, 0, c0, c2, 2), u32: Ttbcr, safe_read, fake::SYSREGS);
33567#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33568read_write_sysreg!(ttbcr2: (p15, 0, c0, c2, 3), u32: Ttbcr2, safe_read, fake::SYSREGS);
33569#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33570read_write_sysreg!(ttbr0: (p15, 0, c2), u64: Ttbr0, safe_read, fake::SYSREGS);
33571#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33572read_write_sysreg! {
33573    /// # Safety
33574    ///
33575    /// The base address must point to a valid and properly aligned translation table.
33576    ttbr0_el1, u64: Ttbr0El1, safe_read, fake::SYSREGS
33577}
33578#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33579read_write_sysreg! {
33580    /// # Safety
33581    ///
33582    /// The base address must point to a valid and properly aligned translation table.
33583    ttbr0_el2, u64: Ttbr0El2, safe_read, fake::SYSREGS
33584}
33585#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33586read_write_sysreg! {
33587    /// # Safety
33588    ///
33589    /// The base address must point to a valid and properly aligned translation table.
33590    ttbr0_el3, u64: Ttbr0El3, safe_read, fake::SYSREGS
33591}
33592#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33593read_write_sysreg!(ttbr1: (p15, 1, c2), u64: Ttbr1, safe_read, fake::SYSREGS);
33594#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33595read_write_sysreg! {
33596    /// # Safety
33597    ///
33598    /// The base address must point to a valid and properly aligned translation table.
33599    ttbr1_el1, u64: Ttbr1El1, safe_read, fake::SYSREGS
33600}
33601#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33602read_write_sysreg! {
33603    /// # Safety
33604    ///
33605    /// The base address must point to a valid and properly aligned translation table.
33606    ttbr1_el2: s3_4_c2_c0_1, u64: Ttbr1El2, safe_read, fake::SYSREGS
33607}
33608#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33609read_write_sysreg!(vbar: (p15, 0, c0, c12, 0), u32: Vbar, safe_read, fake::SYSREGS);
33610#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
33611read_write_sysreg! {
33612    /// # Safety
33613    ///
33614    /// The base address must point to a valid exception vector.
33615    vbar_el1, u64: VbarEl1, safe_read, fake::SYSREGS
33616}
33617#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33618read_write_sysreg! {
33619    /// # Safety
33620    ///
33621    /// The base address must point to a valid exception vector.
33622    vbar_el2, u64: VbarEl2, safe_read, fake::SYSREGS
33623}
33624#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33625read_write_sysreg!(vdfsr: (p15, 4, c2, c5, 3), u32: Vdfsr, safe_read, fake::SYSREGS);
33626#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33627read_write_sysreg!(vdisr: (p15, 0, c1, c12, 1), u32: Vdisr, safe_read, fake::SYSREGS);
33628#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33629read_write_sysreg!(vdisr_el2: s3_4_c12_c1_1, u64: VdisrEl2, safe_read, safe_write, fake::SYSREGS);
33630#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33631read_write_sysreg!(vmpidr: (p15, 0, c0, c0, 5), u32: Vmpidr, safe_read, fake::SYSREGS);
33632#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33633read_write_sysreg!(vmpidr_el2, u64: VmpidrEl2, safe_read, safe_write, fake::SYSREGS);
33634#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33635read_write_sysreg!(vpidr: (p15, 0, c0, c0, 0), u32: Vpidr, safe_read, fake::SYSREGS);
33636#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33637read_write_sysreg!(vpidr_el2, u64: VpidrEl2, safe_read, safe_write, fake::SYSREGS);
33638#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33639read_write_sysreg!(vsesr_el2: s3_4_c5_c2_3, u64: VsesrEl2, safe_read, safe_write, fake::SYSREGS);
33640#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33641read_write_sysreg!(vtcr: (p15, 4, c1, c2, 2), u32: Vtcr, safe_read, fake::SYSREGS);
33642#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33643read_write_sysreg!(vtcr_el2, u64: VtcrEl2, safe_read, fake::SYSREGS);
33644#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
33645read_write_sysreg!(vttbr: (p15, 6, c2), u64: Vttbr, safe_read, fake::SYSREGS);
33646#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
33647read_write_sysreg! {
33648    /// # Safety
33649    ///
33650    /// The base address must point to a valid and properly aligned stage 2 translation table.
33651    vttbr_el2, u64: VttbrEl2, safe_read, fake::SYSREGS
33652}
33653#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
33654read_write_sysreg!(zcr_el3: s3_6_c1_c2_0, u64: ZcrEl3, safe_read, fake::SYSREGS);