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    /// `AMCGCR` system register value.
114    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
115    #[repr(transparent)]
116    pub struct Amcgcr: u32 {
117    }
118}
119
120impl Amcgcr {
121    /// Offset of the `CG0NC` field.
122    pub const CG0NC_SHIFT: u32 = 0;
123    /// Mask for the `CG0NC` field.
124    pub const CG0NC_MASK: u32 = 0b11111111;
125    /// Offset of the `CG1NC` field.
126    pub const CG1NC_SHIFT: u32 = 8;
127    /// Mask for the `CG1NC` field.
128    pub const CG1NC_MASK: u32 = 0b11111111;
129
130    /// Returns the value of the `CG0NC` field.
131    pub const fn cg0nc(self) -> u8 {
132        ((self.bits() >> Self::CG0NC_SHIFT) & 0b11111111) as u8
133    }
134
135    /// Sets the value of the `CG0NC` field.
136    pub const fn set_cg0nc(&mut self, value: u8) {
137        let offset = Self::CG0NC_SHIFT;
138        assert!(value & (Self::CG0NC_MASK as u8) == value);
139        *self = Self::from_bits_retain(
140            (self.bits() & !(Self::CG0NC_MASK << offset)) | ((value as u32) << offset),
141        );
142    }
143
144    /// Returns a copy with the `CG0NC` field set to the given value.
145    pub const fn with_cg0nc(mut self, value: u8) -> Self {
146        self.set_cg0nc(value);
147        self
148    }
149
150    /// Returns the value of the `CG1NC` field.
151    pub const fn cg1nc(self) -> u8 {
152        ((self.bits() >> Self::CG1NC_SHIFT) & 0b11111111) as u8
153    }
154
155    /// Sets the value of the `CG1NC` field.
156    pub const fn set_cg1nc(&mut self, value: u8) {
157        let offset = Self::CG1NC_SHIFT;
158        assert!(value & (Self::CG1NC_MASK as u8) == value);
159        *self = Self::from_bits_retain(
160            (self.bits() & !(Self::CG1NC_MASK << offset)) | ((value as u32) << offset),
161        );
162    }
163
164    /// Returns a copy with the `CG1NC` field set to the given value.
165    pub const fn with_cg1nc(mut self, value: u8) -> Self {
166        self.set_cg1nc(value);
167        self
168    }
169}
170
171bitflags! {
172    /// `AMCNTENCLR0` system register value.
173    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
174    #[repr(transparent)]
175    pub struct Amcntenclr0: u32 {
176        /// `P<n>` bit 0.
177        const P0 = 1 << 0;
178        /// `P<n>` bit 1.
179        const P1 = 1 << 1;
180        /// `P<n>` bit 2.
181        const P2 = 1 << 2;
182        /// `P<n>` bit 3.
183        const P3 = 1 << 3;
184    }
185}
186
187impl Amcntenclr0 {
188    /// Offset of the `P<n>` field.
189    pub const P_SHIFT: u32 = 0;
190}
191
192bitflags! {
193    /// `AMCNTENCLR1` system register value.
194    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
195    #[repr(transparent)]
196    pub struct Amcntenclr1: u32 {
197        /// `P<n>` bit 0.
198        const P0 = 1 << 0;
199        /// `P<n>` bit 1.
200        const P1 = 1 << 1;
201        /// `P<n>` bit 2.
202        const P2 = 1 << 2;
203        /// `P<n>` bit 3.
204        const P3 = 1 << 3;
205        /// `P<n>` bit 4.
206        const P4 = 1 << 4;
207        /// `P<n>` bit 5.
208        const P5 = 1 << 5;
209        /// `P<n>` bit 6.
210        const P6 = 1 << 6;
211        /// `P<n>` bit 7.
212        const P7 = 1 << 7;
213        /// `P<n>` bit 8.
214        const P8 = 1 << 8;
215        /// `P<n>` bit 9.
216        const P9 = 1 << 9;
217        /// `P<n>` bit 10.
218        const P10 = 1 << 10;
219        /// `P<n>` bit 11.
220        const P11 = 1 << 11;
221        /// `P<n>` bit 12.
222        const P12 = 1 << 12;
223        /// `P<n>` bit 13.
224        const P13 = 1 << 13;
225        /// `P<n>` bit 14.
226        const P14 = 1 << 14;
227        /// `P<n>` bit 15.
228        const P15 = 1 << 15;
229    }
230}
231
232impl Amcntenclr1 {
233    /// Offset of the `P<n>` field.
234    pub const P_SHIFT: u32 = 0;
235}
236
237bitflags! {
238    /// `AMCNTENSET0` system register value.
239    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
240    #[repr(transparent)]
241    pub struct Amcntenset0: u32 {
242        /// `P<n>` bit 0.
243        const P0 = 1 << 0;
244        /// `P<n>` bit 1.
245        const P1 = 1 << 1;
246        /// `P<n>` bit 2.
247        const P2 = 1 << 2;
248        /// `P<n>` bit 3.
249        const P3 = 1 << 3;
250    }
251}
252
253impl Amcntenset0 {
254    /// Offset of the `P<n>` field.
255    pub const P_SHIFT: u32 = 0;
256}
257
258bitflags! {
259    /// `AMCNTENSET1` system register value.
260    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
261    #[repr(transparent)]
262    pub struct Amcntenset1: u32 {
263        /// `P<n>` bit 0.
264        const P0 = 1 << 0;
265        /// `P<n>` bit 1.
266        const P1 = 1 << 1;
267        /// `P<n>` bit 2.
268        const P2 = 1 << 2;
269        /// `P<n>` bit 3.
270        const P3 = 1 << 3;
271        /// `P<n>` bit 4.
272        const P4 = 1 << 4;
273        /// `P<n>` bit 5.
274        const P5 = 1 << 5;
275        /// `P<n>` bit 6.
276        const P6 = 1 << 6;
277        /// `P<n>` bit 7.
278        const P7 = 1 << 7;
279        /// `P<n>` bit 8.
280        const P8 = 1 << 8;
281        /// `P<n>` bit 9.
282        const P9 = 1 << 9;
283        /// `P<n>` bit 10.
284        const P10 = 1 << 10;
285        /// `P<n>` bit 11.
286        const P11 = 1 << 11;
287        /// `P<n>` bit 12.
288        const P12 = 1 << 12;
289        /// `P<n>` bit 13.
290        const P13 = 1 << 13;
291        /// `P<n>` bit 14.
292        const P14 = 1 << 14;
293        /// `P<n>` bit 15.
294        const P15 = 1 << 15;
295    }
296}
297
298impl Amcntenset1 {
299    /// Offset of the `P<n>` field.
300    pub const P_SHIFT: u32 = 0;
301}
302
303bitflags! {
304    /// `AMCR` system register value.
305    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
306    #[repr(transparent)]
307    pub struct Amcr: u32 {
308        /// `HDBG` bit.
309        const HDBG = 1 << 10;
310        /// `CG1RZ` bit.
311        const CG1RZ = 1 << 17;
312    }
313}
314
315impl Amcr {
316    /// Offset of the `HDBG` field.
317    pub const HDBG_SHIFT: u32 = 10;
318    /// Offset of the `CG1RZ` field.
319    pub const CG1RZ_SHIFT: u32 = 17;
320}
321
322bitflags! {
323    /// `AMUSERENR` system register value.
324    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
325    #[repr(transparent)]
326    pub struct Amuserenr: u32 {
327        /// `EN` bit.
328        const EN = 1 << 0;
329    }
330}
331
332impl Amuserenr {
333    /// Offset of the `EN` field.
334    pub const EN_SHIFT: u32 = 0;
335}
336
337#[cfg(feature = "el1")]
338bitflags! {
339    /// `APIAKeyHi_EL1` system register value.
340    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
341    #[repr(transparent)]
342    pub struct ApiakeyhiEl1: u64 {
343    }
344}
345
346#[cfg(feature = "el1")]
347impl ApiakeyhiEl1 {
348    /// Offset of the `APIAKeyHi` field.
349    pub const APIAKEYHI_SHIFT: u32 = 0;
350    /// Mask for the `APIAKeyHi` field.
351    pub const APIAKEYHI_MASK: u64 =
352        0b1111111111111111111111111111111111111111111111111111111111111111;
353
354    /// Returns the value of the `APIAKeyHi` field.
355    pub const fn apiakeyhi(self) -> u64 {
356        ((self.bits() >> Self::APIAKEYHI_SHIFT)
357            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
358    }
359
360    /// Sets the value of the `APIAKeyHi` field.
361    pub const fn set_apiakeyhi(&mut self, value: u64) {
362        let offset = Self::APIAKEYHI_SHIFT;
363        assert!(value & (Self::APIAKEYHI_MASK as u64) == value);
364        *self = Self::from_bits_retain(
365            (self.bits() & !(Self::APIAKEYHI_MASK << offset)) | ((value as u64) << offset),
366        );
367    }
368
369    /// Returns a copy with the `APIAKeyHi` field set to the given value.
370    pub const fn with_apiakeyhi(mut self, value: u64) -> Self {
371        self.set_apiakeyhi(value);
372        self
373    }
374}
375
376#[cfg(feature = "el1")]
377bitflags! {
378    /// `APIAKeyLo_EL1` system register value.
379    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
380    #[repr(transparent)]
381    pub struct ApiakeyloEl1: u64 {
382    }
383}
384
385#[cfg(feature = "el1")]
386impl ApiakeyloEl1 {
387    /// Offset of the `APIAKeyLo` field.
388    pub const APIAKEYLO_SHIFT: u32 = 0;
389    /// Mask for the `APIAKeyLo` field.
390    pub const APIAKEYLO_MASK: u64 =
391        0b1111111111111111111111111111111111111111111111111111111111111111;
392
393    /// Returns the value of the `APIAKeyLo` field.
394    pub const fn apiakeylo(self) -> u64 {
395        ((self.bits() >> Self::APIAKEYLO_SHIFT)
396            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
397    }
398
399    /// Sets the value of the `APIAKeyLo` field.
400    pub const fn set_apiakeylo(&mut self, value: u64) {
401        let offset = Self::APIAKEYLO_SHIFT;
402        assert!(value & (Self::APIAKEYLO_MASK as u64) == value);
403        *self = Self::from_bits_retain(
404            (self.bits() & !(Self::APIAKEYLO_MASK << offset)) | ((value as u64) << offset),
405        );
406    }
407
408    /// Returns a copy with the `APIAKeyLo` field set to the given value.
409    pub const fn with_apiakeylo(mut self, value: u64) -> Self {
410        self.set_apiakeylo(value);
411        self
412    }
413}
414
415bitflags! {
416    /// `CCSIDR` system register value.
417    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
418    #[repr(transparent)]
419    pub struct Ccsidr: u32 {
420    }
421}
422
423impl Ccsidr {
424    /// Offset of the `LineSize` field.
425    pub const LINESIZE_SHIFT: u32 = 0;
426    /// Mask for the `LineSize` field.
427    pub const LINESIZE_MASK: u32 = 0b111;
428    /// Offset of the `NumSets` field.
429    pub const NUMSETS_SHIFT: u32 = 13;
430    /// Mask for the `NumSets` field.
431    pub const NUMSETS_MASK: u32 = 0b111111111111111;
432
433    /// Returns the value of the `LineSize` field.
434    pub const fn linesize(self) -> u8 {
435        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
436    }
437
438    /// Sets the value of the `LineSize` field.
439    pub const fn set_linesize(&mut self, value: u8) {
440        let offset = Self::LINESIZE_SHIFT;
441        assert!(value & (Self::LINESIZE_MASK as u8) == value);
442        *self = Self::from_bits_retain(
443            (self.bits() & !(Self::LINESIZE_MASK << offset)) | ((value as u32) << offset),
444        );
445    }
446
447    /// Returns a copy with the `LineSize` field set to the given value.
448    pub const fn with_linesize(mut self, value: u8) -> Self {
449        self.set_linesize(value);
450        self
451    }
452
453    /// Returns the value of the `NumSets` field.
454    pub const fn numsets(self) -> u16 {
455        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111) as u16
456    }
457
458    /// Sets the value of the `NumSets` field.
459    pub const fn set_numsets(&mut self, value: u16) {
460        let offset = Self::NUMSETS_SHIFT;
461        assert!(value & (Self::NUMSETS_MASK as u16) == value);
462        *self = Self::from_bits_retain(
463            (self.bits() & !(Self::NUMSETS_MASK << offset)) | ((value as u32) << offset),
464        );
465    }
466
467    /// Returns a copy with the `NumSets` field set to the given value.
468    pub const fn with_numsets(mut self, value: u16) -> Self {
469        self.set_numsets(value);
470        self
471    }
472}
473
474bitflags! {
475    /// `CCSIDR2` system register value.
476    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
477    #[repr(transparent)]
478    pub struct Ccsidr2: u32 {
479    }
480}
481
482impl Ccsidr2 {
483    /// Offset of the `NumSets` field.
484    pub const NUMSETS_SHIFT: u32 = 0;
485    /// Mask for the `NumSets` field.
486    pub const NUMSETS_MASK: u32 = 0b111111111111111111111111;
487
488    /// Returns the value of the `NumSets` field.
489    pub const fn numsets(self) -> u32 {
490        ((self.bits() >> Self::NUMSETS_SHIFT) & 0b111111111111111111111111) as u32
491    }
492
493    /// Sets the value of the `NumSets` field.
494    pub const fn set_numsets(&mut self, value: u32) {
495        let offset = Self::NUMSETS_SHIFT;
496        assert!(value & (Self::NUMSETS_MASK as u32) == value);
497        *self = Self::from_bits_retain(
498            (self.bits() & !(Self::NUMSETS_MASK << offset)) | ((value as u32) << offset),
499        );
500    }
501
502    /// Returns a copy with the `NumSets` field set to the given value.
503    pub const fn with_numsets(mut self, value: u32) -> Self {
504        self.set_numsets(value);
505        self
506    }
507}
508
509#[cfg(feature = "el1")]
510bitflags! {
511    /// `CCSIDR_EL1` system register value.
512    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
513    #[repr(transparent)]
514    pub struct CcsidrEl1: u64 {
515    }
516}
517
518#[cfg(feature = "el1")]
519impl CcsidrEl1 {
520    /// Offset of the `LineSize` field.
521    pub const LINESIZE_SHIFT: u32 = 0;
522    /// Mask for the `LineSize` field.
523    pub const LINESIZE_MASK: u64 = 0b111;
524
525    /// Returns the value of the `LineSize` field.
526    pub const fn linesize(self) -> u8 {
527        ((self.bits() >> Self::LINESIZE_SHIFT) & 0b111) as u8
528    }
529
530    /// Sets the value of the `LineSize` field.
531    pub const fn set_linesize(&mut self, value: u8) {
532        let offset = Self::LINESIZE_SHIFT;
533        assert!(value & (Self::LINESIZE_MASK as u8) == value);
534        *self = Self::from_bits_retain(
535            (self.bits() & !(Self::LINESIZE_MASK << offset)) | ((value as u64) << offset),
536        );
537    }
538
539    /// Returns a copy with the `LineSize` field set to the given value.
540    pub const fn with_linesize(mut self, value: u8) -> Self {
541        self.set_linesize(value);
542        self
543    }
544}
545
546bitflags! {
547    /// `CLIDR` system register value.
548    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
549    #[repr(transparent)]
550    pub struct Clidr: u32 {
551    }
552}
553
554impl Clidr {
555    /// Offset of the `Ctype<n>` field.
556    pub const CTYPE_SHIFT: u32 = 0;
557    /// Mask for the `Ctype<n>` field.
558    pub const CTYPE_MASK: u32 = 0b111;
559    /// Offset of the `LoUIS` field.
560    pub const LOUIS_SHIFT: u32 = 21;
561    /// Mask for the `LoUIS` field.
562    pub const LOUIS_MASK: u32 = 0b111;
563    /// Offset of the `LoC` field.
564    pub const LOC_SHIFT: u32 = 24;
565    /// Mask for the `LoC` field.
566    pub const LOC_MASK: u32 = 0b111;
567    /// Offset of the `LoUU` field.
568    pub const LOUU_SHIFT: u32 = 27;
569    /// Mask for the `LoUU` field.
570    pub const LOUU_MASK: u32 = 0b111;
571    /// Offset of the `ICB` field.
572    pub const ICB_SHIFT: u32 = 30;
573    /// Mask for the `ICB` field.
574    pub const ICB_MASK: u32 = 0b11;
575
576    /// Returns the value of the given `Ctype<n>` field.
577    pub const fn ctype(self, n: u32) -> u8 {
578        assert!(n >= 1 && n < 8);
579        ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8
580    }
581
582    /// Sets the value of the `Ctype<n>` field.
583    pub const fn set_ctype(&mut self, n: u32, value: u8) {
584        assert!(n >= 1 && n < 8);
585        let offset = Self::CTYPE_SHIFT + (n - 1) * 3;
586        assert!(value & (Self::CTYPE_MASK as u8) == value);
587        *self = Self::from_bits_retain(
588            (self.bits() & !(Self::CTYPE_MASK << offset)) | ((value as u32) << offset),
589        );
590    }
591
592    /// Returns a copy with the `Ctype<n>` field set to the given value.
593    pub const fn with_ctype(mut self, n: u32, value: u8) -> Self {
594        self.set_ctype(n, value);
595        self
596    }
597
598    /// Returns the value of the `LoUIS` field.
599    pub const fn louis(self) -> u8 {
600        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
601    }
602
603    /// Sets the value of the `LoUIS` field.
604    pub const fn set_louis(&mut self, value: u8) {
605        let offset = Self::LOUIS_SHIFT;
606        assert!(value & (Self::LOUIS_MASK as u8) == value);
607        *self = Self::from_bits_retain(
608            (self.bits() & !(Self::LOUIS_MASK << offset)) | ((value as u32) << offset),
609        );
610    }
611
612    /// Returns a copy with the `LoUIS` field set to the given value.
613    pub const fn with_louis(mut self, value: u8) -> Self {
614        self.set_louis(value);
615        self
616    }
617
618    /// Returns the value of the `LoC` field.
619    pub const fn loc(self) -> u8 {
620        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
621    }
622
623    /// Sets the value of the `LoC` field.
624    pub const fn set_loc(&mut self, value: u8) {
625        let offset = Self::LOC_SHIFT;
626        assert!(value & (Self::LOC_MASK as u8) == value);
627        *self = Self::from_bits_retain(
628            (self.bits() & !(Self::LOC_MASK << offset)) | ((value as u32) << offset),
629        );
630    }
631
632    /// Returns a copy with the `LoC` field set to the given value.
633    pub const fn with_loc(mut self, value: u8) -> Self {
634        self.set_loc(value);
635        self
636    }
637
638    /// Returns the value of the `LoUU` field.
639    pub const fn louu(self) -> u8 {
640        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
641    }
642
643    /// Sets the value of the `LoUU` field.
644    pub const fn set_louu(&mut self, value: u8) {
645        let offset = Self::LOUU_SHIFT;
646        assert!(value & (Self::LOUU_MASK as u8) == value);
647        *self = Self::from_bits_retain(
648            (self.bits() & !(Self::LOUU_MASK << offset)) | ((value as u32) << offset),
649        );
650    }
651
652    /// Returns a copy with the `LoUU` field set to the given value.
653    pub const fn with_louu(mut self, value: u8) -> Self {
654        self.set_louu(value);
655        self
656    }
657
658    /// Returns the value of the `ICB` field.
659    pub const fn icb(self) -> u8 {
660        ((self.bits() >> Self::ICB_SHIFT) & 0b11) as u8
661    }
662
663    /// Sets the value of the `ICB` field.
664    pub const fn set_icb(&mut self, value: u8) {
665        let offset = Self::ICB_SHIFT;
666        assert!(value & (Self::ICB_MASK as u8) == value);
667        *self = Self::from_bits_retain(
668            (self.bits() & !(Self::ICB_MASK << offset)) | ((value as u32) << offset),
669        );
670    }
671
672    /// Returns a copy with the `ICB` field set to the given value.
673    pub const fn with_icb(mut self, value: u8) -> Self {
674        self.set_icb(value);
675        self
676    }
677}
678
679#[cfg(feature = "el1")]
680bitflags! {
681    /// `CLIDR_EL1` system register value.
682    ///
683    /// Cache Level ID.
684    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
685    #[repr(transparent)]
686    pub struct ClidrEl1: u64 {
687    }
688}
689
690#[cfg(feature = "el1")]
691impl ClidrEl1 {
692    /// Offset of the `Ctype<n>` field.
693    pub const CTYPE_SHIFT: u32 = 0;
694    /// Mask for the `Ctype<n>` field.
695    pub const CTYPE_MASK: u64 = 0b111;
696    /// Offset of the `LoUIS` field.
697    pub const LOUIS_SHIFT: u32 = 21;
698    /// Mask for the `LoUIS` field.
699    pub const LOUIS_MASK: u64 = 0b111;
700    /// Offset of the `LoC` field.
701    pub const LOC_SHIFT: u32 = 24;
702    /// Mask for the `LoC` field.
703    pub const LOC_MASK: u64 = 0b111;
704    /// Offset of the `LoUU` field.
705    pub const LOUU_SHIFT: u32 = 27;
706    /// Mask for the `LoUU` field.
707    pub const LOUU_MASK: u64 = 0b111;
708    /// Offset of the `ICB` field.
709    pub const ICB_SHIFT: u32 = 30;
710    /// Mask for the `ICB` field.
711    pub const ICB_MASK: u64 = 0b111;
712    /// Offset of the `Ttype<n>` field.
713    pub const TTYPE_SHIFT: u32 = 33;
714    /// Mask for the `Ttype<n>` field.
715    pub const TTYPE_MASK: u64 = 0b11;
716
717    /// Returns the value of the given `Ctype<n>` field.
718    pub fn ctype(self, n: u32) -> crate::manual::CacheType {
719        assert!(n >= 1 && n < 8);
720        crate::manual::CacheType::try_from(
721            ((self.bits() >> (Self::CTYPE_SHIFT + (n - 1) * 3)) & 0b111) as u8,
722        )
723        .unwrap()
724    }
725
726    /// Sets the value of the `Ctype<n>` field.
727    pub fn set_ctype(&mut self, n: u32, value: crate::manual::CacheType) {
728        assert!(n >= 1 && n < 8);
729        let offset = Self::CTYPE_SHIFT + (n - 1) * 3;
730        let value: u8 = value.into();
731        assert!(value & (Self::CTYPE_MASK as u8) == value);
732        *self = Self::from_bits_retain(
733            (self.bits() & !(Self::CTYPE_MASK << offset)) | ((value as u64) << offset),
734        );
735    }
736
737    /// Returns a copy with the `Ctype<n>` field set to the given value.
738    pub fn with_ctype(mut self, n: u32, value: crate::manual::CacheType) -> Self {
739        self.set_ctype(n, value);
740        self
741    }
742
743    /// Returns the value of the `LoUIS` field.
744    ///
745    /// Level of Unification Inner Shareable for the cache hierarchy.
746    pub const fn louis(self) -> u8 {
747        ((self.bits() >> Self::LOUIS_SHIFT) & 0b111) as u8
748    }
749
750    /// Sets the value of the `LoUIS` field.
751    ///
752    /// Level of Unification Inner Shareable for the cache hierarchy.
753    pub const fn set_louis(&mut self, value: u8) {
754        let offset = Self::LOUIS_SHIFT;
755        assert!(value & (Self::LOUIS_MASK as u8) == value);
756        *self = Self::from_bits_retain(
757            (self.bits() & !(Self::LOUIS_MASK << offset)) | ((value as u64) << offset),
758        );
759    }
760
761    /// Returns a copy with the `LoUIS` field set to the given value.
762    ///
763    /// Level of Unification Inner Shareable for the cache hierarchy.
764    pub const fn with_louis(mut self, value: u8) -> Self {
765        self.set_louis(value);
766        self
767    }
768
769    /// Returns the value of the `LoC` field.
770    ///
771    /// Level of Coherence for the cache hierarchy.
772    pub const fn loc(self) -> u8 {
773        ((self.bits() >> Self::LOC_SHIFT) & 0b111) as u8
774    }
775
776    /// Sets the value of the `LoC` field.
777    ///
778    /// Level of Coherence for the cache hierarchy.
779    pub const fn set_loc(&mut self, value: u8) {
780        let offset = Self::LOC_SHIFT;
781        assert!(value & (Self::LOC_MASK as u8) == value);
782        *self = Self::from_bits_retain(
783            (self.bits() & !(Self::LOC_MASK << offset)) | ((value as u64) << offset),
784        );
785    }
786
787    /// Returns a copy with the `LoC` field set to the given value.
788    ///
789    /// Level of Coherence for the cache hierarchy.
790    pub const fn with_loc(mut self, value: u8) -> Self {
791        self.set_loc(value);
792        self
793    }
794
795    /// Returns the value of the `LoUU` field.
796    ///
797    /// Level of Unification Uniprocessor for the cache hierarchy.
798    pub const fn louu(self) -> u8 {
799        ((self.bits() >> Self::LOUU_SHIFT) & 0b111) as u8
800    }
801
802    /// Sets the value of the `LoUU` field.
803    ///
804    /// Level of Unification Uniprocessor for the cache hierarchy.
805    pub const fn set_louu(&mut self, value: u8) {
806        let offset = Self::LOUU_SHIFT;
807        assert!(value & (Self::LOUU_MASK as u8) == value);
808        *self = Self::from_bits_retain(
809            (self.bits() & !(Self::LOUU_MASK << offset)) | ((value as u64) << offset),
810        );
811    }
812
813    /// Returns a copy with the `LoUU` field set to the given value.
814    ///
815    /// Level of Unification Uniprocessor for the cache hierarchy.
816    pub const fn with_louu(mut self, value: u8) -> Self {
817        self.set_louu(value);
818        self
819    }
820
821    /// Returns the value of the `ICB` field.
822    ///
823    /// Inner cache boundary level.
824    pub const fn icb(self) -> u8 {
825        ((self.bits() >> Self::ICB_SHIFT) & 0b111) as u8
826    }
827
828    /// Sets the value of the `ICB` field.
829    ///
830    /// Inner cache boundary level.
831    pub const fn set_icb(&mut self, value: u8) {
832        let offset = Self::ICB_SHIFT;
833        assert!(value & (Self::ICB_MASK as u8) == value);
834        *self = Self::from_bits_retain(
835            (self.bits() & !(Self::ICB_MASK << offset)) | ((value as u64) << offset),
836        );
837    }
838
839    /// Returns a copy with the `ICB` field set to the given value.
840    ///
841    /// Inner cache boundary level.
842    pub const fn with_icb(mut self, value: u8) -> Self {
843        self.set_icb(value);
844        self
845    }
846
847    /// Returns the value of the given `Ttype<n>` field.
848    pub const fn ttype(self, n: u32) -> u8 {
849        assert!(n >= 1 && n < 8);
850        ((self.bits() >> (Self::TTYPE_SHIFT + (n - 1) * 2)) & 0b11) as u8
851    }
852
853    /// Sets the value of the `Ttype<n>` field.
854    pub const fn set_ttype(&mut self, n: u32, value: u8) {
855        assert!(n >= 1 && n < 8);
856        let offset = Self::TTYPE_SHIFT + (n - 1) * 2;
857        assert!(value & (Self::TTYPE_MASK as u8) == value);
858        *self = Self::from_bits_retain(
859            (self.bits() & !(Self::TTYPE_MASK << offset)) | ((value as u64) << offset),
860        );
861    }
862
863    /// Returns a copy with the `Ttype<n>` field set to the given value.
864    pub const fn with_ttype(mut self, n: u32, value: u8) -> Self {
865        self.set_ttype(n, value);
866        self
867    }
868}
869
870bitflags! {
871    /// `CNTFRQ` system register value.
872    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
873    #[repr(transparent)]
874    pub struct Cntfrq: u32 {
875    }
876}
877
878impl Cntfrq {
879    /// Offset of the `ClockFreq` field.
880    pub const CLOCKFREQ_SHIFT: u32 = 0;
881    /// Mask for the `ClockFreq` field.
882    pub const CLOCKFREQ_MASK: u32 = 0b11111111111111111111111111111111;
883
884    /// Returns the value of the `ClockFreq` field.
885    pub const fn clockfreq(self) -> u32 {
886        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
887    }
888
889    /// Sets the value of the `ClockFreq` field.
890    pub const fn set_clockfreq(&mut self, value: u32) {
891        let offset = Self::CLOCKFREQ_SHIFT;
892        assert!(value & (Self::CLOCKFREQ_MASK as u32) == value);
893        *self = Self::from_bits_retain(
894            (self.bits() & !(Self::CLOCKFREQ_MASK << offset)) | ((value as u32) << offset),
895        );
896    }
897
898    /// Returns a copy with the `ClockFreq` field set to the given value.
899    pub const fn with_clockfreq(mut self, value: u32) -> Self {
900        self.set_clockfreq(value);
901        self
902    }
903}
904
905bitflags! {
906    /// `CNTFRQ_EL0` system register value.
907    ///
908    /// Counter-timer Frequency Register
909    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
910    #[repr(transparent)]
911    pub struct CntfrqEl0: u64 {
912    }
913}
914
915impl CntfrqEl0 {
916    /// Offset of the `ClockFreq` field.
917    pub const CLOCKFREQ_SHIFT: u32 = 0;
918    /// Mask for the `ClockFreq` field.
919    pub const CLOCKFREQ_MASK: u64 = 0b11111111111111111111111111111111;
920
921    /// Returns the value of the `ClockFreq` field.
922    pub const fn clockfreq(self) -> u32 {
923        ((self.bits() >> Self::CLOCKFREQ_SHIFT) & 0b11111111111111111111111111111111) as u32
924    }
925
926    /// Sets the value of the `ClockFreq` field.
927    pub const fn set_clockfreq(&mut self, value: u32) {
928        let offset = Self::CLOCKFREQ_SHIFT;
929        assert!(value & (Self::CLOCKFREQ_MASK as u32) == value);
930        *self = Self::from_bits_retain(
931            (self.bits() & !(Self::CLOCKFREQ_MASK << offset)) | ((value as u64) << offset),
932        );
933    }
934
935    /// Returns a copy with the `ClockFreq` field set to the given value.
936    pub const fn with_clockfreq(mut self, value: u32) -> Self {
937        self.set_clockfreq(value);
938        self
939    }
940}
941
942bitflags! {
943    /// `CNTHCTL` system register value.
944    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
945    #[repr(transparent)]
946    pub struct Cnthctl: u32 {
947        /// `PL1PCTEN` bit.
948        const PL1PCTEN = 1 << 0;
949        /// `PL1PCEN` bit.
950        const PL1PCEN = 1 << 1;
951        /// `EVNTEN` bit.
952        const EVNTEN = 1 << 2;
953        /// `EVNTDIR` bit.
954        const EVNTDIR = 1 << 3;
955        /// `EVNTIS` bit.
956        const EVNTIS = 1 << 17;
957    }
958}
959
960impl Cnthctl {
961    /// Offset of the `PL1PCTEN` field.
962    pub const PL1PCTEN_SHIFT: u32 = 0;
963    /// Offset of the `PL1PCEN` field.
964    pub const PL1PCEN_SHIFT: u32 = 1;
965    /// Offset of the `EVNTEN` field.
966    pub const EVNTEN_SHIFT: u32 = 2;
967    /// Offset of the `EVNTDIR` field.
968    pub const EVNTDIR_SHIFT: u32 = 3;
969    /// Offset of the `EVNTI` field.
970    pub const EVNTI_SHIFT: u32 = 4;
971    /// Mask for the `EVNTI` field.
972    pub const EVNTI_MASK: u32 = 0b1111;
973    /// Offset of the `EVNTIS` field.
974    pub const EVNTIS_SHIFT: u32 = 17;
975
976    /// Returns the value of the `EVNTI` field.
977    pub const fn evnti(self) -> u8 {
978        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
979    }
980
981    /// Sets the value of the `EVNTI` field.
982    pub const fn set_evnti(&mut self, value: u8) {
983        let offset = Self::EVNTI_SHIFT;
984        assert!(value & (Self::EVNTI_MASK as u8) == value);
985        *self = Self::from_bits_retain(
986            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u32) << offset),
987        );
988    }
989
990    /// Returns a copy with the `EVNTI` field set to the given value.
991    pub const fn with_evnti(mut self, value: u8) -> Self {
992        self.set_evnti(value);
993        self
994    }
995}
996
997#[cfg(feature = "el2")]
998bitflags! {
999    /// `CNTHCTL_EL2` system register value.
1000    ///
1001    /// Counter-timer Hypervisor Control Register
1002    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1003    #[repr(transparent)]
1004    pub struct CnthctlEl2: u64 {
1005        /// `EL0PCTEN` bit.
1006        const EL0PCTEN = 1 << 0;
1007        /// `EL0VCTEN` bit.
1008        const EL0VCTEN = 1 << 1;
1009        /// `EL1PCEN` bit.
1010        const EL1PCEN = 1 << 1;
1011        /// `EVNTEN` bit.
1012        const EVNTEN = 1 << 2;
1013        /// `EVNTDIR` bit.
1014        const EVNTDIR = 1 << 3;
1015        /// `EL0VTEN` bit.
1016        const EL0VTEN = 1 << 8;
1017        /// `EL0PTEN` bit.
1018        const EL0PTEN = 1 << 9;
1019        /// `EL1PTEN` bit.
1020        const EL1PTEN = 1 << 11;
1021        /// `ECV` bit.
1022        const ECV = 1 << 12;
1023        /// `EL1TVT` bit.
1024        const EL1TVT = 1 << 13;
1025        /// `EL1TVCT` bit.
1026        const EL1TVCT = 1 << 14;
1027        /// `EL1NVPCT` bit.
1028        const EL1NVPCT = 1 << 15;
1029        /// `EL1NVVCT` bit.
1030        const EL1NVVCT = 1 << 16;
1031        /// `EVNTIS` bit.
1032        const EVNTIS = 1 << 17;
1033        /// `CNTVMASK` bit.
1034        const CNTVMASK = 1 << 18;
1035        /// `CNTPMASK` bit.
1036        const CNTPMASK = 1 << 19;
1037    }
1038}
1039
1040#[cfg(feature = "el2")]
1041impl CnthctlEl2 {
1042    /// Offset of the `EL0PCTEN` field.
1043    pub const EL0PCTEN_SHIFT: u32 = 0;
1044    /// Offset of the `EL0VCTEN` field.
1045    pub const EL0VCTEN_SHIFT: u32 = 1;
1046    /// Offset of the `EL1PCEN` field.
1047    pub const EL1PCEN_SHIFT: u32 = 1;
1048    /// Offset of the `EVNTEN` field.
1049    pub const EVNTEN_SHIFT: u32 = 2;
1050    /// Offset of the `EVNTDIR` field.
1051    pub const EVNTDIR_SHIFT: u32 = 3;
1052    /// Offset of the `EVNTI` field.
1053    pub const EVNTI_SHIFT: u32 = 4;
1054    /// Mask for the `EVNTI` field.
1055    pub const EVNTI_MASK: u64 = 0b1111;
1056    /// Offset of the `EL0VTEN` field.
1057    pub const EL0VTEN_SHIFT: u32 = 8;
1058    /// Offset of the `EL0PTEN` field.
1059    pub const EL0PTEN_SHIFT: u32 = 9;
1060    /// Offset of the `EL1PTEN` field.
1061    pub const EL1PTEN_SHIFT: u32 = 11;
1062    /// Offset of the `ECV` field.
1063    pub const ECV_SHIFT: u32 = 12;
1064    /// Offset of the `EL1TVT` field.
1065    pub const EL1TVT_SHIFT: u32 = 13;
1066    /// Offset of the `EL1TVCT` field.
1067    pub const EL1TVCT_SHIFT: u32 = 14;
1068    /// Offset of the `EL1NVPCT` field.
1069    pub const EL1NVPCT_SHIFT: u32 = 15;
1070    /// Offset of the `EL1NVVCT` field.
1071    pub const EL1NVVCT_SHIFT: u32 = 16;
1072    /// Offset of the `EVNTIS` field.
1073    pub const EVNTIS_SHIFT: u32 = 17;
1074    /// Offset of the `CNTVMASK` field.
1075    pub const CNTVMASK_SHIFT: u32 = 18;
1076    /// Offset of the `CNTPMASK` field.
1077    pub const CNTPMASK_SHIFT: u32 = 19;
1078
1079    /// Returns the value of the `EVNTI` field.
1080    pub const fn evnti(self) -> u8 {
1081        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
1082    }
1083
1084    /// Sets the value of the `EVNTI` field.
1085    pub const fn set_evnti(&mut self, value: u8) {
1086        let offset = Self::EVNTI_SHIFT;
1087        assert!(value & (Self::EVNTI_MASK as u8) == value);
1088        *self = Self::from_bits_retain(
1089            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u64) << offset),
1090        );
1091    }
1092
1093    /// Returns a copy with the `EVNTI` field set to the given value.
1094    pub const fn with_evnti(mut self, value: u8) -> Self {
1095        self.set_evnti(value);
1096        self
1097    }
1098}
1099
1100bitflags! {
1101    /// `CNTHPS_CTL` system register value.
1102    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1103    #[repr(transparent)]
1104    pub struct CnthpsCtl: u32 {
1105        /// `ENABLE` bit.
1106        const ENABLE = 1 << 0;
1107        /// `IMASK` bit.
1108        const IMASK = 1 << 1;
1109        /// `ISTATUS` bit.
1110        const ISTATUS = 1 << 2;
1111    }
1112}
1113
1114impl CnthpsCtl {
1115    /// Offset of the `ENABLE` field.
1116    pub const ENABLE_SHIFT: u32 = 0;
1117    /// Offset of the `IMASK` field.
1118    pub const IMASK_SHIFT: u32 = 1;
1119    /// Offset of the `ISTATUS` field.
1120    pub const ISTATUS_SHIFT: u32 = 2;
1121}
1122
1123#[cfg(feature = "el2")]
1124bitflags! {
1125    /// `CNTHPS_CTL_EL2` system register value.
1126    ///
1127    /// Counter-timer Secure Physical Timer Control Register (EL2)
1128    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1129    #[repr(transparent)]
1130    pub struct CnthpsCtlEl2: u64 {
1131        /// `ENABLE` bit.
1132        const ENABLE = 1 << 0;
1133        /// `IMASK` bit.
1134        const IMASK = 1 << 1;
1135        /// `ISTATUS` bit.
1136        const ISTATUS = 1 << 2;
1137    }
1138}
1139
1140#[cfg(feature = "el2")]
1141impl CnthpsCtlEl2 {
1142    /// Offset of the `ENABLE` field.
1143    pub const ENABLE_SHIFT: u32 = 0;
1144    /// Offset of the `IMASK` field.
1145    pub const IMASK_SHIFT: u32 = 1;
1146    /// Offset of the `ISTATUS` field.
1147    pub const ISTATUS_SHIFT: u32 = 2;
1148}
1149
1150bitflags! {
1151    /// `CNTHPS_CVAL` system register value.
1152    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1153    #[repr(transparent)]
1154    pub struct CnthpsCval: u64 {
1155    }
1156}
1157
1158impl CnthpsCval {
1159    /// Offset of the `CompareValue` field.
1160    pub const COMPAREVALUE_SHIFT: u32 = 0;
1161    /// Mask for the `CompareValue` field.
1162    pub const COMPAREVALUE_MASK: u64 =
1163        0b1111111111111111111111111111111111111111111111111111111111111111;
1164
1165    /// Returns the value of the `CompareValue` field.
1166    pub const fn comparevalue(self) -> u64 {
1167        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1168            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1169    }
1170
1171    /// Sets the value of the `CompareValue` field.
1172    pub const fn set_comparevalue(&mut self, value: u64) {
1173        let offset = Self::COMPAREVALUE_SHIFT;
1174        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1175        *self = Self::from_bits_retain(
1176            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1177        );
1178    }
1179
1180    /// Returns a copy with the `CompareValue` field set to the given value.
1181    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1182        self.set_comparevalue(value);
1183        self
1184    }
1185}
1186
1187#[cfg(feature = "el2")]
1188bitflags! {
1189    /// `CNTHPS_CVAL_EL2` system register value.
1190    ///
1191    /// Counter-timer Secure Physical Timer CompareValue Register (EL2)
1192    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1193    #[repr(transparent)]
1194    pub struct CnthpsCvalEl2: u64 {
1195    }
1196}
1197
1198#[cfg(feature = "el2")]
1199impl CnthpsCvalEl2 {
1200    /// Offset of the `CompareValue` field.
1201    pub const COMPAREVALUE_SHIFT: u32 = 0;
1202    /// Mask for the `CompareValue` field.
1203    pub const COMPAREVALUE_MASK: u64 =
1204        0b1111111111111111111111111111111111111111111111111111111111111111;
1205
1206    /// Returns the value of the `CompareValue` field.
1207    pub const fn comparevalue(self) -> u64 {
1208        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1209            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1210    }
1211
1212    /// Sets the value of the `CompareValue` field.
1213    pub const fn set_comparevalue(&mut self, value: u64) {
1214        let offset = Self::COMPAREVALUE_SHIFT;
1215        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1216        *self = Self::from_bits_retain(
1217            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1218        );
1219    }
1220
1221    /// Returns a copy with the `CompareValue` field set to the given value.
1222    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1223        self.set_comparevalue(value);
1224        self
1225    }
1226}
1227
1228bitflags! {
1229    /// `CNTHPS_TVAL` system register value.
1230    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1231    #[repr(transparent)]
1232    pub struct CnthpsTval: u32 {
1233    }
1234}
1235
1236impl CnthpsTval {
1237    /// Offset of the `TimerValue` field.
1238    pub const TIMERVALUE_SHIFT: u32 = 0;
1239    /// Mask for the `TimerValue` field.
1240    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1241
1242    /// Returns the value of the `TimerValue` field.
1243    pub const fn timervalue(self) -> u32 {
1244        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1245    }
1246
1247    /// Sets the value of the `TimerValue` field.
1248    pub const fn set_timervalue(&mut self, value: u32) {
1249        let offset = Self::TIMERVALUE_SHIFT;
1250        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1251        *self = Self::from_bits_retain(
1252            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1253        );
1254    }
1255
1256    /// Returns a copy with the `TimerValue` field set to the given value.
1257    pub const fn with_timervalue(mut self, value: u32) -> Self {
1258        self.set_timervalue(value);
1259        self
1260    }
1261}
1262
1263#[cfg(feature = "el2")]
1264bitflags! {
1265    /// `CNTHPS_TVAL_EL2` system register value.
1266    ///
1267    /// Counter-timer Secure Physical Timer TimerValue Register (EL2)
1268    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1269    #[repr(transparent)]
1270    pub struct CnthpsTvalEl2: u64 {
1271    }
1272}
1273
1274#[cfg(feature = "el2")]
1275impl CnthpsTvalEl2 {
1276    /// Offset of the `TimerValue` field.
1277    pub const TIMERVALUE_SHIFT: u32 = 0;
1278    /// Mask for the `TimerValue` field.
1279    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
1280
1281    /// Returns the value of the `TimerValue` field.
1282    pub const fn timervalue(self) -> u32 {
1283        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1284    }
1285
1286    /// Sets the value of the `TimerValue` field.
1287    pub const fn set_timervalue(&mut self, value: u32) {
1288        let offset = Self::TIMERVALUE_SHIFT;
1289        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1290        *self = Self::from_bits_retain(
1291            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
1292        );
1293    }
1294
1295    /// Returns a copy with the `TimerValue` field set to the given value.
1296    pub const fn with_timervalue(mut self, value: u32) -> Self {
1297        self.set_timervalue(value);
1298        self
1299    }
1300}
1301
1302bitflags! {
1303    /// `CNTHP_CTL` system register value.
1304    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1305    #[repr(transparent)]
1306    pub struct CnthpCtl: u32 {
1307        /// `ENABLE` bit.
1308        const ENABLE = 1 << 0;
1309        /// `IMASK` bit.
1310        const IMASK = 1 << 1;
1311        /// `ISTATUS` bit.
1312        const ISTATUS = 1 << 2;
1313    }
1314}
1315
1316impl CnthpCtl {
1317    /// Offset of the `ENABLE` field.
1318    pub const ENABLE_SHIFT: u32 = 0;
1319    /// Offset of the `IMASK` field.
1320    pub const IMASK_SHIFT: u32 = 1;
1321    /// Offset of the `ISTATUS` field.
1322    pub const ISTATUS_SHIFT: u32 = 2;
1323}
1324
1325#[cfg(feature = "el2")]
1326bitflags! {
1327    /// `CNTHP_CTL_EL2` system register value.
1328    ///
1329    /// Counter-timer Hypervisor Physical Timer Control Register
1330    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1331    #[repr(transparent)]
1332    pub struct CnthpCtlEl2: u64 {
1333        /// `ENABLE` bit.
1334        const ENABLE = 1 << 0;
1335        /// `IMASK` bit.
1336        const IMASK = 1 << 1;
1337        /// `ISTATUS` bit.
1338        const ISTATUS = 1 << 2;
1339    }
1340}
1341
1342#[cfg(feature = "el2")]
1343impl CnthpCtlEl2 {
1344    /// Offset of the `ENABLE` field.
1345    pub const ENABLE_SHIFT: u32 = 0;
1346    /// Offset of the `IMASK` field.
1347    pub const IMASK_SHIFT: u32 = 1;
1348    /// Offset of the `ISTATUS` field.
1349    pub const ISTATUS_SHIFT: u32 = 2;
1350}
1351
1352bitflags! {
1353    /// `CNTHP_CVAL` system register value.
1354    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1355    #[repr(transparent)]
1356    pub struct CnthpCval: u64 {
1357    }
1358}
1359
1360impl CnthpCval {
1361    /// Offset of the `CompareValue` field.
1362    pub const COMPAREVALUE_SHIFT: u32 = 0;
1363    /// Mask for the `CompareValue` field.
1364    pub const COMPAREVALUE_MASK: u64 =
1365        0b1111111111111111111111111111111111111111111111111111111111111111;
1366
1367    /// Returns the value of the `CompareValue` field.
1368    pub const fn comparevalue(self) -> u64 {
1369        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1370            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1371    }
1372
1373    /// Sets the value of the `CompareValue` field.
1374    pub const fn set_comparevalue(&mut self, value: u64) {
1375        let offset = Self::COMPAREVALUE_SHIFT;
1376        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1377        *self = Self::from_bits_retain(
1378            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1379        );
1380    }
1381
1382    /// Returns a copy with the `CompareValue` field set to the given value.
1383    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1384        self.set_comparevalue(value);
1385        self
1386    }
1387}
1388
1389#[cfg(feature = "el2")]
1390bitflags! {
1391    /// `CNTHP_CVAL_EL2` system register value.
1392    ///
1393    /// Counter-timer Physical Timer CompareValue Register (EL2)
1394    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1395    #[repr(transparent)]
1396    pub struct CnthpCvalEl2: u64 {
1397    }
1398}
1399
1400#[cfg(feature = "el2")]
1401impl CnthpCvalEl2 {
1402    /// Offset of the `CompareValue` field.
1403    pub const COMPAREVALUE_SHIFT: u32 = 0;
1404    /// Mask for the `CompareValue` field.
1405    pub const COMPAREVALUE_MASK: u64 =
1406        0b1111111111111111111111111111111111111111111111111111111111111111;
1407
1408    /// Returns the value of the `CompareValue` field.
1409    pub const fn comparevalue(self) -> u64 {
1410        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1411            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1412    }
1413
1414    /// Sets the value of the `CompareValue` field.
1415    pub const fn set_comparevalue(&mut self, value: u64) {
1416        let offset = Self::COMPAREVALUE_SHIFT;
1417        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1418        *self = Self::from_bits_retain(
1419            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1420        );
1421    }
1422
1423    /// Returns a copy with the `CompareValue` field set to the given value.
1424    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1425        self.set_comparevalue(value);
1426        self
1427    }
1428}
1429
1430bitflags! {
1431    /// `CNTHP_TVAL` system register value.
1432    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1433    #[repr(transparent)]
1434    pub struct CnthpTval: u32 {
1435    }
1436}
1437
1438impl CnthpTval {
1439    /// Offset of the `TimerValue` field.
1440    pub const TIMERVALUE_SHIFT: u32 = 0;
1441    /// Mask for the `TimerValue` field.
1442    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1443
1444    /// Returns the value of the `TimerValue` field.
1445    pub const fn timervalue(self) -> u32 {
1446        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1447    }
1448
1449    /// Sets the value of the `TimerValue` field.
1450    pub const fn set_timervalue(&mut self, value: u32) {
1451        let offset = Self::TIMERVALUE_SHIFT;
1452        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1453        *self = Self::from_bits_retain(
1454            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1455        );
1456    }
1457
1458    /// Returns a copy with the `TimerValue` field set to the given value.
1459    pub const fn with_timervalue(mut self, value: u32) -> Self {
1460        self.set_timervalue(value);
1461        self
1462    }
1463}
1464
1465#[cfg(feature = "el2")]
1466bitflags! {
1467    /// `CNTHP_TVAL_EL2` system register value.
1468    ///
1469    /// Counter-timer Physical Timer TimerValue Register (EL2)
1470    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1471    #[repr(transparent)]
1472    pub struct CnthpTvalEl2: u64 {
1473    }
1474}
1475
1476#[cfg(feature = "el2")]
1477impl CnthpTvalEl2 {
1478    /// Offset of the `TimerValue` field.
1479    pub const TIMERVALUE_SHIFT: u32 = 0;
1480    /// Mask for the `TimerValue` field.
1481    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
1482
1483    /// Returns the value of the `TimerValue` field.
1484    pub const fn timervalue(self) -> u32 {
1485        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1486    }
1487
1488    /// Sets the value of the `TimerValue` field.
1489    pub const fn set_timervalue(&mut self, value: u32) {
1490        let offset = Self::TIMERVALUE_SHIFT;
1491        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1492        *self = Self::from_bits_retain(
1493            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
1494        );
1495    }
1496
1497    /// Returns a copy with the `TimerValue` field set to the given value.
1498    pub const fn with_timervalue(mut self, value: u32) -> Self {
1499        self.set_timervalue(value);
1500        self
1501    }
1502}
1503
1504bitflags! {
1505    /// `CNTHVS_CTL` system register value.
1506    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1507    #[repr(transparent)]
1508    pub struct CnthvsCtl: u32 {
1509        /// `ENABLE` bit.
1510        const ENABLE = 1 << 0;
1511        /// `IMASK` bit.
1512        const IMASK = 1 << 1;
1513        /// `ISTATUS` bit.
1514        const ISTATUS = 1 << 2;
1515    }
1516}
1517
1518impl CnthvsCtl {
1519    /// Offset of the `ENABLE` field.
1520    pub const ENABLE_SHIFT: u32 = 0;
1521    /// Offset of the `IMASK` field.
1522    pub const IMASK_SHIFT: u32 = 1;
1523    /// Offset of the `ISTATUS` field.
1524    pub const ISTATUS_SHIFT: u32 = 2;
1525}
1526
1527#[cfg(feature = "el2")]
1528bitflags! {
1529    /// `CNTHVS_CTL_EL2` system register value.
1530    ///
1531    /// Counter-timer Secure Virtual Timer Control Register (EL2)
1532    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1533    #[repr(transparent)]
1534    pub struct CnthvsCtlEl2: u64 {
1535        /// `ENABLE` bit.
1536        const ENABLE = 1 << 0;
1537        /// `IMASK` bit.
1538        const IMASK = 1 << 1;
1539        /// `ISTATUS` bit.
1540        const ISTATUS = 1 << 2;
1541    }
1542}
1543
1544#[cfg(feature = "el2")]
1545impl CnthvsCtlEl2 {
1546    /// Offset of the `ENABLE` field.
1547    pub const ENABLE_SHIFT: u32 = 0;
1548    /// Offset of the `IMASK` field.
1549    pub const IMASK_SHIFT: u32 = 1;
1550    /// Offset of the `ISTATUS` field.
1551    pub const ISTATUS_SHIFT: u32 = 2;
1552}
1553
1554bitflags! {
1555    /// `CNTHVS_CVAL` system register value.
1556    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1557    #[repr(transparent)]
1558    pub struct CnthvsCval: u64 {
1559    }
1560}
1561
1562impl CnthvsCval {
1563    /// Offset of the `CompareValue` field.
1564    pub const COMPAREVALUE_SHIFT: u32 = 0;
1565    /// Mask for the `CompareValue` field.
1566    pub const COMPAREVALUE_MASK: u64 =
1567        0b1111111111111111111111111111111111111111111111111111111111111111;
1568
1569    /// Returns the value of the `CompareValue` field.
1570    pub const fn comparevalue(self) -> u64 {
1571        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1572            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1573    }
1574
1575    /// Sets the value of the `CompareValue` field.
1576    pub const fn set_comparevalue(&mut self, value: u64) {
1577        let offset = Self::COMPAREVALUE_SHIFT;
1578        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1579        *self = Self::from_bits_retain(
1580            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1581        );
1582    }
1583
1584    /// Returns a copy with the `CompareValue` field set to the given value.
1585    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1586        self.set_comparevalue(value);
1587        self
1588    }
1589}
1590
1591#[cfg(feature = "el2")]
1592bitflags! {
1593    /// `CNTHVS_CVAL_EL2` system register value.
1594    ///
1595    /// Counter-timer Secure Virtual Timer CompareValue Register (EL2)
1596    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1597    #[repr(transparent)]
1598    pub struct CnthvsCvalEl2: u64 {
1599    }
1600}
1601
1602#[cfg(feature = "el2")]
1603impl CnthvsCvalEl2 {
1604    /// Offset of the `CompareValue` field.
1605    pub const COMPAREVALUE_SHIFT: u32 = 0;
1606    /// Mask for the `CompareValue` field.
1607    pub const COMPAREVALUE_MASK: u64 =
1608        0b1111111111111111111111111111111111111111111111111111111111111111;
1609
1610    /// Returns the value of the `CompareValue` field.
1611    pub const fn comparevalue(self) -> u64 {
1612        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1613            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1614    }
1615
1616    /// Sets the value of the `CompareValue` field.
1617    pub const fn set_comparevalue(&mut self, value: u64) {
1618        let offset = Self::COMPAREVALUE_SHIFT;
1619        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1620        *self = Self::from_bits_retain(
1621            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1622        );
1623    }
1624
1625    /// Returns a copy with the `CompareValue` field set to the given value.
1626    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1627        self.set_comparevalue(value);
1628        self
1629    }
1630}
1631
1632bitflags! {
1633    /// `CNTHVS_TVAL` system register value.
1634    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1635    #[repr(transparent)]
1636    pub struct CnthvsTval: u32 {
1637    }
1638}
1639
1640impl CnthvsTval {
1641    /// Offset of the `TimerValue` field.
1642    pub const TIMERVALUE_SHIFT: u32 = 0;
1643    /// Mask for the `TimerValue` field.
1644    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1645
1646    /// Returns the value of the `TimerValue` field.
1647    pub const fn timervalue(self) -> u32 {
1648        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1649    }
1650
1651    /// Sets the value of the `TimerValue` field.
1652    pub const fn set_timervalue(&mut self, value: u32) {
1653        let offset = Self::TIMERVALUE_SHIFT;
1654        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1655        *self = Self::from_bits_retain(
1656            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1657        );
1658    }
1659
1660    /// Returns a copy with the `TimerValue` field set to the given value.
1661    pub const fn with_timervalue(mut self, value: u32) -> Self {
1662        self.set_timervalue(value);
1663        self
1664    }
1665}
1666
1667#[cfg(feature = "el2")]
1668bitflags! {
1669    /// `CNTHVS_TVAL_EL2` system register value.
1670    ///
1671    /// Counter-timer Secure Virtual Timer TimerValue Register (EL2)
1672    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1673    #[repr(transparent)]
1674    pub struct CnthvsTvalEl2: u64 {
1675    }
1676}
1677
1678#[cfg(feature = "el2")]
1679impl CnthvsTvalEl2 {
1680    /// Offset of the `TimerValue` field.
1681    pub const TIMERVALUE_SHIFT: u32 = 0;
1682    /// Mask for the `TimerValue` field.
1683    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
1684
1685    /// Returns the value of the `TimerValue` field.
1686    pub const fn timervalue(self) -> u32 {
1687        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1688    }
1689
1690    /// Sets the value of the `TimerValue` field.
1691    pub const fn set_timervalue(&mut self, value: u32) {
1692        let offset = Self::TIMERVALUE_SHIFT;
1693        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1694        *self = Self::from_bits_retain(
1695            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
1696        );
1697    }
1698
1699    /// Returns a copy with the `TimerValue` field set to the given value.
1700    pub const fn with_timervalue(mut self, value: u32) -> Self {
1701        self.set_timervalue(value);
1702        self
1703    }
1704}
1705
1706bitflags! {
1707    /// `CNTHV_CTL` system register value.
1708    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1709    #[repr(transparent)]
1710    pub struct CnthvCtl: u32 {
1711        /// `ENABLE` bit.
1712        const ENABLE = 1 << 0;
1713        /// `IMASK` bit.
1714        const IMASK = 1 << 1;
1715        /// `ISTATUS` bit.
1716        const ISTATUS = 1 << 2;
1717    }
1718}
1719
1720impl CnthvCtl {
1721    /// Offset of the `ENABLE` field.
1722    pub const ENABLE_SHIFT: u32 = 0;
1723    /// Offset of the `IMASK` field.
1724    pub const IMASK_SHIFT: u32 = 1;
1725    /// Offset of the `ISTATUS` field.
1726    pub const ISTATUS_SHIFT: u32 = 2;
1727}
1728
1729#[cfg(feature = "el2")]
1730bitflags! {
1731    /// `CNTHV_CTL_EL2` system register value.
1732    ///
1733    /// Counter-timer Virtual Timer Control Register (EL2)
1734    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1735    #[repr(transparent)]
1736    pub struct CnthvCtlEl2: u64 {
1737        /// `ENABLE` bit.
1738        const ENABLE = 1 << 0;
1739        /// `IMASK` bit.
1740        const IMASK = 1 << 1;
1741        /// `ISTATUS` bit.
1742        const ISTATUS = 1 << 2;
1743    }
1744}
1745
1746#[cfg(feature = "el2")]
1747impl CnthvCtlEl2 {
1748    /// Offset of the `ENABLE` field.
1749    pub const ENABLE_SHIFT: u32 = 0;
1750    /// Offset of the `IMASK` field.
1751    pub const IMASK_SHIFT: u32 = 1;
1752    /// Offset of the `ISTATUS` field.
1753    pub const ISTATUS_SHIFT: u32 = 2;
1754}
1755
1756bitflags! {
1757    /// `CNTHV_CVAL` system register value.
1758    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1759    #[repr(transparent)]
1760    pub struct CnthvCval: u64 {
1761    }
1762}
1763
1764impl CnthvCval {
1765    /// Offset of the `CompareValue` field.
1766    pub const COMPAREVALUE_SHIFT: u32 = 0;
1767    /// Mask for the `CompareValue` field.
1768    pub const COMPAREVALUE_MASK: u64 =
1769        0b1111111111111111111111111111111111111111111111111111111111111111;
1770
1771    /// Returns the value of the `CompareValue` field.
1772    pub const fn comparevalue(self) -> u64 {
1773        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1774            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1775    }
1776
1777    /// Sets the value of the `CompareValue` field.
1778    pub const fn set_comparevalue(&mut self, value: u64) {
1779        let offset = Self::COMPAREVALUE_SHIFT;
1780        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1781        *self = Self::from_bits_retain(
1782            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1783        );
1784    }
1785
1786    /// Returns a copy with the `CompareValue` field set to the given value.
1787    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1788        self.set_comparevalue(value);
1789        self
1790    }
1791}
1792
1793#[cfg(feature = "el2")]
1794bitflags! {
1795    /// `CNTHV_CVAL_EL2` system register value.
1796    ///
1797    /// Counter-timer Virtual Timer CompareValue Register (EL2)
1798    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1799    #[repr(transparent)]
1800    pub struct CnthvCvalEl2: u64 {
1801    }
1802}
1803
1804#[cfg(feature = "el2")]
1805impl CnthvCvalEl2 {
1806    /// Offset of the `CompareValue` field.
1807    pub const COMPAREVALUE_SHIFT: u32 = 0;
1808    /// Mask for the `CompareValue` field.
1809    pub const COMPAREVALUE_MASK: u64 =
1810        0b1111111111111111111111111111111111111111111111111111111111111111;
1811
1812    /// Returns the value of the `CompareValue` field.
1813    pub const fn comparevalue(self) -> u64 {
1814        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
1815            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
1816    }
1817
1818    /// Sets the value of the `CompareValue` field.
1819    pub const fn set_comparevalue(&mut self, value: u64) {
1820        let offset = Self::COMPAREVALUE_SHIFT;
1821        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
1822        *self = Self::from_bits_retain(
1823            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
1824        );
1825    }
1826
1827    /// Returns a copy with the `CompareValue` field set to the given value.
1828    pub const fn with_comparevalue(mut self, value: u64) -> Self {
1829        self.set_comparevalue(value);
1830        self
1831    }
1832}
1833
1834bitflags! {
1835    /// `CNTHV_TVAL` system register value.
1836    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1837    #[repr(transparent)]
1838    pub struct CnthvTval: u32 {
1839    }
1840}
1841
1842impl CnthvTval {
1843    /// Offset of the `TimerValue` field.
1844    pub const TIMERVALUE_SHIFT: u32 = 0;
1845    /// Mask for the `TimerValue` field.
1846    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
1847
1848    /// Returns the value of the `TimerValue` field.
1849    pub const fn timervalue(self) -> u32 {
1850        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1851    }
1852
1853    /// Sets the value of the `TimerValue` field.
1854    pub const fn set_timervalue(&mut self, value: u32) {
1855        let offset = Self::TIMERVALUE_SHIFT;
1856        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1857        *self = Self::from_bits_retain(
1858            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
1859        );
1860    }
1861
1862    /// Returns a copy with the `TimerValue` field set to the given value.
1863    pub const fn with_timervalue(mut self, value: u32) -> Self {
1864        self.set_timervalue(value);
1865        self
1866    }
1867}
1868
1869#[cfg(feature = "el2")]
1870bitflags! {
1871    /// `CNTHV_TVAL_EL2` system register value.
1872    ///
1873    /// Counter-timer Virtual Timer TimerValue Register (EL2)
1874    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1875    #[repr(transparent)]
1876    pub struct CnthvTvalEl2: u64 {
1877    }
1878}
1879
1880#[cfg(feature = "el2")]
1881impl CnthvTvalEl2 {
1882    /// Offset of the `TimerValue` field.
1883    pub const TIMERVALUE_SHIFT: u32 = 0;
1884    /// Mask for the `TimerValue` field.
1885    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
1886
1887    /// Returns the value of the `TimerValue` field.
1888    pub const fn timervalue(self) -> u32 {
1889        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
1890    }
1891
1892    /// Sets the value of the `TimerValue` field.
1893    pub const fn set_timervalue(&mut self, value: u32) {
1894        let offset = Self::TIMERVALUE_SHIFT;
1895        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
1896        *self = Self::from_bits_retain(
1897            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
1898        );
1899    }
1900
1901    /// Returns a copy with the `TimerValue` field set to the given value.
1902    pub const fn with_timervalue(mut self, value: u32) -> Self {
1903        self.set_timervalue(value);
1904        self
1905    }
1906}
1907
1908bitflags! {
1909    /// `CNTKCTL` system register value.
1910    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1911    #[repr(transparent)]
1912    pub struct Cntkctl: u32 {
1913        /// `PL0PCTEN` bit.
1914        const PL0PCTEN = 1 << 0;
1915        /// `PL0VCTEN` bit.
1916        const PL0VCTEN = 1 << 1;
1917        /// `EVNTEN` bit.
1918        const EVNTEN = 1 << 2;
1919        /// `EVNTDIR` bit.
1920        const EVNTDIR = 1 << 3;
1921        /// `PL0VTEN` bit.
1922        const PL0VTEN = 1 << 8;
1923        /// `PL0PTEN` bit.
1924        const PL0PTEN = 1 << 9;
1925        /// `EVNTIS` bit.
1926        const EVNTIS = 1 << 17;
1927    }
1928}
1929
1930impl Cntkctl {
1931    /// Offset of the `PL0PCTEN` field.
1932    pub const PL0PCTEN_SHIFT: u32 = 0;
1933    /// Offset of the `PL0VCTEN` field.
1934    pub const PL0VCTEN_SHIFT: u32 = 1;
1935    /// Offset of the `EVNTEN` field.
1936    pub const EVNTEN_SHIFT: u32 = 2;
1937    /// Offset of the `EVNTDIR` field.
1938    pub const EVNTDIR_SHIFT: u32 = 3;
1939    /// Offset of the `EVNTI` field.
1940    pub const EVNTI_SHIFT: u32 = 4;
1941    /// Mask for the `EVNTI` field.
1942    pub const EVNTI_MASK: u32 = 0b1111;
1943    /// Offset of the `PL0VTEN` field.
1944    pub const PL0VTEN_SHIFT: u32 = 8;
1945    /// Offset of the `PL0PTEN` field.
1946    pub const PL0PTEN_SHIFT: u32 = 9;
1947    /// Offset of the `EVNTIS` field.
1948    pub const EVNTIS_SHIFT: u32 = 17;
1949
1950    /// Returns the value of the `EVNTI` field.
1951    pub const fn evnti(self) -> u8 {
1952        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
1953    }
1954
1955    /// Sets the value of the `EVNTI` field.
1956    pub const fn set_evnti(&mut self, value: u8) {
1957        let offset = Self::EVNTI_SHIFT;
1958        assert!(value & (Self::EVNTI_MASK as u8) == value);
1959        *self = Self::from_bits_retain(
1960            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u32) << offset),
1961        );
1962    }
1963
1964    /// Returns a copy with the `EVNTI` field set to the given value.
1965    pub const fn with_evnti(mut self, value: u8) -> Self {
1966        self.set_evnti(value);
1967        self
1968    }
1969}
1970
1971#[cfg(feature = "el1")]
1972bitflags! {
1973    /// `CNTKCTL_EL1` system register value.
1974    ///
1975    /// Counter-timer Kernel Control Register
1976    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
1977    #[repr(transparent)]
1978    pub struct CntkctlEl1: u64 {
1979        /// `EL0PCTEN` bit.
1980        const EL0PCTEN = 1 << 0;
1981        /// `EL0VCTEN` bit.
1982        const EL0VCTEN = 1 << 1;
1983        /// `EVNTEN` bit.
1984        const EVNTEN = 1 << 2;
1985        /// `EVNTDIR` bit.
1986        const EVNTDIR = 1 << 3;
1987        /// `EL0VTEN` bit.
1988        const EL0VTEN = 1 << 8;
1989        /// `EL0PTEN` bit.
1990        const EL0PTEN = 1 << 9;
1991        /// `EL1PCTEN` bit.
1992        const EL1PCTEN = 1 << 10;
1993        /// `EL1PTEN` bit.
1994        const EL1PTEN = 1 << 11;
1995        /// `ECV` bit.
1996        const ECV = 1 << 12;
1997        /// `EL1TVT` bit.
1998        const EL1TVT = 1 << 13;
1999        /// `EL1TVCT` bit.
2000        const EL1TVCT = 1 << 14;
2001        /// `EL1NVPCT` bit.
2002        const EL1NVPCT = 1 << 15;
2003        /// `EL1NVVCT` bit.
2004        const EL1NVVCT = 1 << 16;
2005        /// `EVNTIS` bit.
2006        const EVNTIS = 1 << 17;
2007        /// `CNTVMASK` bit.
2008        const CNTVMASK = 1 << 18;
2009        /// `CNTPMASK` bit.
2010        const CNTPMASK = 1 << 19;
2011    }
2012}
2013
2014#[cfg(feature = "el1")]
2015impl CntkctlEl1 {
2016    /// Offset of the `EL0PCTEN` field.
2017    pub const EL0PCTEN_SHIFT: u32 = 0;
2018    /// Offset of the `EL0VCTEN` field.
2019    pub const EL0VCTEN_SHIFT: u32 = 1;
2020    /// Offset of the `EVNTEN` field.
2021    pub const EVNTEN_SHIFT: u32 = 2;
2022    /// Offset of the `EVNTDIR` field.
2023    pub const EVNTDIR_SHIFT: u32 = 3;
2024    /// Offset of the `EVNTI` field.
2025    pub const EVNTI_SHIFT: u32 = 4;
2026    /// Mask for the `EVNTI` field.
2027    pub const EVNTI_MASK: u64 = 0b1111;
2028    /// Offset of the `EL0VTEN` field.
2029    pub const EL0VTEN_SHIFT: u32 = 8;
2030    /// Offset of the `EL0PTEN` field.
2031    pub const EL0PTEN_SHIFT: u32 = 9;
2032    /// Offset of the `EL1PCTEN` field.
2033    pub const EL1PCTEN_SHIFT: u32 = 10;
2034    /// Offset of the `EL1PTEN` field.
2035    pub const EL1PTEN_SHIFT: u32 = 11;
2036    /// Offset of the `ECV` field.
2037    pub const ECV_SHIFT: u32 = 12;
2038    /// Offset of the `EL1TVT` field.
2039    pub const EL1TVT_SHIFT: u32 = 13;
2040    /// Offset of the `EL1TVCT` field.
2041    pub const EL1TVCT_SHIFT: u32 = 14;
2042    /// Offset of the `EL1NVPCT` field.
2043    pub const EL1NVPCT_SHIFT: u32 = 15;
2044    /// Offset of the `EL1NVVCT` field.
2045    pub const EL1NVVCT_SHIFT: u32 = 16;
2046    /// Offset of the `EVNTIS` field.
2047    pub const EVNTIS_SHIFT: u32 = 17;
2048    /// Offset of the `CNTVMASK` field.
2049    pub const CNTVMASK_SHIFT: u32 = 18;
2050    /// Offset of the `CNTPMASK` field.
2051    pub const CNTPMASK_SHIFT: u32 = 19;
2052
2053    /// Returns the value of the `EVNTI` field.
2054    pub const fn evnti(self) -> u8 {
2055        ((self.bits() >> Self::EVNTI_SHIFT) & 0b1111) as u8
2056    }
2057
2058    /// Sets the value of the `EVNTI` field.
2059    pub const fn set_evnti(&mut self, value: u8) {
2060        let offset = Self::EVNTI_SHIFT;
2061        assert!(value & (Self::EVNTI_MASK as u8) == value);
2062        *self = Self::from_bits_retain(
2063            (self.bits() & !(Self::EVNTI_MASK << offset)) | ((value as u64) << offset),
2064        );
2065    }
2066
2067    /// Returns a copy with the `EVNTI` field set to the given value.
2068    pub const fn with_evnti(mut self, value: u8) -> Self {
2069        self.set_evnti(value);
2070        self
2071    }
2072}
2073
2074bitflags! {
2075    /// `CNTPCT` system register value.
2076    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2077    #[repr(transparent)]
2078    pub struct Cntpct: u64 {
2079    }
2080}
2081
2082impl Cntpct {
2083    /// Offset of the `PhysicalCount` field.
2084    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
2085    /// Mask for the `PhysicalCount` field.
2086    pub const PHYSICALCOUNT_MASK: u64 =
2087        0b1111111111111111111111111111111111111111111111111111111111111111;
2088
2089    /// Returns the value of the `PhysicalCount` field.
2090    pub const fn physicalcount(self) -> u64 {
2091        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
2092            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2093    }
2094
2095    /// Sets the value of the `PhysicalCount` field.
2096    pub const fn set_physicalcount(&mut self, value: u64) {
2097        let offset = Self::PHYSICALCOUNT_SHIFT;
2098        assert!(value & (Self::PHYSICALCOUNT_MASK as u64) == value);
2099        *self = Self::from_bits_retain(
2100            (self.bits() & !(Self::PHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
2101        );
2102    }
2103
2104    /// Returns a copy with the `PhysicalCount` field set to the given value.
2105    pub const fn with_physicalcount(mut self, value: u64) -> Self {
2106        self.set_physicalcount(value);
2107        self
2108    }
2109}
2110
2111bitflags! {
2112    /// `CNTPCTSS` system register value.
2113    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2114    #[repr(transparent)]
2115    pub struct Cntpctss: u64 {
2116    }
2117}
2118
2119impl Cntpctss {
2120    /// Offset of the `SSPhysicalCount` field.
2121    pub const SSPHYSICALCOUNT_SHIFT: u32 = 0;
2122    /// Mask for the `SSPhysicalCount` field.
2123    pub const SSPHYSICALCOUNT_MASK: u64 =
2124        0b1111111111111111111111111111111111111111111111111111111111111111;
2125
2126    /// Returns the value of the `SSPhysicalCount` field.
2127    pub const fn ssphysicalcount(self) -> u64 {
2128        ((self.bits() >> Self::SSPHYSICALCOUNT_SHIFT)
2129            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2130    }
2131
2132    /// Sets the value of the `SSPhysicalCount` field.
2133    pub const fn set_ssphysicalcount(&mut self, value: u64) {
2134        let offset = Self::SSPHYSICALCOUNT_SHIFT;
2135        assert!(value & (Self::SSPHYSICALCOUNT_MASK as u64) == value);
2136        *self = Self::from_bits_retain(
2137            (self.bits() & !(Self::SSPHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
2138        );
2139    }
2140
2141    /// Returns a copy with the `SSPhysicalCount` field set to the given value.
2142    pub const fn with_ssphysicalcount(mut self, value: u64) -> Self {
2143        self.set_ssphysicalcount(value);
2144        self
2145    }
2146}
2147
2148bitflags! {
2149    /// `CNTPCTSS_EL0` system register value.
2150    ///
2151    /// Counter-timer Self-Synchronized Physical Count Register
2152    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2153    #[repr(transparent)]
2154    pub struct CntpctssEl0: u64 {
2155    }
2156}
2157
2158impl CntpctssEl0 {
2159    /// Offset of the `SSPhysicalCount` field.
2160    pub const SSPHYSICALCOUNT_SHIFT: u32 = 0;
2161    /// Mask for the `SSPhysicalCount` field.
2162    pub const SSPHYSICALCOUNT_MASK: u64 =
2163        0b1111111111111111111111111111111111111111111111111111111111111111;
2164
2165    /// Returns the value of the `SSPhysicalCount` field.
2166    pub const fn ssphysicalcount(self) -> u64 {
2167        ((self.bits() >> Self::SSPHYSICALCOUNT_SHIFT)
2168            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2169    }
2170
2171    /// Sets the value of the `SSPhysicalCount` field.
2172    pub const fn set_ssphysicalcount(&mut self, value: u64) {
2173        let offset = Self::SSPHYSICALCOUNT_SHIFT;
2174        assert!(value & (Self::SSPHYSICALCOUNT_MASK as u64) == value);
2175        *self = Self::from_bits_retain(
2176            (self.bits() & !(Self::SSPHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
2177        );
2178    }
2179
2180    /// Returns a copy with the `SSPhysicalCount` field set to the given value.
2181    pub const fn with_ssphysicalcount(mut self, value: u64) -> Self {
2182        self.set_ssphysicalcount(value);
2183        self
2184    }
2185}
2186
2187bitflags! {
2188    /// `CNTPCT_EL0` system register value.
2189    ///
2190    /// Counter-timer Physical Count Register
2191    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2192    #[repr(transparent)]
2193    pub struct CntpctEl0: u64 {
2194    }
2195}
2196
2197impl CntpctEl0 {
2198    /// Offset of the `PhysicalCount` field.
2199    pub const PHYSICALCOUNT_SHIFT: u32 = 0;
2200    /// Mask for the `PhysicalCount` field.
2201    pub const PHYSICALCOUNT_MASK: u64 =
2202        0b1111111111111111111111111111111111111111111111111111111111111111;
2203
2204    /// Returns the value of the `PhysicalCount` field.
2205    pub const fn physicalcount(self) -> u64 {
2206        ((self.bits() >> Self::PHYSICALCOUNT_SHIFT)
2207            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2208    }
2209
2210    /// Sets the value of the `PhysicalCount` field.
2211    pub const fn set_physicalcount(&mut self, value: u64) {
2212        let offset = Self::PHYSICALCOUNT_SHIFT;
2213        assert!(value & (Self::PHYSICALCOUNT_MASK as u64) == value);
2214        *self = Self::from_bits_retain(
2215            (self.bits() & !(Self::PHYSICALCOUNT_MASK << offset)) | ((value as u64) << offset),
2216        );
2217    }
2218
2219    /// Returns a copy with the `PhysicalCount` field set to the given value.
2220    pub const fn with_physicalcount(mut self, value: u64) -> Self {
2221        self.set_physicalcount(value);
2222        self
2223    }
2224}
2225
2226#[cfg(feature = "el2")]
2227bitflags! {
2228    /// `CNTPOFF_EL2` system register value.
2229    ///
2230    /// Counter-timer Physical Offset Register
2231    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2232    #[repr(transparent)]
2233    pub struct CntpoffEl2: u64 {
2234    }
2235}
2236
2237#[cfg(feature = "el2")]
2238impl CntpoffEl2 {
2239    /// Offset of the `PO` field.
2240    pub const PO_SHIFT: u32 = 0;
2241    /// Mask for the `PO` field.
2242    pub const PO_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
2243
2244    /// Returns the value of the `PO` field.
2245    pub const fn po(self) -> u64 {
2246        ((self.bits() >> Self::PO_SHIFT)
2247            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2248    }
2249
2250    /// Sets the value of the `PO` field.
2251    pub const fn set_po(&mut self, value: u64) {
2252        let offset = Self::PO_SHIFT;
2253        assert!(value & (Self::PO_MASK as u64) == value);
2254        *self = Self::from_bits_retain(
2255            (self.bits() & !(Self::PO_MASK << offset)) | ((value as u64) << offset),
2256        );
2257    }
2258
2259    /// Returns a copy with the `PO` field set to the given value.
2260    pub const fn with_po(mut self, value: u64) -> Self {
2261        self.set_po(value);
2262        self
2263    }
2264}
2265
2266#[cfg(feature = "el1")]
2267bitflags! {
2268    /// `CNTPS_CTL_EL1` system register value.
2269    ///
2270    /// Counter-timer Physical Secure Timer Control Register
2271    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2272    #[repr(transparent)]
2273    pub struct CntpsCtlEl1: u64 {
2274        /// `ENABLE` bit.
2275        const ENABLE = 1 << 0;
2276        /// `IMASK` bit.
2277        const IMASK = 1 << 1;
2278        /// `ISTATUS` bit.
2279        const ISTATUS = 1 << 2;
2280    }
2281}
2282
2283#[cfg(feature = "el1")]
2284impl CntpsCtlEl1 {
2285    /// Offset of the `ENABLE` field.
2286    pub const ENABLE_SHIFT: u32 = 0;
2287    /// Offset of the `IMASK` field.
2288    pub const IMASK_SHIFT: u32 = 1;
2289    /// Offset of the `ISTATUS` field.
2290    pub const ISTATUS_SHIFT: u32 = 2;
2291}
2292
2293#[cfg(feature = "el1")]
2294bitflags! {
2295    /// `CNTPS_CVAL_EL1` system register value.
2296    ///
2297    /// Counter-timer Physical Secure Timer CompareValue Register
2298    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2299    #[repr(transparent)]
2300    pub struct CntpsCvalEl1: u64 {
2301    }
2302}
2303
2304#[cfg(feature = "el1")]
2305impl CntpsCvalEl1 {
2306    /// Offset of the `CompareValue` field.
2307    pub const COMPAREVALUE_SHIFT: u32 = 0;
2308    /// Mask for the `CompareValue` field.
2309    pub const COMPAREVALUE_MASK: u64 =
2310        0b1111111111111111111111111111111111111111111111111111111111111111;
2311
2312    /// Returns the value of the `CompareValue` field.
2313    pub const fn comparevalue(self) -> u64 {
2314        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2315            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2316    }
2317
2318    /// Sets the value of the `CompareValue` field.
2319    pub const fn set_comparevalue(&mut self, value: u64) {
2320        let offset = Self::COMPAREVALUE_SHIFT;
2321        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2322        *self = Self::from_bits_retain(
2323            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2324        );
2325    }
2326
2327    /// Returns a copy with the `CompareValue` field set to the given value.
2328    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2329        self.set_comparevalue(value);
2330        self
2331    }
2332}
2333
2334#[cfg(feature = "el1")]
2335bitflags! {
2336    /// `CNTPS_TVAL_EL1` system register value.
2337    ///
2338    /// Counter-timer Physical Secure Timer TimerValue Register
2339    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2340    #[repr(transparent)]
2341    pub struct CntpsTvalEl1: u64 {
2342    }
2343}
2344
2345#[cfg(feature = "el1")]
2346impl CntpsTvalEl1 {
2347    /// Offset of the `TimerValue` field.
2348    pub const TIMERVALUE_SHIFT: u32 = 0;
2349    /// Mask for the `TimerValue` field.
2350    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
2351
2352    /// Returns the value of the `TimerValue` field.
2353    pub const fn timervalue(self) -> u32 {
2354        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2355    }
2356
2357    /// Sets the value of the `TimerValue` field.
2358    pub const fn set_timervalue(&mut self, value: u32) {
2359        let offset = Self::TIMERVALUE_SHIFT;
2360        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2361        *self = Self::from_bits_retain(
2362            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
2363        );
2364    }
2365
2366    /// Returns a copy with the `TimerValue` field set to the given value.
2367    pub const fn with_timervalue(mut self, value: u32) -> Self {
2368        self.set_timervalue(value);
2369        self
2370    }
2371}
2372
2373bitflags! {
2374    /// `CNTP_CTL` system register value.
2375    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2376    #[repr(transparent)]
2377    pub struct CntpCtl: u32 {
2378        /// `ENABLE` bit.
2379        const ENABLE = 1 << 0;
2380        /// `IMASK` bit.
2381        const IMASK = 1 << 1;
2382        /// `ISTATUS` bit.
2383        const ISTATUS = 1 << 2;
2384    }
2385}
2386
2387impl CntpCtl {
2388    /// Offset of the `ENABLE` field.
2389    pub const ENABLE_SHIFT: u32 = 0;
2390    /// Offset of the `IMASK` field.
2391    pub const IMASK_SHIFT: u32 = 1;
2392    /// Offset of the `ISTATUS` field.
2393    pub const ISTATUS_SHIFT: u32 = 2;
2394}
2395
2396bitflags! {
2397    /// `CNTP_CTL_EL0` system register value.
2398    ///
2399    /// Counter-timer Physical Timer Control Register
2400    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2401    #[repr(transparent)]
2402    pub struct CntpCtlEl0: u64 {
2403        /// `ENABLE` bit.
2404        const ENABLE = 1 << 0;
2405        /// `IMASK` bit.
2406        const IMASK = 1 << 1;
2407        /// `ISTATUS` bit.
2408        const ISTATUS = 1 << 2;
2409    }
2410}
2411
2412impl CntpCtlEl0 {
2413    /// Offset of the `ENABLE` field.
2414    pub const ENABLE_SHIFT: u32 = 0;
2415    /// Offset of the `IMASK` field.
2416    pub const IMASK_SHIFT: u32 = 1;
2417    /// Offset of the `ISTATUS` field.
2418    pub const ISTATUS_SHIFT: u32 = 2;
2419}
2420
2421bitflags! {
2422    /// `CNTP_CVAL` system register value.
2423    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2424    #[repr(transparent)]
2425    pub struct CntpCval: u64 {
2426    }
2427}
2428
2429impl CntpCval {
2430    /// Offset of the `CompareValue` field.
2431    pub const COMPAREVALUE_SHIFT: u32 = 0;
2432    /// Mask for the `CompareValue` field.
2433    pub const COMPAREVALUE_MASK: u64 =
2434        0b1111111111111111111111111111111111111111111111111111111111111111;
2435
2436    /// Returns the value of the `CompareValue` field.
2437    pub const fn comparevalue(self) -> u64 {
2438        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2439            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2440    }
2441
2442    /// Sets the value of the `CompareValue` field.
2443    pub const fn set_comparevalue(&mut self, value: u64) {
2444        let offset = Self::COMPAREVALUE_SHIFT;
2445        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2446        *self = Self::from_bits_retain(
2447            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2448        );
2449    }
2450
2451    /// Returns a copy with the `CompareValue` field set to the given value.
2452    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2453        self.set_comparevalue(value);
2454        self
2455    }
2456}
2457
2458bitflags! {
2459    /// `CNTP_CVAL_EL0` system register value.
2460    ///
2461    /// Counter-timer Physical Timer CompareValue Register
2462    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2463    #[repr(transparent)]
2464    pub struct CntpCvalEl0: u64 {
2465    }
2466}
2467
2468impl CntpCvalEl0 {
2469    /// Offset of the `CompareValue` field.
2470    pub const COMPAREVALUE_SHIFT: u32 = 0;
2471    /// Mask for the `CompareValue` field.
2472    pub const COMPAREVALUE_MASK: u64 =
2473        0b1111111111111111111111111111111111111111111111111111111111111111;
2474
2475    /// Returns the value of the `CompareValue` field.
2476    pub const fn comparevalue(self) -> u64 {
2477        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2478            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2479    }
2480
2481    /// Sets the value of the `CompareValue` field.
2482    pub const fn set_comparevalue(&mut self, value: u64) {
2483        let offset = Self::COMPAREVALUE_SHIFT;
2484        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2485        *self = Self::from_bits_retain(
2486            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2487        );
2488    }
2489
2490    /// Returns a copy with the `CompareValue` field set to the given value.
2491    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2492        self.set_comparevalue(value);
2493        self
2494    }
2495}
2496
2497bitflags! {
2498    /// `CNTP_TVAL` system register value.
2499    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2500    #[repr(transparent)]
2501    pub struct CntpTval: u32 {
2502    }
2503}
2504
2505impl CntpTval {
2506    /// Offset of the `TimerValue` field.
2507    pub const TIMERVALUE_SHIFT: u32 = 0;
2508    /// Mask for the `TimerValue` field.
2509    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
2510
2511    /// Returns the value of the `TimerValue` field.
2512    pub const fn timervalue(self) -> u32 {
2513        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2514    }
2515
2516    /// Sets the value of the `TimerValue` field.
2517    pub const fn set_timervalue(&mut self, value: u32) {
2518        let offset = Self::TIMERVALUE_SHIFT;
2519        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2520        *self = Self::from_bits_retain(
2521            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
2522        );
2523    }
2524
2525    /// Returns a copy with the `TimerValue` field set to the given value.
2526    pub const fn with_timervalue(mut self, value: u32) -> Self {
2527        self.set_timervalue(value);
2528        self
2529    }
2530}
2531
2532bitflags! {
2533    /// `CNTP_TVAL_EL0` system register value.
2534    ///
2535    /// Counter-timer Physical Timer TimerValue Register
2536    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2537    #[repr(transparent)]
2538    pub struct CntpTvalEl0: u64 {
2539    }
2540}
2541
2542impl CntpTvalEl0 {
2543    /// Offset of the `TimerValue` field.
2544    pub const TIMERVALUE_SHIFT: u32 = 0;
2545    /// Mask for the `TimerValue` field.
2546    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
2547
2548    /// Returns the value of the `TimerValue` field.
2549    pub const fn timervalue(self) -> u32 {
2550        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2551    }
2552
2553    /// Sets the value of the `TimerValue` field.
2554    pub const fn set_timervalue(&mut self, value: u32) {
2555        let offset = Self::TIMERVALUE_SHIFT;
2556        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2557        *self = Self::from_bits_retain(
2558            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
2559        );
2560    }
2561
2562    /// Returns a copy with the `TimerValue` field set to the given value.
2563    pub const fn with_timervalue(mut self, value: u32) -> Self {
2564        self.set_timervalue(value);
2565        self
2566    }
2567}
2568
2569bitflags! {
2570    /// `CNTVCT` system register value.
2571    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2572    #[repr(transparent)]
2573    pub struct Cntvct: u64 {
2574    }
2575}
2576
2577impl Cntvct {
2578    /// Offset of the `VirtualCount` field.
2579    pub const VIRTUALCOUNT_SHIFT: u32 = 0;
2580    /// Mask for the `VirtualCount` field.
2581    pub const VIRTUALCOUNT_MASK: u64 =
2582        0b1111111111111111111111111111111111111111111111111111111111111111;
2583
2584    /// Returns the value of the `VirtualCount` field.
2585    pub const fn virtualcount(self) -> u64 {
2586        ((self.bits() >> Self::VIRTUALCOUNT_SHIFT)
2587            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2588    }
2589
2590    /// Sets the value of the `VirtualCount` field.
2591    pub const fn set_virtualcount(&mut self, value: u64) {
2592        let offset = Self::VIRTUALCOUNT_SHIFT;
2593        assert!(value & (Self::VIRTUALCOUNT_MASK as u64) == value);
2594        *self = Self::from_bits_retain(
2595            (self.bits() & !(Self::VIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
2596        );
2597    }
2598
2599    /// Returns a copy with the `VirtualCount` field set to the given value.
2600    pub const fn with_virtualcount(mut self, value: u64) -> Self {
2601        self.set_virtualcount(value);
2602        self
2603    }
2604}
2605
2606bitflags! {
2607    /// `CNTVCTSS` system register value.
2608    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2609    #[repr(transparent)]
2610    pub struct Cntvctss: u64 {
2611    }
2612}
2613
2614impl Cntvctss {
2615    /// Offset of the `SSVirtualCount` field.
2616    pub const SSVIRTUALCOUNT_SHIFT: u32 = 0;
2617    /// Mask for the `SSVirtualCount` field.
2618    pub const SSVIRTUALCOUNT_MASK: u64 =
2619        0b1111111111111111111111111111111111111111111111111111111111111111;
2620
2621    /// Returns the value of the `SSVirtualCount` field.
2622    pub const fn ssvirtualcount(self) -> u64 {
2623        ((self.bits() >> Self::SSVIRTUALCOUNT_SHIFT)
2624            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2625    }
2626
2627    /// Sets the value of the `SSVirtualCount` field.
2628    pub const fn set_ssvirtualcount(&mut self, value: u64) {
2629        let offset = Self::SSVIRTUALCOUNT_SHIFT;
2630        assert!(value & (Self::SSVIRTUALCOUNT_MASK as u64) == value);
2631        *self = Self::from_bits_retain(
2632            (self.bits() & !(Self::SSVIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
2633        );
2634    }
2635
2636    /// Returns a copy with the `SSVirtualCount` field set to the given value.
2637    pub const fn with_ssvirtualcount(mut self, value: u64) -> Self {
2638        self.set_ssvirtualcount(value);
2639        self
2640    }
2641}
2642
2643bitflags! {
2644    /// `CNTVCTSS_EL0` system register value.
2645    ///
2646    /// Counter-timer Self-Synchronized Virtual Count Register
2647    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2648    #[repr(transparent)]
2649    pub struct CntvctssEl0: u64 {
2650    }
2651}
2652
2653impl CntvctssEl0 {
2654    /// Offset of the `SSVirtualCount` field.
2655    pub const SSVIRTUALCOUNT_SHIFT: u32 = 0;
2656    /// Mask for the `SSVirtualCount` field.
2657    pub const SSVIRTUALCOUNT_MASK: u64 =
2658        0b1111111111111111111111111111111111111111111111111111111111111111;
2659
2660    /// Returns the value of the `SSVirtualCount` field.
2661    pub const fn ssvirtualcount(self) -> u64 {
2662        ((self.bits() >> Self::SSVIRTUALCOUNT_SHIFT)
2663            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2664    }
2665
2666    /// Sets the value of the `SSVirtualCount` field.
2667    pub const fn set_ssvirtualcount(&mut self, value: u64) {
2668        let offset = Self::SSVIRTUALCOUNT_SHIFT;
2669        assert!(value & (Self::SSVIRTUALCOUNT_MASK as u64) == value);
2670        *self = Self::from_bits_retain(
2671            (self.bits() & !(Self::SSVIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
2672        );
2673    }
2674
2675    /// Returns a copy with the `SSVirtualCount` field set to the given value.
2676    pub const fn with_ssvirtualcount(mut self, value: u64) -> Self {
2677        self.set_ssvirtualcount(value);
2678        self
2679    }
2680}
2681
2682bitflags! {
2683    /// `CNTVCT_EL0` system register value.
2684    ///
2685    /// Counter-timer Virtual Count Register
2686    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2687    #[repr(transparent)]
2688    pub struct CntvctEl0: u64 {
2689    }
2690}
2691
2692impl CntvctEl0 {
2693    /// Offset of the `VirtualCount` field.
2694    pub const VIRTUALCOUNT_SHIFT: u32 = 0;
2695    /// Mask for the `VirtualCount` field.
2696    pub const VIRTUALCOUNT_MASK: u64 =
2697        0b1111111111111111111111111111111111111111111111111111111111111111;
2698
2699    /// Returns the value of the `VirtualCount` field.
2700    pub const fn virtualcount(self) -> u64 {
2701        ((self.bits() >> Self::VIRTUALCOUNT_SHIFT)
2702            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2703    }
2704
2705    /// Sets the value of the `VirtualCount` field.
2706    pub const fn set_virtualcount(&mut self, value: u64) {
2707        let offset = Self::VIRTUALCOUNT_SHIFT;
2708        assert!(value & (Self::VIRTUALCOUNT_MASK as u64) == value);
2709        *self = Self::from_bits_retain(
2710            (self.bits() & !(Self::VIRTUALCOUNT_MASK << offset)) | ((value as u64) << offset),
2711        );
2712    }
2713
2714    /// Returns a copy with the `VirtualCount` field set to the given value.
2715    pub const fn with_virtualcount(mut self, value: u64) -> Self {
2716        self.set_virtualcount(value);
2717        self
2718    }
2719}
2720
2721bitflags! {
2722    /// `CNTVOFF` system register value.
2723    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2724    #[repr(transparent)]
2725    pub struct Cntvoff: u64 {
2726    }
2727}
2728
2729impl Cntvoff {
2730    /// Offset of the `VOffset` field.
2731    pub const VOFFSET_SHIFT: u32 = 0;
2732    /// Mask for the `VOffset` field.
2733    pub const VOFFSET_MASK: u64 =
2734        0b1111111111111111111111111111111111111111111111111111111111111111;
2735
2736    /// Returns the value of the `VOffset` field.
2737    pub const fn voffset(self) -> u64 {
2738        ((self.bits() >> Self::VOFFSET_SHIFT)
2739            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2740    }
2741
2742    /// Sets the value of the `VOffset` field.
2743    pub const fn set_voffset(&mut self, value: u64) {
2744        let offset = Self::VOFFSET_SHIFT;
2745        assert!(value & (Self::VOFFSET_MASK as u64) == value);
2746        *self = Self::from_bits_retain(
2747            (self.bits() & !(Self::VOFFSET_MASK << offset)) | ((value as u64) << offset),
2748        );
2749    }
2750
2751    /// Returns a copy with the `VOffset` field set to the given value.
2752    pub const fn with_voffset(mut self, value: u64) -> Self {
2753        self.set_voffset(value);
2754        self
2755    }
2756}
2757
2758#[cfg(feature = "el2")]
2759bitflags! {
2760    /// `CNTVOFF_EL2` system register value.
2761    ///
2762    /// Counter-timer Virtual Offset Register
2763    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2764    #[repr(transparent)]
2765    pub struct CntvoffEl2: u64 {
2766    }
2767}
2768
2769#[cfg(feature = "el2")]
2770impl CntvoffEl2 {
2771    /// Offset of the `VOffset` field.
2772    pub const VOFFSET_SHIFT: u32 = 0;
2773    /// Mask for the `VOffset` field.
2774    pub const VOFFSET_MASK: u64 =
2775        0b1111111111111111111111111111111111111111111111111111111111111111;
2776
2777    /// Returns the value of the `VOffset` field.
2778    pub const fn voffset(self) -> u64 {
2779        ((self.bits() >> Self::VOFFSET_SHIFT)
2780            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2781    }
2782
2783    /// Sets the value of the `VOffset` field.
2784    pub const fn set_voffset(&mut self, value: u64) {
2785        let offset = Self::VOFFSET_SHIFT;
2786        assert!(value & (Self::VOFFSET_MASK as u64) == value);
2787        *self = Self::from_bits_retain(
2788            (self.bits() & !(Self::VOFFSET_MASK << offset)) | ((value as u64) << offset),
2789        );
2790    }
2791
2792    /// Returns a copy with the `VOffset` field set to the given value.
2793    pub const fn with_voffset(mut self, value: u64) -> Self {
2794        self.set_voffset(value);
2795        self
2796    }
2797}
2798
2799bitflags! {
2800    /// `CNTV_CTL` system register value.
2801    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2802    #[repr(transparent)]
2803    pub struct CntvCtl: u32 {
2804        /// `ENABLE` bit.
2805        const ENABLE = 1 << 0;
2806        /// `IMASK` bit.
2807        const IMASK = 1 << 1;
2808        /// `ISTATUS` bit.
2809        const ISTATUS = 1 << 2;
2810    }
2811}
2812
2813impl CntvCtl {
2814    /// Offset of the `ENABLE` field.
2815    pub const ENABLE_SHIFT: u32 = 0;
2816    /// Offset of the `IMASK` field.
2817    pub const IMASK_SHIFT: u32 = 1;
2818    /// Offset of the `ISTATUS` field.
2819    pub const ISTATUS_SHIFT: u32 = 2;
2820}
2821
2822bitflags! {
2823    /// `CNTV_CTL_EL0` system register value.
2824    ///
2825    /// Counter-timer Virtual Timer Control Register
2826    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2827    #[repr(transparent)]
2828    pub struct CntvCtlEl0: u64 {
2829        /// `ENABLE` bit.
2830        const ENABLE = 1 << 0;
2831        /// `IMASK` bit.
2832        const IMASK = 1 << 1;
2833        /// `ISTATUS` bit.
2834        const ISTATUS = 1 << 2;
2835    }
2836}
2837
2838impl CntvCtlEl0 {
2839    /// Offset of the `ENABLE` field.
2840    pub const ENABLE_SHIFT: u32 = 0;
2841    /// Offset of the `IMASK` field.
2842    pub const IMASK_SHIFT: u32 = 1;
2843    /// Offset of the `ISTATUS` field.
2844    pub const ISTATUS_SHIFT: u32 = 2;
2845}
2846
2847bitflags! {
2848    /// `CNTV_CVAL` system register value.
2849    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2850    #[repr(transparent)]
2851    pub struct CntvCval: u64 {
2852    }
2853}
2854
2855impl CntvCval {
2856    /// Offset of the `CompareValue` field.
2857    pub const COMPAREVALUE_SHIFT: u32 = 0;
2858    /// Mask for the `CompareValue` field.
2859    pub const COMPAREVALUE_MASK: u64 =
2860        0b1111111111111111111111111111111111111111111111111111111111111111;
2861
2862    /// Returns the value of the `CompareValue` field.
2863    pub const fn comparevalue(self) -> u64 {
2864        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2865            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2866    }
2867
2868    /// Sets the value of the `CompareValue` field.
2869    pub const fn set_comparevalue(&mut self, value: u64) {
2870        let offset = Self::COMPAREVALUE_SHIFT;
2871        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2872        *self = Self::from_bits_retain(
2873            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2874        );
2875    }
2876
2877    /// Returns a copy with the `CompareValue` field set to the given value.
2878    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2879        self.set_comparevalue(value);
2880        self
2881    }
2882}
2883
2884bitflags! {
2885    /// `CNTV_CVAL_EL0` system register value.
2886    ///
2887    /// Counter-timer Virtual Timer CompareValue Register
2888    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2889    #[repr(transparent)]
2890    pub struct CntvCvalEl0: u64 {
2891    }
2892}
2893
2894impl CntvCvalEl0 {
2895    /// Offset of the `CompareValue` field.
2896    pub const COMPAREVALUE_SHIFT: u32 = 0;
2897    /// Mask for the `CompareValue` field.
2898    pub const COMPAREVALUE_MASK: u64 =
2899        0b1111111111111111111111111111111111111111111111111111111111111111;
2900
2901    /// Returns the value of the `CompareValue` field.
2902    pub const fn comparevalue(self) -> u64 {
2903        ((self.bits() >> Self::COMPAREVALUE_SHIFT)
2904            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
2905    }
2906
2907    /// Sets the value of the `CompareValue` field.
2908    pub const fn set_comparevalue(&mut self, value: u64) {
2909        let offset = Self::COMPAREVALUE_SHIFT;
2910        assert!(value & (Self::COMPAREVALUE_MASK as u64) == value);
2911        *self = Self::from_bits_retain(
2912            (self.bits() & !(Self::COMPAREVALUE_MASK << offset)) | ((value as u64) << offset),
2913        );
2914    }
2915
2916    /// Returns a copy with the `CompareValue` field set to the given value.
2917    pub const fn with_comparevalue(mut self, value: u64) -> Self {
2918        self.set_comparevalue(value);
2919        self
2920    }
2921}
2922
2923bitflags! {
2924    /// `CNTV_TVAL` system register value.
2925    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2926    #[repr(transparent)]
2927    pub struct CntvTval: u32 {
2928    }
2929}
2930
2931impl CntvTval {
2932    /// Offset of the `TimerValue` field.
2933    pub const TIMERVALUE_SHIFT: u32 = 0;
2934    /// Mask for the `TimerValue` field.
2935    pub const TIMERVALUE_MASK: u32 = 0b11111111111111111111111111111111;
2936
2937    /// Returns the value of the `TimerValue` field.
2938    pub const fn timervalue(self) -> u32 {
2939        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2940    }
2941
2942    /// Sets the value of the `TimerValue` field.
2943    pub const fn set_timervalue(&mut self, value: u32) {
2944        let offset = Self::TIMERVALUE_SHIFT;
2945        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2946        *self = Self::from_bits_retain(
2947            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u32) << offset),
2948        );
2949    }
2950
2951    /// Returns a copy with the `TimerValue` field set to the given value.
2952    pub const fn with_timervalue(mut self, value: u32) -> Self {
2953        self.set_timervalue(value);
2954        self
2955    }
2956}
2957
2958bitflags! {
2959    /// `CNTV_TVAL_EL0` system register value.
2960    ///
2961    /// Counter-timer Virtual Timer TimerValue Register
2962    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2963    #[repr(transparent)]
2964    pub struct CntvTvalEl0: u64 {
2965    }
2966}
2967
2968impl CntvTvalEl0 {
2969    /// Offset of the `TimerValue` field.
2970    pub const TIMERVALUE_SHIFT: u32 = 0;
2971    /// Mask for the `TimerValue` field.
2972    pub const TIMERVALUE_MASK: u64 = 0b11111111111111111111111111111111;
2973
2974    /// Returns the value of the `TimerValue` field.
2975    pub const fn timervalue(self) -> u32 {
2976        ((self.bits() >> Self::TIMERVALUE_SHIFT) & 0b11111111111111111111111111111111) as u32
2977    }
2978
2979    /// Sets the value of the `TimerValue` field.
2980    pub const fn set_timervalue(&mut self, value: u32) {
2981        let offset = Self::TIMERVALUE_SHIFT;
2982        assert!(value & (Self::TIMERVALUE_MASK as u32) == value);
2983        *self = Self::from_bits_retain(
2984            (self.bits() & !(Self::TIMERVALUE_MASK << offset)) | ((value as u64) << offset),
2985        );
2986    }
2987
2988    /// Returns a copy with the `TimerValue` field set to the given value.
2989    pub const fn with_timervalue(mut self, value: u32) -> Self {
2990        self.set_timervalue(value);
2991        self
2992    }
2993}
2994
2995bitflags! {
2996    /// `CONTEXTIDR` system register value.
2997    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
2998    #[repr(transparent)]
2999    pub struct Contextidr: u32 {
3000    }
3001}
3002
3003impl Contextidr {
3004    /// Offset of the `ASID` field.
3005    pub const ASID_SHIFT: u32 = 0;
3006    /// Mask for the `ASID` field.
3007    pub const ASID_MASK: u32 = 0b11111111;
3008
3009    /// Returns the value of the `ASID` field.
3010    pub const fn asid(self) -> u8 {
3011        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
3012    }
3013
3014    /// Sets the value of the `ASID` field.
3015    pub const fn set_asid(&mut self, value: u8) {
3016        let offset = Self::ASID_SHIFT;
3017        assert!(value & (Self::ASID_MASK as u8) == value);
3018        *self = Self::from_bits_retain(
3019            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u32) << offset),
3020        );
3021    }
3022
3023    /// Returns a copy with the `ASID` field set to the given value.
3024    pub const fn with_asid(mut self, value: u8) -> Self {
3025        self.set_asid(value);
3026        self
3027    }
3028}
3029
3030#[cfg(feature = "el1")]
3031bitflags! {
3032    /// `CONTEXTIDR_EL1` system register value.
3033    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3034    #[repr(transparent)]
3035    pub struct ContextidrEl1: u64 {
3036    }
3037}
3038
3039#[cfg(feature = "el1")]
3040impl ContextidrEl1 {
3041    /// Offset of the `PROCID` field.
3042    pub const PROCID_SHIFT: u32 = 0;
3043    /// Mask for the `PROCID` field.
3044    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
3045
3046    /// Returns the value of the `PROCID` field.
3047    pub const fn procid(self) -> u32 {
3048        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
3049    }
3050
3051    /// Sets the value of the `PROCID` field.
3052    pub const fn set_procid(&mut self, value: u32) {
3053        let offset = Self::PROCID_SHIFT;
3054        assert!(value & (Self::PROCID_MASK as u32) == value);
3055        *self = Self::from_bits_retain(
3056            (self.bits() & !(Self::PROCID_MASK << offset)) | ((value as u64) << offset),
3057        );
3058    }
3059
3060    /// Returns a copy with the `PROCID` field set to the given value.
3061    pub const fn with_procid(mut self, value: u32) -> Self {
3062        self.set_procid(value);
3063        self
3064    }
3065}
3066
3067#[cfg(feature = "el2")]
3068bitflags! {
3069    /// `CONTEXTIDR_EL2` system register value.
3070    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3071    #[repr(transparent)]
3072    pub struct ContextidrEl2: u64 {
3073    }
3074}
3075
3076#[cfg(feature = "el2")]
3077impl ContextidrEl2 {
3078    /// Offset of the `PROCID` field.
3079    pub const PROCID_SHIFT: u32 = 0;
3080    /// Mask for the `PROCID` field.
3081    pub const PROCID_MASK: u64 = 0b11111111111111111111111111111111;
3082
3083    /// Returns the value of the `PROCID` field.
3084    pub const fn procid(self) -> u32 {
3085        ((self.bits() >> Self::PROCID_SHIFT) & 0b11111111111111111111111111111111) as u32
3086    }
3087
3088    /// Sets the value of the `PROCID` field.
3089    pub const fn set_procid(&mut self, value: u32) {
3090        let offset = Self::PROCID_SHIFT;
3091        assert!(value & (Self::PROCID_MASK as u32) == value);
3092        *self = Self::from_bits_retain(
3093            (self.bits() & !(Self::PROCID_MASK << offset)) | ((value as u64) << offset),
3094        );
3095    }
3096
3097    /// Returns a copy with the `PROCID` field set to the given value.
3098    pub const fn with_procid(mut self, value: u32) -> Self {
3099        self.set_procid(value);
3100        self
3101    }
3102}
3103
3104bitflags! {
3105    /// `CPACR` system register value.
3106    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3107    #[repr(transparent)]
3108    pub struct Cpacr: u32 {
3109        /// `TRCDIS` bit.
3110        const TRCDIS = 1 << 28;
3111        /// `ASEDIS` bit.
3112        const ASEDIS = 1 << 31;
3113    }
3114}
3115
3116impl Cpacr {
3117    /// Offset of the `cp10` field.
3118    pub const CP10_SHIFT: u32 = 20;
3119    /// Mask for the `cp10` field.
3120    pub const CP10_MASK: u32 = 0b11;
3121    /// Offset of the `cp11` field.
3122    pub const CP11_SHIFT: u32 = 22;
3123    /// Mask for the `cp11` field.
3124    pub const CP11_MASK: u32 = 0b11;
3125    /// Offset of the `TRCDIS` field.
3126    pub const TRCDIS_SHIFT: u32 = 28;
3127    /// Offset of the `ASEDIS` field.
3128    pub const ASEDIS_SHIFT: u32 = 31;
3129
3130    /// Returns the value of the `cp10` field.
3131    pub const fn cp10(self) -> u8 {
3132        ((self.bits() >> Self::CP10_SHIFT) & 0b11) as u8
3133    }
3134
3135    /// Sets the value of the `cp10` field.
3136    pub const fn set_cp10(&mut self, value: u8) {
3137        let offset = Self::CP10_SHIFT;
3138        assert!(value & (Self::CP10_MASK as u8) == value);
3139        *self = Self::from_bits_retain(
3140            (self.bits() & !(Self::CP10_MASK << offset)) | ((value as u32) << offset),
3141        );
3142    }
3143
3144    /// Returns a copy with the `cp10` field set to the given value.
3145    pub const fn with_cp10(mut self, value: u8) -> Self {
3146        self.set_cp10(value);
3147        self
3148    }
3149
3150    /// Returns the value of the `cp11` field.
3151    pub const fn cp11(self) -> u8 {
3152        ((self.bits() >> Self::CP11_SHIFT) & 0b11) as u8
3153    }
3154
3155    /// Sets the value of the `cp11` field.
3156    pub const fn set_cp11(&mut self, value: u8) {
3157        let offset = Self::CP11_SHIFT;
3158        assert!(value & (Self::CP11_MASK as u8) == value);
3159        *self = Self::from_bits_retain(
3160            (self.bits() & !(Self::CP11_MASK << offset)) | ((value as u32) << offset),
3161        );
3162    }
3163
3164    /// Returns a copy with the `cp11` field set to the given value.
3165    pub const fn with_cp11(mut self, value: u8) -> Self {
3166        self.set_cp11(value);
3167        self
3168    }
3169}
3170
3171#[cfg(feature = "el1")]
3172bitflags! {
3173    /// `CPACR_EL1` system register value.
3174    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3175    #[repr(transparent)]
3176    pub struct CpacrEl1: u64 {
3177        /// `TTA` bit.
3178        const TTA = 1 << 28;
3179        /// `E0POE` bit.
3180        const E0POE = 1 << 29;
3181        /// `TAM` bit.
3182        const TAM = 1 << 30;
3183        /// `TCPAC` bit.
3184        const TCPAC = 1 << 31;
3185        /// `E0TP0E` bit.
3186        const E0TP0E = 1 << 32;
3187        /// `E0TP1E` bit.
3188        const E0TP1E = 1 << 33;
3189    }
3190}
3191
3192#[cfg(feature = "el1")]
3193impl CpacrEl1 {
3194    /// Offset of the `ZEN` field.
3195    pub const ZEN_SHIFT: u32 = 16;
3196    /// Mask for the `ZEN` field.
3197    pub const ZEN_MASK: u64 = 0b11;
3198    /// Offset of the `FPEN` field.
3199    pub const FPEN_SHIFT: u32 = 20;
3200    /// Mask for the `FPEN` field.
3201    pub const FPEN_MASK: u64 = 0b11;
3202    /// Offset of the `SMEN` field.
3203    pub const SMEN_SHIFT: u32 = 24;
3204    /// Mask for the `SMEN` field.
3205    pub const SMEN_MASK: u64 = 0b11;
3206    /// Offset of the `TTA` field.
3207    pub const TTA_SHIFT: u32 = 28;
3208    /// Offset of the `E0POE` field.
3209    pub const E0POE_SHIFT: u32 = 29;
3210    /// Offset of the `TAM` field.
3211    pub const TAM_SHIFT: u32 = 30;
3212    /// Offset of the `TCPAC` field.
3213    pub const TCPAC_SHIFT: u32 = 31;
3214    /// Offset of the `E0TP0E` field.
3215    pub const E0TP0E_SHIFT: u32 = 32;
3216    /// Offset of the `E0TP1E` field.
3217    pub const E0TP1E_SHIFT: u32 = 33;
3218
3219    /// Returns the value of the `ZEN` field.
3220    pub const fn zen(self) -> u8 {
3221        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
3222    }
3223
3224    /// Sets the value of the `ZEN` field.
3225    pub const fn set_zen(&mut self, value: u8) {
3226        let offset = Self::ZEN_SHIFT;
3227        assert!(value & (Self::ZEN_MASK as u8) == value);
3228        *self = Self::from_bits_retain(
3229            (self.bits() & !(Self::ZEN_MASK << offset)) | ((value as u64) << offset),
3230        );
3231    }
3232
3233    /// Returns a copy with the `ZEN` field set to the given value.
3234    pub const fn with_zen(mut self, value: u8) -> Self {
3235        self.set_zen(value);
3236        self
3237    }
3238
3239    /// Returns the value of the `FPEN` field.
3240    pub const fn fpen(self) -> u8 {
3241        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
3242    }
3243
3244    /// Sets the value of the `FPEN` field.
3245    pub const fn set_fpen(&mut self, value: u8) {
3246        let offset = Self::FPEN_SHIFT;
3247        assert!(value & (Self::FPEN_MASK as u8) == value);
3248        *self = Self::from_bits_retain(
3249            (self.bits() & !(Self::FPEN_MASK << offset)) | ((value as u64) << offset),
3250        );
3251    }
3252
3253    /// Returns a copy with the `FPEN` field set to the given value.
3254    pub const fn with_fpen(mut self, value: u8) -> Self {
3255        self.set_fpen(value);
3256        self
3257    }
3258
3259    /// Returns the value of the `SMEN` field.
3260    pub const fn smen(self) -> u8 {
3261        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
3262    }
3263
3264    /// Sets the value of the `SMEN` field.
3265    pub const fn set_smen(&mut self, value: u8) {
3266        let offset = Self::SMEN_SHIFT;
3267        assert!(value & (Self::SMEN_MASK as u8) == value);
3268        *self = Self::from_bits_retain(
3269            (self.bits() & !(Self::SMEN_MASK << offset)) | ((value as u64) << offset),
3270        );
3271    }
3272
3273    /// Returns a copy with the `SMEN` field set to the given value.
3274    pub const fn with_smen(mut self, value: u8) -> Self {
3275        self.set_smen(value);
3276        self
3277    }
3278}
3279
3280#[cfg(feature = "el2")]
3281bitflags! {
3282    /// `CPTR_EL2` system register value.
3283    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3284    #[repr(transparent)]
3285    pub struct CptrEl2: u64 {
3286        /// RES1 bits in the `CPTR_EL2` register.
3287        const RES1 = 0b10001011111111;
3288        /// `TZ` bit.
3289        const TZ = 1 << 8;
3290        /// `TFP` bit.
3291        const TFP = 1 << 10;
3292        /// `TSM` bit.
3293        const TSM = 1 << 12;
3294        /// `E0POE` bit.
3295        const E0POE = 1 << 29;
3296        /// `TAM` bit.
3297        const TAM = 1 << 30;
3298        /// `TCPAC` bit.
3299        const TCPAC = 1 << 31;
3300        /// `E0TP0E` bit.
3301        const E0TP0E = 1 << 32;
3302        /// `E0TP1E` bit.
3303        const E0TP1E = 1 << 33;
3304    }
3305}
3306
3307#[cfg(feature = "el2")]
3308impl CptrEl2 {
3309    /// Offset of the `TZ` field.
3310    pub const TZ_SHIFT: u32 = 8;
3311    /// Offset of the `TFP` field.
3312    pub const TFP_SHIFT: u32 = 10;
3313    /// Offset of the `TSM` field.
3314    pub const TSM_SHIFT: u32 = 12;
3315    /// Offset of the `ZEN` field.
3316    pub const ZEN_SHIFT: u32 = 16;
3317    /// Mask for the `ZEN` field.
3318    pub const ZEN_MASK: u64 = 0b11;
3319    /// Offset of the `FPEN` field.
3320    pub const FPEN_SHIFT: u32 = 20;
3321    /// Mask for the `FPEN` field.
3322    pub const FPEN_MASK: u64 = 0b11;
3323    /// Offset of the `SMEN` field.
3324    pub const SMEN_SHIFT: u32 = 24;
3325    /// Mask for the `SMEN` field.
3326    pub const SMEN_MASK: u64 = 0b11;
3327    /// Offset of the `E0POE` field.
3328    pub const E0POE_SHIFT: u32 = 29;
3329    /// Offset of the `TAM` field.
3330    pub const TAM_SHIFT: u32 = 30;
3331    /// Offset of the `TCPAC` field.
3332    pub const TCPAC_SHIFT: u32 = 31;
3333    /// Offset of the `E0TP0E` field.
3334    pub const E0TP0E_SHIFT: u32 = 32;
3335    /// Offset of the `E0TP1E` field.
3336    pub const E0TP1E_SHIFT: u32 = 33;
3337
3338    /// Returns the value of the `ZEN` field.
3339    pub const fn zen(self) -> u8 {
3340        ((self.bits() >> Self::ZEN_SHIFT) & 0b11) as u8
3341    }
3342
3343    /// Sets the value of the `ZEN` field.
3344    pub const fn set_zen(&mut self, value: u8) {
3345        let offset = Self::ZEN_SHIFT;
3346        assert!(value & (Self::ZEN_MASK as u8) == value);
3347        *self = Self::from_bits_retain(
3348            (self.bits() & !(Self::ZEN_MASK << offset)) | ((value as u64) << offset),
3349        );
3350    }
3351
3352    /// Returns a copy with the `ZEN` field set to the given value.
3353    pub const fn with_zen(mut self, value: u8) -> Self {
3354        self.set_zen(value);
3355        self
3356    }
3357
3358    /// Returns the value of the `FPEN` field.
3359    pub const fn fpen(self) -> u8 {
3360        ((self.bits() >> Self::FPEN_SHIFT) & 0b11) as u8
3361    }
3362
3363    /// Sets the value of the `FPEN` field.
3364    pub const fn set_fpen(&mut self, value: u8) {
3365        let offset = Self::FPEN_SHIFT;
3366        assert!(value & (Self::FPEN_MASK as u8) == value);
3367        *self = Self::from_bits_retain(
3368            (self.bits() & !(Self::FPEN_MASK << offset)) | ((value as u64) << offset),
3369        );
3370    }
3371
3372    /// Returns a copy with the `FPEN` field set to the given value.
3373    pub const fn with_fpen(mut self, value: u8) -> Self {
3374        self.set_fpen(value);
3375        self
3376    }
3377
3378    /// Returns the value of the `SMEN` field.
3379    pub const fn smen(self) -> u8 {
3380        ((self.bits() >> Self::SMEN_SHIFT) & 0b11) as u8
3381    }
3382
3383    /// Sets the value of the `SMEN` field.
3384    pub const fn set_smen(&mut self, value: u8) {
3385        let offset = Self::SMEN_SHIFT;
3386        assert!(value & (Self::SMEN_MASK as u8) == value);
3387        *self = Self::from_bits_retain(
3388            (self.bits() & !(Self::SMEN_MASK << offset)) | ((value as u64) << offset),
3389        );
3390    }
3391
3392    /// Returns a copy with the `SMEN` field set to the given value.
3393    pub const fn with_smen(mut self, value: u8) -> Self {
3394        self.set_smen(value);
3395        self
3396    }
3397}
3398
3399#[cfg(feature = "el3")]
3400bitflags! {
3401    /// `CPTR_EL3` system register value.
3402    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3403    #[repr(transparent)]
3404    pub struct CptrEl3: u64 {
3405        /// Do not trap execution of SVE instructions.
3406        const EZ = 1 << 8;
3407        /// Trap Advanced SIMD instructions execution.
3408        const TFP = 1 << 10;
3409        /// When FEAT_SME is implemented, do not trap SME instructions and system registers accesses.
3410        const ESM = 1 << 12;
3411        /// Trap trace system register accesses.
3412        const TTA = 1 << 20;
3413        /// When FEAT_AMUv1 implemented trap accesses from EL2/EL1/EL0 to AMU registers.
3414        const TAM = 1 << 30;
3415        /// Trap EL2 accesses to CPTR_EL2/HCPTR, and EL2/EL1 accesses to CPACR_EL1/CPACR.
3416        const TCPAC = 1 << 31;
3417    }
3418}
3419
3420#[cfg(feature = "el3")]
3421impl CptrEl3 {
3422    /// Offset of the `EZ` field.
3423    pub const EZ_SHIFT: u32 = 8;
3424    /// Offset of the `TFP` field.
3425    pub const TFP_SHIFT: u32 = 10;
3426    /// Offset of the `ESM` field.
3427    pub const ESM_SHIFT: u32 = 12;
3428    /// Offset of the `TTA` field.
3429    pub const TTA_SHIFT: u32 = 20;
3430    /// Offset of the `TAM` field.
3431    pub const TAM_SHIFT: u32 = 30;
3432    /// Offset of the `TCPAC` field.
3433    pub const TCPAC_SHIFT: u32 = 31;
3434}
3435
3436bitflags! {
3437    /// `CSSELR` system register value.
3438    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3439    #[repr(transparent)]
3440    pub struct Csselr: u32 {
3441        /// `InD` bit.
3442        const IND = 1 << 0;
3443    }
3444}
3445
3446impl Csselr {
3447    /// Offset of the `InD` field.
3448    pub const IND_SHIFT: u32 = 0;
3449    /// Offset of the `Level` field.
3450    pub const LEVEL_SHIFT: u32 = 1;
3451    /// Mask for the `Level` field.
3452    pub const LEVEL_MASK: u32 = 0b111;
3453
3454    /// Returns the value of the `Level` field.
3455    pub const fn level(self) -> u8 {
3456        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
3457    }
3458
3459    /// Sets the value of the `Level` field.
3460    pub const fn set_level(&mut self, value: u8) {
3461        let offset = Self::LEVEL_SHIFT;
3462        assert!(value & (Self::LEVEL_MASK as u8) == value);
3463        *self = Self::from_bits_retain(
3464            (self.bits() & !(Self::LEVEL_MASK << offset)) | ((value as u32) << offset),
3465        );
3466    }
3467
3468    /// Returns a copy with the `Level` field set to the given value.
3469    pub const fn with_level(mut self, value: u8) -> Self {
3470        self.set_level(value);
3471        self
3472    }
3473}
3474
3475#[cfg(feature = "el1")]
3476bitflags! {
3477    /// `CSSELR_EL1` system register value.
3478    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3479    #[repr(transparent)]
3480    pub struct CsselrEl1: u64 {
3481        /// Instruction not Data bit.
3482        const IND = 1 << 0;
3483        /// Allocation Tag not Data bit, only valid if FEAT_MTE2 is implemented.
3484        const TND = 1 << 4;
3485    }
3486}
3487
3488#[cfg(feature = "el1")]
3489impl CsselrEl1 {
3490    /// Offset of the `InD` field.
3491    pub const IND_SHIFT: u32 = 0;
3492    /// Offset of the `Level` field.
3493    pub const LEVEL_SHIFT: u32 = 1;
3494    /// Mask for the `Level` field.
3495    pub const LEVEL_MASK: u64 = 0b111;
3496    /// Offset of the `TnD` field.
3497    pub const TND_SHIFT: u32 = 4;
3498
3499    /// Returns the value of the `Level` field.
3500    pub const fn level(self) -> u8 {
3501        ((self.bits() >> Self::LEVEL_SHIFT) & 0b111) as u8
3502    }
3503
3504    /// Sets the value of the `Level` field.
3505    pub const fn set_level(&mut self, value: u8) {
3506        let offset = Self::LEVEL_SHIFT;
3507        assert!(value & (Self::LEVEL_MASK as u8) == value);
3508        *self = Self::from_bits_retain(
3509            (self.bits() & !(Self::LEVEL_MASK << offset)) | ((value as u64) << offset),
3510        );
3511    }
3512
3513    /// Returns a copy with the `Level` field set to the given value.
3514    pub const fn with_level(mut self, value: u8) -> Self {
3515        self.set_level(value);
3516        self
3517    }
3518}
3519
3520bitflags! {
3521    /// `CTR` system register value.
3522    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3523    #[repr(transparent)]
3524    pub struct Ctr: u32 {
3525        /// RES1 bits in the `CTR` register.
3526        const RES1 = 0b10000000000000000000000000000000;
3527        /// `IDC` bit.
3528        const IDC = 1 << 28;
3529        /// `DIC` bit.
3530        const DIC = 1 << 29;
3531    }
3532}
3533
3534impl Ctr {
3535    /// Offset of the `IminLine` field.
3536    pub const IMINLINE_SHIFT: u32 = 0;
3537    /// Mask for the `IminLine` field.
3538    pub const IMINLINE_MASK: u32 = 0b1111;
3539    /// Offset of the `L1Ip` field.
3540    pub const L1IP_SHIFT: u32 = 14;
3541    /// Mask for the `L1Ip` field.
3542    pub const L1IP_MASK: u32 = 0b11;
3543    /// Offset of the `DminLine` field.
3544    pub const DMINLINE_SHIFT: u32 = 16;
3545    /// Mask for the `DminLine` field.
3546    pub const DMINLINE_MASK: u32 = 0b1111;
3547    /// Offset of the `ERG` field.
3548    pub const ERG_SHIFT: u32 = 20;
3549    /// Mask for the `ERG` field.
3550    pub const ERG_MASK: u32 = 0b1111;
3551    /// Offset of the `CWG` field.
3552    pub const CWG_SHIFT: u32 = 24;
3553    /// Mask for the `CWG` field.
3554    pub const CWG_MASK: u32 = 0b1111;
3555    /// Offset of the `IDC` field.
3556    pub const IDC_SHIFT: u32 = 28;
3557    /// Offset of the `DIC` field.
3558    pub const DIC_SHIFT: u32 = 29;
3559
3560    /// Returns the value of the `IminLine` field.
3561    pub const fn iminline(self) -> u8 {
3562        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
3563    }
3564
3565    /// Sets the value of the `IminLine` field.
3566    pub const fn set_iminline(&mut self, value: u8) {
3567        let offset = Self::IMINLINE_SHIFT;
3568        assert!(value & (Self::IMINLINE_MASK as u8) == value);
3569        *self = Self::from_bits_retain(
3570            (self.bits() & !(Self::IMINLINE_MASK << offset)) | ((value as u32) << offset),
3571        );
3572    }
3573
3574    /// Returns a copy with the `IminLine` field set to the given value.
3575    pub const fn with_iminline(mut self, value: u8) -> Self {
3576        self.set_iminline(value);
3577        self
3578    }
3579
3580    /// Returns the value of the `L1Ip` field.
3581    pub const fn l1ip(self) -> u8 {
3582        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
3583    }
3584
3585    /// Sets the value of the `L1Ip` field.
3586    pub const fn set_l1ip(&mut self, value: u8) {
3587        let offset = Self::L1IP_SHIFT;
3588        assert!(value & (Self::L1IP_MASK as u8) == value);
3589        *self = Self::from_bits_retain(
3590            (self.bits() & !(Self::L1IP_MASK << offset)) | ((value as u32) << offset),
3591        );
3592    }
3593
3594    /// Returns a copy with the `L1Ip` field set to the given value.
3595    pub const fn with_l1ip(mut self, value: u8) -> Self {
3596        self.set_l1ip(value);
3597        self
3598    }
3599
3600    /// Returns the value of the `DminLine` field.
3601    pub const fn dminline(self) -> u8 {
3602        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
3603    }
3604
3605    /// Sets the value of the `DminLine` field.
3606    pub const fn set_dminline(&mut self, value: u8) {
3607        let offset = Self::DMINLINE_SHIFT;
3608        assert!(value & (Self::DMINLINE_MASK as u8) == value);
3609        *self = Self::from_bits_retain(
3610            (self.bits() & !(Self::DMINLINE_MASK << offset)) | ((value as u32) << offset),
3611        );
3612    }
3613
3614    /// Returns a copy with the `DminLine` field set to the given value.
3615    pub const fn with_dminline(mut self, value: u8) -> Self {
3616        self.set_dminline(value);
3617        self
3618    }
3619
3620    /// Returns the value of the `ERG` field.
3621    pub const fn erg(self) -> u8 {
3622        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
3623    }
3624
3625    /// Sets the value of the `ERG` field.
3626    pub const fn set_erg(&mut self, value: u8) {
3627        let offset = Self::ERG_SHIFT;
3628        assert!(value & (Self::ERG_MASK as u8) == value);
3629        *self = Self::from_bits_retain(
3630            (self.bits() & !(Self::ERG_MASK << offset)) | ((value as u32) << offset),
3631        );
3632    }
3633
3634    /// Returns a copy with the `ERG` field set to the given value.
3635    pub const fn with_erg(mut self, value: u8) -> Self {
3636        self.set_erg(value);
3637        self
3638    }
3639
3640    /// Returns the value of the `CWG` field.
3641    pub const fn cwg(self) -> u8 {
3642        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
3643    }
3644
3645    /// Sets the value of the `CWG` field.
3646    pub const fn set_cwg(&mut self, value: u8) {
3647        let offset = Self::CWG_SHIFT;
3648        assert!(value & (Self::CWG_MASK as u8) == value);
3649        *self = Self::from_bits_retain(
3650            (self.bits() & !(Self::CWG_MASK << offset)) | ((value as u32) << offset),
3651        );
3652    }
3653
3654    /// Returns a copy with the `CWG` field set to the given value.
3655    pub const fn with_cwg(mut self, value: u8) -> Self {
3656        self.set_cwg(value);
3657        self
3658    }
3659}
3660
3661bitflags! {
3662    /// `CTR_EL0` system register value.
3663    ///
3664    /// Cache Type Register.
3665    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3666    #[repr(transparent)]
3667    pub struct CtrEl0: u64 {
3668        /// RES1 bits in the `CTR_EL0` register.
3669        const RES1 = 0b10000000000000000000000000000000;
3670        /// `IDC` bit.
3671        const IDC = 1 << 28;
3672        /// `DIC` bit.
3673        const DIC = 1 << 29;
3674    }
3675}
3676
3677impl CtrEl0 {
3678    /// Offset of the `IminLine` field.
3679    pub const IMINLINE_SHIFT: u32 = 0;
3680    /// Mask for the `IminLine` field.
3681    pub const IMINLINE_MASK: u64 = 0b1111;
3682    /// Offset of the `L1Ip` field.
3683    pub const L1IP_SHIFT: u32 = 14;
3684    /// Mask for the `L1Ip` field.
3685    pub const L1IP_MASK: u64 = 0b11;
3686    /// Offset of the `DminLine` field.
3687    pub const DMINLINE_SHIFT: u32 = 16;
3688    /// Mask for the `DminLine` field.
3689    pub const DMINLINE_MASK: u64 = 0b1111;
3690    /// Offset of the `ERG` field.
3691    pub const ERG_SHIFT: u32 = 20;
3692    /// Mask for the `ERG` field.
3693    pub const ERG_MASK: u64 = 0b1111;
3694    /// Offset of the `CWG` field.
3695    pub const CWG_SHIFT: u32 = 24;
3696    /// Mask for the `CWG` field.
3697    pub const CWG_MASK: u64 = 0b1111;
3698    /// Offset of the `IDC` field.
3699    pub const IDC_SHIFT: u32 = 28;
3700    /// Offset of the `DIC` field.
3701    pub const DIC_SHIFT: u32 = 29;
3702    /// Offset of the `TminLine` field.
3703    pub const TMINLINE_SHIFT: u32 = 32;
3704    /// Mask for the `TminLine` field.
3705    pub const TMINLINE_MASK: u64 = 0b111111;
3706
3707    /// Returns the value of the `IminLine` field.
3708    pub const fn iminline(self) -> u8 {
3709        ((self.bits() >> Self::IMINLINE_SHIFT) & 0b1111) as u8
3710    }
3711
3712    /// Sets the value of the `IminLine` field.
3713    pub const fn set_iminline(&mut self, value: u8) {
3714        let offset = Self::IMINLINE_SHIFT;
3715        assert!(value & (Self::IMINLINE_MASK as u8) == value);
3716        *self = Self::from_bits_retain(
3717            (self.bits() & !(Self::IMINLINE_MASK << offset)) | ((value as u64) << offset),
3718        );
3719    }
3720
3721    /// Returns a copy with the `IminLine` field set to the given value.
3722    pub const fn with_iminline(mut self, value: u8) -> Self {
3723        self.set_iminline(value);
3724        self
3725    }
3726
3727    /// Returns the value of the `L1Ip` field.
3728    pub const fn l1ip(self) -> u8 {
3729        ((self.bits() >> Self::L1IP_SHIFT) & 0b11) as u8
3730    }
3731
3732    /// Sets the value of the `L1Ip` field.
3733    pub const fn set_l1ip(&mut self, value: u8) {
3734        let offset = Self::L1IP_SHIFT;
3735        assert!(value & (Self::L1IP_MASK as u8) == value);
3736        *self = Self::from_bits_retain(
3737            (self.bits() & !(Self::L1IP_MASK << offset)) | ((value as u64) << offset),
3738        );
3739    }
3740
3741    /// Returns a copy with the `L1Ip` field set to the given value.
3742    pub const fn with_l1ip(mut self, value: u8) -> Self {
3743        self.set_l1ip(value);
3744        self
3745    }
3746
3747    /// Returns the value of the `DminLine` field.
3748    ///
3749    /// 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.
3750    pub const fn dminline(self) -> u8 {
3751        ((self.bits() >> Self::DMINLINE_SHIFT) & 0b1111) as u8
3752    }
3753
3754    /// Sets the value of the `DminLine` field.
3755    ///
3756    /// 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.
3757    pub const fn set_dminline(&mut self, value: u8) {
3758        let offset = Self::DMINLINE_SHIFT;
3759        assert!(value & (Self::DMINLINE_MASK as u8) == value);
3760        *self = Self::from_bits_retain(
3761            (self.bits() & !(Self::DMINLINE_MASK << offset)) | ((value as u64) << offset),
3762        );
3763    }
3764
3765    /// Returns a copy with the `DminLine` field set to the given value.
3766    ///
3767    /// 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.
3768    pub const fn with_dminline(mut self, value: u8) -> Self {
3769        self.set_dminline(value);
3770        self
3771    }
3772
3773    /// Returns the value of the `ERG` field.
3774    pub const fn erg(self) -> u8 {
3775        ((self.bits() >> Self::ERG_SHIFT) & 0b1111) as u8
3776    }
3777
3778    /// Sets the value of the `ERG` field.
3779    pub const fn set_erg(&mut self, value: u8) {
3780        let offset = Self::ERG_SHIFT;
3781        assert!(value & (Self::ERG_MASK as u8) == value);
3782        *self = Self::from_bits_retain(
3783            (self.bits() & !(Self::ERG_MASK << offset)) | ((value as u64) << offset),
3784        );
3785    }
3786
3787    /// Returns a copy with the `ERG` field set to the given value.
3788    pub const fn with_erg(mut self, value: u8) -> Self {
3789        self.set_erg(value);
3790        self
3791    }
3792
3793    /// Returns the value of the `CWG` field.
3794    pub const fn cwg(self) -> u8 {
3795        ((self.bits() >> Self::CWG_SHIFT) & 0b1111) as u8
3796    }
3797
3798    /// Sets the value of the `CWG` field.
3799    pub const fn set_cwg(&mut self, value: u8) {
3800        let offset = Self::CWG_SHIFT;
3801        assert!(value & (Self::CWG_MASK as u8) == value);
3802        *self = Self::from_bits_retain(
3803            (self.bits() & !(Self::CWG_MASK << offset)) | ((value as u64) << offset),
3804        );
3805    }
3806
3807    /// Returns a copy with the `CWG` field set to the given value.
3808    pub const fn with_cwg(mut self, value: u8) -> Self {
3809        self.set_cwg(value);
3810        self
3811    }
3812
3813    /// Returns the value of the `TminLine` field.
3814    pub const fn tminline(self) -> u8 {
3815        ((self.bits() >> Self::TMINLINE_SHIFT) & 0b111111) as u8
3816    }
3817
3818    /// Sets the value of the `TminLine` field.
3819    pub const fn set_tminline(&mut self, value: u8) {
3820        let offset = Self::TMINLINE_SHIFT;
3821        assert!(value & (Self::TMINLINE_MASK as u8) == value);
3822        *self = Self::from_bits_retain(
3823            (self.bits() & !(Self::TMINLINE_MASK << offset)) | ((value as u64) << offset),
3824        );
3825    }
3826
3827    /// Returns a copy with the `TminLine` field set to the given value.
3828    pub const fn with_tminline(mut self, value: u8) -> Self {
3829        self.set_tminline(value);
3830        self
3831    }
3832}
3833
3834bitflags! {
3835    /// `CurrentEL` system register value.
3836    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3837    #[repr(transparent)]
3838    pub struct Currentel: u64 {
3839    }
3840}
3841
3842impl Currentel {
3843    /// Offset of the `EL` field.
3844    pub const EL_SHIFT: u32 = 2;
3845    /// Mask for the `EL` field.
3846    pub const EL_MASK: u64 = 0b11;
3847
3848    /// Returns the value of the `EL` field.
3849    pub const fn el(self) -> u8 {
3850        ((self.bits() >> Self::EL_SHIFT) & 0b11) as u8
3851    }
3852
3853    /// Sets the value of the `EL` field.
3854    pub const fn set_el(&mut self, value: u8) {
3855        let offset = Self::EL_SHIFT;
3856        assert!(value & (Self::EL_MASK as u8) == value);
3857        *self = Self::from_bits_retain(
3858            (self.bits() & !(Self::EL_MASK << offset)) | ((value as u64) << offset),
3859        );
3860    }
3861
3862    /// Returns a copy with the `EL` field set to the given value.
3863    pub const fn with_el(mut self, value: u8) -> Self {
3864        self.set_el(value);
3865        self
3866    }
3867}
3868
3869bitflags! {
3870    /// `DACR` system register value.
3871    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3872    #[repr(transparent)]
3873    pub struct Dacr: u32 {
3874    }
3875}
3876
3877impl Dacr {
3878    /// Offset of the `D<n>` field.
3879    pub const D_SHIFT: u32 = 0;
3880    /// Mask for the `D<n>` field.
3881    pub const D_MASK: u32 = 0b11;
3882
3883    /// Returns the value of the given `D<n>` field.
3884    pub const fn d(self, n: u32) -> u8 {
3885        assert!(n < 16);
3886        ((self.bits() >> (Self::D_SHIFT + (n - 0) * 2)) & 0b11) as u8
3887    }
3888
3889    /// Sets the value of the `D<n>` field.
3890    pub const fn set_d(&mut self, n: u32, value: u8) {
3891        assert!(n < 16);
3892        let offset = Self::D_SHIFT + (n - 0) * 2;
3893        assert!(value & (Self::D_MASK as u8) == value);
3894        *self = Self::from_bits_retain(
3895            (self.bits() & !(Self::D_MASK << offset)) | ((value as u32) << offset),
3896        );
3897    }
3898
3899    /// Returns a copy with the `D<n>` field set to the given value.
3900    pub const fn with_d(mut self, n: u32, value: u8) -> Self {
3901        self.set_d(n, value);
3902        self
3903    }
3904}
3905
3906bitflags! {
3907    /// `DBGAUTHSTATUS` system register value.
3908    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
3909    #[repr(transparent)]
3910    pub struct Dbgauthstatus: u32 {
3911    }
3912}
3913
3914impl Dbgauthstatus {
3915    /// Offset of the `NSID` field.
3916    pub const NSID_SHIFT: u32 = 0;
3917    /// Mask for the `NSID` field.
3918    pub const NSID_MASK: u32 = 0b11;
3919    /// Offset of the `NSNID` field.
3920    pub const NSNID_SHIFT: u32 = 2;
3921    /// Mask for the `NSNID` field.
3922    pub const NSNID_MASK: u32 = 0b11;
3923    /// Offset of the `SID` field.
3924    pub const SID_SHIFT: u32 = 4;
3925    /// Mask for the `SID` field.
3926    pub const SID_MASK: u32 = 0b11;
3927    /// Offset of the `SNID` field.
3928    pub const SNID_SHIFT: u32 = 6;
3929    /// Mask for the `SNID` field.
3930    pub const SNID_MASK: u32 = 0b11;
3931
3932    /// Returns the value of the `NSID` field.
3933    pub const fn nsid(self) -> u8 {
3934        ((self.bits() >> Self::NSID_SHIFT) & 0b11) as u8
3935    }
3936
3937    /// Sets the value of the `NSID` field.
3938    pub const fn set_nsid(&mut self, value: u8) {
3939        let offset = Self::NSID_SHIFT;
3940        assert!(value & (Self::NSID_MASK as u8) == value);
3941        *self = Self::from_bits_retain(
3942            (self.bits() & !(Self::NSID_MASK << offset)) | ((value as u32) << offset),
3943        );
3944    }
3945
3946    /// Returns a copy with the `NSID` field set to the given value.
3947    pub const fn with_nsid(mut self, value: u8) -> Self {
3948        self.set_nsid(value);
3949        self
3950    }
3951
3952    /// Returns the value of the `NSNID` field.
3953    pub const fn nsnid(self) -> u8 {
3954        ((self.bits() >> Self::NSNID_SHIFT) & 0b11) as u8
3955    }
3956
3957    /// Sets the value of the `NSNID` field.
3958    pub const fn set_nsnid(&mut self, value: u8) {
3959        let offset = Self::NSNID_SHIFT;
3960        assert!(value & (Self::NSNID_MASK as u8) == value);
3961        *self = Self::from_bits_retain(
3962            (self.bits() & !(Self::NSNID_MASK << offset)) | ((value as u32) << offset),
3963        );
3964    }
3965
3966    /// Returns a copy with the `NSNID` field set to the given value.
3967    pub const fn with_nsnid(mut self, value: u8) -> Self {
3968        self.set_nsnid(value);
3969        self
3970    }
3971
3972    /// Returns the value of the `SID` field.
3973    pub const fn sid(self) -> u8 {
3974        ((self.bits() >> Self::SID_SHIFT) & 0b11) as u8
3975    }
3976
3977    /// Sets the value of the `SID` field.
3978    pub const fn set_sid(&mut self, value: u8) {
3979        let offset = Self::SID_SHIFT;
3980        assert!(value & (Self::SID_MASK as u8) == value);
3981        *self = Self::from_bits_retain(
3982            (self.bits() & !(Self::SID_MASK << offset)) | ((value as u32) << offset),
3983        );
3984    }
3985
3986    /// Returns a copy with the `SID` field set to the given value.
3987    pub const fn with_sid(mut self, value: u8) -> Self {
3988        self.set_sid(value);
3989        self
3990    }
3991
3992    /// Returns the value of the `SNID` field.
3993    pub const fn snid(self) -> u8 {
3994        ((self.bits() >> Self::SNID_SHIFT) & 0b11) as u8
3995    }
3996
3997    /// Sets the value of the `SNID` field.
3998    pub const fn set_snid(&mut self, value: u8) {
3999        let offset = Self::SNID_SHIFT;
4000        assert!(value & (Self::SNID_MASK as u8) == value);
4001        *self = Self::from_bits_retain(
4002            (self.bits() & !(Self::SNID_MASK << offset)) | ((value as u32) << offset),
4003        );
4004    }
4005
4006    /// Returns a copy with the `SNID` field set to the given value.
4007    pub const fn with_snid(mut self, value: u8) -> Self {
4008        self.set_snid(value);
4009        self
4010    }
4011}
4012
4013bitflags! {
4014    /// `DBGCLAIMCLR` system register value.
4015    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4016    #[repr(transparent)]
4017    pub struct Dbgclaimclr: u32 {
4018        /// `CLAIM<m>` bit 0.
4019        const CLAIM0 = 1 << 0;
4020        /// `CLAIM<m>` bit 1.
4021        const CLAIM1 = 1 << 1;
4022        /// `CLAIM<m>` bit 2.
4023        const CLAIM2 = 1 << 2;
4024        /// `CLAIM<m>` bit 3.
4025        const CLAIM3 = 1 << 3;
4026        /// `CLAIM<m>` bit 4.
4027        const CLAIM4 = 1 << 4;
4028        /// `CLAIM<m>` bit 5.
4029        const CLAIM5 = 1 << 5;
4030        /// `CLAIM<m>` bit 6.
4031        const CLAIM6 = 1 << 6;
4032        /// `CLAIM<m>` bit 7.
4033        const CLAIM7 = 1 << 7;
4034    }
4035}
4036
4037impl Dbgclaimclr {
4038    /// Offset of the `CLAIM<m>` field.
4039    pub const CLAIM_SHIFT: u32 = 0;
4040}
4041
4042bitflags! {
4043    /// `DBGCLAIMSET` system register value.
4044    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4045    #[repr(transparent)]
4046    pub struct Dbgclaimset: u32 {
4047        /// `CLAIM<m>` bit 0.
4048        const CLAIM0 = 1 << 0;
4049        /// `CLAIM<m>` bit 1.
4050        const CLAIM1 = 1 << 1;
4051        /// `CLAIM<m>` bit 2.
4052        const CLAIM2 = 1 << 2;
4053        /// `CLAIM<m>` bit 3.
4054        const CLAIM3 = 1 << 3;
4055        /// `CLAIM<m>` bit 4.
4056        const CLAIM4 = 1 << 4;
4057        /// `CLAIM<m>` bit 5.
4058        const CLAIM5 = 1 << 5;
4059        /// `CLAIM<m>` bit 6.
4060        const CLAIM6 = 1 << 6;
4061        /// `CLAIM<m>` bit 7.
4062        const CLAIM7 = 1 << 7;
4063    }
4064}
4065
4066impl Dbgclaimset {
4067    /// Offset of the `CLAIM<m>` field.
4068    pub const CLAIM_SHIFT: u32 = 0;
4069}
4070
4071bitflags! {
4072    /// `DBGDCCINT` system register value.
4073    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4074    #[repr(transparent)]
4075    pub struct Dbgdccint: u32 {
4076        /// `TX` bit.
4077        const TX = 1 << 29;
4078        /// `RX` bit.
4079        const RX = 1 << 30;
4080    }
4081}
4082
4083impl Dbgdccint {
4084    /// Offset of the `TX` field.
4085    pub const TX_SHIFT: u32 = 29;
4086    /// Offset of the `RX` field.
4087    pub const RX_SHIFT: u32 = 30;
4088}
4089
4090bitflags! {
4091    /// `DBGDEVID` system register value.
4092    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4093    #[repr(transparent)]
4094    pub struct Dbgdevid: u32 {
4095    }
4096}
4097
4098impl Dbgdevid {
4099    /// Offset of the `PCSample` field.
4100    pub const PCSAMPLE_SHIFT: u32 = 0;
4101    /// Mask for the `PCSample` field.
4102    pub const PCSAMPLE_MASK: u32 = 0b1111;
4103    /// Offset of the `WPAddrMask` field.
4104    pub const WPADDRMASK_SHIFT: u32 = 4;
4105    /// Mask for the `WPAddrMask` field.
4106    pub const WPADDRMASK_MASK: u32 = 0b1111;
4107    /// Offset of the `BPAddrMask` field.
4108    pub const BPADDRMASK_SHIFT: u32 = 8;
4109    /// Mask for the `BPAddrMask` field.
4110    pub const BPADDRMASK_MASK: u32 = 0b1111;
4111    /// Offset of the `VectorCatch` field.
4112    pub const VECTORCATCH_SHIFT: u32 = 12;
4113    /// Mask for the `VectorCatch` field.
4114    pub const VECTORCATCH_MASK: u32 = 0b1111;
4115    /// Offset of the `VirtExtns` field.
4116    pub const VIRTEXTNS_SHIFT: u32 = 16;
4117    /// Mask for the `VirtExtns` field.
4118    pub const VIRTEXTNS_MASK: u32 = 0b1111;
4119    /// Offset of the `DoubleLock` field.
4120    pub const DOUBLELOCK_SHIFT: u32 = 20;
4121    /// Mask for the `DoubleLock` field.
4122    pub const DOUBLELOCK_MASK: u32 = 0b1111;
4123    /// Offset of the `AuxRegs` field.
4124    pub const AUXREGS_SHIFT: u32 = 24;
4125    /// Mask for the `AuxRegs` field.
4126    pub const AUXREGS_MASK: u32 = 0b1111;
4127    /// Offset of the `CIDMask` field.
4128    pub const CIDMASK_SHIFT: u32 = 28;
4129    /// Mask for the `CIDMask` field.
4130    pub const CIDMASK_MASK: u32 = 0b1111;
4131
4132    /// Returns the value of the `PCSample` field.
4133    pub const fn pcsample(self) -> u8 {
4134        ((self.bits() >> Self::PCSAMPLE_SHIFT) & 0b1111) as u8
4135    }
4136
4137    /// Sets the value of the `PCSample` field.
4138    pub const fn set_pcsample(&mut self, value: u8) {
4139        let offset = Self::PCSAMPLE_SHIFT;
4140        assert!(value & (Self::PCSAMPLE_MASK as u8) == value);
4141        *self = Self::from_bits_retain(
4142            (self.bits() & !(Self::PCSAMPLE_MASK << offset)) | ((value as u32) << offset),
4143        );
4144    }
4145
4146    /// Returns a copy with the `PCSample` field set to the given value.
4147    pub const fn with_pcsample(mut self, value: u8) -> Self {
4148        self.set_pcsample(value);
4149        self
4150    }
4151
4152    /// Returns the value of the `WPAddrMask` field.
4153    pub const fn wpaddrmask(self) -> u8 {
4154        ((self.bits() >> Self::WPADDRMASK_SHIFT) & 0b1111) as u8
4155    }
4156
4157    /// Sets the value of the `WPAddrMask` field.
4158    pub const fn set_wpaddrmask(&mut self, value: u8) {
4159        let offset = Self::WPADDRMASK_SHIFT;
4160        assert!(value & (Self::WPADDRMASK_MASK as u8) == value);
4161        *self = Self::from_bits_retain(
4162            (self.bits() & !(Self::WPADDRMASK_MASK << offset)) | ((value as u32) << offset),
4163        );
4164    }
4165
4166    /// Returns a copy with the `WPAddrMask` field set to the given value.
4167    pub const fn with_wpaddrmask(mut self, value: u8) -> Self {
4168        self.set_wpaddrmask(value);
4169        self
4170    }
4171
4172    /// Returns the value of the `BPAddrMask` field.
4173    pub const fn bpaddrmask(self) -> u8 {
4174        ((self.bits() >> Self::BPADDRMASK_SHIFT) & 0b1111) as u8
4175    }
4176
4177    /// Sets the value of the `BPAddrMask` field.
4178    pub const fn set_bpaddrmask(&mut self, value: u8) {
4179        let offset = Self::BPADDRMASK_SHIFT;
4180        assert!(value & (Self::BPADDRMASK_MASK as u8) == value);
4181        *self = Self::from_bits_retain(
4182            (self.bits() & !(Self::BPADDRMASK_MASK << offset)) | ((value as u32) << offset),
4183        );
4184    }
4185
4186    /// Returns a copy with the `BPAddrMask` field set to the given value.
4187    pub const fn with_bpaddrmask(mut self, value: u8) -> Self {
4188        self.set_bpaddrmask(value);
4189        self
4190    }
4191
4192    /// Returns the value of the `VectorCatch` field.
4193    pub const fn vectorcatch(self) -> u8 {
4194        ((self.bits() >> Self::VECTORCATCH_SHIFT) & 0b1111) as u8
4195    }
4196
4197    /// Sets the value of the `VectorCatch` field.
4198    pub const fn set_vectorcatch(&mut self, value: u8) {
4199        let offset = Self::VECTORCATCH_SHIFT;
4200        assert!(value & (Self::VECTORCATCH_MASK as u8) == value);
4201        *self = Self::from_bits_retain(
4202            (self.bits() & !(Self::VECTORCATCH_MASK << offset)) | ((value as u32) << offset),
4203        );
4204    }
4205
4206    /// Returns a copy with the `VectorCatch` field set to the given value.
4207    pub const fn with_vectorcatch(mut self, value: u8) -> Self {
4208        self.set_vectorcatch(value);
4209        self
4210    }
4211
4212    /// Returns the value of the `VirtExtns` field.
4213    pub const fn virtextns(self) -> u8 {
4214        ((self.bits() >> Self::VIRTEXTNS_SHIFT) & 0b1111) as u8
4215    }
4216
4217    /// Sets the value of the `VirtExtns` field.
4218    pub const fn set_virtextns(&mut self, value: u8) {
4219        let offset = Self::VIRTEXTNS_SHIFT;
4220        assert!(value & (Self::VIRTEXTNS_MASK as u8) == value);
4221        *self = Self::from_bits_retain(
4222            (self.bits() & !(Self::VIRTEXTNS_MASK << offset)) | ((value as u32) << offset),
4223        );
4224    }
4225
4226    /// Returns a copy with the `VirtExtns` field set to the given value.
4227    pub const fn with_virtextns(mut self, value: u8) -> Self {
4228        self.set_virtextns(value);
4229        self
4230    }
4231
4232    /// Returns the value of the `DoubleLock` field.
4233    pub const fn doublelock(self) -> u8 {
4234        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
4235    }
4236
4237    /// Sets the value of the `DoubleLock` field.
4238    pub const fn set_doublelock(&mut self, value: u8) {
4239        let offset = Self::DOUBLELOCK_SHIFT;
4240        assert!(value & (Self::DOUBLELOCK_MASK as u8) == value);
4241        *self = Self::from_bits_retain(
4242            (self.bits() & !(Self::DOUBLELOCK_MASK << offset)) | ((value as u32) << offset),
4243        );
4244    }
4245
4246    /// Returns a copy with the `DoubleLock` field set to the given value.
4247    pub const fn with_doublelock(mut self, value: u8) -> Self {
4248        self.set_doublelock(value);
4249        self
4250    }
4251
4252    /// Returns the value of the `AuxRegs` field.
4253    pub const fn auxregs(self) -> u8 {
4254        ((self.bits() >> Self::AUXREGS_SHIFT) & 0b1111) as u8
4255    }
4256
4257    /// Sets the value of the `AuxRegs` field.
4258    pub const fn set_auxregs(&mut self, value: u8) {
4259        let offset = Self::AUXREGS_SHIFT;
4260        assert!(value & (Self::AUXREGS_MASK as u8) == value);
4261        *self = Self::from_bits_retain(
4262            (self.bits() & !(Self::AUXREGS_MASK << offset)) | ((value as u32) << offset),
4263        );
4264    }
4265
4266    /// Returns a copy with the `AuxRegs` field set to the given value.
4267    pub const fn with_auxregs(mut self, value: u8) -> Self {
4268        self.set_auxregs(value);
4269        self
4270    }
4271
4272    /// Returns the value of the `CIDMask` field.
4273    pub const fn cidmask(self) -> u8 {
4274        ((self.bits() >> Self::CIDMASK_SHIFT) & 0b1111) as u8
4275    }
4276
4277    /// Sets the value of the `CIDMask` field.
4278    pub const fn set_cidmask(&mut self, value: u8) {
4279        let offset = Self::CIDMASK_SHIFT;
4280        assert!(value & (Self::CIDMASK_MASK as u8) == value);
4281        *self = Self::from_bits_retain(
4282            (self.bits() & !(Self::CIDMASK_MASK << offset)) | ((value as u32) << offset),
4283        );
4284    }
4285
4286    /// Returns a copy with the `CIDMask` field set to the given value.
4287    pub const fn with_cidmask(mut self, value: u8) -> Self {
4288        self.set_cidmask(value);
4289        self
4290    }
4291}
4292
4293bitflags! {
4294    /// `DBGDEVID1` system register value.
4295    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4296    #[repr(transparent)]
4297    pub struct Dbgdevid1: u32 {
4298    }
4299}
4300
4301impl Dbgdevid1 {
4302    /// Offset of the `PCSROffset` field.
4303    pub const PCSROFFSET_SHIFT: u32 = 0;
4304    /// Mask for the `PCSROffset` field.
4305    pub const PCSROFFSET_MASK: u32 = 0b1111;
4306
4307    /// Returns the value of the `PCSROffset` field.
4308    pub const fn pcsroffset(self) -> u8 {
4309        ((self.bits() >> Self::PCSROFFSET_SHIFT) & 0b1111) as u8
4310    }
4311
4312    /// Sets the value of the `PCSROffset` field.
4313    pub const fn set_pcsroffset(&mut self, value: u8) {
4314        let offset = Self::PCSROFFSET_SHIFT;
4315        assert!(value & (Self::PCSROFFSET_MASK as u8) == value);
4316        *self = Self::from_bits_retain(
4317            (self.bits() & !(Self::PCSROFFSET_MASK << offset)) | ((value as u32) << offset),
4318        );
4319    }
4320
4321    /// Returns a copy with the `PCSROffset` field set to the given value.
4322    pub const fn with_pcsroffset(mut self, value: u8) -> Self {
4323        self.set_pcsroffset(value);
4324        self
4325    }
4326}
4327
4328bitflags! {
4329    /// `DBGDIDR` system register value.
4330    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4331    #[repr(transparent)]
4332    pub struct Dbgdidr: u32 {
4333        /// RES1 bits in the `DBGDIDR` register.
4334        const RES1 = 0b1000000000000000;
4335        /// `SE_imp` bit.
4336        const SE_IMP = 1 << 12;
4337        /// `nSUHD_imp` bit.
4338        const NSUHD_IMP = 1 << 14;
4339    }
4340}
4341
4342impl Dbgdidr {
4343    /// Offset of the `SE_imp` field.
4344    pub const SE_IMP_SHIFT: u32 = 12;
4345    /// Offset of the `nSUHD_imp` field.
4346    pub const NSUHD_IMP_SHIFT: u32 = 14;
4347    /// Offset of the `Version` field.
4348    pub const VERSION_SHIFT: u32 = 16;
4349    /// Mask for the `Version` field.
4350    pub const VERSION_MASK: u32 = 0b1111;
4351    /// Offset of the `CTX_CMPs` field.
4352    pub const CTX_CMPS_SHIFT: u32 = 20;
4353    /// Mask for the `CTX_CMPs` field.
4354    pub const CTX_CMPS_MASK: u32 = 0b1111;
4355    /// Offset of the `BRPs` field.
4356    pub const BRPS_SHIFT: u32 = 24;
4357    /// Mask for the `BRPs` field.
4358    pub const BRPS_MASK: u32 = 0b1111;
4359    /// Offset of the `WRPs` field.
4360    pub const WRPS_SHIFT: u32 = 28;
4361    /// Mask for the `WRPs` field.
4362    pub const WRPS_MASK: u32 = 0b1111;
4363
4364    /// Returns the value of the `Version` field.
4365    pub const fn version(self) -> u8 {
4366        ((self.bits() >> Self::VERSION_SHIFT) & 0b1111) as u8
4367    }
4368
4369    /// Sets the value of the `Version` field.
4370    pub const fn set_version(&mut self, value: u8) {
4371        let offset = Self::VERSION_SHIFT;
4372        assert!(value & (Self::VERSION_MASK as u8) == value);
4373        *self = Self::from_bits_retain(
4374            (self.bits() & !(Self::VERSION_MASK << offset)) | ((value as u32) << offset),
4375        );
4376    }
4377
4378    /// Returns a copy with the `Version` field set to the given value.
4379    pub const fn with_version(mut self, value: u8) -> Self {
4380        self.set_version(value);
4381        self
4382    }
4383
4384    /// Returns the value of the `CTX_CMPs` field.
4385    pub const fn ctx_cmps(self) -> u8 {
4386        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
4387    }
4388
4389    /// Sets the value of the `CTX_CMPs` field.
4390    pub const fn set_ctx_cmps(&mut self, value: u8) {
4391        let offset = Self::CTX_CMPS_SHIFT;
4392        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
4393        *self = Self::from_bits_retain(
4394            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u32) << offset),
4395        );
4396    }
4397
4398    /// Returns a copy with the `CTX_CMPs` field set to the given value.
4399    pub const fn with_ctx_cmps(mut self, value: u8) -> Self {
4400        self.set_ctx_cmps(value);
4401        self
4402    }
4403
4404    /// Returns the value of the `BRPs` field.
4405    pub const fn brps(self) -> u8 {
4406        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
4407    }
4408
4409    /// Sets the value of the `BRPs` field.
4410    pub const fn set_brps(&mut self, value: u8) {
4411        let offset = Self::BRPS_SHIFT;
4412        assert!(value & (Self::BRPS_MASK as u8) == value);
4413        *self = Self::from_bits_retain(
4414            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u32) << offset),
4415        );
4416    }
4417
4418    /// Returns a copy with the `BRPs` field set to the given value.
4419    pub const fn with_brps(mut self, value: u8) -> Self {
4420        self.set_brps(value);
4421        self
4422    }
4423
4424    /// Returns the value of the `WRPs` field.
4425    pub const fn wrps(self) -> u8 {
4426        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
4427    }
4428
4429    /// Sets the value of the `WRPs` field.
4430    pub const fn set_wrps(&mut self, value: u8) {
4431        let offset = Self::WRPS_SHIFT;
4432        assert!(value & (Self::WRPS_MASK as u8) == value);
4433        *self = Self::from_bits_retain(
4434            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u32) << offset),
4435        );
4436    }
4437
4438    /// Returns a copy with the `WRPs` field set to the given value.
4439    pub const fn with_wrps(mut self, value: u8) -> Self {
4440        self.set_wrps(value);
4441        self
4442    }
4443}
4444
4445bitflags! {
4446    /// `DBGDRAR` system register value.
4447    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4448    #[repr(transparent)]
4449    pub struct Dbgdrar: u64 {
4450    }
4451}
4452
4453impl Dbgdrar {
4454    /// Offset of the `Valid` field.
4455    pub const VALID_SHIFT: u32 = 0;
4456    /// Mask for the `Valid` field.
4457    pub const VALID_MASK: u64 = 0b11;
4458    /// Offset of the `ROMADDR[47:12]` field.
4459    pub const ROMADDR_47_12_SHIFT: u32 = 12;
4460    /// Mask for the `ROMADDR[47:12]` field.
4461    pub const ROMADDR_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
4462
4463    /// Returns the value of the `Valid` field.
4464    pub const fn valid(self) -> u8 {
4465        ((self.bits() >> Self::VALID_SHIFT) & 0b11) as u8
4466    }
4467
4468    /// Sets the value of the `Valid` field.
4469    pub const fn set_valid(&mut self, value: u8) {
4470        let offset = Self::VALID_SHIFT;
4471        assert!(value & (Self::VALID_MASK as u8) == value);
4472        *self = Self::from_bits_retain(
4473            (self.bits() & !(Self::VALID_MASK << offset)) | ((value as u64) << offset),
4474        );
4475    }
4476
4477    /// Returns a copy with the `Valid` field set to the given value.
4478    pub const fn with_valid(mut self, value: u8) -> Self {
4479        self.set_valid(value);
4480        self
4481    }
4482
4483    /// Returns the value of the `ROMADDR[47:12]` field.
4484    pub const fn romaddr_47_12(self) -> u64 {
4485        ((self.bits() >> Self::ROMADDR_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
4486    }
4487
4488    /// Sets the value of the `ROMADDR[47:12]` field.
4489    pub const fn set_romaddr_47_12(&mut self, value: u64) {
4490        let offset = Self::ROMADDR_47_12_SHIFT;
4491        assert!(value & (Self::ROMADDR_47_12_MASK as u64) == value);
4492        *self = Self::from_bits_retain(
4493            (self.bits() & !(Self::ROMADDR_47_12_MASK << offset)) | ((value as u64) << offset),
4494        );
4495    }
4496
4497    /// Returns a copy with the `ROMADDR[47:12]` field set to the given value.
4498    pub const fn with_romaddr_47_12(mut self, value: u64) -> Self {
4499        self.set_romaddr_47_12(value);
4500        self
4501    }
4502}
4503
4504bitflags! {
4505    /// `DBGDSCRext` system register value.
4506    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4507    #[repr(transparent)]
4508    pub struct Dbgdscrext: u32 {
4509        /// `ERR` bit.
4510        const ERR = 1 << 6;
4511        /// `UDCCdis` bit.
4512        const UDCCDIS = 1 << 12;
4513        /// `HDE` bit.
4514        const HDE = 1 << 14;
4515        /// `MDBGen` bit.
4516        const MDBGEN = 1 << 15;
4517        /// `SPIDdis` bit.
4518        const SPIDDIS = 1 << 16;
4519        /// `SPNIDdis` bit.
4520        const SPNIDDIS = 1 << 17;
4521        /// `NS` bit.
4522        const NS = 1 << 18;
4523        /// `SC2` bit.
4524        const SC2 = 1 << 19;
4525        /// `TDA` bit.
4526        const TDA = 1 << 21;
4527        /// `TXU` bit.
4528        const TXU = 1 << 26;
4529        /// `RXO` bit.
4530        const RXO = 1 << 27;
4531        /// `TXfull` bit.
4532        const TXFULL = 1 << 29;
4533        /// `RXfull` bit.
4534        const RXFULL = 1 << 30;
4535        /// `TFO` bit.
4536        const TFO = 1 << 31;
4537    }
4538}
4539
4540impl Dbgdscrext {
4541    /// Offset of the `MOE` field.
4542    pub const MOE_SHIFT: u32 = 2;
4543    /// Mask for the `MOE` field.
4544    pub const MOE_MASK: u32 = 0b1111;
4545    /// Offset of the `ERR` field.
4546    pub const ERR_SHIFT: u32 = 6;
4547    /// Offset of the `UDCCdis` field.
4548    pub const UDCCDIS_SHIFT: u32 = 12;
4549    /// Offset of the `HDE` field.
4550    pub const HDE_SHIFT: u32 = 14;
4551    /// Offset of the `MDBGen` field.
4552    pub const MDBGEN_SHIFT: u32 = 15;
4553    /// Offset of the `SPIDdis` field.
4554    pub const SPIDDIS_SHIFT: u32 = 16;
4555    /// Offset of the `SPNIDdis` field.
4556    pub const SPNIDDIS_SHIFT: u32 = 17;
4557    /// Offset of the `NS` field.
4558    pub const NS_SHIFT: u32 = 18;
4559    /// Offset of the `SC2` field.
4560    pub const SC2_SHIFT: u32 = 19;
4561    /// Offset of the `TDA` field.
4562    pub const TDA_SHIFT: u32 = 21;
4563    /// Offset of the `INTdis` field.
4564    pub const INTDIS_SHIFT: u32 = 22;
4565    /// Mask for the `INTdis` field.
4566    pub const INTDIS_MASK: u32 = 0b11;
4567    /// Offset of the `TXU` field.
4568    pub const TXU_SHIFT: u32 = 26;
4569    /// Offset of the `RXO` field.
4570    pub const RXO_SHIFT: u32 = 27;
4571    /// Offset of the `TXfull` field.
4572    pub const TXFULL_SHIFT: u32 = 29;
4573    /// Offset of the `RXfull` field.
4574    pub const RXFULL_SHIFT: u32 = 30;
4575    /// Offset of the `TFO` field.
4576    pub const TFO_SHIFT: u32 = 31;
4577
4578    /// Returns the value of the `MOE` field.
4579    pub const fn moe(self) -> u8 {
4580        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
4581    }
4582
4583    /// Sets the value of the `MOE` field.
4584    pub const fn set_moe(&mut self, value: u8) {
4585        let offset = Self::MOE_SHIFT;
4586        assert!(value & (Self::MOE_MASK as u8) == value);
4587        *self = Self::from_bits_retain(
4588            (self.bits() & !(Self::MOE_MASK << offset)) | ((value as u32) << offset),
4589        );
4590    }
4591
4592    /// Returns a copy with the `MOE` field set to the given value.
4593    pub const fn with_moe(mut self, value: u8) -> Self {
4594        self.set_moe(value);
4595        self
4596    }
4597
4598    /// Returns the value of the `INTdis` field.
4599    pub const fn intdis(self) -> u8 {
4600        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
4601    }
4602
4603    /// Sets the value of the `INTdis` field.
4604    pub const fn set_intdis(&mut self, value: u8) {
4605        let offset = Self::INTDIS_SHIFT;
4606        assert!(value & (Self::INTDIS_MASK as u8) == value);
4607        *self = Self::from_bits_retain(
4608            (self.bits() & !(Self::INTDIS_MASK << offset)) | ((value as u32) << offset),
4609        );
4610    }
4611
4612    /// Returns a copy with the `INTdis` field set to the given value.
4613    pub const fn with_intdis(mut self, value: u8) -> Self {
4614        self.set_intdis(value);
4615        self
4616    }
4617}
4618
4619bitflags! {
4620    /// `DBGDSCRint` system register value.
4621    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4622    #[repr(transparent)]
4623    pub struct Dbgdscrint: u32 {
4624        /// `UDCCdis` bit.
4625        const UDCCDIS = 1 << 12;
4626        /// `MDBGen` bit.
4627        const MDBGEN = 1 << 15;
4628        /// `SPIDdis` bit.
4629        const SPIDDIS = 1 << 16;
4630        /// `SPNIDdis` bit.
4631        const SPNIDDIS = 1 << 17;
4632        /// `NS` bit.
4633        const NS = 1 << 18;
4634        /// `TXfull` bit.
4635        const TXFULL = 1 << 29;
4636        /// `RXfull` bit.
4637        const RXFULL = 1 << 30;
4638    }
4639}
4640
4641impl Dbgdscrint {
4642    /// Offset of the `MOE` field.
4643    pub const MOE_SHIFT: u32 = 2;
4644    /// Mask for the `MOE` field.
4645    pub const MOE_MASK: u32 = 0b1111;
4646    /// Offset of the `UDCCdis` field.
4647    pub const UDCCDIS_SHIFT: u32 = 12;
4648    /// Offset of the `MDBGen` field.
4649    pub const MDBGEN_SHIFT: u32 = 15;
4650    /// Offset of the `SPIDdis` field.
4651    pub const SPIDDIS_SHIFT: u32 = 16;
4652    /// Offset of the `SPNIDdis` field.
4653    pub const SPNIDDIS_SHIFT: u32 = 17;
4654    /// Offset of the `NS` field.
4655    pub const NS_SHIFT: u32 = 18;
4656    /// Offset of the `TXfull` field.
4657    pub const TXFULL_SHIFT: u32 = 29;
4658    /// Offset of the `RXfull` field.
4659    pub const RXFULL_SHIFT: u32 = 30;
4660
4661    /// Returns the value of the `MOE` field.
4662    pub const fn moe(self) -> u8 {
4663        ((self.bits() >> Self::MOE_SHIFT) & 0b1111) as u8
4664    }
4665
4666    /// Sets the value of the `MOE` field.
4667    pub const fn set_moe(&mut self, value: u8) {
4668        let offset = Self::MOE_SHIFT;
4669        assert!(value & (Self::MOE_MASK as u8) == value);
4670        *self = Self::from_bits_retain(
4671            (self.bits() & !(Self::MOE_MASK << offset)) | ((value as u32) << offset),
4672        );
4673    }
4674
4675    /// Returns a copy with the `MOE` field set to the given value.
4676    pub const fn with_moe(mut self, value: u8) -> Self {
4677        self.set_moe(value);
4678        self
4679    }
4680}
4681
4682bitflags! {
4683    /// `DBGDTRRXext` system register value.
4684    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4685    #[repr(transparent)]
4686    pub struct Dbgdtrrxext: u32 {
4687    }
4688}
4689
4690impl Dbgdtrrxext {
4691    /// Offset of the `DTRRX` field.
4692    pub const DTRRX_SHIFT: u32 = 0;
4693    /// Mask for the `DTRRX` field.
4694    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
4695
4696    /// Returns the value of the `DTRRX` field.
4697    pub const fn dtrrx(self) -> u32 {
4698        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
4699    }
4700
4701    /// Sets the value of the `DTRRX` field.
4702    pub const fn set_dtrrx(&mut self, value: u32) {
4703        let offset = Self::DTRRX_SHIFT;
4704        assert!(value & (Self::DTRRX_MASK as u32) == value);
4705        *self = Self::from_bits_retain(
4706            (self.bits() & !(Self::DTRRX_MASK << offset)) | ((value as u32) << offset),
4707        );
4708    }
4709
4710    /// Returns a copy with the `DTRRX` field set to the given value.
4711    pub const fn with_dtrrx(mut self, value: u32) -> Self {
4712        self.set_dtrrx(value);
4713        self
4714    }
4715}
4716
4717bitflags! {
4718    /// `DBGDTRRXint` system register value.
4719    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4720    #[repr(transparent)]
4721    pub struct Dbgdtrrxint: u32 {
4722    }
4723}
4724
4725impl Dbgdtrrxint {
4726    /// Offset of the `DTRRX` field.
4727    pub const DTRRX_SHIFT: u32 = 0;
4728    /// Mask for the `DTRRX` field.
4729    pub const DTRRX_MASK: u32 = 0b11111111111111111111111111111111;
4730
4731    /// Returns the value of the `DTRRX` field.
4732    pub const fn dtrrx(self) -> u32 {
4733        ((self.bits() >> Self::DTRRX_SHIFT) & 0b11111111111111111111111111111111) as u32
4734    }
4735
4736    /// Sets the value of the `DTRRX` field.
4737    pub const fn set_dtrrx(&mut self, value: u32) {
4738        let offset = Self::DTRRX_SHIFT;
4739        assert!(value & (Self::DTRRX_MASK as u32) == value);
4740        *self = Self::from_bits_retain(
4741            (self.bits() & !(Self::DTRRX_MASK << offset)) | ((value as u32) << offset),
4742        );
4743    }
4744
4745    /// Returns a copy with the `DTRRX` field set to the given value.
4746    pub const fn with_dtrrx(mut self, value: u32) -> Self {
4747        self.set_dtrrx(value);
4748        self
4749    }
4750}
4751
4752bitflags! {
4753    /// `DBGDTRTXext` system register value.
4754    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4755    #[repr(transparent)]
4756    pub struct Dbgdtrtxext: u32 {
4757    }
4758}
4759
4760impl Dbgdtrtxext {
4761    /// Offset of the `DTRTX` field.
4762    pub const DTRTX_SHIFT: u32 = 0;
4763    /// Mask for the `DTRTX` field.
4764    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
4765
4766    /// Returns the value of the `DTRTX` field.
4767    pub const fn dtrtx(self) -> u32 {
4768        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
4769    }
4770
4771    /// Sets the value of the `DTRTX` field.
4772    pub const fn set_dtrtx(&mut self, value: u32) {
4773        let offset = Self::DTRTX_SHIFT;
4774        assert!(value & (Self::DTRTX_MASK as u32) == value);
4775        *self = Self::from_bits_retain(
4776            (self.bits() & !(Self::DTRTX_MASK << offset)) | ((value as u32) << offset),
4777        );
4778    }
4779
4780    /// Returns a copy with the `DTRTX` field set to the given value.
4781    pub const fn with_dtrtx(mut self, value: u32) -> Self {
4782        self.set_dtrtx(value);
4783        self
4784    }
4785}
4786
4787bitflags! {
4788    /// `DBGDTRTXint` system register value.
4789    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4790    #[repr(transparent)]
4791    pub struct Dbgdtrtxint: u32 {
4792    }
4793}
4794
4795impl Dbgdtrtxint {
4796    /// Offset of the `DTRTX` field.
4797    pub const DTRTX_SHIFT: u32 = 0;
4798    /// Mask for the `DTRTX` field.
4799    pub const DTRTX_MASK: u32 = 0b11111111111111111111111111111111;
4800
4801    /// Returns the value of the `DTRTX` field.
4802    pub const fn dtrtx(self) -> u32 {
4803        ((self.bits() >> Self::DTRTX_SHIFT) & 0b11111111111111111111111111111111) as u32
4804    }
4805
4806    /// Sets the value of the `DTRTX` field.
4807    pub const fn set_dtrtx(&mut self, value: u32) {
4808        let offset = Self::DTRTX_SHIFT;
4809        assert!(value & (Self::DTRTX_MASK as u32) == value);
4810        *self = Self::from_bits_retain(
4811            (self.bits() & !(Self::DTRTX_MASK << offset)) | ((value as u32) << offset),
4812        );
4813    }
4814
4815    /// Returns a copy with the `DTRTX` field set to the given value.
4816    pub const fn with_dtrtx(mut self, value: u32) -> Self {
4817        self.set_dtrtx(value);
4818        self
4819    }
4820}
4821
4822bitflags! {
4823    /// `DBGOSDLR` system register value.
4824    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4825    #[repr(transparent)]
4826    pub struct Dbgosdlr: u32 {
4827        /// `DLK` bit.
4828        const DLK = 1 << 0;
4829    }
4830}
4831
4832impl Dbgosdlr {
4833    /// Offset of the `DLK` field.
4834    pub const DLK_SHIFT: u32 = 0;
4835}
4836
4837bitflags! {
4838    /// `DBGOSECCR` system register value.
4839    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4840    #[repr(transparent)]
4841    pub struct Dbgoseccr: u32 {
4842    }
4843}
4844
4845impl Dbgoseccr {
4846    /// Offset of the `EDECCR` field.
4847    pub const EDECCR_SHIFT: u32 = 0;
4848    /// Mask for the `EDECCR` field.
4849    pub const EDECCR_MASK: u32 = 0b11111111111111111111111111111111;
4850
4851    /// Returns the value of the `EDECCR` field.
4852    pub const fn edeccr(self) -> u32 {
4853        ((self.bits() >> Self::EDECCR_SHIFT) & 0b11111111111111111111111111111111) as u32
4854    }
4855
4856    /// Sets the value of the `EDECCR` field.
4857    pub const fn set_edeccr(&mut self, value: u32) {
4858        let offset = Self::EDECCR_SHIFT;
4859        assert!(value & (Self::EDECCR_MASK as u32) == value);
4860        *self = Self::from_bits_retain(
4861            (self.bits() & !(Self::EDECCR_MASK << offset)) | ((value as u32) << offset),
4862        );
4863    }
4864
4865    /// Returns a copy with the `EDECCR` field set to the given value.
4866    pub const fn with_edeccr(mut self, value: u32) -> Self {
4867        self.set_edeccr(value);
4868        self
4869    }
4870}
4871
4872bitflags! {
4873    /// `DBGOSLAR` system register value.
4874    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4875    #[repr(transparent)]
4876    pub struct Dbgoslar: u32 {
4877    }
4878}
4879
4880impl Dbgoslar {
4881    /// Offset of the `OSLA` field.
4882    pub const OSLA_SHIFT: u32 = 0;
4883    /// Mask for the `OSLA` field.
4884    pub const OSLA_MASK: u32 = 0b11111111111111111111111111111111;
4885
4886    /// Returns the value of the `OSLA` field.
4887    pub const fn osla(self) -> u32 {
4888        ((self.bits() >> Self::OSLA_SHIFT) & 0b11111111111111111111111111111111) as u32
4889    }
4890
4891    /// Sets the value of the `OSLA` field.
4892    pub const fn set_osla(&mut self, value: u32) {
4893        let offset = Self::OSLA_SHIFT;
4894        assert!(value & (Self::OSLA_MASK as u32) == value);
4895        *self = Self::from_bits_retain(
4896            (self.bits() & !(Self::OSLA_MASK << offset)) | ((value as u32) << offset),
4897        );
4898    }
4899
4900    /// Returns a copy with the `OSLA` field set to the given value.
4901    pub const fn with_osla(mut self, value: u32) -> Self {
4902        self.set_osla(value);
4903        self
4904    }
4905}
4906
4907bitflags! {
4908    /// `DBGOSLSR` system register value.
4909    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4910    #[repr(transparent)]
4911    pub struct Dbgoslsr: u32 {
4912        /// `OSLK` bit.
4913        const OSLK = 1 << 1;
4914        /// `nTT` bit.
4915        const NTT = 1 << 2;
4916    }
4917}
4918
4919impl Dbgoslsr {
4920    /// Offset of the `OSLK` field.
4921    pub const OSLK_SHIFT: u32 = 1;
4922    /// Offset of the `nTT` field.
4923    pub const NTT_SHIFT: u32 = 2;
4924}
4925
4926bitflags! {
4927    /// `DBGPRCR` system register value.
4928    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4929    #[repr(transparent)]
4930    pub struct Dbgprcr: u32 {
4931        /// `CORENPDRQ` bit.
4932        const CORENPDRQ = 1 << 0;
4933    }
4934}
4935
4936impl Dbgprcr {
4937    /// Offset of the `CORENPDRQ` field.
4938    pub const CORENPDRQ_SHIFT: u32 = 0;
4939}
4940
4941bitflags! {
4942    /// `DBGVCR` system register value.
4943    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
4944    #[repr(transparent)]
4945    pub struct Dbgvcr: u32 {
4946        /// `SU` bit.
4947        const SU = 1 << 1;
4948        /// `U` bit.
4949        const U = 1 << 1;
4950        /// `S` bit.
4951        const S = 1 << 2;
4952        /// `SS` bit.
4953        const SS = 1 << 2;
4954        /// `P` bit.
4955        const P = 1 << 3;
4956        /// `SP` bit.
4957        const SP = 1 << 3;
4958        /// `D` bit.
4959        const D = 1 << 4;
4960        /// `SD` bit.
4961        const SD = 1 << 4;
4962        /// `I` bit.
4963        const I = 1 << 6;
4964        /// `SI` bit.
4965        const SI = 1 << 6;
4966        /// `F` bit.
4967        const F = 1 << 7;
4968        /// `SF` bit.
4969        const SF = 1 << 7;
4970        /// `MS` bit.
4971        const MS = 1 << 10;
4972        /// `MP` bit.
4973        const MP = 1 << 11;
4974        /// `MD` bit.
4975        const MD = 1 << 12;
4976        /// `MI` bit.
4977        const MI = 1 << 14;
4978        /// `MF` bit.
4979        const MF = 1 << 15;
4980        /// `NSU` bit.
4981        const NSU = 1 << 25;
4982        /// `NSS` bit.
4983        const NSS = 1 << 26;
4984        /// `NSP` bit.
4985        const NSP = 1 << 27;
4986        /// `NSD` bit.
4987        const NSD = 1 << 28;
4988        /// `NSI` bit.
4989        const NSI = 1 << 30;
4990        /// `NSF` bit.
4991        const NSF = 1 << 31;
4992    }
4993}
4994
4995impl Dbgvcr {
4996    /// Offset of the `SU` field.
4997    pub const SU_SHIFT: u32 = 1;
4998    /// Offset of the `U` field.
4999    pub const U_SHIFT: u32 = 1;
5000    /// Offset of the `S` field.
5001    pub const S_SHIFT: u32 = 2;
5002    /// Offset of the `SS` field.
5003    pub const SS_SHIFT: u32 = 2;
5004    /// Offset of the `P` field.
5005    pub const P_SHIFT: u32 = 3;
5006    /// Offset of the `SP` field.
5007    pub const SP_SHIFT: u32 = 3;
5008    /// Offset of the `D` field.
5009    pub const D_SHIFT: u32 = 4;
5010    /// Offset of the `SD` field.
5011    pub const SD_SHIFT: u32 = 4;
5012    /// Offset of the `I` field.
5013    pub const I_SHIFT: u32 = 6;
5014    /// Offset of the `SI` field.
5015    pub const SI_SHIFT: u32 = 6;
5016    /// Offset of the `F` field.
5017    pub const F_SHIFT: u32 = 7;
5018    /// Offset of the `SF` field.
5019    pub const SF_SHIFT: u32 = 7;
5020    /// Offset of the `MS` field.
5021    pub const MS_SHIFT: u32 = 10;
5022    /// Offset of the `MP` field.
5023    pub const MP_SHIFT: u32 = 11;
5024    /// Offset of the `MD` field.
5025    pub const MD_SHIFT: u32 = 12;
5026    /// Offset of the `MI` field.
5027    pub const MI_SHIFT: u32 = 14;
5028    /// Offset of the `MF` field.
5029    pub const MF_SHIFT: u32 = 15;
5030    /// Offset of the `NSU` field.
5031    pub const NSU_SHIFT: u32 = 25;
5032    /// Offset of the `NSS` field.
5033    pub const NSS_SHIFT: u32 = 26;
5034    /// Offset of the `NSP` field.
5035    pub const NSP_SHIFT: u32 = 27;
5036    /// Offset of the `NSD` field.
5037    pub const NSD_SHIFT: u32 = 28;
5038    /// Offset of the `NSI` field.
5039    pub const NSI_SHIFT: u32 = 30;
5040    /// Offset of the `NSF` field.
5041    pub const NSF_SHIFT: u32 = 31;
5042}
5043
5044bitflags! {
5045    /// `DFAR` system register value.
5046    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5047    #[repr(transparent)]
5048    pub struct Dfar: u32 {
5049    }
5050}
5051
5052impl Dfar {
5053    /// Offset of the `VA` field.
5054    pub const VA_SHIFT: u32 = 0;
5055    /// Mask for the `VA` field.
5056    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
5057
5058    /// Returns the value of the `VA` field.
5059    pub const fn va(self) -> u32 {
5060        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
5061    }
5062
5063    /// Sets the value of the `VA` field.
5064    pub const fn set_va(&mut self, value: u32) {
5065        let offset = Self::VA_SHIFT;
5066        assert!(value & (Self::VA_MASK as u32) == value);
5067        *self = Self::from_bits_retain(
5068            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
5069        );
5070    }
5071
5072    /// Returns a copy with the `VA` field set to the given value.
5073    pub const fn with_va(mut self, value: u32) -> Self {
5074        self.set_va(value);
5075        self
5076    }
5077}
5078
5079bitflags! {
5080    /// `DFSR` system register value.
5081    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5082    #[repr(transparent)]
5083    pub struct Dfsr: u32 {
5084        /// `LPAE` bit.
5085        const LPAE = 1 << 9;
5086        /// `WnR` bit.
5087        const WNR = 1 << 11;
5088        /// `ExT` bit.
5089        const EXT = 1 << 12;
5090        /// `CM` bit.
5091        const CM = 1 << 13;
5092        /// `FnV` bit.
5093        const FNV = 1 << 16;
5094    }
5095}
5096
5097impl Dfsr {
5098    /// Offset of the `STATUS` field.
5099    pub const STATUS_SHIFT: u32 = 0;
5100    /// Mask for the `STATUS` field.
5101    pub const STATUS_MASK: u32 = 0b111111;
5102    /// Offset of the `Domain` field.
5103    pub const DOMAIN_SHIFT: u32 = 4;
5104    /// Mask for the `Domain` field.
5105    pub const DOMAIN_MASK: u32 = 0b1111;
5106    /// Offset of the `LPAE` field.
5107    pub const LPAE_SHIFT: u32 = 9;
5108    /// Offset of the `WnR` field.
5109    pub const WNR_SHIFT: u32 = 11;
5110    /// Offset of the `ExT` field.
5111    pub const EXT_SHIFT: u32 = 12;
5112    /// Offset of the `CM` field.
5113    pub const CM_SHIFT: u32 = 13;
5114    /// Offset of the `AET` field.
5115    pub const AET_SHIFT: u32 = 14;
5116    /// Mask for the `AET` field.
5117    pub const AET_MASK: u32 = 0b11;
5118    /// Offset of the `FnV` field.
5119    pub const FNV_SHIFT: u32 = 16;
5120
5121    /// Returns the value of the `STATUS` field.
5122    pub const fn status(self) -> u8 {
5123        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
5124    }
5125
5126    /// Sets the value of the `STATUS` field.
5127    pub const fn set_status(&mut self, value: u8) {
5128        let offset = Self::STATUS_SHIFT;
5129        assert!(value & (Self::STATUS_MASK as u8) == value);
5130        *self = Self::from_bits_retain(
5131            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
5132        );
5133    }
5134
5135    /// Returns a copy with the `STATUS` field set to the given value.
5136    pub const fn with_status(mut self, value: u8) -> Self {
5137        self.set_status(value);
5138        self
5139    }
5140
5141    /// Returns the value of the `Domain` field.
5142    pub const fn domain(self) -> u8 {
5143        ((self.bits() >> Self::DOMAIN_SHIFT) & 0b1111) as u8
5144    }
5145
5146    /// Sets the value of the `Domain` field.
5147    pub const fn set_domain(&mut self, value: u8) {
5148        let offset = Self::DOMAIN_SHIFT;
5149        assert!(value & (Self::DOMAIN_MASK as u8) == value);
5150        *self = Self::from_bits_retain(
5151            (self.bits() & !(Self::DOMAIN_MASK << offset)) | ((value as u32) << offset),
5152        );
5153    }
5154
5155    /// Returns a copy with the `Domain` field set to the given value.
5156    pub const fn with_domain(mut self, value: u8) -> Self {
5157        self.set_domain(value);
5158        self
5159    }
5160
5161    /// Returns the value of the `AET` field.
5162    pub const fn aet(self) -> u8 {
5163        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
5164    }
5165
5166    /// Sets the value of the `AET` field.
5167    pub const fn set_aet(&mut self, value: u8) {
5168        let offset = Self::AET_SHIFT;
5169        assert!(value & (Self::AET_MASK as u8) == value);
5170        *self = Self::from_bits_retain(
5171            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
5172        );
5173    }
5174
5175    /// Returns a copy with the `AET` field set to the given value.
5176    pub const fn with_aet(mut self, value: u8) -> Self {
5177        self.set_aet(value);
5178        self
5179    }
5180}
5181
5182bitflags! {
5183    /// `DISR` system register value.
5184    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5185    #[repr(transparent)]
5186    pub struct Disr: u32 {
5187        /// `EA` bit.
5188        const EA = 1 << 9;
5189        /// `LPAE` bit.
5190        const LPAE = 1 << 9;
5191        /// `ExT` bit.
5192        const EXT = 1 << 12;
5193        /// `A` bit.
5194        const A = 1 << 31;
5195    }
5196}
5197
5198impl Disr {
5199    /// Offset of the `DFSC` field.
5200    pub const DFSC_SHIFT: u32 = 0;
5201    /// Mask for the `DFSC` field.
5202    pub const DFSC_MASK: u32 = 0b111111;
5203    /// Offset of the `STATUS` field.
5204    pub const STATUS_SHIFT: u32 = 0;
5205    /// Mask for the `STATUS` field.
5206    pub const STATUS_MASK: u32 = 0b111111;
5207    /// Offset of the `EA` field.
5208    pub const EA_SHIFT: u32 = 9;
5209    /// Offset of the `LPAE` field.
5210    pub const LPAE_SHIFT: u32 = 9;
5211    /// Offset of the `ExT` field.
5212    pub const EXT_SHIFT: u32 = 12;
5213    /// Offset of the `A` field.
5214    pub const A_SHIFT: u32 = 31;
5215
5216    /// Returns the value of the `DFSC` field.
5217    pub const fn dfsc(self) -> u8 {
5218        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
5219    }
5220
5221    /// Sets the value of the `DFSC` field.
5222    pub const fn set_dfsc(&mut self, value: u8) {
5223        let offset = Self::DFSC_SHIFT;
5224        assert!(value & (Self::DFSC_MASK as u8) == value);
5225        *self = Self::from_bits_retain(
5226            (self.bits() & !(Self::DFSC_MASK << offset)) | ((value as u32) << offset),
5227        );
5228    }
5229
5230    /// Returns a copy with the `DFSC` field set to the given value.
5231    pub const fn with_dfsc(mut self, value: u8) -> Self {
5232        self.set_dfsc(value);
5233        self
5234    }
5235
5236    /// Returns the value of the `STATUS` field.
5237    pub const fn status(self) -> u8 {
5238        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
5239    }
5240
5241    /// Sets the value of the `STATUS` field.
5242    pub const fn set_status(&mut self, value: u8) {
5243        let offset = Self::STATUS_SHIFT;
5244        assert!(value & (Self::STATUS_MASK as u8) == value);
5245        *self = Self::from_bits_retain(
5246            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
5247        );
5248    }
5249
5250    /// Returns a copy with the `STATUS` field set to the given value.
5251    pub const fn with_status(mut self, value: u8) -> Self {
5252        self.set_status(value);
5253        self
5254    }
5255}
5256
5257#[cfg(feature = "el1")]
5258bitflags! {
5259    /// `DISR_EL1` system register value.
5260    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5261    #[repr(transparent)]
5262    pub struct DisrEl1: u64 {
5263        /// `WnR` bit.
5264        const WNR = 1 << 6;
5265        /// `WnRV` bit.
5266        const WNRV = 1 << 7;
5267        /// `EA` bit.
5268        const EA = 1 << 9;
5269        /// `IDS` bit.
5270        const IDS = 1 << 24;
5271        /// `A` bit.
5272        const A = 1 << 31;
5273    }
5274}
5275
5276#[cfg(feature = "el1")]
5277impl DisrEl1 {
5278    /// Offset of the `DFSC` field.
5279    pub const DFSC_SHIFT: u32 = 0;
5280    /// Mask for the `DFSC` field.
5281    pub const DFSC_MASK: u64 = 0b111111;
5282    /// Offset of the `WnR` field.
5283    pub const WNR_SHIFT: u32 = 6;
5284    /// Offset of the `WnRV` field.
5285    pub const WNRV_SHIFT: u32 = 7;
5286    /// Offset of the `EA` field.
5287    pub const EA_SHIFT: u32 = 9;
5288    /// Offset of the `AET` field.
5289    pub const AET_SHIFT: u32 = 10;
5290    /// Mask for the `AET` field.
5291    pub const AET_MASK: u64 = 0b111;
5292    /// Offset of the `WU` field.
5293    pub const WU_SHIFT: u32 = 16;
5294    /// Mask for the `WU` field.
5295    pub const WU_MASK: u64 = 0b11;
5296    /// Offset of the `IDS` field.
5297    pub const IDS_SHIFT: u32 = 24;
5298    /// Offset of the `A` field.
5299    pub const A_SHIFT: u32 = 31;
5300
5301    /// Returns the value of the `DFSC` field.
5302    pub const fn dfsc(self) -> u8 {
5303        ((self.bits() >> Self::DFSC_SHIFT) & 0b111111) as u8
5304    }
5305
5306    /// Sets the value of the `DFSC` field.
5307    pub const fn set_dfsc(&mut self, value: u8) {
5308        let offset = Self::DFSC_SHIFT;
5309        assert!(value & (Self::DFSC_MASK as u8) == value);
5310        *self = Self::from_bits_retain(
5311            (self.bits() & !(Self::DFSC_MASK << offset)) | ((value as u64) << offset),
5312        );
5313    }
5314
5315    /// Returns a copy with the `DFSC` field set to the given value.
5316    pub const fn with_dfsc(mut self, value: u8) -> Self {
5317        self.set_dfsc(value);
5318        self
5319    }
5320
5321    /// Returns the value of the `AET` field.
5322    pub const fn aet(self) -> u8 {
5323        ((self.bits() >> Self::AET_SHIFT) & 0b111) as u8
5324    }
5325
5326    /// Sets the value of the `AET` field.
5327    pub const fn set_aet(&mut self, value: u8) {
5328        let offset = Self::AET_SHIFT;
5329        assert!(value & (Self::AET_MASK as u8) == value);
5330        *self = Self::from_bits_retain(
5331            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
5332        );
5333    }
5334
5335    /// Returns a copy with the `AET` field set to the given value.
5336    pub const fn with_aet(mut self, value: u8) -> Self {
5337        self.set_aet(value);
5338        self
5339    }
5340
5341    /// Returns the value of the `WU` field.
5342    pub const fn wu(self) -> u8 {
5343        ((self.bits() >> Self::WU_SHIFT) & 0b11) as u8
5344    }
5345
5346    /// Sets the value of the `WU` field.
5347    pub const fn set_wu(&mut self, value: u8) {
5348        let offset = Self::WU_SHIFT;
5349        assert!(value & (Self::WU_MASK as u8) == value);
5350        *self = Self::from_bits_retain(
5351            (self.bits() & !(Self::WU_MASK << offset)) | ((value as u64) << offset),
5352        );
5353    }
5354
5355    /// Returns a copy with the `WU` field set to the given value.
5356    pub const fn with_wu(mut self, value: u8) -> Self {
5357        self.set_wu(value);
5358        self
5359    }
5360}
5361
5362bitflags! {
5363    /// `DIT` system register value.
5364    ///
5365    /// Data Independent Timing.
5366    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5367    #[repr(transparent)]
5368    pub struct Dit: u64 {
5369        /// Enable data independent timing.
5370        const DIT = 1 << 24;
5371    }
5372}
5373
5374impl Dit {
5375    /// Offset of the `DIT` field.
5376    pub const DIT_SHIFT: u32 = 24;
5377}
5378
5379bitflags! {
5380    /// `DLR` system register value.
5381    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5382    #[repr(transparent)]
5383    pub struct Dlr: u32 {
5384    }
5385}
5386
5387impl Dlr {
5388    /// Offset of the `ADDR` field.
5389    pub const ADDR_SHIFT: u32 = 0;
5390    /// Mask for the `ADDR` field.
5391    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
5392
5393    /// Returns the value of the `ADDR` field.
5394    pub const fn addr(self) -> u32 {
5395        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
5396    }
5397
5398    /// Sets the value of the `ADDR` field.
5399    pub const fn set_addr(&mut self, value: u32) {
5400        let offset = Self::ADDR_SHIFT;
5401        assert!(value & (Self::ADDR_MASK as u32) == value);
5402        *self = Self::from_bits_retain(
5403            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u32) << offset),
5404        );
5405    }
5406
5407    /// Returns a copy with the `ADDR` field set to the given value.
5408    pub const fn with_addr(mut self, value: u32) -> Self {
5409        self.set_addr(value);
5410        self
5411    }
5412}
5413
5414bitflags! {
5415    /// `DSPSR` system register value.
5416    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5417    #[repr(transparent)]
5418    pub struct Dspsr: u32 {
5419        /// `T` bit.
5420        const T = 1 << 5;
5421        /// `F` bit.
5422        const F = 1 << 6;
5423        /// `I` bit.
5424        const I = 1 << 7;
5425        /// `A` bit.
5426        const A = 1 << 8;
5427        /// `E` bit.
5428        const E = 1 << 9;
5429        /// `IL` bit.
5430        const IL = 1 << 20;
5431        /// `SS` bit.
5432        const SS = 1 << 21;
5433        /// `PAN` bit.
5434        const PAN = 1 << 22;
5435        /// `SSBS` bit.
5436        const SSBS = 1 << 23;
5437        /// `DIT` bit.
5438        const DIT = 1 << 24;
5439        /// `Q` bit.
5440        const Q = 1 << 27;
5441        /// `V` bit.
5442        const V = 1 << 28;
5443        /// `C` bit.
5444        const C = 1 << 29;
5445        /// `Z` bit.
5446        const Z = 1 << 30;
5447        /// `N` bit.
5448        const N = 1 << 31;
5449    }
5450}
5451
5452impl Dspsr {
5453    /// Offset of the `M[4:0]` field.
5454    pub const M_4_0_SHIFT: u32 = 0;
5455    /// Mask for the `M[4:0]` field.
5456    pub const M_4_0_MASK: u32 = 0b11111;
5457    /// Offset of the `T` field.
5458    pub const T_SHIFT: u32 = 5;
5459    /// Offset of the `F` field.
5460    pub const F_SHIFT: u32 = 6;
5461    /// Offset of the `I` field.
5462    pub const I_SHIFT: u32 = 7;
5463    /// Offset of the `A` field.
5464    pub const A_SHIFT: u32 = 8;
5465    /// Offset of the `E` field.
5466    pub const E_SHIFT: u32 = 9;
5467    /// Offset of the `GE` field.
5468    pub const GE_SHIFT: u32 = 16;
5469    /// Mask for the `GE` field.
5470    pub const GE_MASK: u32 = 0b1111;
5471    /// Offset of the `IL` field.
5472    pub const IL_SHIFT: u32 = 20;
5473    /// Offset of the `SS` field.
5474    pub const SS_SHIFT: u32 = 21;
5475    /// Offset of the `PAN` field.
5476    pub const PAN_SHIFT: u32 = 22;
5477    /// Offset of the `SSBS` field.
5478    pub const SSBS_SHIFT: u32 = 23;
5479    /// Offset of the `DIT` field.
5480    pub const DIT_SHIFT: u32 = 24;
5481    /// Offset of the `Q` field.
5482    pub const Q_SHIFT: u32 = 27;
5483    /// Offset of the `V` field.
5484    pub const V_SHIFT: u32 = 28;
5485    /// Offset of the `C` field.
5486    pub const C_SHIFT: u32 = 29;
5487    /// Offset of the `Z` field.
5488    pub const Z_SHIFT: u32 = 30;
5489    /// Offset of the `N` field.
5490    pub const N_SHIFT: u32 = 31;
5491
5492    /// Returns the value of the `M[4:0]` field.
5493    pub const fn m_4_0(self) -> u8 {
5494        ((self.bits() >> Self::M_4_0_SHIFT) & 0b11111) as u8
5495    }
5496
5497    /// Sets the value of the `M[4:0]` field.
5498    pub const fn set_m_4_0(&mut self, value: u8) {
5499        let offset = Self::M_4_0_SHIFT;
5500        assert!(value & (Self::M_4_0_MASK as u8) == value);
5501        *self = Self::from_bits_retain(
5502            (self.bits() & !(Self::M_4_0_MASK << offset)) | ((value as u32) << offset),
5503        );
5504    }
5505
5506    /// Returns a copy with the `M[4:0]` field set to the given value.
5507    pub const fn with_m_4_0(mut self, value: u8) -> Self {
5508        self.set_m_4_0(value);
5509        self
5510    }
5511
5512    /// Returns the value of the `GE` field.
5513    pub const fn ge(self) -> u8 {
5514        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
5515    }
5516
5517    /// Sets the value of the `GE` field.
5518    pub const fn set_ge(&mut self, value: u8) {
5519        let offset = Self::GE_SHIFT;
5520        assert!(value & (Self::GE_MASK as u8) == value);
5521        *self = Self::from_bits_retain(
5522            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u32) << offset),
5523        );
5524    }
5525
5526    /// Returns a copy with the `GE` field set to the given value.
5527    pub const fn with_ge(mut self, value: u8) -> Self {
5528        self.set_ge(value);
5529        self
5530    }
5531}
5532
5533bitflags! {
5534    /// `DSPSR2` system register value.
5535    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5536    #[repr(transparent)]
5537    pub struct Dspsr2: u32 {
5538        /// `PPEND` bit.
5539        const PPEND = 1 << 1;
5540        /// `UINJ` bit.
5541        const UINJ = 1 << 4;
5542    }
5543}
5544
5545impl Dspsr2 {
5546    /// Offset of the `PPEND` field.
5547    pub const PPEND_SHIFT: u32 = 1;
5548    /// Offset of the `UINJ` field.
5549    pub const UINJ_SHIFT: u32 = 4;
5550}
5551
5552#[cfg(feature = "el1")]
5553bitflags! {
5554    /// `ELR_EL1` system register value.
5555    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5556    #[repr(transparent)]
5557    pub struct ElrEl1: u64 {
5558    }
5559}
5560
5561#[cfg(feature = "el1")]
5562impl ElrEl1 {
5563    /// Offset of the `ADDR` field.
5564    pub const ADDR_SHIFT: u32 = 0;
5565    /// Mask for the `ADDR` field.
5566    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
5567
5568    /// Returns the value of the `ADDR` field.
5569    pub const fn addr(self) -> u64 {
5570        ((self.bits() >> Self::ADDR_SHIFT)
5571            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
5572    }
5573
5574    /// Sets the value of the `ADDR` field.
5575    pub const fn set_addr(&mut self, value: u64) {
5576        let offset = Self::ADDR_SHIFT;
5577        assert!(value & (Self::ADDR_MASK as u64) == value);
5578        *self = Self::from_bits_retain(
5579            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u64) << offset),
5580        );
5581    }
5582
5583    /// Returns a copy with the `ADDR` field set to the given value.
5584    pub const fn with_addr(mut self, value: u64) -> Self {
5585        self.set_addr(value);
5586        self
5587    }
5588}
5589
5590#[cfg(feature = "el2")]
5591bitflags! {
5592    /// `ELR_EL2` system register value.
5593    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5594    #[repr(transparent)]
5595    pub struct ElrEl2: u64 {
5596    }
5597}
5598
5599#[cfg(feature = "el2")]
5600impl ElrEl2 {
5601    /// Offset of the `ADDR` field.
5602    pub const ADDR_SHIFT: u32 = 0;
5603    /// Mask for the `ADDR` field.
5604    pub const ADDR_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
5605
5606    /// Returns the value of the `ADDR` field.
5607    pub const fn addr(self) -> u64 {
5608        ((self.bits() >> Self::ADDR_SHIFT)
5609            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
5610    }
5611
5612    /// Sets the value of the `ADDR` field.
5613    pub const fn set_addr(&mut self, value: u64) {
5614        let offset = Self::ADDR_SHIFT;
5615        assert!(value & (Self::ADDR_MASK as u64) == value);
5616        *self = Self::from_bits_retain(
5617            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u64) << offset),
5618        );
5619    }
5620
5621    /// Returns a copy with the `ADDR` field set to the given value.
5622    pub const fn with_addr(mut self, value: u64) -> Self {
5623        self.set_addr(value);
5624        self
5625    }
5626}
5627
5628#[cfg(feature = "el2")]
5629bitflags! {
5630    /// `ELR_hyp` system register value.
5631    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5632    #[repr(transparent)]
5633    pub struct ElrHyp: u32 {
5634    }
5635}
5636
5637#[cfg(feature = "el2")]
5638impl ElrHyp {
5639    /// Offset of the `ADDR` field.
5640    pub const ADDR_SHIFT: u32 = 0;
5641    /// Mask for the `ADDR` field.
5642    pub const ADDR_MASK: u32 = 0b11111111111111111111111111111111;
5643
5644    /// Returns the value of the `ADDR` field.
5645    pub const fn addr(self) -> u32 {
5646        ((self.bits() >> Self::ADDR_SHIFT) & 0b11111111111111111111111111111111) as u32
5647    }
5648
5649    /// Sets the value of the `ADDR` field.
5650    pub const fn set_addr(&mut self, value: u32) {
5651        let offset = Self::ADDR_SHIFT;
5652        assert!(value & (Self::ADDR_MASK as u32) == value);
5653        *self = Self::from_bits_retain(
5654            (self.bits() & !(Self::ADDR_MASK << offset)) | ((value as u32) << offset),
5655        );
5656    }
5657
5658    /// Returns a copy with the `ADDR` field set to the given value.
5659    pub const fn with_addr(mut self, value: u32) -> Self {
5660        self.set_addr(value);
5661        self
5662    }
5663}
5664
5665bitflags! {
5666    /// `ERRIDR` system register value.
5667    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5668    #[repr(transparent)]
5669    pub struct Erridr: u32 {
5670    }
5671}
5672
5673impl Erridr {
5674    /// Offset of the `NUM` field.
5675    pub const NUM_SHIFT: u32 = 0;
5676    /// Mask for the `NUM` field.
5677    pub const NUM_MASK: u32 = 0b1111111111111111;
5678
5679    /// Returns the value of the `NUM` field.
5680    pub const fn num(self) -> u16 {
5681        ((self.bits() >> Self::NUM_SHIFT) & 0b1111111111111111) as u16
5682    }
5683
5684    /// Sets the value of the `NUM` field.
5685    pub const fn set_num(&mut self, value: u16) {
5686        let offset = Self::NUM_SHIFT;
5687        assert!(value & (Self::NUM_MASK as u16) == value);
5688        *self = Self::from_bits_retain(
5689            (self.bits() & !(Self::NUM_MASK << offset)) | ((value as u32) << offset),
5690        );
5691    }
5692
5693    /// Returns a copy with the `NUM` field set to the given value.
5694    pub const fn with_num(mut self, value: u16) -> Self {
5695        self.set_num(value);
5696        self
5697    }
5698}
5699
5700bitflags! {
5701    /// `ERRSELR` system register value.
5702    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5703    #[repr(transparent)]
5704    pub struct Errselr: u32 {
5705    }
5706}
5707
5708impl Errselr {
5709    /// Offset of the `SEL` field.
5710    pub const SEL_SHIFT: u32 = 0;
5711    /// Mask for the `SEL` field.
5712    pub const SEL_MASK: u32 = 0b1111111111111111;
5713
5714    /// Returns the value of the `SEL` field.
5715    pub const fn sel(self) -> u16 {
5716        ((self.bits() >> Self::SEL_SHIFT) & 0b1111111111111111) as u16
5717    }
5718
5719    /// Sets the value of the `SEL` field.
5720    pub const fn set_sel(&mut self, value: u16) {
5721        let offset = Self::SEL_SHIFT;
5722        assert!(value & (Self::SEL_MASK as u16) == value);
5723        *self = Self::from_bits_retain(
5724            (self.bits() & !(Self::SEL_MASK << offset)) | ((value as u32) << offset),
5725        );
5726    }
5727
5728    /// Returns a copy with the `SEL` field set to the given value.
5729    pub const fn with_sel(mut self, value: u16) -> Self {
5730        self.set_sel(value);
5731        self
5732    }
5733}
5734
5735bitflags! {
5736    /// `ERXADDR` system register value.
5737    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5738    #[repr(transparent)]
5739    pub struct Erxaddr: u32 {
5740    }
5741}
5742
5743impl Erxaddr {
5744    /// Offset of the `ERRnADDRlo` field.
5745    pub const ERRNADDRLO_SHIFT: u32 = 0;
5746    /// Mask for the `ERRnADDRlo` field.
5747    pub const ERRNADDRLO_MASK: u32 = 0b11111111111111111111111111111111;
5748
5749    /// Returns the value of the `ERRnADDRlo` field.
5750    pub const fn errnaddrlo(self) -> u32 {
5751        ((self.bits() >> Self::ERRNADDRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
5752    }
5753
5754    /// Sets the value of the `ERRnADDRlo` field.
5755    pub const fn set_errnaddrlo(&mut self, value: u32) {
5756        let offset = Self::ERRNADDRLO_SHIFT;
5757        assert!(value & (Self::ERRNADDRLO_MASK as u32) == value);
5758        *self = Self::from_bits_retain(
5759            (self.bits() & !(Self::ERRNADDRLO_MASK << offset)) | ((value as u32) << offset),
5760        );
5761    }
5762
5763    /// Returns a copy with the `ERRnADDRlo` field set to the given value.
5764    pub const fn with_errnaddrlo(mut self, value: u32) -> Self {
5765        self.set_errnaddrlo(value);
5766        self
5767    }
5768}
5769
5770bitflags! {
5771    /// `ERXADDR2` system register value.
5772    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5773    #[repr(transparent)]
5774    pub struct Erxaddr2: u32 {
5775    }
5776}
5777
5778impl Erxaddr2 {
5779    /// Offset of the `ERRnADDRhi` field.
5780    pub const ERRNADDRHI_SHIFT: u32 = 0;
5781    /// Mask for the `ERRnADDRhi` field.
5782    pub const ERRNADDRHI_MASK: u32 = 0b11111111111111111111111111111111;
5783
5784    /// Returns the value of the `ERRnADDRhi` field.
5785    pub const fn errnaddrhi(self) -> u32 {
5786        ((self.bits() >> Self::ERRNADDRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
5787    }
5788
5789    /// Sets the value of the `ERRnADDRhi` field.
5790    pub const fn set_errnaddrhi(&mut self, value: u32) {
5791        let offset = Self::ERRNADDRHI_SHIFT;
5792        assert!(value & (Self::ERRNADDRHI_MASK as u32) == value);
5793        *self = Self::from_bits_retain(
5794            (self.bits() & !(Self::ERRNADDRHI_MASK << offset)) | ((value as u32) << offset),
5795        );
5796    }
5797
5798    /// Returns a copy with the `ERRnADDRhi` field set to the given value.
5799    pub const fn with_errnaddrhi(mut self, value: u32) -> Self {
5800        self.set_errnaddrhi(value);
5801        self
5802    }
5803}
5804
5805bitflags! {
5806    /// `ERXCTLR` system register value.
5807    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5808    #[repr(transparent)]
5809    pub struct Erxctlr: u32 {
5810    }
5811}
5812
5813impl Erxctlr {
5814    /// Offset of the `ERRnCTLRlo` field.
5815    pub const ERRNCTLRLO_SHIFT: u32 = 0;
5816    /// Mask for the `ERRnCTLRlo` field.
5817    pub const ERRNCTLRLO_MASK: u32 = 0b11111111111111111111111111111111;
5818
5819    /// Returns the value of the `ERRnCTLRlo` field.
5820    pub const fn errnctlrlo(self) -> u32 {
5821        ((self.bits() >> Self::ERRNCTLRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
5822    }
5823
5824    /// Sets the value of the `ERRnCTLRlo` field.
5825    pub const fn set_errnctlrlo(&mut self, value: u32) {
5826        let offset = Self::ERRNCTLRLO_SHIFT;
5827        assert!(value & (Self::ERRNCTLRLO_MASK as u32) == value);
5828        *self = Self::from_bits_retain(
5829            (self.bits() & !(Self::ERRNCTLRLO_MASK << offset)) | ((value as u32) << offset),
5830        );
5831    }
5832
5833    /// Returns a copy with the `ERRnCTLRlo` field set to the given value.
5834    pub const fn with_errnctlrlo(mut self, value: u32) -> Self {
5835        self.set_errnctlrlo(value);
5836        self
5837    }
5838}
5839
5840bitflags! {
5841    /// `ERXCTLR2` system register value.
5842    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5843    #[repr(transparent)]
5844    pub struct Erxctlr2: u32 {
5845    }
5846}
5847
5848impl Erxctlr2 {
5849    /// Offset of the `ERRnCTLRhi` field.
5850    pub const ERRNCTLRHI_SHIFT: u32 = 0;
5851    /// Mask for the `ERRnCTLRhi` field.
5852    pub const ERRNCTLRHI_MASK: u32 = 0b11111111111111111111111111111111;
5853
5854    /// Returns the value of the `ERRnCTLRhi` field.
5855    pub const fn errnctlrhi(self) -> u32 {
5856        ((self.bits() >> Self::ERRNCTLRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
5857    }
5858
5859    /// Sets the value of the `ERRnCTLRhi` field.
5860    pub const fn set_errnctlrhi(&mut self, value: u32) {
5861        let offset = Self::ERRNCTLRHI_SHIFT;
5862        assert!(value & (Self::ERRNCTLRHI_MASK as u32) == value);
5863        *self = Self::from_bits_retain(
5864            (self.bits() & !(Self::ERRNCTLRHI_MASK << offset)) | ((value as u32) << offset),
5865        );
5866    }
5867
5868    /// Returns a copy with the `ERRnCTLRhi` field set to the given value.
5869    pub const fn with_errnctlrhi(mut self, value: u32) -> Self {
5870        self.set_errnctlrhi(value);
5871        self
5872    }
5873}
5874
5875bitflags! {
5876    /// `ERXFR` system register value.
5877    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5878    #[repr(transparent)]
5879    pub struct Erxfr: u32 {
5880    }
5881}
5882
5883impl Erxfr {
5884    /// Offset of the `ERRnFRlo` field.
5885    pub const ERRNFRLO_SHIFT: u32 = 0;
5886    /// Mask for the `ERRnFRlo` field.
5887    pub const ERRNFRLO_MASK: u32 = 0b11111111111111111111111111111111;
5888
5889    /// Returns the value of the `ERRnFRlo` field.
5890    pub const fn errnfrlo(self) -> u32 {
5891        ((self.bits() >> Self::ERRNFRLO_SHIFT) & 0b11111111111111111111111111111111) as u32
5892    }
5893
5894    /// Sets the value of the `ERRnFRlo` field.
5895    pub const fn set_errnfrlo(&mut self, value: u32) {
5896        let offset = Self::ERRNFRLO_SHIFT;
5897        assert!(value & (Self::ERRNFRLO_MASK as u32) == value);
5898        *self = Self::from_bits_retain(
5899            (self.bits() & !(Self::ERRNFRLO_MASK << offset)) | ((value as u32) << offset),
5900        );
5901    }
5902
5903    /// Returns a copy with the `ERRnFRlo` field set to the given value.
5904    pub const fn with_errnfrlo(mut self, value: u32) -> Self {
5905        self.set_errnfrlo(value);
5906        self
5907    }
5908}
5909
5910bitflags! {
5911    /// `ERXFR2` system register value.
5912    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5913    #[repr(transparent)]
5914    pub struct Erxfr2: u32 {
5915    }
5916}
5917
5918impl Erxfr2 {
5919    /// Offset of the `ERRnFRhi` field.
5920    pub const ERRNFRHI_SHIFT: u32 = 0;
5921    /// Mask for the `ERRnFRhi` field.
5922    pub const ERRNFRHI_MASK: u32 = 0b11111111111111111111111111111111;
5923
5924    /// Returns the value of the `ERRnFRhi` field.
5925    pub const fn errnfrhi(self) -> u32 {
5926        ((self.bits() >> Self::ERRNFRHI_SHIFT) & 0b11111111111111111111111111111111) as u32
5927    }
5928
5929    /// Sets the value of the `ERRnFRhi` field.
5930    pub const fn set_errnfrhi(&mut self, value: u32) {
5931        let offset = Self::ERRNFRHI_SHIFT;
5932        assert!(value & (Self::ERRNFRHI_MASK as u32) == value);
5933        *self = Self::from_bits_retain(
5934            (self.bits() & !(Self::ERRNFRHI_MASK << offset)) | ((value as u32) << offset),
5935        );
5936    }
5937
5938    /// Returns a copy with the `ERRnFRhi` field set to the given value.
5939    pub const fn with_errnfrhi(mut self, value: u32) -> Self {
5940        self.set_errnfrhi(value);
5941        self
5942    }
5943}
5944
5945bitflags! {
5946    /// `ERXMISC0` system register value.
5947    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5948    #[repr(transparent)]
5949    pub struct Erxmisc0: u32 {
5950    }
5951}
5952
5953impl Erxmisc0 {
5954    /// Offset of the `ERRnMISC0lo` field.
5955    pub const ERRNMISC0LO_SHIFT: u32 = 0;
5956    /// Mask for the `ERRnMISC0lo` field.
5957    pub const ERRNMISC0LO_MASK: u32 = 0b11111111111111111111111111111111;
5958
5959    /// Returns the value of the `ERRnMISC0lo` field.
5960    pub const fn errnmisc0lo(self) -> u32 {
5961        ((self.bits() >> Self::ERRNMISC0LO_SHIFT) & 0b11111111111111111111111111111111) as u32
5962    }
5963
5964    /// Sets the value of the `ERRnMISC0lo` field.
5965    pub const fn set_errnmisc0lo(&mut self, value: u32) {
5966        let offset = Self::ERRNMISC0LO_SHIFT;
5967        assert!(value & (Self::ERRNMISC0LO_MASK as u32) == value);
5968        *self = Self::from_bits_retain(
5969            (self.bits() & !(Self::ERRNMISC0LO_MASK << offset)) | ((value as u32) << offset),
5970        );
5971    }
5972
5973    /// Returns a copy with the `ERRnMISC0lo` field set to the given value.
5974    pub const fn with_errnmisc0lo(mut self, value: u32) -> Self {
5975        self.set_errnmisc0lo(value);
5976        self
5977    }
5978}
5979
5980bitflags! {
5981    /// `ERXMISC1` system register value.
5982    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
5983    #[repr(transparent)]
5984    pub struct Erxmisc1: u32 {
5985    }
5986}
5987
5988impl Erxmisc1 {
5989    /// Offset of the `ERRnMISC0hi` field.
5990    pub const ERRNMISC0HI_SHIFT: u32 = 0;
5991    /// Mask for the `ERRnMISC0hi` field.
5992    pub const ERRNMISC0HI_MASK: u32 = 0b11111111111111111111111111111111;
5993
5994    /// Returns the value of the `ERRnMISC0hi` field.
5995    pub const fn errnmisc0hi(self) -> u32 {
5996        ((self.bits() >> Self::ERRNMISC0HI_SHIFT) & 0b11111111111111111111111111111111) as u32
5997    }
5998
5999    /// Sets the value of the `ERRnMISC0hi` field.
6000    pub const fn set_errnmisc0hi(&mut self, value: u32) {
6001        let offset = Self::ERRNMISC0HI_SHIFT;
6002        assert!(value & (Self::ERRNMISC0HI_MASK as u32) == value);
6003        *self = Self::from_bits_retain(
6004            (self.bits() & !(Self::ERRNMISC0HI_MASK << offset)) | ((value as u32) << offset),
6005        );
6006    }
6007
6008    /// Returns a copy with the `ERRnMISC0hi` field set to the given value.
6009    pub const fn with_errnmisc0hi(mut self, value: u32) -> Self {
6010        self.set_errnmisc0hi(value);
6011        self
6012    }
6013}
6014
6015bitflags! {
6016    /// `ERXMISC2` system register value.
6017    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6018    #[repr(transparent)]
6019    pub struct Erxmisc2: u32 {
6020    }
6021}
6022
6023impl Erxmisc2 {
6024    /// Offset of the `ERRnMISC1lo` field.
6025    pub const ERRNMISC1LO_SHIFT: u32 = 0;
6026    /// Mask for the `ERRnMISC1lo` field.
6027    pub const ERRNMISC1LO_MASK: u32 = 0b11111111111111111111111111111111;
6028
6029    /// Returns the value of the `ERRnMISC1lo` field.
6030    pub const fn errnmisc1lo(self) -> u32 {
6031        ((self.bits() >> Self::ERRNMISC1LO_SHIFT) & 0b11111111111111111111111111111111) as u32
6032    }
6033
6034    /// Sets the value of the `ERRnMISC1lo` field.
6035    pub const fn set_errnmisc1lo(&mut self, value: u32) {
6036        let offset = Self::ERRNMISC1LO_SHIFT;
6037        assert!(value & (Self::ERRNMISC1LO_MASK as u32) == value);
6038        *self = Self::from_bits_retain(
6039            (self.bits() & !(Self::ERRNMISC1LO_MASK << offset)) | ((value as u32) << offset),
6040        );
6041    }
6042
6043    /// Returns a copy with the `ERRnMISC1lo` field set to the given value.
6044    pub const fn with_errnmisc1lo(mut self, value: u32) -> Self {
6045        self.set_errnmisc1lo(value);
6046        self
6047    }
6048}
6049
6050bitflags! {
6051    /// `ERXMISC3` system register value.
6052    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6053    #[repr(transparent)]
6054    pub struct Erxmisc3: u32 {
6055    }
6056}
6057
6058impl Erxmisc3 {
6059    /// Offset of the `ERRnMISC1hi` field.
6060    pub const ERRNMISC1HI_SHIFT: u32 = 0;
6061    /// Mask for the `ERRnMISC1hi` field.
6062    pub const ERRNMISC1HI_MASK: u32 = 0b11111111111111111111111111111111;
6063
6064    /// Returns the value of the `ERRnMISC1hi` field.
6065    pub const fn errnmisc1hi(self) -> u32 {
6066        ((self.bits() >> Self::ERRNMISC1HI_SHIFT) & 0b11111111111111111111111111111111) as u32
6067    }
6068
6069    /// Sets the value of the `ERRnMISC1hi` field.
6070    pub const fn set_errnmisc1hi(&mut self, value: u32) {
6071        let offset = Self::ERRNMISC1HI_SHIFT;
6072        assert!(value & (Self::ERRNMISC1HI_MASK as u32) == value);
6073        *self = Self::from_bits_retain(
6074            (self.bits() & !(Self::ERRNMISC1HI_MASK << offset)) | ((value as u32) << offset),
6075        );
6076    }
6077
6078    /// Returns a copy with the `ERRnMISC1hi` field set to the given value.
6079    pub const fn with_errnmisc1hi(mut self, value: u32) -> Self {
6080        self.set_errnmisc1hi(value);
6081        self
6082    }
6083}
6084
6085bitflags! {
6086    /// `ERXMISC4` system register value.
6087    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6088    #[repr(transparent)]
6089    pub struct Erxmisc4: u32 {
6090    }
6091}
6092
6093impl Erxmisc4 {
6094    /// Offset of the `ERRnMISC2lo` field.
6095    pub const ERRNMISC2LO_SHIFT: u32 = 0;
6096    /// Mask for the `ERRnMISC2lo` field.
6097    pub const ERRNMISC2LO_MASK: u32 = 0b11111111111111111111111111111111;
6098
6099    /// Returns the value of the `ERRnMISC2lo` field.
6100    pub const fn errnmisc2lo(self) -> u32 {
6101        ((self.bits() >> Self::ERRNMISC2LO_SHIFT) & 0b11111111111111111111111111111111) as u32
6102    }
6103
6104    /// Sets the value of the `ERRnMISC2lo` field.
6105    pub const fn set_errnmisc2lo(&mut self, value: u32) {
6106        let offset = Self::ERRNMISC2LO_SHIFT;
6107        assert!(value & (Self::ERRNMISC2LO_MASK as u32) == value);
6108        *self = Self::from_bits_retain(
6109            (self.bits() & !(Self::ERRNMISC2LO_MASK << offset)) | ((value as u32) << offset),
6110        );
6111    }
6112
6113    /// Returns a copy with the `ERRnMISC2lo` field set to the given value.
6114    pub const fn with_errnmisc2lo(mut self, value: u32) -> Self {
6115        self.set_errnmisc2lo(value);
6116        self
6117    }
6118}
6119
6120bitflags! {
6121    /// `ERXMISC5` system register value.
6122    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6123    #[repr(transparent)]
6124    pub struct Erxmisc5: u32 {
6125    }
6126}
6127
6128impl Erxmisc5 {
6129    /// Offset of the `ERRnMISC2hi` field.
6130    pub const ERRNMISC2HI_SHIFT: u32 = 0;
6131    /// Mask for the `ERRnMISC2hi` field.
6132    pub const ERRNMISC2HI_MASK: u32 = 0b11111111111111111111111111111111;
6133
6134    /// Returns the value of the `ERRnMISC2hi` field.
6135    pub const fn errnmisc2hi(self) -> u32 {
6136        ((self.bits() >> Self::ERRNMISC2HI_SHIFT) & 0b11111111111111111111111111111111) as u32
6137    }
6138
6139    /// Sets the value of the `ERRnMISC2hi` field.
6140    pub const fn set_errnmisc2hi(&mut self, value: u32) {
6141        let offset = Self::ERRNMISC2HI_SHIFT;
6142        assert!(value & (Self::ERRNMISC2HI_MASK as u32) == value);
6143        *self = Self::from_bits_retain(
6144            (self.bits() & !(Self::ERRNMISC2HI_MASK << offset)) | ((value as u32) << offset),
6145        );
6146    }
6147
6148    /// Returns a copy with the `ERRnMISC2hi` field set to the given value.
6149    pub const fn with_errnmisc2hi(mut self, value: u32) -> Self {
6150        self.set_errnmisc2hi(value);
6151        self
6152    }
6153}
6154
6155bitflags! {
6156    /// `ERXMISC6` system register value.
6157    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6158    #[repr(transparent)]
6159    pub struct Erxmisc6: u32 {
6160    }
6161}
6162
6163impl Erxmisc6 {
6164    /// Offset of the `ERRnMISC3lo` field.
6165    pub const ERRNMISC3LO_SHIFT: u32 = 0;
6166    /// Mask for the `ERRnMISC3lo` field.
6167    pub const ERRNMISC3LO_MASK: u32 = 0b11111111111111111111111111111111;
6168
6169    /// Returns the value of the `ERRnMISC3lo` field.
6170    pub const fn errnmisc3lo(self) -> u32 {
6171        ((self.bits() >> Self::ERRNMISC3LO_SHIFT) & 0b11111111111111111111111111111111) as u32
6172    }
6173
6174    /// Sets the value of the `ERRnMISC3lo` field.
6175    pub const fn set_errnmisc3lo(&mut self, value: u32) {
6176        let offset = Self::ERRNMISC3LO_SHIFT;
6177        assert!(value & (Self::ERRNMISC3LO_MASK as u32) == value);
6178        *self = Self::from_bits_retain(
6179            (self.bits() & !(Self::ERRNMISC3LO_MASK << offset)) | ((value as u32) << offset),
6180        );
6181    }
6182
6183    /// Returns a copy with the `ERRnMISC3lo` field set to the given value.
6184    pub const fn with_errnmisc3lo(mut self, value: u32) -> Self {
6185        self.set_errnmisc3lo(value);
6186        self
6187    }
6188}
6189
6190bitflags! {
6191    /// `ERXMISC7` system register value.
6192    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6193    #[repr(transparent)]
6194    pub struct Erxmisc7: u32 {
6195    }
6196}
6197
6198impl Erxmisc7 {
6199    /// Offset of the `ERRnMISC3hi` field.
6200    pub const ERRNMISC3HI_SHIFT: u32 = 0;
6201    /// Mask for the `ERRnMISC3hi` field.
6202    pub const ERRNMISC3HI_MASK: u32 = 0b11111111111111111111111111111111;
6203
6204    /// Returns the value of the `ERRnMISC3hi` field.
6205    pub const fn errnmisc3hi(self) -> u32 {
6206        ((self.bits() >> Self::ERRNMISC3HI_SHIFT) & 0b11111111111111111111111111111111) as u32
6207    }
6208
6209    /// Sets the value of the `ERRnMISC3hi` field.
6210    pub const fn set_errnmisc3hi(&mut self, value: u32) {
6211        let offset = Self::ERRNMISC3HI_SHIFT;
6212        assert!(value & (Self::ERRNMISC3HI_MASK as u32) == value);
6213        *self = Self::from_bits_retain(
6214            (self.bits() & !(Self::ERRNMISC3HI_MASK << offset)) | ((value as u32) << offset),
6215        );
6216    }
6217
6218    /// Returns a copy with the `ERRnMISC3hi` field set to the given value.
6219    pub const fn with_errnmisc3hi(mut self, value: u32) -> Self {
6220        self.set_errnmisc3hi(value);
6221        self
6222    }
6223}
6224
6225bitflags! {
6226    /// `ERXSTATUS` system register value.
6227    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6228    #[repr(transparent)]
6229    pub struct Erxstatus: u32 {
6230    }
6231}
6232
6233impl Erxstatus {
6234    /// Offset of the `ERRnSTATUSlo` field.
6235    pub const ERRNSTATUSLO_SHIFT: u32 = 0;
6236    /// Mask for the `ERRnSTATUSlo` field.
6237    pub const ERRNSTATUSLO_MASK: u32 = 0b11111111111111111111111111111111;
6238
6239    /// Returns the value of the `ERRnSTATUSlo` field.
6240    pub const fn errnstatuslo(self) -> u32 {
6241        ((self.bits() >> Self::ERRNSTATUSLO_SHIFT) & 0b11111111111111111111111111111111) as u32
6242    }
6243
6244    /// Sets the value of the `ERRnSTATUSlo` field.
6245    pub const fn set_errnstatuslo(&mut self, value: u32) {
6246        let offset = Self::ERRNSTATUSLO_SHIFT;
6247        assert!(value & (Self::ERRNSTATUSLO_MASK as u32) == value);
6248        *self = Self::from_bits_retain(
6249            (self.bits() & !(Self::ERRNSTATUSLO_MASK << offset)) | ((value as u32) << offset),
6250        );
6251    }
6252
6253    /// Returns a copy with the `ERRnSTATUSlo` field set to the given value.
6254    pub const fn with_errnstatuslo(mut self, value: u32) -> Self {
6255        self.set_errnstatuslo(value);
6256        self
6257    }
6258}
6259
6260#[cfg(feature = "el1")]
6261bitflags! {
6262    /// `ESR_EL1` system register value.
6263    #[derive(Clone, Copy, Eq, Default, PartialEq)]
6264    #[repr(transparent)]
6265    pub struct EsrEl1: u64 {
6266        /// `IL` bit.
6267        const IL = 1 << 25;
6268    }
6269}
6270
6271#[cfg(feature = "el1")]
6272impl EsrEl1 {
6273    /// Offset of the `ISS` field.
6274    pub const ISS_SHIFT: u32 = 0;
6275    /// Mask for the `ISS` field.
6276    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
6277    /// Offset of the `IL` field.
6278    pub const IL_SHIFT: u32 = 25;
6279    /// Offset of the `EC` field.
6280    pub const EC_SHIFT: u32 = 26;
6281    /// Mask for the `EC` field.
6282    pub const EC_MASK: u64 = 0b111111;
6283    /// Offset of the `ISS2` field.
6284    pub const ISS2_SHIFT: u32 = 32;
6285    /// Mask for the `ISS2` field.
6286    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
6287
6288    /// Returns the value of the `ISS` field.
6289    pub const fn iss(self) -> u32 {
6290        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
6291    }
6292
6293    /// Sets the value of the `ISS` field.
6294    pub const fn set_iss(&mut self, value: u32) {
6295        let offset = Self::ISS_SHIFT;
6296        assert!(value & (Self::ISS_MASK as u32) == value);
6297        *self = Self::from_bits_retain(
6298            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
6299        );
6300    }
6301
6302    /// Returns a copy with the `ISS` field set to the given value.
6303    pub const fn with_iss(mut self, value: u32) -> Self {
6304        self.set_iss(value);
6305        self
6306    }
6307
6308    /// Returns the value of the `EC` field.
6309    pub const fn ec(self) -> u8 {
6310        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
6311    }
6312
6313    /// Sets the value of the `EC` field.
6314    pub const fn set_ec(&mut self, value: u8) {
6315        let offset = Self::EC_SHIFT;
6316        assert!(value & (Self::EC_MASK as u8) == value);
6317        *self = Self::from_bits_retain(
6318            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
6319        );
6320    }
6321
6322    /// Returns a copy with the `EC` field set to the given value.
6323    pub const fn with_ec(mut self, value: u8) -> Self {
6324        self.set_ec(value);
6325        self
6326    }
6327
6328    /// Returns the value of the `ISS2` field.
6329    pub const fn iss2(self) -> u32 {
6330        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
6331    }
6332
6333    /// Sets the value of the `ISS2` field.
6334    pub const fn set_iss2(&mut self, value: u32) {
6335        let offset = Self::ISS2_SHIFT;
6336        assert!(value & (Self::ISS2_MASK as u32) == value);
6337        *self = Self::from_bits_retain(
6338            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
6339        );
6340    }
6341
6342    /// Returns a copy with the `ISS2` field set to the given value.
6343    pub const fn with_iss2(mut self, value: u32) -> Self {
6344        self.set_iss2(value);
6345        self
6346    }
6347}
6348
6349#[cfg(feature = "el2")]
6350bitflags! {
6351    /// `ESR_EL2` system register value.
6352    #[derive(Clone, Copy, Eq, Default, PartialEq)]
6353    #[repr(transparent)]
6354    pub struct EsrEl2: u64 {
6355        /// 32-bit instruction length.
6356        const IL = 1 << 25;
6357    }
6358}
6359
6360#[cfg(feature = "el2")]
6361impl EsrEl2 {
6362    /// Offset of the `ISS` field.
6363    pub const ISS_SHIFT: u32 = 0;
6364    /// Mask for the `ISS` field.
6365    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
6366    /// Offset of the `IL` field.
6367    pub const IL_SHIFT: u32 = 25;
6368    /// Offset of the `EC` field.
6369    pub const EC_SHIFT: u32 = 26;
6370    /// Mask for the `EC` field.
6371    pub const EC_MASK: u64 = 0b111111;
6372    /// Offset of the `ISS2` field.
6373    pub const ISS2_SHIFT: u32 = 32;
6374    /// Mask for the `ISS2` field.
6375    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
6376
6377    /// Returns the value of the `ISS` field.
6378    pub const fn iss(self) -> u32 {
6379        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
6380    }
6381
6382    /// Sets the value of the `ISS` field.
6383    pub const fn set_iss(&mut self, value: u32) {
6384        let offset = Self::ISS_SHIFT;
6385        assert!(value & (Self::ISS_MASK as u32) == value);
6386        *self = Self::from_bits_retain(
6387            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
6388        );
6389    }
6390
6391    /// Returns a copy with the `ISS` field set to the given value.
6392    pub const fn with_iss(mut self, value: u32) -> Self {
6393        self.set_iss(value);
6394        self
6395    }
6396
6397    /// Returns the value of the `EC` field.
6398    pub const fn ec(self) -> u8 {
6399        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
6400    }
6401
6402    /// Sets the value of the `EC` field.
6403    pub const fn set_ec(&mut self, value: u8) {
6404        let offset = Self::EC_SHIFT;
6405        assert!(value & (Self::EC_MASK as u8) == value);
6406        *self = Self::from_bits_retain(
6407            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
6408        );
6409    }
6410
6411    /// Returns a copy with the `EC` field set to the given value.
6412    pub const fn with_ec(mut self, value: u8) -> Self {
6413        self.set_ec(value);
6414        self
6415    }
6416
6417    /// Returns the value of the `ISS2` field.
6418    pub const fn iss2(self) -> u32 {
6419        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
6420    }
6421
6422    /// Sets the value of the `ISS2` field.
6423    pub const fn set_iss2(&mut self, value: u32) {
6424        let offset = Self::ISS2_SHIFT;
6425        assert!(value & (Self::ISS2_MASK as u32) == value);
6426        *self = Self::from_bits_retain(
6427            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
6428        );
6429    }
6430
6431    /// Returns a copy with the `ISS2` field set to the given value.
6432    pub const fn with_iss2(mut self, value: u32) -> Self {
6433        self.set_iss2(value);
6434        self
6435    }
6436}
6437
6438#[cfg(feature = "el3")]
6439bitflags! {
6440    /// `ESR_EL3` system register value.
6441    #[derive(Clone, Copy, Eq, Default, PartialEq)]
6442    #[repr(transparent)]
6443    pub struct EsrEl3: u64 {
6444        /// 32-bit instruction length.
6445        const IL = 1 << 25;
6446    }
6447}
6448
6449#[cfg(feature = "el3")]
6450impl EsrEl3 {
6451    /// Offset of the `ISS` field.
6452    pub const ISS_SHIFT: u32 = 0;
6453    /// Mask for the `ISS` field.
6454    pub const ISS_MASK: u64 = 0b1111111111111111111111111;
6455    /// Offset of the `IL` field.
6456    pub const IL_SHIFT: u32 = 25;
6457    /// Offset of the `EC` field.
6458    pub const EC_SHIFT: u32 = 26;
6459    /// Mask for the `EC` field.
6460    pub const EC_MASK: u64 = 0b111111;
6461    /// Offset of the `ISS2` field.
6462    pub const ISS2_SHIFT: u32 = 32;
6463    /// Mask for the `ISS2` field.
6464    pub const ISS2_MASK: u64 = 0b111111111111111111111111;
6465
6466    /// Returns the value of the `ISS` field.
6467    pub const fn iss(self) -> u32 {
6468        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
6469    }
6470
6471    /// Sets the value of the `ISS` field.
6472    pub const fn set_iss(&mut self, value: u32) {
6473        let offset = Self::ISS_SHIFT;
6474        assert!(value & (Self::ISS_MASK as u32) == value);
6475        *self = Self::from_bits_retain(
6476            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
6477        );
6478    }
6479
6480    /// Returns a copy with the `ISS` field set to the given value.
6481    pub const fn with_iss(mut self, value: u32) -> Self {
6482        self.set_iss(value);
6483        self
6484    }
6485
6486    /// Returns the value of the `EC` field.
6487    pub const fn ec(self) -> u8 {
6488        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
6489    }
6490
6491    /// Sets the value of the `EC` field.
6492    pub const fn set_ec(&mut self, value: u8) {
6493        let offset = Self::EC_SHIFT;
6494        assert!(value & (Self::EC_MASK as u8) == value);
6495        *self = Self::from_bits_retain(
6496            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u64) << offset),
6497        );
6498    }
6499
6500    /// Returns a copy with the `EC` field set to the given value.
6501    pub const fn with_ec(mut self, value: u8) -> Self {
6502        self.set_ec(value);
6503        self
6504    }
6505
6506    /// Returns the value of the `ISS2` field.
6507    pub const fn iss2(self) -> u32 {
6508        ((self.bits() >> Self::ISS2_SHIFT) & 0b111111111111111111111111) as u32
6509    }
6510
6511    /// Sets the value of the `ISS2` field.
6512    pub const fn set_iss2(&mut self, value: u32) {
6513        let offset = Self::ISS2_SHIFT;
6514        assert!(value & (Self::ISS2_MASK as u32) == value);
6515        *self = Self::from_bits_retain(
6516            (self.bits() & !(Self::ISS2_MASK << offset)) | ((value as u64) << offset),
6517        );
6518    }
6519
6520    /// Returns a copy with the `ISS2` field set to the given value.
6521    pub const fn with_iss2(mut self, value: u32) -> Self {
6522        self.set_iss2(value);
6523        self
6524    }
6525}
6526
6527#[cfg(feature = "el1")]
6528bitflags! {
6529    /// `FAR_EL1` system register value.
6530    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6531    #[repr(transparent)]
6532    pub struct FarEl1: u64 {
6533    }
6534}
6535
6536#[cfg(feature = "el1")]
6537impl FarEl1 {
6538    /// Offset of the `VA` field.
6539    pub const VA_SHIFT: u32 = 0;
6540    /// Mask for the `VA` field.
6541    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
6542
6543    /// Returns the value of the `VA` field.
6544    pub const fn va(self) -> u64 {
6545        ((self.bits() >> Self::VA_SHIFT)
6546            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
6547    }
6548
6549    /// Sets the value of the `VA` field.
6550    pub const fn set_va(&mut self, value: u64) {
6551        let offset = Self::VA_SHIFT;
6552        assert!(value & (Self::VA_MASK as u64) == value);
6553        *self = Self::from_bits_retain(
6554            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u64) << offset),
6555        );
6556    }
6557
6558    /// Returns a copy with the `VA` field set to the given value.
6559    pub const fn with_va(mut self, value: u64) -> Self {
6560        self.set_va(value);
6561        self
6562    }
6563}
6564
6565#[cfg(feature = "el2")]
6566bitflags! {
6567    /// `FAR_EL2` system register value.
6568    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6569    #[repr(transparent)]
6570    pub struct FarEl2: u64 {
6571    }
6572}
6573
6574#[cfg(feature = "el2")]
6575impl FarEl2 {
6576    /// Offset of the `VA` field.
6577    pub const VA_SHIFT: u32 = 0;
6578    /// Mask for the `VA` field.
6579    pub const VA_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
6580
6581    /// Returns the value of the `VA` field.
6582    pub const fn va(self) -> u64 {
6583        ((self.bits() >> Self::VA_SHIFT)
6584            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
6585    }
6586
6587    /// Sets the value of the `VA` field.
6588    pub const fn set_va(&mut self, value: u64) {
6589        let offset = Self::VA_SHIFT;
6590        assert!(value & (Self::VA_MASK as u64) == value);
6591        *self = Self::from_bits_retain(
6592            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u64) << offset),
6593        );
6594    }
6595
6596    /// Returns a copy with the `VA` field set to the given value.
6597    pub const fn with_va(mut self, value: u64) -> Self {
6598        self.set_va(value);
6599        self
6600    }
6601}
6602
6603#[cfg(feature = "el1")]
6604bitflags! {
6605    /// `GCR_EL1` system register value.
6606    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6607    #[repr(transparent)]
6608    pub struct GcrEl1: u64 {
6609        /// `RRND` bit.
6610        const RRND = 1 << 16;
6611    }
6612}
6613
6614#[cfg(feature = "el1")]
6615impl GcrEl1 {
6616    /// Offset of the `Exclude` field.
6617    pub const EXCLUDE_SHIFT: u32 = 0;
6618    /// Mask for the `Exclude` field.
6619    pub const EXCLUDE_MASK: u64 = 0b1111111111111111;
6620    /// Offset of the `RRND` field.
6621    pub const RRND_SHIFT: u32 = 16;
6622
6623    /// Returns the value of the `Exclude` field.
6624    pub const fn exclude(self) -> u16 {
6625        ((self.bits() >> Self::EXCLUDE_SHIFT) & 0b1111111111111111) as u16
6626    }
6627
6628    /// Sets the value of the `Exclude` field.
6629    pub const fn set_exclude(&mut self, value: u16) {
6630        let offset = Self::EXCLUDE_SHIFT;
6631        assert!(value & (Self::EXCLUDE_MASK as u16) == value);
6632        *self = Self::from_bits_retain(
6633            (self.bits() & !(Self::EXCLUDE_MASK << offset)) | ((value as u64) << offset),
6634        );
6635    }
6636
6637    /// Returns a copy with the `Exclude` field set to the given value.
6638    pub const fn with_exclude(mut self, value: u16) -> Self {
6639        self.set_exclude(value);
6640        self
6641    }
6642}
6643
6644#[cfg(feature = "el1")]
6645bitflags! {
6646    /// `GCSCR_EL1` system register value.
6647    ///
6648    /// Guarded Control Stack Control register.
6649    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6650    #[repr(transparent)]
6651    pub struct GcscrEl1: u64 {
6652        /// `PCRSEL` bit.
6653        const PCRSEL = 1 << 0;
6654        /// `RVCHKEN` bit.
6655        const RVCHKEN = 1 << 5;
6656        /// Exception state lock enable.
6657        const EXLOCKEN = 1 << 6;
6658        /// `PUSHMEn` bit.
6659        const PUSHMEN = 1 << 8;
6660        /// `STREn` bit.
6661        const STREN = 1 << 9;
6662    }
6663}
6664
6665#[cfg(feature = "el1")]
6666impl GcscrEl1 {
6667    /// Offset of the `PCRSEL` field.
6668    pub const PCRSEL_SHIFT: u32 = 0;
6669    /// Offset of the `RVCHKEN` field.
6670    pub const RVCHKEN_SHIFT: u32 = 5;
6671    /// Offset of the `EXLOCKEN` field.
6672    pub const EXLOCKEN_SHIFT: u32 = 6;
6673    /// Offset of the `PUSHMEn` field.
6674    pub const PUSHMEN_SHIFT: u32 = 8;
6675    /// Offset of the `STREn` field.
6676    pub const STREN_SHIFT: u32 = 9;
6677}
6678
6679#[cfg(feature = "el2")]
6680bitflags! {
6681    /// `GCSCR_EL2` system register value.
6682    ///
6683    /// Guarded Control Stack Control register.
6684    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6685    #[repr(transparent)]
6686    pub struct GcscrEl2: u64 {
6687        /// `PCRSEL` bit.
6688        const PCRSEL = 1 << 0;
6689        /// `RVCHKEN` bit.
6690        const RVCHKEN = 1 << 5;
6691        /// Exception state lock enable.
6692        const EXLOCKEN = 1 << 6;
6693        /// `PUSHMEn` bit.
6694        const PUSHMEN = 1 << 8;
6695        /// `STREn` bit.
6696        const STREN = 1 << 9;
6697    }
6698}
6699
6700#[cfg(feature = "el2")]
6701impl GcscrEl2 {
6702    /// Offset of the `PCRSEL` field.
6703    pub const PCRSEL_SHIFT: u32 = 0;
6704    /// Offset of the `RVCHKEN` field.
6705    pub const RVCHKEN_SHIFT: u32 = 5;
6706    /// Offset of the `EXLOCKEN` field.
6707    pub const EXLOCKEN_SHIFT: u32 = 6;
6708    /// Offset of the `PUSHMEn` field.
6709    pub const PUSHMEN_SHIFT: u32 = 8;
6710    /// Offset of the `STREn` field.
6711    pub const STREN_SHIFT: u32 = 9;
6712}
6713
6714#[cfg(feature = "el3")]
6715bitflags! {
6716    /// `GPCCR_EL3` system register value.
6717    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6718    #[repr(transparent)]
6719    pub struct GpccrEl3: u64 {
6720        /// `PPS3` bit.
6721        const PPS3 = 1 << 3;
6722        /// `RLPAD` bit.
6723        const RLPAD = 1 << 5;
6724        /// `NSPAD` bit.
6725        const NSPAD = 1 << 6;
6726        /// `SPAD` bit.
6727        const SPAD = 1 << 7;
6728        /// `GPC` bit.
6729        const GPC = 1 << 16;
6730        /// `GPCP` bit.
6731        const GPCP = 1 << 17;
6732        /// `TBGPCD` bit.
6733        const TBGPCD = 1 << 18;
6734        /// `NSO` bit.
6735        const NSO = 1 << 19;
6736        /// `APPSAA` bit.
6737        const APPSAA = 1 << 24;
6738        /// `SA` bit.
6739        const SA = 1 << 25;
6740        /// `NSP` bit.
6741        const NSP = 1 << 26;
6742        /// `NA6` bit.
6743        const NA6 = 1 << 27;
6744        /// `NA7` bit.
6745        const NA7 = 1 << 28;
6746        /// `GPCBW` bit.
6747        const GPCBW = 1 << 29;
6748    }
6749}
6750
6751#[cfg(feature = "el3")]
6752impl GpccrEl3 {
6753    /// Offset of the `PPS` field.
6754    pub const PPS_SHIFT: u32 = 0;
6755    /// Mask for the `PPS` field.
6756    pub const PPS_MASK: u64 = 0b111;
6757    /// Offset of the `PPS3` field.
6758    pub const PPS3_SHIFT: u32 = 3;
6759    /// Offset of the `RLPAD` field.
6760    pub const RLPAD_SHIFT: u32 = 5;
6761    /// Offset of the `NSPAD` field.
6762    pub const NSPAD_SHIFT: u32 = 6;
6763    /// Offset of the `SPAD` field.
6764    pub const SPAD_SHIFT: u32 = 7;
6765    /// Offset of the `IRGN` field.
6766    pub const IRGN_SHIFT: u32 = 8;
6767    /// Mask for the `IRGN` field.
6768    pub const IRGN_MASK: u64 = 0b11;
6769    /// Offset of the `ORGN` field.
6770    pub const ORGN_SHIFT: u32 = 10;
6771    /// Mask for the `ORGN` field.
6772    pub const ORGN_MASK: u64 = 0b11;
6773    /// Offset of the `SH` field.
6774    pub const SH_SHIFT: u32 = 12;
6775    /// Mask for the `SH` field.
6776    pub const SH_MASK: u64 = 0b11;
6777    /// Offset of the `PGS` field.
6778    pub const PGS_SHIFT: u32 = 14;
6779    /// Mask for the `PGS` field.
6780    pub const PGS_MASK: u64 = 0b11;
6781    /// Offset of the `GPC` field.
6782    pub const GPC_SHIFT: u32 = 16;
6783    /// Offset of the `GPCP` field.
6784    pub const GPCP_SHIFT: u32 = 17;
6785    /// Offset of the `TBGPCD` field.
6786    pub const TBGPCD_SHIFT: u32 = 18;
6787    /// Offset of the `NSO` field.
6788    pub const NSO_SHIFT: u32 = 19;
6789    /// Offset of the `L0GPTSZ` field.
6790    pub const L0GPTSZ_SHIFT: u32 = 20;
6791    /// Mask for the `L0GPTSZ` field.
6792    pub const L0GPTSZ_MASK: u64 = 0b1111;
6793    /// Offset of the `APPSAA` field.
6794    pub const APPSAA_SHIFT: u32 = 24;
6795    /// Offset of the `SA` field.
6796    pub const SA_SHIFT: u32 = 25;
6797    /// Offset of the `NSP` field.
6798    pub const NSP_SHIFT: u32 = 26;
6799    /// Offset of the `NA6` field.
6800    pub const NA6_SHIFT: u32 = 27;
6801    /// Offset of the `NA7` field.
6802    pub const NA7_SHIFT: u32 = 28;
6803    /// Offset of the `GPCBW` field.
6804    pub const GPCBW_SHIFT: u32 = 29;
6805
6806    /// Returns the value of the `PPS` field.
6807    pub const fn pps(self) -> u8 {
6808        ((self.bits() >> Self::PPS_SHIFT) & 0b111) as u8
6809    }
6810
6811    /// Sets the value of the `PPS` field.
6812    pub const fn set_pps(&mut self, value: u8) {
6813        let offset = Self::PPS_SHIFT;
6814        assert!(value & (Self::PPS_MASK as u8) == value);
6815        *self = Self::from_bits_retain(
6816            (self.bits() & !(Self::PPS_MASK << offset)) | ((value as u64) << offset),
6817        );
6818    }
6819
6820    /// Returns a copy with the `PPS` field set to the given value.
6821    pub const fn with_pps(mut self, value: u8) -> Self {
6822        self.set_pps(value);
6823        self
6824    }
6825
6826    /// Returns the value of the `IRGN` field.
6827    pub fn irgn(self) -> crate::manual::Cacheability {
6828        crate::manual::Cacheability::try_from(((self.bits() >> Self::IRGN_SHIFT) & 0b11) as u8)
6829            .unwrap()
6830    }
6831
6832    /// Sets the value of the `IRGN` field.
6833    pub fn set_irgn(&mut self, value: crate::manual::Cacheability) {
6834        let offset = Self::IRGN_SHIFT;
6835        let value: u8 = value.into();
6836        assert!(value & (Self::IRGN_MASK as u8) == value);
6837        *self = Self::from_bits_retain(
6838            (self.bits() & !(Self::IRGN_MASK << offset)) | ((value as u64) << offset),
6839        );
6840    }
6841
6842    /// Returns a copy with the `IRGN` field set to the given value.
6843    pub fn with_irgn(mut self, value: crate::manual::Cacheability) -> Self {
6844        self.set_irgn(value);
6845        self
6846    }
6847
6848    /// Returns the value of the `ORGN` field.
6849    pub fn orgn(self) -> crate::manual::Cacheability {
6850        crate::manual::Cacheability::try_from(((self.bits() >> Self::ORGN_SHIFT) & 0b11) as u8)
6851            .unwrap()
6852    }
6853
6854    /// Sets the value of the `ORGN` field.
6855    pub fn set_orgn(&mut self, value: crate::manual::Cacheability) {
6856        let offset = Self::ORGN_SHIFT;
6857        let value: u8 = value.into();
6858        assert!(value & (Self::ORGN_MASK as u8) == value);
6859        *self = Self::from_bits_retain(
6860            (self.bits() & !(Self::ORGN_MASK << offset)) | ((value as u64) << offset),
6861        );
6862    }
6863
6864    /// Returns a copy with the `ORGN` field set to the given value.
6865    pub fn with_orgn(mut self, value: crate::manual::Cacheability) -> Self {
6866        self.set_orgn(value);
6867        self
6868    }
6869
6870    /// Returns the value of the `SH` field.
6871    pub fn sh(self) -> crate::manual::Shareability {
6872        crate::manual::Shareability::try_from(((self.bits() >> Self::SH_SHIFT) & 0b11) as u8)
6873            .unwrap()
6874    }
6875
6876    /// Sets the value of the `SH` field.
6877    pub fn set_sh(&mut self, value: crate::manual::Shareability) {
6878        let offset = Self::SH_SHIFT;
6879        let value: u8 = value.into();
6880        assert!(value & (Self::SH_MASK as u8) == value);
6881        *self = Self::from_bits_retain(
6882            (self.bits() & !(Self::SH_MASK << offset)) | ((value as u64) << offset),
6883        );
6884    }
6885
6886    /// Returns a copy with the `SH` field set to the given value.
6887    pub fn with_sh(mut self, value: crate::manual::Shareability) -> Self {
6888        self.set_sh(value);
6889        self
6890    }
6891
6892    /// Returns the value of the `PGS` field.
6893    pub const fn pgs(self) -> u8 {
6894        ((self.bits() >> Self::PGS_SHIFT) & 0b11) as u8
6895    }
6896
6897    /// Sets the value of the `PGS` field.
6898    pub const fn set_pgs(&mut self, value: u8) {
6899        let offset = Self::PGS_SHIFT;
6900        assert!(value & (Self::PGS_MASK as u8) == value);
6901        *self = Self::from_bits_retain(
6902            (self.bits() & !(Self::PGS_MASK << offset)) | ((value as u64) << offset),
6903        );
6904    }
6905
6906    /// Returns a copy with the `PGS` field set to the given value.
6907    pub const fn with_pgs(mut self, value: u8) -> Self {
6908        self.set_pgs(value);
6909        self
6910    }
6911
6912    /// Returns the value of the `L0GPTSZ` field.
6913    pub const fn l0gptsz(self) -> u8 {
6914        ((self.bits() >> Self::L0GPTSZ_SHIFT) & 0b1111) as u8
6915    }
6916
6917    /// Sets the value of the `L0GPTSZ` field.
6918    pub const fn set_l0gptsz(&mut self, value: u8) {
6919        let offset = Self::L0GPTSZ_SHIFT;
6920        assert!(value & (Self::L0GPTSZ_MASK as u8) == value);
6921        *self = Self::from_bits_retain(
6922            (self.bits() & !(Self::L0GPTSZ_MASK << offset)) | ((value as u64) << offset),
6923        );
6924    }
6925
6926    /// Returns a copy with the `L0GPTSZ` field set to the given value.
6927    pub const fn with_l0gptsz(mut self, value: u8) -> Self {
6928        self.set_l0gptsz(value);
6929        self
6930    }
6931}
6932
6933#[cfg(feature = "el3")]
6934bitflags! {
6935    /// `GPTBR_EL3` system register value.
6936    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6937    #[repr(transparent)]
6938    pub struct GptbrEl3: u64 {
6939    }
6940}
6941
6942#[cfg(feature = "el3")]
6943impl GptbrEl3 {
6944    /// Offset of the `BADDR` field.
6945    pub const BADDR_SHIFT: u32 = 0;
6946    /// Mask for the `BADDR` field.
6947    pub const BADDR_MASK: u64 = 0b1111111111111111111111111111111111111111;
6948    /// Offset of the `BADDR[43:40]` field.
6949    pub const BADDR_43_40_SHIFT: u32 = 40;
6950    /// Mask for the `BADDR[43:40]` field.
6951    pub const BADDR_43_40_MASK: u64 = 0b1111;
6952
6953    /// Returns the value of the `BADDR` field.
6954    pub const fn baddr(self) -> u64 {
6955        ((self.bits() >> Self::BADDR_SHIFT) & 0b1111111111111111111111111111111111111111) as u64
6956    }
6957
6958    /// Sets the value of the `BADDR` field.
6959    pub const fn set_baddr(&mut self, value: u64) {
6960        let offset = Self::BADDR_SHIFT;
6961        assert!(value & (Self::BADDR_MASK as u64) == value);
6962        *self = Self::from_bits_retain(
6963            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
6964        );
6965    }
6966
6967    /// Returns a copy with the `BADDR` field set to the given value.
6968    pub const fn with_baddr(mut self, value: u64) -> Self {
6969        self.set_baddr(value);
6970        self
6971    }
6972
6973    /// Returns the value of the `BADDR[43:40]` field.
6974    pub const fn baddr_43_40(self) -> u8 {
6975        ((self.bits() >> Self::BADDR_43_40_SHIFT) & 0b1111) as u8
6976    }
6977
6978    /// Sets the value of the `BADDR[43:40]` field.
6979    pub const fn set_baddr_43_40(&mut self, value: u8) {
6980        let offset = Self::BADDR_43_40_SHIFT;
6981        assert!(value & (Self::BADDR_43_40_MASK as u8) == value);
6982        *self = Self::from_bits_retain(
6983            (self.bits() & !(Self::BADDR_43_40_MASK << offset)) | ((value as u64) << offset),
6984        );
6985    }
6986
6987    /// Returns a copy with the `BADDR[43:40]` field set to the given value.
6988    pub const fn with_baddr_43_40(mut self, value: u8) -> Self {
6989        self.set_baddr_43_40(value);
6990        self
6991    }
6992}
6993
6994#[cfg(feature = "el2")]
6995bitflags! {
6996    /// `HAFGRTR_EL2` system register value.
6997    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
6998    #[repr(transparent)]
6999    pub struct HafgrtrEl2: u64 {
7000        /// `AMEVCNTR0<x>_EL0` bit 0.
7001        const AMEVCNTR00_EL0 = 1 << 1;
7002        /// `AMEVCNTR0<x>_EL0` bit 1.
7003        const AMEVCNTR01_EL0 = 1 << 2;
7004        /// `AMEVCNTR0<x>_EL0` bit 2.
7005        const AMEVCNTR02_EL0 = 1 << 3;
7006        /// `AMEVCNTR0<x>_EL0` bit 3.
7007        const AMEVCNTR03_EL0 = 1 << 4;
7008    }
7009}
7010
7011#[cfg(feature = "el2")]
7012impl HafgrtrEl2 {
7013    /// Offset of the `AMEVCNTR0<x>_EL0` field.
7014    pub const AMEVCNTR0_EL0_SHIFT: u32 = 1;
7015}
7016
7017bitflags! {
7018    /// `HCPTR` system register value.
7019    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7020    #[repr(transparent)]
7021    pub struct Hcptr: u32 {
7022        /// RES1 bits in the `HCPTR` register.
7023        const RES1 = 0b11001111111111;
7024        /// `TCP10` bit.
7025        const TCP10 = 1 << 10;
7026        /// `TCP11` bit.
7027        const TCP11 = 1 << 11;
7028        /// `TASE` bit.
7029        const TASE = 1 << 15;
7030        /// `TTA` bit.
7031        const TTA = 1 << 20;
7032        /// `TAM` bit.
7033        const TAM = 1 << 30;
7034        /// `TCPAC` bit.
7035        const TCPAC = 1 << 31;
7036    }
7037}
7038
7039impl Hcptr {
7040    /// Offset of the `TCP10` field.
7041    pub const TCP10_SHIFT: u32 = 10;
7042    /// Offset of the `TCP11` field.
7043    pub const TCP11_SHIFT: u32 = 11;
7044    /// Offset of the `TASE` field.
7045    pub const TASE_SHIFT: u32 = 15;
7046    /// Offset of the `TTA` field.
7047    pub const TTA_SHIFT: u32 = 20;
7048    /// Offset of the `TAM` field.
7049    pub const TAM_SHIFT: u32 = 30;
7050    /// Offset of the `TCPAC` field.
7051    pub const TCPAC_SHIFT: u32 = 31;
7052}
7053
7054bitflags! {
7055    /// `HCR` system register value.
7056    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7057    #[repr(transparent)]
7058    pub struct Hcr: u32 {
7059        /// `VM` bit.
7060        const VM = 1 << 0;
7061        /// `SWIO` bit.
7062        const SWIO = 1 << 1;
7063        /// `PTW` bit.
7064        const PTW = 1 << 2;
7065        /// `FMO` bit.
7066        const FMO = 1 << 3;
7067        /// `IMO` bit.
7068        const IMO = 1 << 4;
7069        /// `AMO` bit.
7070        const AMO = 1 << 5;
7071        /// `VF` bit.
7072        const VF = 1 << 6;
7073        /// `VI` bit.
7074        const VI = 1 << 7;
7075        /// `VA` bit.
7076        const VA = 1 << 8;
7077        /// `FB` bit.
7078        const FB = 1 << 9;
7079        /// `DC` bit.
7080        const DC = 1 << 12;
7081        /// `TWI` bit.
7082        const TWI = 1 << 13;
7083        /// `TWE` bit.
7084        const TWE = 1 << 14;
7085        /// `TID0` bit.
7086        const TID0 = 1 << 15;
7087        /// `TID1` bit.
7088        const TID1 = 1 << 16;
7089        /// `TID2` bit.
7090        const TID2 = 1 << 17;
7091        /// `TID3` bit.
7092        const TID3 = 1 << 18;
7093        /// `TSC` bit.
7094        const TSC = 1 << 19;
7095        /// `TIDCP` bit.
7096        const TIDCP = 1 << 20;
7097        /// `TAC` bit.
7098        const TAC = 1 << 21;
7099        /// `TSW` bit.
7100        const TSW = 1 << 22;
7101        /// `TPC` bit.
7102        const TPC = 1 << 23;
7103        /// `TPU` bit.
7104        const TPU = 1 << 24;
7105        /// `TTLB` bit.
7106        const TTLB = 1 << 25;
7107        /// `TVM` bit.
7108        const TVM = 1 << 26;
7109        /// `TGE` bit.
7110        const TGE = 1 << 27;
7111        /// `HCD` bit.
7112        const HCD = 1 << 29;
7113        /// `TRVM` bit.
7114        const TRVM = 1 << 30;
7115    }
7116}
7117
7118impl Hcr {
7119    /// Offset of the `VM` field.
7120    pub const VM_SHIFT: u32 = 0;
7121    /// Offset of the `SWIO` field.
7122    pub const SWIO_SHIFT: u32 = 1;
7123    /// Offset of the `PTW` field.
7124    pub const PTW_SHIFT: u32 = 2;
7125    /// Offset of the `FMO` field.
7126    pub const FMO_SHIFT: u32 = 3;
7127    /// Offset of the `IMO` field.
7128    pub const IMO_SHIFT: u32 = 4;
7129    /// Offset of the `AMO` field.
7130    pub const AMO_SHIFT: u32 = 5;
7131    /// Offset of the `VF` field.
7132    pub const VF_SHIFT: u32 = 6;
7133    /// Offset of the `VI` field.
7134    pub const VI_SHIFT: u32 = 7;
7135    /// Offset of the `VA` field.
7136    pub const VA_SHIFT: u32 = 8;
7137    /// Offset of the `FB` field.
7138    pub const FB_SHIFT: u32 = 9;
7139    /// Offset of the `BSU` field.
7140    pub const BSU_SHIFT: u32 = 10;
7141    /// Mask for the `BSU` field.
7142    pub const BSU_MASK: u32 = 0b11;
7143    /// Offset of the `DC` field.
7144    pub const DC_SHIFT: u32 = 12;
7145    /// Offset of the `TWI` field.
7146    pub const TWI_SHIFT: u32 = 13;
7147    /// Offset of the `TWE` field.
7148    pub const TWE_SHIFT: u32 = 14;
7149    /// Offset of the `TID0` field.
7150    pub const TID0_SHIFT: u32 = 15;
7151    /// Offset of the `TID1` field.
7152    pub const TID1_SHIFT: u32 = 16;
7153    /// Offset of the `TID2` field.
7154    pub const TID2_SHIFT: u32 = 17;
7155    /// Offset of the `TID3` field.
7156    pub const TID3_SHIFT: u32 = 18;
7157    /// Offset of the `TSC` field.
7158    pub const TSC_SHIFT: u32 = 19;
7159    /// Offset of the `TIDCP` field.
7160    pub const TIDCP_SHIFT: u32 = 20;
7161    /// Offset of the `TAC` field.
7162    pub const TAC_SHIFT: u32 = 21;
7163    /// Offset of the `TSW` field.
7164    pub const TSW_SHIFT: u32 = 22;
7165    /// Offset of the `TPC` field.
7166    pub const TPC_SHIFT: u32 = 23;
7167    /// Offset of the `TPU` field.
7168    pub const TPU_SHIFT: u32 = 24;
7169    /// Offset of the `TTLB` field.
7170    pub const TTLB_SHIFT: u32 = 25;
7171    /// Offset of the `TVM` field.
7172    pub const TVM_SHIFT: u32 = 26;
7173    /// Offset of the `TGE` field.
7174    pub const TGE_SHIFT: u32 = 27;
7175    /// Offset of the `HCD` field.
7176    pub const HCD_SHIFT: u32 = 29;
7177    /// Offset of the `TRVM` field.
7178    pub const TRVM_SHIFT: u32 = 30;
7179
7180    /// Returns the value of the `BSU` field.
7181    pub const fn bsu(self) -> u8 {
7182        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
7183    }
7184
7185    /// Sets the value of the `BSU` field.
7186    pub const fn set_bsu(&mut self, value: u8) {
7187        let offset = Self::BSU_SHIFT;
7188        assert!(value & (Self::BSU_MASK as u8) == value);
7189        *self = Self::from_bits_retain(
7190            (self.bits() & !(Self::BSU_MASK << offset)) | ((value as u32) << offset),
7191        );
7192    }
7193
7194    /// Returns a copy with the `BSU` field set to the given value.
7195    pub const fn with_bsu(mut self, value: u8) -> Self {
7196        self.set_bsu(value);
7197        self
7198    }
7199}
7200
7201bitflags! {
7202    /// `HCR2` system register value.
7203    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7204    #[repr(transparent)]
7205    pub struct Hcr2: u32 {
7206        /// `CD` bit.
7207        const CD = 1 << 0;
7208        /// `ID` bit.
7209        const ID = 1 << 1;
7210        /// `TERR` bit.
7211        const TERR = 1 << 4;
7212        /// `TEA` bit.
7213        const TEA = 1 << 5;
7214        /// `TID4` bit.
7215        const TID4 = 1 << 17;
7216        /// `TICAB` bit.
7217        const TICAB = 1 << 18;
7218        /// `TOCU` bit.
7219        const TOCU = 1 << 20;
7220        /// `TTLBIS` bit.
7221        const TTLBIS = 1 << 22;
7222    }
7223}
7224
7225impl Hcr2 {
7226    /// Offset of the `CD` field.
7227    pub const CD_SHIFT: u32 = 0;
7228    /// Offset of the `ID` field.
7229    pub const ID_SHIFT: u32 = 1;
7230    /// Offset of the `TERR` field.
7231    pub const TERR_SHIFT: u32 = 4;
7232    /// Offset of the `TEA` field.
7233    pub const TEA_SHIFT: u32 = 5;
7234    /// Offset of the `TID4` field.
7235    pub const TID4_SHIFT: u32 = 17;
7236    /// Offset of the `TICAB` field.
7237    pub const TICAB_SHIFT: u32 = 18;
7238    /// Offset of the `TOCU` field.
7239    pub const TOCU_SHIFT: u32 = 20;
7240    /// Offset of the `TTLBIS` field.
7241    pub const TTLBIS_SHIFT: u32 = 22;
7242}
7243
7244#[cfg(feature = "el2")]
7245bitflags! {
7246    /// `HCRX_EL2` system register value.
7247    ///
7248    /// Extended Hypervisor Configuration Register.
7249    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7250    #[repr(transparent)]
7251    pub struct HcrxEl2: u64 {
7252        /// Do not trap execution of an ST64BV0 instruction at EL0 or EL1 to EL2.
7253        const ENAS0 = 1 << 0;
7254        /// Do not trap execution of an LD64B or ST64B instruction at EL0 or EL1 to EL2.
7255        const ENALS = 1 << 1;
7256        /// Do not trap execution of an ST64BV instruction at EL0 or EL1 to EL2.
7257        const ENASR = 1 << 2;
7258        /// Determines the behavior of TLBI instructions affected by the XS attribute.
7259        const FNXS = 1 << 3;
7260        /// Determines if the fine-grained traps in HFGITR_EL2 also apply to the corresponding TLBI maintenance instructions with the nXS qualifier.
7261        const FGTNXS = 1 << 4;
7262        /// Controls mapping of the value of SMPRI_EL1.Priority for streaming execution priority at EL0 or EL1.
7263        const SMPME = 1 << 5;
7264        /// Traps MSR writes of ALLINT at EL1 using AArch64 to EL2.
7265        const TALLINT = 1 << 6;
7266        /// Enables signaling of virtual IRQ interrupts with Superpriority.
7267        const VINMI = 1 << 7;
7268        /// Enables signaling of virtual FIQ interrupts with Superpriority.
7269        const VFNMI = 1 << 8;
7270        /// Controls the required permissions for cache maintenance instructions at EL1 or EL0.
7271        const CMOW = 1 << 9;
7272        /// Controls Memory Copy and Memory Set exceptions generated from EL1.
7273        const MCE2 = 1 << 10;
7274        /// Enables execution of Memory Set and Memory Copy instructions at EL1 or EL0.
7275        const MSCEN = 1 << 11;
7276        /// `TCR2En` bit.
7277        const TCR2EN = 1 << 14;
7278        /// `SCTLR2En` bit.
7279        const SCTLR2EN = 1 << 15;
7280        /// `PTTWI` bit.
7281        const PTTWI = 1 << 16;
7282        /// `D128En` bit.
7283        const D128EN = 1 << 17;
7284        /// `EnSNERR` bit.
7285        const ENSNERR = 1 << 18;
7286        /// `TMEA` bit.
7287        const TMEA = 1 << 19;
7288        /// `EnSDERR` bit.
7289        const ENSDERR = 1 << 20;
7290        /// `EnIDCP128` bit.
7291        const ENIDCP128 = 1 << 21;
7292        /// `GCSEn` bit.
7293        const GCSEN = 1 << 22;
7294        /// `EnFPM` bit.
7295        const ENFPM = 1 << 23;
7296        /// `PACMEn` bit.
7297        const PACMEN = 1 << 24;
7298        /// `VTLBIDEn` bit.
7299        const VTLBIDEN = 1 << 25;
7300        /// `SRMASKEn` bit.
7301        const SRMASKEN = 1 << 26;
7302        /// `NVTGE` bit.
7303        const NVTGE = 1 << 27;
7304        /// `POE2En` bit.
7305        const POE2EN = 1 << 29;
7306        /// `TPLIMEn` bit.
7307        const TPLIMEN = 1 << 30;
7308        /// `FDIT` bit.
7309        const FDIT = 1 << 31;
7310        /// `NVnTTLB` bit.
7311        const NVNTTLB = 1 << 32;
7312        /// `NVnTTLBIS` bit.
7313        const NVNTTLBIS = 1 << 33;
7314        /// `NVnTTLBOS` bit.
7315        const NVNTTLBOS = 1 << 34;
7316        /// `VTLBIDOSEn` bit.
7317        const VTLBIDOSEN = 1 << 35;
7318        /// `FNB` bit.
7319        const FNB = 1 << 36;
7320        /// `VTE` bit.
7321        const VTE = 1 << 37;
7322        /// `VTAO` bit.
7323        const VTAO = 1 << 38;
7324        /// `VTCO` bit.
7325        const VTCO = 1 << 39;
7326    }
7327}
7328
7329#[cfg(feature = "el2")]
7330impl HcrxEl2 {
7331    /// Offset of the `EnAS0` field.
7332    pub const ENAS0_SHIFT: u32 = 0;
7333    /// Offset of the `EnALS` field.
7334    pub const ENALS_SHIFT: u32 = 1;
7335    /// Offset of the `EnASR` field.
7336    pub const ENASR_SHIFT: u32 = 2;
7337    /// Offset of the `FnXS` field.
7338    pub const FNXS_SHIFT: u32 = 3;
7339    /// Offset of the `FGTnXS` field.
7340    pub const FGTNXS_SHIFT: u32 = 4;
7341    /// Offset of the `SMPME` field.
7342    pub const SMPME_SHIFT: u32 = 5;
7343    /// Offset of the `TALLINT` field.
7344    pub const TALLINT_SHIFT: u32 = 6;
7345    /// Offset of the `VINMI` field.
7346    pub const VINMI_SHIFT: u32 = 7;
7347    /// Offset of the `VFNMI` field.
7348    pub const VFNMI_SHIFT: u32 = 8;
7349    /// Offset of the `CMOW` field.
7350    pub const CMOW_SHIFT: u32 = 9;
7351    /// Offset of the `MCE2` field.
7352    pub const MCE2_SHIFT: u32 = 10;
7353    /// Offset of the `MSCEn` field.
7354    pub const MSCEN_SHIFT: u32 = 11;
7355    /// Offset of the `TCR2En` field.
7356    pub const TCR2EN_SHIFT: u32 = 14;
7357    /// Offset of the `SCTLR2En` field.
7358    pub const SCTLR2EN_SHIFT: u32 = 15;
7359    /// Offset of the `PTTWI` field.
7360    pub const PTTWI_SHIFT: u32 = 16;
7361    /// Offset of the `D128En` field.
7362    pub const D128EN_SHIFT: u32 = 17;
7363    /// Offset of the `EnSNERR` field.
7364    pub const ENSNERR_SHIFT: u32 = 18;
7365    /// Offset of the `TMEA` field.
7366    pub const TMEA_SHIFT: u32 = 19;
7367    /// Offset of the `EnSDERR` field.
7368    pub const ENSDERR_SHIFT: u32 = 20;
7369    /// Offset of the `EnIDCP128` field.
7370    pub const ENIDCP128_SHIFT: u32 = 21;
7371    /// Offset of the `GCSEn` field.
7372    pub const GCSEN_SHIFT: u32 = 22;
7373    /// Offset of the `EnFPM` field.
7374    pub const ENFPM_SHIFT: u32 = 23;
7375    /// Offset of the `PACMEn` field.
7376    pub const PACMEN_SHIFT: u32 = 24;
7377    /// Offset of the `VTLBIDEn` field.
7378    pub const VTLBIDEN_SHIFT: u32 = 25;
7379    /// Offset of the `SRMASKEn` field.
7380    pub const SRMASKEN_SHIFT: u32 = 26;
7381    /// Offset of the `NVTGE` field.
7382    pub const NVTGE_SHIFT: u32 = 27;
7383    /// Offset of the `POE2En` field.
7384    pub const POE2EN_SHIFT: u32 = 29;
7385    /// Offset of the `TPLIMEn` field.
7386    pub const TPLIMEN_SHIFT: u32 = 30;
7387    /// Offset of the `FDIT` field.
7388    pub const FDIT_SHIFT: u32 = 31;
7389    /// Offset of the `NVnTTLB` field.
7390    pub const NVNTTLB_SHIFT: u32 = 32;
7391    /// Offset of the `NVnTTLBIS` field.
7392    pub const NVNTTLBIS_SHIFT: u32 = 33;
7393    /// Offset of the `NVnTTLBOS` field.
7394    pub const NVNTTLBOS_SHIFT: u32 = 34;
7395    /// Offset of the `VTLBIDOSEn` field.
7396    pub const VTLBIDOSEN_SHIFT: u32 = 35;
7397    /// Offset of the `FNB` field.
7398    pub const FNB_SHIFT: u32 = 36;
7399    /// Offset of the `VTE` field.
7400    pub const VTE_SHIFT: u32 = 37;
7401    /// Offset of the `VTAO` field.
7402    pub const VTAO_SHIFT: u32 = 38;
7403    /// Offset of the `VTCO` field.
7404    pub const VTCO_SHIFT: u32 = 39;
7405}
7406
7407#[cfg(feature = "el2")]
7408bitflags! {
7409    /// `HCR_EL2` system register value.
7410    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7411    #[repr(transparent)]
7412    pub struct HcrEl2: u64 {
7413        /// `VM` bit.
7414        const VM = 1 << 0;
7415        /// `SWIO` bit.
7416        const SWIO = 1 << 1;
7417        /// `PTW` bit.
7418        const PTW = 1 << 2;
7419        /// `FMO` bit.
7420        const FMO = 1 << 3;
7421        /// `IMO` bit.
7422        const IMO = 1 << 4;
7423        /// `AMO` bit.
7424        const AMO = 1 << 5;
7425        /// `VF` bit.
7426        const VF = 1 << 6;
7427        /// `VI` bit.
7428        const VI = 1 << 7;
7429        /// `VSE` bit.
7430        const VSE = 1 << 8;
7431        /// `FB` bit.
7432        const FB = 1 << 9;
7433        /// `DC` bit.
7434        const DC = 1 << 12;
7435        /// `TWI` bit.
7436        const TWI = 1 << 13;
7437        /// `TWE` bit.
7438        const TWE = 1 << 14;
7439        /// `TID0` bit.
7440        const TID0 = 1 << 15;
7441        /// `TID1` bit.
7442        const TID1 = 1 << 16;
7443        /// `TID2` bit.
7444        const TID2 = 1 << 17;
7445        /// `TID3` bit.
7446        const TID3 = 1 << 18;
7447        /// `TSC` bit.
7448        const TSC = 1 << 19;
7449        /// `TIDCP` bit.
7450        const TIDCP = 1 << 20;
7451        /// `TACR` bit.
7452        const TACR = 1 << 21;
7453        /// `TSW` bit.
7454        const TSW = 1 << 22;
7455        /// `TPCP` bit.
7456        const TPCP = 1 << 23;
7457        /// `TPU` bit.
7458        const TPU = 1 << 24;
7459        /// `TTLB` bit.
7460        const TTLB = 1 << 25;
7461        /// `TVM` bit.
7462        const TVM = 1 << 26;
7463        /// Trap general exceptions to EL2.
7464        const TGE = 1 << 27;
7465        /// `TDZ` bit.
7466        const TDZ = 1 << 28;
7467        /// `HCD` bit.
7468        const HCD = 1 << 29;
7469        /// `TRVM` bit.
7470        const TRVM = 1 << 30;
7471        /// `RW` bit.
7472        const RW = 1 << 31;
7473        /// `CD` bit.
7474        const CD = 1 << 32;
7475        /// `ID` bit.
7476        const ID = 1 << 33;
7477        /// `E2H` bit.
7478        const E2H = 1 << 34;
7479        /// `TLOR` bit.
7480        const TLOR = 1 << 35;
7481        /// `TERR` bit.
7482        const TERR = 1 << 36;
7483        /// `TEA` bit.
7484        const TEA = 1 << 37;
7485        /// `APK` bit.
7486        const APK = 1 << 40;
7487        /// `API` bit.
7488        const API = 1 << 41;
7489        /// `NV` bit.
7490        const NV = 1 << 42;
7491        /// `NV1` bit.
7492        const NV1 = 1 << 43;
7493        /// `AT` bit.
7494        const AT = 1 << 44;
7495        /// `NV2` bit.
7496        const NV2 = 1 << 45;
7497        /// `FWB` bit.
7498        const FWB = 1 << 46;
7499        /// `FIEN` bit.
7500        const FIEN = 1 << 47;
7501        /// `GPF` bit.
7502        const GPF = 1 << 48;
7503        /// `TID4` bit.
7504        const TID4 = 1 << 49;
7505        /// `TICAB` bit.
7506        const TICAB = 1 << 50;
7507        /// `AMVOFFEN` bit.
7508        const AMVOFFEN = 1 << 51;
7509        /// `TOCU` bit.
7510        const TOCU = 1 << 52;
7511        /// `EnSCXT` bit.
7512        const ENSCXT = 1 << 53;
7513        /// `TTLBIS` bit.
7514        const TTLBIS = 1 << 54;
7515        /// `TTLBOS` bit.
7516        const TTLBOS = 1 << 55;
7517        /// `ATA` bit.
7518        const ATA = 1 << 56;
7519        /// `DCT` bit.
7520        const DCT = 1 << 57;
7521        /// `TID5` bit.
7522        const TID5 = 1 << 58;
7523        /// `TWEDEn` bit.
7524        const TWEDEN = 1 << 59;
7525    }
7526}
7527
7528#[cfg(feature = "el2")]
7529impl HcrEl2 {
7530    /// Offset of the `VM` field.
7531    pub const VM_SHIFT: u32 = 0;
7532    /// Offset of the `SWIO` field.
7533    pub const SWIO_SHIFT: u32 = 1;
7534    /// Offset of the `PTW` field.
7535    pub const PTW_SHIFT: u32 = 2;
7536    /// Offset of the `FMO` field.
7537    pub const FMO_SHIFT: u32 = 3;
7538    /// Offset of the `IMO` field.
7539    pub const IMO_SHIFT: u32 = 4;
7540    /// Offset of the `AMO` field.
7541    pub const AMO_SHIFT: u32 = 5;
7542    /// Offset of the `VF` field.
7543    pub const VF_SHIFT: u32 = 6;
7544    /// Offset of the `VI` field.
7545    pub const VI_SHIFT: u32 = 7;
7546    /// Offset of the `VSE` field.
7547    pub const VSE_SHIFT: u32 = 8;
7548    /// Offset of the `FB` field.
7549    pub const FB_SHIFT: u32 = 9;
7550    /// Offset of the `BSU` field.
7551    pub const BSU_SHIFT: u32 = 10;
7552    /// Mask for the `BSU` field.
7553    pub const BSU_MASK: u64 = 0b11;
7554    /// Offset of the `DC` field.
7555    pub const DC_SHIFT: u32 = 12;
7556    /// Offset of the `TWI` field.
7557    pub const TWI_SHIFT: u32 = 13;
7558    /// Offset of the `TWE` field.
7559    pub const TWE_SHIFT: u32 = 14;
7560    /// Offset of the `TID0` field.
7561    pub const TID0_SHIFT: u32 = 15;
7562    /// Offset of the `TID1` field.
7563    pub const TID1_SHIFT: u32 = 16;
7564    /// Offset of the `TID2` field.
7565    pub const TID2_SHIFT: u32 = 17;
7566    /// Offset of the `TID3` field.
7567    pub const TID3_SHIFT: u32 = 18;
7568    /// Offset of the `TSC` field.
7569    pub const TSC_SHIFT: u32 = 19;
7570    /// Offset of the `TIDCP` field.
7571    pub const TIDCP_SHIFT: u32 = 20;
7572    /// Offset of the `TACR` field.
7573    pub const TACR_SHIFT: u32 = 21;
7574    /// Offset of the `TSW` field.
7575    pub const TSW_SHIFT: u32 = 22;
7576    /// Offset of the `TPCP` field.
7577    pub const TPCP_SHIFT: u32 = 23;
7578    /// Offset of the `TPU` field.
7579    pub const TPU_SHIFT: u32 = 24;
7580    /// Offset of the `TTLB` field.
7581    pub const TTLB_SHIFT: u32 = 25;
7582    /// Offset of the `TVM` field.
7583    pub const TVM_SHIFT: u32 = 26;
7584    /// Offset of the `TGE` field.
7585    pub const TGE_SHIFT: u32 = 27;
7586    /// Offset of the `TDZ` field.
7587    pub const TDZ_SHIFT: u32 = 28;
7588    /// Offset of the `HCD` field.
7589    pub const HCD_SHIFT: u32 = 29;
7590    /// Offset of the `TRVM` field.
7591    pub const TRVM_SHIFT: u32 = 30;
7592    /// Offset of the `RW` field.
7593    pub const RW_SHIFT: u32 = 31;
7594    /// Offset of the `CD` field.
7595    pub const CD_SHIFT: u32 = 32;
7596    /// Offset of the `ID` field.
7597    pub const ID_SHIFT: u32 = 33;
7598    /// Offset of the `E2H` field.
7599    pub const E2H_SHIFT: u32 = 34;
7600    /// Offset of the `TLOR` field.
7601    pub const TLOR_SHIFT: u32 = 35;
7602    /// Offset of the `TERR` field.
7603    pub const TERR_SHIFT: u32 = 36;
7604    /// Offset of the `TEA` field.
7605    pub const TEA_SHIFT: u32 = 37;
7606    /// Offset of the `APK` field.
7607    pub const APK_SHIFT: u32 = 40;
7608    /// Offset of the `API` field.
7609    pub const API_SHIFT: u32 = 41;
7610    /// Offset of the `NV` field.
7611    pub const NV_SHIFT: u32 = 42;
7612    /// Offset of the `NV1` field.
7613    pub const NV1_SHIFT: u32 = 43;
7614    /// Offset of the `AT` field.
7615    pub const AT_SHIFT: u32 = 44;
7616    /// Offset of the `NV2` field.
7617    pub const NV2_SHIFT: u32 = 45;
7618    /// Offset of the `FWB` field.
7619    pub const FWB_SHIFT: u32 = 46;
7620    /// Offset of the `FIEN` field.
7621    pub const FIEN_SHIFT: u32 = 47;
7622    /// Offset of the `GPF` field.
7623    pub const GPF_SHIFT: u32 = 48;
7624    /// Offset of the `TID4` field.
7625    pub const TID4_SHIFT: u32 = 49;
7626    /// Offset of the `TICAB` field.
7627    pub const TICAB_SHIFT: u32 = 50;
7628    /// Offset of the `AMVOFFEN` field.
7629    pub const AMVOFFEN_SHIFT: u32 = 51;
7630    /// Offset of the `TOCU` field.
7631    pub const TOCU_SHIFT: u32 = 52;
7632    /// Offset of the `EnSCXT` field.
7633    pub const ENSCXT_SHIFT: u32 = 53;
7634    /// Offset of the `TTLBIS` field.
7635    pub const TTLBIS_SHIFT: u32 = 54;
7636    /// Offset of the `TTLBOS` field.
7637    pub const TTLBOS_SHIFT: u32 = 55;
7638    /// Offset of the `ATA` field.
7639    pub const ATA_SHIFT: u32 = 56;
7640    /// Offset of the `DCT` field.
7641    pub const DCT_SHIFT: u32 = 57;
7642    /// Offset of the `TID5` field.
7643    pub const TID5_SHIFT: u32 = 58;
7644    /// Offset of the `TWEDEn` field.
7645    pub const TWEDEN_SHIFT: u32 = 59;
7646    /// Offset of the `TWEDEL` field.
7647    pub const TWEDEL_SHIFT: u32 = 60;
7648    /// Mask for the `TWEDEL` field.
7649    pub const TWEDEL_MASK: u64 = 0b1111;
7650
7651    /// Returns the value of the `BSU` field.
7652    pub const fn bsu(self) -> u8 {
7653        ((self.bits() >> Self::BSU_SHIFT) & 0b11) as u8
7654    }
7655
7656    /// Sets the value of the `BSU` field.
7657    pub const fn set_bsu(&mut self, value: u8) {
7658        let offset = Self::BSU_SHIFT;
7659        assert!(value & (Self::BSU_MASK as u8) == value);
7660        *self = Self::from_bits_retain(
7661            (self.bits() & !(Self::BSU_MASK << offset)) | ((value as u64) << offset),
7662        );
7663    }
7664
7665    /// Returns a copy with the `BSU` field set to the given value.
7666    pub const fn with_bsu(mut self, value: u8) -> Self {
7667        self.set_bsu(value);
7668        self
7669    }
7670
7671    /// Returns the value of the `TWEDEL` field.
7672    pub const fn twedel(self) -> u8 {
7673        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
7674    }
7675
7676    /// Sets the value of the `TWEDEL` field.
7677    pub const fn set_twedel(&mut self, value: u8) {
7678        let offset = Self::TWEDEL_SHIFT;
7679        assert!(value & (Self::TWEDEL_MASK as u8) == value);
7680        *self = Self::from_bits_retain(
7681            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
7682        );
7683    }
7684
7685    /// Returns a copy with the `TWEDEL` field set to the given value.
7686    pub const fn with_twedel(mut self, value: u8) -> Self {
7687        self.set_twedel(value);
7688        self
7689    }
7690}
7691
7692bitflags! {
7693    /// `HDCR` system register value.
7694    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7695    #[repr(transparent)]
7696    pub struct Hdcr: u32 {
7697        /// `TPMCR` bit.
7698        const TPMCR = 1 << 5;
7699        /// `TPM` bit.
7700        const TPM = 1 << 6;
7701        /// `HPME` bit.
7702        const HPME = 1 << 7;
7703        /// `TDE` bit.
7704        const TDE = 1 << 8;
7705        /// `TDA` bit.
7706        const TDA = 1 << 9;
7707        /// `TDOSA` bit.
7708        const TDOSA = 1 << 10;
7709        /// `TDRA` bit.
7710        const TDRA = 1 << 11;
7711        /// `HPMD` bit.
7712        const HPMD = 1 << 17;
7713        /// `TTRF` bit.
7714        const TTRF = 1 << 19;
7715        /// `HCCD` bit.
7716        const HCCD = 1 << 23;
7717        /// `HLP` bit.
7718        const HLP = 1 << 26;
7719        /// `TDCC` bit.
7720        const TDCC = 1 << 27;
7721        /// `MTPME` bit.
7722        const MTPME = 1 << 28;
7723        /// `HPMFZO` bit.
7724        const HPMFZO = 1 << 29;
7725    }
7726}
7727
7728impl Hdcr {
7729    /// Offset of the `HPMN` field.
7730    pub const HPMN_SHIFT: u32 = 0;
7731    /// Mask for the `HPMN` field.
7732    pub const HPMN_MASK: u32 = 0b11111;
7733    /// Offset of the `TPMCR` field.
7734    pub const TPMCR_SHIFT: u32 = 5;
7735    /// Offset of the `TPM` field.
7736    pub const TPM_SHIFT: u32 = 6;
7737    /// Offset of the `HPME` field.
7738    pub const HPME_SHIFT: u32 = 7;
7739    /// Offset of the `TDE` field.
7740    pub const TDE_SHIFT: u32 = 8;
7741    /// Offset of the `TDA` field.
7742    pub const TDA_SHIFT: u32 = 9;
7743    /// Offset of the `TDOSA` field.
7744    pub const TDOSA_SHIFT: u32 = 10;
7745    /// Offset of the `TDRA` field.
7746    pub const TDRA_SHIFT: u32 = 11;
7747    /// Offset of the `HPMD` field.
7748    pub const HPMD_SHIFT: u32 = 17;
7749    /// Offset of the `TTRF` field.
7750    pub const TTRF_SHIFT: u32 = 19;
7751    /// Offset of the `HCCD` field.
7752    pub const HCCD_SHIFT: u32 = 23;
7753    /// Offset of the `HLP` field.
7754    pub const HLP_SHIFT: u32 = 26;
7755    /// Offset of the `TDCC` field.
7756    pub const TDCC_SHIFT: u32 = 27;
7757    /// Offset of the `MTPME` field.
7758    pub const MTPME_SHIFT: u32 = 28;
7759    /// Offset of the `HPMFZO` field.
7760    pub const HPMFZO_SHIFT: u32 = 29;
7761
7762    /// Returns the value of the `HPMN` field.
7763    pub const fn hpmn(self) -> u8 {
7764        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
7765    }
7766
7767    /// Sets the value of the `HPMN` field.
7768    pub const fn set_hpmn(&mut self, value: u8) {
7769        let offset = Self::HPMN_SHIFT;
7770        assert!(value & (Self::HPMN_MASK as u8) == value);
7771        *self = Self::from_bits_retain(
7772            (self.bits() & !(Self::HPMN_MASK << offset)) | ((value as u32) << offset),
7773        );
7774    }
7775
7776    /// Returns a copy with the `HPMN` field set to the given value.
7777    pub const fn with_hpmn(mut self, value: u8) -> Self {
7778        self.set_hpmn(value);
7779        self
7780    }
7781}
7782
7783bitflags! {
7784    /// `HDFAR` system register value.
7785    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7786    #[repr(transparent)]
7787    pub struct Hdfar: u32 {
7788    }
7789}
7790
7791impl Hdfar {
7792    /// Offset of the `VA` field.
7793    pub const VA_SHIFT: u32 = 0;
7794    /// Mask for the `VA` field.
7795    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
7796
7797    /// Returns the value of the `VA` field.
7798    pub const fn va(self) -> u32 {
7799        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
7800    }
7801
7802    /// Sets the value of the `VA` field.
7803    pub const fn set_va(&mut self, value: u32) {
7804        let offset = Self::VA_SHIFT;
7805        assert!(value & (Self::VA_MASK as u32) == value);
7806        *self = Self::from_bits_retain(
7807            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
7808        );
7809    }
7810
7811    /// Returns a copy with the `VA` field set to the given value.
7812    pub const fn with_va(mut self, value: u32) -> Self {
7813        self.set_va(value);
7814        self
7815    }
7816}
7817
7818#[cfg(feature = "el2")]
7819bitflags! {
7820    /// `HDFGRTR2_EL2` system register value.
7821    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7822    #[repr(transparent)]
7823    pub struct Hdfgrtr2El2: u64 {
7824        /// `nPMECR_EL1` bit.
7825        const NPMECR_EL1 = 1 << 0;
7826        /// `nPMIAR_EL1` bit.
7827        const NPMIAR_EL1 = 1 << 1;
7828        /// `nPMICNTR_EL0` bit.
7829        const NPMICNTR_EL0 = 1 << 2;
7830        /// `nPMICFILTR_EL0` bit.
7831        const NPMICFILTR_EL0 = 1 << 3;
7832        /// `nPMUACR_EL1` bit.
7833        const NPMUACR_EL1 = 1 << 4;
7834        /// `nMDSELR_EL1` bit.
7835        const NMDSELR_EL1 = 1 << 5;
7836        /// `nPMSSDATA` bit.
7837        const NPMSSDATA = 1 << 6;
7838        /// `nPMSSCR_EL1` bit.
7839        const NPMSSCR_EL1 = 1 << 7;
7840        /// `nSPMEVCNTRn_EL0` bit.
7841        const NSPMEVCNTRN_EL0 = 1 << 8;
7842        /// `nSPMEVTYPERn_EL0` bit.
7843        const NSPMEVTYPERN_EL0 = 1 << 9;
7844        /// `nSPMSELR_EL0` bit.
7845        const NSPMSELR_EL0 = 1 << 10;
7846        /// `nSPMCNTEN` bit.
7847        const NSPMCNTEN = 1 << 11;
7848        /// `nSPMINTEN` bit.
7849        const NSPMINTEN = 1 << 12;
7850        /// `nSPMOVS` bit.
7851        const NSPMOVS = 1 << 13;
7852        /// `nSPMCR_EL0` bit.
7853        const NSPMCR_EL0 = 1 << 14;
7854        /// `nSPMACCESSR_EL1` bit.
7855        const NSPMACCESSR_EL1 = 1 << 15;
7856        /// `nSPMSCR_EL1` bit.
7857        const NSPMSCR_EL1 = 1 << 16;
7858        /// `nSPMID` bit.
7859        const NSPMID = 1 << 17;
7860        /// `nSPMDEVAFF_EL1` bit.
7861        const NSPMDEVAFF_EL1 = 1 << 18;
7862        /// `nPMSDSFR_EL1` bit.
7863        const NPMSDSFR_EL1 = 1 << 19;
7864        /// `nTRCITECR_EL1` bit.
7865        const NTRCITECR_EL1 = 1 << 20;
7866        /// `nTRBMPAM_EL1` bit.
7867        const NTRBMPAM_EL1 = 1 << 22;
7868        /// `nMDSTEPOP_EL1` bit.
7869        const NMDSTEPOP_EL1 = 1 << 23;
7870        /// `nPMBMAR_EL1` bit.
7871        const NPMBMAR_EL1 = 1 << 24;
7872    }
7873}
7874
7875#[cfg(feature = "el2")]
7876impl Hdfgrtr2El2 {
7877    /// Offset of the `nPMECR_EL1` field.
7878    pub const NPMECR_EL1_SHIFT: u32 = 0;
7879    /// Offset of the `nPMIAR_EL1` field.
7880    pub const NPMIAR_EL1_SHIFT: u32 = 1;
7881    /// Offset of the `nPMICNTR_EL0` field.
7882    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
7883    /// Offset of the `nPMICFILTR_EL0` field.
7884    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
7885    /// Offset of the `nPMUACR_EL1` field.
7886    pub const NPMUACR_EL1_SHIFT: u32 = 4;
7887    /// Offset of the `nMDSELR_EL1` field.
7888    pub const NMDSELR_EL1_SHIFT: u32 = 5;
7889    /// Offset of the `nPMSSDATA` field.
7890    pub const NPMSSDATA_SHIFT: u32 = 6;
7891    /// Offset of the `nPMSSCR_EL1` field.
7892    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
7893    /// Offset of the `nSPMEVCNTRn_EL0` field.
7894    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
7895    /// Offset of the `nSPMEVTYPERn_EL0` field.
7896    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
7897    /// Offset of the `nSPMSELR_EL0` field.
7898    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
7899    /// Offset of the `nSPMCNTEN` field.
7900    pub const NSPMCNTEN_SHIFT: u32 = 11;
7901    /// Offset of the `nSPMINTEN` field.
7902    pub const NSPMINTEN_SHIFT: u32 = 12;
7903    /// Offset of the `nSPMOVS` field.
7904    pub const NSPMOVS_SHIFT: u32 = 13;
7905    /// Offset of the `nSPMCR_EL0` field.
7906    pub const NSPMCR_EL0_SHIFT: u32 = 14;
7907    /// Offset of the `nSPMACCESSR_EL1` field.
7908    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
7909    /// Offset of the `nSPMSCR_EL1` field.
7910    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
7911    /// Offset of the `nSPMID` field.
7912    pub const NSPMID_SHIFT: u32 = 17;
7913    /// Offset of the `nSPMDEVAFF_EL1` field.
7914    pub const NSPMDEVAFF_EL1_SHIFT: u32 = 18;
7915    /// Offset of the `nPMSDSFR_EL1` field.
7916    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
7917    /// Offset of the `nTRCITECR_EL1` field.
7918    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
7919    /// Offset of the `nTRBMPAM_EL1` field.
7920    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
7921    /// Offset of the `nMDSTEPOP_EL1` field.
7922    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
7923    /// Offset of the `nPMBMAR_EL1` field.
7924    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
7925}
7926
7927#[cfg(feature = "el2")]
7928bitflags! {
7929    /// `HDFGRTR_EL2` system register value.
7930    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
7931    #[repr(transparent)]
7932    pub struct HdfgrtrEl2: u64 {
7933        /// `DBGBCRn_EL1` bit.
7934        const DBGBCRN_EL1 = 1 << 0;
7935        /// `DBGBVRn_EL1` bit.
7936        const DBGBVRN_EL1 = 1 << 1;
7937        /// `DBGWCRn_EL1` bit.
7938        const DBGWCRN_EL1 = 1 << 2;
7939        /// `DBGWVRn_EL1` bit.
7940        const DBGWVRN_EL1 = 1 << 3;
7941        /// `MDSCR_EL1` bit.
7942        const MDSCR_EL1 = 1 << 4;
7943        /// `DBGCLAIM` bit.
7944        const DBGCLAIM = 1 << 5;
7945        /// `DBGAUTHSTATUS_EL1` bit.
7946        const DBGAUTHSTATUS_EL1 = 1 << 6;
7947        /// `DBGPRCR_EL1` bit.
7948        const DBGPRCR_EL1 = 1 << 7;
7949        /// `OSLSR_EL1` bit.
7950        const OSLSR_EL1 = 1 << 9;
7951        /// `OSECCR_EL1` bit.
7952        const OSECCR_EL1 = 1 << 10;
7953        /// `OSDLR_EL1` bit.
7954        const OSDLR_EL1 = 1 << 11;
7955        /// `PMEVCNTRn_EL0` bit.
7956        const PMEVCNTRN_EL0 = 1 << 12;
7957        /// `PMEVTYPERn_EL0` bit.
7958        const PMEVTYPERN_EL0 = 1 << 13;
7959        /// `PMCCFILTR_EL0` bit.
7960        const PMCCFILTR_EL0 = 1 << 14;
7961        /// `PMCCNTR_EL0` bit.
7962        const PMCCNTR_EL0 = 1 << 15;
7963        /// `PMCNTEN` bit.
7964        const PMCNTEN = 1 << 16;
7965        /// `PMINTEN` bit.
7966        const PMINTEN = 1 << 17;
7967        /// `PMOVS` bit.
7968        const PMOVS = 1 << 18;
7969        /// `PMSELR_EL0` bit.
7970        const PMSELR_EL0 = 1 << 19;
7971        /// `PMMIR_EL1` bit.
7972        const PMMIR_EL1 = 1 << 22;
7973        /// `PMBLIMITR_EL1` bit.
7974        const PMBLIMITR_EL1 = 1 << 23;
7975        /// `PMBPTR_EL1` bit.
7976        const PMBPTR_EL1 = 1 << 24;
7977        /// `PMBSR_EL1` bit.
7978        const PMBSR_EL1 = 1 << 25;
7979        /// `PMSCR_EL1` bit.
7980        const PMSCR_EL1 = 1 << 26;
7981        /// `PMSEVFR_EL1` bit.
7982        const PMSEVFR_EL1 = 1 << 27;
7983        /// `PMSFCR_EL1` bit.
7984        const PMSFCR_EL1 = 1 << 28;
7985        /// `PMSICR_EL1` bit.
7986        const PMSICR_EL1 = 1 << 29;
7987        /// `PMSIDR_EL1` bit.
7988        const PMSIDR_EL1 = 1 << 30;
7989        /// `PMSIRR_EL1` bit.
7990        const PMSIRR_EL1 = 1 << 31;
7991        /// `PMSLATFR_EL1` bit.
7992        const PMSLATFR_EL1 = 1 << 32;
7993        /// `TRC` bit.
7994        const TRC = 1 << 33;
7995        /// `TRCAUTHSTATUS` bit.
7996        const TRCAUTHSTATUS = 1 << 34;
7997        /// `TRCAUXCTLR` bit.
7998        const TRCAUXCTLR = 1 << 35;
7999        /// `TRCCLAIM` bit.
8000        const TRCCLAIM = 1 << 36;
8001        /// `TRCCNTVRn` bit.
8002        const TRCCNTVRN = 1 << 37;
8003        /// `TRCID` bit.
8004        const TRCID = 1 << 40;
8005        /// `TRCIMSPECn` bit.
8006        const TRCIMSPECN = 1 << 41;
8007        /// `TRCOSLSR` bit.
8008        const TRCOSLSR = 1 << 43;
8009        /// `TRCPRGCTLR` bit.
8010        const TRCPRGCTLR = 1 << 44;
8011        /// `TRCSEQSTR` bit.
8012        const TRCSEQSTR = 1 << 45;
8013        /// `TRCSSCSRn` bit.
8014        const TRCSSCSRN = 1 << 46;
8015        /// `TRCSTATR` bit.
8016        const TRCSTATR = 1 << 47;
8017        /// `TRCVICTLR` bit.
8018        const TRCVICTLR = 1 << 48;
8019        /// `TRBBASER_EL1` bit.
8020        const TRBBASER_EL1 = 1 << 50;
8021        /// `TRBIDR_EL1` bit.
8022        const TRBIDR_EL1 = 1 << 51;
8023        /// `TRBLIMITR_EL1` bit.
8024        const TRBLIMITR_EL1 = 1 << 52;
8025        /// `TRBMAR_EL1` bit.
8026        const TRBMAR_EL1 = 1 << 53;
8027        /// `TRBPTR_EL1` bit.
8028        const TRBPTR_EL1 = 1 << 54;
8029        /// `TRBSR_EL1` bit.
8030        const TRBSR_EL1 = 1 << 55;
8031        /// `TRBTRG_EL1` bit.
8032        const TRBTRG_EL1 = 1 << 56;
8033        /// `PMUSERENR_EL0` bit.
8034        const PMUSERENR_EL0 = 1 << 57;
8035        /// `PMCEIDn_EL0` bit.
8036        const PMCEIDN_EL0 = 1 << 58;
8037        /// `nBRBIDR` bit.
8038        const NBRBIDR = 1 << 59;
8039        /// `nBRBCTL` bit.
8040        const NBRBCTL = 1 << 60;
8041        /// `nBRBDATA` bit.
8042        const NBRBDATA = 1 << 61;
8043        /// `nPMSNEVFR_EL1` bit.
8044        const NPMSNEVFR_EL1 = 1 << 62;
8045        /// `PMBIDR_EL1` bit.
8046        const PMBIDR_EL1 = 1 << 63;
8047    }
8048}
8049
8050#[cfg(feature = "el2")]
8051impl HdfgrtrEl2 {
8052    /// Offset of the `DBGBCRn_EL1` field.
8053    pub const DBGBCRN_EL1_SHIFT: u32 = 0;
8054    /// Offset of the `DBGBVRn_EL1` field.
8055    pub const DBGBVRN_EL1_SHIFT: u32 = 1;
8056    /// Offset of the `DBGWCRn_EL1` field.
8057    pub const DBGWCRN_EL1_SHIFT: u32 = 2;
8058    /// Offset of the `DBGWVRn_EL1` field.
8059    pub const DBGWVRN_EL1_SHIFT: u32 = 3;
8060    /// Offset of the `MDSCR_EL1` field.
8061    pub const MDSCR_EL1_SHIFT: u32 = 4;
8062    /// Offset of the `DBGCLAIM` field.
8063    pub const DBGCLAIM_SHIFT: u32 = 5;
8064    /// Offset of the `DBGAUTHSTATUS_EL1` field.
8065    pub const DBGAUTHSTATUS_EL1_SHIFT: u32 = 6;
8066    /// Offset of the `DBGPRCR_EL1` field.
8067    pub const DBGPRCR_EL1_SHIFT: u32 = 7;
8068    /// Offset of the `OSLSR_EL1` field.
8069    pub const OSLSR_EL1_SHIFT: u32 = 9;
8070    /// Offset of the `OSECCR_EL1` field.
8071    pub const OSECCR_EL1_SHIFT: u32 = 10;
8072    /// Offset of the `OSDLR_EL1` field.
8073    pub const OSDLR_EL1_SHIFT: u32 = 11;
8074    /// Offset of the `PMEVCNTRn_EL0` field.
8075    pub const PMEVCNTRN_EL0_SHIFT: u32 = 12;
8076    /// Offset of the `PMEVTYPERn_EL0` field.
8077    pub const PMEVTYPERN_EL0_SHIFT: u32 = 13;
8078    /// Offset of the `PMCCFILTR_EL0` field.
8079    pub const PMCCFILTR_EL0_SHIFT: u32 = 14;
8080    /// Offset of the `PMCCNTR_EL0` field.
8081    pub const PMCCNTR_EL0_SHIFT: u32 = 15;
8082    /// Offset of the `PMCNTEN` field.
8083    pub const PMCNTEN_SHIFT: u32 = 16;
8084    /// Offset of the `PMINTEN` field.
8085    pub const PMINTEN_SHIFT: u32 = 17;
8086    /// Offset of the `PMOVS` field.
8087    pub const PMOVS_SHIFT: u32 = 18;
8088    /// Offset of the `PMSELR_EL0` field.
8089    pub const PMSELR_EL0_SHIFT: u32 = 19;
8090    /// Offset of the `PMMIR_EL1` field.
8091    pub const PMMIR_EL1_SHIFT: u32 = 22;
8092    /// Offset of the `PMBLIMITR_EL1` field.
8093    pub const PMBLIMITR_EL1_SHIFT: u32 = 23;
8094    /// Offset of the `PMBPTR_EL1` field.
8095    pub const PMBPTR_EL1_SHIFT: u32 = 24;
8096    /// Offset of the `PMBSR_EL1` field.
8097    pub const PMBSR_EL1_SHIFT: u32 = 25;
8098    /// Offset of the `PMSCR_EL1` field.
8099    pub const PMSCR_EL1_SHIFT: u32 = 26;
8100    /// Offset of the `PMSEVFR_EL1` field.
8101    pub const PMSEVFR_EL1_SHIFT: u32 = 27;
8102    /// Offset of the `PMSFCR_EL1` field.
8103    pub const PMSFCR_EL1_SHIFT: u32 = 28;
8104    /// Offset of the `PMSICR_EL1` field.
8105    pub const PMSICR_EL1_SHIFT: u32 = 29;
8106    /// Offset of the `PMSIDR_EL1` field.
8107    pub const PMSIDR_EL1_SHIFT: u32 = 30;
8108    /// Offset of the `PMSIRR_EL1` field.
8109    pub const PMSIRR_EL1_SHIFT: u32 = 31;
8110    /// Offset of the `PMSLATFR_EL1` field.
8111    pub const PMSLATFR_EL1_SHIFT: u32 = 32;
8112    /// Offset of the `TRC` field.
8113    pub const TRC_SHIFT: u32 = 33;
8114    /// Offset of the `TRCAUTHSTATUS` field.
8115    pub const TRCAUTHSTATUS_SHIFT: u32 = 34;
8116    /// Offset of the `TRCAUXCTLR` field.
8117    pub const TRCAUXCTLR_SHIFT: u32 = 35;
8118    /// Offset of the `TRCCLAIM` field.
8119    pub const TRCCLAIM_SHIFT: u32 = 36;
8120    /// Offset of the `TRCCNTVRn` field.
8121    pub const TRCCNTVRN_SHIFT: u32 = 37;
8122    /// Offset of the `TRCID` field.
8123    pub const TRCID_SHIFT: u32 = 40;
8124    /// Offset of the `TRCIMSPECn` field.
8125    pub const TRCIMSPECN_SHIFT: u32 = 41;
8126    /// Offset of the `TRCOSLSR` field.
8127    pub const TRCOSLSR_SHIFT: u32 = 43;
8128    /// Offset of the `TRCPRGCTLR` field.
8129    pub const TRCPRGCTLR_SHIFT: u32 = 44;
8130    /// Offset of the `TRCSEQSTR` field.
8131    pub const TRCSEQSTR_SHIFT: u32 = 45;
8132    /// Offset of the `TRCSSCSRn` field.
8133    pub const TRCSSCSRN_SHIFT: u32 = 46;
8134    /// Offset of the `TRCSTATR` field.
8135    pub const TRCSTATR_SHIFT: u32 = 47;
8136    /// Offset of the `TRCVICTLR` field.
8137    pub const TRCVICTLR_SHIFT: u32 = 48;
8138    /// Offset of the `TRBBASER_EL1` field.
8139    pub const TRBBASER_EL1_SHIFT: u32 = 50;
8140    /// Offset of the `TRBIDR_EL1` field.
8141    pub const TRBIDR_EL1_SHIFT: u32 = 51;
8142    /// Offset of the `TRBLIMITR_EL1` field.
8143    pub const TRBLIMITR_EL1_SHIFT: u32 = 52;
8144    /// Offset of the `TRBMAR_EL1` field.
8145    pub const TRBMAR_EL1_SHIFT: u32 = 53;
8146    /// Offset of the `TRBPTR_EL1` field.
8147    pub const TRBPTR_EL1_SHIFT: u32 = 54;
8148    /// Offset of the `TRBSR_EL1` field.
8149    pub const TRBSR_EL1_SHIFT: u32 = 55;
8150    /// Offset of the `TRBTRG_EL1` field.
8151    pub const TRBTRG_EL1_SHIFT: u32 = 56;
8152    /// Offset of the `PMUSERENR_EL0` field.
8153    pub const PMUSERENR_EL0_SHIFT: u32 = 57;
8154    /// Offset of the `PMCEIDn_EL0` field.
8155    pub const PMCEIDN_EL0_SHIFT: u32 = 58;
8156    /// Offset of the `nBRBIDR` field.
8157    pub const NBRBIDR_SHIFT: u32 = 59;
8158    /// Offset of the `nBRBCTL` field.
8159    pub const NBRBCTL_SHIFT: u32 = 60;
8160    /// Offset of the `nBRBDATA` field.
8161    pub const NBRBDATA_SHIFT: u32 = 61;
8162    /// Offset of the `nPMSNEVFR_EL1` field.
8163    pub const NPMSNEVFR_EL1_SHIFT: u32 = 62;
8164    /// Offset of the `PMBIDR_EL1` field.
8165    pub const PMBIDR_EL1_SHIFT: u32 = 63;
8166}
8167
8168#[cfg(feature = "el2")]
8169bitflags! {
8170    /// `HDFGWTR2_EL2` system register value.
8171    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8172    #[repr(transparent)]
8173    pub struct Hdfgwtr2El2: u64 {
8174        /// `nPMECR_EL1` bit.
8175        const NPMECR_EL1 = 1 << 0;
8176        /// `nPMIAR_EL1` bit.
8177        const NPMIAR_EL1 = 1 << 1;
8178        /// `nPMICNTR_EL0` bit.
8179        const NPMICNTR_EL0 = 1 << 2;
8180        /// `nPMICFILTR_EL0` bit.
8181        const NPMICFILTR_EL0 = 1 << 3;
8182        /// `nPMUACR_EL1` bit.
8183        const NPMUACR_EL1 = 1 << 4;
8184        /// `nMDSELR_EL1` bit.
8185        const NMDSELR_EL1 = 1 << 5;
8186        /// `nPMSSCR_EL1` bit.
8187        const NPMSSCR_EL1 = 1 << 7;
8188        /// `nSPMEVCNTRn_EL0` bit.
8189        const NSPMEVCNTRN_EL0 = 1 << 8;
8190        /// `nSPMEVTYPERn_EL0` bit.
8191        const NSPMEVTYPERN_EL0 = 1 << 9;
8192        /// `nSPMSELR_EL0` bit.
8193        const NSPMSELR_EL0 = 1 << 10;
8194        /// `nSPMCNTEN` bit.
8195        const NSPMCNTEN = 1 << 11;
8196        /// `nSPMINTEN` bit.
8197        const NSPMINTEN = 1 << 12;
8198        /// `nSPMOVS` bit.
8199        const NSPMOVS = 1 << 13;
8200        /// `nSPMCR_EL0` bit.
8201        const NSPMCR_EL0 = 1 << 14;
8202        /// `nSPMACCESSR_EL1` bit.
8203        const NSPMACCESSR_EL1 = 1 << 15;
8204        /// `nSPMSCR_EL1` bit.
8205        const NSPMSCR_EL1 = 1 << 16;
8206        /// `nPMSDSFR_EL1` bit.
8207        const NPMSDSFR_EL1 = 1 << 19;
8208        /// `nTRCITECR_EL1` bit.
8209        const NTRCITECR_EL1 = 1 << 20;
8210        /// `nPMZR_EL0` bit.
8211        const NPMZR_EL0 = 1 << 21;
8212        /// `nTRBMPAM_EL1` bit.
8213        const NTRBMPAM_EL1 = 1 << 22;
8214        /// `nMDSTEPOP_EL1` bit.
8215        const NMDSTEPOP_EL1 = 1 << 23;
8216        /// `nPMBMAR_EL1` bit.
8217        const NPMBMAR_EL1 = 1 << 24;
8218    }
8219}
8220
8221#[cfg(feature = "el2")]
8222impl Hdfgwtr2El2 {
8223    /// Offset of the `nPMECR_EL1` field.
8224    pub const NPMECR_EL1_SHIFT: u32 = 0;
8225    /// Offset of the `nPMIAR_EL1` field.
8226    pub const NPMIAR_EL1_SHIFT: u32 = 1;
8227    /// Offset of the `nPMICNTR_EL0` field.
8228    pub const NPMICNTR_EL0_SHIFT: u32 = 2;
8229    /// Offset of the `nPMICFILTR_EL0` field.
8230    pub const NPMICFILTR_EL0_SHIFT: u32 = 3;
8231    /// Offset of the `nPMUACR_EL1` field.
8232    pub const NPMUACR_EL1_SHIFT: u32 = 4;
8233    /// Offset of the `nMDSELR_EL1` field.
8234    pub const NMDSELR_EL1_SHIFT: u32 = 5;
8235    /// Offset of the `nPMSSCR_EL1` field.
8236    pub const NPMSSCR_EL1_SHIFT: u32 = 7;
8237    /// Offset of the `nSPMEVCNTRn_EL0` field.
8238    pub const NSPMEVCNTRN_EL0_SHIFT: u32 = 8;
8239    /// Offset of the `nSPMEVTYPERn_EL0` field.
8240    pub const NSPMEVTYPERN_EL0_SHIFT: u32 = 9;
8241    /// Offset of the `nSPMSELR_EL0` field.
8242    pub const NSPMSELR_EL0_SHIFT: u32 = 10;
8243    /// Offset of the `nSPMCNTEN` field.
8244    pub const NSPMCNTEN_SHIFT: u32 = 11;
8245    /// Offset of the `nSPMINTEN` field.
8246    pub const NSPMINTEN_SHIFT: u32 = 12;
8247    /// Offset of the `nSPMOVS` field.
8248    pub const NSPMOVS_SHIFT: u32 = 13;
8249    /// Offset of the `nSPMCR_EL0` field.
8250    pub const NSPMCR_EL0_SHIFT: u32 = 14;
8251    /// Offset of the `nSPMACCESSR_EL1` field.
8252    pub const NSPMACCESSR_EL1_SHIFT: u32 = 15;
8253    /// Offset of the `nSPMSCR_EL1` field.
8254    pub const NSPMSCR_EL1_SHIFT: u32 = 16;
8255    /// Offset of the `nPMSDSFR_EL1` field.
8256    pub const NPMSDSFR_EL1_SHIFT: u32 = 19;
8257    /// Offset of the `nTRCITECR_EL1` field.
8258    pub const NTRCITECR_EL1_SHIFT: u32 = 20;
8259    /// Offset of the `nPMZR_EL0` field.
8260    pub const NPMZR_EL0_SHIFT: u32 = 21;
8261    /// Offset of the `nTRBMPAM_EL1` field.
8262    pub const NTRBMPAM_EL1_SHIFT: u32 = 22;
8263    /// Offset of the `nMDSTEPOP_EL1` field.
8264    pub const NMDSTEPOP_EL1_SHIFT: u32 = 23;
8265    /// Offset of the `nPMBMAR_EL1` field.
8266    pub const NPMBMAR_EL1_SHIFT: u32 = 24;
8267}
8268
8269#[cfg(feature = "el2")]
8270bitflags! {
8271    /// `HDFGWTR_EL2` system register value.
8272    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8273    #[repr(transparent)]
8274    pub struct HdfgwtrEl2: u64 {
8275        /// `DBGBCRn_EL1` bit.
8276        const DBGBCRN_EL1 = 1 << 0;
8277        /// `DBGBVRn_EL1` bit.
8278        const DBGBVRN_EL1 = 1 << 1;
8279        /// `DBGWCRn_EL1` bit.
8280        const DBGWCRN_EL1 = 1 << 2;
8281        /// `DBGWVRn_EL1` bit.
8282        const DBGWVRN_EL1 = 1 << 3;
8283        /// `MDSCR_EL1` bit.
8284        const MDSCR_EL1 = 1 << 4;
8285        /// `DBGCLAIM` bit.
8286        const DBGCLAIM = 1 << 5;
8287        /// `DBGPRCR_EL1` bit.
8288        const DBGPRCR_EL1 = 1 << 7;
8289        /// `OSLAR_EL1` bit.
8290        const OSLAR_EL1 = 1 << 8;
8291        /// `OSECCR_EL1` bit.
8292        const OSECCR_EL1 = 1 << 10;
8293        /// `OSDLR_EL1` bit.
8294        const OSDLR_EL1 = 1 << 11;
8295        /// `PMEVCNTRn_EL0` bit.
8296        const PMEVCNTRN_EL0 = 1 << 12;
8297        /// `PMEVTYPERn_EL0` bit.
8298        const PMEVTYPERN_EL0 = 1 << 13;
8299        /// `PMCCFILTR_EL0` bit.
8300        const PMCCFILTR_EL0 = 1 << 14;
8301        /// `PMCCNTR_EL0` bit.
8302        const PMCCNTR_EL0 = 1 << 15;
8303        /// `PMCNTEN` bit.
8304        const PMCNTEN = 1 << 16;
8305        /// `PMINTEN` bit.
8306        const PMINTEN = 1 << 17;
8307        /// `PMOVS` bit.
8308        const PMOVS = 1 << 18;
8309        /// `PMSELR_EL0` bit.
8310        const PMSELR_EL0 = 1 << 19;
8311        /// `PMSWINC_EL0` bit.
8312        const PMSWINC_EL0 = 1 << 20;
8313        /// `PMCR_EL0` bit.
8314        const PMCR_EL0 = 1 << 21;
8315        /// `PMBLIMITR_EL1` bit.
8316        const PMBLIMITR_EL1 = 1 << 23;
8317        /// `PMBPTR_EL1` bit.
8318        const PMBPTR_EL1 = 1 << 24;
8319        /// `PMBSR_EL1` bit.
8320        const PMBSR_EL1 = 1 << 25;
8321        /// `PMSCR_EL1` bit.
8322        const PMSCR_EL1 = 1 << 26;
8323        /// `PMSEVFR_EL1` bit.
8324        const PMSEVFR_EL1 = 1 << 27;
8325        /// `PMSFCR_EL1` bit.
8326        const PMSFCR_EL1 = 1 << 28;
8327        /// `PMSICR_EL1` bit.
8328        const PMSICR_EL1 = 1 << 29;
8329        /// `PMSIRR_EL1` bit.
8330        const PMSIRR_EL1 = 1 << 31;
8331        /// `PMSLATFR_EL1` bit.
8332        const PMSLATFR_EL1 = 1 << 32;
8333        /// `TRC` bit.
8334        const TRC = 1 << 33;
8335        /// `TRCAUXCTLR` bit.
8336        const TRCAUXCTLR = 1 << 35;
8337        /// `TRCCLAIM` bit.
8338        const TRCCLAIM = 1 << 36;
8339        /// `TRCCNTVRn` bit.
8340        const TRCCNTVRN = 1 << 37;
8341        /// `TRCIMSPECn` bit.
8342        const TRCIMSPECN = 1 << 41;
8343        /// `TRCOSLAR` bit.
8344        const TRCOSLAR = 1 << 42;
8345        /// `TRCPRGCTLR` bit.
8346        const TRCPRGCTLR = 1 << 44;
8347        /// `TRCSEQSTR` bit.
8348        const TRCSEQSTR = 1 << 45;
8349        /// `TRCSSCSRn` bit.
8350        const TRCSSCSRN = 1 << 46;
8351        /// `TRCVICTLR` bit.
8352        const TRCVICTLR = 1 << 48;
8353        /// `TRFCR_EL1` bit.
8354        const TRFCR_EL1 = 1 << 49;
8355        /// `TRBBASER_EL1` bit.
8356        const TRBBASER_EL1 = 1 << 50;
8357        /// `TRBLIMITR_EL1` bit.
8358        const TRBLIMITR_EL1 = 1 << 52;
8359        /// `TRBMAR_EL1` bit.
8360        const TRBMAR_EL1 = 1 << 53;
8361        /// `TRBPTR_EL1` bit.
8362        const TRBPTR_EL1 = 1 << 54;
8363        /// `TRBSR_EL1` bit.
8364        const TRBSR_EL1 = 1 << 55;
8365        /// `TRBTRG_EL1` bit.
8366        const TRBTRG_EL1 = 1 << 56;
8367        /// `PMUSERENR_EL0` bit.
8368        const PMUSERENR_EL0 = 1 << 57;
8369        /// `nBRBCTL` bit.
8370        const NBRBCTL = 1 << 60;
8371        /// `nBRBDATA` bit.
8372        const NBRBDATA = 1 << 61;
8373        /// `nPMSNEVFR_EL1` bit.
8374        const NPMSNEVFR_EL1 = 1 << 62;
8375    }
8376}
8377
8378#[cfg(feature = "el2")]
8379impl HdfgwtrEl2 {
8380    /// Offset of the `DBGBCRn_EL1` field.
8381    pub const DBGBCRN_EL1_SHIFT: u32 = 0;
8382    /// Offset of the `DBGBVRn_EL1` field.
8383    pub const DBGBVRN_EL1_SHIFT: u32 = 1;
8384    /// Offset of the `DBGWCRn_EL1` field.
8385    pub const DBGWCRN_EL1_SHIFT: u32 = 2;
8386    /// Offset of the `DBGWVRn_EL1` field.
8387    pub const DBGWVRN_EL1_SHIFT: u32 = 3;
8388    /// Offset of the `MDSCR_EL1` field.
8389    pub const MDSCR_EL1_SHIFT: u32 = 4;
8390    /// Offset of the `DBGCLAIM` field.
8391    pub const DBGCLAIM_SHIFT: u32 = 5;
8392    /// Offset of the `DBGPRCR_EL1` field.
8393    pub const DBGPRCR_EL1_SHIFT: u32 = 7;
8394    /// Offset of the `OSLAR_EL1` field.
8395    pub const OSLAR_EL1_SHIFT: u32 = 8;
8396    /// Offset of the `OSECCR_EL1` field.
8397    pub const OSECCR_EL1_SHIFT: u32 = 10;
8398    /// Offset of the `OSDLR_EL1` field.
8399    pub const OSDLR_EL1_SHIFT: u32 = 11;
8400    /// Offset of the `PMEVCNTRn_EL0` field.
8401    pub const PMEVCNTRN_EL0_SHIFT: u32 = 12;
8402    /// Offset of the `PMEVTYPERn_EL0` field.
8403    pub const PMEVTYPERN_EL0_SHIFT: u32 = 13;
8404    /// Offset of the `PMCCFILTR_EL0` field.
8405    pub const PMCCFILTR_EL0_SHIFT: u32 = 14;
8406    /// Offset of the `PMCCNTR_EL0` field.
8407    pub const PMCCNTR_EL0_SHIFT: u32 = 15;
8408    /// Offset of the `PMCNTEN` field.
8409    pub const PMCNTEN_SHIFT: u32 = 16;
8410    /// Offset of the `PMINTEN` field.
8411    pub const PMINTEN_SHIFT: u32 = 17;
8412    /// Offset of the `PMOVS` field.
8413    pub const PMOVS_SHIFT: u32 = 18;
8414    /// Offset of the `PMSELR_EL0` field.
8415    pub const PMSELR_EL0_SHIFT: u32 = 19;
8416    /// Offset of the `PMSWINC_EL0` field.
8417    pub const PMSWINC_EL0_SHIFT: u32 = 20;
8418    /// Offset of the `PMCR_EL0` field.
8419    pub const PMCR_EL0_SHIFT: u32 = 21;
8420    /// Offset of the `PMBLIMITR_EL1` field.
8421    pub const PMBLIMITR_EL1_SHIFT: u32 = 23;
8422    /// Offset of the `PMBPTR_EL1` field.
8423    pub const PMBPTR_EL1_SHIFT: u32 = 24;
8424    /// Offset of the `PMBSR_EL1` field.
8425    pub const PMBSR_EL1_SHIFT: u32 = 25;
8426    /// Offset of the `PMSCR_EL1` field.
8427    pub const PMSCR_EL1_SHIFT: u32 = 26;
8428    /// Offset of the `PMSEVFR_EL1` field.
8429    pub const PMSEVFR_EL1_SHIFT: u32 = 27;
8430    /// Offset of the `PMSFCR_EL1` field.
8431    pub const PMSFCR_EL1_SHIFT: u32 = 28;
8432    /// Offset of the `PMSICR_EL1` field.
8433    pub const PMSICR_EL1_SHIFT: u32 = 29;
8434    /// Offset of the `PMSIRR_EL1` field.
8435    pub const PMSIRR_EL1_SHIFT: u32 = 31;
8436    /// Offset of the `PMSLATFR_EL1` field.
8437    pub const PMSLATFR_EL1_SHIFT: u32 = 32;
8438    /// Offset of the `TRC` field.
8439    pub const TRC_SHIFT: u32 = 33;
8440    /// Offset of the `TRCAUXCTLR` field.
8441    pub const TRCAUXCTLR_SHIFT: u32 = 35;
8442    /// Offset of the `TRCCLAIM` field.
8443    pub const TRCCLAIM_SHIFT: u32 = 36;
8444    /// Offset of the `TRCCNTVRn` field.
8445    pub const TRCCNTVRN_SHIFT: u32 = 37;
8446    /// Offset of the `TRCIMSPECn` field.
8447    pub const TRCIMSPECN_SHIFT: u32 = 41;
8448    /// Offset of the `TRCOSLAR` field.
8449    pub const TRCOSLAR_SHIFT: u32 = 42;
8450    /// Offset of the `TRCPRGCTLR` field.
8451    pub const TRCPRGCTLR_SHIFT: u32 = 44;
8452    /// Offset of the `TRCSEQSTR` field.
8453    pub const TRCSEQSTR_SHIFT: u32 = 45;
8454    /// Offset of the `TRCSSCSRn` field.
8455    pub const TRCSSCSRN_SHIFT: u32 = 46;
8456    /// Offset of the `TRCVICTLR` field.
8457    pub const TRCVICTLR_SHIFT: u32 = 48;
8458    /// Offset of the `TRFCR_EL1` field.
8459    pub const TRFCR_EL1_SHIFT: u32 = 49;
8460    /// Offset of the `TRBBASER_EL1` field.
8461    pub const TRBBASER_EL1_SHIFT: u32 = 50;
8462    /// Offset of the `TRBLIMITR_EL1` field.
8463    pub const TRBLIMITR_EL1_SHIFT: u32 = 52;
8464    /// Offset of the `TRBMAR_EL1` field.
8465    pub const TRBMAR_EL1_SHIFT: u32 = 53;
8466    /// Offset of the `TRBPTR_EL1` field.
8467    pub const TRBPTR_EL1_SHIFT: u32 = 54;
8468    /// Offset of the `TRBSR_EL1` field.
8469    pub const TRBSR_EL1_SHIFT: u32 = 55;
8470    /// Offset of the `TRBTRG_EL1` field.
8471    pub const TRBTRG_EL1_SHIFT: u32 = 56;
8472    /// Offset of the `PMUSERENR_EL0` field.
8473    pub const PMUSERENR_EL0_SHIFT: u32 = 57;
8474    /// Offset of the `nBRBCTL` field.
8475    pub const NBRBCTL_SHIFT: u32 = 60;
8476    /// Offset of the `nBRBDATA` field.
8477    pub const NBRBDATA_SHIFT: u32 = 61;
8478    /// Offset of the `nPMSNEVFR_EL1` field.
8479    pub const NPMSNEVFR_EL1_SHIFT: u32 = 62;
8480}
8481
8482#[cfg(feature = "el2")]
8483bitflags! {
8484    /// `HFGITR2_EL2` system register value.
8485    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8486    #[repr(transparent)]
8487    pub struct Hfgitr2El2: u64 {
8488        /// `TSBCSYNC` bit.
8489        const TSBCSYNC = 1 << 0;
8490        /// `nDCCIVAPS` bit.
8491        const NDCCIVAPS = 1 << 1;
8492        /// `PLBIPERME1OS` bit.
8493        const PLBIPERME1OS = 1 << 2;
8494        /// `PLBIASIDE1OS` bit.
8495        const PLBIASIDE1OS = 1 << 3;
8496        /// `PLBIVMALLE1OS` bit.
8497        const PLBIVMALLE1OS = 1 << 4;
8498        /// `PLBIPERME1IS` bit.
8499        const PLBIPERME1IS = 1 << 5;
8500        /// `PLBIASIDE1IS` bit.
8501        const PLBIASIDE1IS = 1 << 6;
8502        /// `PLBIVMALLE1IS` bit.
8503        const PLBIVMALLE1IS = 1 << 7;
8504        /// `PLBIPERME1` bit.
8505        const PLBIPERME1 = 1 << 8;
8506        /// `PLBIASIDE1` bit.
8507        const PLBIASIDE1 = 1 << 9;
8508        /// `PLBIVMALLE1` bit.
8509        const PLBIVMALLE1 = 1 << 10;
8510        /// `PLBIPERMAE1OS` bit.
8511        const PLBIPERMAE1OS = 1 << 11;
8512        /// `PLBIPERMAE1IS` bit.
8513        const PLBIPERMAE1IS = 1 << 12;
8514        /// `PLBIPERMAE1` bit.
8515        const PLBIPERMAE1 = 1 << 13;
8516        /// `DCGBVA` bit.
8517        const DCGBVA = 1 << 14;
8518    }
8519}
8520
8521#[cfg(feature = "el2")]
8522impl Hfgitr2El2 {
8523    /// Offset of the `TSBCSYNC` field.
8524    pub const TSBCSYNC_SHIFT: u32 = 0;
8525    /// Offset of the `nDCCIVAPS` field.
8526    pub const NDCCIVAPS_SHIFT: u32 = 1;
8527    /// Offset of the `PLBIPERME1OS` field.
8528    pub const PLBIPERME1OS_SHIFT: u32 = 2;
8529    /// Offset of the `PLBIASIDE1OS` field.
8530    pub const PLBIASIDE1OS_SHIFT: u32 = 3;
8531    /// Offset of the `PLBIVMALLE1OS` field.
8532    pub const PLBIVMALLE1OS_SHIFT: u32 = 4;
8533    /// Offset of the `PLBIPERME1IS` field.
8534    pub const PLBIPERME1IS_SHIFT: u32 = 5;
8535    /// Offset of the `PLBIASIDE1IS` field.
8536    pub const PLBIASIDE1IS_SHIFT: u32 = 6;
8537    /// Offset of the `PLBIVMALLE1IS` field.
8538    pub const PLBIVMALLE1IS_SHIFT: u32 = 7;
8539    /// Offset of the `PLBIPERME1` field.
8540    pub const PLBIPERME1_SHIFT: u32 = 8;
8541    /// Offset of the `PLBIASIDE1` field.
8542    pub const PLBIASIDE1_SHIFT: u32 = 9;
8543    /// Offset of the `PLBIVMALLE1` field.
8544    pub const PLBIVMALLE1_SHIFT: u32 = 10;
8545    /// Offset of the `PLBIPERMAE1OS` field.
8546    pub const PLBIPERMAE1OS_SHIFT: u32 = 11;
8547    /// Offset of the `PLBIPERMAE1IS` field.
8548    pub const PLBIPERMAE1IS_SHIFT: u32 = 12;
8549    /// Offset of the `PLBIPERMAE1` field.
8550    pub const PLBIPERMAE1_SHIFT: u32 = 13;
8551    /// Offset of the `DCGBVA` field.
8552    pub const DCGBVA_SHIFT: u32 = 14;
8553}
8554
8555#[cfg(feature = "el2")]
8556bitflags! {
8557    /// `HFGITR_EL2` system register value.
8558    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8559    #[repr(transparent)]
8560    pub struct HfgitrEl2: u64 {
8561        /// `ICIALLUIS` bit.
8562        const ICIALLUIS = 1 << 0;
8563        /// `ICIALLU` bit.
8564        const ICIALLU = 1 << 1;
8565        /// `ICIVAU` bit.
8566        const ICIVAU = 1 << 2;
8567        /// `DCIVAC` bit.
8568        const DCIVAC = 1 << 3;
8569        /// `DCISW` bit.
8570        const DCISW = 1 << 4;
8571        /// `DCCSW` bit.
8572        const DCCSW = 1 << 5;
8573        /// `DCCISW` bit.
8574        const DCCISW = 1 << 6;
8575        /// `DCCVAU` bit.
8576        const DCCVAU = 1 << 7;
8577        /// `DCCVAP` bit.
8578        const DCCVAP = 1 << 8;
8579        /// `DCCVADP` bit.
8580        const DCCVADP = 1 << 9;
8581        /// `DCCIVAC` bit.
8582        const DCCIVAC = 1 << 10;
8583        /// `DCZVA` bit.
8584        const DCZVA = 1 << 11;
8585        /// `ATS1E1R` bit.
8586        const ATS1E1R = 1 << 12;
8587        /// `ATS1E1W` bit.
8588        const ATS1E1W = 1 << 13;
8589        /// `ATS1E0R` bit.
8590        const ATS1E0R = 1 << 14;
8591        /// `ATS1E0W` bit.
8592        const ATS1E0W = 1 << 15;
8593        /// `ATS1E1RP` bit.
8594        const ATS1E1RP = 1 << 16;
8595        /// `ATS1E1WP` bit.
8596        const ATS1E1WP = 1 << 17;
8597        /// `TLBIVMALLE1OS` bit.
8598        const TLBIVMALLE1OS = 1 << 18;
8599        /// `TLBIVAE1OS` bit.
8600        const TLBIVAE1OS = 1 << 19;
8601        /// `TLBIASIDE1OS` bit.
8602        const TLBIASIDE1OS = 1 << 20;
8603        /// `TLBIVAAE1OS` bit.
8604        const TLBIVAAE1OS = 1 << 21;
8605        /// `TLBIVALE1OS` bit.
8606        const TLBIVALE1OS = 1 << 22;
8607        /// `TLBIVAALE1OS` bit.
8608        const TLBIVAALE1OS = 1 << 23;
8609        /// `TLBIRVAE1OS` bit.
8610        const TLBIRVAE1OS = 1 << 24;
8611        /// `TLBIRVAAE1OS` bit.
8612        const TLBIRVAAE1OS = 1 << 25;
8613        /// `TLBIRVALE1OS` bit.
8614        const TLBIRVALE1OS = 1 << 26;
8615        /// `TLBIRVAALE1OS` bit.
8616        const TLBIRVAALE1OS = 1 << 27;
8617        /// `TLBIVMALLE1IS` bit.
8618        const TLBIVMALLE1IS = 1 << 28;
8619        /// `TLBIVAE1IS` bit.
8620        const TLBIVAE1IS = 1 << 29;
8621        /// `TLBIASIDE1IS` bit.
8622        const TLBIASIDE1IS = 1 << 30;
8623        /// `TLBIVAAE1IS` bit.
8624        const TLBIVAAE1IS = 1 << 31;
8625        /// `TLBIVALE1IS` bit.
8626        const TLBIVALE1IS = 1 << 32;
8627        /// `TLBIVAALE1IS` bit.
8628        const TLBIVAALE1IS = 1 << 33;
8629        /// `TLBIRVAE1IS` bit.
8630        const TLBIRVAE1IS = 1 << 34;
8631        /// `TLBIRVAAE1IS` bit.
8632        const TLBIRVAAE1IS = 1 << 35;
8633        /// `TLBIRVALE1IS` bit.
8634        const TLBIRVALE1IS = 1 << 36;
8635        /// `TLBIRVAALE1IS` bit.
8636        const TLBIRVAALE1IS = 1 << 37;
8637        /// `TLBIRVAE1` bit.
8638        const TLBIRVAE1 = 1 << 38;
8639        /// `TLBIRVAAE1` bit.
8640        const TLBIRVAAE1 = 1 << 39;
8641        /// `TLBIRVALE1` bit.
8642        const TLBIRVALE1 = 1 << 40;
8643        /// `TLBIRVAALE1` bit.
8644        const TLBIRVAALE1 = 1 << 41;
8645        /// `TLBIVMALLE1` bit.
8646        const TLBIVMALLE1 = 1 << 42;
8647        /// `TLBIVAE1` bit.
8648        const TLBIVAE1 = 1 << 43;
8649        /// `TLBIASIDE1` bit.
8650        const TLBIASIDE1 = 1 << 44;
8651        /// `TLBIVAAE1` bit.
8652        const TLBIVAAE1 = 1 << 45;
8653        /// `TLBIVALE1` bit.
8654        const TLBIVALE1 = 1 << 46;
8655        /// `TLBIVAALE1` bit.
8656        const TLBIVAALE1 = 1 << 47;
8657        /// `CFPRCTX` bit.
8658        const CFPRCTX = 1 << 48;
8659        /// `DVPRCTX` bit.
8660        const DVPRCTX = 1 << 49;
8661        /// `CPPRCTX` bit.
8662        const CPPRCTX = 1 << 50;
8663        /// `ERET` bit.
8664        const ERET = 1 << 51;
8665        /// `SVC_EL0` bit.
8666        const SVC_EL0 = 1 << 52;
8667        /// `SVC_EL1` bit.
8668        const SVC_EL1 = 1 << 53;
8669        /// `DCCVAC` bit.
8670        const DCCVAC = 1 << 54;
8671        /// `nBRBINJ` bit.
8672        const NBRBINJ = 1 << 55;
8673        /// `nBRBIALL` bit.
8674        const NBRBIALL = 1 << 56;
8675        /// `nGCSPUSHM_EL1` bit.
8676        const NGCSPUSHM_EL1 = 1 << 57;
8677        /// `nGCSSTR_EL1` bit.
8678        const NGCSSTR_EL1 = 1 << 58;
8679        /// `nGCSEPP` bit.
8680        const NGCSEPP = 1 << 59;
8681        /// `COSPRCTX` bit.
8682        const COSPRCTX = 1 << 60;
8683        /// `ATS1E1A` bit.
8684        const ATS1E1A = 1 << 62;
8685        /// `PSBCSYNC` bit.
8686        const PSBCSYNC = 1 << 63;
8687    }
8688}
8689
8690#[cfg(feature = "el2")]
8691impl HfgitrEl2 {
8692    /// Offset of the `ICIALLUIS` field.
8693    pub const ICIALLUIS_SHIFT: u32 = 0;
8694    /// Offset of the `ICIALLU` field.
8695    pub const ICIALLU_SHIFT: u32 = 1;
8696    /// Offset of the `ICIVAU` field.
8697    pub const ICIVAU_SHIFT: u32 = 2;
8698    /// Offset of the `DCIVAC` field.
8699    pub const DCIVAC_SHIFT: u32 = 3;
8700    /// Offset of the `DCISW` field.
8701    pub const DCISW_SHIFT: u32 = 4;
8702    /// Offset of the `DCCSW` field.
8703    pub const DCCSW_SHIFT: u32 = 5;
8704    /// Offset of the `DCCISW` field.
8705    pub const DCCISW_SHIFT: u32 = 6;
8706    /// Offset of the `DCCVAU` field.
8707    pub const DCCVAU_SHIFT: u32 = 7;
8708    /// Offset of the `DCCVAP` field.
8709    pub const DCCVAP_SHIFT: u32 = 8;
8710    /// Offset of the `DCCVADP` field.
8711    pub const DCCVADP_SHIFT: u32 = 9;
8712    /// Offset of the `DCCIVAC` field.
8713    pub const DCCIVAC_SHIFT: u32 = 10;
8714    /// Offset of the `DCZVA` field.
8715    pub const DCZVA_SHIFT: u32 = 11;
8716    /// Offset of the `ATS1E1R` field.
8717    pub const ATS1E1R_SHIFT: u32 = 12;
8718    /// Offset of the `ATS1E1W` field.
8719    pub const ATS1E1W_SHIFT: u32 = 13;
8720    /// Offset of the `ATS1E0R` field.
8721    pub const ATS1E0R_SHIFT: u32 = 14;
8722    /// Offset of the `ATS1E0W` field.
8723    pub const ATS1E0W_SHIFT: u32 = 15;
8724    /// Offset of the `ATS1E1RP` field.
8725    pub const ATS1E1RP_SHIFT: u32 = 16;
8726    /// Offset of the `ATS1E1WP` field.
8727    pub const ATS1E1WP_SHIFT: u32 = 17;
8728    /// Offset of the `TLBIVMALLE1OS` field.
8729    pub const TLBIVMALLE1OS_SHIFT: u32 = 18;
8730    /// Offset of the `TLBIVAE1OS` field.
8731    pub const TLBIVAE1OS_SHIFT: u32 = 19;
8732    /// Offset of the `TLBIASIDE1OS` field.
8733    pub const TLBIASIDE1OS_SHIFT: u32 = 20;
8734    /// Offset of the `TLBIVAAE1OS` field.
8735    pub const TLBIVAAE1OS_SHIFT: u32 = 21;
8736    /// Offset of the `TLBIVALE1OS` field.
8737    pub const TLBIVALE1OS_SHIFT: u32 = 22;
8738    /// Offset of the `TLBIVAALE1OS` field.
8739    pub const TLBIVAALE1OS_SHIFT: u32 = 23;
8740    /// Offset of the `TLBIRVAE1OS` field.
8741    pub const TLBIRVAE1OS_SHIFT: u32 = 24;
8742    /// Offset of the `TLBIRVAAE1OS` field.
8743    pub const TLBIRVAAE1OS_SHIFT: u32 = 25;
8744    /// Offset of the `TLBIRVALE1OS` field.
8745    pub const TLBIRVALE1OS_SHIFT: u32 = 26;
8746    /// Offset of the `TLBIRVAALE1OS` field.
8747    pub const TLBIRVAALE1OS_SHIFT: u32 = 27;
8748    /// Offset of the `TLBIVMALLE1IS` field.
8749    pub const TLBIVMALLE1IS_SHIFT: u32 = 28;
8750    /// Offset of the `TLBIVAE1IS` field.
8751    pub const TLBIVAE1IS_SHIFT: u32 = 29;
8752    /// Offset of the `TLBIASIDE1IS` field.
8753    pub const TLBIASIDE1IS_SHIFT: u32 = 30;
8754    /// Offset of the `TLBIVAAE1IS` field.
8755    pub const TLBIVAAE1IS_SHIFT: u32 = 31;
8756    /// Offset of the `TLBIVALE1IS` field.
8757    pub const TLBIVALE1IS_SHIFT: u32 = 32;
8758    /// Offset of the `TLBIVAALE1IS` field.
8759    pub const TLBIVAALE1IS_SHIFT: u32 = 33;
8760    /// Offset of the `TLBIRVAE1IS` field.
8761    pub const TLBIRVAE1IS_SHIFT: u32 = 34;
8762    /// Offset of the `TLBIRVAAE1IS` field.
8763    pub const TLBIRVAAE1IS_SHIFT: u32 = 35;
8764    /// Offset of the `TLBIRVALE1IS` field.
8765    pub const TLBIRVALE1IS_SHIFT: u32 = 36;
8766    /// Offset of the `TLBIRVAALE1IS` field.
8767    pub const TLBIRVAALE1IS_SHIFT: u32 = 37;
8768    /// Offset of the `TLBIRVAE1` field.
8769    pub const TLBIRVAE1_SHIFT: u32 = 38;
8770    /// Offset of the `TLBIRVAAE1` field.
8771    pub const TLBIRVAAE1_SHIFT: u32 = 39;
8772    /// Offset of the `TLBIRVALE1` field.
8773    pub const TLBIRVALE1_SHIFT: u32 = 40;
8774    /// Offset of the `TLBIRVAALE1` field.
8775    pub const TLBIRVAALE1_SHIFT: u32 = 41;
8776    /// Offset of the `TLBIVMALLE1` field.
8777    pub const TLBIVMALLE1_SHIFT: u32 = 42;
8778    /// Offset of the `TLBIVAE1` field.
8779    pub const TLBIVAE1_SHIFT: u32 = 43;
8780    /// Offset of the `TLBIASIDE1` field.
8781    pub const TLBIASIDE1_SHIFT: u32 = 44;
8782    /// Offset of the `TLBIVAAE1` field.
8783    pub const TLBIVAAE1_SHIFT: u32 = 45;
8784    /// Offset of the `TLBIVALE1` field.
8785    pub const TLBIVALE1_SHIFT: u32 = 46;
8786    /// Offset of the `TLBIVAALE1` field.
8787    pub const TLBIVAALE1_SHIFT: u32 = 47;
8788    /// Offset of the `CFPRCTX` field.
8789    pub const CFPRCTX_SHIFT: u32 = 48;
8790    /// Offset of the `DVPRCTX` field.
8791    pub const DVPRCTX_SHIFT: u32 = 49;
8792    /// Offset of the `CPPRCTX` field.
8793    pub const CPPRCTX_SHIFT: u32 = 50;
8794    /// Offset of the `ERET` field.
8795    pub const ERET_SHIFT: u32 = 51;
8796    /// Offset of the `SVC_EL0` field.
8797    pub const SVC_EL0_SHIFT: u32 = 52;
8798    /// Offset of the `SVC_EL1` field.
8799    pub const SVC_EL1_SHIFT: u32 = 53;
8800    /// Offset of the `DCCVAC` field.
8801    pub const DCCVAC_SHIFT: u32 = 54;
8802    /// Offset of the `nBRBINJ` field.
8803    pub const NBRBINJ_SHIFT: u32 = 55;
8804    /// Offset of the `nBRBIALL` field.
8805    pub const NBRBIALL_SHIFT: u32 = 56;
8806    /// Offset of the `nGCSPUSHM_EL1` field.
8807    pub const NGCSPUSHM_EL1_SHIFT: u32 = 57;
8808    /// Offset of the `nGCSSTR_EL1` field.
8809    pub const NGCSSTR_EL1_SHIFT: u32 = 58;
8810    /// Offset of the `nGCSEPP` field.
8811    pub const NGCSEPP_SHIFT: u32 = 59;
8812    /// Offset of the `COSPRCTX` field.
8813    pub const COSPRCTX_SHIFT: u32 = 60;
8814    /// Offset of the `ATS1E1A` field.
8815    pub const ATS1E1A_SHIFT: u32 = 62;
8816    /// Offset of the `PSBCSYNC` field.
8817    pub const PSBCSYNC_SHIFT: u32 = 63;
8818}
8819
8820#[cfg(feature = "el2")]
8821bitflags! {
8822    /// `HFGRTR2_EL2` system register value.
8823    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
8824    #[repr(transparent)]
8825    pub struct Hfgrtr2El2: u64 {
8826        /// `nPFAR_EL1` bit.
8827        const NPFAR_EL1 = 1 << 0;
8828        /// `nERXGSR_EL1` bit.
8829        const NERXGSR_EL1 = 1 << 1;
8830        /// `nRCWSMASK_EL1` bit.
8831        const NRCWSMASK_EL1 = 1 << 2;
8832        /// `nCPACRMASK_EL1` bit.
8833        const NCPACRMASK_EL1 = 1 << 3;
8834        /// `nSCTLRMASK_EL1` bit.
8835        const NSCTLRMASK_EL1 = 1 << 4;
8836        /// `nSCTLR2MASK_EL1` bit.
8837        const NSCTLR2MASK_EL1 = 1 << 5;
8838        /// `nTCRMASK_EL1` bit.
8839        const NTCRMASK_EL1 = 1 << 6;
8840        /// `nTCR2MASK_EL1` bit.
8841        const NTCR2MASK_EL1 = 1 << 7;
8842        /// `nCPACRALIAS_EL1` bit.
8843        const NCPACRALIAS_EL1 = 1 << 8;
8844        /// `nSCTLRALIAS_EL1` bit.
8845        const NSCTLRALIAS_EL1 = 1 << 9;
8846        /// `nSCTLR2ALIAS_EL1` bit.
8847        const NSCTLR2ALIAS_EL1 = 1 << 10;
8848        /// `nTCRALIAS_EL1` bit.
8849        const NTCRALIAS_EL1 = 1 << 11;
8850        /// `nTCR2ALIAS_EL1` bit.
8851        const NTCR2ALIAS_EL1 = 1 << 12;
8852        /// `nACTLRMASK_EL1` bit.
8853        const NACTLRMASK_EL1 = 1 << 13;
8854        /// `nACTLRALIAS_EL1` bit.
8855        const NACTLRALIAS_EL1 = 1 << 14;
8856        /// `nTINDEX_EL0` bit.
8857        const NTINDEX_EL0 = 1 << 15;
8858        /// `nTINDEX_EL1` bit.
8859        const NTINDEX_EL1 = 1 << 16;
8860        /// `nSTINDEX_EL1` bit.
8861        const NSTINDEX_EL1 = 1 << 17;
8862        /// `nTTTBRP_EL1` bit.
8863        const NTTTBRP_EL1 = 1 << 20;
8864        /// `nTTTBRU_EL1` bit.
8865        const NTTTBRU_EL1 = 1 << 21;
8866        /// `nIRTBRP_EL1` bit.
8867        const NIRTBRP_EL1 = 1 << 22;
8868        /// `nIRTBRU_EL1` bit.
8869        const NIRTBRU_EL1 = 1 << 23;
8870        /// `nDPOTBR1_EL1` bit.
8871        const NDPOTBR1_EL1 = 1 << 24;
8872        /// `nDPOTBR0_EL1` bit.
8873        const NDPOTBR0_EL1 = 1 << 25;
8874        /// `nTPMIN1_EL1` bit.
8875        const NTPMIN1_EL1 = 1 << 26;
8876        /// `nTPMIN0_EL1` bit.
8877        const NTPMIN0_EL1 = 1 << 27;
8878        /// `nTPMIN1_EL0` bit.
8879        const NTPMIN1_EL0 = 1 << 28;
8880        /// `nTPMIN0_EL0` bit.
8881        const NTPMIN0_EL0 = 1 << 29;
8882        /// `nTLBIDIDR_EL1` bit.
8883        const NTLBIDIDR_EL1 = 1 << 30;
8884        /// `TFSR_EL1` bit.
8885        const TFSR_EL1 = 1 << 33;
8886        /// `RGSR_EL1` bit.
8887        const RGSR_EL1 = 1 << 34;
8888        /// `GCR_EL1` bit.
8889        const GCR_EL1 = 1 << 35;
8890        /// `nTPIDR3_EL0` bit.
8891        const NTPIDR3_EL0 = 1 << 36;
8892        /// `nTPIDR3_EL1` bit.
8893        const NTPIDR3_EL1 = 1 << 37;
8894    }
8895}
8896
8897#[cfg(feature = "el2")]
8898impl Hfgrtr2El2 {
8899    /// Offset of the `nPFAR_EL1` field.
8900    pub const NPFAR_EL1_SHIFT: u32 = 0;
8901    /// Offset of the `nERXGSR_EL1` field.
8902    pub const NERXGSR_EL1_SHIFT: u32 = 1;
8903    /// Offset of the `nRCWSMASK_EL1` field.
8904    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
8905    /// Offset of the `nCPACRMASK_EL1` field.
8906    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
8907    /// Offset of the `nSCTLRMASK_EL1` field.
8908    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
8909    /// Offset of the `nSCTLR2MASK_EL1` field.
8910    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
8911    /// Offset of the `nTCRMASK_EL1` field.
8912    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
8913    /// Offset of the `nTCR2MASK_EL1` field.
8914    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
8915    /// Offset of the `nCPACRALIAS_EL1` field.
8916    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
8917    /// Offset of the `nSCTLRALIAS_EL1` field.
8918    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
8919    /// Offset of the `nSCTLR2ALIAS_EL1` field.
8920    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
8921    /// Offset of the `nTCRALIAS_EL1` field.
8922    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
8923    /// Offset of the `nTCR2ALIAS_EL1` field.
8924    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
8925    /// Offset of the `nACTLRMASK_EL1` field.
8926    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
8927    /// Offset of the `nACTLRALIAS_EL1` field.
8928    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
8929    /// Offset of the `nTINDEX_EL0` field.
8930    pub const NTINDEX_EL0_SHIFT: u32 = 15;
8931    /// Offset of the `nTINDEX_EL1` field.
8932    pub const NTINDEX_EL1_SHIFT: u32 = 16;
8933    /// Offset of the `nSTINDEX_EL1` field.
8934    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
8935    /// Offset of the `nFGDTn_EL1` field.
8936    pub const NFGDTN_EL1_SHIFT: u32 = 18;
8937    /// Mask for the `nFGDTn_EL1` field.
8938    pub const NFGDTN_EL1_MASK: u64 = 0b11;
8939    /// Offset of the `nTTTBRP_EL1` field.
8940    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
8941    /// Offset of the `nTTTBRU_EL1` field.
8942    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
8943    /// Offset of the `nIRTBRP_EL1` field.
8944    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
8945    /// Offset of the `nIRTBRU_EL1` field.
8946    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
8947    /// Offset of the `nDPOTBR1_EL1` field.
8948    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
8949    /// Offset of the `nDPOTBR0_EL1` field.
8950    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
8951    /// Offset of the `nTPMIN1_EL1` field.
8952    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
8953    /// Offset of the `nTPMIN0_EL1` field.
8954    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
8955    /// Offset of the `nTPMIN1_EL0` field.
8956    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
8957    /// Offset of the `nTPMIN0_EL0` field.
8958    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
8959    /// Offset of the `nTLBIDIDR_EL1` field.
8960    pub const NTLBIDIDR_EL1_SHIFT: u32 = 30;
8961    /// Offset of the `nAFGDTn_EL1` field.
8962    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
8963    /// Mask for the `nAFGDTn_EL1` field.
8964    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
8965    /// Offset of the `TFSR_EL1` field.
8966    pub const TFSR_EL1_SHIFT: u32 = 33;
8967    /// Offset of the `RGSR_EL1` field.
8968    pub const RGSR_EL1_SHIFT: u32 = 34;
8969    /// Offset of the `GCR_EL1` field.
8970    pub const GCR_EL1_SHIFT: u32 = 35;
8971    /// Offset of the `nTPIDR3_EL0` field.
8972    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
8973    /// Offset of the `nTPIDR3_EL1` field.
8974    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
8975
8976    /// Returns the value of the `nFGDTn_EL1` field.
8977    pub const fn nfgdtn_el1(self) -> u8 {
8978        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
8979    }
8980
8981    /// Sets the value of the `nFGDTn_EL1` field.
8982    pub const fn set_nfgdtn_el1(&mut self, value: u8) {
8983        let offset = Self::NFGDTN_EL1_SHIFT;
8984        assert!(value & (Self::NFGDTN_EL1_MASK as u8) == value);
8985        *self = Self::from_bits_retain(
8986            (self.bits() & !(Self::NFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
8987        );
8988    }
8989
8990    /// Returns a copy with the `nFGDTn_EL1` field set to the given value.
8991    pub const fn with_nfgdtn_el1(mut self, value: u8) -> Self {
8992        self.set_nfgdtn_el1(value);
8993        self
8994    }
8995
8996    /// Returns the value of the `nAFGDTn_EL1` field.
8997    pub const fn nafgdtn_el1(self) -> u8 {
8998        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
8999    }
9000
9001    /// Sets the value of the `nAFGDTn_EL1` field.
9002    pub const fn set_nafgdtn_el1(&mut self, value: u8) {
9003        let offset = Self::NAFGDTN_EL1_SHIFT;
9004        assert!(value & (Self::NAFGDTN_EL1_MASK as u8) == value);
9005        *self = Self::from_bits_retain(
9006            (self.bits() & !(Self::NAFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
9007        );
9008    }
9009
9010    /// Returns a copy with the `nAFGDTn_EL1` field set to the given value.
9011    pub const fn with_nafgdtn_el1(mut self, value: u8) -> Self {
9012        self.set_nafgdtn_el1(value);
9013        self
9014    }
9015}
9016
9017#[cfg(feature = "el2")]
9018bitflags! {
9019    /// `HFGRTR_EL2` system register value.
9020    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9021    #[repr(transparent)]
9022    pub struct HfgrtrEl2: u64 {
9023        /// `AFSR0_EL1` bit.
9024        const AFSR0_EL1 = 1 << 0;
9025        /// `AFSR1_EL1` bit.
9026        const AFSR1_EL1 = 1 << 1;
9027        /// `AIDR_EL1` bit.
9028        const AIDR_EL1 = 1 << 2;
9029        /// `AMAIR_EL1` bit.
9030        const AMAIR_EL1 = 1 << 3;
9031        /// `APDAKey` bit.
9032        const APDAKEY = 1 << 4;
9033        /// `APDBKey` bit.
9034        const APDBKEY = 1 << 5;
9035        /// `APGAKey` bit.
9036        const APGAKEY = 1 << 6;
9037        /// `APIAKey` bit.
9038        const APIAKEY = 1 << 7;
9039        /// `APIBKey` bit.
9040        const APIBKEY = 1 << 8;
9041        /// `CCSIDR_EL1` bit.
9042        const CCSIDR_EL1 = 1 << 9;
9043        /// `CLIDR_EL1` bit.
9044        const CLIDR_EL1 = 1 << 10;
9045        /// `CONTEXTIDR_EL1` bit.
9046        const CONTEXTIDR_EL1 = 1 << 11;
9047        /// `CPACR_EL1` bit.
9048        const CPACR_EL1 = 1 << 12;
9049        /// `CSSELR_EL1` bit.
9050        const CSSELR_EL1 = 1 << 13;
9051        /// `CTR_EL0` bit.
9052        const CTR_EL0 = 1 << 14;
9053        /// `DCZID_EL0` bit.
9054        const DCZID_EL0 = 1 << 15;
9055        /// `ESR_EL1` bit.
9056        const ESR_EL1 = 1 << 16;
9057        /// `FAR_EL1` bit.
9058        const FAR_EL1 = 1 << 17;
9059        /// `ISR_EL1` bit.
9060        const ISR_EL1 = 1 << 18;
9061        /// `LORC_EL1` bit.
9062        const LORC_EL1 = 1 << 19;
9063        /// `LOREA_EL1` bit.
9064        const LOREA_EL1 = 1 << 20;
9065        /// `LORID_EL1` bit.
9066        const LORID_EL1 = 1 << 21;
9067        /// `LORN_EL1` bit.
9068        const LORN_EL1 = 1 << 22;
9069        /// `LORSA_EL1` bit.
9070        const LORSA_EL1 = 1 << 23;
9071        /// `MAIR_EL1` bit.
9072        const MAIR_EL1 = 1 << 24;
9073        /// `MIDR_EL1` bit.
9074        const MIDR_EL1 = 1 << 25;
9075        /// `MPIDR_EL1` bit.
9076        const MPIDR_EL1 = 1 << 26;
9077        /// `PAR_EL1` bit.
9078        const PAR_EL1 = 1 << 27;
9079        /// `REVIDR_EL1` bit.
9080        const REVIDR_EL1 = 1 << 28;
9081        /// `SCTLR_EL1` bit.
9082        const SCTLR_EL1 = 1 << 29;
9083        /// `SCXTNUM_EL1` bit.
9084        const SCXTNUM_EL1 = 1 << 30;
9085        /// `SCXTNUM_EL0` bit.
9086        const SCXTNUM_EL0 = 1 << 31;
9087        /// `TCR_EL1` bit.
9088        const TCR_EL1 = 1 << 32;
9089        /// `TPIDR_EL1` bit.
9090        const TPIDR_EL1 = 1 << 33;
9091        /// `TPIDRRO_EL0` bit.
9092        const TPIDRRO_EL0 = 1 << 34;
9093        /// `TPIDR_EL0` bit.
9094        const TPIDR_EL0 = 1 << 35;
9095        /// `TTBR0_EL1` bit.
9096        const TTBR0_EL1 = 1 << 36;
9097        /// `TTBR1_EL1` bit.
9098        const TTBR1_EL1 = 1 << 37;
9099        /// `VBAR_EL1` bit.
9100        const VBAR_EL1 = 1 << 38;
9101        /// `ICC_IGRPENn_EL1` bit.
9102        const ICC_IGRPENN_EL1 = 1 << 39;
9103        /// `ERRIDR_EL1` bit.
9104        const ERRIDR_EL1 = 1 << 40;
9105        /// `ERRSELR_EL1` bit.
9106        const ERRSELR_EL1 = 1 << 41;
9107        /// `ERXFR_EL1` bit.
9108        const ERXFR_EL1 = 1 << 42;
9109        /// `ERXCTLR_EL1` bit.
9110        const ERXCTLR_EL1 = 1 << 43;
9111        /// `ERXSTATUS_EL1` bit.
9112        const ERXSTATUS_EL1 = 1 << 44;
9113        /// `ERXMISCn_EL1` bit.
9114        const ERXMISCN_EL1 = 1 << 45;
9115        /// `ERXPFGF_EL1` bit.
9116        const ERXPFGF_EL1 = 1 << 46;
9117        /// `ERXPFGCTL_EL1` bit.
9118        const ERXPFGCTL_EL1 = 1 << 47;
9119        /// `ERXPFGCDN_EL1` bit.
9120        const ERXPFGCDN_EL1 = 1 << 48;
9121        /// `ERXADDR_EL1` bit.
9122        const ERXADDR_EL1 = 1 << 49;
9123        /// `nACCDATA_EL1` bit.
9124        const NACCDATA_EL1 = 1 << 50;
9125        /// `nGCS_EL0` bit.
9126        const NGCS_EL0 = 1 << 52;
9127        /// `nGCS_EL1` bit.
9128        const NGCS_EL1 = 1 << 53;
9129        /// `nSMPRI_EL1` bit.
9130        const NSMPRI_EL1 = 1 << 54;
9131        /// `nTPIDR2_EL0` bit.
9132        const NTPIDR2_EL0 = 1 << 55;
9133        /// `nRCWMASK_EL1` bit.
9134        const NRCWMASK_EL1 = 1 << 56;
9135        /// `nPIRE0_EL1` bit.
9136        const NPIRE0_EL1 = 1 << 57;
9137        /// `nPIR_EL1` bit.
9138        const NPIR_EL1 = 1 << 58;
9139        /// `nPOR_EL0` bit.
9140        const NPOR_EL0 = 1 << 59;
9141        /// `nPOR_EL1` bit.
9142        const NPOR_EL1 = 1 << 60;
9143        /// `nS2POR_EL1` bit.
9144        const NS2POR_EL1 = 1 << 61;
9145        /// `nMAIR2_EL1` bit.
9146        const NMAIR2_EL1 = 1 << 62;
9147        /// `nAMAIR2_EL1` bit.
9148        const NAMAIR2_EL1 = 1 << 63;
9149    }
9150}
9151
9152#[cfg(feature = "el2")]
9153impl HfgrtrEl2 {
9154    /// Offset of the `AFSR0_EL1` field.
9155    pub const AFSR0_EL1_SHIFT: u32 = 0;
9156    /// Offset of the `AFSR1_EL1` field.
9157    pub const AFSR1_EL1_SHIFT: u32 = 1;
9158    /// Offset of the `AIDR_EL1` field.
9159    pub const AIDR_EL1_SHIFT: u32 = 2;
9160    /// Offset of the `AMAIR_EL1` field.
9161    pub const AMAIR_EL1_SHIFT: u32 = 3;
9162    /// Offset of the `APDAKey` field.
9163    pub const APDAKEY_SHIFT: u32 = 4;
9164    /// Offset of the `APDBKey` field.
9165    pub const APDBKEY_SHIFT: u32 = 5;
9166    /// Offset of the `APGAKey` field.
9167    pub const APGAKEY_SHIFT: u32 = 6;
9168    /// Offset of the `APIAKey` field.
9169    pub const APIAKEY_SHIFT: u32 = 7;
9170    /// Offset of the `APIBKey` field.
9171    pub const APIBKEY_SHIFT: u32 = 8;
9172    /// Offset of the `CCSIDR_EL1` field.
9173    pub const CCSIDR_EL1_SHIFT: u32 = 9;
9174    /// Offset of the `CLIDR_EL1` field.
9175    pub const CLIDR_EL1_SHIFT: u32 = 10;
9176    /// Offset of the `CONTEXTIDR_EL1` field.
9177    pub const CONTEXTIDR_EL1_SHIFT: u32 = 11;
9178    /// Offset of the `CPACR_EL1` field.
9179    pub const CPACR_EL1_SHIFT: u32 = 12;
9180    /// Offset of the `CSSELR_EL1` field.
9181    pub const CSSELR_EL1_SHIFT: u32 = 13;
9182    /// Offset of the `CTR_EL0` field.
9183    pub const CTR_EL0_SHIFT: u32 = 14;
9184    /// Offset of the `DCZID_EL0` field.
9185    pub const DCZID_EL0_SHIFT: u32 = 15;
9186    /// Offset of the `ESR_EL1` field.
9187    pub const ESR_EL1_SHIFT: u32 = 16;
9188    /// Offset of the `FAR_EL1` field.
9189    pub const FAR_EL1_SHIFT: u32 = 17;
9190    /// Offset of the `ISR_EL1` field.
9191    pub const ISR_EL1_SHIFT: u32 = 18;
9192    /// Offset of the `LORC_EL1` field.
9193    pub const LORC_EL1_SHIFT: u32 = 19;
9194    /// Offset of the `LOREA_EL1` field.
9195    pub const LOREA_EL1_SHIFT: u32 = 20;
9196    /// Offset of the `LORID_EL1` field.
9197    pub const LORID_EL1_SHIFT: u32 = 21;
9198    /// Offset of the `LORN_EL1` field.
9199    pub const LORN_EL1_SHIFT: u32 = 22;
9200    /// Offset of the `LORSA_EL1` field.
9201    pub const LORSA_EL1_SHIFT: u32 = 23;
9202    /// Offset of the `MAIR_EL1` field.
9203    pub const MAIR_EL1_SHIFT: u32 = 24;
9204    /// Offset of the `MIDR_EL1` field.
9205    pub const MIDR_EL1_SHIFT: u32 = 25;
9206    /// Offset of the `MPIDR_EL1` field.
9207    pub const MPIDR_EL1_SHIFT: u32 = 26;
9208    /// Offset of the `PAR_EL1` field.
9209    pub const PAR_EL1_SHIFT: u32 = 27;
9210    /// Offset of the `REVIDR_EL1` field.
9211    pub const REVIDR_EL1_SHIFT: u32 = 28;
9212    /// Offset of the `SCTLR_EL1` field.
9213    pub const SCTLR_EL1_SHIFT: u32 = 29;
9214    /// Offset of the `SCXTNUM_EL1` field.
9215    pub const SCXTNUM_EL1_SHIFT: u32 = 30;
9216    /// Offset of the `SCXTNUM_EL0` field.
9217    pub const SCXTNUM_EL0_SHIFT: u32 = 31;
9218    /// Offset of the `TCR_EL1` field.
9219    pub const TCR_EL1_SHIFT: u32 = 32;
9220    /// Offset of the `TPIDR_EL1` field.
9221    pub const TPIDR_EL1_SHIFT: u32 = 33;
9222    /// Offset of the `TPIDRRO_EL0` field.
9223    pub const TPIDRRO_EL0_SHIFT: u32 = 34;
9224    /// Offset of the `TPIDR_EL0` field.
9225    pub const TPIDR_EL0_SHIFT: u32 = 35;
9226    /// Offset of the `TTBR0_EL1` field.
9227    pub const TTBR0_EL1_SHIFT: u32 = 36;
9228    /// Offset of the `TTBR1_EL1` field.
9229    pub const TTBR1_EL1_SHIFT: u32 = 37;
9230    /// Offset of the `VBAR_EL1` field.
9231    pub const VBAR_EL1_SHIFT: u32 = 38;
9232    /// Offset of the `ICC_IGRPENn_EL1` field.
9233    pub const ICC_IGRPENN_EL1_SHIFT: u32 = 39;
9234    /// Offset of the `ERRIDR_EL1` field.
9235    pub const ERRIDR_EL1_SHIFT: u32 = 40;
9236    /// Offset of the `ERRSELR_EL1` field.
9237    pub const ERRSELR_EL1_SHIFT: u32 = 41;
9238    /// Offset of the `ERXFR_EL1` field.
9239    pub const ERXFR_EL1_SHIFT: u32 = 42;
9240    /// Offset of the `ERXCTLR_EL1` field.
9241    pub const ERXCTLR_EL1_SHIFT: u32 = 43;
9242    /// Offset of the `ERXSTATUS_EL1` field.
9243    pub const ERXSTATUS_EL1_SHIFT: u32 = 44;
9244    /// Offset of the `ERXMISCn_EL1` field.
9245    pub const ERXMISCN_EL1_SHIFT: u32 = 45;
9246    /// Offset of the `ERXPFGF_EL1` field.
9247    pub const ERXPFGF_EL1_SHIFT: u32 = 46;
9248    /// Offset of the `ERXPFGCTL_EL1` field.
9249    pub const ERXPFGCTL_EL1_SHIFT: u32 = 47;
9250    /// Offset of the `ERXPFGCDN_EL1` field.
9251    pub const ERXPFGCDN_EL1_SHIFT: u32 = 48;
9252    /// Offset of the `ERXADDR_EL1` field.
9253    pub const ERXADDR_EL1_SHIFT: u32 = 49;
9254    /// Offset of the `nACCDATA_EL1` field.
9255    pub const NACCDATA_EL1_SHIFT: u32 = 50;
9256    /// Offset of the `nGCS_EL0` field.
9257    pub const NGCS_EL0_SHIFT: u32 = 52;
9258    /// Offset of the `nGCS_EL1` field.
9259    pub const NGCS_EL1_SHIFT: u32 = 53;
9260    /// Offset of the `nSMPRI_EL1` field.
9261    pub const NSMPRI_EL1_SHIFT: u32 = 54;
9262    /// Offset of the `nTPIDR2_EL0` field.
9263    pub const NTPIDR2_EL0_SHIFT: u32 = 55;
9264    /// Offset of the `nRCWMASK_EL1` field.
9265    pub const NRCWMASK_EL1_SHIFT: u32 = 56;
9266    /// Offset of the `nPIRE0_EL1` field.
9267    pub const NPIRE0_EL1_SHIFT: u32 = 57;
9268    /// Offset of the `nPIR_EL1` field.
9269    pub const NPIR_EL1_SHIFT: u32 = 58;
9270    /// Offset of the `nPOR_EL0` field.
9271    pub const NPOR_EL0_SHIFT: u32 = 59;
9272    /// Offset of the `nPOR_EL1` field.
9273    pub const NPOR_EL1_SHIFT: u32 = 60;
9274    /// Offset of the `nS2POR_EL1` field.
9275    pub const NS2POR_EL1_SHIFT: u32 = 61;
9276    /// Offset of the `nMAIR2_EL1` field.
9277    pub const NMAIR2_EL1_SHIFT: u32 = 62;
9278    /// Offset of the `nAMAIR2_EL1` field.
9279    pub const NAMAIR2_EL1_SHIFT: u32 = 63;
9280}
9281
9282#[cfg(feature = "el2")]
9283bitflags! {
9284    /// `HFGWTR2_EL2` system register value.
9285    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9286    #[repr(transparent)]
9287    pub struct Hfgwtr2El2: u64 {
9288        /// `nPFAR_EL1` bit.
9289        const NPFAR_EL1 = 1 << 0;
9290        /// `nRCWSMASK_EL1` bit.
9291        const NRCWSMASK_EL1 = 1 << 2;
9292        /// `nCPACRMASK_EL1` bit.
9293        const NCPACRMASK_EL1 = 1 << 3;
9294        /// `nSCTLRMASK_EL1` bit.
9295        const NSCTLRMASK_EL1 = 1 << 4;
9296        /// `nSCTLR2MASK_EL1` bit.
9297        const NSCTLR2MASK_EL1 = 1 << 5;
9298        /// `nTCRMASK_EL1` bit.
9299        const NTCRMASK_EL1 = 1 << 6;
9300        /// `nTCR2MASK_EL1` bit.
9301        const NTCR2MASK_EL1 = 1 << 7;
9302        /// `nCPACRALIAS_EL1` bit.
9303        const NCPACRALIAS_EL1 = 1 << 8;
9304        /// `nSCTLRALIAS_EL1` bit.
9305        const NSCTLRALIAS_EL1 = 1 << 9;
9306        /// `nSCTLR2ALIAS_EL1` bit.
9307        const NSCTLR2ALIAS_EL1 = 1 << 10;
9308        /// `nTCRALIAS_EL1` bit.
9309        const NTCRALIAS_EL1 = 1 << 11;
9310        /// `nTCR2ALIAS_EL1` bit.
9311        const NTCR2ALIAS_EL1 = 1 << 12;
9312        /// `nACTLRMASK_EL1` bit.
9313        const NACTLRMASK_EL1 = 1 << 13;
9314        /// `nACTLRALIAS_EL1` bit.
9315        const NACTLRALIAS_EL1 = 1 << 14;
9316        /// `nTINDEX_EL0` bit.
9317        const NTINDEX_EL0 = 1 << 15;
9318        /// `nTINDEX_EL1` bit.
9319        const NTINDEX_EL1 = 1 << 16;
9320        /// `nSTINDEX_EL1` bit.
9321        const NSTINDEX_EL1 = 1 << 17;
9322        /// `nTTTBRP_EL1` bit.
9323        const NTTTBRP_EL1 = 1 << 20;
9324        /// `nTTTBRU_EL1` bit.
9325        const NTTTBRU_EL1 = 1 << 21;
9326        /// `nIRTBRP_EL1` bit.
9327        const NIRTBRP_EL1 = 1 << 22;
9328        /// `nIRTBRU_EL1` bit.
9329        const NIRTBRU_EL1 = 1 << 23;
9330        /// `nDPOTBR1_EL1` bit.
9331        const NDPOTBR1_EL1 = 1 << 24;
9332        /// `nDPOTBR0_EL1` bit.
9333        const NDPOTBR0_EL1 = 1 << 25;
9334        /// `nTPMIN1_EL1` bit.
9335        const NTPMIN1_EL1 = 1 << 26;
9336        /// `nTPMIN0_EL1` bit.
9337        const NTPMIN0_EL1 = 1 << 27;
9338        /// `nTPMIN1_EL0` bit.
9339        const NTPMIN1_EL0 = 1 << 28;
9340        /// `nTPMIN0_EL0` bit.
9341        const NTPMIN0_EL0 = 1 << 29;
9342        /// `TFSR_EL1` bit.
9343        const TFSR_EL1 = 1 << 33;
9344        /// `RGSR_EL1` bit.
9345        const RGSR_EL1 = 1 << 34;
9346        /// `GCR_EL1` bit.
9347        const GCR_EL1 = 1 << 35;
9348        /// `nTPIDR3_EL0` bit.
9349        const NTPIDR3_EL0 = 1 << 36;
9350        /// `nTPIDR3_EL1` bit.
9351        const NTPIDR3_EL1 = 1 << 37;
9352    }
9353}
9354
9355#[cfg(feature = "el2")]
9356impl Hfgwtr2El2 {
9357    /// Offset of the `nPFAR_EL1` field.
9358    pub const NPFAR_EL1_SHIFT: u32 = 0;
9359    /// Offset of the `nRCWSMASK_EL1` field.
9360    pub const NRCWSMASK_EL1_SHIFT: u32 = 2;
9361    /// Offset of the `nCPACRMASK_EL1` field.
9362    pub const NCPACRMASK_EL1_SHIFT: u32 = 3;
9363    /// Offset of the `nSCTLRMASK_EL1` field.
9364    pub const NSCTLRMASK_EL1_SHIFT: u32 = 4;
9365    /// Offset of the `nSCTLR2MASK_EL1` field.
9366    pub const NSCTLR2MASK_EL1_SHIFT: u32 = 5;
9367    /// Offset of the `nTCRMASK_EL1` field.
9368    pub const NTCRMASK_EL1_SHIFT: u32 = 6;
9369    /// Offset of the `nTCR2MASK_EL1` field.
9370    pub const NTCR2MASK_EL1_SHIFT: u32 = 7;
9371    /// Offset of the `nCPACRALIAS_EL1` field.
9372    pub const NCPACRALIAS_EL1_SHIFT: u32 = 8;
9373    /// Offset of the `nSCTLRALIAS_EL1` field.
9374    pub const NSCTLRALIAS_EL1_SHIFT: u32 = 9;
9375    /// Offset of the `nSCTLR2ALIAS_EL1` field.
9376    pub const NSCTLR2ALIAS_EL1_SHIFT: u32 = 10;
9377    /// Offset of the `nTCRALIAS_EL1` field.
9378    pub const NTCRALIAS_EL1_SHIFT: u32 = 11;
9379    /// Offset of the `nTCR2ALIAS_EL1` field.
9380    pub const NTCR2ALIAS_EL1_SHIFT: u32 = 12;
9381    /// Offset of the `nACTLRMASK_EL1` field.
9382    pub const NACTLRMASK_EL1_SHIFT: u32 = 13;
9383    /// Offset of the `nACTLRALIAS_EL1` field.
9384    pub const NACTLRALIAS_EL1_SHIFT: u32 = 14;
9385    /// Offset of the `nTINDEX_EL0` field.
9386    pub const NTINDEX_EL0_SHIFT: u32 = 15;
9387    /// Offset of the `nTINDEX_EL1` field.
9388    pub const NTINDEX_EL1_SHIFT: u32 = 16;
9389    /// Offset of the `nSTINDEX_EL1` field.
9390    pub const NSTINDEX_EL1_SHIFT: u32 = 17;
9391    /// Offset of the `nFGDTn_EL1` field.
9392    pub const NFGDTN_EL1_SHIFT: u32 = 18;
9393    /// Mask for the `nFGDTn_EL1` field.
9394    pub const NFGDTN_EL1_MASK: u64 = 0b11;
9395    /// Offset of the `nTTTBRP_EL1` field.
9396    pub const NTTTBRP_EL1_SHIFT: u32 = 20;
9397    /// Offset of the `nTTTBRU_EL1` field.
9398    pub const NTTTBRU_EL1_SHIFT: u32 = 21;
9399    /// Offset of the `nIRTBRP_EL1` field.
9400    pub const NIRTBRP_EL1_SHIFT: u32 = 22;
9401    /// Offset of the `nIRTBRU_EL1` field.
9402    pub const NIRTBRU_EL1_SHIFT: u32 = 23;
9403    /// Offset of the `nDPOTBR1_EL1` field.
9404    pub const NDPOTBR1_EL1_SHIFT: u32 = 24;
9405    /// Offset of the `nDPOTBR0_EL1` field.
9406    pub const NDPOTBR0_EL1_SHIFT: u32 = 25;
9407    /// Offset of the `nTPMIN1_EL1` field.
9408    pub const NTPMIN1_EL1_SHIFT: u32 = 26;
9409    /// Offset of the `nTPMIN0_EL1` field.
9410    pub const NTPMIN0_EL1_SHIFT: u32 = 27;
9411    /// Offset of the `nTPMIN1_EL0` field.
9412    pub const NTPMIN1_EL0_SHIFT: u32 = 28;
9413    /// Offset of the `nTPMIN0_EL0` field.
9414    pub const NTPMIN0_EL0_SHIFT: u32 = 29;
9415    /// Offset of the `nAFGDTn_EL1` field.
9416    pub const NAFGDTN_EL1_SHIFT: u32 = 31;
9417    /// Mask for the `nAFGDTn_EL1` field.
9418    pub const NAFGDTN_EL1_MASK: u64 = 0b11;
9419    /// Offset of the `TFSR_EL1` field.
9420    pub const TFSR_EL1_SHIFT: u32 = 33;
9421    /// Offset of the `RGSR_EL1` field.
9422    pub const RGSR_EL1_SHIFT: u32 = 34;
9423    /// Offset of the `GCR_EL1` field.
9424    pub const GCR_EL1_SHIFT: u32 = 35;
9425    /// Offset of the `nTPIDR3_EL0` field.
9426    pub const NTPIDR3_EL0_SHIFT: u32 = 36;
9427    /// Offset of the `nTPIDR3_EL1` field.
9428    pub const NTPIDR3_EL1_SHIFT: u32 = 37;
9429
9430    /// Returns the value of the `nFGDTn_EL1` field.
9431    pub const fn nfgdtn_el1(self) -> u8 {
9432        ((self.bits() >> Self::NFGDTN_EL1_SHIFT) & 0b11) as u8
9433    }
9434
9435    /// Sets the value of the `nFGDTn_EL1` field.
9436    pub const fn set_nfgdtn_el1(&mut self, value: u8) {
9437        let offset = Self::NFGDTN_EL1_SHIFT;
9438        assert!(value & (Self::NFGDTN_EL1_MASK as u8) == value);
9439        *self = Self::from_bits_retain(
9440            (self.bits() & !(Self::NFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
9441        );
9442    }
9443
9444    /// Returns a copy with the `nFGDTn_EL1` field set to the given value.
9445    pub const fn with_nfgdtn_el1(mut self, value: u8) -> Self {
9446        self.set_nfgdtn_el1(value);
9447        self
9448    }
9449
9450    /// Returns the value of the `nAFGDTn_EL1` field.
9451    pub const fn nafgdtn_el1(self) -> u8 {
9452        ((self.bits() >> Self::NAFGDTN_EL1_SHIFT) & 0b11) as u8
9453    }
9454
9455    /// Sets the value of the `nAFGDTn_EL1` field.
9456    pub const fn set_nafgdtn_el1(&mut self, value: u8) {
9457        let offset = Self::NAFGDTN_EL1_SHIFT;
9458        assert!(value & (Self::NAFGDTN_EL1_MASK as u8) == value);
9459        *self = Self::from_bits_retain(
9460            (self.bits() & !(Self::NAFGDTN_EL1_MASK << offset)) | ((value as u64) << offset),
9461        );
9462    }
9463
9464    /// Returns a copy with the `nAFGDTn_EL1` field set to the given value.
9465    pub const fn with_nafgdtn_el1(mut self, value: u8) -> Self {
9466        self.set_nafgdtn_el1(value);
9467        self
9468    }
9469}
9470
9471#[cfg(feature = "el2")]
9472bitflags! {
9473    /// `HFGWTR_EL2` system register value.
9474    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9475    #[repr(transparent)]
9476    pub struct HfgwtrEl2: u64 {
9477        /// `AFSR0_EL1` bit.
9478        const AFSR0_EL1 = 1 << 0;
9479        /// `AFSR1_EL1` bit.
9480        const AFSR1_EL1 = 1 << 1;
9481        /// `AMAIR_EL1` bit.
9482        const AMAIR_EL1 = 1 << 3;
9483        /// `APDAKey` bit.
9484        const APDAKEY = 1 << 4;
9485        /// `APDBKey` bit.
9486        const APDBKEY = 1 << 5;
9487        /// `APGAKey` bit.
9488        const APGAKEY = 1 << 6;
9489        /// `APIAKey` bit.
9490        const APIAKEY = 1 << 7;
9491        /// `APIBKey` bit.
9492        const APIBKEY = 1 << 8;
9493        /// `CONTEXTIDR_EL1` bit.
9494        const CONTEXTIDR_EL1 = 1 << 11;
9495        /// `CPACR_EL1` bit.
9496        const CPACR_EL1 = 1 << 12;
9497        /// `CSSELR_EL1` bit.
9498        const CSSELR_EL1 = 1 << 13;
9499        /// `ESR_EL1` bit.
9500        const ESR_EL1 = 1 << 16;
9501        /// `FAR_EL1` bit.
9502        const FAR_EL1 = 1 << 17;
9503        /// `LORC_EL1` bit.
9504        const LORC_EL1 = 1 << 19;
9505        /// `LOREA_EL1` bit.
9506        const LOREA_EL1 = 1 << 20;
9507        /// `LORN_EL1` bit.
9508        const LORN_EL1 = 1 << 22;
9509        /// `LORSA_EL1` bit.
9510        const LORSA_EL1 = 1 << 23;
9511        /// `MAIR_EL1` bit.
9512        const MAIR_EL1 = 1 << 24;
9513        /// `PAR_EL1` bit.
9514        const PAR_EL1 = 1 << 27;
9515        /// `SCTLR_EL1` bit.
9516        const SCTLR_EL1 = 1 << 29;
9517        /// `SCXTNUM_EL1` bit.
9518        const SCXTNUM_EL1 = 1 << 30;
9519        /// `SCXTNUM_EL0` bit.
9520        const SCXTNUM_EL0 = 1 << 31;
9521        /// `TCR_EL1` bit.
9522        const TCR_EL1 = 1 << 32;
9523        /// `TPIDR_EL1` bit.
9524        const TPIDR_EL1 = 1 << 33;
9525        /// `TPIDRRO_EL0` bit.
9526        const TPIDRRO_EL0 = 1 << 34;
9527        /// `TPIDR_EL0` bit.
9528        const TPIDR_EL0 = 1 << 35;
9529        /// `TTBR0_EL1` bit.
9530        const TTBR0_EL1 = 1 << 36;
9531        /// `TTBR1_EL1` bit.
9532        const TTBR1_EL1 = 1 << 37;
9533        /// `VBAR_EL1` bit.
9534        const VBAR_EL1 = 1 << 38;
9535        /// `ICC_IGRPENn_EL1` bit.
9536        const ICC_IGRPENN_EL1 = 1 << 39;
9537        /// `ERRSELR_EL1` bit.
9538        const ERRSELR_EL1 = 1 << 41;
9539        /// `ERXCTLR_EL1` bit.
9540        const ERXCTLR_EL1 = 1 << 43;
9541        /// `ERXSTATUS_EL1` bit.
9542        const ERXSTATUS_EL1 = 1 << 44;
9543        /// `ERXMISCn_EL1` bit.
9544        const ERXMISCN_EL1 = 1 << 45;
9545        /// `ERXPFGCTL_EL1` bit.
9546        const ERXPFGCTL_EL1 = 1 << 47;
9547        /// `ERXPFGCDN_EL1` bit.
9548        const ERXPFGCDN_EL1 = 1 << 48;
9549        /// `ERXADDR_EL1` bit.
9550        const ERXADDR_EL1 = 1 << 49;
9551        /// `nACCDATA_EL1` bit.
9552        const NACCDATA_EL1 = 1 << 50;
9553        /// `nGCS_EL0` bit.
9554        const NGCS_EL0 = 1 << 52;
9555        /// `nGCS_EL1` bit.
9556        const NGCS_EL1 = 1 << 53;
9557        /// `nSMPRI_EL1` bit.
9558        const NSMPRI_EL1 = 1 << 54;
9559        /// `nTPIDR2_EL0` bit.
9560        const NTPIDR2_EL0 = 1 << 55;
9561        /// `nRCWMASK_EL1` bit.
9562        const NRCWMASK_EL1 = 1 << 56;
9563        /// `nPIRE0_EL1` bit.
9564        const NPIRE0_EL1 = 1 << 57;
9565        /// `nPIR_EL1` bit.
9566        const NPIR_EL1 = 1 << 58;
9567        /// `nPOR_EL0` bit.
9568        const NPOR_EL0 = 1 << 59;
9569        /// `nPOR_EL1` bit.
9570        const NPOR_EL1 = 1 << 60;
9571        /// `nS2POR_EL1` bit.
9572        const NS2POR_EL1 = 1 << 61;
9573        /// `nMAIR2_EL1` bit.
9574        const NMAIR2_EL1 = 1 << 62;
9575        /// `nAMAIR2_EL1` bit.
9576        const NAMAIR2_EL1 = 1 << 63;
9577    }
9578}
9579
9580#[cfg(feature = "el2")]
9581impl HfgwtrEl2 {
9582    /// Offset of the `AFSR0_EL1` field.
9583    pub const AFSR0_EL1_SHIFT: u32 = 0;
9584    /// Offset of the `AFSR1_EL1` field.
9585    pub const AFSR1_EL1_SHIFT: u32 = 1;
9586    /// Offset of the `AMAIR_EL1` field.
9587    pub const AMAIR_EL1_SHIFT: u32 = 3;
9588    /// Offset of the `APDAKey` field.
9589    pub const APDAKEY_SHIFT: u32 = 4;
9590    /// Offset of the `APDBKey` field.
9591    pub const APDBKEY_SHIFT: u32 = 5;
9592    /// Offset of the `APGAKey` field.
9593    pub const APGAKEY_SHIFT: u32 = 6;
9594    /// Offset of the `APIAKey` field.
9595    pub const APIAKEY_SHIFT: u32 = 7;
9596    /// Offset of the `APIBKey` field.
9597    pub const APIBKEY_SHIFT: u32 = 8;
9598    /// Offset of the `CONTEXTIDR_EL1` field.
9599    pub const CONTEXTIDR_EL1_SHIFT: u32 = 11;
9600    /// Offset of the `CPACR_EL1` field.
9601    pub const CPACR_EL1_SHIFT: u32 = 12;
9602    /// Offset of the `CSSELR_EL1` field.
9603    pub const CSSELR_EL1_SHIFT: u32 = 13;
9604    /// Offset of the `ESR_EL1` field.
9605    pub const ESR_EL1_SHIFT: u32 = 16;
9606    /// Offset of the `FAR_EL1` field.
9607    pub const FAR_EL1_SHIFT: u32 = 17;
9608    /// Offset of the `LORC_EL1` field.
9609    pub const LORC_EL1_SHIFT: u32 = 19;
9610    /// Offset of the `LOREA_EL1` field.
9611    pub const LOREA_EL1_SHIFT: u32 = 20;
9612    /// Offset of the `LORN_EL1` field.
9613    pub const LORN_EL1_SHIFT: u32 = 22;
9614    /// Offset of the `LORSA_EL1` field.
9615    pub const LORSA_EL1_SHIFT: u32 = 23;
9616    /// Offset of the `MAIR_EL1` field.
9617    pub const MAIR_EL1_SHIFT: u32 = 24;
9618    /// Offset of the `PAR_EL1` field.
9619    pub const PAR_EL1_SHIFT: u32 = 27;
9620    /// Offset of the `SCTLR_EL1` field.
9621    pub const SCTLR_EL1_SHIFT: u32 = 29;
9622    /// Offset of the `SCXTNUM_EL1` field.
9623    pub const SCXTNUM_EL1_SHIFT: u32 = 30;
9624    /// Offset of the `SCXTNUM_EL0` field.
9625    pub const SCXTNUM_EL0_SHIFT: u32 = 31;
9626    /// Offset of the `TCR_EL1` field.
9627    pub const TCR_EL1_SHIFT: u32 = 32;
9628    /// Offset of the `TPIDR_EL1` field.
9629    pub const TPIDR_EL1_SHIFT: u32 = 33;
9630    /// Offset of the `TPIDRRO_EL0` field.
9631    pub const TPIDRRO_EL0_SHIFT: u32 = 34;
9632    /// Offset of the `TPIDR_EL0` field.
9633    pub const TPIDR_EL0_SHIFT: u32 = 35;
9634    /// Offset of the `TTBR0_EL1` field.
9635    pub const TTBR0_EL1_SHIFT: u32 = 36;
9636    /// Offset of the `TTBR1_EL1` field.
9637    pub const TTBR1_EL1_SHIFT: u32 = 37;
9638    /// Offset of the `VBAR_EL1` field.
9639    pub const VBAR_EL1_SHIFT: u32 = 38;
9640    /// Offset of the `ICC_IGRPENn_EL1` field.
9641    pub const ICC_IGRPENN_EL1_SHIFT: u32 = 39;
9642    /// Offset of the `ERRSELR_EL1` field.
9643    pub const ERRSELR_EL1_SHIFT: u32 = 41;
9644    /// Offset of the `ERXCTLR_EL1` field.
9645    pub const ERXCTLR_EL1_SHIFT: u32 = 43;
9646    /// Offset of the `ERXSTATUS_EL1` field.
9647    pub const ERXSTATUS_EL1_SHIFT: u32 = 44;
9648    /// Offset of the `ERXMISCn_EL1` field.
9649    pub const ERXMISCN_EL1_SHIFT: u32 = 45;
9650    /// Offset of the `ERXPFGCTL_EL1` field.
9651    pub const ERXPFGCTL_EL1_SHIFT: u32 = 47;
9652    /// Offset of the `ERXPFGCDN_EL1` field.
9653    pub const ERXPFGCDN_EL1_SHIFT: u32 = 48;
9654    /// Offset of the `ERXADDR_EL1` field.
9655    pub const ERXADDR_EL1_SHIFT: u32 = 49;
9656    /// Offset of the `nACCDATA_EL1` field.
9657    pub const NACCDATA_EL1_SHIFT: u32 = 50;
9658    /// Offset of the `nGCS_EL0` field.
9659    pub const NGCS_EL0_SHIFT: u32 = 52;
9660    /// Offset of the `nGCS_EL1` field.
9661    pub const NGCS_EL1_SHIFT: u32 = 53;
9662    /// Offset of the `nSMPRI_EL1` field.
9663    pub const NSMPRI_EL1_SHIFT: u32 = 54;
9664    /// Offset of the `nTPIDR2_EL0` field.
9665    pub const NTPIDR2_EL0_SHIFT: u32 = 55;
9666    /// Offset of the `nRCWMASK_EL1` field.
9667    pub const NRCWMASK_EL1_SHIFT: u32 = 56;
9668    /// Offset of the `nPIRE0_EL1` field.
9669    pub const NPIRE0_EL1_SHIFT: u32 = 57;
9670    /// Offset of the `nPIR_EL1` field.
9671    pub const NPIR_EL1_SHIFT: u32 = 58;
9672    /// Offset of the `nPOR_EL0` field.
9673    pub const NPOR_EL0_SHIFT: u32 = 59;
9674    /// Offset of the `nPOR_EL1` field.
9675    pub const NPOR_EL1_SHIFT: u32 = 60;
9676    /// Offset of the `nS2POR_EL1` field.
9677    pub const NS2POR_EL1_SHIFT: u32 = 61;
9678    /// Offset of the `nMAIR2_EL1` field.
9679    pub const NMAIR2_EL1_SHIFT: u32 = 62;
9680    /// Offset of the `nAMAIR2_EL1` field.
9681    pub const NAMAIR2_EL1_SHIFT: u32 = 63;
9682}
9683
9684bitflags! {
9685    /// `HIFAR` system register value.
9686    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9687    #[repr(transparent)]
9688    pub struct Hifar: u32 {
9689    }
9690}
9691
9692impl Hifar {
9693    /// Offset of the `VA` field.
9694    pub const VA_SHIFT: u32 = 0;
9695    /// Mask for the `VA` field.
9696    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
9697
9698    /// Returns the value of the `VA` field.
9699    pub const fn va(self) -> u32 {
9700        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
9701    }
9702
9703    /// Sets the value of the `VA` field.
9704    pub const fn set_va(&mut self, value: u32) {
9705        let offset = Self::VA_SHIFT;
9706        assert!(value & (Self::VA_MASK as u32) == value);
9707        *self = Self::from_bits_retain(
9708            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
9709        );
9710    }
9711
9712    /// Returns a copy with the `VA` field set to the given value.
9713    pub const fn with_va(mut self, value: u32) -> Self {
9714        self.set_va(value);
9715        self
9716    }
9717}
9718
9719bitflags! {
9720    /// `HMAIR0` system register value.
9721    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9722    #[repr(transparent)]
9723    pub struct Hmair0: u32 {
9724    }
9725}
9726
9727impl Hmair0 {
9728    /// Offset of the `Attr<n>` field.
9729    pub const ATTR_SHIFT: u32 = 0;
9730    /// Mask for the `Attr<n>` field.
9731    pub const ATTR_MASK: u32 = 0b11111111;
9732
9733    /// Returns the value of the given `Attr<n>` field.
9734    pub const fn attr(self, n: u32) -> u8 {
9735        assert!(n < 4);
9736        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
9737    }
9738
9739    /// Sets the value of the `Attr<n>` field.
9740    pub const fn set_attr(&mut self, n: u32, value: u8) {
9741        assert!(n < 4);
9742        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
9743        assert!(value & (Self::ATTR_MASK as u8) == value);
9744        *self = Self::from_bits_retain(
9745            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
9746        );
9747    }
9748
9749    /// Returns a copy with the `Attr<n>` field set to the given value.
9750    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
9751        self.set_attr(n, value);
9752        self
9753    }
9754}
9755
9756bitflags! {
9757    /// `HMAIR1` system register value.
9758    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9759    #[repr(transparent)]
9760    pub struct Hmair1: u32 {
9761    }
9762}
9763
9764impl Hmair1 {
9765    /// Offset of the `Attr<n>` field.
9766    pub const ATTR_SHIFT: u32 = 0;
9767    /// Mask for the `Attr<n>` field.
9768    pub const ATTR_MASK: u32 = 0b11111111;
9769
9770    /// Returns the value of the given `Attr<n>` field.
9771    pub const fn attr(self, n: u32) -> u8 {
9772        assert!(n >= 4 && n < 8);
9773        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
9774    }
9775
9776    /// Sets the value of the `Attr<n>` field.
9777    pub const fn set_attr(&mut self, n: u32, value: u8) {
9778        assert!(n >= 4 && n < 8);
9779        let offset = Self::ATTR_SHIFT + (n - 4) * 8;
9780        assert!(value & (Self::ATTR_MASK as u8) == value);
9781        *self = Self::from_bits_retain(
9782            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
9783        );
9784    }
9785
9786    /// Returns a copy with the `Attr<n>` field set to the given value.
9787    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
9788        self.set_attr(n, value);
9789        self
9790    }
9791}
9792
9793bitflags! {
9794    /// `HPFAR` system register value.
9795    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9796    #[repr(transparent)]
9797    pub struct Hpfar: u32 {
9798    }
9799}
9800
9801impl Hpfar {
9802    /// Offset of the `FIPA[39:12]` field.
9803    pub const FIPA_39_12_SHIFT: u32 = 4;
9804    /// Mask for the `FIPA[39:12]` field.
9805    pub const FIPA_39_12_MASK: u32 = 0b1111111111111111111111111111;
9806
9807    /// Returns the value of the `FIPA[39:12]` field.
9808    pub const fn fipa_39_12(self) -> u32 {
9809        ((self.bits() >> Self::FIPA_39_12_SHIFT) & 0b1111111111111111111111111111) as u32
9810    }
9811
9812    /// Sets the value of the `FIPA[39:12]` field.
9813    pub const fn set_fipa_39_12(&mut self, value: u32) {
9814        let offset = Self::FIPA_39_12_SHIFT;
9815        assert!(value & (Self::FIPA_39_12_MASK as u32) == value);
9816        *self = Self::from_bits_retain(
9817            (self.bits() & !(Self::FIPA_39_12_MASK << offset)) | ((value as u32) << offset),
9818        );
9819    }
9820
9821    /// Returns a copy with the `FIPA[39:12]` field set to the given value.
9822    pub const fn with_fipa_39_12(mut self, value: u32) -> Self {
9823        self.set_fipa_39_12(value);
9824        self
9825    }
9826}
9827
9828#[cfg(feature = "el2")]
9829bitflags! {
9830    /// `HPFAR_EL2` system register value.
9831    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9832    #[repr(transparent)]
9833    pub struct HpfarEl2: u64 {
9834        /// `NS` bit.
9835        const NS = 1 << 63;
9836    }
9837}
9838
9839#[cfg(feature = "el2")]
9840impl HpfarEl2 {
9841    /// Offset of the `FIPA` field.
9842    pub const FIPA_SHIFT: u32 = 4;
9843    /// Mask for the `FIPA` field.
9844    pub const FIPA_MASK: u64 = 0b11111111111111111111111111111111111111111111;
9845    /// Offset of the `NS` field.
9846    pub const NS_SHIFT: u32 = 63;
9847
9848    /// Returns the value of the `FIPA` field.
9849    pub const fn fipa(self) -> u64 {
9850        ((self.bits() >> Self::FIPA_SHIFT) & 0b11111111111111111111111111111111111111111111) as u64
9851    }
9852
9853    /// Sets the value of the `FIPA` field.
9854    pub const fn set_fipa(&mut self, value: u64) {
9855        let offset = Self::FIPA_SHIFT;
9856        assert!(value & (Self::FIPA_MASK as u64) == value);
9857        *self = Self::from_bits_retain(
9858            (self.bits() & !(Self::FIPA_MASK << offset)) | ((value as u64) << offset),
9859        );
9860    }
9861
9862    /// Returns a copy with the `FIPA` field set to the given value.
9863    pub const fn with_fipa(mut self, value: u64) -> Self {
9864        self.set_fipa(value);
9865        self
9866    }
9867}
9868
9869bitflags! {
9870    /// `HRMR` system register value.
9871    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9872    #[repr(transparent)]
9873    pub struct Hrmr: u32 {
9874        /// `AA64` bit.
9875        const AA64 = 1 << 0;
9876        /// `RR` bit.
9877        const RR = 1 << 1;
9878    }
9879}
9880
9881impl Hrmr {
9882    /// Offset of the `AA64` field.
9883    pub const AA64_SHIFT: u32 = 0;
9884    /// Offset of the `RR` field.
9885    pub const RR_SHIFT: u32 = 1;
9886}
9887
9888bitflags! {
9889    /// `HSCTLR` system register value.
9890    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9891    #[repr(transparent)]
9892    pub struct Hsctlr: u32 {
9893        /// RES1 bits in the `HSCTLR` register.
9894        const RES1 = 0b110000110001010000100000000000;
9895        /// `M` bit.
9896        const M = 1 << 0;
9897        /// `A` bit.
9898        const A = 1 << 1;
9899        /// `C` bit.
9900        const C = 1 << 2;
9901        /// `nTLSMD` bit.
9902        const NTLSMD = 1 << 3;
9903        /// `LSMAOE` bit.
9904        const LSMAOE = 1 << 4;
9905        /// `CP15BEN` bit.
9906        const CP15BEN = 1 << 5;
9907        /// `ITD` bit.
9908        const ITD = 1 << 7;
9909        /// `SED` bit.
9910        const SED = 1 << 8;
9911        /// `I` bit.
9912        const I = 1 << 12;
9913        /// `WXN` bit.
9914        const WXN = 1 << 19;
9915        /// `TE` bit.
9916        const TE = 1 << 30;
9917        /// `DSSBS` bit.
9918        const DSSBS = 1 << 31;
9919    }
9920}
9921
9922impl Hsctlr {
9923    /// Offset of the `M` field.
9924    pub const M_SHIFT: u32 = 0;
9925    /// Offset of the `A` field.
9926    pub const A_SHIFT: u32 = 1;
9927    /// Offset of the `C` field.
9928    pub const C_SHIFT: u32 = 2;
9929    /// Offset of the `nTLSMD` field.
9930    pub const NTLSMD_SHIFT: u32 = 3;
9931    /// Offset of the `LSMAOE` field.
9932    pub const LSMAOE_SHIFT: u32 = 4;
9933    /// Offset of the `CP15BEN` field.
9934    pub const CP15BEN_SHIFT: u32 = 5;
9935    /// Offset of the `ITD` field.
9936    pub const ITD_SHIFT: u32 = 7;
9937    /// Offset of the `SED` field.
9938    pub const SED_SHIFT: u32 = 8;
9939    /// Offset of the `I` field.
9940    pub const I_SHIFT: u32 = 12;
9941    /// Offset of the `WXN` field.
9942    pub const WXN_SHIFT: u32 = 19;
9943    /// Offset of the `TE` field.
9944    pub const TE_SHIFT: u32 = 30;
9945    /// Offset of the `DSSBS` field.
9946    pub const DSSBS_SHIFT: u32 = 31;
9947}
9948
9949bitflags! {
9950    /// `HSR` system register value.
9951    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
9952    #[repr(transparent)]
9953    pub struct Hsr: u32 {
9954        /// `IL` bit.
9955        const IL = 1 << 25;
9956    }
9957}
9958
9959impl Hsr {
9960    /// Offset of the `ISS` field.
9961    pub const ISS_SHIFT: u32 = 0;
9962    /// Mask for the `ISS` field.
9963    pub const ISS_MASK: u32 = 0b1111111111111111111111111;
9964    /// Offset of the `IL` field.
9965    pub const IL_SHIFT: u32 = 25;
9966    /// Offset of the `EC` field.
9967    pub const EC_SHIFT: u32 = 26;
9968    /// Mask for the `EC` field.
9969    pub const EC_MASK: u32 = 0b111111;
9970
9971    /// Returns the value of the `ISS` field.
9972    pub const fn iss(self) -> u32 {
9973        ((self.bits() >> Self::ISS_SHIFT) & 0b1111111111111111111111111) as u32
9974    }
9975
9976    /// Sets the value of the `ISS` field.
9977    pub const fn set_iss(&mut self, value: u32) {
9978        let offset = Self::ISS_SHIFT;
9979        assert!(value & (Self::ISS_MASK as u32) == value);
9980        *self = Self::from_bits_retain(
9981            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u32) << offset),
9982        );
9983    }
9984
9985    /// Returns a copy with the `ISS` field set to the given value.
9986    pub const fn with_iss(mut self, value: u32) -> Self {
9987        self.set_iss(value);
9988        self
9989    }
9990
9991    /// Returns the value of the `EC` field.
9992    pub const fn ec(self) -> u8 {
9993        ((self.bits() >> Self::EC_SHIFT) & 0b111111) as u8
9994    }
9995
9996    /// Sets the value of the `EC` field.
9997    pub const fn set_ec(&mut self, value: u8) {
9998        let offset = Self::EC_SHIFT;
9999        assert!(value & (Self::EC_MASK as u8) == value);
10000        *self = Self::from_bits_retain(
10001            (self.bits() & !(Self::EC_MASK << offset)) | ((value as u32) << offset),
10002        );
10003    }
10004
10005    /// Returns a copy with the `EC` field set to the given value.
10006    pub const fn with_ec(mut self, value: u8) -> Self {
10007        self.set_ec(value);
10008        self
10009    }
10010}
10011
10012bitflags! {
10013    /// `HTCR` system register value.
10014    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10015    #[repr(transparent)]
10016    pub struct Htcr: u32 {
10017        /// RES1 bits in the `HTCR` register.
10018        const RES1 = 0b10000000100000000000000000000000;
10019        /// `HPD` bit.
10020        const HPD = 1 << 24;
10021        /// `HWU59` bit.
10022        const HWU59 = 1 << 25;
10023        /// `HWU60` bit.
10024        const HWU60 = 1 << 26;
10025        /// `HWU61` bit.
10026        const HWU61 = 1 << 27;
10027        /// `HWU62` bit.
10028        const HWU62 = 1 << 28;
10029    }
10030}
10031
10032impl Htcr {
10033    /// Offset of the `T0SZ` field.
10034    pub const T0SZ_SHIFT: u32 = 0;
10035    /// Mask for the `T0SZ` field.
10036    pub const T0SZ_MASK: u32 = 0b111;
10037    /// Offset of the `IRGN0` field.
10038    pub const IRGN0_SHIFT: u32 = 8;
10039    /// Mask for the `IRGN0` field.
10040    pub const IRGN0_MASK: u32 = 0b11;
10041    /// Offset of the `ORGN0` field.
10042    pub const ORGN0_SHIFT: u32 = 10;
10043    /// Mask for the `ORGN0` field.
10044    pub const ORGN0_MASK: u32 = 0b11;
10045    /// Offset of the `SH0` field.
10046    pub const SH0_SHIFT: u32 = 12;
10047    /// Mask for the `SH0` field.
10048    pub const SH0_MASK: u32 = 0b11;
10049    /// Offset of the `HPD` field.
10050    pub const HPD_SHIFT: u32 = 24;
10051    /// Offset of the `HWU59` field.
10052    pub const HWU59_SHIFT: u32 = 25;
10053    /// Offset of the `HWU60` field.
10054    pub const HWU60_SHIFT: u32 = 26;
10055    /// Offset of the `HWU61` field.
10056    pub const HWU61_SHIFT: u32 = 27;
10057    /// Offset of the `HWU62` field.
10058    pub const HWU62_SHIFT: u32 = 28;
10059
10060    /// Returns the value of the `T0SZ` field.
10061    pub const fn t0sz(self) -> u8 {
10062        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
10063    }
10064
10065    /// Sets the value of the `T0SZ` field.
10066    pub const fn set_t0sz(&mut self, value: u8) {
10067        let offset = Self::T0SZ_SHIFT;
10068        assert!(value & (Self::T0SZ_MASK as u8) == value);
10069        *self = Self::from_bits_retain(
10070            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
10071        );
10072    }
10073
10074    /// Returns a copy with the `T0SZ` field set to the given value.
10075    pub const fn with_t0sz(mut self, value: u8) -> Self {
10076        self.set_t0sz(value);
10077        self
10078    }
10079
10080    /// Returns the value of the `IRGN0` field.
10081    pub const fn irgn0(self) -> u8 {
10082        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
10083    }
10084
10085    /// Sets the value of the `IRGN0` field.
10086    pub const fn set_irgn0(&mut self, value: u8) {
10087        let offset = Self::IRGN0_SHIFT;
10088        assert!(value & (Self::IRGN0_MASK as u8) == value);
10089        *self = Self::from_bits_retain(
10090            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
10091        );
10092    }
10093
10094    /// Returns a copy with the `IRGN0` field set to the given value.
10095    pub const fn with_irgn0(mut self, value: u8) -> Self {
10096        self.set_irgn0(value);
10097        self
10098    }
10099
10100    /// Returns the value of the `ORGN0` field.
10101    pub const fn orgn0(self) -> u8 {
10102        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
10103    }
10104
10105    /// Sets the value of the `ORGN0` field.
10106    pub const fn set_orgn0(&mut self, value: u8) {
10107        let offset = Self::ORGN0_SHIFT;
10108        assert!(value & (Self::ORGN0_MASK as u8) == value);
10109        *self = Self::from_bits_retain(
10110            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
10111        );
10112    }
10113
10114    /// Returns a copy with the `ORGN0` field set to the given value.
10115    pub const fn with_orgn0(mut self, value: u8) -> Self {
10116        self.set_orgn0(value);
10117        self
10118    }
10119
10120    /// Returns the value of the `SH0` field.
10121    pub const fn sh0(self) -> u8 {
10122        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
10123    }
10124
10125    /// Sets the value of the `SH0` field.
10126    pub const fn set_sh0(&mut self, value: u8) {
10127        let offset = Self::SH0_SHIFT;
10128        assert!(value & (Self::SH0_MASK as u8) == value);
10129        *self = Self::from_bits_retain(
10130            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
10131        );
10132    }
10133
10134    /// Returns a copy with the `SH0` field set to the given value.
10135    pub const fn with_sh0(mut self, value: u8) -> Self {
10136        self.set_sh0(value);
10137        self
10138    }
10139}
10140
10141bitflags! {
10142    /// `HTPIDR` system register value.
10143    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10144    #[repr(transparent)]
10145    pub struct Htpidr: u32 {
10146    }
10147}
10148
10149impl Htpidr {
10150    /// Offset of the `TID` field.
10151    pub const TID_SHIFT: u32 = 0;
10152    /// Mask for the `TID` field.
10153    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
10154
10155    /// Returns the value of the `TID` field.
10156    pub const fn tid(self) -> u32 {
10157        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
10158    }
10159
10160    /// Sets the value of the `TID` field.
10161    pub const fn set_tid(&mut self, value: u32) {
10162        let offset = Self::TID_SHIFT;
10163        assert!(value & (Self::TID_MASK as u32) == value);
10164        *self = Self::from_bits_retain(
10165            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
10166        );
10167    }
10168
10169    /// Returns a copy with the `TID` field set to the given value.
10170    pub const fn with_tid(mut self, value: u32) -> Self {
10171        self.set_tid(value);
10172        self
10173    }
10174}
10175
10176bitflags! {
10177    /// `HTRFCR` system register value.
10178    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10179    #[repr(transparent)]
10180    pub struct Htrfcr: u32 {
10181        /// `E0HTRE` bit.
10182        const E0HTRE = 1 << 0;
10183        /// `E2TRE` bit.
10184        const E2TRE = 1 << 1;
10185        /// `CX` bit.
10186        const CX = 1 << 3;
10187    }
10188}
10189
10190impl Htrfcr {
10191    /// Offset of the `E0HTRE` field.
10192    pub const E0HTRE_SHIFT: u32 = 0;
10193    /// Offset of the `E2TRE` field.
10194    pub const E2TRE_SHIFT: u32 = 1;
10195    /// Offset of the `CX` field.
10196    pub const CX_SHIFT: u32 = 3;
10197    /// Offset of the `TS` field.
10198    pub const TS_SHIFT: u32 = 5;
10199    /// Mask for the `TS` field.
10200    pub const TS_MASK: u32 = 0b11;
10201
10202    /// Returns the value of the `TS` field.
10203    pub const fn ts(self) -> u8 {
10204        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
10205    }
10206
10207    /// Sets the value of the `TS` field.
10208    pub const fn set_ts(&mut self, value: u8) {
10209        let offset = Self::TS_SHIFT;
10210        assert!(value & (Self::TS_MASK as u8) == value);
10211        *self = Self::from_bits_retain(
10212            (self.bits() & !(Self::TS_MASK << offset)) | ((value as u32) << offset),
10213        );
10214    }
10215
10216    /// Returns a copy with the `TS` field set to the given value.
10217    pub const fn with_ts(mut self, value: u8) -> Self {
10218        self.set_ts(value);
10219        self
10220    }
10221}
10222
10223bitflags! {
10224    /// `HTTBR` system register value.
10225    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10226    #[repr(transparent)]
10227    pub struct Httbr: u64 {
10228        /// `CnP` bit.
10229        const CNP = 1 << 0;
10230    }
10231}
10232
10233impl Httbr {
10234    /// Offset of the `CnP` field.
10235    pub const CNP_SHIFT: u32 = 0;
10236    /// Offset of the `BADDR` field.
10237    pub const BADDR_SHIFT: u32 = 1;
10238    /// Mask for the `BADDR` field.
10239    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
10240
10241    /// Returns the value of the `BADDR` field.
10242    pub const fn baddr(self) -> u64 {
10243        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
10244            as u64
10245    }
10246
10247    /// Sets the value of the `BADDR` field.
10248    pub const fn set_baddr(&mut self, value: u64) {
10249        let offset = Self::BADDR_SHIFT;
10250        assert!(value & (Self::BADDR_MASK as u64) == value);
10251        *self = Self::from_bits_retain(
10252            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
10253        );
10254    }
10255
10256    /// Returns a copy with the `BADDR` field set to the given value.
10257    pub const fn with_baddr(mut self, value: u64) -> Self {
10258        self.set_baddr(value);
10259        self
10260    }
10261}
10262
10263bitflags! {
10264    /// `HVBAR` system register value.
10265    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10266    #[repr(transparent)]
10267    pub struct Hvbar: u32 {
10268    }
10269}
10270
10271impl Hvbar {
10272    /// Offset of the `VBA` field.
10273    pub const VBA_SHIFT: u32 = 5;
10274    /// Mask for the `VBA` field.
10275    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
10276
10277    /// Returns the value of the `VBA` field.
10278    pub const fn vba(self) -> u32 {
10279        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
10280    }
10281
10282    /// Sets the value of the `VBA` field.
10283    pub const fn set_vba(&mut self, value: u32) {
10284        let offset = Self::VBA_SHIFT;
10285        assert!(value & (Self::VBA_MASK as u32) == value);
10286        *self = Self::from_bits_retain(
10287            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
10288        );
10289    }
10290
10291    /// Returns a copy with the `VBA` field set to the given value.
10292    pub const fn with_vba(mut self, value: u32) -> Self {
10293        self.set_vba(value);
10294        self
10295    }
10296}
10297
10298#[cfg(feature = "el1")]
10299bitflags! {
10300    /// `ICC_AP1R0_EL1` system register value.
10301    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10302    #[repr(transparent)]
10303    pub struct IccAp1r0El1: u64 {
10304        /// `NMI` bit.
10305        const NMI = 1 << 63;
10306    }
10307}
10308
10309#[cfg(feature = "el1")]
10310impl IccAp1r0El1 {
10311    /// Offset of the `NMI` field.
10312    pub const NMI_SHIFT: u32 = 63;
10313}
10314
10315bitflags! {
10316    /// `ICC_ASGI1R` system register value.
10317    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10318    #[repr(transparent)]
10319    pub struct IccAsgi1r: u64 {
10320        /// `IRM` bit.
10321        const IRM = 1 << 40;
10322    }
10323}
10324
10325impl IccAsgi1r {
10326    /// Offset of the `TargetList` field.
10327    pub const TARGETLIST_SHIFT: u32 = 0;
10328    /// Mask for the `TargetList` field.
10329    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
10330    /// Offset of the `Aff1` field.
10331    pub const AFF1_SHIFT: u32 = 16;
10332    /// Mask for the `Aff1` field.
10333    pub const AFF1_MASK: u64 = 0b11111111;
10334    /// Offset of the `INTID` field.
10335    pub const INTID_SHIFT: u32 = 24;
10336    /// Mask for the `INTID` field.
10337    pub const INTID_MASK: u64 = 0b1111;
10338    /// Offset of the `Aff2` field.
10339    pub const AFF2_SHIFT: u32 = 32;
10340    /// Mask for the `Aff2` field.
10341    pub const AFF2_MASK: u64 = 0b11111111;
10342    /// Offset of the `IRM` field.
10343    pub const IRM_SHIFT: u32 = 40;
10344    /// Offset of the `RS` field.
10345    pub const RS_SHIFT: u32 = 44;
10346    /// Mask for the `RS` field.
10347    pub const RS_MASK: u64 = 0b1111;
10348    /// Offset of the `Aff3` field.
10349    pub const AFF3_SHIFT: u32 = 48;
10350    /// Mask for the `Aff3` field.
10351    pub const AFF3_MASK: u64 = 0b11111111;
10352
10353    /// Returns the value of the `TargetList` field.
10354    pub const fn targetlist(self) -> u16 {
10355        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
10356    }
10357
10358    /// Sets the value of the `TargetList` field.
10359    pub const fn set_targetlist(&mut self, value: u16) {
10360        let offset = Self::TARGETLIST_SHIFT;
10361        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
10362        *self = Self::from_bits_retain(
10363            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
10364        );
10365    }
10366
10367    /// Returns a copy with the `TargetList` field set to the given value.
10368    pub const fn with_targetlist(mut self, value: u16) -> Self {
10369        self.set_targetlist(value);
10370        self
10371    }
10372
10373    /// Returns the value of the `Aff1` field.
10374    pub const fn aff1(self) -> u8 {
10375        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
10376    }
10377
10378    /// Sets the value of the `Aff1` field.
10379    pub const fn set_aff1(&mut self, value: u8) {
10380        let offset = Self::AFF1_SHIFT;
10381        assert!(value & (Self::AFF1_MASK as u8) == value);
10382        *self = Self::from_bits_retain(
10383            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
10384        );
10385    }
10386
10387    /// Returns a copy with the `Aff1` field set to the given value.
10388    pub const fn with_aff1(mut self, value: u8) -> Self {
10389        self.set_aff1(value);
10390        self
10391    }
10392
10393    /// Returns the value of the `INTID` field.
10394    pub const fn intid(self) -> u8 {
10395        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
10396    }
10397
10398    /// Sets the value of the `INTID` field.
10399    pub const fn set_intid(&mut self, value: u8) {
10400        let offset = Self::INTID_SHIFT;
10401        assert!(value & (Self::INTID_MASK as u8) == value);
10402        *self = Self::from_bits_retain(
10403            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
10404        );
10405    }
10406
10407    /// Returns a copy with the `INTID` field set to the given value.
10408    pub const fn with_intid(mut self, value: u8) -> Self {
10409        self.set_intid(value);
10410        self
10411    }
10412
10413    /// Returns the value of the `Aff2` field.
10414    pub const fn aff2(self) -> u8 {
10415        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
10416    }
10417
10418    /// Sets the value of the `Aff2` field.
10419    pub const fn set_aff2(&mut self, value: u8) {
10420        let offset = Self::AFF2_SHIFT;
10421        assert!(value & (Self::AFF2_MASK as u8) == value);
10422        *self = Self::from_bits_retain(
10423            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
10424        );
10425    }
10426
10427    /// Returns a copy with the `Aff2` field set to the given value.
10428    pub const fn with_aff2(mut self, value: u8) -> Self {
10429        self.set_aff2(value);
10430        self
10431    }
10432
10433    /// Returns the value of the `RS` field.
10434    pub const fn rs(self) -> u8 {
10435        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
10436    }
10437
10438    /// Sets the value of the `RS` field.
10439    pub const fn set_rs(&mut self, value: u8) {
10440        let offset = Self::RS_SHIFT;
10441        assert!(value & (Self::RS_MASK as u8) == value);
10442        *self = Self::from_bits_retain(
10443            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
10444        );
10445    }
10446
10447    /// Returns a copy with the `RS` field set to the given value.
10448    pub const fn with_rs(mut self, value: u8) -> Self {
10449        self.set_rs(value);
10450        self
10451    }
10452
10453    /// Returns the value of the `Aff3` field.
10454    pub const fn aff3(self) -> u8 {
10455        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
10456    }
10457
10458    /// Sets the value of the `Aff3` field.
10459    pub const fn set_aff3(&mut self, value: u8) {
10460        let offset = Self::AFF3_SHIFT;
10461        assert!(value & (Self::AFF3_MASK as u8) == value);
10462        *self = Self::from_bits_retain(
10463            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
10464        );
10465    }
10466
10467    /// Returns a copy with the `Aff3` field set to the given value.
10468    pub const fn with_aff3(mut self, value: u8) -> Self {
10469        self.set_aff3(value);
10470        self
10471    }
10472}
10473
10474#[cfg(feature = "el1")]
10475bitflags! {
10476    /// `ICC_ASGI1R_EL1` system register value.
10477    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10478    #[repr(transparent)]
10479    pub struct IccAsgi1rEl1: u64 {
10480        /// `IRM` bit.
10481        const IRM = 1 << 40;
10482    }
10483}
10484
10485#[cfg(feature = "el1")]
10486impl IccAsgi1rEl1 {
10487    /// Offset of the `TargetList` field.
10488    pub const TARGETLIST_SHIFT: u32 = 0;
10489    /// Mask for the `TargetList` field.
10490    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
10491    /// Offset of the `Aff1` field.
10492    pub const AFF1_SHIFT: u32 = 16;
10493    /// Mask for the `Aff1` field.
10494    pub const AFF1_MASK: u64 = 0b11111111;
10495    /// Offset of the `INTID` field.
10496    pub const INTID_SHIFT: u32 = 24;
10497    /// Mask for the `INTID` field.
10498    pub const INTID_MASK: u64 = 0b1111;
10499    /// Offset of the `Aff2` field.
10500    pub const AFF2_SHIFT: u32 = 32;
10501    /// Mask for the `Aff2` field.
10502    pub const AFF2_MASK: u64 = 0b11111111;
10503    /// Offset of the `IRM` field.
10504    pub const IRM_SHIFT: u32 = 40;
10505    /// Offset of the `RS` field.
10506    pub const RS_SHIFT: u32 = 44;
10507    /// Mask for the `RS` field.
10508    pub const RS_MASK: u64 = 0b1111;
10509    /// Offset of the `Aff3` field.
10510    pub const AFF3_SHIFT: u32 = 48;
10511    /// Mask for the `Aff3` field.
10512    pub const AFF3_MASK: u64 = 0b11111111;
10513
10514    /// Returns the value of the `TargetList` field.
10515    pub const fn targetlist(self) -> u16 {
10516        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
10517    }
10518
10519    /// Sets the value of the `TargetList` field.
10520    pub const fn set_targetlist(&mut self, value: u16) {
10521        let offset = Self::TARGETLIST_SHIFT;
10522        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
10523        *self = Self::from_bits_retain(
10524            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
10525        );
10526    }
10527
10528    /// Returns a copy with the `TargetList` field set to the given value.
10529    pub const fn with_targetlist(mut self, value: u16) -> Self {
10530        self.set_targetlist(value);
10531        self
10532    }
10533
10534    /// Returns the value of the `Aff1` field.
10535    pub const fn aff1(self) -> u8 {
10536        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
10537    }
10538
10539    /// Sets the value of the `Aff1` field.
10540    pub const fn set_aff1(&mut self, value: u8) {
10541        let offset = Self::AFF1_SHIFT;
10542        assert!(value & (Self::AFF1_MASK as u8) == value);
10543        *self = Self::from_bits_retain(
10544            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
10545        );
10546    }
10547
10548    /// Returns a copy with the `Aff1` field set to the given value.
10549    pub const fn with_aff1(mut self, value: u8) -> Self {
10550        self.set_aff1(value);
10551        self
10552    }
10553
10554    /// Returns the value of the `INTID` field.
10555    pub const fn intid(self) -> u8 {
10556        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
10557    }
10558
10559    /// Sets the value of the `INTID` field.
10560    pub const fn set_intid(&mut self, value: u8) {
10561        let offset = Self::INTID_SHIFT;
10562        assert!(value & (Self::INTID_MASK as u8) == value);
10563        *self = Self::from_bits_retain(
10564            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
10565        );
10566    }
10567
10568    /// Returns a copy with the `INTID` field set to the given value.
10569    pub const fn with_intid(mut self, value: u8) -> Self {
10570        self.set_intid(value);
10571        self
10572    }
10573
10574    /// Returns the value of the `Aff2` field.
10575    pub const fn aff2(self) -> u8 {
10576        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
10577    }
10578
10579    /// Sets the value of the `Aff2` field.
10580    pub const fn set_aff2(&mut self, value: u8) {
10581        let offset = Self::AFF2_SHIFT;
10582        assert!(value & (Self::AFF2_MASK as u8) == value);
10583        *self = Self::from_bits_retain(
10584            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
10585        );
10586    }
10587
10588    /// Returns a copy with the `Aff2` field set to the given value.
10589    pub const fn with_aff2(mut self, value: u8) -> Self {
10590        self.set_aff2(value);
10591        self
10592    }
10593
10594    /// Returns the value of the `RS` field.
10595    pub const fn rs(self) -> u8 {
10596        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
10597    }
10598
10599    /// Sets the value of the `RS` field.
10600    pub const fn set_rs(&mut self, value: u8) {
10601        let offset = Self::RS_SHIFT;
10602        assert!(value & (Self::RS_MASK as u8) == value);
10603        *self = Self::from_bits_retain(
10604            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
10605        );
10606    }
10607
10608    /// Returns a copy with the `RS` field set to the given value.
10609    pub const fn with_rs(mut self, value: u8) -> Self {
10610        self.set_rs(value);
10611        self
10612    }
10613
10614    /// Returns the value of the `Aff3` field.
10615    pub const fn aff3(self) -> u8 {
10616        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
10617    }
10618
10619    /// Sets the value of the `Aff3` field.
10620    pub const fn set_aff3(&mut self, value: u8) {
10621        let offset = Self::AFF3_SHIFT;
10622        assert!(value & (Self::AFF3_MASK as u8) == value);
10623        *self = Self::from_bits_retain(
10624            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
10625        );
10626    }
10627
10628    /// Returns a copy with the `Aff3` field set to the given value.
10629    pub const fn with_aff3(mut self, value: u8) -> Self {
10630        self.set_aff3(value);
10631        self
10632    }
10633}
10634
10635bitflags! {
10636    /// `ICC_BPR0` system register value.
10637    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10638    #[repr(transparent)]
10639    pub struct IccBpr0: u32 {
10640    }
10641}
10642
10643impl IccBpr0 {
10644    /// Offset of the `BinaryPoint` field.
10645    pub const BINARYPOINT_SHIFT: u32 = 0;
10646    /// Mask for the `BinaryPoint` field.
10647    pub const BINARYPOINT_MASK: u32 = 0b111;
10648
10649    /// Returns the value of the `BinaryPoint` field.
10650    pub const fn binarypoint(self) -> u8 {
10651        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
10652    }
10653
10654    /// Sets the value of the `BinaryPoint` field.
10655    pub const fn set_binarypoint(&mut self, value: u8) {
10656        let offset = Self::BINARYPOINT_SHIFT;
10657        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
10658        *self = Self::from_bits_retain(
10659            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u32) << offset),
10660        );
10661    }
10662
10663    /// Returns a copy with the `BinaryPoint` field set to the given value.
10664    pub const fn with_binarypoint(mut self, value: u8) -> Self {
10665        self.set_binarypoint(value);
10666        self
10667    }
10668}
10669
10670#[cfg(feature = "el1")]
10671bitflags! {
10672    /// `ICC_BPR0_EL1` system register value.
10673    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10674    #[repr(transparent)]
10675    pub struct IccBpr0El1: u64 {
10676    }
10677}
10678
10679#[cfg(feature = "el1")]
10680impl IccBpr0El1 {
10681    /// Offset of the `BinaryPoint` field.
10682    pub const BINARYPOINT_SHIFT: u32 = 0;
10683    /// Mask for the `BinaryPoint` field.
10684    pub const BINARYPOINT_MASK: u64 = 0b111;
10685
10686    /// Returns the value of the `BinaryPoint` field.
10687    pub const fn binarypoint(self) -> u8 {
10688        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
10689    }
10690
10691    /// Sets the value of the `BinaryPoint` field.
10692    pub const fn set_binarypoint(&mut self, value: u8) {
10693        let offset = Self::BINARYPOINT_SHIFT;
10694        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
10695        *self = Self::from_bits_retain(
10696            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u64) << offset),
10697        );
10698    }
10699
10700    /// Returns a copy with the `BinaryPoint` field set to the given value.
10701    pub const fn with_binarypoint(mut self, value: u8) -> Self {
10702        self.set_binarypoint(value);
10703        self
10704    }
10705}
10706
10707bitflags! {
10708    /// `ICC_BPR1` system register value.
10709    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10710    #[repr(transparent)]
10711    pub struct IccBpr1: u32 {
10712    }
10713}
10714
10715impl IccBpr1 {
10716    /// Offset of the `BinaryPoint` field.
10717    pub const BINARYPOINT_SHIFT: u32 = 0;
10718    /// Mask for the `BinaryPoint` field.
10719    pub const BINARYPOINT_MASK: u32 = 0b111;
10720
10721    /// Returns the value of the `BinaryPoint` field.
10722    pub const fn binarypoint(self) -> u8 {
10723        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
10724    }
10725
10726    /// Sets the value of the `BinaryPoint` field.
10727    pub const fn set_binarypoint(&mut self, value: u8) {
10728        let offset = Self::BINARYPOINT_SHIFT;
10729        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
10730        *self = Self::from_bits_retain(
10731            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u32) << offset),
10732        );
10733    }
10734
10735    /// Returns a copy with the `BinaryPoint` field set to the given value.
10736    pub const fn with_binarypoint(mut self, value: u8) -> Self {
10737        self.set_binarypoint(value);
10738        self
10739    }
10740}
10741
10742#[cfg(feature = "el1")]
10743bitflags! {
10744    /// `ICC_BPR1_EL1` system register value.
10745    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10746    #[repr(transparent)]
10747    pub struct IccBpr1El1: u64 {
10748    }
10749}
10750
10751#[cfg(feature = "el1")]
10752impl IccBpr1El1 {
10753    /// Offset of the `BinaryPoint` field.
10754    pub const BINARYPOINT_SHIFT: u32 = 0;
10755    /// Mask for the `BinaryPoint` field.
10756    pub const BINARYPOINT_MASK: u64 = 0b111;
10757
10758    /// Returns the value of the `BinaryPoint` field.
10759    pub const fn binarypoint(self) -> u8 {
10760        ((self.bits() >> Self::BINARYPOINT_SHIFT) & 0b111) as u8
10761    }
10762
10763    /// Sets the value of the `BinaryPoint` field.
10764    pub const fn set_binarypoint(&mut self, value: u8) {
10765        let offset = Self::BINARYPOINT_SHIFT;
10766        assert!(value & (Self::BINARYPOINT_MASK as u8) == value);
10767        *self = Self::from_bits_retain(
10768            (self.bits() & !(Self::BINARYPOINT_MASK << offset)) | ((value as u64) << offset),
10769        );
10770    }
10771
10772    /// Returns a copy with the `BinaryPoint` field set to the given value.
10773    pub const fn with_binarypoint(mut self, value: u8) -> Self {
10774        self.set_binarypoint(value);
10775        self
10776    }
10777}
10778
10779bitflags! {
10780    /// `ICC_CTLR` system register value.
10781    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10782    #[repr(transparent)]
10783    pub struct IccCtlr: u32 {
10784        /// `CBPR` bit.
10785        const CBPR = 1 << 0;
10786        /// `EOImode` bit.
10787        const EOIMODE = 1 << 1;
10788        /// `PMHE` bit.
10789        const PMHE = 1 << 6;
10790        /// `SEIS` bit.
10791        const SEIS = 1 << 14;
10792        /// `A3V` bit.
10793        const A3V = 1 << 15;
10794        /// `RSS` bit.
10795        const RSS = 1 << 18;
10796        /// `ExtRange` bit.
10797        const EXTRANGE = 1 << 19;
10798    }
10799}
10800
10801impl IccCtlr {
10802    /// Offset of the `CBPR` field.
10803    pub const CBPR_SHIFT: u32 = 0;
10804    /// Offset of the `EOImode` field.
10805    pub const EOIMODE_SHIFT: u32 = 1;
10806    /// Offset of the `PMHE` field.
10807    pub const PMHE_SHIFT: u32 = 6;
10808    /// Offset of the `PRIbits` field.
10809    pub const PRIBITS_SHIFT: u32 = 8;
10810    /// Mask for the `PRIbits` field.
10811    pub const PRIBITS_MASK: u32 = 0b111;
10812    /// Offset of the `IDbits` field.
10813    pub const IDBITS_SHIFT: u32 = 11;
10814    /// Mask for the `IDbits` field.
10815    pub const IDBITS_MASK: u32 = 0b111;
10816    /// Offset of the `SEIS` field.
10817    pub const SEIS_SHIFT: u32 = 14;
10818    /// Offset of the `A3V` field.
10819    pub const A3V_SHIFT: u32 = 15;
10820    /// Offset of the `RSS` field.
10821    pub const RSS_SHIFT: u32 = 18;
10822    /// Offset of the `ExtRange` field.
10823    pub const EXTRANGE_SHIFT: u32 = 19;
10824
10825    /// Returns the value of the `PRIbits` field.
10826    pub const fn pribits(self) -> u8 {
10827        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
10828    }
10829
10830    /// Sets the value of the `PRIbits` field.
10831    pub const fn set_pribits(&mut self, value: u8) {
10832        let offset = Self::PRIBITS_SHIFT;
10833        assert!(value & (Self::PRIBITS_MASK as u8) == value);
10834        *self = Self::from_bits_retain(
10835            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u32) << offset),
10836        );
10837    }
10838
10839    /// Returns a copy with the `PRIbits` field set to the given value.
10840    pub const fn with_pribits(mut self, value: u8) -> Self {
10841        self.set_pribits(value);
10842        self
10843    }
10844
10845    /// Returns the value of the `IDbits` field.
10846    pub const fn idbits(self) -> u8 {
10847        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
10848    }
10849
10850    /// Sets the value of the `IDbits` field.
10851    pub const fn set_idbits(&mut self, value: u8) {
10852        let offset = Self::IDBITS_SHIFT;
10853        assert!(value & (Self::IDBITS_MASK as u8) == value);
10854        *self = Self::from_bits_retain(
10855            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u32) << offset),
10856        );
10857    }
10858
10859    /// Returns a copy with the `IDbits` field set to the given value.
10860    pub const fn with_idbits(mut self, value: u8) -> Self {
10861        self.set_idbits(value);
10862        self
10863    }
10864}
10865
10866#[cfg(feature = "el1")]
10867bitflags! {
10868    /// `ICC_CTLR_EL1` system register value.
10869    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10870    #[repr(transparent)]
10871    pub struct IccCtlrEl1: u64 {
10872        /// `CBPR` bit.
10873        const CBPR = 1 << 0;
10874        /// `EOImode` bit.
10875        const EOIMODE = 1 << 1;
10876        /// `PMHE` bit.
10877        const PMHE = 1 << 6;
10878        /// `SEIS` bit.
10879        const SEIS = 1 << 14;
10880        /// `A3V` bit.
10881        const A3V = 1 << 15;
10882        /// `RSS` bit.
10883        const RSS = 1 << 18;
10884        /// `ExtRange` bit.
10885        const EXTRANGE = 1 << 19;
10886    }
10887}
10888
10889#[cfg(feature = "el1")]
10890impl IccCtlrEl1 {
10891    /// Offset of the `CBPR` field.
10892    pub const CBPR_SHIFT: u32 = 0;
10893    /// Offset of the `EOImode` field.
10894    pub const EOIMODE_SHIFT: u32 = 1;
10895    /// Offset of the `PMHE` field.
10896    pub const PMHE_SHIFT: u32 = 6;
10897    /// Offset of the `PRIbits` field.
10898    pub const PRIBITS_SHIFT: u32 = 8;
10899    /// Mask for the `PRIbits` field.
10900    pub const PRIBITS_MASK: u64 = 0b111;
10901    /// Offset of the `IDbits` field.
10902    pub const IDBITS_SHIFT: u32 = 11;
10903    /// Mask for the `IDbits` field.
10904    pub const IDBITS_MASK: u64 = 0b111;
10905    /// Offset of the `SEIS` field.
10906    pub const SEIS_SHIFT: u32 = 14;
10907    /// Offset of the `A3V` field.
10908    pub const A3V_SHIFT: u32 = 15;
10909    /// Offset of the `RSS` field.
10910    pub const RSS_SHIFT: u32 = 18;
10911    /// Offset of the `ExtRange` field.
10912    pub const EXTRANGE_SHIFT: u32 = 19;
10913
10914    /// Returns the value of the `PRIbits` field.
10915    pub const fn pribits(self) -> u8 {
10916        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
10917    }
10918
10919    /// Sets the value of the `PRIbits` field.
10920    pub const fn set_pribits(&mut self, value: u8) {
10921        let offset = Self::PRIBITS_SHIFT;
10922        assert!(value & (Self::PRIBITS_MASK as u8) == value);
10923        *self = Self::from_bits_retain(
10924            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u64) << offset),
10925        );
10926    }
10927
10928    /// Returns a copy with the `PRIbits` field set to the given value.
10929    pub const fn with_pribits(mut self, value: u8) -> Self {
10930        self.set_pribits(value);
10931        self
10932    }
10933
10934    /// Returns the value of the `IDbits` field.
10935    pub const fn idbits(self) -> u8 {
10936        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
10937    }
10938
10939    /// Sets the value of the `IDbits` field.
10940    pub const fn set_idbits(&mut self, value: u8) {
10941        let offset = Self::IDBITS_SHIFT;
10942        assert!(value & (Self::IDBITS_MASK as u8) == value);
10943        *self = Self::from_bits_retain(
10944            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u64) << offset),
10945        );
10946    }
10947
10948    /// Returns a copy with the `IDbits` field set to the given value.
10949    pub const fn with_idbits(mut self, value: u8) -> Self {
10950        self.set_idbits(value);
10951        self
10952    }
10953}
10954
10955#[cfg(feature = "el3")]
10956bitflags! {
10957    /// `ICC_CTLR_EL3` system register value.
10958    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
10959    #[repr(transparent)]
10960    pub struct IccCtlrEl3: u64 {
10961        /// `CBPR_EL1S` bit.
10962        const CBPR_EL1S = 1 << 0;
10963        /// `CBPR_EL1NS` bit.
10964        const CBPR_EL1NS = 1 << 1;
10965        /// `EOImode_EL3` bit.
10966        const EOIMODE_EL3 = 1 << 2;
10967        /// `EOImode_EL1S` bit.
10968        const EOIMODE_EL1S = 1 << 3;
10969        /// `EOImode_EL1NS` bit.
10970        const EOIMODE_EL1NS = 1 << 4;
10971        /// `RM` bit.
10972        const RM = 1 << 5;
10973        /// `PMHE` bit.
10974        const PMHE = 1 << 6;
10975        /// `SEIS` bit.
10976        const SEIS = 1 << 14;
10977        /// `A3V` bit.
10978        const A3V = 1 << 15;
10979        /// `nDS` bit.
10980        const NDS = 1 << 17;
10981        /// `RSS` bit.
10982        const RSS = 1 << 18;
10983        /// `ExtRange` bit.
10984        const EXTRANGE = 1 << 19;
10985    }
10986}
10987
10988#[cfg(feature = "el3")]
10989impl IccCtlrEl3 {
10990    /// Offset of the `CBPR_EL1S` field.
10991    pub const CBPR_EL1S_SHIFT: u32 = 0;
10992    /// Offset of the `CBPR_EL1NS` field.
10993    pub const CBPR_EL1NS_SHIFT: u32 = 1;
10994    /// Offset of the `EOImode_EL3` field.
10995    pub const EOIMODE_EL3_SHIFT: u32 = 2;
10996    /// Offset of the `EOImode_EL1S` field.
10997    pub const EOIMODE_EL1S_SHIFT: u32 = 3;
10998    /// Offset of the `EOImode_EL1NS` field.
10999    pub const EOIMODE_EL1NS_SHIFT: u32 = 4;
11000    /// Offset of the `RM` field.
11001    pub const RM_SHIFT: u32 = 5;
11002    /// Offset of the `PMHE` field.
11003    pub const PMHE_SHIFT: u32 = 6;
11004    /// Offset of the `PRIbits` field.
11005    pub const PRIBITS_SHIFT: u32 = 8;
11006    /// Mask for the `PRIbits` field.
11007    pub const PRIBITS_MASK: u64 = 0b111;
11008    /// Offset of the `IDbits` field.
11009    pub const IDBITS_SHIFT: u32 = 11;
11010    /// Mask for the `IDbits` field.
11011    pub const IDBITS_MASK: u64 = 0b111;
11012    /// Offset of the `SEIS` field.
11013    pub const SEIS_SHIFT: u32 = 14;
11014    /// Offset of the `A3V` field.
11015    pub const A3V_SHIFT: u32 = 15;
11016    /// Offset of the `nDS` field.
11017    pub const NDS_SHIFT: u32 = 17;
11018    /// Offset of the `RSS` field.
11019    pub const RSS_SHIFT: u32 = 18;
11020    /// Offset of the `ExtRange` field.
11021    pub const EXTRANGE_SHIFT: u32 = 19;
11022
11023    /// Returns the value of the `PRIbits` field.
11024    pub const fn pribits(self) -> u8 {
11025        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
11026    }
11027
11028    /// Sets the value of the `PRIbits` field.
11029    pub const fn set_pribits(&mut self, value: u8) {
11030        let offset = Self::PRIBITS_SHIFT;
11031        assert!(value & (Self::PRIBITS_MASK as u8) == value);
11032        *self = Self::from_bits_retain(
11033            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u64) << offset),
11034        );
11035    }
11036
11037    /// Returns a copy with the `PRIbits` field set to the given value.
11038    pub const fn with_pribits(mut self, value: u8) -> Self {
11039        self.set_pribits(value);
11040        self
11041    }
11042
11043    /// Returns the value of the `IDbits` field.
11044    pub const fn idbits(self) -> u8 {
11045        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
11046    }
11047
11048    /// Sets the value of the `IDbits` field.
11049    pub const fn set_idbits(&mut self, value: u8) {
11050        let offset = Self::IDBITS_SHIFT;
11051        assert!(value & (Self::IDBITS_MASK as u8) == value);
11052        *self = Self::from_bits_retain(
11053            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u64) << offset),
11054        );
11055    }
11056
11057    /// Returns a copy with the `IDbits` field set to the given value.
11058    pub const fn with_idbits(mut self, value: u8) -> Self {
11059        self.set_idbits(value);
11060        self
11061    }
11062}
11063
11064bitflags! {
11065    /// `ICC_DIR` system register value.
11066    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11067    #[repr(transparent)]
11068    pub struct IccDir: u32 {
11069    }
11070}
11071
11072impl IccDir {
11073    /// Offset of the `INTID` field.
11074    pub const INTID_SHIFT: u32 = 0;
11075    /// Mask for the `INTID` field.
11076    pub const INTID_MASK: u32 = 0b111111111111111111111111;
11077
11078    /// Returns the value of the `INTID` field.
11079    pub const fn intid(self) -> u32 {
11080        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11081    }
11082
11083    /// Sets the value of the `INTID` field.
11084    pub const fn set_intid(&mut self, value: u32) {
11085        let offset = Self::INTID_SHIFT;
11086        assert!(value & (Self::INTID_MASK as u32) == value);
11087        *self = Self::from_bits_retain(
11088            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
11089        );
11090    }
11091
11092    /// Returns a copy with the `INTID` field set to the given value.
11093    pub const fn with_intid(mut self, value: u32) -> Self {
11094        self.set_intid(value);
11095        self
11096    }
11097}
11098
11099#[cfg(feature = "el1")]
11100bitflags! {
11101    /// `ICC_DIR_EL1` system register value.
11102    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11103    #[repr(transparent)]
11104    pub struct IccDirEl1: u64 {
11105    }
11106}
11107
11108#[cfg(feature = "el1")]
11109impl IccDirEl1 {
11110    /// Offset of the `INTID` field.
11111    pub const INTID_SHIFT: u32 = 0;
11112    /// Mask for the `INTID` field.
11113    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11114
11115    /// Returns the value of the `INTID` field.
11116    pub const fn intid(self) -> u32 {
11117        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11118    }
11119
11120    /// Sets the value of the `INTID` field.
11121    pub const fn set_intid(&mut self, value: u32) {
11122        let offset = Self::INTID_SHIFT;
11123        assert!(value & (Self::INTID_MASK as u32) == value);
11124        *self = Self::from_bits_retain(
11125            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11126        );
11127    }
11128
11129    /// Returns a copy with the `INTID` field set to the given value.
11130    pub const fn with_intid(mut self, value: u32) -> Self {
11131        self.set_intid(value);
11132        self
11133    }
11134}
11135
11136bitflags! {
11137    /// `ICC_EOIR0` system register value.
11138    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11139    #[repr(transparent)]
11140    pub struct IccEoir0: u32 {
11141    }
11142}
11143
11144impl IccEoir0 {
11145    /// Offset of the `INTID` field.
11146    pub const INTID_SHIFT: u32 = 0;
11147    /// Mask for the `INTID` field.
11148    pub const INTID_MASK: u32 = 0b111111111111111111111111;
11149
11150    /// Returns the value of the `INTID` field.
11151    pub const fn intid(self) -> u32 {
11152        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11153    }
11154
11155    /// Sets the value of the `INTID` field.
11156    pub const fn set_intid(&mut self, value: u32) {
11157        let offset = Self::INTID_SHIFT;
11158        assert!(value & (Self::INTID_MASK as u32) == value);
11159        *self = Self::from_bits_retain(
11160            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
11161        );
11162    }
11163
11164    /// Returns a copy with the `INTID` field set to the given value.
11165    pub const fn with_intid(mut self, value: u32) -> Self {
11166        self.set_intid(value);
11167        self
11168    }
11169}
11170
11171#[cfg(feature = "el1")]
11172bitflags! {
11173    /// `ICC_EOIR0_EL1` system register value.
11174    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11175    #[repr(transparent)]
11176    pub struct IccEoir0El1: u64 {
11177    }
11178}
11179
11180#[cfg(feature = "el1")]
11181impl IccEoir0El1 {
11182    /// Offset of the `INTID` field.
11183    pub const INTID_SHIFT: u32 = 0;
11184    /// Mask for the `INTID` field.
11185    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11186
11187    /// Returns the value of the `INTID` field.
11188    pub const fn intid(self) -> u32 {
11189        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11190    }
11191
11192    /// Sets the value of the `INTID` field.
11193    pub const fn set_intid(&mut self, value: u32) {
11194        let offset = Self::INTID_SHIFT;
11195        assert!(value & (Self::INTID_MASK as u32) == value);
11196        *self = Self::from_bits_retain(
11197            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11198        );
11199    }
11200
11201    /// Returns a copy with the `INTID` field set to the given value.
11202    pub const fn with_intid(mut self, value: u32) -> Self {
11203        self.set_intid(value);
11204        self
11205    }
11206}
11207
11208bitflags! {
11209    /// `ICC_EOIR1` system register value.
11210    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11211    #[repr(transparent)]
11212    pub struct IccEoir1: u32 {
11213    }
11214}
11215
11216impl IccEoir1 {
11217    /// Offset of the `INTID` field.
11218    pub const INTID_SHIFT: u32 = 0;
11219    /// Mask for the `INTID` field.
11220    pub const INTID_MASK: u32 = 0b111111111111111111111111;
11221
11222    /// Returns the value of the `INTID` field.
11223    pub const fn intid(self) -> u32 {
11224        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11225    }
11226
11227    /// Sets the value of the `INTID` field.
11228    pub const fn set_intid(&mut self, value: u32) {
11229        let offset = Self::INTID_SHIFT;
11230        assert!(value & (Self::INTID_MASK as u32) == value);
11231        *self = Self::from_bits_retain(
11232            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
11233        );
11234    }
11235
11236    /// Returns a copy with the `INTID` field set to the given value.
11237    pub const fn with_intid(mut self, value: u32) -> Self {
11238        self.set_intid(value);
11239        self
11240    }
11241}
11242
11243#[cfg(feature = "el1")]
11244bitflags! {
11245    /// `ICC_EOIR1_EL1` system register value.
11246    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11247    #[repr(transparent)]
11248    pub struct IccEoir1El1: u64 {
11249    }
11250}
11251
11252#[cfg(feature = "el1")]
11253impl IccEoir1El1 {
11254    /// Offset of the `INTID` field.
11255    pub const INTID_SHIFT: u32 = 0;
11256    /// Mask for the `INTID` field.
11257    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11258
11259    /// Returns the value of the `INTID` field.
11260    pub const fn intid(self) -> u32 {
11261        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11262    }
11263
11264    /// Sets the value of the `INTID` field.
11265    pub const fn set_intid(&mut self, value: u32) {
11266        let offset = Self::INTID_SHIFT;
11267        assert!(value & (Self::INTID_MASK as u32) == value);
11268        *self = Self::from_bits_retain(
11269            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11270        );
11271    }
11272
11273    /// Returns a copy with the `INTID` field set to the given value.
11274    pub const fn with_intid(mut self, value: u32) -> Self {
11275        self.set_intid(value);
11276        self
11277    }
11278}
11279
11280bitflags! {
11281    /// `ICC_HPPIR0` system register value.
11282    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11283    #[repr(transparent)]
11284    pub struct IccHppir0: u32 {
11285    }
11286}
11287
11288impl IccHppir0 {
11289    /// Offset of the `INTID` field.
11290    pub const INTID_SHIFT: u32 = 0;
11291    /// Mask for the `INTID` field.
11292    pub const INTID_MASK: u32 = 0b111111111111111111111111;
11293
11294    /// Returns the value of the `INTID` field.
11295    pub const fn intid(self) -> u32 {
11296        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11297    }
11298
11299    /// Sets the value of the `INTID` field.
11300    pub const fn set_intid(&mut self, value: u32) {
11301        let offset = Self::INTID_SHIFT;
11302        assert!(value & (Self::INTID_MASK as u32) == value);
11303        *self = Self::from_bits_retain(
11304            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
11305        );
11306    }
11307
11308    /// Returns a copy with the `INTID` field set to the given value.
11309    pub const fn with_intid(mut self, value: u32) -> Self {
11310        self.set_intid(value);
11311        self
11312    }
11313}
11314
11315#[cfg(feature = "el1")]
11316bitflags! {
11317    /// `ICC_HPPIR0_EL1` system register value.
11318    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11319    #[repr(transparent)]
11320    pub struct IccHppir0El1: u64 {
11321    }
11322}
11323
11324#[cfg(feature = "el1")]
11325impl IccHppir0El1 {
11326    /// Offset of the `INTID` field.
11327    pub const INTID_SHIFT: u32 = 0;
11328    /// Mask for the `INTID` field.
11329    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11330
11331    /// Returns the value of the `INTID` field.
11332    pub const fn intid(self) -> u32 {
11333        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11334    }
11335
11336    /// Sets the value of the `INTID` field.
11337    pub const fn set_intid(&mut self, value: u32) {
11338        let offset = Self::INTID_SHIFT;
11339        assert!(value & (Self::INTID_MASK as u32) == value);
11340        *self = Self::from_bits_retain(
11341            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11342        );
11343    }
11344
11345    /// Returns a copy with the `INTID` field set to the given value.
11346    pub const fn with_intid(mut self, value: u32) -> Self {
11347        self.set_intid(value);
11348        self
11349    }
11350}
11351
11352bitflags! {
11353    /// `ICC_HPPIR1` system register value.
11354    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11355    #[repr(transparent)]
11356    pub struct IccHppir1: u32 {
11357    }
11358}
11359
11360impl IccHppir1 {
11361    /// Offset of the `INTID` field.
11362    pub const INTID_SHIFT: u32 = 0;
11363    /// Mask for the `INTID` field.
11364    pub const INTID_MASK: u32 = 0b111111111111111111111111;
11365
11366    /// Returns the value of the `INTID` field.
11367    pub const fn intid(self) -> u32 {
11368        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11369    }
11370
11371    /// Sets the value of the `INTID` field.
11372    pub const fn set_intid(&mut self, value: u32) {
11373        let offset = Self::INTID_SHIFT;
11374        assert!(value & (Self::INTID_MASK as u32) == value);
11375        *self = Self::from_bits_retain(
11376            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
11377        );
11378    }
11379
11380    /// Returns a copy with the `INTID` field set to the given value.
11381    pub const fn with_intid(mut self, value: u32) -> Self {
11382        self.set_intid(value);
11383        self
11384    }
11385}
11386
11387#[cfg(feature = "el1")]
11388bitflags! {
11389    /// `ICC_HPPIR1_EL1` system register value.
11390    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11391    #[repr(transparent)]
11392    pub struct IccHppir1El1: u64 {
11393    }
11394}
11395
11396#[cfg(feature = "el1")]
11397impl IccHppir1El1 {
11398    /// Offset of the `INTID` field.
11399    pub const INTID_SHIFT: u32 = 0;
11400    /// Mask for the `INTID` field.
11401    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11402
11403    /// Returns the value of the `INTID` field.
11404    pub const fn intid(self) -> u32 {
11405        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11406    }
11407
11408    /// Sets the value of the `INTID` field.
11409    pub const fn set_intid(&mut self, value: u32) {
11410        let offset = Self::INTID_SHIFT;
11411        assert!(value & (Self::INTID_MASK as u32) == value);
11412        *self = Self::from_bits_retain(
11413            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11414        );
11415    }
11416
11417    /// Returns a copy with the `INTID` field set to the given value.
11418    pub const fn with_intid(mut self, value: u32) -> Self {
11419        self.set_intid(value);
11420        self
11421    }
11422}
11423
11424bitflags! {
11425    /// `ICC_HSRE` system register value.
11426    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11427    #[repr(transparent)]
11428    pub struct IccHsre: u32 {
11429        /// `SRE` bit.
11430        const SRE = 1 << 0;
11431        /// `DFB` bit.
11432        const DFB = 1 << 1;
11433        /// `DIB` bit.
11434        const DIB = 1 << 2;
11435        /// `Enable` bit.
11436        const ENABLE = 1 << 3;
11437    }
11438}
11439
11440impl IccHsre {
11441    /// Offset of the `SRE` field.
11442    pub const SRE_SHIFT: u32 = 0;
11443    /// Offset of the `DFB` field.
11444    pub const DFB_SHIFT: u32 = 1;
11445    /// Offset of the `DIB` field.
11446    pub const DIB_SHIFT: u32 = 2;
11447    /// Offset of the `Enable` field.
11448    pub const ENABLE_SHIFT: u32 = 3;
11449}
11450
11451bitflags! {
11452    /// `ICC_IAR0` system register value.
11453    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11454    #[repr(transparent)]
11455    pub struct IccIar0: u32 {
11456    }
11457}
11458
11459impl IccIar0 {
11460    /// Offset of the `INTID` field.
11461    pub const INTID_SHIFT: u32 = 0;
11462    /// Mask for the `INTID` field.
11463    pub const INTID_MASK: u32 = 0b111111111111111111111111;
11464
11465    /// Returns the value of the `INTID` field.
11466    pub const fn intid(self) -> u32 {
11467        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11468    }
11469
11470    /// Sets the value of the `INTID` field.
11471    pub const fn set_intid(&mut self, value: u32) {
11472        let offset = Self::INTID_SHIFT;
11473        assert!(value & (Self::INTID_MASK as u32) == value);
11474        *self = Self::from_bits_retain(
11475            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
11476        );
11477    }
11478
11479    /// Returns a copy with the `INTID` field set to the given value.
11480    pub const fn with_intid(mut self, value: u32) -> Self {
11481        self.set_intid(value);
11482        self
11483    }
11484}
11485
11486#[cfg(feature = "el1")]
11487bitflags! {
11488    /// `ICC_IAR0_EL1` system register value.
11489    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11490    #[repr(transparent)]
11491    pub struct IccIar0El1: u64 {
11492    }
11493}
11494
11495#[cfg(feature = "el1")]
11496impl IccIar0El1 {
11497    /// Offset of the `INTID` field.
11498    pub const INTID_SHIFT: u32 = 0;
11499    /// Mask for the `INTID` field.
11500    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11501
11502    /// Returns the value of the `INTID` field.
11503    pub const fn intid(self) -> u32 {
11504        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11505    }
11506
11507    /// Sets the value of the `INTID` field.
11508    pub const fn set_intid(&mut self, value: u32) {
11509        let offset = Self::INTID_SHIFT;
11510        assert!(value & (Self::INTID_MASK as u32) == value);
11511        *self = Self::from_bits_retain(
11512            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11513        );
11514    }
11515
11516    /// Returns a copy with the `INTID` field set to the given value.
11517    pub const fn with_intid(mut self, value: u32) -> Self {
11518        self.set_intid(value);
11519        self
11520    }
11521}
11522
11523bitflags! {
11524    /// `ICC_IAR1` system register value.
11525    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11526    #[repr(transparent)]
11527    pub struct IccIar1: u32 {
11528    }
11529}
11530
11531impl IccIar1 {
11532    /// Offset of the `INTID` field.
11533    pub const INTID_SHIFT: u32 = 0;
11534    /// Mask for the `INTID` field.
11535    pub const INTID_MASK: u32 = 0b111111111111111111111111;
11536
11537    /// Returns the value of the `INTID` field.
11538    pub const fn intid(self) -> u32 {
11539        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11540    }
11541
11542    /// Sets the value of the `INTID` field.
11543    pub const fn set_intid(&mut self, value: u32) {
11544        let offset = Self::INTID_SHIFT;
11545        assert!(value & (Self::INTID_MASK as u32) == value);
11546        *self = Self::from_bits_retain(
11547            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u32) << offset),
11548        );
11549    }
11550
11551    /// Returns a copy with the `INTID` field set to the given value.
11552    pub const fn with_intid(mut self, value: u32) -> Self {
11553        self.set_intid(value);
11554        self
11555    }
11556}
11557
11558#[cfg(feature = "el1")]
11559bitflags! {
11560    /// `ICC_IAR1_EL1` system register value.
11561    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11562    #[repr(transparent)]
11563    pub struct IccIar1El1: u64 {
11564    }
11565}
11566
11567#[cfg(feature = "el1")]
11568impl IccIar1El1 {
11569    /// Offset of the `INTID` field.
11570    pub const INTID_SHIFT: u32 = 0;
11571    /// Mask for the `INTID` field.
11572    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11573
11574    /// Returns the value of the `INTID` field.
11575    pub const fn intid(self) -> u32 {
11576        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11577    }
11578
11579    /// Sets the value of the `INTID` field.
11580    pub const fn set_intid(&mut self, value: u32) {
11581        let offset = Self::INTID_SHIFT;
11582        assert!(value & (Self::INTID_MASK as u32) == value);
11583        *self = Self::from_bits_retain(
11584            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11585        );
11586    }
11587
11588    /// Returns a copy with the `INTID` field set to the given value.
11589    pub const fn with_intid(mut self, value: u32) -> Self {
11590        self.set_intid(value);
11591        self
11592    }
11593}
11594
11595bitflags! {
11596    /// `ICC_IGRPEN0` system register value.
11597    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11598    #[repr(transparent)]
11599    pub struct IccIgrpen0: u32 {
11600        /// `Enable` bit.
11601        const ENABLE = 1 << 0;
11602    }
11603}
11604
11605impl IccIgrpen0 {
11606    /// Offset of the `Enable` field.
11607    pub const ENABLE_SHIFT: u32 = 0;
11608}
11609
11610#[cfg(feature = "el1")]
11611bitflags! {
11612    /// `ICC_IGRPEN0_EL1` system register value.
11613    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11614    #[repr(transparent)]
11615    pub struct IccIgrpen0El1: u64 {
11616        /// `Enable` bit.
11617        const ENABLE = 1 << 0;
11618    }
11619}
11620
11621#[cfg(feature = "el1")]
11622impl IccIgrpen0El1 {
11623    /// Offset of the `Enable` field.
11624    pub const ENABLE_SHIFT: u32 = 0;
11625}
11626
11627bitflags! {
11628    /// `ICC_IGRPEN1` system register value.
11629    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11630    #[repr(transparent)]
11631    pub struct IccIgrpen1: u32 {
11632        /// `Enable` bit.
11633        const ENABLE = 1 << 0;
11634    }
11635}
11636
11637impl IccIgrpen1 {
11638    /// Offset of the `Enable` field.
11639    pub const ENABLE_SHIFT: u32 = 0;
11640}
11641
11642#[cfg(feature = "el1")]
11643bitflags! {
11644    /// `ICC_IGRPEN1_EL1` system register value.
11645    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11646    #[repr(transparent)]
11647    pub struct IccIgrpen1El1: u64 {
11648        /// `Enable` bit.
11649        const ENABLE = 1 << 0;
11650    }
11651}
11652
11653#[cfg(feature = "el1")]
11654impl IccIgrpen1El1 {
11655    /// Offset of the `Enable` field.
11656    pub const ENABLE_SHIFT: u32 = 0;
11657}
11658
11659#[cfg(feature = "el3")]
11660bitflags! {
11661    /// `ICC_IGRPEN1_EL3` system register value.
11662    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11663    #[repr(transparent)]
11664    pub struct IccIgrpen1El3: u64 {
11665        /// `EnableGrp1NS` bit.
11666        const ENABLEGRP1NS = 1 << 0;
11667        /// `EnableGrp1S` bit.
11668        const ENABLEGRP1S = 1 << 1;
11669    }
11670}
11671
11672#[cfg(feature = "el3")]
11673impl IccIgrpen1El3 {
11674    /// Offset of the `EnableGrp1NS` field.
11675    pub const ENABLEGRP1NS_SHIFT: u32 = 0;
11676    /// Offset of the `EnableGrp1S` field.
11677    pub const ENABLEGRP1S_SHIFT: u32 = 1;
11678}
11679
11680bitflags! {
11681    /// `ICC_MCTLR` system register value.
11682    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11683    #[repr(transparent)]
11684    pub struct IccMctlr: u32 {
11685        /// `CBPR_EL1S` bit.
11686        const CBPR_EL1S = 1 << 0;
11687        /// `CBPR_EL1NS` bit.
11688        const CBPR_EL1NS = 1 << 1;
11689        /// `EOImode_EL3` bit.
11690        const EOIMODE_EL3 = 1 << 2;
11691        /// `EOImode_EL1S` bit.
11692        const EOIMODE_EL1S = 1 << 3;
11693        /// `EOImode_EL1NS` bit.
11694        const EOIMODE_EL1NS = 1 << 4;
11695        /// `RM` bit.
11696        const RM = 1 << 5;
11697        /// `PMHE` bit.
11698        const PMHE = 1 << 6;
11699        /// `SEIS` bit.
11700        const SEIS = 1 << 14;
11701        /// `A3V` bit.
11702        const A3V = 1 << 15;
11703        /// `nDS` bit.
11704        const NDS = 1 << 17;
11705        /// `RSS` bit.
11706        const RSS = 1 << 18;
11707        /// `ExtRange` bit.
11708        const EXTRANGE = 1 << 19;
11709    }
11710}
11711
11712impl IccMctlr {
11713    /// Offset of the `CBPR_EL1S` field.
11714    pub const CBPR_EL1S_SHIFT: u32 = 0;
11715    /// Offset of the `CBPR_EL1NS` field.
11716    pub const CBPR_EL1NS_SHIFT: u32 = 1;
11717    /// Offset of the `EOImode_EL3` field.
11718    pub const EOIMODE_EL3_SHIFT: u32 = 2;
11719    /// Offset of the `EOImode_EL1S` field.
11720    pub const EOIMODE_EL1S_SHIFT: u32 = 3;
11721    /// Offset of the `EOImode_EL1NS` field.
11722    pub const EOIMODE_EL1NS_SHIFT: u32 = 4;
11723    /// Offset of the `RM` field.
11724    pub const RM_SHIFT: u32 = 5;
11725    /// Offset of the `PMHE` field.
11726    pub const PMHE_SHIFT: u32 = 6;
11727    /// Offset of the `PRIbits` field.
11728    pub const PRIBITS_SHIFT: u32 = 8;
11729    /// Mask for the `PRIbits` field.
11730    pub const PRIBITS_MASK: u32 = 0b111;
11731    /// Offset of the `IDbits` field.
11732    pub const IDBITS_SHIFT: u32 = 11;
11733    /// Mask for the `IDbits` field.
11734    pub const IDBITS_MASK: u32 = 0b111;
11735    /// Offset of the `SEIS` field.
11736    pub const SEIS_SHIFT: u32 = 14;
11737    /// Offset of the `A3V` field.
11738    pub const A3V_SHIFT: u32 = 15;
11739    /// Offset of the `nDS` field.
11740    pub const NDS_SHIFT: u32 = 17;
11741    /// Offset of the `RSS` field.
11742    pub const RSS_SHIFT: u32 = 18;
11743    /// Offset of the `ExtRange` field.
11744    pub const EXTRANGE_SHIFT: u32 = 19;
11745
11746    /// Returns the value of the `PRIbits` field.
11747    pub const fn pribits(self) -> u8 {
11748        ((self.bits() >> Self::PRIBITS_SHIFT) & 0b111) as u8
11749    }
11750
11751    /// Sets the value of the `PRIbits` field.
11752    pub const fn set_pribits(&mut self, value: u8) {
11753        let offset = Self::PRIBITS_SHIFT;
11754        assert!(value & (Self::PRIBITS_MASK as u8) == value);
11755        *self = Self::from_bits_retain(
11756            (self.bits() & !(Self::PRIBITS_MASK << offset)) | ((value as u32) << offset),
11757        );
11758    }
11759
11760    /// Returns a copy with the `PRIbits` field set to the given value.
11761    pub const fn with_pribits(mut self, value: u8) -> Self {
11762        self.set_pribits(value);
11763        self
11764    }
11765
11766    /// Returns the value of the `IDbits` field.
11767    pub const fn idbits(self) -> u8 {
11768        ((self.bits() >> Self::IDBITS_SHIFT) & 0b111) as u8
11769    }
11770
11771    /// Sets the value of the `IDbits` field.
11772    pub const fn set_idbits(&mut self, value: u8) {
11773        let offset = Self::IDBITS_SHIFT;
11774        assert!(value & (Self::IDBITS_MASK as u8) == value);
11775        *self = Self::from_bits_retain(
11776            (self.bits() & !(Self::IDBITS_MASK << offset)) | ((value as u32) << offset),
11777        );
11778    }
11779
11780    /// Returns a copy with the `IDbits` field set to the given value.
11781    pub const fn with_idbits(mut self, value: u8) -> Self {
11782        self.set_idbits(value);
11783        self
11784    }
11785}
11786
11787bitflags! {
11788    /// `ICC_MGRPEN1` system register value.
11789    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11790    #[repr(transparent)]
11791    pub struct IccMgrpen1: u32 {
11792        /// `EnableGrp1NS` bit.
11793        const ENABLEGRP1NS = 1 << 0;
11794        /// `EnableGrp1S` bit.
11795        const ENABLEGRP1S = 1 << 1;
11796    }
11797}
11798
11799impl IccMgrpen1 {
11800    /// Offset of the `EnableGrp1NS` field.
11801    pub const ENABLEGRP1NS_SHIFT: u32 = 0;
11802    /// Offset of the `EnableGrp1S` field.
11803    pub const ENABLEGRP1S_SHIFT: u32 = 1;
11804}
11805
11806bitflags! {
11807    /// `ICC_MSRE` system register value.
11808    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11809    #[repr(transparent)]
11810    pub struct IccMsre: u32 {
11811        /// `SRE` bit.
11812        const SRE = 1 << 0;
11813        /// `DFB` bit.
11814        const DFB = 1 << 1;
11815        /// `DIB` bit.
11816        const DIB = 1 << 2;
11817        /// `Enable` bit.
11818        const ENABLE = 1 << 3;
11819    }
11820}
11821
11822impl IccMsre {
11823    /// Offset of the `SRE` field.
11824    pub const SRE_SHIFT: u32 = 0;
11825    /// Offset of the `DFB` field.
11826    pub const DFB_SHIFT: u32 = 1;
11827    /// Offset of the `DIB` field.
11828    pub const DIB_SHIFT: u32 = 2;
11829    /// Offset of the `Enable` field.
11830    pub const ENABLE_SHIFT: u32 = 3;
11831}
11832
11833#[cfg(feature = "el1")]
11834bitflags! {
11835    /// `ICC_NMIAR1_EL1` system register value.
11836    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11837    #[repr(transparent)]
11838    pub struct IccNmiar1El1: u64 {
11839    }
11840}
11841
11842#[cfg(feature = "el1")]
11843impl IccNmiar1El1 {
11844    /// Offset of the `INTID` field.
11845    pub const INTID_SHIFT: u32 = 0;
11846    /// Mask for the `INTID` field.
11847    pub const INTID_MASK: u64 = 0b111111111111111111111111;
11848
11849    /// Returns the value of the `INTID` field.
11850    pub const fn intid(self) -> u32 {
11851        ((self.bits() >> Self::INTID_SHIFT) & 0b111111111111111111111111) as u32
11852    }
11853
11854    /// Sets the value of the `INTID` field.
11855    pub const fn set_intid(&mut self, value: u32) {
11856        let offset = Self::INTID_SHIFT;
11857        assert!(value & (Self::INTID_MASK as u32) == value);
11858        *self = Self::from_bits_retain(
11859            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
11860        );
11861    }
11862
11863    /// Returns a copy with the `INTID` field set to the given value.
11864    pub const fn with_intid(mut self, value: u32) -> Self {
11865        self.set_intid(value);
11866        self
11867    }
11868}
11869
11870bitflags! {
11871    /// `ICC_PMR` system register value.
11872    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11873    #[repr(transparent)]
11874    pub struct IccPmr: u32 {
11875    }
11876}
11877
11878impl IccPmr {
11879    /// Offset of the `Priority` field.
11880    pub const PRIORITY_SHIFT: u32 = 0;
11881    /// Mask for the `Priority` field.
11882    pub const PRIORITY_MASK: u32 = 0b11111111;
11883
11884    /// Returns the value of the `Priority` field.
11885    pub const fn priority(self) -> u8 {
11886        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
11887    }
11888
11889    /// Sets the value of the `Priority` field.
11890    pub const fn set_priority(&mut self, value: u8) {
11891        let offset = Self::PRIORITY_SHIFT;
11892        assert!(value & (Self::PRIORITY_MASK as u8) == value);
11893        *self = Self::from_bits_retain(
11894            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u32) << offset),
11895        );
11896    }
11897
11898    /// Returns a copy with the `Priority` field set to the given value.
11899    pub const fn with_priority(mut self, value: u8) -> Self {
11900        self.set_priority(value);
11901        self
11902    }
11903}
11904
11905#[cfg(feature = "el1")]
11906bitflags! {
11907    /// `ICC_PMR_EL1` system register value.
11908    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11909    #[repr(transparent)]
11910    pub struct IccPmrEl1: u64 {
11911    }
11912}
11913
11914#[cfg(feature = "el1")]
11915impl IccPmrEl1 {
11916    /// Offset of the `Priority` field.
11917    pub const PRIORITY_SHIFT: u32 = 0;
11918    /// Mask for the `Priority` field.
11919    pub const PRIORITY_MASK: u64 = 0b11111111;
11920
11921    /// Returns the value of the `Priority` field.
11922    pub const fn priority(self) -> u8 {
11923        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
11924    }
11925
11926    /// Sets the value of the `Priority` field.
11927    pub const fn set_priority(&mut self, value: u8) {
11928        let offset = Self::PRIORITY_SHIFT;
11929        assert!(value & (Self::PRIORITY_MASK as u8) == value);
11930        *self = Self::from_bits_retain(
11931            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u64) << offset),
11932        );
11933    }
11934
11935    /// Returns a copy with the `Priority` field set to the given value.
11936    pub const fn with_priority(mut self, value: u8) -> Self {
11937        self.set_priority(value);
11938        self
11939    }
11940}
11941
11942bitflags! {
11943    /// `ICC_RPR` system register value.
11944    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11945    #[repr(transparent)]
11946    pub struct IccRpr: u32 {
11947    }
11948}
11949
11950impl IccRpr {
11951    /// Offset of the `Priority` field.
11952    pub const PRIORITY_SHIFT: u32 = 0;
11953    /// Mask for the `Priority` field.
11954    pub const PRIORITY_MASK: u32 = 0b11111111;
11955
11956    /// Returns the value of the `Priority` field.
11957    pub const fn priority(self) -> u8 {
11958        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
11959    }
11960
11961    /// Sets the value of the `Priority` field.
11962    pub const fn set_priority(&mut self, value: u8) {
11963        let offset = Self::PRIORITY_SHIFT;
11964        assert!(value & (Self::PRIORITY_MASK as u8) == value);
11965        *self = Self::from_bits_retain(
11966            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u32) << offset),
11967        );
11968    }
11969
11970    /// Returns a copy with the `Priority` field set to the given value.
11971    pub const fn with_priority(mut self, value: u8) -> Self {
11972        self.set_priority(value);
11973        self
11974    }
11975}
11976
11977#[cfg(feature = "el1")]
11978bitflags! {
11979    /// `ICC_RPR_EL1` system register value.
11980    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
11981    #[repr(transparent)]
11982    pub struct IccRprEl1: u64 {
11983        /// `NMI_NS` bit.
11984        const NMI_NS = 1 << 62;
11985        /// `NMI` bit.
11986        const NMI = 1 << 63;
11987    }
11988}
11989
11990#[cfg(feature = "el1")]
11991impl IccRprEl1 {
11992    /// Offset of the `Priority` field.
11993    pub const PRIORITY_SHIFT: u32 = 0;
11994    /// Mask for the `Priority` field.
11995    pub const PRIORITY_MASK: u64 = 0b11111111;
11996    /// Offset of the `NMI_NS` field.
11997    pub const NMI_NS_SHIFT: u32 = 62;
11998    /// Offset of the `NMI` field.
11999    pub const NMI_SHIFT: u32 = 63;
12000
12001    /// Returns the value of the `Priority` field.
12002    pub const fn priority(self) -> u8 {
12003        ((self.bits() >> Self::PRIORITY_SHIFT) & 0b11111111) as u8
12004    }
12005
12006    /// Sets the value of the `Priority` field.
12007    pub const fn set_priority(&mut self, value: u8) {
12008        let offset = Self::PRIORITY_SHIFT;
12009        assert!(value & (Self::PRIORITY_MASK as u8) == value);
12010        *self = Self::from_bits_retain(
12011            (self.bits() & !(Self::PRIORITY_MASK << offset)) | ((value as u64) << offset),
12012        );
12013    }
12014
12015    /// Returns a copy with the `Priority` field set to the given value.
12016    pub const fn with_priority(mut self, value: u8) -> Self {
12017        self.set_priority(value);
12018        self
12019    }
12020}
12021
12022bitflags! {
12023    /// `ICC_SGI0R` system register value.
12024    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12025    #[repr(transparent)]
12026    pub struct IccSgi0r: u64 {
12027        /// `IRM` bit.
12028        const IRM = 1 << 40;
12029    }
12030}
12031
12032impl IccSgi0r {
12033    /// Offset of the `TargetList` field.
12034    pub const TARGETLIST_SHIFT: u32 = 0;
12035    /// Mask for the `TargetList` field.
12036    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
12037    /// Offset of the `Aff1` field.
12038    pub const AFF1_SHIFT: u32 = 16;
12039    /// Mask for the `Aff1` field.
12040    pub const AFF1_MASK: u64 = 0b11111111;
12041    /// Offset of the `INTID` field.
12042    pub const INTID_SHIFT: u32 = 24;
12043    /// Mask for the `INTID` field.
12044    pub const INTID_MASK: u64 = 0b1111;
12045    /// Offset of the `Aff2` field.
12046    pub const AFF2_SHIFT: u32 = 32;
12047    /// Mask for the `Aff2` field.
12048    pub const AFF2_MASK: u64 = 0b11111111;
12049    /// Offset of the `IRM` field.
12050    pub const IRM_SHIFT: u32 = 40;
12051    /// Offset of the `RS` field.
12052    pub const RS_SHIFT: u32 = 44;
12053    /// Mask for the `RS` field.
12054    pub const RS_MASK: u64 = 0b1111;
12055    /// Offset of the `Aff3` field.
12056    pub const AFF3_SHIFT: u32 = 48;
12057    /// Mask for the `Aff3` field.
12058    pub const AFF3_MASK: u64 = 0b11111111;
12059
12060    /// Returns the value of the `TargetList` field.
12061    pub const fn targetlist(self) -> u16 {
12062        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
12063    }
12064
12065    /// Sets the value of the `TargetList` field.
12066    pub const fn set_targetlist(&mut self, value: u16) {
12067        let offset = Self::TARGETLIST_SHIFT;
12068        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
12069        *self = Self::from_bits_retain(
12070            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
12071        );
12072    }
12073
12074    /// Returns a copy with the `TargetList` field set to the given value.
12075    pub const fn with_targetlist(mut self, value: u16) -> Self {
12076        self.set_targetlist(value);
12077        self
12078    }
12079
12080    /// Returns the value of the `Aff1` field.
12081    pub const fn aff1(self) -> u8 {
12082        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
12083    }
12084
12085    /// Sets the value of the `Aff1` field.
12086    pub const fn set_aff1(&mut self, value: u8) {
12087        let offset = Self::AFF1_SHIFT;
12088        assert!(value & (Self::AFF1_MASK as u8) == value);
12089        *self = Self::from_bits_retain(
12090            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
12091        );
12092    }
12093
12094    /// Returns a copy with the `Aff1` field set to the given value.
12095    pub const fn with_aff1(mut self, value: u8) -> Self {
12096        self.set_aff1(value);
12097        self
12098    }
12099
12100    /// Returns the value of the `INTID` field.
12101    pub const fn intid(self) -> u8 {
12102        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
12103    }
12104
12105    /// Sets the value of the `INTID` field.
12106    pub const fn set_intid(&mut self, value: u8) {
12107        let offset = Self::INTID_SHIFT;
12108        assert!(value & (Self::INTID_MASK as u8) == value);
12109        *self = Self::from_bits_retain(
12110            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12111        );
12112    }
12113
12114    /// Returns a copy with the `INTID` field set to the given value.
12115    pub const fn with_intid(mut self, value: u8) -> Self {
12116        self.set_intid(value);
12117        self
12118    }
12119
12120    /// Returns the value of the `Aff2` field.
12121    pub const fn aff2(self) -> u8 {
12122        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
12123    }
12124
12125    /// Sets the value of the `Aff2` field.
12126    pub const fn set_aff2(&mut self, value: u8) {
12127        let offset = Self::AFF2_SHIFT;
12128        assert!(value & (Self::AFF2_MASK as u8) == value);
12129        *self = Self::from_bits_retain(
12130            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
12131        );
12132    }
12133
12134    /// Returns a copy with the `Aff2` field set to the given value.
12135    pub const fn with_aff2(mut self, value: u8) -> Self {
12136        self.set_aff2(value);
12137        self
12138    }
12139
12140    /// Returns the value of the `RS` field.
12141    pub const fn rs(self) -> u8 {
12142        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
12143    }
12144
12145    /// Sets the value of the `RS` field.
12146    pub const fn set_rs(&mut self, value: u8) {
12147        let offset = Self::RS_SHIFT;
12148        assert!(value & (Self::RS_MASK as u8) == value);
12149        *self = Self::from_bits_retain(
12150            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
12151        );
12152    }
12153
12154    /// Returns a copy with the `RS` field set to the given value.
12155    pub const fn with_rs(mut self, value: u8) -> Self {
12156        self.set_rs(value);
12157        self
12158    }
12159
12160    /// Returns the value of the `Aff3` field.
12161    pub const fn aff3(self) -> u8 {
12162        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
12163    }
12164
12165    /// Sets the value of the `Aff3` field.
12166    pub const fn set_aff3(&mut self, value: u8) {
12167        let offset = Self::AFF3_SHIFT;
12168        assert!(value & (Self::AFF3_MASK as u8) == value);
12169        *self = Self::from_bits_retain(
12170            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
12171        );
12172    }
12173
12174    /// Returns a copy with the `Aff3` field set to the given value.
12175    pub const fn with_aff3(mut self, value: u8) -> Self {
12176        self.set_aff3(value);
12177        self
12178    }
12179}
12180
12181#[cfg(feature = "el1")]
12182bitflags! {
12183    /// `ICC_SGI0R_EL1` system register value.
12184    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12185    #[repr(transparent)]
12186    pub struct IccSgi0rEl1: u64 {
12187        /// `IRM` bit.
12188        const IRM = 1 << 40;
12189    }
12190}
12191
12192#[cfg(feature = "el1")]
12193impl IccSgi0rEl1 {
12194    /// Offset of the `TargetList` field.
12195    pub const TARGETLIST_SHIFT: u32 = 0;
12196    /// Mask for the `TargetList` field.
12197    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
12198    /// Offset of the `Aff1` field.
12199    pub const AFF1_SHIFT: u32 = 16;
12200    /// Mask for the `Aff1` field.
12201    pub const AFF1_MASK: u64 = 0b11111111;
12202    /// Offset of the `INTID` field.
12203    pub const INTID_SHIFT: u32 = 24;
12204    /// Mask for the `INTID` field.
12205    pub const INTID_MASK: u64 = 0b1111;
12206    /// Offset of the `Aff2` field.
12207    pub const AFF2_SHIFT: u32 = 32;
12208    /// Mask for the `Aff2` field.
12209    pub const AFF2_MASK: u64 = 0b11111111;
12210    /// Offset of the `IRM` field.
12211    pub const IRM_SHIFT: u32 = 40;
12212    /// Offset of the `RS` field.
12213    pub const RS_SHIFT: u32 = 44;
12214    /// Mask for the `RS` field.
12215    pub const RS_MASK: u64 = 0b1111;
12216    /// Offset of the `Aff3` field.
12217    pub const AFF3_SHIFT: u32 = 48;
12218    /// Mask for the `Aff3` field.
12219    pub const AFF3_MASK: u64 = 0b11111111;
12220
12221    /// Returns the value of the `TargetList` field.
12222    pub const fn targetlist(self) -> u16 {
12223        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
12224    }
12225
12226    /// Sets the value of the `TargetList` field.
12227    pub const fn set_targetlist(&mut self, value: u16) {
12228        let offset = Self::TARGETLIST_SHIFT;
12229        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
12230        *self = Self::from_bits_retain(
12231            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
12232        );
12233    }
12234
12235    /// Returns a copy with the `TargetList` field set to the given value.
12236    pub const fn with_targetlist(mut self, value: u16) -> Self {
12237        self.set_targetlist(value);
12238        self
12239    }
12240
12241    /// Returns the value of the `Aff1` field.
12242    pub const fn aff1(self) -> u8 {
12243        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
12244    }
12245
12246    /// Sets the value of the `Aff1` field.
12247    pub const fn set_aff1(&mut self, value: u8) {
12248        let offset = Self::AFF1_SHIFT;
12249        assert!(value & (Self::AFF1_MASK as u8) == value);
12250        *self = Self::from_bits_retain(
12251            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
12252        );
12253    }
12254
12255    /// Returns a copy with the `Aff1` field set to the given value.
12256    pub const fn with_aff1(mut self, value: u8) -> Self {
12257        self.set_aff1(value);
12258        self
12259    }
12260
12261    /// Returns the value of the `INTID` field.
12262    pub const fn intid(self) -> u8 {
12263        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
12264    }
12265
12266    /// Sets the value of the `INTID` field.
12267    pub const fn set_intid(&mut self, value: u8) {
12268        let offset = Self::INTID_SHIFT;
12269        assert!(value & (Self::INTID_MASK as u8) == value);
12270        *self = Self::from_bits_retain(
12271            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12272        );
12273    }
12274
12275    /// Returns a copy with the `INTID` field set to the given value.
12276    pub const fn with_intid(mut self, value: u8) -> Self {
12277        self.set_intid(value);
12278        self
12279    }
12280
12281    /// Returns the value of the `Aff2` field.
12282    pub const fn aff2(self) -> u8 {
12283        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
12284    }
12285
12286    /// Sets the value of the `Aff2` field.
12287    pub const fn set_aff2(&mut self, value: u8) {
12288        let offset = Self::AFF2_SHIFT;
12289        assert!(value & (Self::AFF2_MASK as u8) == value);
12290        *self = Self::from_bits_retain(
12291            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
12292        );
12293    }
12294
12295    /// Returns a copy with the `Aff2` field set to the given value.
12296    pub const fn with_aff2(mut self, value: u8) -> Self {
12297        self.set_aff2(value);
12298        self
12299    }
12300
12301    /// Returns the value of the `RS` field.
12302    pub const fn rs(self) -> u8 {
12303        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
12304    }
12305
12306    /// Sets the value of the `RS` field.
12307    pub const fn set_rs(&mut self, value: u8) {
12308        let offset = Self::RS_SHIFT;
12309        assert!(value & (Self::RS_MASK as u8) == value);
12310        *self = Self::from_bits_retain(
12311            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
12312        );
12313    }
12314
12315    /// Returns a copy with the `RS` field set to the given value.
12316    pub const fn with_rs(mut self, value: u8) -> Self {
12317        self.set_rs(value);
12318        self
12319    }
12320
12321    /// Returns the value of the `Aff3` field.
12322    pub const fn aff3(self) -> u8 {
12323        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
12324    }
12325
12326    /// Sets the value of the `Aff3` field.
12327    pub const fn set_aff3(&mut self, value: u8) {
12328        let offset = Self::AFF3_SHIFT;
12329        assert!(value & (Self::AFF3_MASK as u8) == value);
12330        *self = Self::from_bits_retain(
12331            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
12332        );
12333    }
12334
12335    /// Returns a copy with the `Aff3` field set to the given value.
12336    pub const fn with_aff3(mut self, value: u8) -> Self {
12337        self.set_aff3(value);
12338        self
12339    }
12340}
12341
12342bitflags! {
12343    /// `ICC_SGI1R` system register value.
12344    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12345    #[repr(transparent)]
12346    pub struct IccSgi1r: u64 {
12347        /// `IRM` bit.
12348        const IRM = 1 << 40;
12349    }
12350}
12351
12352impl IccSgi1r {
12353    /// Offset of the `TargetList` field.
12354    pub const TARGETLIST_SHIFT: u32 = 0;
12355    /// Mask for the `TargetList` field.
12356    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
12357    /// Offset of the `Aff1` field.
12358    pub const AFF1_SHIFT: u32 = 16;
12359    /// Mask for the `Aff1` field.
12360    pub const AFF1_MASK: u64 = 0b11111111;
12361    /// Offset of the `INTID` field.
12362    pub const INTID_SHIFT: u32 = 24;
12363    /// Mask for the `INTID` field.
12364    pub const INTID_MASK: u64 = 0b1111;
12365    /// Offset of the `Aff2` field.
12366    pub const AFF2_SHIFT: u32 = 32;
12367    /// Mask for the `Aff2` field.
12368    pub const AFF2_MASK: u64 = 0b11111111;
12369    /// Offset of the `IRM` field.
12370    pub const IRM_SHIFT: u32 = 40;
12371    /// Offset of the `RS` field.
12372    pub const RS_SHIFT: u32 = 44;
12373    /// Mask for the `RS` field.
12374    pub const RS_MASK: u64 = 0b1111;
12375    /// Offset of the `Aff3` field.
12376    pub const AFF3_SHIFT: u32 = 48;
12377    /// Mask for the `Aff3` field.
12378    pub const AFF3_MASK: u64 = 0b11111111;
12379
12380    /// Returns the value of the `TargetList` field.
12381    pub const fn targetlist(self) -> u16 {
12382        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
12383    }
12384
12385    /// Sets the value of the `TargetList` field.
12386    pub const fn set_targetlist(&mut self, value: u16) {
12387        let offset = Self::TARGETLIST_SHIFT;
12388        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
12389        *self = Self::from_bits_retain(
12390            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
12391        );
12392    }
12393
12394    /// Returns a copy with the `TargetList` field set to the given value.
12395    pub const fn with_targetlist(mut self, value: u16) -> Self {
12396        self.set_targetlist(value);
12397        self
12398    }
12399
12400    /// Returns the value of the `Aff1` field.
12401    pub const fn aff1(self) -> u8 {
12402        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
12403    }
12404
12405    /// Sets the value of the `Aff1` field.
12406    pub const fn set_aff1(&mut self, value: u8) {
12407        let offset = Self::AFF1_SHIFT;
12408        assert!(value & (Self::AFF1_MASK as u8) == value);
12409        *self = Self::from_bits_retain(
12410            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
12411        );
12412    }
12413
12414    /// Returns a copy with the `Aff1` field set to the given value.
12415    pub const fn with_aff1(mut self, value: u8) -> Self {
12416        self.set_aff1(value);
12417        self
12418    }
12419
12420    /// Returns the value of the `INTID` field.
12421    pub const fn intid(self) -> u8 {
12422        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
12423    }
12424
12425    /// Sets the value of the `INTID` field.
12426    pub const fn set_intid(&mut self, value: u8) {
12427        let offset = Self::INTID_SHIFT;
12428        assert!(value & (Self::INTID_MASK as u8) == value);
12429        *self = Self::from_bits_retain(
12430            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12431        );
12432    }
12433
12434    /// Returns a copy with the `INTID` field set to the given value.
12435    pub const fn with_intid(mut self, value: u8) -> Self {
12436        self.set_intid(value);
12437        self
12438    }
12439
12440    /// Returns the value of the `Aff2` field.
12441    pub const fn aff2(self) -> u8 {
12442        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
12443    }
12444
12445    /// Sets the value of the `Aff2` field.
12446    pub const fn set_aff2(&mut self, value: u8) {
12447        let offset = Self::AFF2_SHIFT;
12448        assert!(value & (Self::AFF2_MASK as u8) == value);
12449        *self = Self::from_bits_retain(
12450            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
12451        );
12452    }
12453
12454    /// Returns a copy with the `Aff2` field set to the given value.
12455    pub const fn with_aff2(mut self, value: u8) -> Self {
12456        self.set_aff2(value);
12457        self
12458    }
12459
12460    /// Returns the value of the `RS` field.
12461    pub const fn rs(self) -> u8 {
12462        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
12463    }
12464
12465    /// Sets the value of the `RS` field.
12466    pub const fn set_rs(&mut self, value: u8) {
12467        let offset = Self::RS_SHIFT;
12468        assert!(value & (Self::RS_MASK as u8) == value);
12469        *self = Self::from_bits_retain(
12470            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
12471        );
12472    }
12473
12474    /// Returns a copy with the `RS` field set to the given value.
12475    pub const fn with_rs(mut self, value: u8) -> Self {
12476        self.set_rs(value);
12477        self
12478    }
12479
12480    /// Returns the value of the `Aff3` field.
12481    pub const fn aff3(self) -> u8 {
12482        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
12483    }
12484
12485    /// Sets the value of the `Aff3` field.
12486    pub const fn set_aff3(&mut self, value: u8) {
12487        let offset = Self::AFF3_SHIFT;
12488        assert!(value & (Self::AFF3_MASK as u8) == value);
12489        *self = Self::from_bits_retain(
12490            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
12491        );
12492    }
12493
12494    /// Returns a copy with the `Aff3` field set to the given value.
12495    pub const fn with_aff3(mut self, value: u8) -> Self {
12496        self.set_aff3(value);
12497        self
12498    }
12499}
12500
12501#[cfg(feature = "el1")]
12502bitflags! {
12503    /// `ICC_SGI1R_EL1` system register value.
12504    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12505    #[repr(transparent)]
12506    pub struct IccSgi1rEl1: u64 {
12507        /// `IRM` bit.
12508        const IRM = 1 << 40;
12509    }
12510}
12511
12512#[cfg(feature = "el1")]
12513impl IccSgi1rEl1 {
12514    /// Offset of the `TargetList` field.
12515    pub const TARGETLIST_SHIFT: u32 = 0;
12516    /// Mask for the `TargetList` field.
12517    pub const TARGETLIST_MASK: u64 = 0b1111111111111111;
12518    /// Offset of the `Aff1` field.
12519    pub const AFF1_SHIFT: u32 = 16;
12520    /// Mask for the `Aff1` field.
12521    pub const AFF1_MASK: u64 = 0b11111111;
12522    /// Offset of the `INTID` field.
12523    pub const INTID_SHIFT: u32 = 24;
12524    /// Mask for the `INTID` field.
12525    pub const INTID_MASK: u64 = 0b1111;
12526    /// Offset of the `Aff2` field.
12527    pub const AFF2_SHIFT: u32 = 32;
12528    /// Mask for the `Aff2` field.
12529    pub const AFF2_MASK: u64 = 0b11111111;
12530    /// Offset of the `IRM` field.
12531    pub const IRM_SHIFT: u32 = 40;
12532    /// Offset of the `RS` field.
12533    pub const RS_SHIFT: u32 = 44;
12534    /// Mask for the `RS` field.
12535    pub const RS_MASK: u64 = 0b1111;
12536    /// Offset of the `Aff3` field.
12537    pub const AFF3_SHIFT: u32 = 48;
12538    /// Mask for the `Aff3` field.
12539    pub const AFF3_MASK: u64 = 0b11111111;
12540
12541    /// Returns the value of the `TargetList` field.
12542    pub const fn targetlist(self) -> u16 {
12543        ((self.bits() >> Self::TARGETLIST_SHIFT) & 0b1111111111111111) as u16
12544    }
12545
12546    /// Sets the value of the `TargetList` field.
12547    pub const fn set_targetlist(&mut self, value: u16) {
12548        let offset = Self::TARGETLIST_SHIFT;
12549        assert!(value & (Self::TARGETLIST_MASK as u16) == value);
12550        *self = Self::from_bits_retain(
12551            (self.bits() & !(Self::TARGETLIST_MASK << offset)) | ((value as u64) << offset),
12552        );
12553    }
12554
12555    /// Returns a copy with the `TargetList` field set to the given value.
12556    pub const fn with_targetlist(mut self, value: u16) -> Self {
12557        self.set_targetlist(value);
12558        self
12559    }
12560
12561    /// Returns the value of the `Aff1` field.
12562    pub const fn aff1(self) -> u8 {
12563        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
12564    }
12565
12566    /// Sets the value of the `Aff1` field.
12567    pub const fn set_aff1(&mut self, value: u8) {
12568        let offset = Self::AFF1_SHIFT;
12569        assert!(value & (Self::AFF1_MASK as u8) == value);
12570        *self = Self::from_bits_retain(
12571            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
12572        );
12573    }
12574
12575    /// Returns a copy with the `Aff1` field set to the given value.
12576    pub const fn with_aff1(mut self, value: u8) -> Self {
12577        self.set_aff1(value);
12578        self
12579    }
12580
12581    /// Returns the value of the `INTID` field.
12582    pub const fn intid(self) -> u8 {
12583        ((self.bits() >> Self::INTID_SHIFT) & 0b1111) as u8
12584    }
12585
12586    /// Sets the value of the `INTID` field.
12587    pub const fn set_intid(&mut self, value: u8) {
12588        let offset = Self::INTID_SHIFT;
12589        assert!(value & (Self::INTID_MASK as u8) == value);
12590        *self = Self::from_bits_retain(
12591            (self.bits() & !(Self::INTID_MASK << offset)) | ((value as u64) << offset),
12592        );
12593    }
12594
12595    /// Returns a copy with the `INTID` field set to the given value.
12596    pub const fn with_intid(mut self, value: u8) -> Self {
12597        self.set_intid(value);
12598        self
12599    }
12600
12601    /// Returns the value of the `Aff2` field.
12602    pub const fn aff2(self) -> u8 {
12603        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
12604    }
12605
12606    /// Sets the value of the `Aff2` field.
12607    pub const fn set_aff2(&mut self, value: u8) {
12608        let offset = Self::AFF2_SHIFT;
12609        assert!(value & (Self::AFF2_MASK as u8) == value);
12610        *self = Self::from_bits_retain(
12611            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
12612        );
12613    }
12614
12615    /// Returns a copy with the `Aff2` field set to the given value.
12616    pub const fn with_aff2(mut self, value: u8) -> Self {
12617        self.set_aff2(value);
12618        self
12619    }
12620
12621    /// Returns the value of the `RS` field.
12622    pub const fn rs(self) -> u8 {
12623        ((self.bits() >> Self::RS_SHIFT) & 0b1111) as u8
12624    }
12625
12626    /// Sets the value of the `RS` field.
12627    pub const fn set_rs(&mut self, value: u8) {
12628        let offset = Self::RS_SHIFT;
12629        assert!(value & (Self::RS_MASK as u8) == value);
12630        *self = Self::from_bits_retain(
12631            (self.bits() & !(Self::RS_MASK << offset)) | ((value as u64) << offset),
12632        );
12633    }
12634
12635    /// Returns a copy with the `RS` field set to the given value.
12636    pub const fn with_rs(mut self, value: u8) -> Self {
12637        self.set_rs(value);
12638        self
12639    }
12640
12641    /// Returns the value of the `Aff3` field.
12642    pub const fn aff3(self) -> u8 {
12643        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
12644    }
12645
12646    /// Sets the value of the `Aff3` field.
12647    pub const fn set_aff3(&mut self, value: u8) {
12648        let offset = Self::AFF3_SHIFT;
12649        assert!(value & (Self::AFF3_MASK as u8) == value);
12650        *self = Self::from_bits_retain(
12651            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
12652        );
12653    }
12654
12655    /// Returns a copy with the `Aff3` field set to the given value.
12656    pub const fn with_aff3(mut self, value: u8) -> Self {
12657        self.set_aff3(value);
12658        self
12659    }
12660}
12661
12662bitflags! {
12663    /// `ICC_SRE` system register value.
12664    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12665    #[repr(transparent)]
12666    pub struct IccSre: u32 {
12667        /// `SRE` bit.
12668        const SRE = 1 << 0;
12669        /// `DFB` bit.
12670        const DFB = 1 << 1;
12671        /// `DIB` bit.
12672        const DIB = 1 << 2;
12673    }
12674}
12675
12676impl IccSre {
12677    /// Offset of the `SRE` field.
12678    pub const SRE_SHIFT: u32 = 0;
12679    /// Offset of the `DFB` field.
12680    pub const DFB_SHIFT: u32 = 1;
12681    /// Offset of the `DIB` field.
12682    pub const DIB_SHIFT: u32 = 2;
12683}
12684
12685#[cfg(feature = "el1")]
12686bitflags! {
12687    /// `ICC_SRE_EL1` system register value.
12688    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12689    #[repr(transparent)]
12690    pub struct IccSreEl1: u64 {
12691        /// Enable the system register interface.
12692        const SRE = 1 << 0;
12693        /// Disable FIQ bypass.
12694        const DFB = 1 << 1;
12695        /// Disable IRQ bypass.
12696        const DIB = 1 << 2;
12697    }
12698}
12699
12700#[cfg(feature = "el1")]
12701impl IccSreEl1 {
12702    /// Offset of the `SRE` field.
12703    pub const SRE_SHIFT: u32 = 0;
12704    /// Offset of the `DFB` field.
12705    pub const DFB_SHIFT: u32 = 1;
12706    /// Offset of the `DIB` field.
12707    pub const DIB_SHIFT: u32 = 2;
12708}
12709
12710#[cfg(feature = "el2")]
12711bitflags! {
12712    /// `ICC_SRE_EL2` system register value.
12713    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12714    #[repr(transparent)]
12715    pub struct IccSreEl2: u64 {
12716        /// Enable the system register interface.
12717        const SRE = 1 << 0;
12718        /// Disable FIQ bypass.
12719        const DFB = 1 << 1;
12720        /// Disable IRQ bypass.
12721        const DIB = 1 << 2;
12722        /// Enable lower exception level access.
12723        const ENABLE = 1 << 3;
12724    }
12725}
12726
12727#[cfg(feature = "el2")]
12728impl IccSreEl2 {
12729    /// Offset of the `SRE` field.
12730    pub const SRE_SHIFT: u32 = 0;
12731    /// Offset of the `DFB` field.
12732    pub const DFB_SHIFT: u32 = 1;
12733    /// Offset of the `DIB` field.
12734    pub const DIB_SHIFT: u32 = 2;
12735    /// Offset of the `Enable` field.
12736    pub const ENABLE_SHIFT: u32 = 3;
12737}
12738
12739#[cfg(feature = "el3")]
12740bitflags! {
12741    /// `ICC_SRE_EL3` system register value.
12742    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12743    #[repr(transparent)]
12744    pub struct IccSreEl3: u64 {
12745        /// Enable the system register interface.
12746        const SRE = 1 << 0;
12747        /// Disable FIQ bypass.
12748        const DFB = 1 << 1;
12749        /// Disable IRQ bypass.
12750        const DIB = 1 << 2;
12751        /// Enable lower exception level access.
12752        const ENABLE = 1 << 3;
12753    }
12754}
12755
12756#[cfg(feature = "el3")]
12757impl IccSreEl3 {
12758    /// Offset of the `SRE` field.
12759    pub const SRE_SHIFT: u32 = 0;
12760    /// Offset of the `DFB` field.
12761    pub const DFB_SHIFT: u32 = 1;
12762    /// Offset of the `DIB` field.
12763    pub const DIB_SHIFT: u32 = 2;
12764    /// Offset of the `Enable` field.
12765    pub const ENABLE_SHIFT: u32 = 3;
12766}
12767
12768#[cfg(feature = "el2")]
12769bitflags! {
12770    /// `ICH_HCR_EL2` system register value.
12771    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12772    #[repr(transparent)]
12773    pub struct IchHcrEl2: u64 {
12774        /// `En` bit.
12775        const EN = 1 << 0;
12776        /// `UIE` bit.
12777        const UIE = 1 << 1;
12778        /// `LRENPIE` bit.
12779        const LRENPIE = 1 << 2;
12780        /// `NPIE` bit.
12781        const NPIE = 1 << 3;
12782        /// `VGrp0EIE` bit.
12783        const VGRP0EIE = 1 << 4;
12784        /// `VGrp0DIE` bit.
12785        const VGRP0DIE = 1 << 5;
12786        /// `VGrp1EIE` bit.
12787        const VGRP1EIE = 1 << 6;
12788        /// `VGrp1DIE` bit.
12789        const VGRP1DIE = 1 << 7;
12790        /// `vSGIEOICount` bit.
12791        const VSGIEOICOUNT = 1 << 8;
12792        /// `TC` bit.
12793        const TC = 1 << 10;
12794        /// `TALL0` bit.
12795        const TALL0 = 1 << 11;
12796        /// `TALL1` bit.
12797        const TALL1 = 1 << 12;
12798        /// `TSEI` bit.
12799        const TSEI = 1 << 13;
12800        /// `TDIR` bit.
12801        const TDIR = 1 << 14;
12802        /// `DVIM` bit.
12803        const DVIM = 1 << 15;
12804    }
12805}
12806
12807#[cfg(feature = "el2")]
12808impl IchHcrEl2 {
12809    /// Offset of the `En` field.
12810    pub const EN_SHIFT: u32 = 0;
12811    /// Offset of the `UIE` field.
12812    pub const UIE_SHIFT: u32 = 1;
12813    /// Offset of the `LRENPIE` field.
12814    pub const LRENPIE_SHIFT: u32 = 2;
12815    /// Offset of the `NPIE` field.
12816    pub const NPIE_SHIFT: u32 = 3;
12817    /// Offset of the `VGrp0EIE` field.
12818    pub const VGRP0EIE_SHIFT: u32 = 4;
12819    /// Offset of the `VGrp0DIE` field.
12820    pub const VGRP0DIE_SHIFT: u32 = 5;
12821    /// Offset of the `VGrp1EIE` field.
12822    pub const VGRP1EIE_SHIFT: u32 = 6;
12823    /// Offset of the `VGrp1DIE` field.
12824    pub const VGRP1DIE_SHIFT: u32 = 7;
12825    /// Offset of the `vSGIEOICount` field.
12826    pub const VSGIEOICOUNT_SHIFT: u32 = 8;
12827    /// Offset of the `TC` field.
12828    pub const TC_SHIFT: u32 = 10;
12829    /// Offset of the `TALL0` field.
12830    pub const TALL0_SHIFT: u32 = 11;
12831    /// Offset of the `TALL1` field.
12832    pub const TALL1_SHIFT: u32 = 12;
12833    /// Offset of the `TSEI` field.
12834    pub const TSEI_SHIFT: u32 = 13;
12835    /// Offset of the `TDIR` field.
12836    pub const TDIR_SHIFT: u32 = 14;
12837    /// Offset of the `DVIM` field.
12838    pub const DVIM_SHIFT: u32 = 15;
12839    /// Offset of the `EOIcount` field.
12840    pub const EOICOUNT_SHIFT: u32 = 27;
12841    /// Mask for the `EOIcount` field.
12842    pub const EOICOUNT_MASK: u64 = 0b11111;
12843
12844    /// Returns the value of the `EOIcount` field.
12845    pub const fn eoicount(self) -> u8 {
12846        ((self.bits() >> Self::EOICOUNT_SHIFT) & 0b11111) as u8
12847    }
12848
12849    /// Sets the value of the `EOIcount` field.
12850    pub const fn set_eoicount(&mut self, value: u8) {
12851        let offset = Self::EOICOUNT_SHIFT;
12852        assert!(value & (Self::EOICOUNT_MASK as u8) == value);
12853        *self = Self::from_bits_retain(
12854            (self.bits() & !(Self::EOICOUNT_MASK << offset)) | ((value as u64) << offset),
12855        );
12856    }
12857
12858    /// Returns a copy with the `EOIcount` field set to the given value.
12859    pub const fn with_eoicount(mut self, value: u8) -> Self {
12860        self.set_eoicount(value);
12861        self
12862    }
12863}
12864
12865#[cfg(feature = "el2")]
12866bitflags! {
12867    /// `ICH_VMCR_EL2` system register value.
12868    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12869    #[repr(transparent)]
12870    pub struct IchVmcrEl2: u64 {
12871        /// `EN` bit.
12872        const EN = 1 << 0;
12873        /// `VENG0` bit.
12874        const VENG0 = 1 << 0;
12875        /// `VENG1` bit.
12876        const VENG1 = 1 << 1;
12877        /// `VAckCtl` bit.
12878        const VACKCTL = 1 << 2;
12879        /// `VFIQEn` bit.
12880        const VFIQEN = 1 << 3;
12881        /// `VCBPR` bit.
12882        const VCBPR = 1 << 4;
12883        /// `VEOIM` bit.
12884        const VEOIM = 1 << 9;
12885    }
12886}
12887
12888#[cfg(feature = "el2")]
12889impl IchVmcrEl2 {
12890    /// Offset of the `EN` field.
12891    pub const EN_SHIFT: u32 = 0;
12892    /// Offset of the `VENG0` field.
12893    pub const VENG0_SHIFT: u32 = 0;
12894    /// Offset of the `VENG1` field.
12895    pub const VENG1_SHIFT: u32 = 1;
12896    /// Offset of the `VAckCtl` field.
12897    pub const VACKCTL_SHIFT: u32 = 2;
12898    /// Offset of the `VFIQEn` field.
12899    pub const VFIQEN_SHIFT: u32 = 3;
12900    /// Offset of the `VCBPR` field.
12901    pub const VCBPR_SHIFT: u32 = 4;
12902    /// Offset of the `VEOIM` field.
12903    pub const VEOIM_SHIFT: u32 = 9;
12904    /// Offset of the `VBPR1` field.
12905    pub const VBPR1_SHIFT: u32 = 18;
12906    /// Mask for the `VBPR1` field.
12907    pub const VBPR1_MASK: u64 = 0b111;
12908    /// Offset of the `VBPR0` field.
12909    pub const VBPR0_SHIFT: u32 = 21;
12910    /// Mask for the `VBPR0` field.
12911    pub const VBPR0_MASK: u64 = 0b111;
12912
12913    /// Returns the value of the `VBPR1` field.
12914    pub const fn vbpr1(self) -> u8 {
12915        ((self.bits() >> Self::VBPR1_SHIFT) & 0b111) as u8
12916    }
12917
12918    /// Sets the value of the `VBPR1` field.
12919    pub const fn set_vbpr1(&mut self, value: u8) {
12920        let offset = Self::VBPR1_SHIFT;
12921        assert!(value & (Self::VBPR1_MASK as u8) == value);
12922        *self = Self::from_bits_retain(
12923            (self.bits() & !(Self::VBPR1_MASK << offset)) | ((value as u64) << offset),
12924        );
12925    }
12926
12927    /// Returns a copy with the `VBPR1` field set to the given value.
12928    pub const fn with_vbpr1(mut self, value: u8) -> Self {
12929        self.set_vbpr1(value);
12930        self
12931    }
12932
12933    /// Returns the value of the `VBPR0` field.
12934    pub const fn vbpr0(self) -> u8 {
12935        ((self.bits() >> Self::VBPR0_SHIFT) & 0b111) as u8
12936    }
12937
12938    /// Sets the value of the `VBPR0` field.
12939    pub const fn set_vbpr0(&mut self, value: u8) {
12940        let offset = Self::VBPR0_SHIFT;
12941        assert!(value & (Self::VBPR0_MASK as u8) == value);
12942        *self = Self::from_bits_retain(
12943            (self.bits() & !(Self::VBPR0_MASK << offset)) | ((value as u64) << offset),
12944        );
12945    }
12946
12947    /// Returns a copy with the `VBPR0` field set to the given value.
12948    pub const fn with_vbpr0(mut self, value: u8) -> Self {
12949        self.set_vbpr0(value);
12950        self
12951    }
12952}
12953
12954#[cfg(feature = "el1")]
12955bitflags! {
12956    /// `ID_AA64DFR0_EL1` system register value.
12957    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
12958    #[repr(transparent)]
12959    pub struct IdAa64dfr0El1: u64 {
12960    }
12961}
12962
12963#[cfg(feature = "el1")]
12964impl IdAa64dfr0El1 {
12965    /// Offset of the `DebugVer` field.
12966    pub const DEBUGVER_SHIFT: u32 = 0;
12967    /// Mask for the `DebugVer` field.
12968    pub const DEBUGVER_MASK: u64 = 0b1111;
12969    /// Offset of the `TraceVer` field.
12970    pub const TRACEVER_SHIFT: u32 = 4;
12971    /// Mask for the `TraceVer` field.
12972    pub const TRACEVER_MASK: u64 = 0b1111;
12973    /// Offset of the `PMUVer` field.
12974    pub const PMUVER_SHIFT: u32 = 8;
12975    /// Mask for the `PMUVer` field.
12976    pub const PMUVER_MASK: u64 = 0b1111;
12977    /// Offset of the `BRPs` field.
12978    pub const BRPS_SHIFT: u32 = 12;
12979    /// Mask for the `BRPs` field.
12980    pub const BRPS_MASK: u64 = 0b1111;
12981    /// Offset of the `PMSS` field.
12982    pub const PMSS_SHIFT: u32 = 16;
12983    /// Mask for the `PMSS` field.
12984    pub const PMSS_MASK: u64 = 0b1111;
12985    /// Offset of the `WRPs` field.
12986    pub const WRPS_SHIFT: u32 = 20;
12987    /// Mask for the `WRPs` field.
12988    pub const WRPS_MASK: u64 = 0b1111;
12989    /// Offset of the `SEBEP` field.
12990    pub const SEBEP_SHIFT: u32 = 24;
12991    /// Mask for the `SEBEP` field.
12992    pub const SEBEP_MASK: u64 = 0b1111;
12993    /// Offset of the `CTX_CMPs` field.
12994    pub const CTX_CMPS_SHIFT: u32 = 28;
12995    /// Mask for the `CTX_CMPs` field.
12996    pub const CTX_CMPS_MASK: u64 = 0b1111;
12997    /// Offset of the `PMSVer` field.
12998    pub const PMSVER_SHIFT: u32 = 32;
12999    /// Mask for the `PMSVer` field.
13000    pub const PMSVER_MASK: u64 = 0b1111;
13001    /// Offset of the `DoubleLock` field.
13002    pub const DOUBLELOCK_SHIFT: u32 = 36;
13003    /// Mask for the `DoubleLock` field.
13004    pub const DOUBLELOCK_MASK: u64 = 0b1111;
13005    /// Offset of the `TraceFilt` field.
13006    pub const TRACEFILT_SHIFT: u32 = 40;
13007    /// Mask for the `TraceFilt` field.
13008    pub const TRACEFILT_MASK: u64 = 0b1111;
13009    /// Offset of the `TraceBuffer` field.
13010    pub const TRACEBUFFER_SHIFT: u32 = 44;
13011    /// Mask for the `TraceBuffer` field.
13012    pub const TRACEBUFFER_MASK: u64 = 0b1111;
13013    /// Offset of the `MTPMU` field.
13014    pub const MTPMU_SHIFT: u32 = 48;
13015    /// Mask for the `MTPMU` field.
13016    pub const MTPMU_MASK: u64 = 0b1111;
13017    /// Offset of the `BRBE` field.
13018    pub const BRBE_SHIFT: u32 = 52;
13019    /// Mask for the `BRBE` field.
13020    pub const BRBE_MASK: u64 = 0b1111;
13021    /// Offset of the `ExtTrcBuff` field.
13022    pub const EXTTRCBUFF_SHIFT: u32 = 56;
13023    /// Mask for the `ExtTrcBuff` field.
13024    pub const EXTTRCBUFF_MASK: u64 = 0b1111;
13025    /// Offset of the `HPMN0` field.
13026    pub const HPMN0_SHIFT: u32 = 60;
13027    /// Mask for the `HPMN0` field.
13028    pub const HPMN0_MASK: u64 = 0b1111;
13029
13030    /// Returns the value of the `DebugVer` field.
13031    pub const fn debugver(self) -> u8 {
13032        ((self.bits() >> Self::DEBUGVER_SHIFT) & 0b1111) as u8
13033    }
13034
13035    /// Sets the value of the `DebugVer` field.
13036    pub const fn set_debugver(&mut self, value: u8) {
13037        let offset = Self::DEBUGVER_SHIFT;
13038        assert!(value & (Self::DEBUGVER_MASK as u8) == value);
13039        *self = Self::from_bits_retain(
13040            (self.bits() & !(Self::DEBUGVER_MASK << offset)) | ((value as u64) << offset),
13041        );
13042    }
13043
13044    /// Returns a copy with the `DebugVer` field set to the given value.
13045    pub const fn with_debugver(mut self, value: u8) -> Self {
13046        self.set_debugver(value);
13047        self
13048    }
13049
13050    /// Returns the value of the `TraceVer` field.
13051    pub const fn tracever(self) -> u8 {
13052        ((self.bits() >> Self::TRACEVER_SHIFT) & 0b1111) as u8
13053    }
13054
13055    /// Sets the value of the `TraceVer` field.
13056    pub const fn set_tracever(&mut self, value: u8) {
13057        let offset = Self::TRACEVER_SHIFT;
13058        assert!(value & (Self::TRACEVER_MASK as u8) == value);
13059        *self = Self::from_bits_retain(
13060            (self.bits() & !(Self::TRACEVER_MASK << offset)) | ((value as u64) << offset),
13061        );
13062    }
13063
13064    /// Returns a copy with the `TraceVer` field set to the given value.
13065    pub const fn with_tracever(mut self, value: u8) -> Self {
13066        self.set_tracever(value);
13067        self
13068    }
13069
13070    /// Returns the value of the `PMUVer` field.
13071    pub const fn pmuver(self) -> u8 {
13072        ((self.bits() >> Self::PMUVER_SHIFT) & 0b1111) as u8
13073    }
13074
13075    /// Sets the value of the `PMUVer` field.
13076    pub const fn set_pmuver(&mut self, value: u8) {
13077        let offset = Self::PMUVER_SHIFT;
13078        assert!(value & (Self::PMUVER_MASK as u8) == value);
13079        *self = Self::from_bits_retain(
13080            (self.bits() & !(Self::PMUVER_MASK << offset)) | ((value as u64) << offset),
13081        );
13082    }
13083
13084    /// Returns a copy with the `PMUVer` field set to the given value.
13085    pub const fn with_pmuver(mut self, value: u8) -> Self {
13086        self.set_pmuver(value);
13087        self
13088    }
13089
13090    /// Returns the value of the `BRPs` field.
13091    pub const fn brps(self) -> u8 {
13092        ((self.bits() >> Self::BRPS_SHIFT) & 0b1111) as u8
13093    }
13094
13095    /// Sets the value of the `BRPs` field.
13096    pub const fn set_brps(&mut self, value: u8) {
13097        let offset = Self::BRPS_SHIFT;
13098        assert!(value & (Self::BRPS_MASK as u8) == value);
13099        *self = Self::from_bits_retain(
13100            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u64) << offset),
13101        );
13102    }
13103
13104    /// Returns a copy with the `BRPs` field set to the given value.
13105    pub const fn with_brps(mut self, value: u8) -> Self {
13106        self.set_brps(value);
13107        self
13108    }
13109
13110    /// Returns the value of the `PMSS` field.
13111    pub const fn pmss(self) -> u8 {
13112        ((self.bits() >> Self::PMSS_SHIFT) & 0b1111) as u8
13113    }
13114
13115    /// Sets the value of the `PMSS` field.
13116    pub const fn set_pmss(&mut self, value: u8) {
13117        let offset = Self::PMSS_SHIFT;
13118        assert!(value & (Self::PMSS_MASK as u8) == value);
13119        *self = Self::from_bits_retain(
13120            (self.bits() & !(Self::PMSS_MASK << offset)) | ((value as u64) << offset),
13121        );
13122    }
13123
13124    /// Returns a copy with the `PMSS` field set to the given value.
13125    pub const fn with_pmss(mut self, value: u8) -> Self {
13126        self.set_pmss(value);
13127        self
13128    }
13129
13130    /// Returns the value of the `WRPs` field.
13131    pub const fn wrps(self) -> u8 {
13132        ((self.bits() >> Self::WRPS_SHIFT) & 0b1111) as u8
13133    }
13134
13135    /// Sets the value of the `WRPs` field.
13136    pub const fn set_wrps(&mut self, value: u8) {
13137        let offset = Self::WRPS_SHIFT;
13138        assert!(value & (Self::WRPS_MASK as u8) == value);
13139        *self = Self::from_bits_retain(
13140            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u64) << offset),
13141        );
13142    }
13143
13144    /// Returns a copy with the `WRPs` field set to the given value.
13145    pub const fn with_wrps(mut self, value: u8) -> Self {
13146        self.set_wrps(value);
13147        self
13148    }
13149
13150    /// Returns the value of the `SEBEP` field.
13151    pub const fn sebep(self) -> u8 {
13152        ((self.bits() >> Self::SEBEP_SHIFT) & 0b1111) as u8
13153    }
13154
13155    /// Sets the value of the `SEBEP` field.
13156    pub const fn set_sebep(&mut self, value: u8) {
13157        let offset = Self::SEBEP_SHIFT;
13158        assert!(value & (Self::SEBEP_MASK as u8) == value);
13159        *self = Self::from_bits_retain(
13160            (self.bits() & !(Self::SEBEP_MASK << offset)) | ((value as u64) << offset),
13161        );
13162    }
13163
13164    /// Returns a copy with the `SEBEP` field set to the given value.
13165    pub const fn with_sebep(mut self, value: u8) -> Self {
13166        self.set_sebep(value);
13167        self
13168    }
13169
13170    /// Returns the value of the `CTX_CMPs` field.
13171    pub const fn ctx_cmps(self) -> u8 {
13172        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b1111) as u8
13173    }
13174
13175    /// Sets the value of the `CTX_CMPs` field.
13176    pub const fn set_ctx_cmps(&mut self, value: u8) {
13177        let offset = Self::CTX_CMPS_SHIFT;
13178        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
13179        *self = Self::from_bits_retain(
13180            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u64) << offset),
13181        );
13182    }
13183
13184    /// Returns a copy with the `CTX_CMPs` field set to the given value.
13185    pub const fn with_ctx_cmps(mut self, value: u8) -> Self {
13186        self.set_ctx_cmps(value);
13187        self
13188    }
13189
13190    /// Returns the value of the `PMSVer` field.
13191    pub const fn pmsver(self) -> u8 {
13192        ((self.bits() >> Self::PMSVER_SHIFT) & 0b1111) as u8
13193    }
13194
13195    /// Sets the value of the `PMSVer` field.
13196    pub const fn set_pmsver(&mut self, value: u8) {
13197        let offset = Self::PMSVER_SHIFT;
13198        assert!(value & (Self::PMSVER_MASK as u8) == value);
13199        *self = Self::from_bits_retain(
13200            (self.bits() & !(Self::PMSVER_MASK << offset)) | ((value as u64) << offset),
13201        );
13202    }
13203
13204    /// Returns a copy with the `PMSVer` field set to the given value.
13205    pub const fn with_pmsver(mut self, value: u8) -> Self {
13206        self.set_pmsver(value);
13207        self
13208    }
13209
13210    /// Returns the value of the `DoubleLock` field.
13211    pub const fn doublelock(self) -> u8 {
13212        ((self.bits() >> Self::DOUBLELOCK_SHIFT) & 0b1111) as u8
13213    }
13214
13215    /// Sets the value of the `DoubleLock` field.
13216    pub const fn set_doublelock(&mut self, value: u8) {
13217        let offset = Self::DOUBLELOCK_SHIFT;
13218        assert!(value & (Self::DOUBLELOCK_MASK as u8) == value);
13219        *self = Self::from_bits_retain(
13220            (self.bits() & !(Self::DOUBLELOCK_MASK << offset)) | ((value as u64) << offset),
13221        );
13222    }
13223
13224    /// Returns a copy with the `DoubleLock` field set to the given value.
13225    pub const fn with_doublelock(mut self, value: u8) -> Self {
13226        self.set_doublelock(value);
13227        self
13228    }
13229
13230    /// Returns the value of the `TraceFilt` field.
13231    pub const fn tracefilt(self) -> u8 {
13232        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
13233    }
13234
13235    /// Sets the value of the `TraceFilt` field.
13236    pub const fn set_tracefilt(&mut self, value: u8) {
13237        let offset = Self::TRACEFILT_SHIFT;
13238        assert!(value & (Self::TRACEFILT_MASK as u8) == value);
13239        *self = Self::from_bits_retain(
13240            (self.bits() & !(Self::TRACEFILT_MASK << offset)) | ((value as u64) << offset),
13241        );
13242    }
13243
13244    /// Returns a copy with the `TraceFilt` field set to the given value.
13245    pub const fn with_tracefilt(mut self, value: u8) -> Self {
13246        self.set_tracefilt(value);
13247        self
13248    }
13249
13250    /// Returns the value of the `TraceBuffer` field.
13251    pub const fn tracebuffer(self) -> u8 {
13252        ((self.bits() >> Self::TRACEBUFFER_SHIFT) & 0b1111) as u8
13253    }
13254
13255    /// Sets the value of the `TraceBuffer` field.
13256    pub const fn set_tracebuffer(&mut self, value: u8) {
13257        let offset = Self::TRACEBUFFER_SHIFT;
13258        assert!(value & (Self::TRACEBUFFER_MASK as u8) == value);
13259        *self = Self::from_bits_retain(
13260            (self.bits() & !(Self::TRACEBUFFER_MASK << offset)) | ((value as u64) << offset),
13261        );
13262    }
13263
13264    /// Returns a copy with the `TraceBuffer` field set to the given value.
13265    pub const fn with_tracebuffer(mut self, value: u8) -> Self {
13266        self.set_tracebuffer(value);
13267        self
13268    }
13269
13270    /// Returns the value of the `MTPMU` field.
13271    pub const fn mtpmu(self) -> u8 {
13272        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
13273    }
13274
13275    /// Sets the value of the `MTPMU` field.
13276    pub const fn set_mtpmu(&mut self, value: u8) {
13277        let offset = Self::MTPMU_SHIFT;
13278        assert!(value & (Self::MTPMU_MASK as u8) == value);
13279        *self = Self::from_bits_retain(
13280            (self.bits() & !(Self::MTPMU_MASK << offset)) | ((value as u64) << offset),
13281        );
13282    }
13283
13284    /// Returns a copy with the `MTPMU` field set to the given value.
13285    pub const fn with_mtpmu(mut self, value: u8) -> Self {
13286        self.set_mtpmu(value);
13287        self
13288    }
13289
13290    /// Returns the value of the `BRBE` field.
13291    pub const fn brbe(self) -> u8 {
13292        ((self.bits() >> Self::BRBE_SHIFT) & 0b1111) as u8
13293    }
13294
13295    /// Sets the value of the `BRBE` field.
13296    pub const fn set_brbe(&mut self, value: u8) {
13297        let offset = Self::BRBE_SHIFT;
13298        assert!(value & (Self::BRBE_MASK as u8) == value);
13299        *self = Self::from_bits_retain(
13300            (self.bits() & !(Self::BRBE_MASK << offset)) | ((value as u64) << offset),
13301        );
13302    }
13303
13304    /// Returns a copy with the `BRBE` field set to the given value.
13305    pub const fn with_brbe(mut self, value: u8) -> Self {
13306        self.set_brbe(value);
13307        self
13308    }
13309
13310    /// Returns the value of the `ExtTrcBuff` field.
13311    pub const fn exttrcbuff(self) -> u8 {
13312        ((self.bits() >> Self::EXTTRCBUFF_SHIFT) & 0b1111) as u8
13313    }
13314
13315    /// Sets the value of the `ExtTrcBuff` field.
13316    pub const fn set_exttrcbuff(&mut self, value: u8) {
13317        let offset = Self::EXTTRCBUFF_SHIFT;
13318        assert!(value & (Self::EXTTRCBUFF_MASK as u8) == value);
13319        *self = Self::from_bits_retain(
13320            (self.bits() & !(Self::EXTTRCBUFF_MASK << offset)) | ((value as u64) << offset),
13321        );
13322    }
13323
13324    /// Returns a copy with the `ExtTrcBuff` field set to the given value.
13325    pub const fn with_exttrcbuff(mut self, value: u8) -> Self {
13326        self.set_exttrcbuff(value);
13327        self
13328    }
13329
13330    /// Returns the value of the `HPMN0` field.
13331    pub const fn hpmn0(self) -> u8 {
13332        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
13333    }
13334
13335    /// Sets the value of the `HPMN0` field.
13336    pub const fn set_hpmn0(&mut self, value: u8) {
13337        let offset = Self::HPMN0_SHIFT;
13338        assert!(value & (Self::HPMN0_MASK as u8) == value);
13339        *self = Self::from_bits_retain(
13340            (self.bits() & !(Self::HPMN0_MASK << offset)) | ((value as u64) << offset),
13341        );
13342    }
13343
13344    /// Returns a copy with the `HPMN0` field set to the given value.
13345    pub const fn with_hpmn0(mut self, value: u8) -> Self {
13346        self.set_hpmn0(value);
13347        self
13348    }
13349}
13350
13351#[cfg(feature = "el1")]
13352bitflags! {
13353    /// `ID_AA64DFR1_EL1` system register value.
13354    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13355    #[repr(transparent)]
13356    pub struct IdAa64dfr1El1: u64 {
13357    }
13358}
13359
13360#[cfg(feature = "el1")]
13361impl IdAa64dfr1El1 {
13362    /// Offset of the `SYSPMUID` field.
13363    pub const SYSPMUID_SHIFT: u32 = 0;
13364    /// Mask for the `SYSPMUID` field.
13365    pub const SYSPMUID_MASK: u64 = 0b11111111;
13366    /// Offset of the `BRPs` field.
13367    pub const BRPS_SHIFT: u32 = 8;
13368    /// Mask for the `BRPs` field.
13369    pub const BRPS_MASK: u64 = 0b11111111;
13370    /// Offset of the `WRPs` field.
13371    pub const WRPS_SHIFT: u32 = 16;
13372    /// Mask for the `WRPs` field.
13373    pub const WRPS_MASK: u64 = 0b11111111;
13374    /// Offset of the `CTX_CMPs` field.
13375    pub const CTX_CMPS_SHIFT: u32 = 24;
13376    /// Mask for the `CTX_CMPs` field.
13377    pub const CTX_CMPS_MASK: u64 = 0b11111111;
13378    /// Offset of the `SPMU` field.
13379    pub const SPMU_SHIFT: u32 = 32;
13380    /// Mask for the `SPMU` field.
13381    pub const SPMU_MASK: u64 = 0b1111;
13382    /// Offset of the `PMICNTR` field.
13383    pub const PMICNTR_SHIFT: u32 = 36;
13384    /// Mask for the `PMICNTR` field.
13385    pub const PMICNTR_MASK: u64 = 0b1111;
13386    /// Offset of the `ABLE` field.
13387    pub const ABLE_SHIFT: u32 = 40;
13388    /// Mask for the `ABLE` field.
13389    pub const ABLE_MASK: u64 = 0b1111;
13390    /// Offset of the `ITE` field.
13391    pub const ITE_SHIFT: u32 = 44;
13392    /// Mask for the `ITE` field.
13393    pub const ITE_MASK: u64 = 0b1111;
13394    /// Offset of the `EBEP` field.
13395    pub const EBEP_SHIFT: u32 = 48;
13396    /// Mask for the `EBEP` field.
13397    pub const EBEP_MASK: u64 = 0b1111;
13398    /// Offset of the `DPFZS` field.
13399    pub const DPFZS_SHIFT: u32 = 52;
13400    /// Mask for the `DPFZS` field.
13401    pub const DPFZS_MASK: u64 = 0b1111;
13402    /// Offset of the `ABL_CMPs` field.
13403    pub const ABL_CMPS_SHIFT: u32 = 56;
13404    /// Mask for the `ABL_CMPs` field.
13405    pub const ABL_CMPS_MASK: u64 = 0b11111111;
13406
13407    /// Returns the value of the `SYSPMUID` field.
13408    pub const fn syspmuid(self) -> u8 {
13409        ((self.bits() >> Self::SYSPMUID_SHIFT) & 0b11111111) as u8
13410    }
13411
13412    /// Sets the value of the `SYSPMUID` field.
13413    pub const fn set_syspmuid(&mut self, value: u8) {
13414        let offset = Self::SYSPMUID_SHIFT;
13415        assert!(value & (Self::SYSPMUID_MASK as u8) == value);
13416        *self = Self::from_bits_retain(
13417            (self.bits() & !(Self::SYSPMUID_MASK << offset)) | ((value as u64) << offset),
13418        );
13419    }
13420
13421    /// Returns a copy with the `SYSPMUID` field set to the given value.
13422    pub const fn with_syspmuid(mut self, value: u8) -> Self {
13423        self.set_syspmuid(value);
13424        self
13425    }
13426
13427    /// Returns the value of the `BRPs` field.
13428    pub const fn brps(self) -> u8 {
13429        ((self.bits() >> Self::BRPS_SHIFT) & 0b11111111) as u8
13430    }
13431
13432    /// Sets the value of the `BRPs` field.
13433    pub const fn set_brps(&mut self, value: u8) {
13434        let offset = Self::BRPS_SHIFT;
13435        assert!(value & (Self::BRPS_MASK as u8) == value);
13436        *self = Self::from_bits_retain(
13437            (self.bits() & !(Self::BRPS_MASK << offset)) | ((value as u64) << offset),
13438        );
13439    }
13440
13441    /// Returns a copy with the `BRPs` field set to the given value.
13442    pub const fn with_brps(mut self, value: u8) -> Self {
13443        self.set_brps(value);
13444        self
13445    }
13446
13447    /// Returns the value of the `WRPs` field.
13448    pub const fn wrps(self) -> u8 {
13449        ((self.bits() >> Self::WRPS_SHIFT) & 0b11111111) as u8
13450    }
13451
13452    /// Sets the value of the `WRPs` field.
13453    pub const fn set_wrps(&mut self, value: u8) {
13454        let offset = Self::WRPS_SHIFT;
13455        assert!(value & (Self::WRPS_MASK as u8) == value);
13456        *self = Self::from_bits_retain(
13457            (self.bits() & !(Self::WRPS_MASK << offset)) | ((value as u64) << offset),
13458        );
13459    }
13460
13461    /// Returns a copy with the `WRPs` field set to the given value.
13462    pub const fn with_wrps(mut self, value: u8) -> Self {
13463        self.set_wrps(value);
13464        self
13465    }
13466
13467    /// Returns the value of the `CTX_CMPs` field.
13468    pub const fn ctx_cmps(self) -> u8 {
13469        ((self.bits() >> Self::CTX_CMPS_SHIFT) & 0b11111111) as u8
13470    }
13471
13472    /// Sets the value of the `CTX_CMPs` field.
13473    pub const fn set_ctx_cmps(&mut self, value: u8) {
13474        let offset = Self::CTX_CMPS_SHIFT;
13475        assert!(value & (Self::CTX_CMPS_MASK as u8) == value);
13476        *self = Self::from_bits_retain(
13477            (self.bits() & !(Self::CTX_CMPS_MASK << offset)) | ((value as u64) << offset),
13478        );
13479    }
13480
13481    /// Returns a copy with the `CTX_CMPs` field set to the given value.
13482    pub const fn with_ctx_cmps(mut self, value: u8) -> Self {
13483        self.set_ctx_cmps(value);
13484        self
13485    }
13486
13487    /// Returns the value of the `SPMU` field.
13488    pub const fn spmu(self) -> u8 {
13489        ((self.bits() >> Self::SPMU_SHIFT) & 0b1111) as u8
13490    }
13491
13492    /// Sets the value of the `SPMU` field.
13493    pub const fn set_spmu(&mut self, value: u8) {
13494        let offset = Self::SPMU_SHIFT;
13495        assert!(value & (Self::SPMU_MASK as u8) == value);
13496        *self = Self::from_bits_retain(
13497            (self.bits() & !(Self::SPMU_MASK << offset)) | ((value as u64) << offset),
13498        );
13499    }
13500
13501    /// Returns a copy with the `SPMU` field set to the given value.
13502    pub const fn with_spmu(mut self, value: u8) -> Self {
13503        self.set_spmu(value);
13504        self
13505    }
13506
13507    /// Returns the value of the `PMICNTR` field.
13508    pub const fn pmicntr(self) -> u8 {
13509        ((self.bits() >> Self::PMICNTR_SHIFT) & 0b1111) as u8
13510    }
13511
13512    /// Sets the value of the `PMICNTR` field.
13513    pub const fn set_pmicntr(&mut self, value: u8) {
13514        let offset = Self::PMICNTR_SHIFT;
13515        assert!(value & (Self::PMICNTR_MASK as u8) == value);
13516        *self = Self::from_bits_retain(
13517            (self.bits() & !(Self::PMICNTR_MASK << offset)) | ((value as u64) << offset),
13518        );
13519    }
13520
13521    /// Returns a copy with the `PMICNTR` field set to the given value.
13522    pub const fn with_pmicntr(mut self, value: u8) -> Self {
13523        self.set_pmicntr(value);
13524        self
13525    }
13526
13527    /// Returns the value of the `ABLE` field.
13528    pub const fn able(self) -> u8 {
13529        ((self.bits() >> Self::ABLE_SHIFT) & 0b1111) as u8
13530    }
13531
13532    /// Sets the value of the `ABLE` field.
13533    pub const fn set_able(&mut self, value: u8) {
13534        let offset = Self::ABLE_SHIFT;
13535        assert!(value & (Self::ABLE_MASK as u8) == value);
13536        *self = Self::from_bits_retain(
13537            (self.bits() & !(Self::ABLE_MASK << offset)) | ((value as u64) << offset),
13538        );
13539    }
13540
13541    /// Returns a copy with the `ABLE` field set to the given value.
13542    pub const fn with_able(mut self, value: u8) -> Self {
13543        self.set_able(value);
13544        self
13545    }
13546
13547    /// Returns the value of the `ITE` field.
13548    pub const fn ite(self) -> u8 {
13549        ((self.bits() >> Self::ITE_SHIFT) & 0b1111) as u8
13550    }
13551
13552    /// Sets the value of the `ITE` field.
13553    pub const fn set_ite(&mut self, value: u8) {
13554        let offset = Self::ITE_SHIFT;
13555        assert!(value & (Self::ITE_MASK as u8) == value);
13556        *self = Self::from_bits_retain(
13557            (self.bits() & !(Self::ITE_MASK << offset)) | ((value as u64) << offset),
13558        );
13559    }
13560
13561    /// Returns a copy with the `ITE` field set to the given value.
13562    pub const fn with_ite(mut self, value: u8) -> Self {
13563        self.set_ite(value);
13564        self
13565    }
13566
13567    /// Returns the value of the `EBEP` field.
13568    pub const fn ebep(self) -> u8 {
13569        ((self.bits() >> Self::EBEP_SHIFT) & 0b1111) as u8
13570    }
13571
13572    /// Sets the value of the `EBEP` field.
13573    pub const fn set_ebep(&mut self, value: u8) {
13574        let offset = Self::EBEP_SHIFT;
13575        assert!(value & (Self::EBEP_MASK as u8) == value);
13576        *self = Self::from_bits_retain(
13577            (self.bits() & !(Self::EBEP_MASK << offset)) | ((value as u64) << offset),
13578        );
13579    }
13580
13581    /// Returns a copy with the `EBEP` field set to the given value.
13582    pub const fn with_ebep(mut self, value: u8) -> Self {
13583        self.set_ebep(value);
13584        self
13585    }
13586
13587    /// Returns the value of the `DPFZS` field.
13588    pub const fn dpfzs(self) -> u8 {
13589        ((self.bits() >> Self::DPFZS_SHIFT) & 0b1111) as u8
13590    }
13591
13592    /// Sets the value of the `DPFZS` field.
13593    pub const fn set_dpfzs(&mut self, value: u8) {
13594        let offset = Self::DPFZS_SHIFT;
13595        assert!(value & (Self::DPFZS_MASK as u8) == value);
13596        *self = Self::from_bits_retain(
13597            (self.bits() & !(Self::DPFZS_MASK << offset)) | ((value as u64) << offset),
13598        );
13599    }
13600
13601    /// Returns a copy with the `DPFZS` field set to the given value.
13602    pub const fn with_dpfzs(mut self, value: u8) -> Self {
13603        self.set_dpfzs(value);
13604        self
13605    }
13606
13607    /// Returns the value of the `ABL_CMPs` field.
13608    pub const fn abl_cmps(self) -> u8 {
13609        ((self.bits() >> Self::ABL_CMPS_SHIFT) & 0b11111111) as u8
13610    }
13611
13612    /// Sets the value of the `ABL_CMPs` field.
13613    pub const fn set_abl_cmps(&mut self, value: u8) {
13614        let offset = Self::ABL_CMPS_SHIFT;
13615        assert!(value & (Self::ABL_CMPS_MASK as u8) == value);
13616        *self = Self::from_bits_retain(
13617            (self.bits() & !(Self::ABL_CMPS_MASK << offset)) | ((value as u64) << offset),
13618        );
13619    }
13620
13621    /// Returns a copy with the `ABL_CMPs` field set to the given value.
13622    pub const fn with_abl_cmps(mut self, value: u8) -> Self {
13623        self.set_abl_cmps(value);
13624        self
13625    }
13626}
13627
13628#[cfg(feature = "el1")]
13629bitflags! {
13630    /// `ID_AA64ISAR1_EL1` system register value.
13631    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
13632    #[repr(transparent)]
13633    pub struct IdAa64isar1El1: u64 {
13634    }
13635}
13636
13637#[cfg(feature = "el1")]
13638impl IdAa64isar1El1 {
13639    /// Offset of the `DPB` field.
13640    pub const DPB_SHIFT: u32 = 0;
13641    /// Mask for the `DPB` field.
13642    pub const DPB_MASK: u64 = 0b1111;
13643    /// Offset of the `APA` field.
13644    pub const APA_SHIFT: u32 = 4;
13645    /// Mask for the `APA` field.
13646    pub const APA_MASK: u64 = 0b1111;
13647    /// Offset of the `API` field.
13648    pub const API_SHIFT: u32 = 8;
13649    /// Mask for the `API` field.
13650    pub const API_MASK: u64 = 0b1111;
13651    /// Offset of the `JSCVT` field.
13652    pub const JSCVT_SHIFT: u32 = 12;
13653    /// Mask for the `JSCVT` field.
13654    pub const JSCVT_MASK: u64 = 0b1111;
13655    /// Offset of the `FCMA` field.
13656    pub const FCMA_SHIFT: u32 = 16;
13657    /// Mask for the `FCMA` field.
13658    pub const FCMA_MASK: u64 = 0b1111;
13659    /// Offset of the `LRCPC` field.
13660    pub const LRCPC_SHIFT: u32 = 20;
13661    /// Mask for the `LRCPC` field.
13662    pub const LRCPC_MASK: u64 = 0b1111;
13663    /// Offset of the `GPA` field.
13664    pub const GPA_SHIFT: u32 = 24;
13665    /// Mask for the `GPA` field.
13666    pub const GPA_MASK: u64 = 0b1111;
13667    /// Offset of the `GPI` field.
13668    pub const GPI_SHIFT: u32 = 28;
13669    /// Mask for the `GPI` field.
13670    pub const GPI_MASK: u64 = 0b1111;
13671    /// Offset of the `FRINTTS` field.
13672    pub const FRINTTS_SHIFT: u32 = 32;
13673    /// Mask for the `FRINTTS` field.
13674    pub const FRINTTS_MASK: u64 = 0b1111;
13675    /// Offset of the `SB` field.
13676    pub const SB_SHIFT: u32 = 36;
13677    /// Mask for the `SB` field.
13678    pub const SB_MASK: u64 = 0b1111;
13679    /// Offset of the `SPECRES` field.
13680    pub const SPECRES_SHIFT: u32 = 40;
13681    /// Mask for the `SPECRES` field.
13682    pub const SPECRES_MASK: u64 = 0b1111;
13683    /// Offset of the `BF16` field.
13684    pub const BF16_SHIFT: u32 = 44;
13685    /// Mask for the `BF16` field.
13686    pub const BF16_MASK: u64 = 0b1111;
13687    /// Offset of the `DGH` field.
13688    pub const DGH_SHIFT: u32 = 48;
13689    /// Mask for the `DGH` field.
13690    pub const DGH_MASK: u64 = 0b1111;
13691    /// Offset of the `I8MM` field.
13692    pub const I8MM_SHIFT: u32 = 52;
13693    /// Mask for the `I8MM` field.
13694    pub const I8MM_MASK: u64 = 0b1111;
13695    /// Offset of the `XS` field.
13696    pub const XS_SHIFT: u32 = 56;
13697    /// Mask for the `XS` field.
13698    pub const XS_MASK: u64 = 0b1111;
13699    /// Offset of the `LS64` field.
13700    pub const LS64_SHIFT: u32 = 60;
13701    /// Mask for the `LS64` field.
13702    pub const LS64_MASK: u64 = 0b1111;
13703
13704    /// Returns the value of the `DPB` field.
13705    pub const fn dpb(self) -> u8 {
13706        ((self.bits() >> Self::DPB_SHIFT) & 0b1111) as u8
13707    }
13708
13709    /// Sets the value of the `DPB` field.
13710    pub const fn set_dpb(&mut self, value: u8) {
13711        let offset = Self::DPB_SHIFT;
13712        assert!(value & (Self::DPB_MASK as u8) == value);
13713        *self = Self::from_bits_retain(
13714            (self.bits() & !(Self::DPB_MASK << offset)) | ((value as u64) << offset),
13715        );
13716    }
13717
13718    /// Returns a copy with the `DPB` field set to the given value.
13719    pub const fn with_dpb(mut self, value: u8) -> Self {
13720        self.set_dpb(value);
13721        self
13722    }
13723
13724    /// Returns the value of the `APA` field.
13725    pub const fn apa(self) -> u8 {
13726        ((self.bits() >> Self::APA_SHIFT) & 0b1111) as u8
13727    }
13728
13729    /// Sets the value of the `APA` field.
13730    pub const fn set_apa(&mut self, value: u8) {
13731        let offset = Self::APA_SHIFT;
13732        assert!(value & (Self::APA_MASK as u8) == value);
13733        *self = Self::from_bits_retain(
13734            (self.bits() & !(Self::APA_MASK << offset)) | ((value as u64) << offset),
13735        );
13736    }
13737
13738    /// Returns a copy with the `APA` field set to the given value.
13739    pub const fn with_apa(mut self, value: u8) -> Self {
13740        self.set_apa(value);
13741        self
13742    }
13743
13744    /// Returns the value of the `API` field.
13745    pub const fn api(self) -> u8 {
13746        ((self.bits() >> Self::API_SHIFT) & 0b1111) as u8
13747    }
13748
13749    /// Sets the value of the `API` field.
13750    pub const fn set_api(&mut self, value: u8) {
13751        let offset = Self::API_SHIFT;
13752        assert!(value & (Self::API_MASK as u8) == value);
13753        *self = Self::from_bits_retain(
13754            (self.bits() & !(Self::API_MASK << offset)) | ((value as u64) << offset),
13755        );
13756    }
13757
13758    /// Returns a copy with the `API` field set to the given value.
13759    pub const fn with_api(mut self, value: u8) -> Self {
13760        self.set_api(value);
13761        self
13762    }
13763
13764    /// Returns the value of the `JSCVT` field.
13765    pub const fn jscvt(self) -> u8 {
13766        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
13767    }
13768
13769    /// Sets the value of the `JSCVT` field.
13770    pub const fn set_jscvt(&mut self, value: u8) {
13771        let offset = Self::JSCVT_SHIFT;
13772        assert!(value & (Self::JSCVT_MASK as u8) == value);
13773        *self = Self::from_bits_retain(
13774            (self.bits() & !(Self::JSCVT_MASK << offset)) | ((value as u64) << offset),
13775        );
13776    }
13777
13778    /// Returns a copy with the `JSCVT` field set to the given value.
13779    pub const fn with_jscvt(mut self, value: u8) -> Self {
13780        self.set_jscvt(value);
13781        self
13782    }
13783
13784    /// Returns the value of the `FCMA` field.
13785    pub const fn fcma(self) -> u8 {
13786        ((self.bits() >> Self::FCMA_SHIFT) & 0b1111) as u8
13787    }
13788
13789    /// Sets the value of the `FCMA` field.
13790    pub const fn set_fcma(&mut self, value: u8) {
13791        let offset = Self::FCMA_SHIFT;
13792        assert!(value & (Self::FCMA_MASK as u8) == value);
13793        *self = Self::from_bits_retain(
13794            (self.bits() & !(Self::FCMA_MASK << offset)) | ((value as u64) << offset),
13795        );
13796    }
13797
13798    /// Returns a copy with the `FCMA` field set to the given value.
13799    pub const fn with_fcma(mut self, value: u8) -> Self {
13800        self.set_fcma(value);
13801        self
13802    }
13803
13804    /// Returns the value of the `LRCPC` field.
13805    pub const fn lrcpc(self) -> u8 {
13806        ((self.bits() >> Self::LRCPC_SHIFT) & 0b1111) as u8
13807    }
13808
13809    /// Sets the value of the `LRCPC` field.
13810    pub const fn set_lrcpc(&mut self, value: u8) {
13811        let offset = Self::LRCPC_SHIFT;
13812        assert!(value & (Self::LRCPC_MASK as u8) == value);
13813        *self = Self::from_bits_retain(
13814            (self.bits() & !(Self::LRCPC_MASK << offset)) | ((value as u64) << offset),
13815        );
13816    }
13817
13818    /// Returns a copy with the `LRCPC` field set to the given value.
13819    pub const fn with_lrcpc(mut self, value: u8) -> Self {
13820        self.set_lrcpc(value);
13821        self
13822    }
13823
13824    /// Returns the value of the `GPA` field.
13825    pub const fn gpa(self) -> u8 {
13826        ((self.bits() >> Self::GPA_SHIFT) & 0b1111) as u8
13827    }
13828
13829    /// Sets the value of the `GPA` field.
13830    pub const fn set_gpa(&mut self, value: u8) {
13831        let offset = Self::GPA_SHIFT;
13832        assert!(value & (Self::GPA_MASK as u8) == value);
13833        *self = Self::from_bits_retain(
13834            (self.bits() & !(Self::GPA_MASK << offset)) | ((value as u64) << offset),
13835        );
13836    }
13837
13838    /// Returns a copy with the `GPA` field set to the given value.
13839    pub const fn with_gpa(mut self, value: u8) -> Self {
13840        self.set_gpa(value);
13841        self
13842    }
13843
13844    /// Returns the value of the `GPI` field.
13845    pub const fn gpi(self) -> u8 {
13846        ((self.bits() >> Self::GPI_SHIFT) & 0b1111) as u8
13847    }
13848
13849    /// Sets the value of the `GPI` field.
13850    pub const fn set_gpi(&mut self, value: u8) {
13851        let offset = Self::GPI_SHIFT;
13852        assert!(value & (Self::GPI_MASK as u8) == value);
13853        *self = Self::from_bits_retain(
13854            (self.bits() & !(Self::GPI_MASK << offset)) | ((value as u64) << offset),
13855        );
13856    }
13857
13858    /// Returns a copy with the `GPI` field set to the given value.
13859    pub const fn with_gpi(mut self, value: u8) -> Self {
13860        self.set_gpi(value);
13861        self
13862    }
13863
13864    /// Returns the value of the `FRINTTS` field.
13865    pub const fn frintts(self) -> u8 {
13866        ((self.bits() >> Self::FRINTTS_SHIFT) & 0b1111) as u8
13867    }
13868
13869    /// Sets the value of the `FRINTTS` field.
13870    pub const fn set_frintts(&mut self, value: u8) {
13871        let offset = Self::FRINTTS_SHIFT;
13872        assert!(value & (Self::FRINTTS_MASK as u8) == value);
13873        *self = Self::from_bits_retain(
13874            (self.bits() & !(Self::FRINTTS_MASK << offset)) | ((value as u64) << offset),
13875        );
13876    }
13877
13878    /// Returns a copy with the `FRINTTS` field set to the given value.
13879    pub const fn with_frintts(mut self, value: u8) -> Self {
13880        self.set_frintts(value);
13881        self
13882    }
13883
13884    /// Returns the value of the `SB` field.
13885    pub const fn sb(self) -> u8 {
13886        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
13887    }
13888
13889    /// Sets the value of the `SB` field.
13890    pub const fn set_sb(&mut self, value: u8) {
13891        let offset = Self::SB_SHIFT;
13892        assert!(value & (Self::SB_MASK as u8) == value);
13893        *self = Self::from_bits_retain(
13894            (self.bits() & !(Self::SB_MASK << offset)) | ((value as u64) << offset),
13895        );
13896    }
13897
13898    /// Returns a copy with the `SB` field set to the given value.
13899    pub const fn with_sb(mut self, value: u8) -> Self {
13900        self.set_sb(value);
13901        self
13902    }
13903
13904    /// Returns the value of the `SPECRES` field.
13905    pub const fn specres(self) -> u8 {
13906        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
13907    }
13908
13909    /// Sets the value of the `SPECRES` field.
13910    pub const fn set_specres(&mut self, value: u8) {
13911        let offset = Self::SPECRES_SHIFT;
13912        assert!(value & (Self::SPECRES_MASK as u8) == value);
13913        *self = Self::from_bits_retain(
13914            (self.bits() & !(Self::SPECRES_MASK << offset)) | ((value as u64) << offset),
13915        );
13916    }
13917
13918    /// Returns a copy with the `SPECRES` field set to the given value.
13919    pub const fn with_specres(mut self, value: u8) -> Self {
13920        self.set_specres(value);
13921        self
13922    }
13923
13924    /// Returns the value of the `BF16` field.
13925    pub const fn bf16(self) -> u8 {
13926        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
13927    }
13928
13929    /// Sets the value of the `BF16` field.
13930    pub const fn set_bf16(&mut self, value: u8) {
13931        let offset = Self::BF16_SHIFT;
13932        assert!(value & (Self::BF16_MASK as u8) == value);
13933        *self = Self::from_bits_retain(
13934            (self.bits() & !(Self::BF16_MASK << offset)) | ((value as u64) << offset),
13935        );
13936    }
13937
13938    /// Returns a copy with the `BF16` field set to the given value.
13939    pub const fn with_bf16(mut self, value: u8) -> Self {
13940        self.set_bf16(value);
13941        self
13942    }
13943
13944    /// Returns the value of the `DGH` field.
13945    pub const fn dgh(self) -> u8 {
13946        ((self.bits() >> Self::DGH_SHIFT) & 0b1111) as u8
13947    }
13948
13949    /// Sets the value of the `DGH` field.
13950    pub const fn set_dgh(&mut self, value: u8) {
13951        let offset = Self::DGH_SHIFT;
13952        assert!(value & (Self::DGH_MASK as u8) == value);
13953        *self = Self::from_bits_retain(
13954            (self.bits() & !(Self::DGH_MASK << offset)) | ((value as u64) << offset),
13955        );
13956    }
13957
13958    /// Returns a copy with the `DGH` field set to the given value.
13959    pub const fn with_dgh(mut self, value: u8) -> Self {
13960        self.set_dgh(value);
13961        self
13962    }
13963
13964    /// Returns the value of the `I8MM` field.
13965    pub const fn i8mm(self) -> u8 {
13966        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
13967    }
13968
13969    /// Sets the value of the `I8MM` field.
13970    pub const fn set_i8mm(&mut self, value: u8) {
13971        let offset = Self::I8MM_SHIFT;
13972        assert!(value & (Self::I8MM_MASK as u8) == value);
13973        *self = Self::from_bits_retain(
13974            (self.bits() & !(Self::I8MM_MASK << offset)) | ((value as u64) << offset),
13975        );
13976    }
13977
13978    /// Returns a copy with the `I8MM` field set to the given value.
13979    pub const fn with_i8mm(mut self, value: u8) -> Self {
13980        self.set_i8mm(value);
13981        self
13982    }
13983
13984    /// Returns the value of the `XS` field.
13985    pub const fn xs(self) -> u8 {
13986        ((self.bits() >> Self::XS_SHIFT) & 0b1111) as u8
13987    }
13988
13989    /// Sets the value of the `XS` field.
13990    pub const fn set_xs(&mut self, value: u8) {
13991        let offset = Self::XS_SHIFT;
13992        assert!(value & (Self::XS_MASK as u8) == value);
13993        *self = Self::from_bits_retain(
13994            (self.bits() & !(Self::XS_MASK << offset)) | ((value as u64) << offset),
13995        );
13996    }
13997
13998    /// Returns a copy with the `XS` field set to the given value.
13999    pub const fn with_xs(mut self, value: u8) -> Self {
14000        self.set_xs(value);
14001        self
14002    }
14003
14004    /// Returns the value of the `LS64` field.
14005    pub const fn ls64(self) -> u8 {
14006        ((self.bits() >> Self::LS64_SHIFT) & 0b1111) as u8
14007    }
14008
14009    /// Sets the value of the `LS64` field.
14010    pub const fn set_ls64(&mut self, value: u8) {
14011        let offset = Self::LS64_SHIFT;
14012        assert!(value & (Self::LS64_MASK as u8) == value);
14013        *self = Self::from_bits_retain(
14014            (self.bits() & !(Self::LS64_MASK << offset)) | ((value as u64) << offset),
14015        );
14016    }
14017
14018    /// Returns a copy with the `LS64` field set to the given value.
14019    pub const fn with_ls64(mut self, value: u8) -> Self {
14020        self.set_ls64(value);
14021        self
14022    }
14023}
14024
14025#[cfg(feature = "el1")]
14026bitflags! {
14027    /// `ID_AA64ISAR2_EL1` system register value.
14028    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14029    #[repr(transparent)]
14030    pub struct IdAa64isar2El1: u64 {
14031    }
14032}
14033
14034#[cfg(feature = "el1")]
14035impl IdAa64isar2El1 {
14036    /// Offset of the `WFxT` field.
14037    pub const WFXT_SHIFT: u32 = 0;
14038    /// Mask for the `WFxT` field.
14039    pub const WFXT_MASK: u64 = 0b1111;
14040    /// Offset of the `RPRES` field.
14041    pub const RPRES_SHIFT: u32 = 4;
14042    /// Mask for the `RPRES` field.
14043    pub const RPRES_MASK: u64 = 0b1111;
14044    /// Offset of the `GPA3` field.
14045    pub const GPA3_SHIFT: u32 = 8;
14046    /// Mask for the `GPA3` field.
14047    pub const GPA3_MASK: u64 = 0b1111;
14048    /// Offset of the `APA3` field.
14049    pub const APA3_SHIFT: u32 = 12;
14050    /// Mask for the `APA3` field.
14051    pub const APA3_MASK: u64 = 0b1111;
14052    /// Offset of the `MOPS` field.
14053    pub const MOPS_SHIFT: u32 = 16;
14054    /// Mask for the `MOPS` field.
14055    pub const MOPS_MASK: u64 = 0b1111;
14056    /// Offset of the `BC` field.
14057    pub const BC_SHIFT: u32 = 20;
14058    /// Mask for the `BC` field.
14059    pub const BC_MASK: u64 = 0b1111;
14060    /// Offset of the `PAC_frac` field.
14061    pub const PAC_FRAC_SHIFT: u32 = 24;
14062    /// Mask for the `PAC_frac` field.
14063    pub const PAC_FRAC_MASK: u64 = 0b1111;
14064    /// Offset of the `CLRBHB` field.
14065    pub const CLRBHB_SHIFT: u32 = 28;
14066    /// Mask for the `CLRBHB` field.
14067    pub const CLRBHB_MASK: u64 = 0b1111;
14068    /// Offset of the `SYSREG_128` field.
14069    pub const SYSREG_128_SHIFT: u32 = 32;
14070    /// Mask for the `SYSREG_128` field.
14071    pub const SYSREG_128_MASK: u64 = 0b1111;
14072    /// Offset of the `SYSINSTR_128` field.
14073    pub const SYSINSTR_128_SHIFT: u32 = 36;
14074    /// Mask for the `SYSINSTR_128` field.
14075    pub const SYSINSTR_128_MASK: u64 = 0b1111;
14076    /// Offset of the `PRFMSLC` field.
14077    pub const PRFMSLC_SHIFT: u32 = 40;
14078    /// Mask for the `PRFMSLC` field.
14079    pub const PRFMSLC_MASK: u64 = 0b1111;
14080    /// Offset of the `PCDPHINT` field.
14081    pub const PCDPHINT_SHIFT: u32 = 44;
14082    /// Mask for the `PCDPHINT` field.
14083    pub const PCDPHINT_MASK: u64 = 0b1111;
14084    /// Offset of the `RPRFM` field.
14085    pub const RPRFM_SHIFT: u32 = 48;
14086    /// Mask for the `RPRFM` field.
14087    pub const RPRFM_MASK: u64 = 0b1111;
14088    /// Offset of the `CSSC` field.
14089    pub const CSSC_SHIFT: u32 = 52;
14090    /// Mask for the `CSSC` field.
14091    pub const CSSC_MASK: u64 = 0b1111;
14092    /// Offset of the `LUT` field.
14093    pub const LUT_SHIFT: u32 = 56;
14094    /// Mask for the `LUT` field.
14095    pub const LUT_MASK: u64 = 0b1111;
14096    /// Offset of the `ATS1A` field.
14097    pub const ATS1A_SHIFT: u32 = 60;
14098    /// Mask for the `ATS1A` field.
14099    pub const ATS1A_MASK: u64 = 0b1111;
14100
14101    /// Returns the value of the `WFxT` field.
14102    pub const fn wfxt(self) -> u8 {
14103        ((self.bits() >> Self::WFXT_SHIFT) & 0b1111) as u8
14104    }
14105
14106    /// Sets the value of the `WFxT` field.
14107    pub const fn set_wfxt(&mut self, value: u8) {
14108        let offset = Self::WFXT_SHIFT;
14109        assert!(value & (Self::WFXT_MASK as u8) == value);
14110        *self = Self::from_bits_retain(
14111            (self.bits() & !(Self::WFXT_MASK << offset)) | ((value as u64) << offset),
14112        );
14113    }
14114
14115    /// Returns a copy with the `WFxT` field set to the given value.
14116    pub const fn with_wfxt(mut self, value: u8) -> Self {
14117        self.set_wfxt(value);
14118        self
14119    }
14120
14121    /// Returns the value of the `RPRES` field.
14122    pub const fn rpres(self) -> u8 {
14123        ((self.bits() >> Self::RPRES_SHIFT) & 0b1111) as u8
14124    }
14125
14126    /// Sets the value of the `RPRES` field.
14127    pub const fn set_rpres(&mut self, value: u8) {
14128        let offset = Self::RPRES_SHIFT;
14129        assert!(value & (Self::RPRES_MASK as u8) == value);
14130        *self = Self::from_bits_retain(
14131            (self.bits() & !(Self::RPRES_MASK << offset)) | ((value as u64) << offset),
14132        );
14133    }
14134
14135    /// Returns a copy with the `RPRES` field set to the given value.
14136    pub const fn with_rpres(mut self, value: u8) -> Self {
14137        self.set_rpres(value);
14138        self
14139    }
14140
14141    /// Returns the value of the `GPA3` field.
14142    pub const fn gpa3(self) -> u8 {
14143        ((self.bits() >> Self::GPA3_SHIFT) & 0b1111) as u8
14144    }
14145
14146    /// Sets the value of the `GPA3` field.
14147    pub const fn set_gpa3(&mut self, value: u8) {
14148        let offset = Self::GPA3_SHIFT;
14149        assert!(value & (Self::GPA3_MASK as u8) == value);
14150        *self = Self::from_bits_retain(
14151            (self.bits() & !(Self::GPA3_MASK << offset)) | ((value as u64) << offset),
14152        );
14153    }
14154
14155    /// Returns a copy with the `GPA3` field set to the given value.
14156    pub const fn with_gpa3(mut self, value: u8) -> Self {
14157        self.set_gpa3(value);
14158        self
14159    }
14160
14161    /// Returns the value of the `APA3` field.
14162    pub const fn apa3(self) -> u8 {
14163        ((self.bits() >> Self::APA3_SHIFT) & 0b1111) as u8
14164    }
14165
14166    /// Sets the value of the `APA3` field.
14167    pub const fn set_apa3(&mut self, value: u8) {
14168        let offset = Self::APA3_SHIFT;
14169        assert!(value & (Self::APA3_MASK as u8) == value);
14170        *self = Self::from_bits_retain(
14171            (self.bits() & !(Self::APA3_MASK << offset)) | ((value as u64) << offset),
14172        );
14173    }
14174
14175    /// Returns a copy with the `APA3` field set to the given value.
14176    pub const fn with_apa3(mut self, value: u8) -> Self {
14177        self.set_apa3(value);
14178        self
14179    }
14180
14181    /// Returns the value of the `MOPS` field.
14182    pub const fn mops(self) -> u8 {
14183        ((self.bits() >> Self::MOPS_SHIFT) & 0b1111) as u8
14184    }
14185
14186    /// Sets the value of the `MOPS` field.
14187    pub const fn set_mops(&mut self, value: u8) {
14188        let offset = Self::MOPS_SHIFT;
14189        assert!(value & (Self::MOPS_MASK as u8) == value);
14190        *self = Self::from_bits_retain(
14191            (self.bits() & !(Self::MOPS_MASK << offset)) | ((value as u64) << offset),
14192        );
14193    }
14194
14195    /// Returns a copy with the `MOPS` field set to the given value.
14196    pub const fn with_mops(mut self, value: u8) -> Self {
14197        self.set_mops(value);
14198        self
14199    }
14200
14201    /// Returns the value of the `BC` field.
14202    pub const fn bc(self) -> u8 {
14203        ((self.bits() >> Self::BC_SHIFT) & 0b1111) as u8
14204    }
14205
14206    /// Sets the value of the `BC` field.
14207    pub const fn set_bc(&mut self, value: u8) {
14208        let offset = Self::BC_SHIFT;
14209        assert!(value & (Self::BC_MASK as u8) == value);
14210        *self = Self::from_bits_retain(
14211            (self.bits() & !(Self::BC_MASK << offset)) | ((value as u64) << offset),
14212        );
14213    }
14214
14215    /// Returns a copy with the `BC` field set to the given value.
14216    pub const fn with_bc(mut self, value: u8) -> Self {
14217        self.set_bc(value);
14218        self
14219    }
14220
14221    /// Returns the value of the `PAC_frac` field.
14222    pub const fn pac_frac(self) -> u8 {
14223        ((self.bits() >> Self::PAC_FRAC_SHIFT) & 0b1111) as u8
14224    }
14225
14226    /// Sets the value of the `PAC_frac` field.
14227    pub const fn set_pac_frac(&mut self, value: u8) {
14228        let offset = Self::PAC_FRAC_SHIFT;
14229        assert!(value & (Self::PAC_FRAC_MASK as u8) == value);
14230        *self = Self::from_bits_retain(
14231            (self.bits() & !(Self::PAC_FRAC_MASK << offset)) | ((value as u64) << offset),
14232        );
14233    }
14234
14235    /// Returns a copy with the `PAC_frac` field set to the given value.
14236    pub const fn with_pac_frac(mut self, value: u8) -> Self {
14237        self.set_pac_frac(value);
14238        self
14239    }
14240
14241    /// Returns the value of the `CLRBHB` field.
14242    pub const fn clrbhb(self) -> u8 {
14243        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
14244    }
14245
14246    /// Sets the value of the `CLRBHB` field.
14247    pub const fn set_clrbhb(&mut self, value: u8) {
14248        let offset = Self::CLRBHB_SHIFT;
14249        assert!(value & (Self::CLRBHB_MASK as u8) == value);
14250        *self = Self::from_bits_retain(
14251            (self.bits() & !(Self::CLRBHB_MASK << offset)) | ((value as u64) << offset),
14252        );
14253    }
14254
14255    /// Returns a copy with the `CLRBHB` field set to the given value.
14256    pub const fn with_clrbhb(mut self, value: u8) -> Self {
14257        self.set_clrbhb(value);
14258        self
14259    }
14260
14261    /// Returns the value of the `SYSREG_128` field.
14262    pub const fn sysreg_128(self) -> u8 {
14263        ((self.bits() >> Self::SYSREG_128_SHIFT) & 0b1111) as u8
14264    }
14265
14266    /// Sets the value of the `SYSREG_128` field.
14267    pub const fn set_sysreg_128(&mut self, value: u8) {
14268        let offset = Self::SYSREG_128_SHIFT;
14269        assert!(value & (Self::SYSREG_128_MASK as u8) == value);
14270        *self = Self::from_bits_retain(
14271            (self.bits() & !(Self::SYSREG_128_MASK << offset)) | ((value as u64) << offset),
14272        );
14273    }
14274
14275    /// Returns a copy with the `SYSREG_128` field set to the given value.
14276    pub const fn with_sysreg_128(mut self, value: u8) -> Self {
14277        self.set_sysreg_128(value);
14278        self
14279    }
14280
14281    /// Returns the value of the `SYSINSTR_128` field.
14282    pub const fn sysinstr_128(self) -> u8 {
14283        ((self.bits() >> Self::SYSINSTR_128_SHIFT) & 0b1111) as u8
14284    }
14285
14286    /// Sets the value of the `SYSINSTR_128` field.
14287    pub const fn set_sysinstr_128(&mut self, value: u8) {
14288        let offset = Self::SYSINSTR_128_SHIFT;
14289        assert!(value & (Self::SYSINSTR_128_MASK as u8) == value);
14290        *self = Self::from_bits_retain(
14291            (self.bits() & !(Self::SYSINSTR_128_MASK << offset)) | ((value as u64) << offset),
14292        );
14293    }
14294
14295    /// Returns a copy with the `SYSINSTR_128` field set to the given value.
14296    pub const fn with_sysinstr_128(mut self, value: u8) -> Self {
14297        self.set_sysinstr_128(value);
14298        self
14299    }
14300
14301    /// Returns the value of the `PRFMSLC` field.
14302    pub const fn prfmslc(self) -> u8 {
14303        ((self.bits() >> Self::PRFMSLC_SHIFT) & 0b1111) as u8
14304    }
14305
14306    /// Sets the value of the `PRFMSLC` field.
14307    pub const fn set_prfmslc(&mut self, value: u8) {
14308        let offset = Self::PRFMSLC_SHIFT;
14309        assert!(value & (Self::PRFMSLC_MASK as u8) == value);
14310        *self = Self::from_bits_retain(
14311            (self.bits() & !(Self::PRFMSLC_MASK << offset)) | ((value as u64) << offset),
14312        );
14313    }
14314
14315    /// Returns a copy with the `PRFMSLC` field set to the given value.
14316    pub const fn with_prfmslc(mut self, value: u8) -> Self {
14317        self.set_prfmslc(value);
14318        self
14319    }
14320
14321    /// Returns the value of the `PCDPHINT` field.
14322    pub const fn pcdphint(self) -> u8 {
14323        ((self.bits() >> Self::PCDPHINT_SHIFT) & 0b1111) as u8
14324    }
14325
14326    /// Sets the value of the `PCDPHINT` field.
14327    pub const fn set_pcdphint(&mut self, value: u8) {
14328        let offset = Self::PCDPHINT_SHIFT;
14329        assert!(value & (Self::PCDPHINT_MASK as u8) == value);
14330        *self = Self::from_bits_retain(
14331            (self.bits() & !(Self::PCDPHINT_MASK << offset)) | ((value as u64) << offset),
14332        );
14333    }
14334
14335    /// Returns a copy with the `PCDPHINT` field set to the given value.
14336    pub const fn with_pcdphint(mut self, value: u8) -> Self {
14337        self.set_pcdphint(value);
14338        self
14339    }
14340
14341    /// Returns the value of the `RPRFM` field.
14342    pub const fn rprfm(self) -> u8 {
14343        ((self.bits() >> Self::RPRFM_SHIFT) & 0b1111) as u8
14344    }
14345
14346    /// Sets the value of the `RPRFM` field.
14347    pub const fn set_rprfm(&mut self, value: u8) {
14348        let offset = Self::RPRFM_SHIFT;
14349        assert!(value & (Self::RPRFM_MASK as u8) == value);
14350        *self = Self::from_bits_retain(
14351            (self.bits() & !(Self::RPRFM_MASK << offset)) | ((value as u64) << offset),
14352        );
14353    }
14354
14355    /// Returns a copy with the `RPRFM` field set to the given value.
14356    pub const fn with_rprfm(mut self, value: u8) -> Self {
14357        self.set_rprfm(value);
14358        self
14359    }
14360
14361    /// Returns the value of the `CSSC` field.
14362    pub const fn cssc(self) -> u8 {
14363        ((self.bits() >> Self::CSSC_SHIFT) & 0b1111) as u8
14364    }
14365
14366    /// Sets the value of the `CSSC` field.
14367    pub const fn set_cssc(&mut self, value: u8) {
14368        let offset = Self::CSSC_SHIFT;
14369        assert!(value & (Self::CSSC_MASK as u8) == value);
14370        *self = Self::from_bits_retain(
14371            (self.bits() & !(Self::CSSC_MASK << offset)) | ((value as u64) << offset),
14372        );
14373    }
14374
14375    /// Returns a copy with the `CSSC` field set to the given value.
14376    pub const fn with_cssc(mut self, value: u8) -> Self {
14377        self.set_cssc(value);
14378        self
14379    }
14380
14381    /// Returns the value of the `LUT` field.
14382    pub const fn lut(self) -> u8 {
14383        ((self.bits() >> Self::LUT_SHIFT) & 0b1111) as u8
14384    }
14385
14386    /// Sets the value of the `LUT` field.
14387    pub const fn set_lut(&mut self, value: u8) {
14388        let offset = Self::LUT_SHIFT;
14389        assert!(value & (Self::LUT_MASK as u8) == value);
14390        *self = Self::from_bits_retain(
14391            (self.bits() & !(Self::LUT_MASK << offset)) | ((value as u64) << offset),
14392        );
14393    }
14394
14395    /// Returns a copy with the `LUT` field set to the given value.
14396    pub const fn with_lut(mut self, value: u8) -> Self {
14397        self.set_lut(value);
14398        self
14399    }
14400
14401    /// Returns the value of the `ATS1A` field.
14402    pub const fn ats1a(self) -> u8 {
14403        ((self.bits() >> Self::ATS1A_SHIFT) & 0b1111) as u8
14404    }
14405
14406    /// Sets the value of the `ATS1A` field.
14407    pub const fn set_ats1a(&mut self, value: u8) {
14408        let offset = Self::ATS1A_SHIFT;
14409        assert!(value & (Self::ATS1A_MASK as u8) == value);
14410        *self = Self::from_bits_retain(
14411            (self.bits() & !(Self::ATS1A_MASK << offset)) | ((value as u64) << offset),
14412        );
14413    }
14414
14415    /// Returns a copy with the `ATS1A` field set to the given value.
14416    pub const fn with_ats1a(mut self, value: u8) -> Self {
14417        self.set_ats1a(value);
14418        self
14419    }
14420}
14421
14422#[cfg(feature = "el1")]
14423bitflags! {
14424    /// `ID_AA64MMFR0_EL1` system register value.
14425    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14426    #[repr(transparent)]
14427    pub struct IdAa64mmfr0El1: u64 {
14428    }
14429}
14430
14431#[cfg(feature = "el1")]
14432impl IdAa64mmfr0El1 {
14433    /// Offset of the `PARange` field.
14434    pub const PARANGE_SHIFT: u32 = 0;
14435    /// Mask for the `PARange` field.
14436    pub const PARANGE_MASK: u64 = 0b1111;
14437    /// Offset of the `ASIDBits` field.
14438    pub const ASIDBITS_SHIFT: u32 = 4;
14439    /// Mask for the `ASIDBits` field.
14440    pub const ASIDBITS_MASK: u64 = 0b1111;
14441    /// Offset of the `BigEnd` field.
14442    pub const BIGEND_SHIFT: u32 = 8;
14443    /// Mask for the `BigEnd` field.
14444    pub const BIGEND_MASK: u64 = 0b1111;
14445    /// Offset of the `SNSMem` field.
14446    pub const SNSMEM_SHIFT: u32 = 12;
14447    /// Mask for the `SNSMem` field.
14448    pub const SNSMEM_MASK: u64 = 0b1111;
14449    /// Offset of the `BigEndEL0` field.
14450    pub const BIGENDEL0_SHIFT: u32 = 16;
14451    /// Mask for the `BigEndEL0` field.
14452    pub const BIGENDEL0_MASK: u64 = 0b1111;
14453    /// Offset of the `TGran16` field.
14454    pub const TGRAN16_SHIFT: u32 = 20;
14455    /// Mask for the `TGran16` field.
14456    pub const TGRAN16_MASK: u64 = 0b1111;
14457    /// Offset of the `TGran64` field.
14458    pub const TGRAN64_SHIFT: u32 = 24;
14459    /// Mask for the `TGran64` field.
14460    pub const TGRAN64_MASK: u64 = 0b1111;
14461    /// Offset of the `TGran4` field.
14462    pub const TGRAN4_SHIFT: u32 = 28;
14463    /// Mask for the `TGran4` field.
14464    pub const TGRAN4_MASK: u64 = 0b1111;
14465    /// Offset of the `TGran16_2` field.
14466    pub const TGRAN16_2_SHIFT: u32 = 32;
14467    /// Mask for the `TGran16_2` field.
14468    pub const TGRAN16_2_MASK: u64 = 0b1111;
14469    /// Offset of the `TGran64_2` field.
14470    pub const TGRAN64_2_SHIFT: u32 = 36;
14471    /// Mask for the `TGran64_2` field.
14472    pub const TGRAN64_2_MASK: u64 = 0b1111;
14473    /// Offset of the `TGran4_2` field.
14474    pub const TGRAN4_2_SHIFT: u32 = 40;
14475    /// Mask for the `TGran4_2` field.
14476    pub const TGRAN4_2_MASK: u64 = 0b1111;
14477    /// Offset of the `ExS` field.
14478    pub const EXS_SHIFT: u32 = 44;
14479    /// Mask for the `ExS` field.
14480    pub const EXS_MASK: u64 = 0b1111;
14481    /// Offset of the `FGT` field.
14482    pub const FGT_SHIFT: u32 = 56;
14483    /// Mask for the `FGT` field.
14484    pub const FGT_MASK: u64 = 0b1111;
14485    /// Offset of the `ECV` field.
14486    pub const ECV_SHIFT: u32 = 60;
14487    /// Mask for the `ECV` field.
14488    pub const ECV_MASK: u64 = 0b1111;
14489
14490    /// Returns the value of the `PARange` field.
14491    pub const fn parange(self) -> u8 {
14492        ((self.bits() >> Self::PARANGE_SHIFT) & 0b1111) as u8
14493    }
14494
14495    /// Sets the value of the `PARange` field.
14496    pub const fn set_parange(&mut self, value: u8) {
14497        let offset = Self::PARANGE_SHIFT;
14498        assert!(value & (Self::PARANGE_MASK as u8) == value);
14499        *self = Self::from_bits_retain(
14500            (self.bits() & !(Self::PARANGE_MASK << offset)) | ((value as u64) << offset),
14501        );
14502    }
14503
14504    /// Returns a copy with the `PARange` field set to the given value.
14505    pub const fn with_parange(mut self, value: u8) -> Self {
14506        self.set_parange(value);
14507        self
14508    }
14509
14510    /// Returns the value of the `ASIDBits` field.
14511    pub const fn asidbits(self) -> u8 {
14512        ((self.bits() >> Self::ASIDBITS_SHIFT) & 0b1111) as u8
14513    }
14514
14515    /// Sets the value of the `ASIDBits` field.
14516    pub const fn set_asidbits(&mut self, value: u8) {
14517        let offset = Self::ASIDBITS_SHIFT;
14518        assert!(value & (Self::ASIDBITS_MASK as u8) == value);
14519        *self = Self::from_bits_retain(
14520            (self.bits() & !(Self::ASIDBITS_MASK << offset)) | ((value as u64) << offset),
14521        );
14522    }
14523
14524    /// Returns a copy with the `ASIDBits` field set to the given value.
14525    pub const fn with_asidbits(mut self, value: u8) -> Self {
14526        self.set_asidbits(value);
14527        self
14528    }
14529
14530    /// Returns the value of the `BigEnd` field.
14531    pub const fn bigend(self) -> u8 {
14532        ((self.bits() >> Self::BIGEND_SHIFT) & 0b1111) as u8
14533    }
14534
14535    /// Sets the value of the `BigEnd` field.
14536    pub const fn set_bigend(&mut self, value: u8) {
14537        let offset = Self::BIGEND_SHIFT;
14538        assert!(value & (Self::BIGEND_MASK as u8) == value);
14539        *self = Self::from_bits_retain(
14540            (self.bits() & !(Self::BIGEND_MASK << offset)) | ((value as u64) << offset),
14541        );
14542    }
14543
14544    /// Returns a copy with the `BigEnd` field set to the given value.
14545    pub const fn with_bigend(mut self, value: u8) -> Self {
14546        self.set_bigend(value);
14547        self
14548    }
14549
14550    /// Returns the value of the `SNSMem` field.
14551    pub const fn snsmem(self) -> u8 {
14552        ((self.bits() >> Self::SNSMEM_SHIFT) & 0b1111) as u8
14553    }
14554
14555    /// Sets the value of the `SNSMem` field.
14556    pub const fn set_snsmem(&mut self, value: u8) {
14557        let offset = Self::SNSMEM_SHIFT;
14558        assert!(value & (Self::SNSMEM_MASK as u8) == value);
14559        *self = Self::from_bits_retain(
14560            (self.bits() & !(Self::SNSMEM_MASK << offset)) | ((value as u64) << offset),
14561        );
14562    }
14563
14564    /// Returns a copy with the `SNSMem` field set to the given value.
14565    pub const fn with_snsmem(mut self, value: u8) -> Self {
14566        self.set_snsmem(value);
14567        self
14568    }
14569
14570    /// Returns the value of the `BigEndEL0` field.
14571    pub const fn bigendel0(self) -> u8 {
14572        ((self.bits() >> Self::BIGENDEL0_SHIFT) & 0b1111) as u8
14573    }
14574
14575    /// Sets the value of the `BigEndEL0` field.
14576    pub const fn set_bigendel0(&mut self, value: u8) {
14577        let offset = Self::BIGENDEL0_SHIFT;
14578        assert!(value & (Self::BIGENDEL0_MASK as u8) == value);
14579        *self = Self::from_bits_retain(
14580            (self.bits() & !(Self::BIGENDEL0_MASK << offset)) | ((value as u64) << offset),
14581        );
14582    }
14583
14584    /// Returns a copy with the `BigEndEL0` field set to the given value.
14585    pub const fn with_bigendel0(mut self, value: u8) -> Self {
14586        self.set_bigendel0(value);
14587        self
14588    }
14589
14590    /// Returns the value of the `TGran16` field.
14591    pub const fn tgran16(self) -> u8 {
14592        ((self.bits() >> Self::TGRAN16_SHIFT) & 0b1111) as u8
14593    }
14594
14595    /// Sets the value of the `TGran16` field.
14596    pub const fn set_tgran16(&mut self, value: u8) {
14597        let offset = Self::TGRAN16_SHIFT;
14598        assert!(value & (Self::TGRAN16_MASK as u8) == value);
14599        *self = Self::from_bits_retain(
14600            (self.bits() & !(Self::TGRAN16_MASK << offset)) | ((value as u64) << offset),
14601        );
14602    }
14603
14604    /// Returns a copy with the `TGran16` field set to the given value.
14605    pub const fn with_tgran16(mut self, value: u8) -> Self {
14606        self.set_tgran16(value);
14607        self
14608    }
14609
14610    /// Returns the value of the `TGran64` field.
14611    pub const fn tgran64(self) -> u8 {
14612        ((self.bits() >> Self::TGRAN64_SHIFT) & 0b1111) as u8
14613    }
14614
14615    /// Sets the value of the `TGran64` field.
14616    pub const fn set_tgran64(&mut self, value: u8) {
14617        let offset = Self::TGRAN64_SHIFT;
14618        assert!(value & (Self::TGRAN64_MASK as u8) == value);
14619        *self = Self::from_bits_retain(
14620            (self.bits() & !(Self::TGRAN64_MASK << offset)) | ((value as u64) << offset),
14621        );
14622    }
14623
14624    /// Returns a copy with the `TGran64` field set to the given value.
14625    pub const fn with_tgran64(mut self, value: u8) -> Self {
14626        self.set_tgran64(value);
14627        self
14628    }
14629
14630    /// Returns the value of the `TGran4` field.
14631    pub const fn tgran4(self) -> u8 {
14632        ((self.bits() >> Self::TGRAN4_SHIFT) & 0b1111) as u8
14633    }
14634
14635    /// Sets the value of the `TGran4` field.
14636    pub const fn set_tgran4(&mut self, value: u8) {
14637        let offset = Self::TGRAN4_SHIFT;
14638        assert!(value & (Self::TGRAN4_MASK as u8) == value);
14639        *self = Self::from_bits_retain(
14640            (self.bits() & !(Self::TGRAN4_MASK << offset)) | ((value as u64) << offset),
14641        );
14642    }
14643
14644    /// Returns a copy with the `TGran4` field set to the given value.
14645    pub const fn with_tgran4(mut self, value: u8) -> Self {
14646        self.set_tgran4(value);
14647        self
14648    }
14649
14650    /// Returns the value of the `TGran16_2` field.
14651    pub const fn tgran16_2(self) -> u8 {
14652        ((self.bits() >> Self::TGRAN16_2_SHIFT) & 0b1111) as u8
14653    }
14654
14655    /// Sets the value of the `TGran16_2` field.
14656    pub const fn set_tgran16_2(&mut self, value: u8) {
14657        let offset = Self::TGRAN16_2_SHIFT;
14658        assert!(value & (Self::TGRAN16_2_MASK as u8) == value);
14659        *self = Self::from_bits_retain(
14660            (self.bits() & !(Self::TGRAN16_2_MASK << offset)) | ((value as u64) << offset),
14661        );
14662    }
14663
14664    /// Returns a copy with the `TGran16_2` field set to the given value.
14665    pub const fn with_tgran16_2(mut self, value: u8) -> Self {
14666        self.set_tgran16_2(value);
14667        self
14668    }
14669
14670    /// Returns the value of the `TGran64_2` field.
14671    pub const fn tgran64_2(self) -> u8 {
14672        ((self.bits() >> Self::TGRAN64_2_SHIFT) & 0b1111) as u8
14673    }
14674
14675    /// Sets the value of the `TGran64_2` field.
14676    pub const fn set_tgran64_2(&mut self, value: u8) {
14677        let offset = Self::TGRAN64_2_SHIFT;
14678        assert!(value & (Self::TGRAN64_2_MASK as u8) == value);
14679        *self = Self::from_bits_retain(
14680            (self.bits() & !(Self::TGRAN64_2_MASK << offset)) | ((value as u64) << offset),
14681        );
14682    }
14683
14684    /// Returns a copy with the `TGran64_2` field set to the given value.
14685    pub const fn with_tgran64_2(mut self, value: u8) -> Self {
14686        self.set_tgran64_2(value);
14687        self
14688    }
14689
14690    /// Returns the value of the `TGran4_2` field.
14691    pub const fn tgran4_2(self) -> u8 {
14692        ((self.bits() >> Self::TGRAN4_2_SHIFT) & 0b1111) as u8
14693    }
14694
14695    /// Sets the value of the `TGran4_2` field.
14696    pub const fn set_tgran4_2(&mut self, value: u8) {
14697        let offset = Self::TGRAN4_2_SHIFT;
14698        assert!(value & (Self::TGRAN4_2_MASK as u8) == value);
14699        *self = Self::from_bits_retain(
14700            (self.bits() & !(Self::TGRAN4_2_MASK << offset)) | ((value as u64) << offset),
14701        );
14702    }
14703
14704    /// Returns a copy with the `TGran4_2` field set to the given value.
14705    pub const fn with_tgran4_2(mut self, value: u8) -> Self {
14706        self.set_tgran4_2(value);
14707        self
14708    }
14709
14710    /// Returns the value of the `ExS` field.
14711    pub const fn exs(self) -> u8 {
14712        ((self.bits() >> Self::EXS_SHIFT) & 0b1111) as u8
14713    }
14714
14715    /// Sets the value of the `ExS` field.
14716    pub const fn set_exs(&mut self, value: u8) {
14717        let offset = Self::EXS_SHIFT;
14718        assert!(value & (Self::EXS_MASK as u8) == value);
14719        *self = Self::from_bits_retain(
14720            (self.bits() & !(Self::EXS_MASK << offset)) | ((value as u64) << offset),
14721        );
14722    }
14723
14724    /// Returns a copy with the `ExS` field set to the given value.
14725    pub const fn with_exs(mut self, value: u8) -> Self {
14726        self.set_exs(value);
14727        self
14728    }
14729
14730    /// Returns the value of the `FGT` field.
14731    pub const fn fgt(self) -> u8 {
14732        ((self.bits() >> Self::FGT_SHIFT) & 0b1111) as u8
14733    }
14734
14735    /// Sets the value of the `FGT` field.
14736    pub const fn set_fgt(&mut self, value: u8) {
14737        let offset = Self::FGT_SHIFT;
14738        assert!(value & (Self::FGT_MASK as u8) == value);
14739        *self = Self::from_bits_retain(
14740            (self.bits() & !(Self::FGT_MASK << offset)) | ((value as u64) << offset),
14741        );
14742    }
14743
14744    /// Returns a copy with the `FGT` field set to the given value.
14745    pub const fn with_fgt(mut self, value: u8) -> Self {
14746        self.set_fgt(value);
14747        self
14748    }
14749
14750    /// Returns the value of the `ECV` field.
14751    pub const fn ecv(self) -> u8 {
14752        ((self.bits() >> Self::ECV_SHIFT) & 0b1111) as u8
14753    }
14754
14755    /// Sets the value of the `ECV` field.
14756    pub const fn set_ecv(&mut self, value: u8) {
14757        let offset = Self::ECV_SHIFT;
14758        assert!(value & (Self::ECV_MASK as u8) == value);
14759        *self = Self::from_bits_retain(
14760            (self.bits() & !(Self::ECV_MASK << offset)) | ((value as u64) << offset),
14761        );
14762    }
14763
14764    /// Returns a copy with the `ECV` field set to the given value.
14765    pub const fn with_ecv(mut self, value: u8) -> Self {
14766        self.set_ecv(value);
14767        self
14768    }
14769}
14770
14771#[cfg(feature = "el1")]
14772bitflags! {
14773    /// `ID_AA64MMFR1_EL1` system register value.
14774    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
14775    #[repr(transparent)]
14776    pub struct IdAa64mmfr1El1: u64 {
14777    }
14778}
14779
14780#[cfg(feature = "el1")]
14781impl IdAa64mmfr1El1 {
14782    /// Offset of the `HAFDBS` field.
14783    pub const HAFDBS_SHIFT: u32 = 0;
14784    /// Mask for the `HAFDBS` field.
14785    pub const HAFDBS_MASK: u64 = 0b1111;
14786    /// Offset of the `VMIDBits` field.
14787    pub const VMIDBITS_SHIFT: u32 = 4;
14788    /// Mask for the `VMIDBits` field.
14789    pub const VMIDBITS_MASK: u64 = 0b1111;
14790    /// Offset of the `VH` field.
14791    pub const VH_SHIFT: u32 = 8;
14792    /// Mask for the `VH` field.
14793    pub const VH_MASK: u64 = 0b1111;
14794    /// Offset of the `HPDS` field.
14795    pub const HPDS_SHIFT: u32 = 12;
14796    /// Mask for the `HPDS` field.
14797    pub const HPDS_MASK: u64 = 0b1111;
14798    /// Offset of the `LO` field.
14799    pub const LO_SHIFT: u32 = 16;
14800    /// Mask for the `LO` field.
14801    pub const LO_MASK: u64 = 0b1111;
14802    /// Offset of the `PAN` field.
14803    pub const PAN_SHIFT: u32 = 20;
14804    /// Mask for the `PAN` field.
14805    pub const PAN_MASK: u64 = 0b1111;
14806    /// Offset of the `SpecSEI` field.
14807    pub const SPECSEI_SHIFT: u32 = 24;
14808    /// Mask for the `SpecSEI` field.
14809    pub const SPECSEI_MASK: u64 = 0b1111;
14810    /// Offset of the `XNX` field.
14811    pub const XNX_SHIFT: u32 = 28;
14812    /// Mask for the `XNX` field.
14813    pub const XNX_MASK: u64 = 0b1111;
14814    /// Offset of the `TWED` field.
14815    pub const TWED_SHIFT: u32 = 32;
14816    /// Mask for the `TWED` field.
14817    pub const TWED_MASK: u64 = 0b1111;
14818    /// Offset of the `ETS` field.
14819    pub const ETS_SHIFT: u32 = 36;
14820    /// Mask for the `ETS` field.
14821    pub const ETS_MASK: u64 = 0b1111;
14822    /// Offset of the `HCX` field.
14823    pub const HCX_SHIFT: u32 = 40;
14824    /// Mask for the `HCX` field.
14825    pub const HCX_MASK: u64 = 0b1111;
14826    /// Offset of the `AFP` field.
14827    pub const AFP_SHIFT: u32 = 44;
14828    /// Mask for the `AFP` field.
14829    pub const AFP_MASK: u64 = 0b1111;
14830    /// Offset of the `nTLBPA` field.
14831    pub const NTLBPA_SHIFT: u32 = 48;
14832    /// Mask for the `nTLBPA` field.
14833    pub const NTLBPA_MASK: u64 = 0b1111;
14834    /// Offset of the `TIDCP1` field.
14835    pub const TIDCP1_SHIFT: u32 = 52;
14836    /// Mask for the `TIDCP1` field.
14837    pub const TIDCP1_MASK: u64 = 0b1111;
14838    /// Offset of the `CMOW` field.
14839    pub const CMOW_SHIFT: u32 = 56;
14840    /// Mask for the `CMOW` field.
14841    pub const CMOW_MASK: u64 = 0b1111;
14842    /// Offset of the `ECBHB` field.
14843    pub const ECBHB_SHIFT: u32 = 60;
14844    /// Mask for the `ECBHB` field.
14845    pub const ECBHB_MASK: u64 = 0b1111;
14846
14847    /// Returns the value of the `HAFDBS` field.
14848    pub const fn hafdbs(self) -> u8 {
14849        ((self.bits() >> Self::HAFDBS_SHIFT) & 0b1111) as u8
14850    }
14851
14852    /// Sets the value of the `HAFDBS` field.
14853    pub const fn set_hafdbs(&mut self, value: u8) {
14854        let offset = Self::HAFDBS_SHIFT;
14855        assert!(value & (Self::HAFDBS_MASK as u8) == value);
14856        *self = Self::from_bits_retain(
14857            (self.bits() & !(Self::HAFDBS_MASK << offset)) | ((value as u64) << offset),
14858        );
14859    }
14860
14861    /// Returns a copy with the `HAFDBS` field set to the given value.
14862    pub const fn with_hafdbs(mut self, value: u8) -> Self {
14863        self.set_hafdbs(value);
14864        self
14865    }
14866
14867    /// Returns the value of the `VMIDBits` field.
14868    pub const fn vmidbits(self) -> u8 {
14869        ((self.bits() >> Self::VMIDBITS_SHIFT) & 0b1111) as u8
14870    }
14871
14872    /// Sets the value of the `VMIDBits` field.
14873    pub const fn set_vmidbits(&mut self, value: u8) {
14874        let offset = Self::VMIDBITS_SHIFT;
14875        assert!(value & (Self::VMIDBITS_MASK as u8) == value);
14876        *self = Self::from_bits_retain(
14877            (self.bits() & !(Self::VMIDBITS_MASK << offset)) | ((value as u64) << offset),
14878        );
14879    }
14880
14881    /// Returns a copy with the `VMIDBits` field set to the given value.
14882    pub const fn with_vmidbits(mut self, value: u8) -> Self {
14883        self.set_vmidbits(value);
14884        self
14885    }
14886
14887    /// Returns the value of the `VH` field.
14888    pub const fn vh(self) -> u8 {
14889        ((self.bits() >> Self::VH_SHIFT) & 0b1111) as u8
14890    }
14891
14892    /// Sets the value of the `VH` field.
14893    pub const fn set_vh(&mut self, value: u8) {
14894        let offset = Self::VH_SHIFT;
14895        assert!(value & (Self::VH_MASK as u8) == value);
14896        *self = Self::from_bits_retain(
14897            (self.bits() & !(Self::VH_MASK << offset)) | ((value as u64) << offset),
14898        );
14899    }
14900
14901    /// Returns a copy with the `VH` field set to the given value.
14902    pub const fn with_vh(mut self, value: u8) -> Self {
14903        self.set_vh(value);
14904        self
14905    }
14906
14907    /// Returns the value of the `HPDS` field.
14908    pub const fn hpds(self) -> u8 {
14909        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
14910    }
14911
14912    /// Sets the value of the `HPDS` field.
14913    pub const fn set_hpds(&mut self, value: u8) {
14914        let offset = Self::HPDS_SHIFT;
14915        assert!(value & (Self::HPDS_MASK as u8) == value);
14916        *self = Self::from_bits_retain(
14917            (self.bits() & !(Self::HPDS_MASK << offset)) | ((value as u64) << offset),
14918        );
14919    }
14920
14921    /// Returns a copy with the `HPDS` field set to the given value.
14922    pub const fn with_hpds(mut self, value: u8) -> Self {
14923        self.set_hpds(value);
14924        self
14925    }
14926
14927    /// Returns the value of the `LO` field.
14928    pub const fn lo(self) -> u8 {
14929        ((self.bits() >> Self::LO_SHIFT) & 0b1111) as u8
14930    }
14931
14932    /// Sets the value of the `LO` field.
14933    pub const fn set_lo(&mut self, value: u8) {
14934        let offset = Self::LO_SHIFT;
14935        assert!(value & (Self::LO_MASK as u8) == value);
14936        *self = Self::from_bits_retain(
14937            (self.bits() & !(Self::LO_MASK << offset)) | ((value as u64) << offset),
14938        );
14939    }
14940
14941    /// Returns a copy with the `LO` field set to the given value.
14942    pub const fn with_lo(mut self, value: u8) -> Self {
14943        self.set_lo(value);
14944        self
14945    }
14946
14947    /// Returns the value of the `PAN` field.
14948    pub const fn pan(self) -> u8 {
14949        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
14950    }
14951
14952    /// Sets the value of the `PAN` field.
14953    pub const fn set_pan(&mut self, value: u8) {
14954        let offset = Self::PAN_SHIFT;
14955        assert!(value & (Self::PAN_MASK as u8) == value);
14956        *self = Self::from_bits_retain(
14957            (self.bits() & !(Self::PAN_MASK << offset)) | ((value as u64) << offset),
14958        );
14959    }
14960
14961    /// Returns a copy with the `PAN` field set to the given value.
14962    pub const fn with_pan(mut self, value: u8) -> Self {
14963        self.set_pan(value);
14964        self
14965    }
14966
14967    /// Returns the value of the `SpecSEI` field.
14968    pub const fn specsei(self) -> u8 {
14969        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
14970    }
14971
14972    /// Sets the value of the `SpecSEI` field.
14973    pub const fn set_specsei(&mut self, value: u8) {
14974        let offset = Self::SPECSEI_SHIFT;
14975        assert!(value & (Self::SPECSEI_MASK as u8) == value);
14976        *self = Self::from_bits_retain(
14977            (self.bits() & !(Self::SPECSEI_MASK << offset)) | ((value as u64) << offset),
14978        );
14979    }
14980
14981    /// Returns a copy with the `SpecSEI` field set to the given value.
14982    pub const fn with_specsei(mut self, value: u8) -> Self {
14983        self.set_specsei(value);
14984        self
14985    }
14986
14987    /// Returns the value of the `XNX` field.
14988    pub const fn xnx(self) -> u8 {
14989        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
14990    }
14991
14992    /// Sets the value of the `XNX` field.
14993    pub const fn set_xnx(&mut self, value: u8) {
14994        let offset = Self::XNX_SHIFT;
14995        assert!(value & (Self::XNX_MASK as u8) == value);
14996        *self = Self::from_bits_retain(
14997            (self.bits() & !(Self::XNX_MASK << offset)) | ((value as u64) << offset),
14998        );
14999    }
15000
15001    /// Returns a copy with the `XNX` field set to the given value.
15002    pub const fn with_xnx(mut self, value: u8) -> Self {
15003        self.set_xnx(value);
15004        self
15005    }
15006
15007    /// Returns the value of the `TWED` field.
15008    pub const fn twed(self) -> u8 {
15009        ((self.bits() >> Self::TWED_SHIFT) & 0b1111) as u8
15010    }
15011
15012    /// Sets the value of the `TWED` field.
15013    pub const fn set_twed(&mut self, value: u8) {
15014        let offset = Self::TWED_SHIFT;
15015        assert!(value & (Self::TWED_MASK as u8) == value);
15016        *self = Self::from_bits_retain(
15017            (self.bits() & !(Self::TWED_MASK << offset)) | ((value as u64) << offset),
15018        );
15019    }
15020
15021    /// Returns a copy with the `TWED` field set to the given value.
15022    pub const fn with_twed(mut self, value: u8) -> Self {
15023        self.set_twed(value);
15024        self
15025    }
15026
15027    /// Returns the value of the `ETS` field.
15028    pub const fn ets(self) -> u8 {
15029        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
15030    }
15031
15032    /// Sets the value of the `ETS` field.
15033    pub const fn set_ets(&mut self, value: u8) {
15034        let offset = Self::ETS_SHIFT;
15035        assert!(value & (Self::ETS_MASK as u8) == value);
15036        *self = Self::from_bits_retain(
15037            (self.bits() & !(Self::ETS_MASK << offset)) | ((value as u64) << offset),
15038        );
15039    }
15040
15041    /// Returns a copy with the `ETS` field set to the given value.
15042    pub const fn with_ets(mut self, value: u8) -> Self {
15043        self.set_ets(value);
15044        self
15045    }
15046
15047    /// Returns the value of the `HCX` field.
15048    pub const fn hcx(self) -> u8 {
15049        ((self.bits() >> Self::HCX_SHIFT) & 0b1111) as u8
15050    }
15051
15052    /// Sets the value of the `HCX` field.
15053    pub const fn set_hcx(&mut self, value: u8) {
15054        let offset = Self::HCX_SHIFT;
15055        assert!(value & (Self::HCX_MASK as u8) == value);
15056        *self = Self::from_bits_retain(
15057            (self.bits() & !(Self::HCX_MASK << offset)) | ((value as u64) << offset),
15058        );
15059    }
15060
15061    /// Returns a copy with the `HCX` field set to the given value.
15062    pub const fn with_hcx(mut self, value: u8) -> Self {
15063        self.set_hcx(value);
15064        self
15065    }
15066
15067    /// Returns the value of the `AFP` field.
15068    pub const fn afp(self) -> u8 {
15069        ((self.bits() >> Self::AFP_SHIFT) & 0b1111) as u8
15070    }
15071
15072    /// Sets the value of the `AFP` field.
15073    pub const fn set_afp(&mut self, value: u8) {
15074        let offset = Self::AFP_SHIFT;
15075        assert!(value & (Self::AFP_MASK as u8) == value);
15076        *self = Self::from_bits_retain(
15077            (self.bits() & !(Self::AFP_MASK << offset)) | ((value as u64) << offset),
15078        );
15079    }
15080
15081    /// Returns a copy with the `AFP` field set to the given value.
15082    pub const fn with_afp(mut self, value: u8) -> Self {
15083        self.set_afp(value);
15084        self
15085    }
15086
15087    /// Returns the value of the `nTLBPA` field.
15088    pub const fn ntlbpa(self) -> u8 {
15089        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
15090    }
15091
15092    /// Sets the value of the `nTLBPA` field.
15093    pub const fn set_ntlbpa(&mut self, value: u8) {
15094        let offset = Self::NTLBPA_SHIFT;
15095        assert!(value & (Self::NTLBPA_MASK as u8) == value);
15096        *self = Self::from_bits_retain(
15097            (self.bits() & !(Self::NTLBPA_MASK << offset)) | ((value as u64) << offset),
15098        );
15099    }
15100
15101    /// Returns a copy with the `nTLBPA` field set to the given value.
15102    pub const fn with_ntlbpa(mut self, value: u8) -> Self {
15103        self.set_ntlbpa(value);
15104        self
15105    }
15106
15107    /// Returns the value of the `TIDCP1` field.
15108    pub const fn tidcp1(self) -> u8 {
15109        ((self.bits() >> Self::TIDCP1_SHIFT) & 0b1111) as u8
15110    }
15111
15112    /// Sets the value of the `TIDCP1` field.
15113    pub const fn set_tidcp1(&mut self, value: u8) {
15114        let offset = Self::TIDCP1_SHIFT;
15115        assert!(value & (Self::TIDCP1_MASK as u8) == value);
15116        *self = Self::from_bits_retain(
15117            (self.bits() & !(Self::TIDCP1_MASK << offset)) | ((value as u64) << offset),
15118        );
15119    }
15120
15121    /// Returns a copy with the `TIDCP1` field set to the given value.
15122    pub const fn with_tidcp1(mut self, value: u8) -> Self {
15123        self.set_tidcp1(value);
15124        self
15125    }
15126
15127    /// Returns the value of the `CMOW` field.
15128    pub const fn cmow(self) -> u8 {
15129        ((self.bits() >> Self::CMOW_SHIFT) & 0b1111) as u8
15130    }
15131
15132    /// Sets the value of the `CMOW` field.
15133    pub const fn set_cmow(&mut self, value: u8) {
15134        let offset = Self::CMOW_SHIFT;
15135        assert!(value & (Self::CMOW_MASK as u8) == value);
15136        *self = Self::from_bits_retain(
15137            (self.bits() & !(Self::CMOW_MASK << offset)) | ((value as u64) << offset),
15138        );
15139    }
15140
15141    /// Returns a copy with the `CMOW` field set to the given value.
15142    pub const fn with_cmow(mut self, value: u8) -> Self {
15143        self.set_cmow(value);
15144        self
15145    }
15146
15147    /// Returns the value of the `ECBHB` field.
15148    pub const fn ecbhb(self) -> u8 {
15149        ((self.bits() >> Self::ECBHB_SHIFT) & 0b1111) as u8
15150    }
15151
15152    /// Sets the value of the `ECBHB` field.
15153    pub const fn set_ecbhb(&mut self, value: u8) {
15154        let offset = Self::ECBHB_SHIFT;
15155        assert!(value & (Self::ECBHB_MASK as u8) == value);
15156        *self = Self::from_bits_retain(
15157            (self.bits() & !(Self::ECBHB_MASK << offset)) | ((value as u64) << offset),
15158        );
15159    }
15160
15161    /// Returns a copy with the `ECBHB` field set to the given value.
15162    pub const fn with_ecbhb(mut self, value: u8) -> Self {
15163        self.set_ecbhb(value);
15164        self
15165    }
15166}
15167
15168#[cfg(feature = "el1")]
15169bitflags! {
15170    /// `ID_AA64MMFR2_EL1` system register value.
15171    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15172    #[repr(transparent)]
15173    pub struct IdAa64mmfr2El1: u64 {
15174    }
15175}
15176
15177#[cfg(feature = "el1")]
15178impl IdAa64mmfr2El1 {
15179    /// Offset of the `CnP` field.
15180    pub const CNP_SHIFT: u32 = 0;
15181    /// Mask for the `CnP` field.
15182    pub const CNP_MASK: u64 = 0b1111;
15183    /// Offset of the `UAO` field.
15184    pub const UAO_SHIFT: u32 = 4;
15185    /// Mask for the `UAO` field.
15186    pub const UAO_MASK: u64 = 0b1111;
15187    /// Offset of the `LSM` field.
15188    pub const LSM_SHIFT: u32 = 8;
15189    /// Mask for the `LSM` field.
15190    pub const LSM_MASK: u64 = 0b1111;
15191    /// Offset of the `IESB` field.
15192    pub const IESB_SHIFT: u32 = 12;
15193    /// Mask for the `IESB` field.
15194    pub const IESB_MASK: u64 = 0b1111;
15195    /// Offset of the `VARange` field.
15196    pub const VARANGE_SHIFT: u32 = 16;
15197    /// Mask for the `VARange` field.
15198    pub const VARANGE_MASK: u64 = 0b1111;
15199    /// Offset of the `CCIDX` field.
15200    pub const CCIDX_SHIFT: u32 = 20;
15201    /// Mask for the `CCIDX` field.
15202    pub const CCIDX_MASK: u64 = 0b1111;
15203    /// Offset of the `NV` field.
15204    pub const NV_SHIFT: u32 = 24;
15205    /// Mask for the `NV` field.
15206    pub const NV_MASK: u64 = 0b1111;
15207    /// Offset of the `ST` field.
15208    pub const ST_SHIFT: u32 = 28;
15209    /// Mask for the `ST` field.
15210    pub const ST_MASK: u64 = 0b1111;
15211    /// Offset of the `AT` field.
15212    pub const AT_SHIFT: u32 = 32;
15213    /// Mask for the `AT` field.
15214    pub const AT_MASK: u64 = 0b1111;
15215    /// Offset of the `IDS` field.
15216    pub const IDS_SHIFT: u32 = 36;
15217    /// Mask for the `IDS` field.
15218    pub const IDS_MASK: u64 = 0b1111;
15219    /// Offset of the `FWB` field.
15220    pub const FWB_SHIFT: u32 = 40;
15221    /// Mask for the `FWB` field.
15222    pub const FWB_MASK: u64 = 0b1111;
15223    /// Offset of the `TTL` field.
15224    pub const TTL_SHIFT: u32 = 48;
15225    /// Mask for the `TTL` field.
15226    pub const TTL_MASK: u64 = 0b1111;
15227    /// Offset of the `BBM` field.
15228    pub const BBM_SHIFT: u32 = 52;
15229    /// Mask for the `BBM` field.
15230    pub const BBM_MASK: u64 = 0b1111;
15231    /// Offset of the `EVT` field.
15232    pub const EVT_SHIFT: u32 = 56;
15233    /// Mask for the `EVT` field.
15234    pub const EVT_MASK: u64 = 0b1111;
15235    /// Offset of the `E0PD` field.
15236    pub const E0PD_SHIFT: u32 = 60;
15237    /// Mask for the `E0PD` field.
15238    pub const E0PD_MASK: u64 = 0b1111;
15239
15240    /// Returns the value of the `CnP` field.
15241    pub const fn cnp(self) -> u8 {
15242        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
15243    }
15244
15245    /// Sets the value of the `CnP` field.
15246    pub const fn set_cnp(&mut self, value: u8) {
15247        let offset = Self::CNP_SHIFT;
15248        assert!(value & (Self::CNP_MASK as u8) == value);
15249        *self = Self::from_bits_retain(
15250            (self.bits() & !(Self::CNP_MASK << offset)) | ((value as u64) << offset),
15251        );
15252    }
15253
15254    /// Returns a copy with the `CnP` field set to the given value.
15255    pub const fn with_cnp(mut self, value: u8) -> Self {
15256        self.set_cnp(value);
15257        self
15258    }
15259
15260    /// Returns the value of the `UAO` field.
15261    pub const fn uao(self) -> u8 {
15262        ((self.bits() >> Self::UAO_SHIFT) & 0b1111) as u8
15263    }
15264
15265    /// Sets the value of the `UAO` field.
15266    pub const fn set_uao(&mut self, value: u8) {
15267        let offset = Self::UAO_SHIFT;
15268        assert!(value & (Self::UAO_MASK as u8) == value);
15269        *self = Self::from_bits_retain(
15270            (self.bits() & !(Self::UAO_MASK << offset)) | ((value as u64) << offset),
15271        );
15272    }
15273
15274    /// Returns a copy with the `UAO` field set to the given value.
15275    pub const fn with_uao(mut self, value: u8) -> Self {
15276        self.set_uao(value);
15277        self
15278    }
15279
15280    /// Returns the value of the `LSM` field.
15281    pub const fn lsm(self) -> u8 {
15282        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
15283    }
15284
15285    /// Sets the value of the `LSM` field.
15286    pub const fn set_lsm(&mut self, value: u8) {
15287        let offset = Self::LSM_SHIFT;
15288        assert!(value & (Self::LSM_MASK as u8) == value);
15289        *self = Self::from_bits_retain(
15290            (self.bits() & !(Self::LSM_MASK << offset)) | ((value as u64) << offset),
15291        );
15292    }
15293
15294    /// Returns a copy with the `LSM` field set to the given value.
15295    pub const fn with_lsm(mut self, value: u8) -> Self {
15296        self.set_lsm(value);
15297        self
15298    }
15299
15300    /// Returns the value of the `IESB` field.
15301    pub const fn iesb(self) -> u8 {
15302        ((self.bits() >> Self::IESB_SHIFT) & 0b1111) as u8
15303    }
15304
15305    /// Sets the value of the `IESB` field.
15306    pub const fn set_iesb(&mut self, value: u8) {
15307        let offset = Self::IESB_SHIFT;
15308        assert!(value & (Self::IESB_MASK as u8) == value);
15309        *self = Self::from_bits_retain(
15310            (self.bits() & !(Self::IESB_MASK << offset)) | ((value as u64) << offset),
15311        );
15312    }
15313
15314    /// Returns a copy with the `IESB` field set to the given value.
15315    pub const fn with_iesb(mut self, value: u8) -> Self {
15316        self.set_iesb(value);
15317        self
15318    }
15319
15320    /// Returns the value of the `VARange` field.
15321    pub const fn varange(self) -> u8 {
15322        ((self.bits() >> Self::VARANGE_SHIFT) & 0b1111) as u8
15323    }
15324
15325    /// Sets the value of the `VARange` field.
15326    pub const fn set_varange(&mut self, value: u8) {
15327        let offset = Self::VARANGE_SHIFT;
15328        assert!(value & (Self::VARANGE_MASK as u8) == value);
15329        *self = Self::from_bits_retain(
15330            (self.bits() & !(Self::VARANGE_MASK << offset)) | ((value as u64) << offset),
15331        );
15332    }
15333
15334    /// Returns a copy with the `VARange` field set to the given value.
15335    pub const fn with_varange(mut self, value: u8) -> Self {
15336        self.set_varange(value);
15337        self
15338    }
15339
15340    /// Returns the value of the `CCIDX` field.
15341    pub const fn ccidx(self) -> u8 {
15342        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
15343    }
15344
15345    /// Sets the value of the `CCIDX` field.
15346    pub const fn set_ccidx(&mut self, value: u8) {
15347        let offset = Self::CCIDX_SHIFT;
15348        assert!(value & (Self::CCIDX_MASK as u8) == value);
15349        *self = Self::from_bits_retain(
15350            (self.bits() & !(Self::CCIDX_MASK << offset)) | ((value as u64) << offset),
15351        );
15352    }
15353
15354    /// Returns a copy with the `CCIDX` field set to the given value.
15355    pub const fn with_ccidx(mut self, value: u8) -> Self {
15356        self.set_ccidx(value);
15357        self
15358    }
15359
15360    /// Returns the value of the `NV` field.
15361    pub const fn nv(self) -> u8 {
15362        ((self.bits() >> Self::NV_SHIFT) & 0b1111) as u8
15363    }
15364
15365    /// Sets the value of the `NV` field.
15366    pub const fn set_nv(&mut self, value: u8) {
15367        let offset = Self::NV_SHIFT;
15368        assert!(value & (Self::NV_MASK as u8) == value);
15369        *self = Self::from_bits_retain(
15370            (self.bits() & !(Self::NV_MASK << offset)) | ((value as u64) << offset),
15371        );
15372    }
15373
15374    /// Returns a copy with the `NV` field set to the given value.
15375    pub const fn with_nv(mut self, value: u8) -> Self {
15376        self.set_nv(value);
15377        self
15378    }
15379
15380    /// Returns the value of the `ST` field.
15381    pub const fn st(self) -> u8 {
15382        ((self.bits() >> Self::ST_SHIFT) & 0b1111) as u8
15383    }
15384
15385    /// Sets the value of the `ST` field.
15386    pub const fn set_st(&mut self, value: u8) {
15387        let offset = Self::ST_SHIFT;
15388        assert!(value & (Self::ST_MASK as u8) == value);
15389        *self = Self::from_bits_retain(
15390            (self.bits() & !(Self::ST_MASK << offset)) | ((value as u64) << offset),
15391        );
15392    }
15393
15394    /// Returns a copy with the `ST` field set to the given value.
15395    pub const fn with_st(mut self, value: u8) -> Self {
15396        self.set_st(value);
15397        self
15398    }
15399
15400    /// Returns the value of the `AT` field.
15401    pub const fn at(self) -> u8 {
15402        ((self.bits() >> Self::AT_SHIFT) & 0b1111) as u8
15403    }
15404
15405    /// Sets the value of the `AT` field.
15406    pub const fn set_at(&mut self, value: u8) {
15407        let offset = Self::AT_SHIFT;
15408        assert!(value & (Self::AT_MASK as u8) == value);
15409        *self = Self::from_bits_retain(
15410            (self.bits() & !(Self::AT_MASK << offset)) | ((value as u64) << offset),
15411        );
15412    }
15413
15414    /// Returns a copy with the `AT` field set to the given value.
15415    pub const fn with_at(mut self, value: u8) -> Self {
15416        self.set_at(value);
15417        self
15418    }
15419
15420    /// Returns the value of the `IDS` field.
15421    pub const fn ids(self) -> u8 {
15422        ((self.bits() >> Self::IDS_SHIFT) & 0b1111) as u8
15423    }
15424
15425    /// Sets the value of the `IDS` field.
15426    pub const fn set_ids(&mut self, value: u8) {
15427        let offset = Self::IDS_SHIFT;
15428        assert!(value & (Self::IDS_MASK as u8) == value);
15429        *self = Self::from_bits_retain(
15430            (self.bits() & !(Self::IDS_MASK << offset)) | ((value as u64) << offset),
15431        );
15432    }
15433
15434    /// Returns a copy with the `IDS` field set to the given value.
15435    pub const fn with_ids(mut self, value: u8) -> Self {
15436        self.set_ids(value);
15437        self
15438    }
15439
15440    /// Returns the value of the `FWB` field.
15441    pub const fn fwb(self) -> u8 {
15442        ((self.bits() >> Self::FWB_SHIFT) & 0b1111) as u8
15443    }
15444
15445    /// Sets the value of the `FWB` field.
15446    pub const fn set_fwb(&mut self, value: u8) {
15447        let offset = Self::FWB_SHIFT;
15448        assert!(value & (Self::FWB_MASK as u8) == value);
15449        *self = Self::from_bits_retain(
15450            (self.bits() & !(Self::FWB_MASK << offset)) | ((value as u64) << offset),
15451        );
15452    }
15453
15454    /// Returns a copy with the `FWB` field set to the given value.
15455    pub const fn with_fwb(mut self, value: u8) -> Self {
15456        self.set_fwb(value);
15457        self
15458    }
15459
15460    /// Returns the value of the `TTL` field.
15461    pub const fn ttl(self) -> u8 {
15462        ((self.bits() >> Self::TTL_SHIFT) & 0b1111) as u8
15463    }
15464
15465    /// Sets the value of the `TTL` field.
15466    pub const fn set_ttl(&mut self, value: u8) {
15467        let offset = Self::TTL_SHIFT;
15468        assert!(value & (Self::TTL_MASK as u8) == value);
15469        *self = Self::from_bits_retain(
15470            (self.bits() & !(Self::TTL_MASK << offset)) | ((value as u64) << offset),
15471        );
15472    }
15473
15474    /// Returns a copy with the `TTL` field set to the given value.
15475    pub const fn with_ttl(mut self, value: u8) -> Self {
15476        self.set_ttl(value);
15477        self
15478    }
15479
15480    /// Returns the value of the `BBM` field.
15481    pub const fn bbm(self) -> u8 {
15482        ((self.bits() >> Self::BBM_SHIFT) & 0b1111) as u8
15483    }
15484
15485    /// Sets the value of the `BBM` field.
15486    pub const fn set_bbm(&mut self, value: u8) {
15487        let offset = Self::BBM_SHIFT;
15488        assert!(value & (Self::BBM_MASK as u8) == value);
15489        *self = Self::from_bits_retain(
15490            (self.bits() & !(Self::BBM_MASK << offset)) | ((value as u64) << offset),
15491        );
15492    }
15493
15494    /// Returns a copy with the `BBM` field set to the given value.
15495    pub const fn with_bbm(mut self, value: u8) -> Self {
15496        self.set_bbm(value);
15497        self
15498    }
15499
15500    /// Returns the value of the `EVT` field.
15501    pub const fn evt(self) -> u8 {
15502        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
15503    }
15504
15505    /// Sets the value of the `EVT` field.
15506    pub const fn set_evt(&mut self, value: u8) {
15507        let offset = Self::EVT_SHIFT;
15508        assert!(value & (Self::EVT_MASK as u8) == value);
15509        *self = Self::from_bits_retain(
15510            (self.bits() & !(Self::EVT_MASK << offset)) | ((value as u64) << offset),
15511        );
15512    }
15513
15514    /// Returns a copy with the `EVT` field set to the given value.
15515    pub const fn with_evt(mut self, value: u8) -> Self {
15516        self.set_evt(value);
15517        self
15518    }
15519
15520    /// Returns the value of the `E0PD` field.
15521    pub const fn e0pd(self) -> u8 {
15522        ((self.bits() >> Self::E0PD_SHIFT) & 0b1111) as u8
15523    }
15524
15525    /// Sets the value of the `E0PD` field.
15526    pub const fn set_e0pd(&mut self, value: u8) {
15527        let offset = Self::E0PD_SHIFT;
15528        assert!(value & (Self::E0PD_MASK as u8) == value);
15529        *self = Self::from_bits_retain(
15530            (self.bits() & !(Self::E0PD_MASK << offset)) | ((value as u64) << offset),
15531        );
15532    }
15533
15534    /// Returns a copy with the `E0PD` field set to the given value.
15535    pub const fn with_e0pd(mut self, value: u8) -> Self {
15536        self.set_e0pd(value);
15537        self
15538    }
15539}
15540
15541#[cfg(feature = "el1")]
15542bitflags! {
15543    /// `ID_AA64MMFR3_EL1` system register value.
15544    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15545    #[repr(transparent)]
15546    pub struct IdAa64mmfr3El1: u64 {
15547    }
15548}
15549
15550#[cfg(feature = "el1")]
15551impl IdAa64mmfr3El1 {
15552    /// Offset of the `TCRX` field.
15553    pub const TCRX_SHIFT: u32 = 0;
15554    /// Mask for the `TCRX` field.
15555    pub const TCRX_MASK: u64 = 0b1111;
15556    /// Offset of the `SCTLRX` field.
15557    pub const SCTLRX_SHIFT: u32 = 4;
15558    /// Mask for the `SCTLRX` field.
15559    pub const SCTLRX_MASK: u64 = 0b1111;
15560    /// Offset of the `S1PIE` field.
15561    pub const S1PIE_SHIFT: u32 = 8;
15562    /// Mask for the `S1PIE` field.
15563    pub const S1PIE_MASK: u64 = 0b1111;
15564    /// Offset of the `S2PIE` field.
15565    pub const S2PIE_SHIFT: u32 = 12;
15566    /// Mask for the `S2PIE` field.
15567    pub const S2PIE_MASK: u64 = 0b1111;
15568    /// Offset of the `S1POE` field.
15569    pub const S1POE_SHIFT: u32 = 16;
15570    /// Mask for the `S1POE` field.
15571    pub const S1POE_MASK: u64 = 0b1111;
15572    /// Offset of the `S2POE` field.
15573    pub const S2POE_SHIFT: u32 = 20;
15574    /// Mask for the `S2POE` field.
15575    pub const S2POE_MASK: u64 = 0b1111;
15576    /// Offset of the `AIE` field.
15577    pub const AIE_SHIFT: u32 = 24;
15578    /// Mask for the `AIE` field.
15579    pub const AIE_MASK: u64 = 0b1111;
15580    /// Offset of the `MEC` field.
15581    pub const MEC_SHIFT: u32 = 28;
15582    /// Mask for the `MEC` field.
15583    pub const MEC_MASK: u64 = 0b1111;
15584    /// Offset of the `D128` field.
15585    pub const D128_SHIFT: u32 = 32;
15586    /// Mask for the `D128` field.
15587    pub const D128_MASK: u64 = 0b1111;
15588    /// Offset of the `D128_2` field.
15589    pub const D128_2_SHIFT: u32 = 36;
15590    /// Mask for the `D128_2` field.
15591    pub const D128_2_MASK: u64 = 0b1111;
15592    /// Offset of the `SNERR` field.
15593    pub const SNERR_SHIFT: u32 = 40;
15594    /// Mask for the `SNERR` field.
15595    pub const SNERR_MASK: u64 = 0b1111;
15596    /// Offset of the `ANERR` field.
15597    pub const ANERR_SHIFT: u32 = 44;
15598    /// Mask for the `ANERR` field.
15599    pub const ANERR_MASK: u64 = 0b1111;
15600    /// Offset of the `SDERR` field.
15601    pub const SDERR_SHIFT: u32 = 52;
15602    /// Mask for the `SDERR` field.
15603    pub const SDERR_MASK: u64 = 0b1111;
15604    /// Offset of the `ADERR` field.
15605    pub const ADERR_SHIFT: u32 = 56;
15606    /// Mask for the `ADERR` field.
15607    pub const ADERR_MASK: u64 = 0b1111;
15608    /// Offset of the `Spec_FPACC` field.
15609    pub const SPEC_FPACC_SHIFT: u32 = 60;
15610    /// Mask for the `Spec_FPACC` field.
15611    pub const SPEC_FPACC_MASK: u64 = 0b1111;
15612
15613    /// Returns the value of the `TCRX` field.
15614    pub const fn tcrx(self) -> u8 {
15615        ((self.bits() >> Self::TCRX_SHIFT) & 0b1111) as u8
15616    }
15617
15618    /// Sets the value of the `TCRX` field.
15619    pub const fn set_tcrx(&mut self, value: u8) {
15620        let offset = Self::TCRX_SHIFT;
15621        assert!(value & (Self::TCRX_MASK as u8) == value);
15622        *self = Self::from_bits_retain(
15623            (self.bits() & !(Self::TCRX_MASK << offset)) | ((value as u64) << offset),
15624        );
15625    }
15626
15627    /// Returns a copy with the `TCRX` field set to the given value.
15628    pub const fn with_tcrx(mut self, value: u8) -> Self {
15629        self.set_tcrx(value);
15630        self
15631    }
15632
15633    /// Returns the value of the `SCTLRX` field.
15634    pub const fn sctlrx(self) -> u8 {
15635        ((self.bits() >> Self::SCTLRX_SHIFT) & 0b1111) as u8
15636    }
15637
15638    /// Sets the value of the `SCTLRX` field.
15639    pub const fn set_sctlrx(&mut self, value: u8) {
15640        let offset = Self::SCTLRX_SHIFT;
15641        assert!(value & (Self::SCTLRX_MASK as u8) == value);
15642        *self = Self::from_bits_retain(
15643            (self.bits() & !(Self::SCTLRX_MASK << offset)) | ((value as u64) << offset),
15644        );
15645    }
15646
15647    /// Returns a copy with the `SCTLRX` field set to the given value.
15648    pub const fn with_sctlrx(mut self, value: u8) -> Self {
15649        self.set_sctlrx(value);
15650        self
15651    }
15652
15653    /// Returns the value of the `S1PIE` field.
15654    pub const fn s1pie(self) -> u8 {
15655        ((self.bits() >> Self::S1PIE_SHIFT) & 0b1111) as u8
15656    }
15657
15658    /// Sets the value of the `S1PIE` field.
15659    pub const fn set_s1pie(&mut self, value: u8) {
15660        let offset = Self::S1PIE_SHIFT;
15661        assert!(value & (Self::S1PIE_MASK as u8) == value);
15662        *self = Self::from_bits_retain(
15663            (self.bits() & !(Self::S1PIE_MASK << offset)) | ((value as u64) << offset),
15664        );
15665    }
15666
15667    /// Returns a copy with the `S1PIE` field set to the given value.
15668    pub const fn with_s1pie(mut self, value: u8) -> Self {
15669        self.set_s1pie(value);
15670        self
15671    }
15672
15673    /// Returns the value of the `S2PIE` field.
15674    pub const fn s2pie(self) -> u8 {
15675        ((self.bits() >> Self::S2PIE_SHIFT) & 0b1111) as u8
15676    }
15677
15678    /// Sets the value of the `S2PIE` field.
15679    pub const fn set_s2pie(&mut self, value: u8) {
15680        let offset = Self::S2PIE_SHIFT;
15681        assert!(value & (Self::S2PIE_MASK as u8) == value);
15682        *self = Self::from_bits_retain(
15683            (self.bits() & !(Self::S2PIE_MASK << offset)) | ((value as u64) << offset),
15684        );
15685    }
15686
15687    /// Returns a copy with the `S2PIE` field set to the given value.
15688    pub const fn with_s2pie(mut self, value: u8) -> Self {
15689        self.set_s2pie(value);
15690        self
15691    }
15692
15693    /// Returns the value of the `S1POE` field.
15694    pub const fn s1poe(self) -> u8 {
15695        ((self.bits() >> Self::S1POE_SHIFT) & 0b1111) as u8
15696    }
15697
15698    /// Sets the value of the `S1POE` field.
15699    pub const fn set_s1poe(&mut self, value: u8) {
15700        let offset = Self::S1POE_SHIFT;
15701        assert!(value & (Self::S1POE_MASK as u8) == value);
15702        *self = Self::from_bits_retain(
15703            (self.bits() & !(Self::S1POE_MASK << offset)) | ((value as u64) << offset),
15704        );
15705    }
15706
15707    /// Returns a copy with the `S1POE` field set to the given value.
15708    pub const fn with_s1poe(mut self, value: u8) -> Self {
15709        self.set_s1poe(value);
15710        self
15711    }
15712
15713    /// Returns the value of the `S2POE` field.
15714    pub const fn s2poe(self) -> u8 {
15715        ((self.bits() >> Self::S2POE_SHIFT) & 0b1111) as u8
15716    }
15717
15718    /// Sets the value of the `S2POE` field.
15719    pub const fn set_s2poe(&mut self, value: u8) {
15720        let offset = Self::S2POE_SHIFT;
15721        assert!(value & (Self::S2POE_MASK as u8) == value);
15722        *self = Self::from_bits_retain(
15723            (self.bits() & !(Self::S2POE_MASK << offset)) | ((value as u64) << offset),
15724        );
15725    }
15726
15727    /// Returns a copy with the `S2POE` field set to the given value.
15728    pub const fn with_s2poe(mut self, value: u8) -> Self {
15729        self.set_s2poe(value);
15730        self
15731    }
15732
15733    /// Returns the value of the `AIE` field.
15734    pub const fn aie(self) -> u8 {
15735        ((self.bits() >> Self::AIE_SHIFT) & 0b1111) as u8
15736    }
15737
15738    /// Sets the value of the `AIE` field.
15739    pub const fn set_aie(&mut self, value: u8) {
15740        let offset = Self::AIE_SHIFT;
15741        assert!(value & (Self::AIE_MASK as u8) == value);
15742        *self = Self::from_bits_retain(
15743            (self.bits() & !(Self::AIE_MASK << offset)) | ((value as u64) << offset),
15744        );
15745    }
15746
15747    /// Returns a copy with the `AIE` field set to the given value.
15748    pub const fn with_aie(mut self, value: u8) -> Self {
15749        self.set_aie(value);
15750        self
15751    }
15752
15753    /// Returns the value of the `MEC` field.
15754    pub const fn mec(self) -> u8 {
15755        ((self.bits() >> Self::MEC_SHIFT) & 0b1111) as u8
15756    }
15757
15758    /// Sets the value of the `MEC` field.
15759    pub const fn set_mec(&mut self, value: u8) {
15760        let offset = Self::MEC_SHIFT;
15761        assert!(value & (Self::MEC_MASK as u8) == value);
15762        *self = Self::from_bits_retain(
15763            (self.bits() & !(Self::MEC_MASK << offset)) | ((value as u64) << offset),
15764        );
15765    }
15766
15767    /// Returns a copy with the `MEC` field set to the given value.
15768    pub const fn with_mec(mut self, value: u8) -> Self {
15769        self.set_mec(value);
15770        self
15771    }
15772
15773    /// Returns the value of the `D128` field.
15774    pub const fn d128(self) -> u8 {
15775        ((self.bits() >> Self::D128_SHIFT) & 0b1111) as u8
15776    }
15777
15778    /// Sets the value of the `D128` field.
15779    pub const fn set_d128(&mut self, value: u8) {
15780        let offset = Self::D128_SHIFT;
15781        assert!(value & (Self::D128_MASK as u8) == value);
15782        *self = Self::from_bits_retain(
15783            (self.bits() & !(Self::D128_MASK << offset)) | ((value as u64) << offset),
15784        );
15785    }
15786
15787    /// Returns a copy with the `D128` field set to the given value.
15788    pub const fn with_d128(mut self, value: u8) -> Self {
15789        self.set_d128(value);
15790        self
15791    }
15792
15793    /// Returns the value of the `D128_2` field.
15794    pub const fn d128_2(self) -> u8 {
15795        ((self.bits() >> Self::D128_2_SHIFT) & 0b1111) as u8
15796    }
15797
15798    /// Sets the value of the `D128_2` field.
15799    pub const fn set_d128_2(&mut self, value: u8) {
15800        let offset = Self::D128_2_SHIFT;
15801        assert!(value & (Self::D128_2_MASK as u8) == value);
15802        *self = Self::from_bits_retain(
15803            (self.bits() & !(Self::D128_2_MASK << offset)) | ((value as u64) << offset),
15804        );
15805    }
15806
15807    /// Returns a copy with the `D128_2` field set to the given value.
15808    pub const fn with_d128_2(mut self, value: u8) -> Self {
15809        self.set_d128_2(value);
15810        self
15811    }
15812
15813    /// Returns the value of the `SNERR` field.
15814    pub const fn snerr(self) -> u8 {
15815        ((self.bits() >> Self::SNERR_SHIFT) & 0b1111) as u8
15816    }
15817
15818    /// Sets the value of the `SNERR` field.
15819    pub const fn set_snerr(&mut self, value: u8) {
15820        let offset = Self::SNERR_SHIFT;
15821        assert!(value & (Self::SNERR_MASK as u8) == value);
15822        *self = Self::from_bits_retain(
15823            (self.bits() & !(Self::SNERR_MASK << offset)) | ((value as u64) << offset),
15824        );
15825    }
15826
15827    /// Returns a copy with the `SNERR` field set to the given value.
15828    pub const fn with_snerr(mut self, value: u8) -> Self {
15829        self.set_snerr(value);
15830        self
15831    }
15832
15833    /// Returns the value of the `ANERR` field.
15834    pub const fn anerr(self) -> u8 {
15835        ((self.bits() >> Self::ANERR_SHIFT) & 0b1111) as u8
15836    }
15837
15838    /// Sets the value of the `ANERR` field.
15839    pub const fn set_anerr(&mut self, value: u8) {
15840        let offset = Self::ANERR_SHIFT;
15841        assert!(value & (Self::ANERR_MASK as u8) == value);
15842        *self = Self::from_bits_retain(
15843            (self.bits() & !(Self::ANERR_MASK << offset)) | ((value as u64) << offset),
15844        );
15845    }
15846
15847    /// Returns a copy with the `ANERR` field set to the given value.
15848    pub const fn with_anerr(mut self, value: u8) -> Self {
15849        self.set_anerr(value);
15850        self
15851    }
15852
15853    /// Returns the value of the `SDERR` field.
15854    pub const fn sderr(self) -> u8 {
15855        ((self.bits() >> Self::SDERR_SHIFT) & 0b1111) as u8
15856    }
15857
15858    /// Sets the value of the `SDERR` field.
15859    pub const fn set_sderr(&mut self, value: u8) {
15860        let offset = Self::SDERR_SHIFT;
15861        assert!(value & (Self::SDERR_MASK as u8) == value);
15862        *self = Self::from_bits_retain(
15863            (self.bits() & !(Self::SDERR_MASK << offset)) | ((value as u64) << offset),
15864        );
15865    }
15866
15867    /// Returns a copy with the `SDERR` field set to the given value.
15868    pub const fn with_sderr(mut self, value: u8) -> Self {
15869        self.set_sderr(value);
15870        self
15871    }
15872
15873    /// Returns the value of the `ADERR` field.
15874    pub const fn aderr(self) -> u8 {
15875        ((self.bits() >> Self::ADERR_SHIFT) & 0b1111) as u8
15876    }
15877
15878    /// Sets the value of the `ADERR` field.
15879    pub const fn set_aderr(&mut self, value: u8) {
15880        let offset = Self::ADERR_SHIFT;
15881        assert!(value & (Self::ADERR_MASK as u8) == value);
15882        *self = Self::from_bits_retain(
15883            (self.bits() & !(Self::ADERR_MASK << offset)) | ((value as u64) << offset),
15884        );
15885    }
15886
15887    /// Returns a copy with the `ADERR` field set to the given value.
15888    pub const fn with_aderr(mut self, value: u8) -> Self {
15889        self.set_aderr(value);
15890        self
15891    }
15892
15893    /// Returns the value of the `Spec_FPACC` field.
15894    pub const fn spec_fpacc(self) -> u8 {
15895        ((self.bits() >> Self::SPEC_FPACC_SHIFT) & 0b1111) as u8
15896    }
15897
15898    /// Sets the value of the `Spec_FPACC` field.
15899    pub const fn set_spec_fpacc(&mut self, value: u8) {
15900        let offset = Self::SPEC_FPACC_SHIFT;
15901        assert!(value & (Self::SPEC_FPACC_MASK as u8) == value);
15902        *self = Self::from_bits_retain(
15903            (self.bits() & !(Self::SPEC_FPACC_MASK << offset)) | ((value as u64) << offset),
15904        );
15905    }
15906
15907    /// Returns a copy with the `Spec_FPACC` field set to the given value.
15908    pub const fn with_spec_fpacc(mut self, value: u8) -> Self {
15909        self.set_spec_fpacc(value);
15910        self
15911    }
15912}
15913
15914#[cfg(feature = "el1")]
15915bitflags! {
15916    /// `ID_AA64PFR0_EL1` system register value.
15917    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
15918    #[repr(transparent)]
15919    pub struct IdAa64pfr0El1: u64 {
15920    }
15921}
15922
15923#[cfg(feature = "el1")]
15924impl IdAa64pfr0El1 {
15925    /// Offset of the `EL0` field.
15926    pub const EL0_SHIFT: u32 = 0;
15927    /// Mask for the `EL0` field.
15928    pub const EL0_MASK: u64 = 0b1111;
15929    /// Offset of the `EL1` field.
15930    pub const EL1_SHIFT: u32 = 4;
15931    /// Mask for the `EL1` field.
15932    pub const EL1_MASK: u64 = 0b1111;
15933    /// Offset of the `EL2` field.
15934    pub const EL2_SHIFT: u32 = 8;
15935    /// Mask for the `EL2` field.
15936    pub const EL2_MASK: u64 = 0b1111;
15937    /// Offset of the `EL3` field.
15938    pub const EL3_SHIFT: u32 = 12;
15939    /// Mask for the `EL3` field.
15940    pub const EL3_MASK: u64 = 0b1111;
15941    /// Offset of the `FP` field.
15942    pub const FP_SHIFT: u32 = 16;
15943    /// Mask for the `FP` field.
15944    pub const FP_MASK: u64 = 0b1111;
15945    /// Offset of the `AdvSIMD` field.
15946    pub const ADVSIMD_SHIFT: u32 = 20;
15947    /// Mask for the `AdvSIMD` field.
15948    pub const ADVSIMD_MASK: u64 = 0b1111;
15949    /// Offset of the `GIC` field.
15950    pub const GIC_SHIFT: u32 = 24;
15951    /// Mask for the `GIC` field.
15952    pub const GIC_MASK: u64 = 0b1111;
15953    /// Offset of the `RAS` field.
15954    pub const RAS_SHIFT: u32 = 28;
15955    /// Mask for the `RAS` field.
15956    pub const RAS_MASK: u64 = 0b1111;
15957    /// Offset of the `SVE` field.
15958    pub const SVE_SHIFT: u32 = 32;
15959    /// Mask for the `SVE` field.
15960    pub const SVE_MASK: u64 = 0b1111;
15961    /// Offset of the `SEL2` field.
15962    pub const SEL2_SHIFT: u32 = 36;
15963    /// Mask for the `SEL2` field.
15964    pub const SEL2_MASK: u64 = 0b1111;
15965    /// Offset of the `MPAM` field.
15966    pub const MPAM_SHIFT: u32 = 40;
15967    /// Mask for the `MPAM` field.
15968    pub const MPAM_MASK: u64 = 0b1111;
15969    /// Offset of the `AMU` field.
15970    pub const AMU_SHIFT: u32 = 44;
15971    /// Mask for the `AMU` field.
15972    pub const AMU_MASK: u64 = 0b1111;
15973    /// Offset of the `DIT` field.
15974    pub const DIT_SHIFT: u32 = 48;
15975    /// Mask for the `DIT` field.
15976    pub const DIT_MASK: u64 = 0b1111;
15977    /// Offset of the `RME` field.
15978    pub const RME_SHIFT: u32 = 52;
15979    /// Mask for the `RME` field.
15980    pub const RME_MASK: u64 = 0b1111;
15981    /// Offset of the `CSV2` field.
15982    pub const CSV2_SHIFT: u32 = 56;
15983    /// Mask for the `CSV2` field.
15984    pub const CSV2_MASK: u64 = 0b1111;
15985    /// Offset of the `CSV3` field.
15986    pub const CSV3_SHIFT: u32 = 60;
15987    /// Mask for the `CSV3` field.
15988    pub const CSV3_MASK: u64 = 0b1111;
15989
15990    /// Returns the value of the `EL0` field.
15991    pub const fn el0(self) -> u8 {
15992        ((self.bits() >> Self::EL0_SHIFT) & 0b1111) as u8
15993    }
15994
15995    /// Sets the value of the `EL0` field.
15996    pub const fn set_el0(&mut self, value: u8) {
15997        let offset = Self::EL0_SHIFT;
15998        assert!(value & (Self::EL0_MASK as u8) == value);
15999        *self = Self::from_bits_retain(
16000            (self.bits() & !(Self::EL0_MASK << offset)) | ((value as u64) << offset),
16001        );
16002    }
16003
16004    /// Returns a copy with the `EL0` field set to the given value.
16005    pub const fn with_el0(mut self, value: u8) -> Self {
16006        self.set_el0(value);
16007        self
16008    }
16009
16010    /// Returns the value of the `EL1` field.
16011    pub const fn el1(self) -> u8 {
16012        ((self.bits() >> Self::EL1_SHIFT) & 0b1111) as u8
16013    }
16014
16015    /// Sets the value of the `EL1` field.
16016    pub const fn set_el1(&mut self, value: u8) {
16017        let offset = Self::EL1_SHIFT;
16018        assert!(value & (Self::EL1_MASK as u8) == value);
16019        *self = Self::from_bits_retain(
16020            (self.bits() & !(Self::EL1_MASK << offset)) | ((value as u64) << offset),
16021        );
16022    }
16023
16024    /// Returns a copy with the `EL1` field set to the given value.
16025    pub const fn with_el1(mut self, value: u8) -> Self {
16026        self.set_el1(value);
16027        self
16028    }
16029
16030    /// Returns the value of the `EL2` field.
16031    pub const fn el2(self) -> u8 {
16032        ((self.bits() >> Self::EL2_SHIFT) & 0b1111) as u8
16033    }
16034
16035    /// Sets the value of the `EL2` field.
16036    pub const fn set_el2(&mut self, value: u8) {
16037        let offset = Self::EL2_SHIFT;
16038        assert!(value & (Self::EL2_MASK as u8) == value);
16039        *self = Self::from_bits_retain(
16040            (self.bits() & !(Self::EL2_MASK << offset)) | ((value as u64) << offset),
16041        );
16042    }
16043
16044    /// Returns a copy with the `EL2` field set to the given value.
16045    pub const fn with_el2(mut self, value: u8) -> Self {
16046        self.set_el2(value);
16047        self
16048    }
16049
16050    /// Returns the value of the `EL3` field.
16051    pub const fn el3(self) -> u8 {
16052        ((self.bits() >> Self::EL3_SHIFT) & 0b1111) as u8
16053    }
16054
16055    /// Sets the value of the `EL3` field.
16056    pub const fn set_el3(&mut self, value: u8) {
16057        let offset = Self::EL3_SHIFT;
16058        assert!(value & (Self::EL3_MASK as u8) == value);
16059        *self = Self::from_bits_retain(
16060            (self.bits() & !(Self::EL3_MASK << offset)) | ((value as u64) << offset),
16061        );
16062    }
16063
16064    /// Returns a copy with the `EL3` field set to the given value.
16065    pub const fn with_el3(mut self, value: u8) -> Self {
16066        self.set_el3(value);
16067        self
16068    }
16069
16070    /// Returns the value of the `FP` field.
16071    pub const fn fp(self) -> u8 {
16072        ((self.bits() >> Self::FP_SHIFT) & 0b1111) as u8
16073    }
16074
16075    /// Sets the value of the `FP` field.
16076    pub const fn set_fp(&mut self, value: u8) {
16077        let offset = Self::FP_SHIFT;
16078        assert!(value & (Self::FP_MASK as u8) == value);
16079        *self = Self::from_bits_retain(
16080            (self.bits() & !(Self::FP_MASK << offset)) | ((value as u64) << offset),
16081        );
16082    }
16083
16084    /// Returns a copy with the `FP` field set to the given value.
16085    pub const fn with_fp(mut self, value: u8) -> Self {
16086        self.set_fp(value);
16087        self
16088    }
16089
16090    /// Returns the value of the `AdvSIMD` field.
16091    pub const fn advsimd(self) -> u8 {
16092        ((self.bits() >> Self::ADVSIMD_SHIFT) & 0b1111) as u8
16093    }
16094
16095    /// Sets the value of the `AdvSIMD` field.
16096    pub const fn set_advsimd(&mut self, value: u8) {
16097        let offset = Self::ADVSIMD_SHIFT;
16098        assert!(value & (Self::ADVSIMD_MASK as u8) == value);
16099        *self = Self::from_bits_retain(
16100            (self.bits() & !(Self::ADVSIMD_MASK << offset)) | ((value as u64) << offset),
16101        );
16102    }
16103
16104    /// Returns a copy with the `AdvSIMD` field set to the given value.
16105    pub const fn with_advsimd(mut self, value: u8) -> Self {
16106        self.set_advsimd(value);
16107        self
16108    }
16109
16110    /// Returns the value of the `GIC` field.
16111    pub const fn gic(self) -> u8 {
16112        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
16113    }
16114
16115    /// Sets the value of the `GIC` field.
16116    pub const fn set_gic(&mut self, value: u8) {
16117        let offset = Self::GIC_SHIFT;
16118        assert!(value & (Self::GIC_MASK as u8) == value);
16119        *self = Self::from_bits_retain(
16120            (self.bits() & !(Self::GIC_MASK << offset)) | ((value as u64) << offset),
16121        );
16122    }
16123
16124    /// Returns a copy with the `GIC` field set to the given value.
16125    pub const fn with_gic(mut self, value: u8) -> Self {
16126        self.set_gic(value);
16127        self
16128    }
16129
16130    /// Returns the value of the `RAS` field.
16131    pub const fn ras(self) -> u8 {
16132        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
16133    }
16134
16135    /// Sets the value of the `RAS` field.
16136    pub const fn set_ras(&mut self, value: u8) {
16137        let offset = Self::RAS_SHIFT;
16138        assert!(value & (Self::RAS_MASK as u8) == value);
16139        *self = Self::from_bits_retain(
16140            (self.bits() & !(Self::RAS_MASK << offset)) | ((value as u64) << offset),
16141        );
16142    }
16143
16144    /// Returns a copy with the `RAS` field set to the given value.
16145    pub const fn with_ras(mut self, value: u8) -> Self {
16146        self.set_ras(value);
16147        self
16148    }
16149
16150    /// Returns the value of the `SVE` field.
16151    pub const fn sve(self) -> u8 {
16152        ((self.bits() >> Self::SVE_SHIFT) & 0b1111) as u8
16153    }
16154
16155    /// Sets the value of the `SVE` field.
16156    pub const fn set_sve(&mut self, value: u8) {
16157        let offset = Self::SVE_SHIFT;
16158        assert!(value & (Self::SVE_MASK as u8) == value);
16159        *self = Self::from_bits_retain(
16160            (self.bits() & !(Self::SVE_MASK << offset)) | ((value as u64) << offset),
16161        );
16162    }
16163
16164    /// Returns a copy with the `SVE` field set to the given value.
16165    pub const fn with_sve(mut self, value: u8) -> Self {
16166        self.set_sve(value);
16167        self
16168    }
16169
16170    /// Returns the value of the `SEL2` field.
16171    pub const fn sel2(self) -> u8 {
16172        ((self.bits() >> Self::SEL2_SHIFT) & 0b1111) as u8
16173    }
16174
16175    /// Sets the value of the `SEL2` field.
16176    pub const fn set_sel2(&mut self, value: u8) {
16177        let offset = Self::SEL2_SHIFT;
16178        assert!(value & (Self::SEL2_MASK as u8) == value);
16179        *self = Self::from_bits_retain(
16180            (self.bits() & !(Self::SEL2_MASK << offset)) | ((value as u64) << offset),
16181        );
16182    }
16183
16184    /// Returns a copy with the `SEL2` field set to the given value.
16185    pub const fn with_sel2(mut self, value: u8) -> Self {
16186        self.set_sel2(value);
16187        self
16188    }
16189
16190    /// Returns the value of the `MPAM` field.
16191    pub const fn mpam(self) -> u8 {
16192        ((self.bits() >> Self::MPAM_SHIFT) & 0b1111) as u8
16193    }
16194
16195    /// Sets the value of the `MPAM` field.
16196    pub const fn set_mpam(&mut self, value: u8) {
16197        let offset = Self::MPAM_SHIFT;
16198        assert!(value & (Self::MPAM_MASK as u8) == value);
16199        *self = Self::from_bits_retain(
16200            (self.bits() & !(Self::MPAM_MASK << offset)) | ((value as u64) << offset),
16201        );
16202    }
16203
16204    /// Returns a copy with the `MPAM` field set to the given value.
16205    pub const fn with_mpam(mut self, value: u8) -> Self {
16206        self.set_mpam(value);
16207        self
16208    }
16209
16210    /// Returns the value of the `AMU` field.
16211    pub const fn amu(self) -> u8 {
16212        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
16213    }
16214
16215    /// Sets the value of the `AMU` field.
16216    pub const fn set_amu(&mut self, value: u8) {
16217        let offset = Self::AMU_SHIFT;
16218        assert!(value & (Self::AMU_MASK as u8) == value);
16219        *self = Self::from_bits_retain(
16220            (self.bits() & !(Self::AMU_MASK << offset)) | ((value as u64) << offset),
16221        );
16222    }
16223
16224    /// Returns a copy with the `AMU` field set to the given value.
16225    pub const fn with_amu(mut self, value: u8) -> Self {
16226        self.set_amu(value);
16227        self
16228    }
16229
16230    /// Returns the value of the `DIT` field.
16231    pub const fn dit(self) -> u8 {
16232        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
16233    }
16234
16235    /// Sets the value of the `DIT` field.
16236    pub const fn set_dit(&mut self, value: u8) {
16237        let offset = Self::DIT_SHIFT;
16238        assert!(value & (Self::DIT_MASK as u8) == value);
16239        *self = Self::from_bits_retain(
16240            (self.bits() & !(Self::DIT_MASK << offset)) | ((value as u64) << offset),
16241        );
16242    }
16243
16244    /// Returns a copy with the `DIT` field set to the given value.
16245    pub const fn with_dit(mut self, value: u8) -> Self {
16246        self.set_dit(value);
16247        self
16248    }
16249
16250    /// Returns the value of the `RME` field.
16251    pub const fn rme(self) -> u8 {
16252        ((self.bits() >> Self::RME_SHIFT) & 0b1111) as u8
16253    }
16254
16255    /// Sets the value of the `RME` field.
16256    pub const fn set_rme(&mut self, value: u8) {
16257        let offset = Self::RME_SHIFT;
16258        assert!(value & (Self::RME_MASK as u8) == value);
16259        *self = Self::from_bits_retain(
16260            (self.bits() & !(Self::RME_MASK << offset)) | ((value as u64) << offset),
16261        );
16262    }
16263
16264    /// Returns a copy with the `RME` field set to the given value.
16265    pub const fn with_rme(mut self, value: u8) -> Self {
16266        self.set_rme(value);
16267        self
16268    }
16269
16270    /// Returns the value of the `CSV2` field.
16271    pub const fn csv2(self) -> u8 {
16272        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
16273    }
16274
16275    /// Sets the value of the `CSV2` field.
16276    pub const fn set_csv2(&mut self, value: u8) {
16277        let offset = Self::CSV2_SHIFT;
16278        assert!(value & (Self::CSV2_MASK as u8) == value);
16279        *self = Self::from_bits_retain(
16280            (self.bits() & !(Self::CSV2_MASK << offset)) | ((value as u64) << offset),
16281        );
16282    }
16283
16284    /// Returns a copy with the `CSV2` field set to the given value.
16285    pub const fn with_csv2(mut self, value: u8) -> Self {
16286        self.set_csv2(value);
16287        self
16288    }
16289
16290    /// Returns the value of the `CSV3` field.
16291    pub const fn csv3(self) -> u8 {
16292        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
16293    }
16294
16295    /// Sets the value of the `CSV3` field.
16296    pub const fn set_csv3(&mut self, value: u8) {
16297        let offset = Self::CSV3_SHIFT;
16298        assert!(value & (Self::CSV3_MASK as u8) == value);
16299        *self = Self::from_bits_retain(
16300            (self.bits() & !(Self::CSV3_MASK << offset)) | ((value as u64) << offset),
16301        );
16302    }
16303
16304    /// Returns a copy with the `CSV3` field set to the given value.
16305    pub const fn with_csv3(mut self, value: u8) -> Self {
16306        self.set_csv3(value);
16307        self
16308    }
16309}
16310
16311#[cfg(feature = "el1")]
16312bitflags! {
16313    /// `ID_AA64PFR1_EL1` system register value.
16314    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16315    #[repr(transparent)]
16316    pub struct IdAa64pfr1El1: u64 {
16317    }
16318}
16319
16320#[cfg(feature = "el1")]
16321impl IdAa64pfr1El1 {
16322    /// Offset of the `BT` field.
16323    pub const BT_SHIFT: u32 = 0;
16324    /// Mask for the `BT` field.
16325    pub const BT_MASK: u64 = 0b1111;
16326    /// Offset of the `SSBS` field.
16327    pub const SSBS_SHIFT: u32 = 4;
16328    /// Mask for the `SSBS` field.
16329    pub const SSBS_MASK: u64 = 0b1111;
16330    /// Offset of the `MTE` field.
16331    pub const MTE_SHIFT: u32 = 8;
16332    /// Mask for the `MTE` field.
16333    pub const MTE_MASK: u64 = 0b1111;
16334    /// Offset of the `RAS_frac` field.
16335    pub const RAS_FRAC_SHIFT: u32 = 12;
16336    /// Mask for the `RAS_frac` field.
16337    pub const RAS_FRAC_MASK: u64 = 0b1111;
16338    /// Offset of the `MPAM_frac` field.
16339    pub const MPAM_FRAC_SHIFT: u32 = 16;
16340    /// Mask for the `MPAM_frac` field.
16341    pub const MPAM_FRAC_MASK: u64 = 0b1111;
16342    /// Offset of the `SME` field.
16343    pub const SME_SHIFT: u32 = 24;
16344    /// Mask for the `SME` field.
16345    pub const SME_MASK: u64 = 0b1111;
16346    /// Offset of the `RNDR_trap` field.
16347    pub const RNDR_TRAP_SHIFT: u32 = 28;
16348    /// Mask for the `RNDR_trap` field.
16349    pub const RNDR_TRAP_MASK: u64 = 0b1111;
16350    /// Offset of the `CSV2_frac` field.
16351    pub const CSV2_FRAC_SHIFT: u32 = 32;
16352    /// Mask for the `CSV2_frac` field.
16353    pub const CSV2_FRAC_MASK: u64 = 0b1111;
16354    /// Offset of the `NMI` field.
16355    pub const NMI_SHIFT: u32 = 36;
16356    /// Mask for the `NMI` field.
16357    pub const NMI_MASK: u64 = 0b1111;
16358    /// Offset of the `MTE_frac` field.
16359    pub const MTE_FRAC_SHIFT: u32 = 40;
16360    /// Mask for the `MTE_frac` field.
16361    pub const MTE_FRAC_MASK: u64 = 0b1111;
16362    /// Offset of the `GCS` field.
16363    pub const GCS_SHIFT: u32 = 44;
16364    /// Mask for the `GCS` field.
16365    pub const GCS_MASK: u64 = 0b1111;
16366    /// Offset of the `THE` field.
16367    pub const THE_SHIFT: u32 = 48;
16368    /// Mask for the `THE` field.
16369    pub const THE_MASK: u64 = 0b1111;
16370    /// Offset of the `MTEX` field.
16371    pub const MTEX_SHIFT: u32 = 52;
16372    /// Mask for the `MTEX` field.
16373    pub const MTEX_MASK: u64 = 0b1111;
16374    /// Offset of the `DF2` field.
16375    pub const DF2_SHIFT: u32 = 56;
16376    /// Mask for the `DF2` field.
16377    pub const DF2_MASK: u64 = 0b1111;
16378    /// Offset of the `PFAR` field.
16379    pub const PFAR_SHIFT: u32 = 60;
16380    /// Mask for the `PFAR` field.
16381    pub const PFAR_MASK: u64 = 0b1111;
16382
16383    /// Returns the value of the `BT` field.
16384    pub const fn bt(self) -> u8 {
16385        ((self.bits() >> Self::BT_SHIFT) & 0b1111) as u8
16386    }
16387
16388    /// Sets the value of the `BT` field.
16389    pub const fn set_bt(&mut self, value: u8) {
16390        let offset = Self::BT_SHIFT;
16391        assert!(value & (Self::BT_MASK as u8) == value);
16392        *self = Self::from_bits_retain(
16393            (self.bits() & !(Self::BT_MASK << offset)) | ((value as u64) << offset),
16394        );
16395    }
16396
16397    /// Returns a copy with the `BT` field set to the given value.
16398    pub const fn with_bt(mut self, value: u8) -> Self {
16399        self.set_bt(value);
16400        self
16401    }
16402
16403    /// Returns the value of the `SSBS` field.
16404    pub const fn ssbs(self) -> u8 {
16405        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
16406    }
16407
16408    /// Sets the value of the `SSBS` field.
16409    pub const fn set_ssbs(&mut self, value: u8) {
16410        let offset = Self::SSBS_SHIFT;
16411        assert!(value & (Self::SSBS_MASK as u8) == value);
16412        *self = Self::from_bits_retain(
16413            (self.bits() & !(Self::SSBS_MASK << offset)) | ((value as u64) << offset),
16414        );
16415    }
16416
16417    /// Returns a copy with the `SSBS` field set to the given value.
16418    pub const fn with_ssbs(mut self, value: u8) -> Self {
16419        self.set_ssbs(value);
16420        self
16421    }
16422
16423    /// Returns the value of the `MTE` field.
16424    pub const fn mte(self) -> u8 {
16425        ((self.bits() >> Self::MTE_SHIFT) & 0b1111) as u8
16426    }
16427
16428    /// Sets the value of the `MTE` field.
16429    pub const fn set_mte(&mut self, value: u8) {
16430        let offset = Self::MTE_SHIFT;
16431        assert!(value & (Self::MTE_MASK as u8) == value);
16432        *self = Self::from_bits_retain(
16433            (self.bits() & !(Self::MTE_MASK << offset)) | ((value as u64) << offset),
16434        );
16435    }
16436
16437    /// Returns a copy with the `MTE` field set to the given value.
16438    pub const fn with_mte(mut self, value: u8) -> Self {
16439        self.set_mte(value);
16440        self
16441    }
16442
16443    /// Returns the value of the `RAS_frac` field.
16444    pub const fn ras_frac(self) -> u8 {
16445        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
16446    }
16447
16448    /// Sets the value of the `RAS_frac` field.
16449    pub const fn set_ras_frac(&mut self, value: u8) {
16450        let offset = Self::RAS_FRAC_SHIFT;
16451        assert!(value & (Self::RAS_FRAC_MASK as u8) == value);
16452        *self = Self::from_bits_retain(
16453            (self.bits() & !(Self::RAS_FRAC_MASK << offset)) | ((value as u64) << offset),
16454        );
16455    }
16456
16457    /// Returns a copy with the `RAS_frac` field set to the given value.
16458    pub const fn with_ras_frac(mut self, value: u8) -> Self {
16459        self.set_ras_frac(value);
16460        self
16461    }
16462
16463    /// Returns the value of the `MPAM_frac` field.
16464    pub const fn mpam_frac(self) -> u8 {
16465        ((self.bits() >> Self::MPAM_FRAC_SHIFT) & 0b1111) as u8
16466    }
16467
16468    /// Sets the value of the `MPAM_frac` field.
16469    pub const fn set_mpam_frac(&mut self, value: u8) {
16470        let offset = Self::MPAM_FRAC_SHIFT;
16471        assert!(value & (Self::MPAM_FRAC_MASK as u8) == value);
16472        *self = Self::from_bits_retain(
16473            (self.bits() & !(Self::MPAM_FRAC_MASK << offset)) | ((value as u64) << offset),
16474        );
16475    }
16476
16477    /// Returns a copy with the `MPAM_frac` field set to the given value.
16478    pub const fn with_mpam_frac(mut self, value: u8) -> Self {
16479        self.set_mpam_frac(value);
16480        self
16481    }
16482
16483    /// Returns the value of the `SME` field.
16484    pub const fn sme(self) -> u8 {
16485        ((self.bits() >> Self::SME_SHIFT) & 0b1111) as u8
16486    }
16487
16488    /// Sets the value of the `SME` field.
16489    pub const fn set_sme(&mut self, value: u8) {
16490        let offset = Self::SME_SHIFT;
16491        assert!(value & (Self::SME_MASK as u8) == value);
16492        *self = Self::from_bits_retain(
16493            (self.bits() & !(Self::SME_MASK << offset)) | ((value as u64) << offset),
16494        );
16495    }
16496
16497    /// Returns a copy with the `SME` field set to the given value.
16498    pub const fn with_sme(mut self, value: u8) -> Self {
16499        self.set_sme(value);
16500        self
16501    }
16502
16503    /// Returns the value of the `RNDR_trap` field.
16504    pub const fn rndr_trap(self) -> u8 {
16505        ((self.bits() >> Self::RNDR_TRAP_SHIFT) & 0b1111) as u8
16506    }
16507
16508    /// Sets the value of the `RNDR_trap` field.
16509    pub const fn set_rndr_trap(&mut self, value: u8) {
16510        let offset = Self::RNDR_TRAP_SHIFT;
16511        assert!(value & (Self::RNDR_TRAP_MASK as u8) == value);
16512        *self = Self::from_bits_retain(
16513            (self.bits() & !(Self::RNDR_TRAP_MASK << offset)) | ((value as u64) << offset),
16514        );
16515    }
16516
16517    /// Returns a copy with the `RNDR_trap` field set to the given value.
16518    pub const fn with_rndr_trap(mut self, value: u8) -> Self {
16519        self.set_rndr_trap(value);
16520        self
16521    }
16522
16523    /// Returns the value of the `CSV2_frac` field.
16524    pub const fn csv2_frac(self) -> u8 {
16525        ((self.bits() >> Self::CSV2_FRAC_SHIFT) & 0b1111) as u8
16526    }
16527
16528    /// Sets the value of the `CSV2_frac` field.
16529    pub const fn set_csv2_frac(&mut self, value: u8) {
16530        let offset = Self::CSV2_FRAC_SHIFT;
16531        assert!(value & (Self::CSV2_FRAC_MASK as u8) == value);
16532        *self = Self::from_bits_retain(
16533            (self.bits() & !(Self::CSV2_FRAC_MASK << offset)) | ((value as u64) << offset),
16534        );
16535    }
16536
16537    /// Returns a copy with the `CSV2_frac` field set to the given value.
16538    pub const fn with_csv2_frac(mut self, value: u8) -> Self {
16539        self.set_csv2_frac(value);
16540        self
16541    }
16542
16543    /// Returns the value of the `NMI` field.
16544    pub const fn nmi(self) -> u8 {
16545        ((self.bits() >> Self::NMI_SHIFT) & 0b1111) as u8
16546    }
16547
16548    /// Sets the value of the `NMI` field.
16549    pub const fn set_nmi(&mut self, value: u8) {
16550        let offset = Self::NMI_SHIFT;
16551        assert!(value & (Self::NMI_MASK as u8) == value);
16552        *self = Self::from_bits_retain(
16553            (self.bits() & !(Self::NMI_MASK << offset)) | ((value as u64) << offset),
16554        );
16555    }
16556
16557    /// Returns a copy with the `NMI` field set to the given value.
16558    pub const fn with_nmi(mut self, value: u8) -> Self {
16559        self.set_nmi(value);
16560        self
16561    }
16562
16563    /// Returns the value of the `MTE_frac` field.
16564    pub const fn mte_frac(self) -> u8 {
16565        ((self.bits() >> Self::MTE_FRAC_SHIFT) & 0b1111) as u8
16566    }
16567
16568    /// Sets the value of the `MTE_frac` field.
16569    pub const fn set_mte_frac(&mut self, value: u8) {
16570        let offset = Self::MTE_FRAC_SHIFT;
16571        assert!(value & (Self::MTE_FRAC_MASK as u8) == value);
16572        *self = Self::from_bits_retain(
16573            (self.bits() & !(Self::MTE_FRAC_MASK << offset)) | ((value as u64) << offset),
16574        );
16575    }
16576
16577    /// Returns a copy with the `MTE_frac` field set to the given value.
16578    pub const fn with_mte_frac(mut self, value: u8) -> Self {
16579        self.set_mte_frac(value);
16580        self
16581    }
16582
16583    /// Returns the value of the `GCS` field.
16584    pub const fn gcs(self) -> u8 {
16585        ((self.bits() >> Self::GCS_SHIFT) & 0b1111) as u8
16586    }
16587
16588    /// Sets the value of the `GCS` field.
16589    pub const fn set_gcs(&mut self, value: u8) {
16590        let offset = Self::GCS_SHIFT;
16591        assert!(value & (Self::GCS_MASK as u8) == value);
16592        *self = Self::from_bits_retain(
16593            (self.bits() & !(Self::GCS_MASK << offset)) | ((value as u64) << offset),
16594        );
16595    }
16596
16597    /// Returns a copy with the `GCS` field set to the given value.
16598    pub const fn with_gcs(mut self, value: u8) -> Self {
16599        self.set_gcs(value);
16600        self
16601    }
16602
16603    /// Returns the value of the `THE` field.
16604    pub const fn the(self) -> u8 {
16605        ((self.bits() >> Self::THE_SHIFT) & 0b1111) as u8
16606    }
16607
16608    /// Sets the value of the `THE` field.
16609    pub const fn set_the(&mut self, value: u8) {
16610        let offset = Self::THE_SHIFT;
16611        assert!(value & (Self::THE_MASK as u8) == value);
16612        *self = Self::from_bits_retain(
16613            (self.bits() & !(Self::THE_MASK << offset)) | ((value as u64) << offset),
16614        );
16615    }
16616
16617    /// Returns a copy with the `THE` field set to the given value.
16618    pub const fn with_the(mut self, value: u8) -> Self {
16619        self.set_the(value);
16620        self
16621    }
16622
16623    /// Returns the value of the `MTEX` field.
16624    pub const fn mtex(self) -> u8 {
16625        ((self.bits() >> Self::MTEX_SHIFT) & 0b1111) as u8
16626    }
16627
16628    /// Sets the value of the `MTEX` field.
16629    pub const fn set_mtex(&mut self, value: u8) {
16630        let offset = Self::MTEX_SHIFT;
16631        assert!(value & (Self::MTEX_MASK as u8) == value);
16632        *self = Self::from_bits_retain(
16633            (self.bits() & !(Self::MTEX_MASK << offset)) | ((value as u64) << offset),
16634        );
16635    }
16636
16637    /// Returns a copy with the `MTEX` field set to the given value.
16638    pub const fn with_mtex(mut self, value: u8) -> Self {
16639        self.set_mtex(value);
16640        self
16641    }
16642
16643    /// Returns the value of the `DF2` field.
16644    pub const fn df2(self) -> u8 {
16645        ((self.bits() >> Self::DF2_SHIFT) & 0b1111) as u8
16646    }
16647
16648    /// Sets the value of the `DF2` field.
16649    pub const fn set_df2(&mut self, value: u8) {
16650        let offset = Self::DF2_SHIFT;
16651        assert!(value & (Self::DF2_MASK as u8) == value);
16652        *self = Self::from_bits_retain(
16653            (self.bits() & !(Self::DF2_MASK << offset)) | ((value as u64) << offset),
16654        );
16655    }
16656
16657    /// Returns a copy with the `DF2` field set to the given value.
16658    pub const fn with_df2(mut self, value: u8) -> Self {
16659        self.set_df2(value);
16660        self
16661    }
16662
16663    /// Returns the value of the `PFAR` field.
16664    pub const fn pfar(self) -> u8 {
16665        ((self.bits() >> Self::PFAR_SHIFT) & 0b1111) as u8
16666    }
16667
16668    /// Sets the value of the `PFAR` field.
16669    pub const fn set_pfar(&mut self, value: u8) {
16670        let offset = Self::PFAR_SHIFT;
16671        assert!(value & (Self::PFAR_MASK as u8) == value);
16672        *self = Self::from_bits_retain(
16673            (self.bits() & !(Self::PFAR_MASK << offset)) | ((value as u64) << offset),
16674        );
16675    }
16676
16677    /// Returns a copy with the `PFAR` field set to the given value.
16678    pub const fn with_pfar(mut self, value: u8) -> Self {
16679        self.set_pfar(value);
16680        self
16681    }
16682}
16683
16684#[cfg(feature = "el1")]
16685bitflags! {
16686    /// `ID_AA64SMFR0_EL1` system register value.
16687    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16688    #[repr(transparent)]
16689    pub struct IdAa64smfr0El1: u64 {
16690        /// `SMOP4` bit.
16691        const SMOP4 = 1 << 0;
16692        /// `STMOP` bit.
16693        const STMOP = 1 << 16;
16694        /// `SFEXPA` bit.
16695        const SFEXPA = 1 << 23;
16696        /// `AES` bit.
16697        const AES = 1 << 24;
16698        /// `SBitPerm` bit.
16699        const SBITPERM = 1 << 25;
16700        /// `SF8DP2` bit.
16701        const SF8DP2 = 1 << 28;
16702        /// `SF8DP4` bit.
16703        const SF8DP4 = 1 << 29;
16704        /// `SF8FMA` bit.
16705        const SF8FMA = 1 << 30;
16706        /// `F32F32` bit.
16707        const F32F32 = 1 << 32;
16708        /// `BI32I32` bit.
16709        const BI32I32 = 1 << 33;
16710        /// `B16F32` bit.
16711        const B16F32 = 1 << 34;
16712        /// `F16F32` bit.
16713        const F16F32 = 1 << 35;
16714        /// `F8F32` bit.
16715        const F8F32 = 1 << 40;
16716        /// `F8F16` bit.
16717        const F8F16 = 1 << 41;
16718        /// `F16F16` bit.
16719        const F16F16 = 1 << 42;
16720        /// `B16B16` bit.
16721        const B16B16 = 1 << 43;
16722        /// `F64F64` bit.
16723        const F64F64 = 1 << 48;
16724        /// `LUTv2` bit.
16725        const LUTV2 = 1 << 60;
16726        /// `LUT6` bit.
16727        const LUT6 = 1 << 61;
16728        /// `FA64` bit.
16729        const FA64 = 1 << 63;
16730    }
16731}
16732
16733#[cfg(feature = "el1")]
16734impl IdAa64smfr0El1 {
16735    /// Offset of the `SMOP4` field.
16736    pub const SMOP4_SHIFT: u32 = 0;
16737    /// Offset of the `STMOP` field.
16738    pub const STMOP_SHIFT: u32 = 16;
16739    /// Offset of the `SFEXPA` field.
16740    pub const SFEXPA_SHIFT: u32 = 23;
16741    /// Offset of the `AES` field.
16742    pub const AES_SHIFT: u32 = 24;
16743    /// Offset of the `SBitPerm` field.
16744    pub const SBITPERM_SHIFT: u32 = 25;
16745    /// Offset of the `SF8DP2` field.
16746    pub const SF8DP2_SHIFT: u32 = 28;
16747    /// Offset of the `SF8DP4` field.
16748    pub const SF8DP4_SHIFT: u32 = 29;
16749    /// Offset of the `SF8FMA` field.
16750    pub const SF8FMA_SHIFT: u32 = 30;
16751    /// Offset of the `F32F32` field.
16752    pub const F32F32_SHIFT: u32 = 32;
16753    /// Offset of the `BI32I32` field.
16754    pub const BI32I32_SHIFT: u32 = 33;
16755    /// Offset of the `B16F32` field.
16756    pub const B16F32_SHIFT: u32 = 34;
16757    /// Offset of the `F16F32` field.
16758    pub const F16F32_SHIFT: u32 = 35;
16759    /// Offset of the `I8I32` field.
16760    pub const I8I32_SHIFT: u32 = 36;
16761    /// Mask for the `I8I32` field.
16762    pub const I8I32_MASK: u64 = 0b1111;
16763    /// Offset of the `F8F32` field.
16764    pub const F8F32_SHIFT: u32 = 40;
16765    /// Offset of the `F8F16` field.
16766    pub const F8F16_SHIFT: u32 = 41;
16767    /// Offset of the `F16F16` field.
16768    pub const F16F16_SHIFT: u32 = 42;
16769    /// Offset of the `B16B16` field.
16770    pub const B16B16_SHIFT: u32 = 43;
16771    /// Offset of the `I16I32` field.
16772    pub const I16I32_SHIFT: u32 = 44;
16773    /// Mask for the `I16I32` field.
16774    pub const I16I32_MASK: u64 = 0b1111;
16775    /// Offset of the `F64F64` field.
16776    pub const F64F64_SHIFT: u32 = 48;
16777    /// Offset of the `I16I64` field.
16778    pub const I16I64_SHIFT: u32 = 52;
16779    /// Mask for the `I16I64` field.
16780    pub const I16I64_MASK: u64 = 0b1111;
16781    /// Offset of the `SMEver` field.
16782    pub const SMEVER_SHIFT: u32 = 56;
16783    /// Mask for the `SMEver` field.
16784    pub const SMEVER_MASK: u64 = 0b1111;
16785    /// Offset of the `LUTv2` field.
16786    pub const LUTV2_SHIFT: u32 = 60;
16787    /// Offset of the `LUT6` field.
16788    pub const LUT6_SHIFT: u32 = 61;
16789    /// Offset of the `FA64` field.
16790    pub const FA64_SHIFT: u32 = 63;
16791
16792    /// Returns the value of the `I8I32` field.
16793    pub const fn i8i32(self) -> u8 {
16794        ((self.bits() >> Self::I8I32_SHIFT) & 0b1111) as u8
16795    }
16796
16797    /// Sets the value of the `I8I32` field.
16798    pub const fn set_i8i32(&mut self, value: u8) {
16799        let offset = Self::I8I32_SHIFT;
16800        assert!(value & (Self::I8I32_MASK as u8) == value);
16801        *self = Self::from_bits_retain(
16802            (self.bits() & !(Self::I8I32_MASK << offset)) | ((value as u64) << offset),
16803        );
16804    }
16805
16806    /// Returns a copy with the `I8I32` field set to the given value.
16807    pub const fn with_i8i32(mut self, value: u8) -> Self {
16808        self.set_i8i32(value);
16809        self
16810    }
16811
16812    /// Returns the value of the `I16I32` field.
16813    pub const fn i16i32(self) -> u8 {
16814        ((self.bits() >> Self::I16I32_SHIFT) & 0b1111) as u8
16815    }
16816
16817    /// Sets the value of the `I16I32` field.
16818    pub const fn set_i16i32(&mut self, value: u8) {
16819        let offset = Self::I16I32_SHIFT;
16820        assert!(value & (Self::I16I32_MASK as u8) == value);
16821        *self = Self::from_bits_retain(
16822            (self.bits() & !(Self::I16I32_MASK << offset)) | ((value as u64) << offset),
16823        );
16824    }
16825
16826    /// Returns a copy with the `I16I32` field set to the given value.
16827    pub const fn with_i16i32(mut self, value: u8) -> Self {
16828        self.set_i16i32(value);
16829        self
16830    }
16831
16832    /// Returns the value of the `I16I64` field.
16833    pub const fn i16i64(self) -> u8 {
16834        ((self.bits() >> Self::I16I64_SHIFT) & 0b1111) as u8
16835    }
16836
16837    /// Sets the value of the `I16I64` field.
16838    pub const fn set_i16i64(&mut self, value: u8) {
16839        let offset = Self::I16I64_SHIFT;
16840        assert!(value & (Self::I16I64_MASK as u8) == value);
16841        *self = Self::from_bits_retain(
16842            (self.bits() & !(Self::I16I64_MASK << offset)) | ((value as u64) << offset),
16843        );
16844    }
16845
16846    /// Returns a copy with the `I16I64` field set to the given value.
16847    pub const fn with_i16i64(mut self, value: u8) -> Self {
16848        self.set_i16i64(value);
16849        self
16850    }
16851
16852    /// Returns the value of the `SMEver` field.
16853    pub const fn smever(self) -> u8 {
16854        ((self.bits() >> Self::SMEVER_SHIFT) & 0b1111) as u8
16855    }
16856
16857    /// Sets the value of the `SMEver` field.
16858    pub const fn set_smever(&mut self, value: u8) {
16859        let offset = Self::SMEVER_SHIFT;
16860        assert!(value & (Self::SMEVER_MASK as u8) == value);
16861        *self = Self::from_bits_retain(
16862            (self.bits() & !(Self::SMEVER_MASK << offset)) | ((value as u64) << offset),
16863        );
16864    }
16865
16866    /// Returns a copy with the `SMEver` field set to the given value.
16867    pub const fn with_smever(mut self, value: u8) -> Self {
16868        self.set_smever(value);
16869        self
16870    }
16871}
16872
16873bitflags! {
16874    /// `ID_DFR0` system register value.
16875    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
16876    #[repr(transparent)]
16877    pub struct IdDfr0: u32 {
16878    }
16879}
16880
16881impl IdDfr0 {
16882    /// Offset of the `CopDbg` field.
16883    pub const COPDBG_SHIFT: u32 = 0;
16884    /// Mask for the `CopDbg` field.
16885    pub const COPDBG_MASK: u32 = 0b1111;
16886    /// Offset of the `CopSDbg` field.
16887    pub const COPSDBG_SHIFT: u32 = 4;
16888    /// Mask for the `CopSDbg` field.
16889    pub const COPSDBG_MASK: u32 = 0b1111;
16890    /// Offset of the `MMapDbg` field.
16891    pub const MMAPDBG_SHIFT: u32 = 8;
16892    /// Mask for the `MMapDbg` field.
16893    pub const MMAPDBG_MASK: u32 = 0b1111;
16894    /// Offset of the `CopTrc` field.
16895    pub const COPTRC_SHIFT: u32 = 12;
16896    /// Mask for the `CopTrc` field.
16897    pub const COPTRC_MASK: u32 = 0b1111;
16898    /// Offset of the `MMapTrc` field.
16899    pub const MMAPTRC_SHIFT: u32 = 16;
16900    /// Mask for the `MMapTrc` field.
16901    pub const MMAPTRC_MASK: u32 = 0b1111;
16902    /// Offset of the `MProfDbg` field.
16903    pub const MPROFDBG_SHIFT: u32 = 20;
16904    /// Mask for the `MProfDbg` field.
16905    pub const MPROFDBG_MASK: u32 = 0b1111;
16906    /// Offset of the `PerfMon` field.
16907    pub const PERFMON_SHIFT: u32 = 24;
16908    /// Mask for the `PerfMon` field.
16909    pub const PERFMON_MASK: u32 = 0b1111;
16910    /// Offset of the `TraceFilt` field.
16911    pub const TRACEFILT_SHIFT: u32 = 28;
16912    /// Mask for the `TraceFilt` field.
16913    pub const TRACEFILT_MASK: u32 = 0b1111;
16914
16915    /// Returns the value of the `CopDbg` field.
16916    pub const fn copdbg(self) -> u8 {
16917        ((self.bits() >> Self::COPDBG_SHIFT) & 0b1111) as u8
16918    }
16919
16920    /// Sets the value of the `CopDbg` field.
16921    pub const fn set_copdbg(&mut self, value: u8) {
16922        let offset = Self::COPDBG_SHIFT;
16923        assert!(value & (Self::COPDBG_MASK as u8) == value);
16924        *self = Self::from_bits_retain(
16925            (self.bits() & !(Self::COPDBG_MASK << offset)) | ((value as u32) << offset),
16926        );
16927    }
16928
16929    /// Returns a copy with the `CopDbg` field set to the given value.
16930    pub const fn with_copdbg(mut self, value: u8) -> Self {
16931        self.set_copdbg(value);
16932        self
16933    }
16934
16935    /// Returns the value of the `CopSDbg` field.
16936    pub const fn copsdbg(self) -> u8 {
16937        ((self.bits() >> Self::COPSDBG_SHIFT) & 0b1111) as u8
16938    }
16939
16940    /// Sets the value of the `CopSDbg` field.
16941    pub const fn set_copsdbg(&mut self, value: u8) {
16942        let offset = Self::COPSDBG_SHIFT;
16943        assert!(value & (Self::COPSDBG_MASK as u8) == value);
16944        *self = Self::from_bits_retain(
16945            (self.bits() & !(Self::COPSDBG_MASK << offset)) | ((value as u32) << offset),
16946        );
16947    }
16948
16949    /// Returns a copy with the `CopSDbg` field set to the given value.
16950    pub const fn with_copsdbg(mut self, value: u8) -> Self {
16951        self.set_copsdbg(value);
16952        self
16953    }
16954
16955    /// Returns the value of the `MMapDbg` field.
16956    pub const fn mmapdbg(self) -> u8 {
16957        ((self.bits() >> Self::MMAPDBG_SHIFT) & 0b1111) as u8
16958    }
16959
16960    /// Sets the value of the `MMapDbg` field.
16961    pub const fn set_mmapdbg(&mut self, value: u8) {
16962        let offset = Self::MMAPDBG_SHIFT;
16963        assert!(value & (Self::MMAPDBG_MASK as u8) == value);
16964        *self = Self::from_bits_retain(
16965            (self.bits() & !(Self::MMAPDBG_MASK << offset)) | ((value as u32) << offset),
16966        );
16967    }
16968
16969    /// Returns a copy with the `MMapDbg` field set to the given value.
16970    pub const fn with_mmapdbg(mut self, value: u8) -> Self {
16971        self.set_mmapdbg(value);
16972        self
16973    }
16974
16975    /// Returns the value of the `CopTrc` field.
16976    pub const fn coptrc(self) -> u8 {
16977        ((self.bits() >> Self::COPTRC_SHIFT) & 0b1111) as u8
16978    }
16979
16980    /// Sets the value of the `CopTrc` field.
16981    pub const fn set_coptrc(&mut self, value: u8) {
16982        let offset = Self::COPTRC_SHIFT;
16983        assert!(value & (Self::COPTRC_MASK as u8) == value);
16984        *self = Self::from_bits_retain(
16985            (self.bits() & !(Self::COPTRC_MASK << offset)) | ((value as u32) << offset),
16986        );
16987    }
16988
16989    /// Returns a copy with the `CopTrc` field set to the given value.
16990    pub const fn with_coptrc(mut self, value: u8) -> Self {
16991        self.set_coptrc(value);
16992        self
16993    }
16994
16995    /// Returns the value of the `MMapTrc` field.
16996    pub const fn mmaptrc(self) -> u8 {
16997        ((self.bits() >> Self::MMAPTRC_SHIFT) & 0b1111) as u8
16998    }
16999
17000    /// Sets the value of the `MMapTrc` field.
17001    pub const fn set_mmaptrc(&mut self, value: u8) {
17002        let offset = Self::MMAPTRC_SHIFT;
17003        assert!(value & (Self::MMAPTRC_MASK as u8) == value);
17004        *self = Self::from_bits_retain(
17005            (self.bits() & !(Self::MMAPTRC_MASK << offset)) | ((value as u32) << offset),
17006        );
17007    }
17008
17009    /// Returns a copy with the `MMapTrc` field set to the given value.
17010    pub const fn with_mmaptrc(mut self, value: u8) -> Self {
17011        self.set_mmaptrc(value);
17012        self
17013    }
17014
17015    /// Returns the value of the `MProfDbg` field.
17016    pub const fn mprofdbg(self) -> u8 {
17017        ((self.bits() >> Self::MPROFDBG_SHIFT) & 0b1111) as u8
17018    }
17019
17020    /// Sets the value of the `MProfDbg` field.
17021    pub const fn set_mprofdbg(&mut self, value: u8) {
17022        let offset = Self::MPROFDBG_SHIFT;
17023        assert!(value & (Self::MPROFDBG_MASK as u8) == value);
17024        *self = Self::from_bits_retain(
17025            (self.bits() & !(Self::MPROFDBG_MASK << offset)) | ((value as u32) << offset),
17026        );
17027    }
17028
17029    /// Returns a copy with the `MProfDbg` field set to the given value.
17030    pub const fn with_mprofdbg(mut self, value: u8) -> Self {
17031        self.set_mprofdbg(value);
17032        self
17033    }
17034
17035    /// Returns the value of the `PerfMon` field.
17036    pub const fn perfmon(self) -> u8 {
17037        ((self.bits() >> Self::PERFMON_SHIFT) & 0b1111) as u8
17038    }
17039
17040    /// Sets the value of the `PerfMon` field.
17041    pub const fn set_perfmon(&mut self, value: u8) {
17042        let offset = Self::PERFMON_SHIFT;
17043        assert!(value & (Self::PERFMON_MASK as u8) == value);
17044        *self = Self::from_bits_retain(
17045            (self.bits() & !(Self::PERFMON_MASK << offset)) | ((value as u32) << offset),
17046        );
17047    }
17048
17049    /// Returns a copy with the `PerfMon` field set to the given value.
17050    pub const fn with_perfmon(mut self, value: u8) -> Self {
17051        self.set_perfmon(value);
17052        self
17053    }
17054
17055    /// Returns the value of the `TraceFilt` field.
17056    pub const fn tracefilt(self) -> u8 {
17057        ((self.bits() >> Self::TRACEFILT_SHIFT) & 0b1111) as u8
17058    }
17059
17060    /// Sets the value of the `TraceFilt` field.
17061    pub const fn set_tracefilt(&mut self, value: u8) {
17062        let offset = Self::TRACEFILT_SHIFT;
17063        assert!(value & (Self::TRACEFILT_MASK as u8) == value);
17064        *self = Self::from_bits_retain(
17065            (self.bits() & !(Self::TRACEFILT_MASK << offset)) | ((value as u32) << offset),
17066        );
17067    }
17068
17069    /// Returns a copy with the `TraceFilt` field set to the given value.
17070    pub const fn with_tracefilt(mut self, value: u8) -> Self {
17071        self.set_tracefilt(value);
17072        self
17073    }
17074}
17075
17076bitflags! {
17077    /// `ID_DFR1` system register value.
17078    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17079    #[repr(transparent)]
17080    pub struct IdDfr1: u32 {
17081    }
17082}
17083
17084impl IdDfr1 {
17085    /// Offset of the `MTPMU` field.
17086    pub const MTPMU_SHIFT: u32 = 0;
17087    /// Mask for the `MTPMU` field.
17088    pub const MTPMU_MASK: u32 = 0b1111;
17089    /// Offset of the `HPMN0` field.
17090    pub const HPMN0_SHIFT: u32 = 4;
17091    /// Mask for the `HPMN0` field.
17092    pub const HPMN0_MASK: u32 = 0b1111;
17093
17094    /// Returns the value of the `MTPMU` field.
17095    pub const fn mtpmu(self) -> u8 {
17096        ((self.bits() >> Self::MTPMU_SHIFT) & 0b1111) as u8
17097    }
17098
17099    /// Sets the value of the `MTPMU` field.
17100    pub const fn set_mtpmu(&mut self, value: u8) {
17101        let offset = Self::MTPMU_SHIFT;
17102        assert!(value & (Self::MTPMU_MASK as u8) == value);
17103        *self = Self::from_bits_retain(
17104            (self.bits() & !(Self::MTPMU_MASK << offset)) | ((value as u32) << offset),
17105        );
17106    }
17107
17108    /// Returns a copy with the `MTPMU` field set to the given value.
17109    pub const fn with_mtpmu(mut self, value: u8) -> Self {
17110        self.set_mtpmu(value);
17111        self
17112    }
17113
17114    /// Returns the value of the `HPMN0` field.
17115    pub const fn hpmn0(self) -> u8 {
17116        ((self.bits() >> Self::HPMN0_SHIFT) & 0b1111) as u8
17117    }
17118
17119    /// Sets the value of the `HPMN0` field.
17120    pub const fn set_hpmn0(&mut self, value: u8) {
17121        let offset = Self::HPMN0_SHIFT;
17122        assert!(value & (Self::HPMN0_MASK as u8) == value);
17123        *self = Self::from_bits_retain(
17124            (self.bits() & !(Self::HPMN0_MASK << offset)) | ((value as u32) << offset),
17125        );
17126    }
17127
17128    /// Returns a copy with the `HPMN0` field set to the given value.
17129    pub const fn with_hpmn0(mut self, value: u8) -> Self {
17130        self.set_hpmn0(value);
17131        self
17132    }
17133}
17134
17135bitflags! {
17136    /// `ID_ISAR0` system register value.
17137    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17138    #[repr(transparent)]
17139    pub struct IdIsar0: u32 {
17140    }
17141}
17142
17143impl IdIsar0 {
17144    /// Offset of the `Swap` field.
17145    pub const SWAP_SHIFT: u32 = 0;
17146    /// Mask for the `Swap` field.
17147    pub const SWAP_MASK: u32 = 0b1111;
17148    /// Offset of the `BitCount` field.
17149    pub const BITCOUNT_SHIFT: u32 = 4;
17150    /// Mask for the `BitCount` field.
17151    pub const BITCOUNT_MASK: u32 = 0b1111;
17152    /// Offset of the `BitField` field.
17153    pub const BITFIELD_SHIFT: u32 = 8;
17154    /// Mask for the `BitField` field.
17155    pub const BITFIELD_MASK: u32 = 0b1111;
17156    /// Offset of the `CmpBranch` field.
17157    pub const CMPBRANCH_SHIFT: u32 = 12;
17158    /// Mask for the `CmpBranch` field.
17159    pub const CMPBRANCH_MASK: u32 = 0b1111;
17160    /// Offset of the `Coproc` field.
17161    pub const COPROC_SHIFT: u32 = 16;
17162    /// Mask for the `Coproc` field.
17163    pub const COPROC_MASK: u32 = 0b1111;
17164    /// Offset of the `Debug` field.
17165    pub const DEBUG_SHIFT: u32 = 20;
17166    /// Mask for the `Debug` field.
17167    pub const DEBUG_MASK: u32 = 0b1111;
17168    /// Offset of the `Divide` field.
17169    pub const DIVIDE_SHIFT: u32 = 24;
17170    /// Mask for the `Divide` field.
17171    pub const DIVIDE_MASK: u32 = 0b1111;
17172
17173    /// Returns the value of the `Swap` field.
17174    pub const fn swap(self) -> u8 {
17175        ((self.bits() >> Self::SWAP_SHIFT) & 0b1111) as u8
17176    }
17177
17178    /// Sets the value of the `Swap` field.
17179    pub const fn set_swap(&mut self, value: u8) {
17180        let offset = Self::SWAP_SHIFT;
17181        assert!(value & (Self::SWAP_MASK as u8) == value);
17182        *self = Self::from_bits_retain(
17183            (self.bits() & !(Self::SWAP_MASK << offset)) | ((value as u32) << offset),
17184        );
17185    }
17186
17187    /// Returns a copy with the `Swap` field set to the given value.
17188    pub const fn with_swap(mut self, value: u8) -> Self {
17189        self.set_swap(value);
17190        self
17191    }
17192
17193    /// Returns the value of the `BitCount` field.
17194    pub const fn bitcount(self) -> u8 {
17195        ((self.bits() >> Self::BITCOUNT_SHIFT) & 0b1111) as u8
17196    }
17197
17198    /// Sets the value of the `BitCount` field.
17199    pub const fn set_bitcount(&mut self, value: u8) {
17200        let offset = Self::BITCOUNT_SHIFT;
17201        assert!(value & (Self::BITCOUNT_MASK as u8) == value);
17202        *self = Self::from_bits_retain(
17203            (self.bits() & !(Self::BITCOUNT_MASK << offset)) | ((value as u32) << offset),
17204        );
17205    }
17206
17207    /// Returns a copy with the `BitCount` field set to the given value.
17208    pub const fn with_bitcount(mut self, value: u8) -> Self {
17209        self.set_bitcount(value);
17210        self
17211    }
17212
17213    /// Returns the value of the `BitField` field.
17214    pub const fn bitfield(self) -> u8 {
17215        ((self.bits() >> Self::BITFIELD_SHIFT) & 0b1111) as u8
17216    }
17217
17218    /// Sets the value of the `BitField` field.
17219    pub const fn set_bitfield(&mut self, value: u8) {
17220        let offset = Self::BITFIELD_SHIFT;
17221        assert!(value & (Self::BITFIELD_MASK as u8) == value);
17222        *self = Self::from_bits_retain(
17223            (self.bits() & !(Self::BITFIELD_MASK << offset)) | ((value as u32) << offset),
17224        );
17225    }
17226
17227    /// Returns a copy with the `BitField` field set to the given value.
17228    pub const fn with_bitfield(mut self, value: u8) -> Self {
17229        self.set_bitfield(value);
17230        self
17231    }
17232
17233    /// Returns the value of the `CmpBranch` field.
17234    pub const fn cmpbranch(self) -> u8 {
17235        ((self.bits() >> Self::CMPBRANCH_SHIFT) & 0b1111) as u8
17236    }
17237
17238    /// Sets the value of the `CmpBranch` field.
17239    pub const fn set_cmpbranch(&mut self, value: u8) {
17240        let offset = Self::CMPBRANCH_SHIFT;
17241        assert!(value & (Self::CMPBRANCH_MASK as u8) == value);
17242        *self = Self::from_bits_retain(
17243            (self.bits() & !(Self::CMPBRANCH_MASK << offset)) | ((value as u32) << offset),
17244        );
17245    }
17246
17247    /// Returns a copy with the `CmpBranch` field set to the given value.
17248    pub const fn with_cmpbranch(mut self, value: u8) -> Self {
17249        self.set_cmpbranch(value);
17250        self
17251    }
17252
17253    /// Returns the value of the `Coproc` field.
17254    pub const fn coproc(self) -> u8 {
17255        ((self.bits() >> Self::COPROC_SHIFT) & 0b1111) as u8
17256    }
17257
17258    /// Sets the value of the `Coproc` field.
17259    pub const fn set_coproc(&mut self, value: u8) {
17260        let offset = Self::COPROC_SHIFT;
17261        assert!(value & (Self::COPROC_MASK as u8) == value);
17262        *self = Self::from_bits_retain(
17263            (self.bits() & !(Self::COPROC_MASK << offset)) | ((value as u32) << offset),
17264        );
17265    }
17266
17267    /// Returns a copy with the `Coproc` field set to the given value.
17268    pub const fn with_coproc(mut self, value: u8) -> Self {
17269        self.set_coproc(value);
17270        self
17271    }
17272
17273    /// Returns the value of the `Debug` field.
17274    pub const fn debug(self) -> u8 {
17275        ((self.bits() >> Self::DEBUG_SHIFT) & 0b1111) as u8
17276    }
17277
17278    /// Sets the value of the `Debug` field.
17279    pub const fn set_debug(&mut self, value: u8) {
17280        let offset = Self::DEBUG_SHIFT;
17281        assert!(value & (Self::DEBUG_MASK as u8) == value);
17282        *self = Self::from_bits_retain(
17283            (self.bits() & !(Self::DEBUG_MASK << offset)) | ((value as u32) << offset),
17284        );
17285    }
17286
17287    /// Returns a copy with the `Debug` field set to the given value.
17288    pub const fn with_debug(mut self, value: u8) -> Self {
17289        self.set_debug(value);
17290        self
17291    }
17292
17293    /// Returns the value of the `Divide` field.
17294    pub const fn divide(self) -> u8 {
17295        ((self.bits() >> Self::DIVIDE_SHIFT) & 0b1111) as u8
17296    }
17297
17298    /// Sets the value of the `Divide` field.
17299    pub const fn set_divide(&mut self, value: u8) {
17300        let offset = Self::DIVIDE_SHIFT;
17301        assert!(value & (Self::DIVIDE_MASK as u8) == value);
17302        *self = Self::from_bits_retain(
17303            (self.bits() & !(Self::DIVIDE_MASK << offset)) | ((value as u32) << offset),
17304        );
17305    }
17306
17307    /// Returns a copy with the `Divide` field set to the given value.
17308    pub const fn with_divide(mut self, value: u8) -> Self {
17309        self.set_divide(value);
17310        self
17311    }
17312}
17313
17314bitflags! {
17315    /// `ID_ISAR1` system register value.
17316    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17317    #[repr(transparent)]
17318    pub struct IdIsar1: u32 {
17319    }
17320}
17321
17322impl IdIsar1 {
17323    /// Offset of the `Endian` field.
17324    pub const ENDIAN_SHIFT: u32 = 0;
17325    /// Mask for the `Endian` field.
17326    pub const ENDIAN_MASK: u32 = 0b1111;
17327    /// Offset of the `Except` field.
17328    pub const EXCEPT_SHIFT: u32 = 4;
17329    /// Mask for the `Except` field.
17330    pub const EXCEPT_MASK: u32 = 0b1111;
17331    /// Offset of the `Except_AR` field.
17332    pub const EXCEPT_AR_SHIFT: u32 = 8;
17333    /// Mask for the `Except_AR` field.
17334    pub const EXCEPT_AR_MASK: u32 = 0b1111;
17335    /// Offset of the `Extend` field.
17336    pub const EXTEND_SHIFT: u32 = 12;
17337    /// Mask for the `Extend` field.
17338    pub const EXTEND_MASK: u32 = 0b1111;
17339    /// Offset of the `IfThen` field.
17340    pub const IFTHEN_SHIFT: u32 = 16;
17341    /// Mask for the `IfThen` field.
17342    pub const IFTHEN_MASK: u32 = 0b1111;
17343    /// Offset of the `Immediate` field.
17344    pub const IMMEDIATE_SHIFT: u32 = 20;
17345    /// Mask for the `Immediate` field.
17346    pub const IMMEDIATE_MASK: u32 = 0b1111;
17347    /// Offset of the `Interwork` field.
17348    pub const INTERWORK_SHIFT: u32 = 24;
17349    /// Mask for the `Interwork` field.
17350    pub const INTERWORK_MASK: u32 = 0b1111;
17351    /// Offset of the `Jazelle` field.
17352    pub const JAZELLE_SHIFT: u32 = 28;
17353    /// Mask for the `Jazelle` field.
17354    pub const JAZELLE_MASK: u32 = 0b1111;
17355
17356    /// Returns the value of the `Endian` field.
17357    pub const fn endian(self) -> u8 {
17358        ((self.bits() >> Self::ENDIAN_SHIFT) & 0b1111) as u8
17359    }
17360
17361    /// Sets the value of the `Endian` field.
17362    pub const fn set_endian(&mut self, value: u8) {
17363        let offset = Self::ENDIAN_SHIFT;
17364        assert!(value & (Self::ENDIAN_MASK as u8) == value);
17365        *self = Self::from_bits_retain(
17366            (self.bits() & !(Self::ENDIAN_MASK << offset)) | ((value as u32) << offset),
17367        );
17368    }
17369
17370    /// Returns a copy with the `Endian` field set to the given value.
17371    pub const fn with_endian(mut self, value: u8) -> Self {
17372        self.set_endian(value);
17373        self
17374    }
17375
17376    /// Returns the value of the `Except` field.
17377    pub const fn except(self) -> u8 {
17378        ((self.bits() >> Self::EXCEPT_SHIFT) & 0b1111) as u8
17379    }
17380
17381    /// Sets the value of the `Except` field.
17382    pub const fn set_except(&mut self, value: u8) {
17383        let offset = Self::EXCEPT_SHIFT;
17384        assert!(value & (Self::EXCEPT_MASK as u8) == value);
17385        *self = Self::from_bits_retain(
17386            (self.bits() & !(Self::EXCEPT_MASK << offset)) | ((value as u32) << offset),
17387        );
17388    }
17389
17390    /// Returns a copy with the `Except` field set to the given value.
17391    pub const fn with_except(mut self, value: u8) -> Self {
17392        self.set_except(value);
17393        self
17394    }
17395
17396    /// Returns the value of the `Except_AR` field.
17397    pub const fn except_ar(self) -> u8 {
17398        ((self.bits() >> Self::EXCEPT_AR_SHIFT) & 0b1111) as u8
17399    }
17400
17401    /// Sets the value of the `Except_AR` field.
17402    pub const fn set_except_ar(&mut self, value: u8) {
17403        let offset = Self::EXCEPT_AR_SHIFT;
17404        assert!(value & (Self::EXCEPT_AR_MASK as u8) == value);
17405        *self = Self::from_bits_retain(
17406            (self.bits() & !(Self::EXCEPT_AR_MASK << offset)) | ((value as u32) << offset),
17407        );
17408    }
17409
17410    /// Returns a copy with the `Except_AR` field set to the given value.
17411    pub const fn with_except_ar(mut self, value: u8) -> Self {
17412        self.set_except_ar(value);
17413        self
17414    }
17415
17416    /// Returns the value of the `Extend` field.
17417    pub const fn extend_(self) -> u8 {
17418        ((self.bits() >> Self::EXTEND_SHIFT) & 0b1111) as u8
17419    }
17420
17421    /// Sets the value of the `Extend` field.
17422    pub const fn set_extend_(&mut self, value: u8) {
17423        let offset = Self::EXTEND_SHIFT;
17424        assert!(value & (Self::EXTEND_MASK as u8) == value);
17425        *self = Self::from_bits_retain(
17426            (self.bits() & !(Self::EXTEND_MASK << offset)) | ((value as u32) << offset),
17427        );
17428    }
17429
17430    /// Returns a copy with the `Extend` field set to the given value.
17431    pub const fn with_extend_(mut self, value: u8) -> Self {
17432        self.set_extend_(value);
17433        self
17434    }
17435
17436    /// Returns the value of the `IfThen` field.
17437    pub const fn ifthen(self) -> u8 {
17438        ((self.bits() >> Self::IFTHEN_SHIFT) & 0b1111) as u8
17439    }
17440
17441    /// Sets the value of the `IfThen` field.
17442    pub const fn set_ifthen(&mut self, value: u8) {
17443        let offset = Self::IFTHEN_SHIFT;
17444        assert!(value & (Self::IFTHEN_MASK as u8) == value);
17445        *self = Self::from_bits_retain(
17446            (self.bits() & !(Self::IFTHEN_MASK << offset)) | ((value as u32) << offset),
17447        );
17448    }
17449
17450    /// Returns a copy with the `IfThen` field set to the given value.
17451    pub const fn with_ifthen(mut self, value: u8) -> Self {
17452        self.set_ifthen(value);
17453        self
17454    }
17455
17456    /// Returns the value of the `Immediate` field.
17457    pub const fn immediate(self) -> u8 {
17458        ((self.bits() >> Self::IMMEDIATE_SHIFT) & 0b1111) as u8
17459    }
17460
17461    /// Sets the value of the `Immediate` field.
17462    pub const fn set_immediate(&mut self, value: u8) {
17463        let offset = Self::IMMEDIATE_SHIFT;
17464        assert!(value & (Self::IMMEDIATE_MASK as u8) == value);
17465        *self = Self::from_bits_retain(
17466            (self.bits() & !(Self::IMMEDIATE_MASK << offset)) | ((value as u32) << offset),
17467        );
17468    }
17469
17470    /// Returns a copy with the `Immediate` field set to the given value.
17471    pub const fn with_immediate(mut self, value: u8) -> Self {
17472        self.set_immediate(value);
17473        self
17474    }
17475
17476    /// Returns the value of the `Interwork` field.
17477    pub const fn interwork(self) -> u8 {
17478        ((self.bits() >> Self::INTERWORK_SHIFT) & 0b1111) as u8
17479    }
17480
17481    /// Sets the value of the `Interwork` field.
17482    pub const fn set_interwork(&mut self, value: u8) {
17483        let offset = Self::INTERWORK_SHIFT;
17484        assert!(value & (Self::INTERWORK_MASK as u8) == value);
17485        *self = Self::from_bits_retain(
17486            (self.bits() & !(Self::INTERWORK_MASK << offset)) | ((value as u32) << offset),
17487        );
17488    }
17489
17490    /// Returns a copy with the `Interwork` field set to the given value.
17491    pub const fn with_interwork(mut self, value: u8) -> Self {
17492        self.set_interwork(value);
17493        self
17494    }
17495
17496    /// Returns the value of the `Jazelle` field.
17497    pub const fn jazelle(self) -> u8 {
17498        ((self.bits() >> Self::JAZELLE_SHIFT) & 0b1111) as u8
17499    }
17500
17501    /// Sets the value of the `Jazelle` field.
17502    pub const fn set_jazelle(&mut self, value: u8) {
17503        let offset = Self::JAZELLE_SHIFT;
17504        assert!(value & (Self::JAZELLE_MASK as u8) == value);
17505        *self = Self::from_bits_retain(
17506            (self.bits() & !(Self::JAZELLE_MASK << offset)) | ((value as u32) << offset),
17507        );
17508    }
17509
17510    /// Returns a copy with the `Jazelle` field set to the given value.
17511    pub const fn with_jazelle(mut self, value: u8) -> Self {
17512        self.set_jazelle(value);
17513        self
17514    }
17515}
17516
17517bitflags! {
17518    /// `ID_ISAR2` system register value.
17519    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17520    #[repr(transparent)]
17521    pub struct IdIsar2: u32 {
17522    }
17523}
17524
17525impl IdIsar2 {
17526    /// Offset of the `LoadStore` field.
17527    pub const LOADSTORE_SHIFT: u32 = 0;
17528    /// Mask for the `LoadStore` field.
17529    pub const LOADSTORE_MASK: u32 = 0b1111;
17530    /// Offset of the `MemHint` field.
17531    pub const MEMHINT_SHIFT: u32 = 4;
17532    /// Mask for the `MemHint` field.
17533    pub const MEMHINT_MASK: u32 = 0b1111;
17534    /// Offset of the `MultiAccessInt` field.
17535    pub const MULTIACCESSINT_SHIFT: u32 = 8;
17536    /// Mask for the `MultiAccessInt` field.
17537    pub const MULTIACCESSINT_MASK: u32 = 0b1111;
17538    /// Offset of the `Mult` field.
17539    pub const MULT_SHIFT: u32 = 12;
17540    /// Mask for the `Mult` field.
17541    pub const MULT_MASK: u32 = 0b1111;
17542    /// Offset of the `MultS` field.
17543    pub const MULTS_SHIFT: u32 = 16;
17544    /// Mask for the `MultS` field.
17545    pub const MULTS_MASK: u32 = 0b1111;
17546    /// Offset of the `MultU` field.
17547    pub const MULTU_SHIFT: u32 = 20;
17548    /// Mask for the `MultU` field.
17549    pub const MULTU_MASK: u32 = 0b1111;
17550    /// Offset of the `PSR_AR` field.
17551    pub const PSR_AR_SHIFT: u32 = 24;
17552    /// Mask for the `PSR_AR` field.
17553    pub const PSR_AR_MASK: u32 = 0b1111;
17554    /// Offset of the `Reversal` field.
17555    pub const REVERSAL_SHIFT: u32 = 28;
17556    /// Mask for the `Reversal` field.
17557    pub const REVERSAL_MASK: u32 = 0b1111;
17558
17559    /// Returns the value of the `LoadStore` field.
17560    pub const fn loadstore(self) -> u8 {
17561        ((self.bits() >> Self::LOADSTORE_SHIFT) & 0b1111) as u8
17562    }
17563
17564    /// Sets the value of the `LoadStore` field.
17565    pub const fn set_loadstore(&mut self, value: u8) {
17566        let offset = Self::LOADSTORE_SHIFT;
17567        assert!(value & (Self::LOADSTORE_MASK as u8) == value);
17568        *self = Self::from_bits_retain(
17569            (self.bits() & !(Self::LOADSTORE_MASK << offset)) | ((value as u32) << offset),
17570        );
17571    }
17572
17573    /// Returns a copy with the `LoadStore` field set to the given value.
17574    pub const fn with_loadstore(mut self, value: u8) -> Self {
17575        self.set_loadstore(value);
17576        self
17577    }
17578
17579    /// Returns the value of the `MemHint` field.
17580    pub const fn memhint(self) -> u8 {
17581        ((self.bits() >> Self::MEMHINT_SHIFT) & 0b1111) as u8
17582    }
17583
17584    /// Sets the value of the `MemHint` field.
17585    pub const fn set_memhint(&mut self, value: u8) {
17586        let offset = Self::MEMHINT_SHIFT;
17587        assert!(value & (Self::MEMHINT_MASK as u8) == value);
17588        *self = Self::from_bits_retain(
17589            (self.bits() & !(Self::MEMHINT_MASK << offset)) | ((value as u32) << offset),
17590        );
17591    }
17592
17593    /// Returns a copy with the `MemHint` field set to the given value.
17594    pub const fn with_memhint(mut self, value: u8) -> Self {
17595        self.set_memhint(value);
17596        self
17597    }
17598
17599    /// Returns the value of the `MultiAccessInt` field.
17600    pub const fn multiaccessint(self) -> u8 {
17601        ((self.bits() >> Self::MULTIACCESSINT_SHIFT) & 0b1111) as u8
17602    }
17603
17604    /// Sets the value of the `MultiAccessInt` field.
17605    pub const fn set_multiaccessint(&mut self, value: u8) {
17606        let offset = Self::MULTIACCESSINT_SHIFT;
17607        assert!(value & (Self::MULTIACCESSINT_MASK as u8) == value);
17608        *self = Self::from_bits_retain(
17609            (self.bits() & !(Self::MULTIACCESSINT_MASK << offset)) | ((value as u32) << offset),
17610        );
17611    }
17612
17613    /// Returns a copy with the `MultiAccessInt` field set to the given value.
17614    pub const fn with_multiaccessint(mut self, value: u8) -> Self {
17615        self.set_multiaccessint(value);
17616        self
17617    }
17618
17619    /// Returns the value of the `Mult` field.
17620    pub const fn mult(self) -> u8 {
17621        ((self.bits() >> Self::MULT_SHIFT) & 0b1111) as u8
17622    }
17623
17624    /// Sets the value of the `Mult` field.
17625    pub const fn set_mult(&mut self, value: u8) {
17626        let offset = Self::MULT_SHIFT;
17627        assert!(value & (Self::MULT_MASK as u8) == value);
17628        *self = Self::from_bits_retain(
17629            (self.bits() & !(Self::MULT_MASK << offset)) | ((value as u32) << offset),
17630        );
17631    }
17632
17633    /// Returns a copy with the `Mult` field set to the given value.
17634    pub const fn with_mult(mut self, value: u8) -> Self {
17635        self.set_mult(value);
17636        self
17637    }
17638
17639    /// Returns the value of the `MultS` field.
17640    pub const fn mults(self) -> u8 {
17641        ((self.bits() >> Self::MULTS_SHIFT) & 0b1111) as u8
17642    }
17643
17644    /// Sets the value of the `MultS` field.
17645    pub const fn set_mults(&mut self, value: u8) {
17646        let offset = Self::MULTS_SHIFT;
17647        assert!(value & (Self::MULTS_MASK as u8) == value);
17648        *self = Self::from_bits_retain(
17649            (self.bits() & !(Self::MULTS_MASK << offset)) | ((value as u32) << offset),
17650        );
17651    }
17652
17653    /// Returns a copy with the `MultS` field set to the given value.
17654    pub const fn with_mults(mut self, value: u8) -> Self {
17655        self.set_mults(value);
17656        self
17657    }
17658
17659    /// Returns the value of the `MultU` field.
17660    pub const fn multu(self) -> u8 {
17661        ((self.bits() >> Self::MULTU_SHIFT) & 0b1111) as u8
17662    }
17663
17664    /// Sets the value of the `MultU` field.
17665    pub const fn set_multu(&mut self, value: u8) {
17666        let offset = Self::MULTU_SHIFT;
17667        assert!(value & (Self::MULTU_MASK as u8) == value);
17668        *self = Self::from_bits_retain(
17669            (self.bits() & !(Self::MULTU_MASK << offset)) | ((value as u32) << offset),
17670        );
17671    }
17672
17673    /// Returns a copy with the `MultU` field set to the given value.
17674    pub const fn with_multu(mut self, value: u8) -> Self {
17675        self.set_multu(value);
17676        self
17677    }
17678
17679    /// Returns the value of the `PSR_AR` field.
17680    pub const fn psr_ar(self) -> u8 {
17681        ((self.bits() >> Self::PSR_AR_SHIFT) & 0b1111) as u8
17682    }
17683
17684    /// Sets the value of the `PSR_AR` field.
17685    pub const fn set_psr_ar(&mut self, value: u8) {
17686        let offset = Self::PSR_AR_SHIFT;
17687        assert!(value & (Self::PSR_AR_MASK as u8) == value);
17688        *self = Self::from_bits_retain(
17689            (self.bits() & !(Self::PSR_AR_MASK << offset)) | ((value as u32) << offset),
17690        );
17691    }
17692
17693    /// Returns a copy with the `PSR_AR` field set to the given value.
17694    pub const fn with_psr_ar(mut self, value: u8) -> Self {
17695        self.set_psr_ar(value);
17696        self
17697    }
17698
17699    /// Returns the value of the `Reversal` field.
17700    pub const fn reversal(self) -> u8 {
17701        ((self.bits() >> Self::REVERSAL_SHIFT) & 0b1111) as u8
17702    }
17703
17704    /// Sets the value of the `Reversal` field.
17705    pub const fn set_reversal(&mut self, value: u8) {
17706        let offset = Self::REVERSAL_SHIFT;
17707        assert!(value & (Self::REVERSAL_MASK as u8) == value);
17708        *self = Self::from_bits_retain(
17709            (self.bits() & !(Self::REVERSAL_MASK << offset)) | ((value as u32) << offset),
17710        );
17711    }
17712
17713    /// Returns a copy with the `Reversal` field set to the given value.
17714    pub const fn with_reversal(mut self, value: u8) -> Self {
17715        self.set_reversal(value);
17716        self
17717    }
17718}
17719
17720bitflags! {
17721    /// `ID_ISAR3` system register value.
17722    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17723    #[repr(transparent)]
17724    pub struct IdIsar3: u32 {
17725    }
17726}
17727
17728impl IdIsar3 {
17729    /// Offset of the `Saturate` field.
17730    pub const SATURATE_SHIFT: u32 = 0;
17731    /// Mask for the `Saturate` field.
17732    pub const SATURATE_MASK: u32 = 0b1111;
17733    /// Offset of the `SIMD` field.
17734    pub const SIMD_SHIFT: u32 = 4;
17735    /// Mask for the `SIMD` field.
17736    pub const SIMD_MASK: u32 = 0b1111;
17737    /// Offset of the `SVC` field.
17738    pub const SVC_SHIFT: u32 = 8;
17739    /// Mask for the `SVC` field.
17740    pub const SVC_MASK: u32 = 0b1111;
17741    /// Offset of the `SynchPrim` field.
17742    pub const SYNCHPRIM_SHIFT: u32 = 12;
17743    /// Mask for the `SynchPrim` field.
17744    pub const SYNCHPRIM_MASK: u32 = 0b1111;
17745    /// Offset of the `TabBranch` field.
17746    pub const TABBRANCH_SHIFT: u32 = 16;
17747    /// Mask for the `TabBranch` field.
17748    pub const TABBRANCH_MASK: u32 = 0b1111;
17749    /// Offset of the `T32Copy` field.
17750    pub const T32COPY_SHIFT: u32 = 20;
17751    /// Mask for the `T32Copy` field.
17752    pub const T32COPY_MASK: u32 = 0b1111;
17753    /// Offset of the `TrueNOP` field.
17754    pub const TRUENOP_SHIFT: u32 = 24;
17755    /// Mask for the `TrueNOP` field.
17756    pub const TRUENOP_MASK: u32 = 0b1111;
17757    /// Offset of the `T32EE` field.
17758    pub const T32EE_SHIFT: u32 = 28;
17759    /// Mask for the `T32EE` field.
17760    pub const T32EE_MASK: u32 = 0b1111;
17761
17762    /// Returns the value of the `Saturate` field.
17763    pub const fn saturate(self) -> u8 {
17764        ((self.bits() >> Self::SATURATE_SHIFT) & 0b1111) as u8
17765    }
17766
17767    /// Sets the value of the `Saturate` field.
17768    pub const fn set_saturate(&mut self, value: u8) {
17769        let offset = Self::SATURATE_SHIFT;
17770        assert!(value & (Self::SATURATE_MASK as u8) == value);
17771        *self = Self::from_bits_retain(
17772            (self.bits() & !(Self::SATURATE_MASK << offset)) | ((value as u32) << offset),
17773        );
17774    }
17775
17776    /// Returns a copy with the `Saturate` field set to the given value.
17777    pub const fn with_saturate(mut self, value: u8) -> Self {
17778        self.set_saturate(value);
17779        self
17780    }
17781
17782    /// Returns the value of the `SIMD` field.
17783    pub const fn simd(self) -> u8 {
17784        ((self.bits() >> Self::SIMD_SHIFT) & 0b1111) as u8
17785    }
17786
17787    /// Sets the value of the `SIMD` field.
17788    pub const fn set_simd(&mut self, value: u8) {
17789        let offset = Self::SIMD_SHIFT;
17790        assert!(value & (Self::SIMD_MASK as u8) == value);
17791        *self = Self::from_bits_retain(
17792            (self.bits() & !(Self::SIMD_MASK << offset)) | ((value as u32) << offset),
17793        );
17794    }
17795
17796    /// Returns a copy with the `SIMD` field set to the given value.
17797    pub const fn with_simd(mut self, value: u8) -> Self {
17798        self.set_simd(value);
17799        self
17800    }
17801
17802    /// Returns the value of the `SVC` field.
17803    pub const fn svc(self) -> u8 {
17804        ((self.bits() >> Self::SVC_SHIFT) & 0b1111) as u8
17805    }
17806
17807    /// Sets the value of the `SVC` field.
17808    pub const fn set_svc(&mut self, value: u8) {
17809        let offset = Self::SVC_SHIFT;
17810        assert!(value & (Self::SVC_MASK as u8) == value);
17811        *self = Self::from_bits_retain(
17812            (self.bits() & !(Self::SVC_MASK << offset)) | ((value as u32) << offset),
17813        );
17814    }
17815
17816    /// Returns a copy with the `SVC` field set to the given value.
17817    pub const fn with_svc(mut self, value: u8) -> Self {
17818        self.set_svc(value);
17819        self
17820    }
17821
17822    /// Returns the value of the `SynchPrim` field.
17823    pub const fn synchprim(self) -> u8 {
17824        ((self.bits() >> Self::SYNCHPRIM_SHIFT) & 0b1111) as u8
17825    }
17826
17827    /// Sets the value of the `SynchPrim` field.
17828    pub const fn set_synchprim(&mut self, value: u8) {
17829        let offset = Self::SYNCHPRIM_SHIFT;
17830        assert!(value & (Self::SYNCHPRIM_MASK as u8) == value);
17831        *self = Self::from_bits_retain(
17832            (self.bits() & !(Self::SYNCHPRIM_MASK << offset)) | ((value as u32) << offset),
17833        );
17834    }
17835
17836    /// Returns a copy with the `SynchPrim` field set to the given value.
17837    pub const fn with_synchprim(mut self, value: u8) -> Self {
17838        self.set_synchprim(value);
17839        self
17840    }
17841
17842    /// Returns the value of the `TabBranch` field.
17843    pub const fn tabbranch(self) -> u8 {
17844        ((self.bits() >> Self::TABBRANCH_SHIFT) & 0b1111) as u8
17845    }
17846
17847    /// Sets the value of the `TabBranch` field.
17848    pub const fn set_tabbranch(&mut self, value: u8) {
17849        let offset = Self::TABBRANCH_SHIFT;
17850        assert!(value & (Self::TABBRANCH_MASK as u8) == value);
17851        *self = Self::from_bits_retain(
17852            (self.bits() & !(Self::TABBRANCH_MASK << offset)) | ((value as u32) << offset),
17853        );
17854    }
17855
17856    /// Returns a copy with the `TabBranch` field set to the given value.
17857    pub const fn with_tabbranch(mut self, value: u8) -> Self {
17858        self.set_tabbranch(value);
17859        self
17860    }
17861
17862    /// Returns the value of the `T32Copy` field.
17863    pub const fn t32copy(self) -> u8 {
17864        ((self.bits() >> Self::T32COPY_SHIFT) & 0b1111) as u8
17865    }
17866
17867    /// Sets the value of the `T32Copy` field.
17868    pub const fn set_t32copy(&mut self, value: u8) {
17869        let offset = Self::T32COPY_SHIFT;
17870        assert!(value & (Self::T32COPY_MASK as u8) == value);
17871        *self = Self::from_bits_retain(
17872            (self.bits() & !(Self::T32COPY_MASK << offset)) | ((value as u32) << offset),
17873        );
17874    }
17875
17876    /// Returns a copy with the `T32Copy` field set to the given value.
17877    pub const fn with_t32copy(mut self, value: u8) -> Self {
17878        self.set_t32copy(value);
17879        self
17880    }
17881
17882    /// Returns the value of the `TrueNOP` field.
17883    pub const fn truenop(self) -> u8 {
17884        ((self.bits() >> Self::TRUENOP_SHIFT) & 0b1111) as u8
17885    }
17886
17887    /// Sets the value of the `TrueNOP` field.
17888    pub const fn set_truenop(&mut self, value: u8) {
17889        let offset = Self::TRUENOP_SHIFT;
17890        assert!(value & (Self::TRUENOP_MASK as u8) == value);
17891        *self = Self::from_bits_retain(
17892            (self.bits() & !(Self::TRUENOP_MASK << offset)) | ((value as u32) << offset),
17893        );
17894    }
17895
17896    /// Returns a copy with the `TrueNOP` field set to the given value.
17897    pub const fn with_truenop(mut self, value: u8) -> Self {
17898        self.set_truenop(value);
17899        self
17900    }
17901
17902    /// Returns the value of the `T32EE` field.
17903    pub const fn t32ee(self) -> u8 {
17904        ((self.bits() >> Self::T32EE_SHIFT) & 0b1111) as u8
17905    }
17906
17907    /// Sets the value of the `T32EE` field.
17908    pub const fn set_t32ee(&mut self, value: u8) {
17909        let offset = Self::T32EE_SHIFT;
17910        assert!(value & (Self::T32EE_MASK as u8) == value);
17911        *self = Self::from_bits_retain(
17912            (self.bits() & !(Self::T32EE_MASK << offset)) | ((value as u32) << offset),
17913        );
17914    }
17915
17916    /// Returns a copy with the `T32EE` field set to the given value.
17917    pub const fn with_t32ee(mut self, value: u8) -> Self {
17918        self.set_t32ee(value);
17919        self
17920    }
17921}
17922
17923bitflags! {
17924    /// `ID_ISAR4` system register value.
17925    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
17926    #[repr(transparent)]
17927    pub struct IdIsar4: u32 {
17928    }
17929}
17930
17931impl IdIsar4 {
17932    /// Offset of the `Unpriv` field.
17933    pub const UNPRIV_SHIFT: u32 = 0;
17934    /// Mask for the `Unpriv` field.
17935    pub const UNPRIV_MASK: u32 = 0b1111;
17936    /// Offset of the `WithShifts` field.
17937    pub const WITHSHIFTS_SHIFT: u32 = 4;
17938    /// Mask for the `WithShifts` field.
17939    pub const WITHSHIFTS_MASK: u32 = 0b1111;
17940    /// Offset of the `Writeback` field.
17941    pub const WRITEBACK_SHIFT: u32 = 8;
17942    /// Mask for the `Writeback` field.
17943    pub const WRITEBACK_MASK: u32 = 0b1111;
17944    /// Offset of the `SMC` field.
17945    pub const SMC_SHIFT: u32 = 12;
17946    /// Mask for the `SMC` field.
17947    pub const SMC_MASK: u32 = 0b1111;
17948    /// Offset of the `Barrier` field.
17949    pub const BARRIER_SHIFT: u32 = 16;
17950    /// Mask for the `Barrier` field.
17951    pub const BARRIER_MASK: u32 = 0b1111;
17952    /// Offset of the `SynchPrim_frac` field.
17953    pub const SYNCHPRIM_FRAC_SHIFT: u32 = 20;
17954    /// Mask for the `SynchPrim_frac` field.
17955    pub const SYNCHPRIM_FRAC_MASK: u32 = 0b1111;
17956    /// Offset of the `PSR_M` field.
17957    pub const PSR_M_SHIFT: u32 = 24;
17958    /// Mask for the `PSR_M` field.
17959    pub const PSR_M_MASK: u32 = 0b1111;
17960    /// Offset of the `SWP_frac` field.
17961    pub const SWP_FRAC_SHIFT: u32 = 28;
17962    /// Mask for the `SWP_frac` field.
17963    pub const SWP_FRAC_MASK: u32 = 0b1111;
17964
17965    /// Returns the value of the `Unpriv` field.
17966    pub const fn unpriv(self) -> u8 {
17967        ((self.bits() >> Self::UNPRIV_SHIFT) & 0b1111) as u8
17968    }
17969
17970    /// Sets the value of the `Unpriv` field.
17971    pub const fn set_unpriv(&mut self, value: u8) {
17972        let offset = Self::UNPRIV_SHIFT;
17973        assert!(value & (Self::UNPRIV_MASK as u8) == value);
17974        *self = Self::from_bits_retain(
17975            (self.bits() & !(Self::UNPRIV_MASK << offset)) | ((value as u32) << offset),
17976        );
17977    }
17978
17979    /// Returns a copy with the `Unpriv` field set to the given value.
17980    pub const fn with_unpriv(mut self, value: u8) -> Self {
17981        self.set_unpriv(value);
17982        self
17983    }
17984
17985    /// Returns the value of the `WithShifts` field.
17986    pub const fn withshifts(self) -> u8 {
17987        ((self.bits() >> Self::WITHSHIFTS_SHIFT) & 0b1111) as u8
17988    }
17989
17990    /// Sets the value of the `WithShifts` field.
17991    pub const fn set_withshifts(&mut self, value: u8) {
17992        let offset = Self::WITHSHIFTS_SHIFT;
17993        assert!(value & (Self::WITHSHIFTS_MASK as u8) == value);
17994        *self = Self::from_bits_retain(
17995            (self.bits() & !(Self::WITHSHIFTS_MASK << offset)) | ((value as u32) << offset),
17996        );
17997    }
17998
17999    /// Returns a copy with the `WithShifts` field set to the given value.
18000    pub const fn with_withshifts(mut self, value: u8) -> Self {
18001        self.set_withshifts(value);
18002        self
18003    }
18004
18005    /// Returns the value of the `Writeback` field.
18006    pub const fn writeback(self) -> u8 {
18007        ((self.bits() >> Self::WRITEBACK_SHIFT) & 0b1111) as u8
18008    }
18009
18010    /// Sets the value of the `Writeback` field.
18011    pub const fn set_writeback(&mut self, value: u8) {
18012        let offset = Self::WRITEBACK_SHIFT;
18013        assert!(value & (Self::WRITEBACK_MASK as u8) == value);
18014        *self = Self::from_bits_retain(
18015            (self.bits() & !(Self::WRITEBACK_MASK << offset)) | ((value as u32) << offset),
18016        );
18017    }
18018
18019    /// Returns a copy with the `Writeback` field set to the given value.
18020    pub const fn with_writeback(mut self, value: u8) -> Self {
18021        self.set_writeback(value);
18022        self
18023    }
18024
18025    /// Returns the value of the `SMC` field.
18026    pub const fn smc(self) -> u8 {
18027        ((self.bits() >> Self::SMC_SHIFT) & 0b1111) as u8
18028    }
18029
18030    /// Sets the value of the `SMC` field.
18031    pub const fn set_smc(&mut self, value: u8) {
18032        let offset = Self::SMC_SHIFT;
18033        assert!(value & (Self::SMC_MASK as u8) == value);
18034        *self = Self::from_bits_retain(
18035            (self.bits() & !(Self::SMC_MASK << offset)) | ((value as u32) << offset),
18036        );
18037    }
18038
18039    /// Returns a copy with the `SMC` field set to the given value.
18040    pub const fn with_smc(mut self, value: u8) -> Self {
18041        self.set_smc(value);
18042        self
18043    }
18044
18045    /// Returns the value of the `Barrier` field.
18046    pub const fn barrier(self) -> u8 {
18047        ((self.bits() >> Self::BARRIER_SHIFT) & 0b1111) as u8
18048    }
18049
18050    /// Sets the value of the `Barrier` field.
18051    pub const fn set_barrier(&mut self, value: u8) {
18052        let offset = Self::BARRIER_SHIFT;
18053        assert!(value & (Self::BARRIER_MASK as u8) == value);
18054        *self = Self::from_bits_retain(
18055            (self.bits() & !(Self::BARRIER_MASK << offset)) | ((value as u32) << offset),
18056        );
18057    }
18058
18059    /// Returns a copy with the `Barrier` field set to the given value.
18060    pub const fn with_barrier(mut self, value: u8) -> Self {
18061        self.set_barrier(value);
18062        self
18063    }
18064
18065    /// Returns the value of the `SynchPrim_frac` field.
18066    pub const fn synchprim_frac(self) -> u8 {
18067        ((self.bits() >> Self::SYNCHPRIM_FRAC_SHIFT) & 0b1111) as u8
18068    }
18069
18070    /// Sets the value of the `SynchPrim_frac` field.
18071    pub const fn set_synchprim_frac(&mut self, value: u8) {
18072        let offset = Self::SYNCHPRIM_FRAC_SHIFT;
18073        assert!(value & (Self::SYNCHPRIM_FRAC_MASK as u8) == value);
18074        *self = Self::from_bits_retain(
18075            (self.bits() & !(Self::SYNCHPRIM_FRAC_MASK << offset)) | ((value as u32) << offset),
18076        );
18077    }
18078
18079    /// Returns a copy with the `SynchPrim_frac` field set to the given value.
18080    pub const fn with_synchprim_frac(mut self, value: u8) -> Self {
18081        self.set_synchprim_frac(value);
18082        self
18083    }
18084
18085    /// Returns the value of the `PSR_M` field.
18086    pub const fn psr_m(self) -> u8 {
18087        ((self.bits() >> Self::PSR_M_SHIFT) & 0b1111) as u8
18088    }
18089
18090    /// Sets the value of the `PSR_M` field.
18091    pub const fn set_psr_m(&mut self, value: u8) {
18092        let offset = Self::PSR_M_SHIFT;
18093        assert!(value & (Self::PSR_M_MASK as u8) == value);
18094        *self = Self::from_bits_retain(
18095            (self.bits() & !(Self::PSR_M_MASK << offset)) | ((value as u32) << offset),
18096        );
18097    }
18098
18099    /// Returns a copy with the `PSR_M` field set to the given value.
18100    pub const fn with_psr_m(mut self, value: u8) -> Self {
18101        self.set_psr_m(value);
18102        self
18103    }
18104
18105    /// Returns the value of the `SWP_frac` field.
18106    pub const fn swp_frac(self) -> u8 {
18107        ((self.bits() >> Self::SWP_FRAC_SHIFT) & 0b1111) as u8
18108    }
18109
18110    /// Sets the value of the `SWP_frac` field.
18111    pub const fn set_swp_frac(&mut self, value: u8) {
18112        let offset = Self::SWP_FRAC_SHIFT;
18113        assert!(value & (Self::SWP_FRAC_MASK as u8) == value);
18114        *self = Self::from_bits_retain(
18115            (self.bits() & !(Self::SWP_FRAC_MASK << offset)) | ((value as u32) << offset),
18116        );
18117    }
18118
18119    /// Returns a copy with the `SWP_frac` field set to the given value.
18120    pub const fn with_swp_frac(mut self, value: u8) -> Self {
18121        self.set_swp_frac(value);
18122        self
18123    }
18124}
18125
18126bitflags! {
18127    /// `ID_ISAR5` system register value.
18128    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18129    #[repr(transparent)]
18130    pub struct IdIsar5: u32 {
18131    }
18132}
18133
18134impl IdIsar5 {
18135    /// Offset of the `SEVL` field.
18136    pub const SEVL_SHIFT: u32 = 0;
18137    /// Mask for the `SEVL` field.
18138    pub const SEVL_MASK: u32 = 0b1111;
18139    /// Offset of the `AES` field.
18140    pub const AES_SHIFT: u32 = 4;
18141    /// Mask for the `AES` field.
18142    pub const AES_MASK: u32 = 0b1111;
18143    /// Offset of the `SHA1` field.
18144    pub const SHA1_SHIFT: u32 = 8;
18145    /// Mask for the `SHA1` field.
18146    pub const SHA1_MASK: u32 = 0b1111;
18147    /// Offset of the `SHA2` field.
18148    pub const SHA2_SHIFT: u32 = 12;
18149    /// Mask for the `SHA2` field.
18150    pub const SHA2_MASK: u32 = 0b1111;
18151    /// Offset of the `CRC32` field.
18152    pub const CRC32_SHIFT: u32 = 16;
18153    /// Mask for the `CRC32` field.
18154    pub const CRC32_MASK: u32 = 0b1111;
18155    /// Offset of the `RDM` field.
18156    pub const RDM_SHIFT: u32 = 24;
18157    /// Mask for the `RDM` field.
18158    pub const RDM_MASK: u32 = 0b1111;
18159    /// Offset of the `VCMA` field.
18160    pub const VCMA_SHIFT: u32 = 28;
18161    /// Mask for the `VCMA` field.
18162    pub const VCMA_MASK: u32 = 0b1111;
18163
18164    /// Returns the value of the `SEVL` field.
18165    pub const fn sevl(self) -> u8 {
18166        ((self.bits() >> Self::SEVL_SHIFT) & 0b1111) as u8
18167    }
18168
18169    /// Sets the value of the `SEVL` field.
18170    pub const fn set_sevl(&mut self, value: u8) {
18171        let offset = Self::SEVL_SHIFT;
18172        assert!(value & (Self::SEVL_MASK as u8) == value);
18173        *self = Self::from_bits_retain(
18174            (self.bits() & !(Self::SEVL_MASK << offset)) | ((value as u32) << offset),
18175        );
18176    }
18177
18178    /// Returns a copy with the `SEVL` field set to the given value.
18179    pub const fn with_sevl(mut self, value: u8) -> Self {
18180        self.set_sevl(value);
18181        self
18182    }
18183
18184    /// Returns the value of the `AES` field.
18185    pub const fn aes(self) -> u8 {
18186        ((self.bits() >> Self::AES_SHIFT) & 0b1111) as u8
18187    }
18188
18189    /// Sets the value of the `AES` field.
18190    pub const fn set_aes(&mut self, value: u8) {
18191        let offset = Self::AES_SHIFT;
18192        assert!(value & (Self::AES_MASK as u8) == value);
18193        *self = Self::from_bits_retain(
18194            (self.bits() & !(Self::AES_MASK << offset)) | ((value as u32) << offset),
18195        );
18196    }
18197
18198    /// Returns a copy with the `AES` field set to the given value.
18199    pub const fn with_aes(mut self, value: u8) -> Self {
18200        self.set_aes(value);
18201        self
18202    }
18203
18204    /// Returns the value of the `SHA1` field.
18205    pub const fn sha1(self) -> u8 {
18206        ((self.bits() >> Self::SHA1_SHIFT) & 0b1111) as u8
18207    }
18208
18209    /// Sets the value of the `SHA1` field.
18210    pub const fn set_sha1(&mut self, value: u8) {
18211        let offset = Self::SHA1_SHIFT;
18212        assert!(value & (Self::SHA1_MASK as u8) == value);
18213        *self = Self::from_bits_retain(
18214            (self.bits() & !(Self::SHA1_MASK << offset)) | ((value as u32) << offset),
18215        );
18216    }
18217
18218    /// Returns a copy with the `SHA1` field set to the given value.
18219    pub const fn with_sha1(mut self, value: u8) -> Self {
18220        self.set_sha1(value);
18221        self
18222    }
18223
18224    /// Returns the value of the `SHA2` field.
18225    pub const fn sha2(self) -> u8 {
18226        ((self.bits() >> Self::SHA2_SHIFT) & 0b1111) as u8
18227    }
18228
18229    /// Sets the value of the `SHA2` field.
18230    pub const fn set_sha2(&mut self, value: u8) {
18231        let offset = Self::SHA2_SHIFT;
18232        assert!(value & (Self::SHA2_MASK as u8) == value);
18233        *self = Self::from_bits_retain(
18234            (self.bits() & !(Self::SHA2_MASK << offset)) | ((value as u32) << offset),
18235        );
18236    }
18237
18238    /// Returns a copy with the `SHA2` field set to the given value.
18239    pub const fn with_sha2(mut self, value: u8) -> Self {
18240        self.set_sha2(value);
18241        self
18242    }
18243
18244    /// Returns the value of the `CRC32` field.
18245    pub const fn crc32(self) -> u8 {
18246        ((self.bits() >> Self::CRC32_SHIFT) & 0b1111) as u8
18247    }
18248
18249    /// Sets the value of the `CRC32` field.
18250    pub const fn set_crc32(&mut self, value: u8) {
18251        let offset = Self::CRC32_SHIFT;
18252        assert!(value & (Self::CRC32_MASK as u8) == value);
18253        *self = Self::from_bits_retain(
18254            (self.bits() & !(Self::CRC32_MASK << offset)) | ((value as u32) << offset),
18255        );
18256    }
18257
18258    /// Returns a copy with the `CRC32` field set to the given value.
18259    pub const fn with_crc32(mut self, value: u8) -> Self {
18260        self.set_crc32(value);
18261        self
18262    }
18263
18264    /// Returns the value of the `RDM` field.
18265    pub const fn rdm(self) -> u8 {
18266        ((self.bits() >> Self::RDM_SHIFT) & 0b1111) as u8
18267    }
18268
18269    /// Sets the value of the `RDM` field.
18270    pub const fn set_rdm(&mut self, value: u8) {
18271        let offset = Self::RDM_SHIFT;
18272        assert!(value & (Self::RDM_MASK as u8) == value);
18273        *self = Self::from_bits_retain(
18274            (self.bits() & !(Self::RDM_MASK << offset)) | ((value as u32) << offset),
18275        );
18276    }
18277
18278    /// Returns a copy with the `RDM` field set to the given value.
18279    pub const fn with_rdm(mut self, value: u8) -> Self {
18280        self.set_rdm(value);
18281        self
18282    }
18283
18284    /// Returns the value of the `VCMA` field.
18285    pub const fn vcma(self) -> u8 {
18286        ((self.bits() >> Self::VCMA_SHIFT) & 0b1111) as u8
18287    }
18288
18289    /// Sets the value of the `VCMA` field.
18290    pub const fn set_vcma(&mut self, value: u8) {
18291        let offset = Self::VCMA_SHIFT;
18292        assert!(value & (Self::VCMA_MASK as u8) == value);
18293        *self = Self::from_bits_retain(
18294            (self.bits() & !(Self::VCMA_MASK << offset)) | ((value as u32) << offset),
18295        );
18296    }
18297
18298    /// Returns a copy with the `VCMA` field set to the given value.
18299    pub const fn with_vcma(mut self, value: u8) -> Self {
18300        self.set_vcma(value);
18301        self
18302    }
18303}
18304
18305bitflags! {
18306    /// `ID_ISAR6` system register value.
18307    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18308    #[repr(transparent)]
18309    pub struct IdIsar6: u32 {
18310    }
18311}
18312
18313impl IdIsar6 {
18314    /// Offset of the `JSCVT` field.
18315    pub const JSCVT_SHIFT: u32 = 0;
18316    /// Mask for the `JSCVT` field.
18317    pub const JSCVT_MASK: u32 = 0b1111;
18318    /// Offset of the `DP` field.
18319    pub const DP_SHIFT: u32 = 4;
18320    /// Mask for the `DP` field.
18321    pub const DP_MASK: u32 = 0b1111;
18322    /// Offset of the `FHM` field.
18323    pub const FHM_SHIFT: u32 = 8;
18324    /// Mask for the `FHM` field.
18325    pub const FHM_MASK: u32 = 0b1111;
18326    /// Offset of the `SB` field.
18327    pub const SB_SHIFT: u32 = 12;
18328    /// Mask for the `SB` field.
18329    pub const SB_MASK: u32 = 0b1111;
18330    /// Offset of the `SPECRES` field.
18331    pub const SPECRES_SHIFT: u32 = 16;
18332    /// Mask for the `SPECRES` field.
18333    pub const SPECRES_MASK: u32 = 0b1111;
18334    /// Offset of the `BF16` field.
18335    pub const BF16_SHIFT: u32 = 20;
18336    /// Mask for the `BF16` field.
18337    pub const BF16_MASK: u32 = 0b1111;
18338    /// Offset of the `I8MM` field.
18339    pub const I8MM_SHIFT: u32 = 24;
18340    /// Mask for the `I8MM` field.
18341    pub const I8MM_MASK: u32 = 0b1111;
18342    /// Offset of the `CLRBHB` field.
18343    pub const CLRBHB_SHIFT: u32 = 28;
18344    /// Mask for the `CLRBHB` field.
18345    pub const CLRBHB_MASK: u32 = 0b1111;
18346
18347    /// Returns the value of the `JSCVT` field.
18348    pub const fn jscvt(self) -> u8 {
18349        ((self.bits() >> Self::JSCVT_SHIFT) & 0b1111) as u8
18350    }
18351
18352    /// Sets the value of the `JSCVT` field.
18353    pub const fn set_jscvt(&mut self, value: u8) {
18354        let offset = Self::JSCVT_SHIFT;
18355        assert!(value & (Self::JSCVT_MASK as u8) == value);
18356        *self = Self::from_bits_retain(
18357            (self.bits() & !(Self::JSCVT_MASK << offset)) | ((value as u32) << offset),
18358        );
18359    }
18360
18361    /// Returns a copy with the `JSCVT` field set to the given value.
18362    pub const fn with_jscvt(mut self, value: u8) -> Self {
18363        self.set_jscvt(value);
18364        self
18365    }
18366
18367    /// Returns the value of the `DP` field.
18368    pub const fn dp(self) -> u8 {
18369        ((self.bits() >> Self::DP_SHIFT) & 0b1111) as u8
18370    }
18371
18372    /// Sets the value of the `DP` field.
18373    pub const fn set_dp(&mut self, value: u8) {
18374        let offset = Self::DP_SHIFT;
18375        assert!(value & (Self::DP_MASK as u8) == value);
18376        *self = Self::from_bits_retain(
18377            (self.bits() & !(Self::DP_MASK << offset)) | ((value as u32) << offset),
18378        );
18379    }
18380
18381    /// Returns a copy with the `DP` field set to the given value.
18382    pub const fn with_dp(mut self, value: u8) -> Self {
18383        self.set_dp(value);
18384        self
18385    }
18386
18387    /// Returns the value of the `FHM` field.
18388    pub const fn fhm(self) -> u8 {
18389        ((self.bits() >> Self::FHM_SHIFT) & 0b1111) as u8
18390    }
18391
18392    /// Sets the value of the `FHM` field.
18393    pub const fn set_fhm(&mut self, value: u8) {
18394        let offset = Self::FHM_SHIFT;
18395        assert!(value & (Self::FHM_MASK as u8) == value);
18396        *self = Self::from_bits_retain(
18397            (self.bits() & !(Self::FHM_MASK << offset)) | ((value as u32) << offset),
18398        );
18399    }
18400
18401    /// Returns a copy with the `FHM` field set to the given value.
18402    pub const fn with_fhm(mut self, value: u8) -> Self {
18403        self.set_fhm(value);
18404        self
18405    }
18406
18407    /// Returns the value of the `SB` field.
18408    pub const fn sb(self) -> u8 {
18409        ((self.bits() >> Self::SB_SHIFT) & 0b1111) as u8
18410    }
18411
18412    /// Sets the value of the `SB` field.
18413    pub const fn set_sb(&mut self, value: u8) {
18414        let offset = Self::SB_SHIFT;
18415        assert!(value & (Self::SB_MASK as u8) == value);
18416        *self = Self::from_bits_retain(
18417            (self.bits() & !(Self::SB_MASK << offset)) | ((value as u32) << offset),
18418        );
18419    }
18420
18421    /// Returns a copy with the `SB` field set to the given value.
18422    pub const fn with_sb(mut self, value: u8) -> Self {
18423        self.set_sb(value);
18424        self
18425    }
18426
18427    /// Returns the value of the `SPECRES` field.
18428    pub const fn specres(self) -> u8 {
18429        ((self.bits() >> Self::SPECRES_SHIFT) & 0b1111) as u8
18430    }
18431
18432    /// Sets the value of the `SPECRES` field.
18433    pub const fn set_specres(&mut self, value: u8) {
18434        let offset = Self::SPECRES_SHIFT;
18435        assert!(value & (Self::SPECRES_MASK as u8) == value);
18436        *self = Self::from_bits_retain(
18437            (self.bits() & !(Self::SPECRES_MASK << offset)) | ((value as u32) << offset),
18438        );
18439    }
18440
18441    /// Returns a copy with the `SPECRES` field set to the given value.
18442    pub const fn with_specres(mut self, value: u8) -> Self {
18443        self.set_specres(value);
18444        self
18445    }
18446
18447    /// Returns the value of the `BF16` field.
18448    pub const fn bf16(self) -> u8 {
18449        ((self.bits() >> Self::BF16_SHIFT) & 0b1111) as u8
18450    }
18451
18452    /// Sets the value of the `BF16` field.
18453    pub const fn set_bf16(&mut self, value: u8) {
18454        let offset = Self::BF16_SHIFT;
18455        assert!(value & (Self::BF16_MASK as u8) == value);
18456        *self = Self::from_bits_retain(
18457            (self.bits() & !(Self::BF16_MASK << offset)) | ((value as u32) << offset),
18458        );
18459    }
18460
18461    /// Returns a copy with the `BF16` field set to the given value.
18462    pub const fn with_bf16(mut self, value: u8) -> Self {
18463        self.set_bf16(value);
18464        self
18465    }
18466
18467    /// Returns the value of the `I8MM` field.
18468    pub const fn i8mm(self) -> u8 {
18469        ((self.bits() >> Self::I8MM_SHIFT) & 0b1111) as u8
18470    }
18471
18472    /// Sets the value of the `I8MM` field.
18473    pub const fn set_i8mm(&mut self, value: u8) {
18474        let offset = Self::I8MM_SHIFT;
18475        assert!(value & (Self::I8MM_MASK as u8) == value);
18476        *self = Self::from_bits_retain(
18477            (self.bits() & !(Self::I8MM_MASK << offset)) | ((value as u32) << offset),
18478        );
18479    }
18480
18481    /// Returns a copy with the `I8MM` field set to the given value.
18482    pub const fn with_i8mm(mut self, value: u8) -> Self {
18483        self.set_i8mm(value);
18484        self
18485    }
18486
18487    /// Returns the value of the `CLRBHB` field.
18488    pub const fn clrbhb(self) -> u8 {
18489        ((self.bits() >> Self::CLRBHB_SHIFT) & 0b1111) as u8
18490    }
18491
18492    /// Sets the value of the `CLRBHB` field.
18493    pub const fn set_clrbhb(&mut self, value: u8) {
18494        let offset = Self::CLRBHB_SHIFT;
18495        assert!(value & (Self::CLRBHB_MASK as u8) == value);
18496        *self = Self::from_bits_retain(
18497            (self.bits() & !(Self::CLRBHB_MASK << offset)) | ((value as u32) << offset),
18498        );
18499    }
18500
18501    /// Returns a copy with the `CLRBHB` field set to the given value.
18502    pub const fn with_clrbhb(mut self, value: u8) -> Self {
18503        self.set_clrbhb(value);
18504        self
18505    }
18506}
18507
18508bitflags! {
18509    /// `ID_MMFR0` system register value.
18510    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18511    #[repr(transparent)]
18512    pub struct IdMmfr0: u32 {
18513    }
18514}
18515
18516impl IdMmfr0 {
18517    /// Offset of the `VMSA` field.
18518    pub const VMSA_SHIFT: u32 = 0;
18519    /// Mask for the `VMSA` field.
18520    pub const VMSA_MASK: u32 = 0b1111;
18521    /// Offset of the `PMSA` field.
18522    pub const PMSA_SHIFT: u32 = 4;
18523    /// Mask for the `PMSA` field.
18524    pub const PMSA_MASK: u32 = 0b1111;
18525    /// Offset of the `OuterShr` field.
18526    pub const OUTERSHR_SHIFT: u32 = 8;
18527    /// Mask for the `OuterShr` field.
18528    pub const OUTERSHR_MASK: u32 = 0b1111;
18529    /// Offset of the `ShareLvl` field.
18530    pub const SHARELVL_SHIFT: u32 = 12;
18531    /// Mask for the `ShareLvl` field.
18532    pub const SHARELVL_MASK: u32 = 0b1111;
18533    /// Offset of the `TCM` field.
18534    pub const TCM_SHIFT: u32 = 16;
18535    /// Mask for the `TCM` field.
18536    pub const TCM_MASK: u32 = 0b1111;
18537    /// Offset of the `AuxReg` field.
18538    pub const AUXREG_SHIFT: u32 = 20;
18539    /// Mask for the `AuxReg` field.
18540    pub const AUXREG_MASK: u32 = 0b1111;
18541    /// Offset of the `FCSE` field.
18542    pub const FCSE_SHIFT: u32 = 24;
18543    /// Mask for the `FCSE` field.
18544    pub const FCSE_MASK: u32 = 0b1111;
18545    /// Offset of the `InnerShr` field.
18546    pub const INNERSHR_SHIFT: u32 = 28;
18547    /// Mask for the `InnerShr` field.
18548    pub const INNERSHR_MASK: u32 = 0b1111;
18549
18550    /// Returns the value of the `VMSA` field.
18551    pub const fn vmsa(self) -> u8 {
18552        ((self.bits() >> Self::VMSA_SHIFT) & 0b1111) as u8
18553    }
18554
18555    /// Sets the value of the `VMSA` field.
18556    pub const fn set_vmsa(&mut self, value: u8) {
18557        let offset = Self::VMSA_SHIFT;
18558        assert!(value & (Self::VMSA_MASK as u8) == value);
18559        *self = Self::from_bits_retain(
18560            (self.bits() & !(Self::VMSA_MASK << offset)) | ((value as u32) << offset),
18561        );
18562    }
18563
18564    /// Returns a copy with the `VMSA` field set to the given value.
18565    pub const fn with_vmsa(mut self, value: u8) -> Self {
18566        self.set_vmsa(value);
18567        self
18568    }
18569
18570    /// Returns the value of the `PMSA` field.
18571    pub const fn pmsa(self) -> u8 {
18572        ((self.bits() >> Self::PMSA_SHIFT) & 0b1111) as u8
18573    }
18574
18575    /// Sets the value of the `PMSA` field.
18576    pub const fn set_pmsa(&mut self, value: u8) {
18577        let offset = Self::PMSA_SHIFT;
18578        assert!(value & (Self::PMSA_MASK as u8) == value);
18579        *self = Self::from_bits_retain(
18580            (self.bits() & !(Self::PMSA_MASK << offset)) | ((value as u32) << offset),
18581        );
18582    }
18583
18584    /// Returns a copy with the `PMSA` field set to the given value.
18585    pub const fn with_pmsa(mut self, value: u8) -> Self {
18586        self.set_pmsa(value);
18587        self
18588    }
18589
18590    /// Returns the value of the `OuterShr` field.
18591    pub const fn outershr(self) -> u8 {
18592        ((self.bits() >> Self::OUTERSHR_SHIFT) & 0b1111) as u8
18593    }
18594
18595    /// Sets the value of the `OuterShr` field.
18596    pub const fn set_outershr(&mut self, value: u8) {
18597        let offset = Self::OUTERSHR_SHIFT;
18598        assert!(value & (Self::OUTERSHR_MASK as u8) == value);
18599        *self = Self::from_bits_retain(
18600            (self.bits() & !(Self::OUTERSHR_MASK << offset)) | ((value as u32) << offset),
18601        );
18602    }
18603
18604    /// Returns a copy with the `OuterShr` field set to the given value.
18605    pub const fn with_outershr(mut self, value: u8) -> Self {
18606        self.set_outershr(value);
18607        self
18608    }
18609
18610    /// Returns the value of the `ShareLvl` field.
18611    pub const fn sharelvl(self) -> u8 {
18612        ((self.bits() >> Self::SHARELVL_SHIFT) & 0b1111) as u8
18613    }
18614
18615    /// Sets the value of the `ShareLvl` field.
18616    pub const fn set_sharelvl(&mut self, value: u8) {
18617        let offset = Self::SHARELVL_SHIFT;
18618        assert!(value & (Self::SHARELVL_MASK as u8) == value);
18619        *self = Self::from_bits_retain(
18620            (self.bits() & !(Self::SHARELVL_MASK << offset)) | ((value as u32) << offset),
18621        );
18622    }
18623
18624    /// Returns a copy with the `ShareLvl` field set to the given value.
18625    pub const fn with_sharelvl(mut self, value: u8) -> Self {
18626        self.set_sharelvl(value);
18627        self
18628    }
18629
18630    /// Returns the value of the `TCM` field.
18631    pub const fn tcm(self) -> u8 {
18632        ((self.bits() >> Self::TCM_SHIFT) & 0b1111) as u8
18633    }
18634
18635    /// Sets the value of the `TCM` field.
18636    pub const fn set_tcm(&mut self, value: u8) {
18637        let offset = Self::TCM_SHIFT;
18638        assert!(value & (Self::TCM_MASK as u8) == value);
18639        *self = Self::from_bits_retain(
18640            (self.bits() & !(Self::TCM_MASK << offset)) | ((value as u32) << offset),
18641        );
18642    }
18643
18644    /// Returns a copy with the `TCM` field set to the given value.
18645    pub const fn with_tcm(mut self, value: u8) -> Self {
18646        self.set_tcm(value);
18647        self
18648    }
18649
18650    /// Returns the value of the `AuxReg` field.
18651    pub const fn auxreg(self) -> u8 {
18652        ((self.bits() >> Self::AUXREG_SHIFT) & 0b1111) as u8
18653    }
18654
18655    /// Sets the value of the `AuxReg` field.
18656    pub const fn set_auxreg(&mut self, value: u8) {
18657        let offset = Self::AUXREG_SHIFT;
18658        assert!(value & (Self::AUXREG_MASK as u8) == value);
18659        *self = Self::from_bits_retain(
18660            (self.bits() & !(Self::AUXREG_MASK << offset)) | ((value as u32) << offset),
18661        );
18662    }
18663
18664    /// Returns a copy with the `AuxReg` field set to the given value.
18665    pub const fn with_auxreg(mut self, value: u8) -> Self {
18666        self.set_auxreg(value);
18667        self
18668    }
18669
18670    /// Returns the value of the `FCSE` field.
18671    pub const fn fcse(self) -> u8 {
18672        ((self.bits() >> Self::FCSE_SHIFT) & 0b1111) as u8
18673    }
18674
18675    /// Sets the value of the `FCSE` field.
18676    pub const fn set_fcse(&mut self, value: u8) {
18677        let offset = Self::FCSE_SHIFT;
18678        assert!(value & (Self::FCSE_MASK as u8) == value);
18679        *self = Self::from_bits_retain(
18680            (self.bits() & !(Self::FCSE_MASK << offset)) | ((value as u32) << offset),
18681        );
18682    }
18683
18684    /// Returns a copy with the `FCSE` field set to the given value.
18685    pub const fn with_fcse(mut self, value: u8) -> Self {
18686        self.set_fcse(value);
18687        self
18688    }
18689
18690    /// Returns the value of the `InnerShr` field.
18691    pub const fn innershr(self) -> u8 {
18692        ((self.bits() >> Self::INNERSHR_SHIFT) & 0b1111) as u8
18693    }
18694
18695    /// Sets the value of the `InnerShr` field.
18696    pub const fn set_innershr(&mut self, value: u8) {
18697        let offset = Self::INNERSHR_SHIFT;
18698        assert!(value & (Self::INNERSHR_MASK as u8) == value);
18699        *self = Self::from_bits_retain(
18700            (self.bits() & !(Self::INNERSHR_MASK << offset)) | ((value as u32) << offset),
18701        );
18702    }
18703
18704    /// Returns a copy with the `InnerShr` field set to the given value.
18705    pub const fn with_innershr(mut self, value: u8) -> Self {
18706        self.set_innershr(value);
18707        self
18708    }
18709}
18710
18711bitflags! {
18712    /// `ID_MMFR1` system register value.
18713    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18714    #[repr(transparent)]
18715    pub struct IdMmfr1: u32 {
18716    }
18717}
18718
18719impl IdMmfr1 {
18720    /// Offset of the `L1HvdVA` field.
18721    pub const L1HVDVA_SHIFT: u32 = 0;
18722    /// Mask for the `L1HvdVA` field.
18723    pub const L1HVDVA_MASK: u32 = 0b1111;
18724    /// Offset of the `L1UniVA` field.
18725    pub const L1UNIVA_SHIFT: u32 = 4;
18726    /// Mask for the `L1UniVA` field.
18727    pub const L1UNIVA_MASK: u32 = 0b1111;
18728    /// Offset of the `L1HvdSW` field.
18729    pub const L1HVDSW_SHIFT: u32 = 8;
18730    /// Mask for the `L1HvdSW` field.
18731    pub const L1HVDSW_MASK: u32 = 0b1111;
18732    /// Offset of the `L1UniSW` field.
18733    pub const L1UNISW_SHIFT: u32 = 12;
18734    /// Mask for the `L1UniSW` field.
18735    pub const L1UNISW_MASK: u32 = 0b1111;
18736    /// Offset of the `L1Hvd` field.
18737    pub const L1HVD_SHIFT: u32 = 16;
18738    /// Mask for the `L1Hvd` field.
18739    pub const L1HVD_MASK: u32 = 0b1111;
18740    /// Offset of the `L1Uni` field.
18741    pub const L1UNI_SHIFT: u32 = 20;
18742    /// Mask for the `L1Uni` field.
18743    pub const L1UNI_MASK: u32 = 0b1111;
18744    /// Offset of the `L1TstCln` field.
18745    pub const L1TSTCLN_SHIFT: u32 = 24;
18746    /// Mask for the `L1TstCln` field.
18747    pub const L1TSTCLN_MASK: u32 = 0b1111;
18748    /// Offset of the `BPred` field.
18749    pub const BPRED_SHIFT: u32 = 28;
18750    /// Mask for the `BPred` field.
18751    pub const BPRED_MASK: u32 = 0b1111;
18752
18753    /// Returns the value of the `L1HvdVA` field.
18754    pub const fn l1hvdva(self) -> u8 {
18755        ((self.bits() >> Self::L1HVDVA_SHIFT) & 0b1111) as u8
18756    }
18757
18758    /// Sets the value of the `L1HvdVA` field.
18759    pub const fn set_l1hvdva(&mut self, value: u8) {
18760        let offset = Self::L1HVDVA_SHIFT;
18761        assert!(value & (Self::L1HVDVA_MASK as u8) == value);
18762        *self = Self::from_bits_retain(
18763            (self.bits() & !(Self::L1HVDVA_MASK << offset)) | ((value as u32) << offset),
18764        );
18765    }
18766
18767    /// Returns a copy with the `L1HvdVA` field set to the given value.
18768    pub const fn with_l1hvdva(mut self, value: u8) -> Self {
18769        self.set_l1hvdva(value);
18770        self
18771    }
18772
18773    /// Returns the value of the `L1UniVA` field.
18774    pub const fn l1univa(self) -> u8 {
18775        ((self.bits() >> Self::L1UNIVA_SHIFT) & 0b1111) as u8
18776    }
18777
18778    /// Sets the value of the `L1UniVA` field.
18779    pub const fn set_l1univa(&mut self, value: u8) {
18780        let offset = Self::L1UNIVA_SHIFT;
18781        assert!(value & (Self::L1UNIVA_MASK as u8) == value);
18782        *self = Self::from_bits_retain(
18783            (self.bits() & !(Self::L1UNIVA_MASK << offset)) | ((value as u32) << offset),
18784        );
18785    }
18786
18787    /// Returns a copy with the `L1UniVA` field set to the given value.
18788    pub const fn with_l1univa(mut self, value: u8) -> Self {
18789        self.set_l1univa(value);
18790        self
18791    }
18792
18793    /// Returns the value of the `L1HvdSW` field.
18794    pub const fn l1hvdsw(self) -> u8 {
18795        ((self.bits() >> Self::L1HVDSW_SHIFT) & 0b1111) as u8
18796    }
18797
18798    /// Sets the value of the `L1HvdSW` field.
18799    pub const fn set_l1hvdsw(&mut self, value: u8) {
18800        let offset = Self::L1HVDSW_SHIFT;
18801        assert!(value & (Self::L1HVDSW_MASK as u8) == value);
18802        *self = Self::from_bits_retain(
18803            (self.bits() & !(Self::L1HVDSW_MASK << offset)) | ((value as u32) << offset),
18804        );
18805    }
18806
18807    /// Returns a copy with the `L1HvdSW` field set to the given value.
18808    pub const fn with_l1hvdsw(mut self, value: u8) -> Self {
18809        self.set_l1hvdsw(value);
18810        self
18811    }
18812
18813    /// Returns the value of the `L1UniSW` field.
18814    pub const fn l1unisw(self) -> u8 {
18815        ((self.bits() >> Self::L1UNISW_SHIFT) & 0b1111) as u8
18816    }
18817
18818    /// Sets the value of the `L1UniSW` field.
18819    pub const fn set_l1unisw(&mut self, value: u8) {
18820        let offset = Self::L1UNISW_SHIFT;
18821        assert!(value & (Self::L1UNISW_MASK as u8) == value);
18822        *self = Self::from_bits_retain(
18823            (self.bits() & !(Self::L1UNISW_MASK << offset)) | ((value as u32) << offset),
18824        );
18825    }
18826
18827    /// Returns a copy with the `L1UniSW` field set to the given value.
18828    pub const fn with_l1unisw(mut self, value: u8) -> Self {
18829        self.set_l1unisw(value);
18830        self
18831    }
18832
18833    /// Returns the value of the `L1Hvd` field.
18834    pub const fn l1hvd(self) -> u8 {
18835        ((self.bits() >> Self::L1HVD_SHIFT) & 0b1111) as u8
18836    }
18837
18838    /// Sets the value of the `L1Hvd` field.
18839    pub const fn set_l1hvd(&mut self, value: u8) {
18840        let offset = Self::L1HVD_SHIFT;
18841        assert!(value & (Self::L1HVD_MASK as u8) == value);
18842        *self = Self::from_bits_retain(
18843            (self.bits() & !(Self::L1HVD_MASK << offset)) | ((value as u32) << offset),
18844        );
18845    }
18846
18847    /// Returns a copy with the `L1Hvd` field set to the given value.
18848    pub const fn with_l1hvd(mut self, value: u8) -> Self {
18849        self.set_l1hvd(value);
18850        self
18851    }
18852
18853    /// Returns the value of the `L1Uni` field.
18854    pub const fn l1uni(self) -> u8 {
18855        ((self.bits() >> Self::L1UNI_SHIFT) & 0b1111) as u8
18856    }
18857
18858    /// Sets the value of the `L1Uni` field.
18859    pub const fn set_l1uni(&mut self, value: u8) {
18860        let offset = Self::L1UNI_SHIFT;
18861        assert!(value & (Self::L1UNI_MASK as u8) == value);
18862        *self = Self::from_bits_retain(
18863            (self.bits() & !(Self::L1UNI_MASK << offset)) | ((value as u32) << offset),
18864        );
18865    }
18866
18867    /// Returns a copy with the `L1Uni` field set to the given value.
18868    pub const fn with_l1uni(mut self, value: u8) -> Self {
18869        self.set_l1uni(value);
18870        self
18871    }
18872
18873    /// Returns the value of the `L1TstCln` field.
18874    pub const fn l1tstcln(self) -> u8 {
18875        ((self.bits() >> Self::L1TSTCLN_SHIFT) & 0b1111) as u8
18876    }
18877
18878    /// Sets the value of the `L1TstCln` field.
18879    pub const fn set_l1tstcln(&mut self, value: u8) {
18880        let offset = Self::L1TSTCLN_SHIFT;
18881        assert!(value & (Self::L1TSTCLN_MASK as u8) == value);
18882        *self = Self::from_bits_retain(
18883            (self.bits() & !(Self::L1TSTCLN_MASK << offset)) | ((value as u32) << offset),
18884        );
18885    }
18886
18887    /// Returns a copy with the `L1TstCln` field set to the given value.
18888    pub const fn with_l1tstcln(mut self, value: u8) -> Self {
18889        self.set_l1tstcln(value);
18890        self
18891    }
18892
18893    /// Returns the value of the `BPred` field.
18894    pub const fn bpred(self) -> u8 {
18895        ((self.bits() >> Self::BPRED_SHIFT) & 0b1111) as u8
18896    }
18897
18898    /// Sets the value of the `BPred` field.
18899    pub const fn set_bpred(&mut self, value: u8) {
18900        let offset = Self::BPRED_SHIFT;
18901        assert!(value & (Self::BPRED_MASK as u8) == value);
18902        *self = Self::from_bits_retain(
18903            (self.bits() & !(Self::BPRED_MASK << offset)) | ((value as u32) << offset),
18904        );
18905    }
18906
18907    /// Returns a copy with the `BPred` field set to the given value.
18908    pub const fn with_bpred(mut self, value: u8) -> Self {
18909        self.set_bpred(value);
18910        self
18911    }
18912}
18913
18914bitflags! {
18915    /// `ID_MMFR2` system register value.
18916    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
18917    #[repr(transparent)]
18918    pub struct IdMmfr2: u32 {
18919    }
18920}
18921
18922impl IdMmfr2 {
18923    /// Offset of the `L1HvdFG` field.
18924    pub const L1HVDFG_SHIFT: u32 = 0;
18925    /// Mask for the `L1HvdFG` field.
18926    pub const L1HVDFG_MASK: u32 = 0b1111;
18927    /// Offset of the `L1HvdBG` field.
18928    pub const L1HVDBG_SHIFT: u32 = 4;
18929    /// Mask for the `L1HvdBG` field.
18930    pub const L1HVDBG_MASK: u32 = 0b1111;
18931    /// Offset of the `L1HvdRng` field.
18932    pub const L1HVDRNG_SHIFT: u32 = 8;
18933    /// Mask for the `L1HvdRng` field.
18934    pub const L1HVDRNG_MASK: u32 = 0b1111;
18935    /// Offset of the `HvdTLB` field.
18936    pub const HVDTLB_SHIFT: u32 = 12;
18937    /// Mask for the `HvdTLB` field.
18938    pub const HVDTLB_MASK: u32 = 0b1111;
18939    /// Offset of the `UniTLB` field.
18940    pub const UNITLB_SHIFT: u32 = 16;
18941    /// Mask for the `UniTLB` field.
18942    pub const UNITLB_MASK: u32 = 0b1111;
18943    /// Offset of the `MemBarr` field.
18944    pub const MEMBARR_SHIFT: u32 = 20;
18945    /// Mask for the `MemBarr` field.
18946    pub const MEMBARR_MASK: u32 = 0b1111;
18947    /// Offset of the `WFIStall` field.
18948    pub const WFISTALL_SHIFT: u32 = 24;
18949    /// Mask for the `WFIStall` field.
18950    pub const WFISTALL_MASK: u32 = 0b1111;
18951    /// Offset of the `HWAccFlg` field.
18952    pub const HWACCFLG_SHIFT: u32 = 28;
18953    /// Mask for the `HWAccFlg` field.
18954    pub const HWACCFLG_MASK: u32 = 0b1111;
18955
18956    /// Returns the value of the `L1HvdFG` field.
18957    pub const fn l1hvdfg(self) -> u8 {
18958        ((self.bits() >> Self::L1HVDFG_SHIFT) & 0b1111) as u8
18959    }
18960
18961    /// Sets the value of the `L1HvdFG` field.
18962    pub const fn set_l1hvdfg(&mut self, value: u8) {
18963        let offset = Self::L1HVDFG_SHIFT;
18964        assert!(value & (Self::L1HVDFG_MASK as u8) == value);
18965        *self = Self::from_bits_retain(
18966            (self.bits() & !(Self::L1HVDFG_MASK << offset)) | ((value as u32) << offset),
18967        );
18968    }
18969
18970    /// Returns a copy with the `L1HvdFG` field set to the given value.
18971    pub const fn with_l1hvdfg(mut self, value: u8) -> Self {
18972        self.set_l1hvdfg(value);
18973        self
18974    }
18975
18976    /// Returns the value of the `L1HvdBG` field.
18977    pub const fn l1hvdbg(self) -> u8 {
18978        ((self.bits() >> Self::L1HVDBG_SHIFT) & 0b1111) as u8
18979    }
18980
18981    /// Sets the value of the `L1HvdBG` field.
18982    pub const fn set_l1hvdbg(&mut self, value: u8) {
18983        let offset = Self::L1HVDBG_SHIFT;
18984        assert!(value & (Self::L1HVDBG_MASK as u8) == value);
18985        *self = Self::from_bits_retain(
18986            (self.bits() & !(Self::L1HVDBG_MASK << offset)) | ((value as u32) << offset),
18987        );
18988    }
18989
18990    /// Returns a copy with the `L1HvdBG` field set to the given value.
18991    pub const fn with_l1hvdbg(mut self, value: u8) -> Self {
18992        self.set_l1hvdbg(value);
18993        self
18994    }
18995
18996    /// Returns the value of the `L1HvdRng` field.
18997    pub const fn l1hvdrng(self) -> u8 {
18998        ((self.bits() >> Self::L1HVDRNG_SHIFT) & 0b1111) as u8
18999    }
19000
19001    /// Sets the value of the `L1HvdRng` field.
19002    pub const fn set_l1hvdrng(&mut self, value: u8) {
19003        let offset = Self::L1HVDRNG_SHIFT;
19004        assert!(value & (Self::L1HVDRNG_MASK as u8) == value);
19005        *self = Self::from_bits_retain(
19006            (self.bits() & !(Self::L1HVDRNG_MASK << offset)) | ((value as u32) << offset),
19007        );
19008    }
19009
19010    /// Returns a copy with the `L1HvdRng` field set to the given value.
19011    pub const fn with_l1hvdrng(mut self, value: u8) -> Self {
19012        self.set_l1hvdrng(value);
19013        self
19014    }
19015
19016    /// Returns the value of the `HvdTLB` field.
19017    pub const fn hvdtlb(self) -> u8 {
19018        ((self.bits() >> Self::HVDTLB_SHIFT) & 0b1111) as u8
19019    }
19020
19021    /// Sets the value of the `HvdTLB` field.
19022    pub const fn set_hvdtlb(&mut self, value: u8) {
19023        let offset = Self::HVDTLB_SHIFT;
19024        assert!(value & (Self::HVDTLB_MASK as u8) == value);
19025        *self = Self::from_bits_retain(
19026            (self.bits() & !(Self::HVDTLB_MASK << offset)) | ((value as u32) << offset),
19027        );
19028    }
19029
19030    /// Returns a copy with the `HvdTLB` field set to the given value.
19031    pub const fn with_hvdtlb(mut self, value: u8) -> Self {
19032        self.set_hvdtlb(value);
19033        self
19034    }
19035
19036    /// Returns the value of the `UniTLB` field.
19037    pub const fn unitlb(self) -> u8 {
19038        ((self.bits() >> Self::UNITLB_SHIFT) & 0b1111) as u8
19039    }
19040
19041    /// Sets the value of the `UniTLB` field.
19042    pub const fn set_unitlb(&mut self, value: u8) {
19043        let offset = Self::UNITLB_SHIFT;
19044        assert!(value & (Self::UNITLB_MASK as u8) == value);
19045        *self = Self::from_bits_retain(
19046            (self.bits() & !(Self::UNITLB_MASK << offset)) | ((value as u32) << offset),
19047        );
19048    }
19049
19050    /// Returns a copy with the `UniTLB` field set to the given value.
19051    pub const fn with_unitlb(mut self, value: u8) -> Self {
19052        self.set_unitlb(value);
19053        self
19054    }
19055
19056    /// Returns the value of the `MemBarr` field.
19057    pub const fn membarr(self) -> u8 {
19058        ((self.bits() >> Self::MEMBARR_SHIFT) & 0b1111) as u8
19059    }
19060
19061    /// Sets the value of the `MemBarr` field.
19062    pub const fn set_membarr(&mut self, value: u8) {
19063        let offset = Self::MEMBARR_SHIFT;
19064        assert!(value & (Self::MEMBARR_MASK as u8) == value);
19065        *self = Self::from_bits_retain(
19066            (self.bits() & !(Self::MEMBARR_MASK << offset)) | ((value as u32) << offset),
19067        );
19068    }
19069
19070    /// Returns a copy with the `MemBarr` field set to the given value.
19071    pub const fn with_membarr(mut self, value: u8) -> Self {
19072        self.set_membarr(value);
19073        self
19074    }
19075
19076    /// Returns the value of the `WFIStall` field.
19077    pub const fn wfistall(self) -> u8 {
19078        ((self.bits() >> Self::WFISTALL_SHIFT) & 0b1111) as u8
19079    }
19080
19081    /// Sets the value of the `WFIStall` field.
19082    pub const fn set_wfistall(&mut self, value: u8) {
19083        let offset = Self::WFISTALL_SHIFT;
19084        assert!(value & (Self::WFISTALL_MASK as u8) == value);
19085        *self = Self::from_bits_retain(
19086            (self.bits() & !(Self::WFISTALL_MASK << offset)) | ((value as u32) << offset),
19087        );
19088    }
19089
19090    /// Returns a copy with the `WFIStall` field set to the given value.
19091    pub const fn with_wfistall(mut self, value: u8) -> Self {
19092        self.set_wfistall(value);
19093        self
19094    }
19095
19096    /// Returns the value of the `HWAccFlg` field.
19097    pub const fn hwaccflg(self) -> u8 {
19098        ((self.bits() >> Self::HWACCFLG_SHIFT) & 0b1111) as u8
19099    }
19100
19101    /// Sets the value of the `HWAccFlg` field.
19102    pub const fn set_hwaccflg(&mut self, value: u8) {
19103        let offset = Self::HWACCFLG_SHIFT;
19104        assert!(value & (Self::HWACCFLG_MASK as u8) == value);
19105        *self = Self::from_bits_retain(
19106            (self.bits() & !(Self::HWACCFLG_MASK << offset)) | ((value as u32) << offset),
19107        );
19108    }
19109
19110    /// Returns a copy with the `HWAccFlg` field set to the given value.
19111    pub const fn with_hwaccflg(mut self, value: u8) -> Self {
19112        self.set_hwaccflg(value);
19113        self
19114    }
19115}
19116
19117bitflags! {
19118    /// `ID_MMFR3` system register value.
19119    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19120    #[repr(transparent)]
19121    pub struct IdMmfr3: u32 {
19122    }
19123}
19124
19125impl IdMmfr3 {
19126    /// Offset of the `CMaintVA` field.
19127    pub const CMAINTVA_SHIFT: u32 = 0;
19128    /// Mask for the `CMaintVA` field.
19129    pub const CMAINTVA_MASK: u32 = 0b1111;
19130    /// Offset of the `CMaintSW` field.
19131    pub const CMAINTSW_SHIFT: u32 = 4;
19132    /// Mask for the `CMaintSW` field.
19133    pub const CMAINTSW_MASK: u32 = 0b1111;
19134    /// Offset of the `BPMaint` field.
19135    pub const BPMAINT_SHIFT: u32 = 8;
19136    /// Mask for the `BPMaint` field.
19137    pub const BPMAINT_MASK: u32 = 0b1111;
19138    /// Offset of the `MaintBcst` field.
19139    pub const MAINTBCST_SHIFT: u32 = 12;
19140    /// Mask for the `MaintBcst` field.
19141    pub const MAINTBCST_MASK: u32 = 0b1111;
19142    /// Offset of the `PAN` field.
19143    pub const PAN_SHIFT: u32 = 16;
19144    /// Mask for the `PAN` field.
19145    pub const PAN_MASK: u32 = 0b1111;
19146    /// Offset of the `CohWalk` field.
19147    pub const COHWALK_SHIFT: u32 = 20;
19148    /// Mask for the `CohWalk` field.
19149    pub const COHWALK_MASK: u32 = 0b1111;
19150    /// Offset of the `CMemSz` field.
19151    pub const CMEMSZ_SHIFT: u32 = 24;
19152    /// Mask for the `CMemSz` field.
19153    pub const CMEMSZ_MASK: u32 = 0b1111;
19154    /// Offset of the `Supersec` field.
19155    pub const SUPERSEC_SHIFT: u32 = 28;
19156    /// Mask for the `Supersec` field.
19157    pub const SUPERSEC_MASK: u32 = 0b1111;
19158
19159    /// Returns the value of the `CMaintVA` field.
19160    pub const fn cmaintva(self) -> u8 {
19161        ((self.bits() >> Self::CMAINTVA_SHIFT) & 0b1111) as u8
19162    }
19163
19164    /// Sets the value of the `CMaintVA` field.
19165    pub const fn set_cmaintva(&mut self, value: u8) {
19166        let offset = Self::CMAINTVA_SHIFT;
19167        assert!(value & (Self::CMAINTVA_MASK as u8) == value);
19168        *self = Self::from_bits_retain(
19169            (self.bits() & !(Self::CMAINTVA_MASK << offset)) | ((value as u32) << offset),
19170        );
19171    }
19172
19173    /// Returns a copy with the `CMaintVA` field set to the given value.
19174    pub const fn with_cmaintva(mut self, value: u8) -> Self {
19175        self.set_cmaintva(value);
19176        self
19177    }
19178
19179    /// Returns the value of the `CMaintSW` field.
19180    pub const fn cmaintsw(self) -> u8 {
19181        ((self.bits() >> Self::CMAINTSW_SHIFT) & 0b1111) as u8
19182    }
19183
19184    /// Sets the value of the `CMaintSW` field.
19185    pub const fn set_cmaintsw(&mut self, value: u8) {
19186        let offset = Self::CMAINTSW_SHIFT;
19187        assert!(value & (Self::CMAINTSW_MASK as u8) == value);
19188        *self = Self::from_bits_retain(
19189            (self.bits() & !(Self::CMAINTSW_MASK << offset)) | ((value as u32) << offset),
19190        );
19191    }
19192
19193    /// Returns a copy with the `CMaintSW` field set to the given value.
19194    pub const fn with_cmaintsw(mut self, value: u8) -> Self {
19195        self.set_cmaintsw(value);
19196        self
19197    }
19198
19199    /// Returns the value of the `BPMaint` field.
19200    pub const fn bpmaint(self) -> u8 {
19201        ((self.bits() >> Self::BPMAINT_SHIFT) & 0b1111) as u8
19202    }
19203
19204    /// Sets the value of the `BPMaint` field.
19205    pub const fn set_bpmaint(&mut self, value: u8) {
19206        let offset = Self::BPMAINT_SHIFT;
19207        assert!(value & (Self::BPMAINT_MASK as u8) == value);
19208        *self = Self::from_bits_retain(
19209            (self.bits() & !(Self::BPMAINT_MASK << offset)) | ((value as u32) << offset),
19210        );
19211    }
19212
19213    /// Returns a copy with the `BPMaint` field set to the given value.
19214    pub const fn with_bpmaint(mut self, value: u8) -> Self {
19215        self.set_bpmaint(value);
19216        self
19217    }
19218
19219    /// Returns the value of the `MaintBcst` field.
19220    pub const fn maintbcst(self) -> u8 {
19221        ((self.bits() >> Self::MAINTBCST_SHIFT) & 0b1111) as u8
19222    }
19223
19224    /// Sets the value of the `MaintBcst` field.
19225    pub const fn set_maintbcst(&mut self, value: u8) {
19226        let offset = Self::MAINTBCST_SHIFT;
19227        assert!(value & (Self::MAINTBCST_MASK as u8) == value);
19228        *self = Self::from_bits_retain(
19229            (self.bits() & !(Self::MAINTBCST_MASK << offset)) | ((value as u32) << offset),
19230        );
19231    }
19232
19233    /// Returns a copy with the `MaintBcst` field set to the given value.
19234    pub const fn with_maintbcst(mut self, value: u8) -> Self {
19235        self.set_maintbcst(value);
19236        self
19237    }
19238
19239    /// Returns the value of the `PAN` field.
19240    pub const fn pan(self) -> u8 {
19241        ((self.bits() >> Self::PAN_SHIFT) & 0b1111) as u8
19242    }
19243
19244    /// Sets the value of the `PAN` field.
19245    pub const fn set_pan(&mut self, value: u8) {
19246        let offset = Self::PAN_SHIFT;
19247        assert!(value & (Self::PAN_MASK as u8) == value);
19248        *self = Self::from_bits_retain(
19249            (self.bits() & !(Self::PAN_MASK << offset)) | ((value as u32) << offset),
19250        );
19251    }
19252
19253    /// Returns a copy with the `PAN` field set to the given value.
19254    pub const fn with_pan(mut self, value: u8) -> Self {
19255        self.set_pan(value);
19256        self
19257    }
19258
19259    /// Returns the value of the `CohWalk` field.
19260    pub const fn cohwalk(self) -> u8 {
19261        ((self.bits() >> Self::COHWALK_SHIFT) & 0b1111) as u8
19262    }
19263
19264    /// Sets the value of the `CohWalk` field.
19265    pub const fn set_cohwalk(&mut self, value: u8) {
19266        let offset = Self::COHWALK_SHIFT;
19267        assert!(value & (Self::COHWALK_MASK as u8) == value);
19268        *self = Self::from_bits_retain(
19269            (self.bits() & !(Self::COHWALK_MASK << offset)) | ((value as u32) << offset),
19270        );
19271    }
19272
19273    /// Returns a copy with the `CohWalk` field set to the given value.
19274    pub const fn with_cohwalk(mut self, value: u8) -> Self {
19275        self.set_cohwalk(value);
19276        self
19277    }
19278
19279    /// Returns the value of the `CMemSz` field.
19280    pub const fn cmemsz(self) -> u8 {
19281        ((self.bits() >> Self::CMEMSZ_SHIFT) & 0b1111) as u8
19282    }
19283
19284    /// Sets the value of the `CMemSz` field.
19285    pub const fn set_cmemsz(&mut self, value: u8) {
19286        let offset = Self::CMEMSZ_SHIFT;
19287        assert!(value & (Self::CMEMSZ_MASK as u8) == value);
19288        *self = Self::from_bits_retain(
19289            (self.bits() & !(Self::CMEMSZ_MASK << offset)) | ((value as u32) << offset),
19290        );
19291    }
19292
19293    /// Returns a copy with the `CMemSz` field set to the given value.
19294    pub const fn with_cmemsz(mut self, value: u8) -> Self {
19295        self.set_cmemsz(value);
19296        self
19297    }
19298
19299    /// Returns the value of the `Supersec` field.
19300    pub const fn supersec(self) -> u8 {
19301        ((self.bits() >> Self::SUPERSEC_SHIFT) & 0b1111) as u8
19302    }
19303
19304    /// Sets the value of the `Supersec` field.
19305    pub const fn set_supersec(&mut self, value: u8) {
19306        let offset = Self::SUPERSEC_SHIFT;
19307        assert!(value & (Self::SUPERSEC_MASK as u8) == value);
19308        *self = Self::from_bits_retain(
19309            (self.bits() & !(Self::SUPERSEC_MASK << offset)) | ((value as u32) << offset),
19310        );
19311    }
19312
19313    /// Returns a copy with the `Supersec` field set to the given value.
19314    pub const fn with_supersec(mut self, value: u8) -> Self {
19315        self.set_supersec(value);
19316        self
19317    }
19318}
19319
19320bitflags! {
19321    /// `ID_MMFR4` system register value.
19322    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19323    #[repr(transparent)]
19324    pub struct IdMmfr4: u32 {
19325    }
19326}
19327
19328impl IdMmfr4 {
19329    /// Offset of the `SpecSEI` field.
19330    pub const SPECSEI_SHIFT: u32 = 0;
19331    /// Mask for the `SpecSEI` field.
19332    pub const SPECSEI_MASK: u32 = 0b1111;
19333    /// Offset of the `AC2` field.
19334    pub const AC2_SHIFT: u32 = 4;
19335    /// Mask for the `AC2` field.
19336    pub const AC2_MASK: u32 = 0b1111;
19337    /// Offset of the `XNX` field.
19338    pub const XNX_SHIFT: u32 = 8;
19339    /// Mask for the `XNX` field.
19340    pub const XNX_MASK: u32 = 0b1111;
19341    /// Offset of the `CnP` field.
19342    pub const CNP_SHIFT: u32 = 12;
19343    /// Mask for the `CnP` field.
19344    pub const CNP_MASK: u32 = 0b1111;
19345    /// Offset of the `HPDS` field.
19346    pub const HPDS_SHIFT: u32 = 16;
19347    /// Mask for the `HPDS` field.
19348    pub const HPDS_MASK: u32 = 0b1111;
19349    /// Offset of the `LSM` field.
19350    pub const LSM_SHIFT: u32 = 20;
19351    /// Mask for the `LSM` field.
19352    pub const LSM_MASK: u32 = 0b1111;
19353    /// Offset of the `CCIDX` field.
19354    pub const CCIDX_SHIFT: u32 = 24;
19355    /// Mask for the `CCIDX` field.
19356    pub const CCIDX_MASK: u32 = 0b1111;
19357    /// Offset of the `EVT` field.
19358    pub const EVT_SHIFT: u32 = 28;
19359    /// Mask for the `EVT` field.
19360    pub const EVT_MASK: u32 = 0b1111;
19361
19362    /// Returns the value of the `SpecSEI` field.
19363    pub const fn specsei(self) -> u8 {
19364        ((self.bits() >> Self::SPECSEI_SHIFT) & 0b1111) as u8
19365    }
19366
19367    /// Sets the value of the `SpecSEI` field.
19368    pub const fn set_specsei(&mut self, value: u8) {
19369        let offset = Self::SPECSEI_SHIFT;
19370        assert!(value & (Self::SPECSEI_MASK as u8) == value);
19371        *self = Self::from_bits_retain(
19372            (self.bits() & !(Self::SPECSEI_MASK << offset)) | ((value as u32) << offset),
19373        );
19374    }
19375
19376    /// Returns a copy with the `SpecSEI` field set to the given value.
19377    pub const fn with_specsei(mut self, value: u8) -> Self {
19378        self.set_specsei(value);
19379        self
19380    }
19381
19382    /// Returns the value of the `AC2` field.
19383    pub const fn ac2(self) -> u8 {
19384        ((self.bits() >> Self::AC2_SHIFT) & 0b1111) as u8
19385    }
19386
19387    /// Sets the value of the `AC2` field.
19388    pub const fn set_ac2(&mut self, value: u8) {
19389        let offset = Self::AC2_SHIFT;
19390        assert!(value & (Self::AC2_MASK as u8) == value);
19391        *self = Self::from_bits_retain(
19392            (self.bits() & !(Self::AC2_MASK << offset)) | ((value as u32) << offset),
19393        );
19394    }
19395
19396    /// Returns a copy with the `AC2` field set to the given value.
19397    pub const fn with_ac2(mut self, value: u8) -> Self {
19398        self.set_ac2(value);
19399        self
19400    }
19401
19402    /// Returns the value of the `XNX` field.
19403    pub const fn xnx(self) -> u8 {
19404        ((self.bits() >> Self::XNX_SHIFT) & 0b1111) as u8
19405    }
19406
19407    /// Sets the value of the `XNX` field.
19408    pub const fn set_xnx(&mut self, value: u8) {
19409        let offset = Self::XNX_SHIFT;
19410        assert!(value & (Self::XNX_MASK as u8) == value);
19411        *self = Self::from_bits_retain(
19412            (self.bits() & !(Self::XNX_MASK << offset)) | ((value as u32) << offset),
19413        );
19414    }
19415
19416    /// Returns a copy with the `XNX` field set to the given value.
19417    pub const fn with_xnx(mut self, value: u8) -> Self {
19418        self.set_xnx(value);
19419        self
19420    }
19421
19422    /// Returns the value of the `CnP` field.
19423    pub const fn cnp(self) -> u8 {
19424        ((self.bits() >> Self::CNP_SHIFT) & 0b1111) as u8
19425    }
19426
19427    /// Sets the value of the `CnP` field.
19428    pub const fn set_cnp(&mut self, value: u8) {
19429        let offset = Self::CNP_SHIFT;
19430        assert!(value & (Self::CNP_MASK as u8) == value);
19431        *self = Self::from_bits_retain(
19432            (self.bits() & !(Self::CNP_MASK << offset)) | ((value as u32) << offset),
19433        );
19434    }
19435
19436    /// Returns a copy with the `CnP` field set to the given value.
19437    pub const fn with_cnp(mut self, value: u8) -> Self {
19438        self.set_cnp(value);
19439        self
19440    }
19441
19442    /// Returns the value of the `HPDS` field.
19443    pub const fn hpds(self) -> u8 {
19444        ((self.bits() >> Self::HPDS_SHIFT) & 0b1111) as u8
19445    }
19446
19447    /// Sets the value of the `HPDS` field.
19448    pub const fn set_hpds(&mut self, value: u8) {
19449        let offset = Self::HPDS_SHIFT;
19450        assert!(value & (Self::HPDS_MASK as u8) == value);
19451        *self = Self::from_bits_retain(
19452            (self.bits() & !(Self::HPDS_MASK << offset)) | ((value as u32) << offset),
19453        );
19454    }
19455
19456    /// Returns a copy with the `HPDS` field set to the given value.
19457    pub const fn with_hpds(mut self, value: u8) -> Self {
19458        self.set_hpds(value);
19459        self
19460    }
19461
19462    /// Returns the value of the `LSM` field.
19463    pub const fn lsm(self) -> u8 {
19464        ((self.bits() >> Self::LSM_SHIFT) & 0b1111) as u8
19465    }
19466
19467    /// Sets the value of the `LSM` field.
19468    pub const fn set_lsm(&mut self, value: u8) {
19469        let offset = Self::LSM_SHIFT;
19470        assert!(value & (Self::LSM_MASK as u8) == value);
19471        *self = Self::from_bits_retain(
19472            (self.bits() & !(Self::LSM_MASK << offset)) | ((value as u32) << offset),
19473        );
19474    }
19475
19476    /// Returns a copy with the `LSM` field set to the given value.
19477    pub const fn with_lsm(mut self, value: u8) -> Self {
19478        self.set_lsm(value);
19479        self
19480    }
19481
19482    /// Returns the value of the `CCIDX` field.
19483    pub const fn ccidx(self) -> u8 {
19484        ((self.bits() >> Self::CCIDX_SHIFT) & 0b1111) as u8
19485    }
19486
19487    /// Sets the value of the `CCIDX` field.
19488    pub const fn set_ccidx(&mut self, value: u8) {
19489        let offset = Self::CCIDX_SHIFT;
19490        assert!(value & (Self::CCIDX_MASK as u8) == value);
19491        *self = Self::from_bits_retain(
19492            (self.bits() & !(Self::CCIDX_MASK << offset)) | ((value as u32) << offset),
19493        );
19494    }
19495
19496    /// Returns a copy with the `CCIDX` field set to the given value.
19497    pub const fn with_ccidx(mut self, value: u8) -> Self {
19498        self.set_ccidx(value);
19499        self
19500    }
19501
19502    /// Returns the value of the `EVT` field.
19503    pub const fn evt(self) -> u8 {
19504        ((self.bits() >> Self::EVT_SHIFT) & 0b1111) as u8
19505    }
19506
19507    /// Sets the value of the `EVT` field.
19508    pub const fn set_evt(&mut self, value: u8) {
19509        let offset = Self::EVT_SHIFT;
19510        assert!(value & (Self::EVT_MASK as u8) == value);
19511        *self = Self::from_bits_retain(
19512            (self.bits() & !(Self::EVT_MASK << offset)) | ((value as u32) << offset),
19513        );
19514    }
19515
19516    /// Returns a copy with the `EVT` field set to the given value.
19517    pub const fn with_evt(mut self, value: u8) -> Self {
19518        self.set_evt(value);
19519        self
19520    }
19521}
19522
19523bitflags! {
19524    /// `ID_MMFR5` system register value.
19525    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19526    #[repr(transparent)]
19527    pub struct IdMmfr5: u32 {
19528    }
19529}
19530
19531impl IdMmfr5 {
19532    /// Offset of the `ETS` field.
19533    pub const ETS_SHIFT: u32 = 0;
19534    /// Mask for the `ETS` field.
19535    pub const ETS_MASK: u32 = 0b1111;
19536    /// Offset of the `nTLBPA` field.
19537    pub const NTLBPA_SHIFT: u32 = 4;
19538    /// Mask for the `nTLBPA` field.
19539    pub const NTLBPA_MASK: u32 = 0b1111;
19540
19541    /// Returns the value of the `ETS` field.
19542    pub const fn ets(self) -> u8 {
19543        ((self.bits() >> Self::ETS_SHIFT) & 0b1111) as u8
19544    }
19545
19546    /// Sets the value of the `ETS` field.
19547    pub const fn set_ets(&mut self, value: u8) {
19548        let offset = Self::ETS_SHIFT;
19549        assert!(value & (Self::ETS_MASK as u8) == value);
19550        *self = Self::from_bits_retain(
19551            (self.bits() & !(Self::ETS_MASK << offset)) | ((value as u32) << offset),
19552        );
19553    }
19554
19555    /// Returns a copy with the `ETS` field set to the given value.
19556    pub const fn with_ets(mut self, value: u8) -> Self {
19557        self.set_ets(value);
19558        self
19559    }
19560
19561    /// Returns the value of the `nTLBPA` field.
19562    pub const fn ntlbpa(self) -> u8 {
19563        ((self.bits() >> Self::NTLBPA_SHIFT) & 0b1111) as u8
19564    }
19565
19566    /// Sets the value of the `nTLBPA` field.
19567    pub const fn set_ntlbpa(&mut self, value: u8) {
19568        let offset = Self::NTLBPA_SHIFT;
19569        assert!(value & (Self::NTLBPA_MASK as u8) == value);
19570        *self = Self::from_bits_retain(
19571            (self.bits() & !(Self::NTLBPA_MASK << offset)) | ((value as u32) << offset),
19572        );
19573    }
19574
19575    /// Returns a copy with the `nTLBPA` field set to the given value.
19576    pub const fn with_ntlbpa(mut self, value: u8) -> Self {
19577        self.set_ntlbpa(value);
19578        self
19579    }
19580}
19581
19582bitflags! {
19583    /// `ID_PFR0` system register value.
19584    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19585    #[repr(transparent)]
19586    pub struct IdPfr0: u32 {
19587    }
19588}
19589
19590impl IdPfr0 {
19591    /// Offset of the `State0` field.
19592    pub const STATE0_SHIFT: u32 = 0;
19593    /// Mask for the `State0` field.
19594    pub const STATE0_MASK: u32 = 0b1111;
19595    /// Offset of the `State1` field.
19596    pub const STATE1_SHIFT: u32 = 4;
19597    /// Mask for the `State1` field.
19598    pub const STATE1_MASK: u32 = 0b1111;
19599    /// Offset of the `State2` field.
19600    pub const STATE2_SHIFT: u32 = 8;
19601    /// Mask for the `State2` field.
19602    pub const STATE2_MASK: u32 = 0b1111;
19603    /// Offset of the `State3` field.
19604    pub const STATE3_SHIFT: u32 = 12;
19605    /// Mask for the `State3` field.
19606    pub const STATE3_MASK: u32 = 0b1111;
19607    /// Offset of the `CSV2` field.
19608    pub const CSV2_SHIFT: u32 = 16;
19609    /// Mask for the `CSV2` field.
19610    pub const CSV2_MASK: u32 = 0b1111;
19611    /// Offset of the `AMU` field.
19612    pub const AMU_SHIFT: u32 = 20;
19613    /// Mask for the `AMU` field.
19614    pub const AMU_MASK: u32 = 0b1111;
19615    /// Offset of the `DIT` field.
19616    pub const DIT_SHIFT: u32 = 24;
19617    /// Mask for the `DIT` field.
19618    pub const DIT_MASK: u32 = 0b1111;
19619    /// Offset of the `RAS` field.
19620    pub const RAS_SHIFT: u32 = 28;
19621    /// Mask for the `RAS` field.
19622    pub const RAS_MASK: u32 = 0b1111;
19623
19624    /// Returns the value of the `State0` field.
19625    pub const fn state0(self) -> u8 {
19626        ((self.bits() >> Self::STATE0_SHIFT) & 0b1111) as u8
19627    }
19628
19629    /// Sets the value of the `State0` field.
19630    pub const fn set_state0(&mut self, value: u8) {
19631        let offset = Self::STATE0_SHIFT;
19632        assert!(value & (Self::STATE0_MASK as u8) == value);
19633        *self = Self::from_bits_retain(
19634            (self.bits() & !(Self::STATE0_MASK << offset)) | ((value as u32) << offset),
19635        );
19636    }
19637
19638    /// Returns a copy with the `State0` field set to the given value.
19639    pub const fn with_state0(mut self, value: u8) -> Self {
19640        self.set_state0(value);
19641        self
19642    }
19643
19644    /// Returns the value of the `State1` field.
19645    pub const fn state1(self) -> u8 {
19646        ((self.bits() >> Self::STATE1_SHIFT) & 0b1111) as u8
19647    }
19648
19649    /// Sets the value of the `State1` field.
19650    pub const fn set_state1(&mut self, value: u8) {
19651        let offset = Self::STATE1_SHIFT;
19652        assert!(value & (Self::STATE1_MASK as u8) == value);
19653        *self = Self::from_bits_retain(
19654            (self.bits() & !(Self::STATE1_MASK << offset)) | ((value as u32) << offset),
19655        );
19656    }
19657
19658    /// Returns a copy with the `State1` field set to the given value.
19659    pub const fn with_state1(mut self, value: u8) -> Self {
19660        self.set_state1(value);
19661        self
19662    }
19663
19664    /// Returns the value of the `State2` field.
19665    pub const fn state2(self) -> u8 {
19666        ((self.bits() >> Self::STATE2_SHIFT) & 0b1111) as u8
19667    }
19668
19669    /// Sets the value of the `State2` field.
19670    pub const fn set_state2(&mut self, value: u8) {
19671        let offset = Self::STATE2_SHIFT;
19672        assert!(value & (Self::STATE2_MASK as u8) == value);
19673        *self = Self::from_bits_retain(
19674            (self.bits() & !(Self::STATE2_MASK << offset)) | ((value as u32) << offset),
19675        );
19676    }
19677
19678    /// Returns a copy with the `State2` field set to the given value.
19679    pub const fn with_state2(mut self, value: u8) -> Self {
19680        self.set_state2(value);
19681        self
19682    }
19683
19684    /// Returns the value of the `State3` field.
19685    pub const fn state3(self) -> u8 {
19686        ((self.bits() >> Self::STATE3_SHIFT) & 0b1111) as u8
19687    }
19688
19689    /// Sets the value of the `State3` field.
19690    pub const fn set_state3(&mut self, value: u8) {
19691        let offset = Self::STATE3_SHIFT;
19692        assert!(value & (Self::STATE3_MASK as u8) == value);
19693        *self = Self::from_bits_retain(
19694            (self.bits() & !(Self::STATE3_MASK << offset)) | ((value as u32) << offset),
19695        );
19696    }
19697
19698    /// Returns a copy with the `State3` field set to the given value.
19699    pub const fn with_state3(mut self, value: u8) -> Self {
19700        self.set_state3(value);
19701        self
19702    }
19703
19704    /// Returns the value of the `CSV2` field.
19705    pub const fn csv2(self) -> u8 {
19706        ((self.bits() >> Self::CSV2_SHIFT) & 0b1111) as u8
19707    }
19708
19709    /// Sets the value of the `CSV2` field.
19710    pub const fn set_csv2(&mut self, value: u8) {
19711        let offset = Self::CSV2_SHIFT;
19712        assert!(value & (Self::CSV2_MASK as u8) == value);
19713        *self = Self::from_bits_retain(
19714            (self.bits() & !(Self::CSV2_MASK << offset)) | ((value as u32) << offset),
19715        );
19716    }
19717
19718    /// Returns a copy with the `CSV2` field set to the given value.
19719    pub const fn with_csv2(mut self, value: u8) -> Self {
19720        self.set_csv2(value);
19721        self
19722    }
19723
19724    /// Returns the value of the `AMU` field.
19725    pub const fn amu(self) -> u8 {
19726        ((self.bits() >> Self::AMU_SHIFT) & 0b1111) as u8
19727    }
19728
19729    /// Sets the value of the `AMU` field.
19730    pub const fn set_amu(&mut self, value: u8) {
19731        let offset = Self::AMU_SHIFT;
19732        assert!(value & (Self::AMU_MASK as u8) == value);
19733        *self = Self::from_bits_retain(
19734            (self.bits() & !(Self::AMU_MASK << offset)) | ((value as u32) << offset),
19735        );
19736    }
19737
19738    /// Returns a copy with the `AMU` field set to the given value.
19739    pub const fn with_amu(mut self, value: u8) -> Self {
19740        self.set_amu(value);
19741        self
19742    }
19743
19744    /// Returns the value of the `DIT` field.
19745    pub const fn dit(self) -> u8 {
19746        ((self.bits() >> Self::DIT_SHIFT) & 0b1111) as u8
19747    }
19748
19749    /// Sets the value of the `DIT` field.
19750    pub const fn set_dit(&mut self, value: u8) {
19751        let offset = Self::DIT_SHIFT;
19752        assert!(value & (Self::DIT_MASK as u8) == value);
19753        *self = Self::from_bits_retain(
19754            (self.bits() & !(Self::DIT_MASK << offset)) | ((value as u32) << offset),
19755        );
19756    }
19757
19758    /// Returns a copy with the `DIT` field set to the given value.
19759    pub const fn with_dit(mut self, value: u8) -> Self {
19760        self.set_dit(value);
19761        self
19762    }
19763
19764    /// Returns the value of the `RAS` field.
19765    pub const fn ras(self) -> u8 {
19766        ((self.bits() >> Self::RAS_SHIFT) & 0b1111) as u8
19767    }
19768
19769    /// Sets the value of the `RAS` field.
19770    pub const fn set_ras(&mut self, value: u8) {
19771        let offset = Self::RAS_SHIFT;
19772        assert!(value & (Self::RAS_MASK as u8) == value);
19773        *self = Self::from_bits_retain(
19774            (self.bits() & !(Self::RAS_MASK << offset)) | ((value as u32) << offset),
19775        );
19776    }
19777
19778    /// Returns a copy with the `RAS` field set to the given value.
19779    pub const fn with_ras(mut self, value: u8) -> Self {
19780        self.set_ras(value);
19781        self
19782    }
19783}
19784
19785bitflags! {
19786    /// `ID_PFR1` system register value.
19787    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19788    #[repr(transparent)]
19789    pub struct IdPfr1: u32 {
19790    }
19791}
19792
19793impl IdPfr1 {
19794    /// Offset of the `ProgMod` field.
19795    pub const PROGMOD_SHIFT: u32 = 0;
19796    /// Mask for the `ProgMod` field.
19797    pub const PROGMOD_MASK: u32 = 0b1111;
19798    /// Offset of the `Security` field.
19799    pub const SECURITY_SHIFT: u32 = 4;
19800    /// Mask for the `Security` field.
19801    pub const SECURITY_MASK: u32 = 0b1111;
19802    /// Offset of the `MProgMod` field.
19803    pub const MPROGMOD_SHIFT: u32 = 8;
19804    /// Mask for the `MProgMod` field.
19805    pub const MPROGMOD_MASK: u32 = 0b1111;
19806    /// Offset of the `Virtualization` field.
19807    pub const VIRTUALIZATION_SHIFT: u32 = 12;
19808    /// Mask for the `Virtualization` field.
19809    pub const VIRTUALIZATION_MASK: u32 = 0b1111;
19810    /// Offset of the `GenTimer` field.
19811    pub const GENTIMER_SHIFT: u32 = 16;
19812    /// Mask for the `GenTimer` field.
19813    pub const GENTIMER_MASK: u32 = 0b1111;
19814    /// Offset of the `Sec_frac` field.
19815    pub const SEC_FRAC_SHIFT: u32 = 20;
19816    /// Mask for the `Sec_frac` field.
19817    pub const SEC_FRAC_MASK: u32 = 0b1111;
19818    /// Offset of the `Virt_frac` field.
19819    pub const VIRT_FRAC_SHIFT: u32 = 24;
19820    /// Mask for the `Virt_frac` field.
19821    pub const VIRT_FRAC_MASK: u32 = 0b1111;
19822    /// Offset of the `GIC` field.
19823    pub const GIC_SHIFT: u32 = 28;
19824    /// Mask for the `GIC` field.
19825    pub const GIC_MASK: u32 = 0b1111;
19826
19827    /// Returns the value of the `ProgMod` field.
19828    pub const fn progmod(self) -> u8 {
19829        ((self.bits() >> Self::PROGMOD_SHIFT) & 0b1111) as u8
19830    }
19831
19832    /// Sets the value of the `ProgMod` field.
19833    pub const fn set_progmod(&mut self, value: u8) {
19834        let offset = Self::PROGMOD_SHIFT;
19835        assert!(value & (Self::PROGMOD_MASK as u8) == value);
19836        *self = Self::from_bits_retain(
19837            (self.bits() & !(Self::PROGMOD_MASK << offset)) | ((value as u32) << offset),
19838        );
19839    }
19840
19841    /// Returns a copy with the `ProgMod` field set to the given value.
19842    pub const fn with_progmod(mut self, value: u8) -> Self {
19843        self.set_progmod(value);
19844        self
19845    }
19846
19847    /// Returns the value of the `Security` field.
19848    pub const fn security(self) -> u8 {
19849        ((self.bits() >> Self::SECURITY_SHIFT) & 0b1111) as u8
19850    }
19851
19852    /// Sets the value of the `Security` field.
19853    pub const fn set_security(&mut self, value: u8) {
19854        let offset = Self::SECURITY_SHIFT;
19855        assert!(value & (Self::SECURITY_MASK as u8) == value);
19856        *self = Self::from_bits_retain(
19857            (self.bits() & !(Self::SECURITY_MASK << offset)) | ((value as u32) << offset),
19858        );
19859    }
19860
19861    /// Returns a copy with the `Security` field set to the given value.
19862    pub const fn with_security(mut self, value: u8) -> Self {
19863        self.set_security(value);
19864        self
19865    }
19866
19867    /// Returns the value of the `MProgMod` field.
19868    pub const fn mprogmod(self) -> u8 {
19869        ((self.bits() >> Self::MPROGMOD_SHIFT) & 0b1111) as u8
19870    }
19871
19872    /// Sets the value of the `MProgMod` field.
19873    pub const fn set_mprogmod(&mut self, value: u8) {
19874        let offset = Self::MPROGMOD_SHIFT;
19875        assert!(value & (Self::MPROGMOD_MASK as u8) == value);
19876        *self = Self::from_bits_retain(
19877            (self.bits() & !(Self::MPROGMOD_MASK << offset)) | ((value as u32) << offset),
19878        );
19879    }
19880
19881    /// Returns a copy with the `MProgMod` field set to the given value.
19882    pub const fn with_mprogmod(mut self, value: u8) -> Self {
19883        self.set_mprogmod(value);
19884        self
19885    }
19886
19887    /// Returns the value of the `Virtualization` field.
19888    pub const fn virtualization(self) -> u8 {
19889        ((self.bits() >> Self::VIRTUALIZATION_SHIFT) & 0b1111) as u8
19890    }
19891
19892    /// Sets the value of the `Virtualization` field.
19893    pub const fn set_virtualization(&mut self, value: u8) {
19894        let offset = Self::VIRTUALIZATION_SHIFT;
19895        assert!(value & (Self::VIRTUALIZATION_MASK as u8) == value);
19896        *self = Self::from_bits_retain(
19897            (self.bits() & !(Self::VIRTUALIZATION_MASK << offset)) | ((value as u32) << offset),
19898        );
19899    }
19900
19901    /// Returns a copy with the `Virtualization` field set to the given value.
19902    pub const fn with_virtualization(mut self, value: u8) -> Self {
19903        self.set_virtualization(value);
19904        self
19905    }
19906
19907    /// Returns the value of the `GenTimer` field.
19908    pub const fn gentimer(self) -> u8 {
19909        ((self.bits() >> Self::GENTIMER_SHIFT) & 0b1111) as u8
19910    }
19911
19912    /// Sets the value of the `GenTimer` field.
19913    pub const fn set_gentimer(&mut self, value: u8) {
19914        let offset = Self::GENTIMER_SHIFT;
19915        assert!(value & (Self::GENTIMER_MASK as u8) == value);
19916        *self = Self::from_bits_retain(
19917            (self.bits() & !(Self::GENTIMER_MASK << offset)) | ((value as u32) << offset),
19918        );
19919    }
19920
19921    /// Returns a copy with the `GenTimer` field set to the given value.
19922    pub const fn with_gentimer(mut self, value: u8) -> Self {
19923        self.set_gentimer(value);
19924        self
19925    }
19926
19927    /// Returns the value of the `Sec_frac` field.
19928    pub const fn sec_frac(self) -> u8 {
19929        ((self.bits() >> Self::SEC_FRAC_SHIFT) & 0b1111) as u8
19930    }
19931
19932    /// Sets the value of the `Sec_frac` field.
19933    pub const fn set_sec_frac(&mut self, value: u8) {
19934        let offset = Self::SEC_FRAC_SHIFT;
19935        assert!(value & (Self::SEC_FRAC_MASK as u8) == value);
19936        *self = Self::from_bits_retain(
19937            (self.bits() & !(Self::SEC_FRAC_MASK << offset)) | ((value as u32) << offset),
19938        );
19939    }
19940
19941    /// Returns a copy with the `Sec_frac` field set to the given value.
19942    pub const fn with_sec_frac(mut self, value: u8) -> Self {
19943        self.set_sec_frac(value);
19944        self
19945    }
19946
19947    /// Returns the value of the `Virt_frac` field.
19948    pub const fn virt_frac(self) -> u8 {
19949        ((self.bits() >> Self::VIRT_FRAC_SHIFT) & 0b1111) as u8
19950    }
19951
19952    /// Sets the value of the `Virt_frac` field.
19953    pub const fn set_virt_frac(&mut self, value: u8) {
19954        let offset = Self::VIRT_FRAC_SHIFT;
19955        assert!(value & (Self::VIRT_FRAC_MASK as u8) == value);
19956        *self = Self::from_bits_retain(
19957            (self.bits() & !(Self::VIRT_FRAC_MASK << offset)) | ((value as u32) << offset),
19958        );
19959    }
19960
19961    /// Returns a copy with the `Virt_frac` field set to the given value.
19962    pub const fn with_virt_frac(mut self, value: u8) -> Self {
19963        self.set_virt_frac(value);
19964        self
19965    }
19966
19967    /// Returns the value of the `GIC` field.
19968    pub const fn gic(self) -> u8 {
19969        ((self.bits() >> Self::GIC_SHIFT) & 0b1111) as u8
19970    }
19971
19972    /// Sets the value of the `GIC` field.
19973    pub const fn set_gic(&mut self, value: u8) {
19974        let offset = Self::GIC_SHIFT;
19975        assert!(value & (Self::GIC_MASK as u8) == value);
19976        *self = Self::from_bits_retain(
19977            (self.bits() & !(Self::GIC_MASK << offset)) | ((value as u32) << offset),
19978        );
19979    }
19980
19981    /// Returns a copy with the `GIC` field set to the given value.
19982    pub const fn with_gic(mut self, value: u8) -> Self {
19983        self.set_gic(value);
19984        self
19985    }
19986}
19987
19988bitflags! {
19989    /// `ID_PFR2` system register value.
19990    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
19991    #[repr(transparent)]
19992    pub struct IdPfr2: u32 {
19993    }
19994}
19995
19996impl IdPfr2 {
19997    /// Offset of the `CSV3` field.
19998    pub const CSV3_SHIFT: u32 = 0;
19999    /// Mask for the `CSV3` field.
20000    pub const CSV3_MASK: u32 = 0b1111;
20001    /// Offset of the `SSBS` field.
20002    pub const SSBS_SHIFT: u32 = 4;
20003    /// Mask for the `SSBS` field.
20004    pub const SSBS_MASK: u32 = 0b1111;
20005    /// Offset of the `RAS_frac` field.
20006    pub const RAS_FRAC_SHIFT: u32 = 8;
20007    /// Mask for the `RAS_frac` field.
20008    pub const RAS_FRAC_MASK: u32 = 0b1111;
20009
20010    /// Returns the value of the `CSV3` field.
20011    pub const fn csv3(self) -> u8 {
20012        ((self.bits() >> Self::CSV3_SHIFT) & 0b1111) as u8
20013    }
20014
20015    /// Sets the value of the `CSV3` field.
20016    pub const fn set_csv3(&mut self, value: u8) {
20017        let offset = Self::CSV3_SHIFT;
20018        assert!(value & (Self::CSV3_MASK as u8) == value);
20019        *self = Self::from_bits_retain(
20020            (self.bits() & !(Self::CSV3_MASK << offset)) | ((value as u32) << offset),
20021        );
20022    }
20023
20024    /// Returns a copy with the `CSV3` field set to the given value.
20025    pub const fn with_csv3(mut self, value: u8) -> Self {
20026        self.set_csv3(value);
20027        self
20028    }
20029
20030    /// Returns the value of the `SSBS` field.
20031    pub const fn ssbs(self) -> u8 {
20032        ((self.bits() >> Self::SSBS_SHIFT) & 0b1111) as u8
20033    }
20034
20035    /// Sets the value of the `SSBS` field.
20036    pub const fn set_ssbs(&mut self, value: u8) {
20037        let offset = Self::SSBS_SHIFT;
20038        assert!(value & (Self::SSBS_MASK as u8) == value);
20039        *self = Self::from_bits_retain(
20040            (self.bits() & !(Self::SSBS_MASK << offset)) | ((value as u32) << offset),
20041        );
20042    }
20043
20044    /// Returns a copy with the `SSBS` field set to the given value.
20045    pub const fn with_ssbs(mut self, value: u8) -> Self {
20046        self.set_ssbs(value);
20047        self
20048    }
20049
20050    /// Returns the value of the `RAS_frac` field.
20051    pub const fn ras_frac(self) -> u8 {
20052        ((self.bits() >> Self::RAS_FRAC_SHIFT) & 0b1111) as u8
20053    }
20054
20055    /// Sets the value of the `RAS_frac` field.
20056    pub const fn set_ras_frac(&mut self, value: u8) {
20057        let offset = Self::RAS_FRAC_SHIFT;
20058        assert!(value & (Self::RAS_FRAC_MASK as u8) == value);
20059        *self = Self::from_bits_retain(
20060            (self.bits() & !(Self::RAS_FRAC_MASK << offset)) | ((value as u32) << offset),
20061        );
20062    }
20063
20064    /// Returns a copy with the `RAS_frac` field set to the given value.
20065    pub const fn with_ras_frac(mut self, value: u8) -> Self {
20066        self.set_ras_frac(value);
20067        self
20068    }
20069}
20070
20071bitflags! {
20072    /// `IFAR` system register value.
20073    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20074    #[repr(transparent)]
20075    pub struct Ifar: u32 {
20076    }
20077}
20078
20079impl Ifar {
20080    /// Offset of the `VA` field.
20081    pub const VA_SHIFT: u32 = 0;
20082    /// Mask for the `VA` field.
20083    pub const VA_MASK: u32 = 0b11111111111111111111111111111111;
20084
20085    /// Returns the value of the `VA` field.
20086    pub const fn va(self) -> u32 {
20087        ((self.bits() >> Self::VA_SHIFT) & 0b11111111111111111111111111111111) as u32
20088    }
20089
20090    /// Sets the value of the `VA` field.
20091    pub const fn set_va(&mut self, value: u32) {
20092        let offset = Self::VA_SHIFT;
20093        assert!(value & (Self::VA_MASK as u32) == value);
20094        *self = Self::from_bits_retain(
20095            (self.bits() & !(Self::VA_MASK << offset)) | ((value as u32) << offset),
20096        );
20097    }
20098
20099    /// Returns a copy with the `VA` field set to the given value.
20100    pub const fn with_va(mut self, value: u32) -> Self {
20101        self.set_va(value);
20102        self
20103    }
20104}
20105
20106bitflags! {
20107    /// `IFSR` system register value.
20108    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20109    #[repr(transparent)]
20110    pub struct Ifsr: u32 {
20111        /// `LPAE` bit.
20112        const LPAE = 1 << 9;
20113        /// `ExT` bit.
20114        const EXT = 1 << 12;
20115        /// `FnV` bit.
20116        const FNV = 1 << 16;
20117    }
20118}
20119
20120impl Ifsr {
20121    /// Offset of the `STATUS` field.
20122    pub const STATUS_SHIFT: u32 = 0;
20123    /// Mask for the `STATUS` field.
20124    pub const STATUS_MASK: u32 = 0b111111;
20125    /// Offset of the `LPAE` field.
20126    pub const LPAE_SHIFT: u32 = 9;
20127    /// Offset of the `ExT` field.
20128    pub const EXT_SHIFT: u32 = 12;
20129    /// Offset of the `FnV` field.
20130    pub const FNV_SHIFT: u32 = 16;
20131
20132    /// Returns the value of the `STATUS` field.
20133    pub const fn status(self) -> u8 {
20134        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
20135    }
20136
20137    /// Sets the value of the `STATUS` field.
20138    pub const fn set_status(&mut self, value: u8) {
20139        let offset = Self::STATUS_SHIFT;
20140        assert!(value & (Self::STATUS_MASK as u8) == value);
20141        *self = Self::from_bits_retain(
20142            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
20143        );
20144    }
20145
20146    /// Returns a copy with the `STATUS` field set to the given value.
20147    pub const fn with_status(mut self, value: u8) -> Self {
20148        self.set_status(value);
20149        self
20150    }
20151}
20152
20153bitflags! {
20154    /// `ISR` system register value.
20155    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20156    #[repr(transparent)]
20157    pub struct Isr: u32 {
20158        /// `F` bit.
20159        const F = 1 << 6;
20160        /// `I` bit.
20161        const I = 1 << 7;
20162        /// `A` bit.
20163        const A = 1 << 8;
20164    }
20165}
20166
20167impl Isr {
20168    /// Offset of the `F` field.
20169    pub const F_SHIFT: u32 = 6;
20170    /// Offset of the `I` field.
20171    pub const I_SHIFT: u32 = 7;
20172    /// Offset of the `A` field.
20173    pub const A_SHIFT: u32 = 8;
20174}
20175
20176#[cfg(feature = "el1")]
20177bitflags! {
20178    /// `ISR_EL1` system register value.
20179    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20180    #[repr(transparent)]
20181    pub struct IsrEl1: u64 {
20182        /// `F` bit.
20183        const F = 1 << 6;
20184        /// `I` bit.
20185        const I = 1 << 7;
20186        /// `A` bit.
20187        const A = 1 << 8;
20188        /// `FS` bit.
20189        const FS = 1 << 9;
20190        /// `IS` bit.
20191        const IS = 1 << 10;
20192    }
20193}
20194
20195#[cfg(feature = "el1")]
20196impl IsrEl1 {
20197    /// Offset of the `F` field.
20198    pub const F_SHIFT: u32 = 6;
20199    /// Offset of the `I` field.
20200    pub const I_SHIFT: u32 = 7;
20201    /// Offset of the `A` field.
20202    pub const A_SHIFT: u32 = 8;
20203    /// Offset of the `FS` field.
20204    pub const FS_SHIFT: u32 = 9;
20205    /// Offset of the `IS` field.
20206    pub const IS_SHIFT: u32 = 10;
20207}
20208
20209bitflags! {
20210    /// `MAIR0` system register value.
20211    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20212    #[repr(transparent)]
20213    pub struct Mair0: u32 {
20214    }
20215}
20216
20217impl Mair0 {
20218    /// Offset of the `Attr<n>` field.
20219    pub const ATTR_SHIFT: u32 = 0;
20220    /// Mask for the `Attr<n>` field.
20221    pub const ATTR_MASK: u32 = 0b11111111;
20222
20223    /// Returns the value of the given `Attr<n>` field.
20224    pub const fn attr(self, n: u32) -> u8 {
20225        assert!(n < 4);
20226        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
20227    }
20228
20229    /// Sets the value of the `Attr<n>` field.
20230    pub const fn set_attr(&mut self, n: u32, value: u8) {
20231        assert!(n < 4);
20232        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
20233        assert!(value & (Self::ATTR_MASK as u8) == value);
20234        *self = Self::from_bits_retain(
20235            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
20236        );
20237    }
20238
20239    /// Returns a copy with the `Attr<n>` field set to the given value.
20240    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
20241        self.set_attr(n, value);
20242        self
20243    }
20244}
20245
20246bitflags! {
20247    /// `MAIR1` system register value.
20248    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20249    #[repr(transparent)]
20250    pub struct Mair1: u32 {
20251    }
20252}
20253
20254impl Mair1 {
20255    /// Offset of the `Attr<n>` field.
20256    pub const ATTR_SHIFT: u32 = 0;
20257    /// Mask for the `Attr<n>` field.
20258    pub const ATTR_MASK: u32 = 0b11111111;
20259
20260    /// Returns the value of the given `Attr<n>` field.
20261    pub const fn attr(self, n: u32) -> u8 {
20262        assert!(n >= 4 && n < 8);
20263        ((self.bits() >> (Self::ATTR_SHIFT + (n - 4) * 8)) & 0b11111111) as u8
20264    }
20265
20266    /// Sets the value of the `Attr<n>` field.
20267    pub const fn set_attr(&mut self, n: u32, value: u8) {
20268        assert!(n >= 4 && n < 8);
20269        let offset = Self::ATTR_SHIFT + (n - 4) * 8;
20270        assert!(value & (Self::ATTR_MASK as u8) == value);
20271        *self = Self::from_bits_retain(
20272            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u32) << offset),
20273        );
20274    }
20275
20276    /// Returns a copy with the `Attr<n>` field set to the given value.
20277    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
20278        self.set_attr(n, value);
20279        self
20280    }
20281}
20282
20283#[cfg(feature = "el1")]
20284bitflags! {
20285    /// `MAIR_EL1` system register value.
20286    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20287    #[repr(transparent)]
20288    pub struct MairEl1: u64 {
20289    }
20290}
20291
20292#[cfg(feature = "el1")]
20293impl MairEl1 {
20294    /// Offset of the `Attr<n>` field.
20295    pub const ATTR_SHIFT: u32 = 0;
20296    /// Mask for the `Attr<n>` field.
20297    pub const ATTR_MASK: u64 = 0b11111111;
20298
20299    /// Returns the value of the given `Attr<n>` field.
20300    pub const fn attr(self, n: u32) -> u8 {
20301        assert!(n < 8);
20302        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
20303    }
20304
20305    /// Sets the value of the `Attr<n>` field.
20306    pub const fn set_attr(&mut self, n: u32, value: u8) {
20307        assert!(n < 8);
20308        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
20309        assert!(value & (Self::ATTR_MASK as u8) == value);
20310        *self = Self::from_bits_retain(
20311            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
20312        );
20313    }
20314
20315    /// Returns a copy with the `Attr<n>` field set to the given value.
20316    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
20317        self.set_attr(n, value);
20318        self
20319    }
20320}
20321
20322#[cfg(feature = "el2")]
20323bitflags! {
20324    /// `MAIR_EL2` system register value.
20325    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20326    #[repr(transparent)]
20327    pub struct MairEl2: u64 {
20328    }
20329}
20330
20331#[cfg(feature = "el2")]
20332impl MairEl2 {
20333    /// Offset of the `Attr<n>` field.
20334    pub const ATTR_SHIFT: u32 = 0;
20335    /// Mask for the `Attr<n>` field.
20336    pub const ATTR_MASK: u64 = 0b11111111;
20337
20338    /// Returns the value of the given `Attr<n>` field.
20339    pub const fn attr(self, n: u32) -> u8 {
20340        assert!(n < 8);
20341        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
20342    }
20343
20344    /// Sets the value of the `Attr<n>` field.
20345    pub const fn set_attr(&mut self, n: u32, value: u8) {
20346        assert!(n < 8);
20347        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
20348        assert!(value & (Self::ATTR_MASK as u8) == value);
20349        *self = Self::from_bits_retain(
20350            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
20351        );
20352    }
20353
20354    /// Returns a copy with the `Attr<n>` field set to the given value.
20355    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
20356        self.set_attr(n, value);
20357        self
20358    }
20359}
20360
20361#[cfg(feature = "el3")]
20362bitflags! {
20363    /// `MAIR_EL3` system register value.
20364    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20365    #[repr(transparent)]
20366    pub struct MairEl3: u64 {
20367    }
20368}
20369
20370#[cfg(feature = "el3")]
20371impl MairEl3 {
20372    /// Offset of the `Attr<n>` field.
20373    pub const ATTR_SHIFT: u32 = 0;
20374    /// Mask for the `Attr<n>` field.
20375    pub const ATTR_MASK: u64 = 0b11111111;
20376
20377    /// Returns the value of the given `Attr<n>` field.
20378    pub const fn attr(self, n: u32) -> u8 {
20379        assert!(n < 8);
20380        ((self.bits() >> (Self::ATTR_SHIFT + (n - 0) * 8)) & 0b11111111) as u8
20381    }
20382
20383    /// Sets the value of the `Attr<n>` field.
20384    pub const fn set_attr(&mut self, n: u32, value: u8) {
20385        assert!(n < 8);
20386        let offset = Self::ATTR_SHIFT + (n - 0) * 8;
20387        assert!(value & (Self::ATTR_MASK as u8) == value);
20388        *self = Self::from_bits_retain(
20389            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
20390        );
20391    }
20392
20393    /// Returns a copy with the `Attr<n>` field set to the given value.
20394    pub const fn with_attr(mut self, n: u32, value: u8) -> Self {
20395        self.set_attr(n, value);
20396        self
20397    }
20398}
20399
20400#[cfg(feature = "el1")]
20401bitflags! {
20402    /// `MDCCINT_EL1` system register value.
20403    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20404    #[repr(transparent)]
20405    pub struct MdccintEl1: u64 {
20406        /// `TX` bit.
20407        const TX = 1 << 29;
20408        /// `RX` bit.
20409        const RX = 1 << 30;
20410    }
20411}
20412
20413#[cfg(feature = "el1")]
20414impl MdccintEl1 {
20415    /// Offset of the `TX` field.
20416    pub const TX_SHIFT: u32 = 29;
20417    /// Offset of the `RX` field.
20418    pub const RX_SHIFT: u32 = 30;
20419}
20420
20421#[cfg(feature = "el2")]
20422bitflags! {
20423    /// `MDCR_EL2` system register value.
20424    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20425    #[repr(transparent)]
20426    pub struct MdcrEl2: u64 {
20427        /// `TPMCR` bit.
20428        const TPMCR = 1 << 5;
20429        /// `TPM` bit.
20430        const TPM = 1 << 6;
20431        /// `HPME` bit.
20432        const HPME = 1 << 7;
20433        /// `TDE` bit.
20434        const TDE = 1 << 8;
20435        /// `TDA` bit.
20436        const TDA = 1 << 9;
20437        /// `TDOSA` bit.
20438        const TDOSA = 1 << 10;
20439        /// `TDRA` bit.
20440        const TDRA = 1 << 11;
20441        /// `TPMS` bit.
20442        const TPMS = 1 << 14;
20443        /// `EnSPM` bit.
20444        const ENSPM = 1 << 15;
20445        /// `HPMD` bit.
20446        const HPMD = 1 << 17;
20447        /// `TTRF` bit.
20448        const TTRF = 1 << 19;
20449        /// `HCCD` bit.
20450        const HCCD = 1 << 23;
20451        /// `HLP` bit.
20452        const HLP = 1 << 26;
20453        /// `TDCC` bit.
20454        const TDCC = 1 << 27;
20455        /// `MTPME` bit.
20456        const MTPME = 1 << 28;
20457        /// `HPMFZO` bit.
20458        const HPMFZO = 1 << 29;
20459        /// `HPMFZS` bit.
20460        const HPMFZS = 1 << 36;
20461        /// `EBWE` bit.
20462        const EBWE = 1 << 43;
20463        /// `EnSTEPOP` bit.
20464        const ENSTEPOP = 1 << 50;
20465    }
20466}
20467
20468#[cfg(feature = "el2")]
20469impl MdcrEl2 {
20470    /// Offset of the `HPMN` field.
20471    pub const HPMN_SHIFT: u32 = 0;
20472    /// Mask for the `HPMN` field.
20473    pub const HPMN_MASK: u64 = 0b11111;
20474    /// Offset of the `TPMCR` field.
20475    pub const TPMCR_SHIFT: u32 = 5;
20476    /// Offset of the `TPM` field.
20477    pub const TPM_SHIFT: u32 = 6;
20478    /// Offset of the `HPME` field.
20479    pub const HPME_SHIFT: u32 = 7;
20480    /// Offset of the `TDE` field.
20481    pub const TDE_SHIFT: u32 = 8;
20482    /// Offset of the `TDA` field.
20483    pub const TDA_SHIFT: u32 = 9;
20484    /// Offset of the `TDOSA` field.
20485    pub const TDOSA_SHIFT: u32 = 10;
20486    /// Offset of the `TDRA` field.
20487    pub const TDRA_SHIFT: u32 = 11;
20488    /// Offset of the `E2PB` field.
20489    pub const E2PB_SHIFT: u32 = 12;
20490    /// Mask for the `E2PB` field.
20491    pub const E2PB_MASK: u64 = 0b11;
20492    /// Offset of the `TPMS` field.
20493    pub const TPMS_SHIFT: u32 = 14;
20494    /// Offset of the `EnSPM` field.
20495    pub const ENSPM_SHIFT: u32 = 15;
20496    /// Offset of the `HPMD` field.
20497    pub const HPMD_SHIFT: u32 = 17;
20498    /// Offset of the `TTRF` field.
20499    pub const TTRF_SHIFT: u32 = 19;
20500    /// Offset of the `HCCD` field.
20501    pub const HCCD_SHIFT: u32 = 23;
20502    /// Offset of the `E2TB` field.
20503    pub const E2TB_SHIFT: u32 = 24;
20504    /// Mask for the `E2TB` field.
20505    pub const E2TB_MASK: u64 = 0b11;
20506    /// Offset of the `HLP` field.
20507    pub const HLP_SHIFT: u32 = 26;
20508    /// Offset of the `TDCC` field.
20509    pub const TDCC_SHIFT: u32 = 27;
20510    /// Offset of the `MTPME` field.
20511    pub const MTPME_SHIFT: u32 = 28;
20512    /// Offset of the `HPMFZO` field.
20513    pub const HPMFZO_SHIFT: u32 = 29;
20514    /// Offset of the `PMSSE` field.
20515    pub const PMSSE_SHIFT: u32 = 30;
20516    /// Mask for the `PMSSE` field.
20517    pub const PMSSE_MASK: u64 = 0b11;
20518    /// Offset of the `HPMFZS` field.
20519    pub const HPMFZS_SHIFT: u32 = 36;
20520    /// Offset of the `PMEE` field.
20521    pub const PMEE_SHIFT: u32 = 40;
20522    /// Mask for the `PMEE` field.
20523    pub const PMEE_MASK: u64 = 0b11;
20524    /// Offset of the `EBWE` field.
20525    pub const EBWE_SHIFT: u32 = 43;
20526    /// Offset of the `EnSTEPOP` field.
20527    pub const ENSTEPOP_SHIFT: u32 = 50;
20528
20529    /// Returns the value of the `HPMN` field.
20530    pub const fn hpmn(self) -> u8 {
20531        ((self.bits() >> Self::HPMN_SHIFT) & 0b11111) as u8
20532    }
20533
20534    /// Sets the value of the `HPMN` field.
20535    pub const fn set_hpmn(&mut self, value: u8) {
20536        let offset = Self::HPMN_SHIFT;
20537        assert!(value & (Self::HPMN_MASK as u8) == value);
20538        *self = Self::from_bits_retain(
20539            (self.bits() & !(Self::HPMN_MASK << offset)) | ((value as u64) << offset),
20540        );
20541    }
20542
20543    /// Returns a copy with the `HPMN` field set to the given value.
20544    pub const fn with_hpmn(mut self, value: u8) -> Self {
20545        self.set_hpmn(value);
20546        self
20547    }
20548
20549    /// Returns the value of the `E2PB` field.
20550    pub const fn e2pb(self) -> u8 {
20551        ((self.bits() >> Self::E2PB_SHIFT) & 0b11) as u8
20552    }
20553
20554    /// Sets the value of the `E2PB` field.
20555    pub const fn set_e2pb(&mut self, value: u8) {
20556        let offset = Self::E2PB_SHIFT;
20557        assert!(value & (Self::E2PB_MASK as u8) == value);
20558        *self = Self::from_bits_retain(
20559            (self.bits() & !(Self::E2PB_MASK << offset)) | ((value as u64) << offset),
20560        );
20561    }
20562
20563    /// Returns a copy with the `E2PB` field set to the given value.
20564    pub const fn with_e2pb(mut self, value: u8) -> Self {
20565        self.set_e2pb(value);
20566        self
20567    }
20568
20569    /// Returns the value of the `E2TB` field.
20570    pub const fn e2tb(self) -> u8 {
20571        ((self.bits() >> Self::E2TB_SHIFT) & 0b11) as u8
20572    }
20573
20574    /// Sets the value of the `E2TB` field.
20575    pub const fn set_e2tb(&mut self, value: u8) {
20576        let offset = Self::E2TB_SHIFT;
20577        assert!(value & (Self::E2TB_MASK as u8) == value);
20578        *self = Self::from_bits_retain(
20579            (self.bits() & !(Self::E2TB_MASK << offset)) | ((value as u64) << offset),
20580        );
20581    }
20582
20583    /// Returns a copy with the `E2TB` field set to the given value.
20584    pub const fn with_e2tb(mut self, value: u8) -> Self {
20585        self.set_e2tb(value);
20586        self
20587    }
20588
20589    /// Returns the value of the `PMSSE` field.
20590    pub const fn pmsse(self) -> u8 {
20591        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
20592    }
20593
20594    /// Sets the value of the `PMSSE` field.
20595    pub const fn set_pmsse(&mut self, value: u8) {
20596        let offset = Self::PMSSE_SHIFT;
20597        assert!(value & (Self::PMSSE_MASK as u8) == value);
20598        *self = Self::from_bits_retain(
20599            (self.bits() & !(Self::PMSSE_MASK << offset)) | ((value as u64) << offset),
20600        );
20601    }
20602
20603    /// Returns a copy with the `PMSSE` field set to the given value.
20604    pub const fn with_pmsse(mut self, value: u8) -> Self {
20605        self.set_pmsse(value);
20606        self
20607    }
20608
20609    /// Returns the value of the `PMEE` field.
20610    pub const fn pmee(self) -> u8 {
20611        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
20612    }
20613
20614    /// Sets the value of the `PMEE` field.
20615    pub const fn set_pmee(&mut self, value: u8) {
20616        let offset = Self::PMEE_SHIFT;
20617        assert!(value & (Self::PMEE_MASK as u8) == value);
20618        *self = Self::from_bits_retain(
20619            (self.bits() & !(Self::PMEE_MASK << offset)) | ((value as u64) << offset),
20620        );
20621    }
20622
20623    /// Returns a copy with the `PMEE` field set to the given value.
20624    pub const fn with_pmee(mut self, value: u8) -> Self {
20625        self.set_pmee(value);
20626        self
20627    }
20628}
20629
20630#[cfg(feature = "el3")]
20631bitflags! {
20632    /// `MDCR_EL3` system register value.
20633    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
20634    #[repr(transparent)]
20635    pub struct MdcrEl3: u64 {
20636        /// Realm Trace enable. Enables tracing in Realm state.
20637        const RLTE = 1 << 0;
20638        /// `EPMADE` bit.
20639        const EPMADE = 1 << 2;
20640        /// `ETADE` bit.
20641        const ETADE = 1 << 3;
20642        /// `EDADE` bit.
20643        const EDADE = 1 << 4;
20644        /// Trap Performance Monitor register accesses
20645        const TPM = 1 << 6;
20646        /// Do not trap various PMUv3p9 related system register accesses to EL3.
20647        const ENPM2 = 1 << 7;
20648        /// `TDA` bit.
20649        const TDA = 1 << 9;
20650        /// `TDOSA` bit.
20651        const TDOSA = 1 << 10;
20652        /// 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.
20653        const NSPBE = 1 << 11;
20654        /// 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.
20655        const SDD = 1 << 16;
20656        /// Secure Performance Monitors Enable. Controls event counting in Secure state and EL3.
20657        const SPME = 1 << 17;
20658        /// Secure Trace enable. Enables tracing in Secure state.
20659        const STE = 1 << 18;
20660        /// Trap Trace Filter controls. Traps use of the Trace Filter control registers at EL2 and EL1 to EL3.
20661        const TTRF = 1 << 19;
20662        /// `EDAD` bit.
20663        const EDAD = 1 << 20;
20664        /// `EPMAD` bit.
20665        const EPMAD = 1 << 21;
20666        /// `ETAD` bit.
20667        const ETAD = 1 << 22;
20668        /// Secure Cycle Counter Disable. Prohibits PMCCNTR_EL0 from counting in Secure state.
20669        const SCCD = 1 << 23;
20670        /// 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.
20671        const NSTBE = 1 << 26;
20672        /// `TDCC` bit.
20673        const TDCC = 1 << 27;
20674        /// Multi-threaded PMU Enable. Enables use of the PMEVTYPER<n>_EL0.MT bits.
20675        const MTPME = 1 << 28;
20676        /// Monitor Cycle Counter Disable. Prohibits the Cycle Counter, PMCCNTR_EL0, from counting at EL3.
20677        const MCCD = 1 << 34;
20678        /// 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.
20679        const MPMX = 1 << 35;
20680        /// Trap accesses to PMSNEVFR_EL1. Controls access to Statistical Profiling PMSNEVFR_EL1 System register from EL2 and EL1.
20681        const ENPMSN = 1 << 36;
20682        /// `E3BREW` bit.
20683        const E3BREW = 1 << 37;
20684        /// `E3BREC` bit.
20685        const E3BREC = 1 << 38;
20686        /// `EnTB2` bit.
20687        const ENTB2 = 1 << 39;
20688        /// Enable access to SPE registers. When disabled, accesses to SPE registers generate a trap to EL3.
20689        const ENPMS3 = 1 << 42;
20690        /// `EBWE` bit.
20691        const EBWE = 1 << 43;
20692        /// `EnPMSS` bit.
20693        const ENPMSS = 1 << 44;
20694        /// `EnITE` bit.
20695        const ENITE = 1 << 47;
20696        /// `EnSTEPOP` bit.
20697        const ENSTEPOP = 1 << 50;
20698        /// `EnPMS4` bit.
20699        const ENPMS4 = 1 << 55;
20700    }
20701}
20702
20703#[cfg(feature = "el3")]
20704impl MdcrEl3 {
20705    /// Offset of the `RLTE` field.
20706    pub const RLTE_SHIFT: u32 = 0;
20707    /// Offset of the `EPMADE` field.
20708    pub const EPMADE_SHIFT: u32 = 2;
20709    /// Offset of the `ETADE` field.
20710    pub const ETADE_SHIFT: u32 = 3;
20711    /// Offset of the `EDADE` field.
20712    pub const EDADE_SHIFT: u32 = 4;
20713    /// Offset of the `TPM` field.
20714    pub const TPM_SHIFT: u32 = 6;
20715    /// Offset of the `EnPM2` field.
20716    pub const ENPM2_SHIFT: u32 = 7;
20717    /// Offset of the `TDA` field.
20718    pub const TDA_SHIFT: u32 = 9;
20719    /// Offset of the `TDOSA` field.
20720    pub const TDOSA_SHIFT: u32 = 10;
20721    /// Offset of the `NSPBE` field.
20722    pub const NSPBE_SHIFT: u32 = 11;
20723    /// Offset of the `NSPB` field.
20724    pub const NSPB_SHIFT: u32 = 12;
20725    /// Mask for the `NSPB` field.
20726    pub const NSPB_MASK: u64 = 0b11;
20727    /// Offset of the `SPD32` field.
20728    pub const SPD32_SHIFT: u32 = 14;
20729    /// Mask for the `SPD32` field.
20730    pub const SPD32_MASK: u64 = 0b11;
20731    /// Offset of the `SDD` field.
20732    pub const SDD_SHIFT: u32 = 16;
20733    /// Offset of the `SPME` field.
20734    pub const SPME_SHIFT: u32 = 17;
20735    /// Offset of the `STE` field.
20736    pub const STE_SHIFT: u32 = 18;
20737    /// Offset of the `TTRF` field.
20738    pub const TTRF_SHIFT: u32 = 19;
20739    /// Offset of the `EDAD` field.
20740    pub const EDAD_SHIFT: u32 = 20;
20741    /// Offset of the `EPMAD` field.
20742    pub const EPMAD_SHIFT: u32 = 21;
20743    /// Offset of the `ETAD` field.
20744    pub const ETAD_SHIFT: u32 = 22;
20745    /// Offset of the `SCCD` field.
20746    pub const SCCD_SHIFT: u32 = 23;
20747    /// Offset of the `NSTB` field.
20748    pub const NSTB_SHIFT: u32 = 24;
20749    /// Mask for the `NSTB` field.
20750    pub const NSTB_MASK: u64 = 0b11;
20751    /// Offset of the `NSTBE` field.
20752    pub const NSTBE_SHIFT: u32 = 26;
20753    /// Offset of the `TDCC` field.
20754    pub const TDCC_SHIFT: u32 = 27;
20755    /// Offset of the `MTPME` field.
20756    pub const MTPME_SHIFT: u32 = 28;
20757    /// Offset of the `PMSSE` field.
20758    pub const PMSSE_SHIFT: u32 = 30;
20759    /// Mask for the `PMSSE` field.
20760    pub const PMSSE_MASK: u64 = 0b11;
20761    /// Offset of the `SBRBE` field.
20762    pub const SBRBE_SHIFT: u32 = 32;
20763    /// Mask for the `SBRBE` field.
20764    pub const SBRBE_MASK: u64 = 0b11;
20765    /// Offset of the `MCCD` field.
20766    pub const MCCD_SHIFT: u32 = 34;
20767    /// Offset of the `MPMX` field.
20768    pub const MPMX_SHIFT: u32 = 35;
20769    /// Offset of the `EnPMSN` field.
20770    pub const ENPMSN_SHIFT: u32 = 36;
20771    /// Offset of the `E3BREW` field.
20772    pub const E3BREW_SHIFT: u32 = 37;
20773    /// Offset of the `E3BREC` field.
20774    pub const E3BREC_SHIFT: u32 = 38;
20775    /// Offset of the `EnTB2` field.
20776    pub const ENTB2_SHIFT: u32 = 39;
20777    /// Offset of the `PMEE` field.
20778    pub const PMEE_SHIFT: u32 = 40;
20779    /// Mask for the `PMEE` field.
20780    pub const PMEE_MASK: u64 = 0b11;
20781    /// Offset of the `EnPMS3` field.
20782    pub const ENPMS3_SHIFT: u32 = 42;
20783    /// Offset of the `EBWE` field.
20784    pub const EBWE_SHIFT: u32 = 43;
20785    /// Offset of the `EnPMSS` field.
20786    pub const ENPMSS_SHIFT: u32 = 44;
20787    /// Offset of the `EPMSSAD` field.
20788    pub const EPMSSAD_SHIFT: u32 = 45;
20789    /// Mask for the `EPMSSAD` field.
20790    pub const EPMSSAD_MASK: u64 = 0b11;
20791    /// Offset of the `EnITE` field.
20792    pub const ENITE_SHIFT: u32 = 47;
20793    /// Offset of the `ETBAD` field.
20794    pub const ETBAD_SHIFT: u32 = 48;
20795    /// Mask for the `ETBAD` field.
20796    pub const ETBAD_MASK: u64 = 0b11;
20797    /// Offset of the `EnSTEPOP` field.
20798    pub const ENSTEPOP_SHIFT: u32 = 50;
20799    /// Offset of the `PMSEE` field.
20800    pub const PMSEE_SHIFT: u32 = 51;
20801    /// Mask for the `PMSEE` field.
20802    pub const PMSEE_MASK: u64 = 0b11;
20803    /// Offset of the `TRBEE` field.
20804    pub const TRBEE_SHIFT: u32 = 53;
20805    /// Mask for the `TRBEE` field.
20806    pub const TRBEE_MASK: u64 = 0b11;
20807    /// Offset of the `EnPMS4` field.
20808    pub const ENPMS4_SHIFT: u32 = 55;
20809
20810    /// Returns the value of the `NSPB` field.
20811    pub const fn nspb(self) -> u8 {
20812        ((self.bits() >> Self::NSPB_SHIFT) & 0b11) as u8
20813    }
20814
20815    /// Sets the value of the `NSPB` field.
20816    pub const fn set_nspb(&mut self, value: u8) {
20817        let offset = Self::NSPB_SHIFT;
20818        assert!(value & (Self::NSPB_MASK as u8) == value);
20819        *self = Self::from_bits_retain(
20820            (self.bits() & !(Self::NSPB_MASK << offset)) | ((value as u64) << offset),
20821        );
20822    }
20823
20824    /// Returns a copy with the `NSPB` field set to the given value.
20825    pub const fn with_nspb(mut self, value: u8) -> Self {
20826        self.set_nspb(value);
20827        self
20828    }
20829
20830    /// Returns the value of the `SPD32` field.
20831    pub const fn spd32(self) -> u8 {
20832        ((self.bits() >> Self::SPD32_SHIFT) & 0b11) as u8
20833    }
20834
20835    /// Sets the value of the `SPD32` field.
20836    pub const fn set_spd32(&mut self, value: u8) {
20837        let offset = Self::SPD32_SHIFT;
20838        assert!(value & (Self::SPD32_MASK as u8) == value);
20839        *self = Self::from_bits_retain(
20840            (self.bits() & !(Self::SPD32_MASK << offset)) | ((value as u64) << offset),
20841        );
20842    }
20843
20844    /// Returns a copy with the `SPD32` field set to the given value.
20845    pub const fn with_spd32(mut self, value: u8) -> Self {
20846        self.set_spd32(value);
20847        self
20848    }
20849
20850    /// Returns the value of the `NSTB` field.
20851    pub const fn nstb(self) -> u8 {
20852        ((self.bits() >> Self::NSTB_SHIFT) & 0b11) as u8
20853    }
20854
20855    /// Sets the value of the `NSTB` field.
20856    pub const fn set_nstb(&mut self, value: u8) {
20857        let offset = Self::NSTB_SHIFT;
20858        assert!(value & (Self::NSTB_MASK as u8) == value);
20859        *self = Self::from_bits_retain(
20860            (self.bits() & !(Self::NSTB_MASK << offset)) | ((value as u64) << offset),
20861        );
20862    }
20863
20864    /// Returns a copy with the `NSTB` field set to the given value.
20865    pub const fn with_nstb(mut self, value: u8) -> Self {
20866        self.set_nstb(value);
20867        self
20868    }
20869
20870    /// Returns the value of the `PMSSE` field.
20871    pub const fn pmsse(self) -> u8 {
20872        ((self.bits() >> Self::PMSSE_SHIFT) & 0b11) as u8
20873    }
20874
20875    /// Sets the value of the `PMSSE` field.
20876    pub const fn set_pmsse(&mut self, value: u8) {
20877        let offset = Self::PMSSE_SHIFT;
20878        assert!(value & (Self::PMSSE_MASK as u8) == value);
20879        *self = Self::from_bits_retain(
20880            (self.bits() & !(Self::PMSSE_MASK << offset)) | ((value as u64) << offset),
20881        );
20882    }
20883
20884    /// Returns a copy with the `PMSSE` field set to the given value.
20885    pub const fn with_pmsse(mut self, value: u8) -> Self {
20886        self.set_pmsse(value);
20887        self
20888    }
20889
20890    /// Returns the value of the `SBRBE` field.
20891    pub const fn sbrbe(self) -> u8 {
20892        ((self.bits() >> Self::SBRBE_SHIFT) & 0b11) as u8
20893    }
20894
20895    /// Sets the value of the `SBRBE` field.
20896    pub const fn set_sbrbe(&mut self, value: u8) {
20897        let offset = Self::SBRBE_SHIFT;
20898        assert!(value & (Self::SBRBE_MASK as u8) == value);
20899        *self = Self::from_bits_retain(
20900            (self.bits() & !(Self::SBRBE_MASK << offset)) | ((value as u64) << offset),
20901        );
20902    }
20903
20904    /// Returns a copy with the `SBRBE` field set to the given value.
20905    pub const fn with_sbrbe(mut self, value: u8) -> Self {
20906        self.set_sbrbe(value);
20907        self
20908    }
20909
20910    /// Returns the value of the `PMEE` field.
20911    pub const fn pmee(self) -> u8 {
20912        ((self.bits() >> Self::PMEE_SHIFT) & 0b11) as u8
20913    }
20914
20915    /// Sets the value of the `PMEE` field.
20916    pub const fn set_pmee(&mut self, value: u8) {
20917        let offset = Self::PMEE_SHIFT;
20918        assert!(value & (Self::PMEE_MASK as u8) == value);
20919        *self = Self::from_bits_retain(
20920            (self.bits() & !(Self::PMEE_MASK << offset)) | ((value as u64) << offset),
20921        );
20922    }
20923
20924    /// Returns a copy with the `PMEE` field set to the given value.
20925    pub const fn with_pmee(mut self, value: u8) -> Self {
20926        self.set_pmee(value);
20927        self
20928    }
20929
20930    /// Returns the value of the `EPMSSAD` field.
20931    pub const fn epmssad(self) -> u8 {
20932        ((self.bits() >> Self::EPMSSAD_SHIFT) & 0b11) as u8
20933    }
20934
20935    /// Sets the value of the `EPMSSAD` field.
20936    pub const fn set_epmssad(&mut self, value: u8) {
20937        let offset = Self::EPMSSAD_SHIFT;
20938        assert!(value & (Self::EPMSSAD_MASK as u8) == value);
20939        *self = Self::from_bits_retain(
20940            (self.bits() & !(Self::EPMSSAD_MASK << offset)) | ((value as u64) << offset),
20941        );
20942    }
20943
20944    /// Returns a copy with the `EPMSSAD` field set to the given value.
20945    pub const fn with_epmssad(mut self, value: u8) -> Self {
20946        self.set_epmssad(value);
20947        self
20948    }
20949
20950    /// Returns the value of the `ETBAD` field.
20951    pub const fn etbad(self) -> u8 {
20952        ((self.bits() >> Self::ETBAD_SHIFT) & 0b11) as u8
20953    }
20954
20955    /// Sets the value of the `ETBAD` field.
20956    pub const fn set_etbad(&mut self, value: u8) {
20957        let offset = Self::ETBAD_SHIFT;
20958        assert!(value & (Self::ETBAD_MASK as u8) == value);
20959        *self = Self::from_bits_retain(
20960            (self.bits() & !(Self::ETBAD_MASK << offset)) | ((value as u64) << offset),
20961        );
20962    }
20963
20964    /// Returns a copy with the `ETBAD` field set to the given value.
20965    pub const fn with_etbad(mut self, value: u8) -> Self {
20966        self.set_etbad(value);
20967        self
20968    }
20969
20970    /// Returns the value of the `PMSEE` field.
20971    pub const fn pmsee(self) -> u8 {
20972        ((self.bits() >> Self::PMSEE_SHIFT) & 0b11) as u8
20973    }
20974
20975    /// Sets the value of the `PMSEE` field.
20976    pub const fn set_pmsee(&mut self, value: u8) {
20977        let offset = Self::PMSEE_SHIFT;
20978        assert!(value & (Self::PMSEE_MASK as u8) == value);
20979        *self = Self::from_bits_retain(
20980            (self.bits() & !(Self::PMSEE_MASK << offset)) | ((value as u64) << offset),
20981        );
20982    }
20983
20984    /// Returns a copy with the `PMSEE` field set to the given value.
20985    pub const fn with_pmsee(mut self, value: u8) -> Self {
20986        self.set_pmsee(value);
20987        self
20988    }
20989
20990    /// Returns the value of the `TRBEE` field.
20991    pub const fn trbee(self) -> u8 {
20992        ((self.bits() >> Self::TRBEE_SHIFT) & 0b11) as u8
20993    }
20994
20995    /// Sets the value of the `TRBEE` field.
20996    pub const fn set_trbee(&mut self, value: u8) {
20997        let offset = Self::TRBEE_SHIFT;
20998        assert!(value & (Self::TRBEE_MASK as u8) == value);
20999        *self = Self::from_bits_retain(
21000            (self.bits() & !(Self::TRBEE_MASK << offset)) | ((value as u64) << offset),
21001        );
21002    }
21003
21004    /// Returns a copy with the `TRBEE` field set to the given value.
21005    pub const fn with_trbee(mut self, value: u8) -> Self {
21006        self.set_trbee(value);
21007        self
21008    }
21009}
21010
21011#[cfg(feature = "el1")]
21012bitflags! {
21013    /// `MDSCR_EL1` system register value.
21014    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21015    #[repr(transparent)]
21016    pub struct MdscrEl1: u64 {
21017        /// `SS` bit.
21018        const SS = 1 << 0;
21019        /// `ERR` bit.
21020        const ERR = 1 << 6;
21021        /// `TDCC` bit.
21022        const TDCC = 1 << 12;
21023        /// `KDE` bit.
21024        const KDE = 1 << 13;
21025        /// `HDE` bit.
21026        const HDE = 1 << 14;
21027        /// `MDE` bit.
21028        const MDE = 1 << 15;
21029        /// `SC2` bit.
21030        const SC2 = 1 << 19;
21031        /// `TDA` bit.
21032        const TDA = 1 << 21;
21033        /// `TXU` bit.
21034        const TXU = 1 << 26;
21035        /// `RXO` bit.
21036        const RXO = 1 << 27;
21037        /// `TXfull` bit.
21038        const TXFULL = 1 << 29;
21039        /// `RXfull` bit.
21040        const RXFULL = 1 << 30;
21041        /// `TFO` bit.
21042        const TFO = 1 << 31;
21043        /// `EMBWE` bit.
21044        const EMBWE = 1 << 32;
21045        /// `TTA` bit.
21046        const TTA = 1 << 33;
21047        /// `EnSPM` bit.
21048        const ENSPM = 1 << 34;
21049        /// `EHBWE` bit.
21050        const EHBWE = 1 << 35;
21051        /// `EnSTEPOP` bit.
21052        const ENSTEPOP = 1 << 50;
21053    }
21054}
21055
21056#[cfg(feature = "el1")]
21057impl MdscrEl1 {
21058    /// Offset of the `SS` field.
21059    pub const SS_SHIFT: u32 = 0;
21060    /// Offset of the `ERR` field.
21061    pub const ERR_SHIFT: u32 = 6;
21062    /// Offset of the `TDCC` field.
21063    pub const TDCC_SHIFT: u32 = 12;
21064    /// Offset of the `KDE` field.
21065    pub const KDE_SHIFT: u32 = 13;
21066    /// Offset of the `HDE` field.
21067    pub const HDE_SHIFT: u32 = 14;
21068    /// Offset of the `MDE` field.
21069    pub const MDE_SHIFT: u32 = 15;
21070    /// Offset of the `SC2` field.
21071    pub const SC2_SHIFT: u32 = 19;
21072    /// Offset of the `TDA` field.
21073    pub const TDA_SHIFT: u32 = 21;
21074    /// Offset of the `INTdis` field.
21075    pub const INTDIS_SHIFT: u32 = 22;
21076    /// Mask for the `INTdis` field.
21077    pub const INTDIS_MASK: u64 = 0b11;
21078    /// Offset of the `TXU` field.
21079    pub const TXU_SHIFT: u32 = 26;
21080    /// Offset of the `RXO` field.
21081    pub const RXO_SHIFT: u32 = 27;
21082    /// Offset of the `TXfull` field.
21083    pub const TXFULL_SHIFT: u32 = 29;
21084    /// Offset of the `RXfull` field.
21085    pub const RXFULL_SHIFT: u32 = 30;
21086    /// Offset of the `TFO` field.
21087    pub const TFO_SHIFT: u32 = 31;
21088    /// Offset of the `EMBWE` field.
21089    pub const EMBWE_SHIFT: u32 = 32;
21090    /// Offset of the `TTA` field.
21091    pub const TTA_SHIFT: u32 = 33;
21092    /// Offset of the `EnSPM` field.
21093    pub const ENSPM_SHIFT: u32 = 34;
21094    /// Offset of the `EHBWE` field.
21095    pub const EHBWE_SHIFT: u32 = 35;
21096    /// Offset of the `EnSTEPOP` field.
21097    pub const ENSTEPOP_SHIFT: u32 = 50;
21098
21099    /// Returns the value of the `INTdis` field.
21100    pub const fn intdis(self) -> u8 {
21101        ((self.bits() >> Self::INTDIS_SHIFT) & 0b11) as u8
21102    }
21103
21104    /// Sets the value of the `INTdis` field.
21105    pub const fn set_intdis(&mut self, value: u8) {
21106        let offset = Self::INTDIS_SHIFT;
21107        assert!(value & (Self::INTDIS_MASK as u8) == value);
21108        *self = Self::from_bits_retain(
21109            (self.bits() & !(Self::INTDIS_MASK << offset)) | ((value as u64) << offset),
21110        );
21111    }
21112
21113    /// Returns a copy with the `INTdis` field set to the given value.
21114    pub const fn with_intdis(mut self, value: u8) -> Self {
21115        self.set_intdis(value);
21116        self
21117    }
21118}
21119
21120bitflags! {
21121    /// `MIDR` system register value.
21122    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21123    #[repr(transparent)]
21124    pub struct Midr: u32 {
21125    }
21126}
21127
21128impl Midr {
21129    /// Offset of the `Revision` field.
21130    pub const REVISION_SHIFT: u32 = 0;
21131    /// Mask for the `Revision` field.
21132    pub const REVISION_MASK: u32 = 0b1111;
21133    /// Offset of the `PartNum` field.
21134    pub const PARTNUM_SHIFT: u32 = 4;
21135    /// Mask for the `PartNum` field.
21136    pub const PARTNUM_MASK: u32 = 0b111111111111;
21137    /// Offset of the `Architecture` field.
21138    pub const ARCHITECTURE_SHIFT: u32 = 16;
21139    /// Mask for the `Architecture` field.
21140    pub const ARCHITECTURE_MASK: u32 = 0b1111;
21141    /// Offset of the `Variant` field.
21142    pub const VARIANT_SHIFT: u32 = 20;
21143    /// Mask for the `Variant` field.
21144    pub const VARIANT_MASK: u32 = 0b1111;
21145    /// Offset of the `Implementer` field.
21146    pub const IMPLEMENTER_SHIFT: u32 = 24;
21147    /// Mask for the `Implementer` field.
21148    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
21149
21150    /// Returns the value of the `Revision` field.
21151    pub const fn revision(self) -> u8 {
21152        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
21153    }
21154
21155    /// Sets the value of the `Revision` field.
21156    pub const fn set_revision(&mut self, value: u8) {
21157        let offset = Self::REVISION_SHIFT;
21158        assert!(value & (Self::REVISION_MASK as u8) == value);
21159        *self = Self::from_bits_retain(
21160            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u32) << offset),
21161        );
21162    }
21163
21164    /// Returns a copy with the `Revision` field set to the given value.
21165    pub const fn with_revision(mut self, value: u8) -> Self {
21166        self.set_revision(value);
21167        self
21168    }
21169
21170    /// Returns the value of the `PartNum` field.
21171    pub const fn partnum(self) -> u16 {
21172        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
21173    }
21174
21175    /// Sets the value of the `PartNum` field.
21176    pub const fn set_partnum(&mut self, value: u16) {
21177        let offset = Self::PARTNUM_SHIFT;
21178        assert!(value & (Self::PARTNUM_MASK as u16) == value);
21179        *self = Self::from_bits_retain(
21180            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u32) << offset),
21181        );
21182    }
21183
21184    /// Returns a copy with the `PartNum` field set to the given value.
21185    pub const fn with_partnum(mut self, value: u16) -> Self {
21186        self.set_partnum(value);
21187        self
21188    }
21189
21190    /// Returns the value of the `Architecture` field.
21191    pub const fn architecture(self) -> u8 {
21192        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
21193    }
21194
21195    /// Sets the value of the `Architecture` field.
21196    pub const fn set_architecture(&mut self, value: u8) {
21197        let offset = Self::ARCHITECTURE_SHIFT;
21198        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
21199        *self = Self::from_bits_retain(
21200            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u32) << offset),
21201        );
21202    }
21203
21204    /// Returns a copy with the `Architecture` field set to the given value.
21205    pub const fn with_architecture(mut self, value: u8) -> Self {
21206        self.set_architecture(value);
21207        self
21208    }
21209
21210    /// Returns the value of the `Variant` field.
21211    pub const fn variant(self) -> u8 {
21212        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
21213    }
21214
21215    /// Sets the value of the `Variant` field.
21216    pub const fn set_variant(&mut self, value: u8) {
21217        let offset = Self::VARIANT_SHIFT;
21218        assert!(value & (Self::VARIANT_MASK as u8) == value);
21219        *self = Self::from_bits_retain(
21220            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u32) << offset),
21221        );
21222    }
21223
21224    /// Returns a copy with the `Variant` field set to the given value.
21225    pub const fn with_variant(mut self, value: u8) -> Self {
21226        self.set_variant(value);
21227        self
21228    }
21229
21230    /// Returns the value of the `Implementer` field.
21231    pub const fn implementer(self) -> u8 {
21232        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
21233    }
21234
21235    /// Sets the value of the `Implementer` field.
21236    pub const fn set_implementer(&mut self, value: u8) {
21237        let offset = Self::IMPLEMENTER_SHIFT;
21238        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
21239        *self = Self::from_bits_retain(
21240            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u32) << offset),
21241        );
21242    }
21243
21244    /// Returns a copy with the `Implementer` field set to the given value.
21245    pub const fn with_implementer(mut self, value: u8) -> Self {
21246        self.set_implementer(value);
21247        self
21248    }
21249}
21250
21251#[cfg(feature = "el1")]
21252bitflags! {
21253    /// `MIDR_EL1` system register value.
21254    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21255    #[repr(transparent)]
21256    pub struct MidrEl1: u64 {
21257    }
21258}
21259
21260#[cfg(feature = "el1")]
21261impl MidrEl1 {
21262    /// Offset of the `Revision` field.
21263    pub const REVISION_SHIFT: u32 = 0;
21264    /// Mask for the `Revision` field.
21265    pub const REVISION_MASK: u64 = 0b1111;
21266    /// Offset of the `PartNum` field.
21267    pub const PARTNUM_SHIFT: u32 = 4;
21268    /// Mask for the `PartNum` field.
21269    pub const PARTNUM_MASK: u64 = 0b111111111111;
21270    /// Offset of the `Architecture` field.
21271    pub const ARCHITECTURE_SHIFT: u32 = 16;
21272    /// Mask for the `Architecture` field.
21273    pub const ARCHITECTURE_MASK: u64 = 0b1111;
21274    /// Offset of the `Variant` field.
21275    pub const VARIANT_SHIFT: u32 = 20;
21276    /// Mask for the `Variant` field.
21277    pub const VARIANT_MASK: u64 = 0b1111;
21278    /// Offset of the `Implementer` field.
21279    pub const IMPLEMENTER_SHIFT: u32 = 24;
21280    /// Mask for the `Implementer` field.
21281    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
21282
21283    /// Returns the value of the `Revision` field.
21284    pub const fn revision(self) -> u8 {
21285        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
21286    }
21287
21288    /// Sets the value of the `Revision` field.
21289    pub const fn set_revision(&mut self, value: u8) {
21290        let offset = Self::REVISION_SHIFT;
21291        assert!(value & (Self::REVISION_MASK as u8) == value);
21292        *self = Self::from_bits_retain(
21293            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u64) << offset),
21294        );
21295    }
21296
21297    /// Returns a copy with the `Revision` field set to the given value.
21298    pub const fn with_revision(mut self, value: u8) -> Self {
21299        self.set_revision(value);
21300        self
21301    }
21302
21303    /// Returns the value of the `PartNum` field.
21304    pub const fn partnum(self) -> u16 {
21305        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
21306    }
21307
21308    /// Sets the value of the `PartNum` field.
21309    pub const fn set_partnum(&mut self, value: u16) {
21310        let offset = Self::PARTNUM_SHIFT;
21311        assert!(value & (Self::PARTNUM_MASK as u16) == value);
21312        *self = Self::from_bits_retain(
21313            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u64) << offset),
21314        );
21315    }
21316
21317    /// Returns a copy with the `PartNum` field set to the given value.
21318    pub const fn with_partnum(mut self, value: u16) -> Self {
21319        self.set_partnum(value);
21320        self
21321    }
21322
21323    /// Returns the value of the `Architecture` field.
21324    pub const fn architecture(self) -> u8 {
21325        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
21326    }
21327
21328    /// Sets the value of the `Architecture` field.
21329    pub const fn set_architecture(&mut self, value: u8) {
21330        let offset = Self::ARCHITECTURE_SHIFT;
21331        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
21332        *self = Self::from_bits_retain(
21333            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u64) << offset),
21334        );
21335    }
21336
21337    /// Returns a copy with the `Architecture` field set to the given value.
21338    pub const fn with_architecture(mut self, value: u8) -> Self {
21339        self.set_architecture(value);
21340        self
21341    }
21342
21343    /// Returns the value of the `Variant` field.
21344    pub const fn variant(self) -> u8 {
21345        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
21346    }
21347
21348    /// Sets the value of the `Variant` field.
21349    pub const fn set_variant(&mut self, value: u8) {
21350        let offset = Self::VARIANT_SHIFT;
21351        assert!(value & (Self::VARIANT_MASK as u8) == value);
21352        *self = Self::from_bits_retain(
21353            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u64) << offset),
21354        );
21355    }
21356
21357    /// Returns a copy with the `Variant` field set to the given value.
21358    pub const fn with_variant(mut self, value: u8) -> Self {
21359        self.set_variant(value);
21360        self
21361    }
21362
21363    /// Returns the value of the `Implementer` field.
21364    pub const fn implementer(self) -> u8 {
21365        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
21366    }
21367
21368    /// Sets the value of the `Implementer` field.
21369    pub const fn set_implementer(&mut self, value: u8) {
21370        let offset = Self::IMPLEMENTER_SHIFT;
21371        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
21372        *self = Self::from_bits_retain(
21373            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u64) << offset),
21374        );
21375    }
21376
21377    /// Returns a copy with the `Implementer` field set to the given value.
21378    pub const fn with_implementer(mut self, value: u8) -> Self {
21379        self.set_implementer(value);
21380        self
21381    }
21382}
21383
21384#[cfg(feature = "el2")]
21385bitflags! {
21386    /// `MPAM2_EL2` system register value.
21387    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21388    #[repr(transparent)]
21389    pub struct Mpam2El2: u64 {
21390        /// `TRAPMPAM1EL1` bit.
21391        const TRAPMPAM1EL1 = 1 << 48;
21392        /// `TRAPMPAM0EL1` bit.
21393        const TRAPMPAM0EL1 = 1 << 49;
21394        /// `EnMPAMSM` bit.
21395        const ENMPAMSM = 1 << 50;
21396        /// `ALTSP_FRCD` bit.
21397        const ALTSP_FRCD = 1 << 54;
21398        /// `ALTSP_EL2` bit.
21399        const ALTSP_EL2 = 1 << 55;
21400        /// `ALTSP_HFC` bit.
21401        const ALTSP_HFC = 1 << 56;
21402        /// `TIDR` bit.
21403        const TIDR = 1 << 58;
21404        /// `MPAMEN` bit.
21405        const MPAMEN = 1 << 63;
21406    }
21407}
21408
21409#[cfg(feature = "el2")]
21410impl Mpam2El2 {
21411    /// Offset of the `PARTID` field.
21412    pub const PARTID_SHIFT: u32 = 0;
21413    /// Mask for the `PARTID` field.
21414    pub const PARTID_MASK: u64 = 0b1111111111111111;
21415    /// Offset of the `PARTID_I` field.
21416    pub const PARTID_I_SHIFT: u32 = 0;
21417    /// Mask for the `PARTID_I` field.
21418    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
21419    /// Offset of the `PARTID_D` field.
21420    pub const PARTID_D_SHIFT: u32 = 16;
21421    /// Mask for the `PARTID_D` field.
21422    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
21423    /// Offset of the `altPARTID` field.
21424    pub const ALTPARTID_SHIFT: u32 = 16;
21425    /// Mask for the `altPARTID` field.
21426    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
21427    /// Offset of the `PMG` field.
21428    pub const PMG_SHIFT: u32 = 32;
21429    /// Mask for the `PMG` field.
21430    pub const PMG_MASK: u64 = 0b1111111111111111;
21431    /// Offset of the `PMG_I` field.
21432    pub const PMG_I_SHIFT: u32 = 32;
21433    /// Mask for the `PMG_I` field.
21434    pub const PMG_I_MASK: u64 = 0b11111111;
21435    /// Offset of the `PMG_D` field.
21436    pub const PMG_D_SHIFT: u32 = 40;
21437    /// Mask for the `PMG_D` field.
21438    pub const PMG_D_MASK: u64 = 0b11111111;
21439    /// Offset of the `TRAPMPAM1EL1` field.
21440    pub const TRAPMPAM1EL1_SHIFT: u32 = 48;
21441    /// Offset of the `altPMG` field.
21442    pub const ALTPMG_SHIFT: u32 = 48;
21443    /// Mask for the `altPMG` field.
21444    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
21445    /// Offset of the `TRAPMPAM0EL1` field.
21446    pub const TRAPMPAM0EL1_SHIFT: u32 = 49;
21447    /// Offset of the `EnMPAMSM` field.
21448    pub const ENMPAMSM_SHIFT: u32 = 50;
21449    /// Offset of the `ALTSP_FRCD` field.
21450    pub const ALTSP_FRCD_SHIFT: u32 = 54;
21451    /// Offset of the `ALTSP_EL2` field.
21452    pub const ALTSP_EL2_SHIFT: u32 = 55;
21453    /// Offset of the `ALTSP_HFC` field.
21454    pub const ALTSP_HFC_SHIFT: u32 = 56;
21455    /// Offset of the `TIDR` field.
21456    pub const TIDR_SHIFT: u32 = 58;
21457    /// Offset of the `MPAMEN` field.
21458    pub const MPAMEN_SHIFT: u32 = 63;
21459
21460    /// Returns the value of the `PARTID` field.
21461    pub const fn partid(self) -> u16 {
21462        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
21463    }
21464
21465    /// Sets the value of the `PARTID` field.
21466    pub const fn set_partid(&mut self, value: u16) {
21467        let offset = Self::PARTID_SHIFT;
21468        assert!(value & (Self::PARTID_MASK as u16) == value);
21469        *self = Self::from_bits_retain(
21470            (self.bits() & !(Self::PARTID_MASK << offset)) | ((value as u64) << offset),
21471        );
21472    }
21473
21474    /// Returns a copy with the `PARTID` field set to the given value.
21475    pub const fn with_partid(mut self, value: u16) -> Self {
21476        self.set_partid(value);
21477        self
21478    }
21479
21480    /// Returns the value of the `PARTID_I` field.
21481    pub const fn partid_i(self) -> u16 {
21482        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
21483    }
21484
21485    /// Sets the value of the `PARTID_I` field.
21486    pub const fn set_partid_i(&mut self, value: u16) {
21487        let offset = Self::PARTID_I_SHIFT;
21488        assert!(value & (Self::PARTID_I_MASK as u16) == value);
21489        *self = Self::from_bits_retain(
21490            (self.bits() & !(Self::PARTID_I_MASK << offset)) | ((value as u64) << offset),
21491        );
21492    }
21493
21494    /// Returns a copy with the `PARTID_I` field set to the given value.
21495    pub const fn with_partid_i(mut self, value: u16) -> Self {
21496        self.set_partid_i(value);
21497        self
21498    }
21499
21500    /// Returns the value of the `PARTID_D` field.
21501    pub const fn partid_d(self) -> u16 {
21502        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
21503    }
21504
21505    /// Sets the value of the `PARTID_D` field.
21506    pub const fn set_partid_d(&mut self, value: u16) {
21507        let offset = Self::PARTID_D_SHIFT;
21508        assert!(value & (Self::PARTID_D_MASK as u16) == value);
21509        *self = Self::from_bits_retain(
21510            (self.bits() & !(Self::PARTID_D_MASK << offset)) | ((value as u64) << offset),
21511        );
21512    }
21513
21514    /// Returns a copy with the `PARTID_D` field set to the given value.
21515    pub const fn with_partid_d(mut self, value: u16) -> Self {
21516        self.set_partid_d(value);
21517        self
21518    }
21519
21520    /// Returns the value of the `altPARTID` field.
21521    pub const fn altpartid(self) -> u16 {
21522        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
21523    }
21524
21525    /// Sets the value of the `altPARTID` field.
21526    pub const fn set_altpartid(&mut self, value: u16) {
21527        let offset = Self::ALTPARTID_SHIFT;
21528        assert!(value & (Self::ALTPARTID_MASK as u16) == value);
21529        *self = Self::from_bits_retain(
21530            (self.bits() & !(Self::ALTPARTID_MASK << offset)) | ((value as u64) << offset),
21531        );
21532    }
21533
21534    /// Returns a copy with the `altPARTID` field set to the given value.
21535    pub const fn with_altpartid(mut self, value: u16) -> Self {
21536        self.set_altpartid(value);
21537        self
21538    }
21539
21540    /// Returns the value of the `PMG` field.
21541    pub const fn pmg(self) -> u16 {
21542        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
21543    }
21544
21545    /// Sets the value of the `PMG` field.
21546    pub const fn set_pmg(&mut self, value: u16) {
21547        let offset = Self::PMG_SHIFT;
21548        assert!(value & (Self::PMG_MASK as u16) == value);
21549        *self = Self::from_bits_retain(
21550            (self.bits() & !(Self::PMG_MASK << offset)) | ((value as u64) << offset),
21551        );
21552    }
21553
21554    /// Returns a copy with the `PMG` field set to the given value.
21555    pub const fn with_pmg(mut self, value: u16) -> Self {
21556        self.set_pmg(value);
21557        self
21558    }
21559
21560    /// Returns the value of the `PMG_I` field.
21561    pub const fn pmg_i(self) -> u8 {
21562        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
21563    }
21564
21565    /// Sets the value of the `PMG_I` field.
21566    pub const fn set_pmg_i(&mut self, value: u8) {
21567        let offset = Self::PMG_I_SHIFT;
21568        assert!(value & (Self::PMG_I_MASK as u8) == value);
21569        *self = Self::from_bits_retain(
21570            (self.bits() & !(Self::PMG_I_MASK << offset)) | ((value as u64) << offset),
21571        );
21572    }
21573
21574    /// Returns a copy with the `PMG_I` field set to the given value.
21575    pub const fn with_pmg_i(mut self, value: u8) -> Self {
21576        self.set_pmg_i(value);
21577        self
21578    }
21579
21580    /// Returns the value of the `PMG_D` field.
21581    pub const fn pmg_d(self) -> u8 {
21582        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
21583    }
21584
21585    /// Sets the value of the `PMG_D` field.
21586    pub const fn set_pmg_d(&mut self, value: u8) {
21587        let offset = Self::PMG_D_SHIFT;
21588        assert!(value & (Self::PMG_D_MASK as u8) == value);
21589        *self = Self::from_bits_retain(
21590            (self.bits() & !(Self::PMG_D_MASK << offset)) | ((value as u64) << offset),
21591        );
21592    }
21593
21594    /// Returns a copy with the `PMG_D` field set to the given value.
21595    pub const fn with_pmg_d(mut self, value: u8) -> Self {
21596        self.set_pmg_d(value);
21597        self
21598    }
21599
21600    /// Returns the value of the `altPMG` field.
21601    pub const fn altpmg(self) -> u16 {
21602        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
21603    }
21604
21605    /// Sets the value of the `altPMG` field.
21606    pub const fn set_altpmg(&mut self, value: u16) {
21607        let offset = Self::ALTPMG_SHIFT;
21608        assert!(value & (Self::ALTPMG_MASK as u16) == value);
21609        *self = Self::from_bits_retain(
21610            (self.bits() & !(Self::ALTPMG_MASK << offset)) | ((value as u64) << offset),
21611        );
21612    }
21613
21614    /// Returns a copy with the `altPMG` field set to the given value.
21615    pub const fn with_altpmg(mut self, value: u16) -> Self {
21616        self.set_altpmg(value);
21617        self
21618    }
21619}
21620
21621#[cfg(feature = "el3")]
21622bitflags! {
21623    /// `MPAM3_EL3` system register value.
21624    ///
21625    /// Holds information to generate MPAM labels for memory requests when executing at EL3.
21626    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21627    #[repr(transparent)]
21628    pub struct Mpam3El3: u64 {
21629        /// `RT_ALTSP_NS` bit.
21630        const RT_ALTSP_NS = 1 << 52;
21631        /// `ALTSP_EL3` bit.
21632        const ALTSP_EL3 = 1 << 55;
21633        /// `ALTSP_HFC` bit.
21634        const ALTSP_HFC = 1 << 56;
21635        /// `ALTSP_HEN` bit.
21636        const ALTSP_HEN = 1 << 57;
21637        /// `FORCE_NS` bit.
21638        const FORCE_NS = 1 << 60;
21639        /// `SDEFLT` bit.
21640        const SDEFLT = 1 << 61;
21641        /// Trap direct accesses to MPAM System registers that are not UNDEFINED from all ELn lower than EL3.
21642        const TRAPLOWER = 1 << 62;
21643        /// 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.
21644        const MPAMEN = 1 << 63;
21645    }
21646}
21647
21648#[cfg(feature = "el3")]
21649impl Mpam3El3 {
21650    /// Offset of the `PARTID` field.
21651    pub const PARTID_SHIFT: u32 = 0;
21652    /// Mask for the `PARTID` field.
21653    pub const PARTID_MASK: u64 = 0b1111111111111111;
21654    /// Offset of the `PARTID_I` field.
21655    pub const PARTID_I_SHIFT: u32 = 0;
21656    /// Mask for the `PARTID_I` field.
21657    pub const PARTID_I_MASK: u64 = 0b1111111111111111;
21658    /// Offset of the `PARTID_D` field.
21659    pub const PARTID_D_SHIFT: u32 = 16;
21660    /// Mask for the `PARTID_D` field.
21661    pub const PARTID_D_MASK: u64 = 0b1111111111111111;
21662    /// Offset of the `altPARTID` field.
21663    pub const ALTPARTID_SHIFT: u32 = 16;
21664    /// Mask for the `altPARTID` field.
21665    pub const ALTPARTID_MASK: u64 = 0b1111111111111111;
21666    /// Offset of the `PMG` field.
21667    pub const PMG_SHIFT: u32 = 32;
21668    /// Mask for the `PMG` field.
21669    pub const PMG_MASK: u64 = 0b1111111111111111;
21670    /// Offset of the `PMG_I` field.
21671    pub const PMG_I_SHIFT: u32 = 32;
21672    /// Mask for the `PMG_I` field.
21673    pub const PMG_I_MASK: u64 = 0b11111111;
21674    /// Offset of the `PMG_D` field.
21675    pub const PMG_D_SHIFT: u32 = 40;
21676    /// Mask for the `PMG_D` field.
21677    pub const PMG_D_MASK: u64 = 0b11111111;
21678    /// Offset of the `altPMG` field.
21679    pub const ALTPMG_SHIFT: u32 = 48;
21680    /// Mask for the `altPMG` field.
21681    pub const ALTPMG_MASK: u64 = 0b1111111111111111;
21682    /// Offset of the `RT_ALTSP_NS` field.
21683    pub const RT_ALTSP_NS_SHIFT: u32 = 52;
21684    /// Offset of the `ALTSP_EL3` field.
21685    pub const ALTSP_EL3_SHIFT: u32 = 55;
21686    /// Offset of the `ALTSP_HFC` field.
21687    pub const ALTSP_HFC_SHIFT: u32 = 56;
21688    /// Offset of the `ALTSP_HEN` field.
21689    pub const ALTSP_HEN_SHIFT: u32 = 57;
21690    /// Offset of the `FORCE_NS` field.
21691    pub const FORCE_NS_SHIFT: u32 = 60;
21692    /// Offset of the `SDEFLT` field.
21693    pub const SDEFLT_SHIFT: u32 = 61;
21694    /// Offset of the `TRAPLOWER` field.
21695    pub const TRAPLOWER_SHIFT: u32 = 62;
21696    /// Offset of the `MPAMEN` field.
21697    pub const MPAMEN_SHIFT: u32 = 63;
21698
21699    /// Returns the value of the `PARTID` field.
21700    pub const fn partid(self) -> u16 {
21701        ((self.bits() >> Self::PARTID_SHIFT) & 0b1111111111111111) as u16
21702    }
21703
21704    /// Sets the value of the `PARTID` field.
21705    pub const fn set_partid(&mut self, value: u16) {
21706        let offset = Self::PARTID_SHIFT;
21707        assert!(value & (Self::PARTID_MASK as u16) == value);
21708        *self = Self::from_bits_retain(
21709            (self.bits() & !(Self::PARTID_MASK << offset)) | ((value as u64) << offset),
21710        );
21711    }
21712
21713    /// Returns a copy with the `PARTID` field set to the given value.
21714    pub const fn with_partid(mut self, value: u16) -> Self {
21715        self.set_partid(value);
21716        self
21717    }
21718
21719    /// Returns the value of the `PARTID_I` field.
21720    pub const fn partid_i(self) -> u16 {
21721        ((self.bits() >> Self::PARTID_I_SHIFT) & 0b1111111111111111) as u16
21722    }
21723
21724    /// Sets the value of the `PARTID_I` field.
21725    pub const fn set_partid_i(&mut self, value: u16) {
21726        let offset = Self::PARTID_I_SHIFT;
21727        assert!(value & (Self::PARTID_I_MASK as u16) == value);
21728        *self = Self::from_bits_retain(
21729            (self.bits() & !(Self::PARTID_I_MASK << offset)) | ((value as u64) << offset),
21730        );
21731    }
21732
21733    /// Returns a copy with the `PARTID_I` field set to the given value.
21734    pub const fn with_partid_i(mut self, value: u16) -> Self {
21735        self.set_partid_i(value);
21736        self
21737    }
21738
21739    /// Returns the value of the `PARTID_D` field.
21740    pub const fn partid_d(self) -> u16 {
21741        ((self.bits() >> Self::PARTID_D_SHIFT) & 0b1111111111111111) as u16
21742    }
21743
21744    /// Sets the value of the `PARTID_D` field.
21745    pub const fn set_partid_d(&mut self, value: u16) {
21746        let offset = Self::PARTID_D_SHIFT;
21747        assert!(value & (Self::PARTID_D_MASK as u16) == value);
21748        *self = Self::from_bits_retain(
21749            (self.bits() & !(Self::PARTID_D_MASK << offset)) | ((value as u64) << offset),
21750        );
21751    }
21752
21753    /// Returns a copy with the `PARTID_D` field set to the given value.
21754    pub const fn with_partid_d(mut self, value: u16) -> Self {
21755        self.set_partid_d(value);
21756        self
21757    }
21758
21759    /// Returns the value of the `altPARTID` field.
21760    pub const fn altpartid(self) -> u16 {
21761        ((self.bits() >> Self::ALTPARTID_SHIFT) & 0b1111111111111111) as u16
21762    }
21763
21764    /// Sets the value of the `altPARTID` field.
21765    pub const fn set_altpartid(&mut self, value: u16) {
21766        let offset = Self::ALTPARTID_SHIFT;
21767        assert!(value & (Self::ALTPARTID_MASK as u16) == value);
21768        *self = Self::from_bits_retain(
21769            (self.bits() & !(Self::ALTPARTID_MASK << offset)) | ((value as u64) << offset),
21770        );
21771    }
21772
21773    /// Returns a copy with the `altPARTID` field set to the given value.
21774    pub const fn with_altpartid(mut self, value: u16) -> Self {
21775        self.set_altpartid(value);
21776        self
21777    }
21778
21779    /// Returns the value of the `PMG` field.
21780    pub const fn pmg(self) -> u16 {
21781        ((self.bits() >> Self::PMG_SHIFT) & 0b1111111111111111) as u16
21782    }
21783
21784    /// Sets the value of the `PMG` field.
21785    pub const fn set_pmg(&mut self, value: u16) {
21786        let offset = Self::PMG_SHIFT;
21787        assert!(value & (Self::PMG_MASK as u16) == value);
21788        *self = Self::from_bits_retain(
21789            (self.bits() & !(Self::PMG_MASK << offset)) | ((value as u64) << offset),
21790        );
21791    }
21792
21793    /// Returns a copy with the `PMG` field set to the given value.
21794    pub const fn with_pmg(mut self, value: u16) -> Self {
21795        self.set_pmg(value);
21796        self
21797    }
21798
21799    /// Returns the value of the `PMG_I` field.
21800    pub const fn pmg_i(self) -> u8 {
21801        ((self.bits() >> Self::PMG_I_SHIFT) & 0b11111111) as u8
21802    }
21803
21804    /// Sets the value of the `PMG_I` field.
21805    pub const fn set_pmg_i(&mut self, value: u8) {
21806        let offset = Self::PMG_I_SHIFT;
21807        assert!(value & (Self::PMG_I_MASK as u8) == value);
21808        *self = Self::from_bits_retain(
21809            (self.bits() & !(Self::PMG_I_MASK << offset)) | ((value as u64) << offset),
21810        );
21811    }
21812
21813    /// Returns a copy with the `PMG_I` field set to the given value.
21814    pub const fn with_pmg_i(mut self, value: u8) -> Self {
21815        self.set_pmg_i(value);
21816        self
21817    }
21818
21819    /// Returns the value of the `PMG_D` field.
21820    pub const fn pmg_d(self) -> u8 {
21821        ((self.bits() >> Self::PMG_D_SHIFT) & 0b11111111) as u8
21822    }
21823
21824    /// Sets the value of the `PMG_D` field.
21825    pub const fn set_pmg_d(&mut self, value: u8) {
21826        let offset = Self::PMG_D_SHIFT;
21827        assert!(value & (Self::PMG_D_MASK as u8) == value);
21828        *self = Self::from_bits_retain(
21829            (self.bits() & !(Self::PMG_D_MASK << offset)) | ((value as u64) << offset),
21830        );
21831    }
21832
21833    /// Returns a copy with the `PMG_D` field set to the given value.
21834    pub const fn with_pmg_d(mut self, value: u8) -> Self {
21835        self.set_pmg_d(value);
21836        self
21837    }
21838
21839    /// Returns the value of the `altPMG` field.
21840    pub const fn altpmg(self) -> u16 {
21841        ((self.bits() >> Self::ALTPMG_SHIFT) & 0b1111111111111111) as u16
21842    }
21843
21844    /// Sets the value of the `altPMG` field.
21845    pub const fn set_altpmg(&mut self, value: u16) {
21846        let offset = Self::ALTPMG_SHIFT;
21847        assert!(value & (Self::ALTPMG_MASK as u16) == value);
21848        *self = Self::from_bits_retain(
21849            (self.bits() & !(Self::ALTPMG_MASK << offset)) | ((value as u64) << offset),
21850        );
21851    }
21852
21853    /// Returns a copy with the `altPMG` field set to the given value.
21854    pub const fn with_altpmg(mut self, value: u16) -> Self {
21855        self.set_altpmg(value);
21856        self
21857    }
21858}
21859
21860#[cfg(feature = "el2")]
21861bitflags! {
21862    /// `MPAMHCR_EL2` system register value.
21863    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21864    #[repr(transparent)]
21865    pub struct MpamhcrEl2: u64 {
21866        /// `EL0_VPMEN` bit.
21867        const EL0_VPMEN = 1 << 0;
21868        /// `EL1_VPMEN` bit.
21869        const EL1_VPMEN = 1 << 1;
21870        /// `VPMEN` bit.
21871        const VPMEN = 1 << 2;
21872        /// `VMMEN` bit.
21873        const VMMEN = 1 << 3;
21874        /// `SMVPMEN` bit.
21875        const SMVPMEN = 1 << 4;
21876        /// `SMVMMEN` bit.
21877        const SMVMMEN = 1 << 5;
21878        /// `GSTAPP_PLK` bit.
21879        const GSTAPP_PLK = 1 << 8;
21880        /// `TRAP_MPAMIDR_EL1` bit.
21881        const TRAP_MPAMIDR_EL1 = 1 << 31;
21882        /// `nTRAPMPAM1EL1` bit.
21883        const NTRAPMPAM1EL1 = 1 << 48;
21884        /// `nTRAPMPAM0EL1` bit.
21885        const NTRAPMPAM0EL1 = 1 << 49;
21886        /// `nTRAPMPAMSM` bit.
21887        const NTRAPMPAMSM = 1 << 50;
21888        /// `nTIDR` bit.
21889        const NTIDR = 1 << 58;
21890    }
21891}
21892
21893#[cfg(feature = "el2")]
21894impl MpamhcrEl2 {
21895    /// Offset of the `EL0_VPMEN` field.
21896    pub const EL0_VPMEN_SHIFT: u32 = 0;
21897    /// Offset of the `EL1_VPMEN` field.
21898    pub const EL1_VPMEN_SHIFT: u32 = 1;
21899    /// Offset of the `VPMEN` field.
21900    pub const VPMEN_SHIFT: u32 = 2;
21901    /// Offset of the `VMMEN` field.
21902    pub const VMMEN_SHIFT: u32 = 3;
21903    /// Offset of the `SMVPMEN` field.
21904    pub const SMVPMEN_SHIFT: u32 = 4;
21905    /// Offset of the `SMVMMEN` field.
21906    pub const SMVMMEN_SHIFT: u32 = 5;
21907    /// Offset of the `GSTAPP_PLK` field.
21908    pub const GSTAPP_PLK_SHIFT: u32 = 8;
21909    /// Offset of the `TRAP_MPAMIDR_EL1` field.
21910    pub const TRAP_MPAMIDR_EL1_SHIFT: u32 = 31;
21911    /// Offset of the `nTRAPMPAM1EL1` field.
21912    pub const NTRAPMPAM1EL1_SHIFT: u32 = 48;
21913    /// Offset of the `nTRAPMPAM0EL1` field.
21914    pub const NTRAPMPAM0EL1_SHIFT: u32 = 49;
21915    /// Offset of the `nTRAPMPAMSM` field.
21916    pub const NTRAPMPAMSM_SHIFT: u32 = 50;
21917    /// Offset of the `nTIDR` field.
21918    pub const NTIDR_SHIFT: u32 = 58;
21919}
21920
21921#[cfg(feature = "el1")]
21922bitflags! {
21923    /// `MPAMIDR_EL1` system register value.
21924    ///
21925    /// Indicates the maximum PARTID and PMG values supported in the implementation and the support for other optional features.
21926    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
21927    #[repr(transparent)]
21928    pub struct MpamidrEl1: u64 {
21929        /// Indicates support for MPAM virtualization.
21930        const HAS_HCR = 1 << 17;
21931        /// `HAS_ALT_ID` bit.
21932        const HAS_ALT_ID = 1 << 21;
21933        /// `HAS_INSTR_ALT_ID` bit.
21934        const HAS_INSTR_ALT_ID = 1 << 22;
21935        /// `HAS_BW_CTRL` bit.
21936        const HAS_BW_CTRL = 1 << 56;
21937        /// `HAS_ALTSP` bit.
21938        const HAS_ALTSP = 1 << 57;
21939        /// `HAS_TIDR` bit.
21940        const HAS_TIDR = 1 << 58;
21941        /// `SP4` bit.
21942        const SP4 = 1 << 59;
21943        /// `HAS_FORCE_NS` bit.
21944        const HAS_FORCE_NS = 1 << 60;
21945        /// `HAS_SDEFLT` bit.
21946        const HAS_SDEFLT = 1 << 61;
21947    }
21948}
21949
21950#[cfg(feature = "el1")]
21951impl MpamidrEl1 {
21952    /// Offset of the `PARTID_MAX` field.
21953    pub const PARTID_MAX_SHIFT: u32 = 0;
21954    /// Mask for the `PARTID_MAX` field.
21955    pub const PARTID_MAX_MASK: u64 = 0b1111111111111111;
21956    /// Offset of the `HAS_HCR` field.
21957    pub const HAS_HCR_SHIFT: u32 = 17;
21958    /// Offset of the `VPMR_MAX` field.
21959    pub const VPMR_MAX_SHIFT: u32 = 18;
21960    /// Mask for the `VPMR_MAX` field.
21961    pub const VPMR_MAX_MASK: u64 = 0b111;
21962    /// Offset of the `HAS_ALT_ID` field.
21963    pub const HAS_ALT_ID_SHIFT: u32 = 21;
21964    /// Offset of the `HAS_INSTR_ALT_ID` field.
21965    pub const HAS_INSTR_ALT_ID_SHIFT: u32 = 22;
21966    /// Offset of the `HAS_BW_CTRL` field.
21967    pub const HAS_BW_CTRL_SHIFT: u32 = 56;
21968    /// Offset of the `HAS_ALTSP` field.
21969    pub const HAS_ALTSP_SHIFT: u32 = 57;
21970    /// Offset of the `HAS_TIDR` field.
21971    pub const HAS_TIDR_SHIFT: u32 = 58;
21972    /// Offset of the `SP4` field.
21973    pub const SP4_SHIFT: u32 = 59;
21974    /// Offset of the `HAS_FORCE_NS` field.
21975    pub const HAS_FORCE_NS_SHIFT: u32 = 60;
21976    /// Offset of the `HAS_SDEFLT` field.
21977    pub const HAS_SDEFLT_SHIFT: u32 = 61;
21978
21979    /// Returns the value of the `PARTID_MAX` field.
21980    pub const fn partid_max(self) -> u16 {
21981        ((self.bits() >> Self::PARTID_MAX_SHIFT) & 0b1111111111111111) as u16
21982    }
21983
21984    /// Sets the value of the `PARTID_MAX` field.
21985    pub const fn set_partid_max(&mut self, value: u16) {
21986        let offset = Self::PARTID_MAX_SHIFT;
21987        assert!(value & (Self::PARTID_MAX_MASK as u16) == value);
21988        *self = Self::from_bits_retain(
21989            (self.bits() & !(Self::PARTID_MAX_MASK << offset)) | ((value as u64) << offset),
21990        );
21991    }
21992
21993    /// Returns a copy with the `PARTID_MAX` field set to the given value.
21994    pub const fn with_partid_max(mut self, value: u16) -> Self {
21995        self.set_partid_max(value);
21996        self
21997    }
21998
21999    /// Returns the value of the `VPMR_MAX` field.
22000    ///
22001    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
22002    pub const fn vpmr_max(self) -> u8 {
22003        ((self.bits() >> Self::VPMR_MAX_SHIFT) & 0b111) as u8
22004    }
22005
22006    /// Sets the value of the `VPMR_MAX` field.
22007    ///
22008    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
22009    pub const fn set_vpmr_max(&mut self, value: u8) {
22010        let offset = Self::VPMR_MAX_SHIFT;
22011        assert!(value & (Self::VPMR_MAX_MASK as u8) == value);
22012        *self = Self::from_bits_retain(
22013            (self.bits() & !(Self::VPMR_MAX_MASK << offset)) | ((value as u64) << offset),
22014        );
22015    }
22016
22017    /// Returns a copy with the `VPMR_MAX` field set to the given value.
22018    ///
22019    /// Indicates the maximum register index n for the `MPAMVPM<n>_EL2` registers.
22020    pub const fn with_vpmr_max(mut self, value: u8) -> Self {
22021        self.set_vpmr_max(value);
22022        self
22023    }
22024}
22025
22026#[cfg(feature = "el2")]
22027bitflags! {
22028    /// `MPAMVPM0_EL2` system register value.
22029    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22030    #[repr(transparent)]
22031    pub struct Mpamvpm0El2: u64 {
22032    }
22033}
22034
22035#[cfg(feature = "el2")]
22036impl Mpamvpm0El2 {
22037    /// Offset of the `PhyPARTID0` field.
22038    pub const PHYPARTID0_SHIFT: u32 = 0;
22039    /// Mask for the `PhyPARTID0` field.
22040    pub const PHYPARTID0_MASK: u64 = 0b1111111111111111;
22041    /// Offset of the `PhyPARTID1` field.
22042    pub const PHYPARTID1_SHIFT: u32 = 16;
22043    /// Mask for the `PhyPARTID1` field.
22044    pub const PHYPARTID1_MASK: u64 = 0b1111111111111111;
22045    /// Offset of the `PhyPARTID2` field.
22046    pub const PHYPARTID2_SHIFT: u32 = 32;
22047    /// Mask for the `PhyPARTID2` field.
22048    pub const PHYPARTID2_MASK: u64 = 0b1111111111111111;
22049    /// Offset of the `PhyPARTID3` field.
22050    pub const PHYPARTID3_SHIFT: u32 = 48;
22051    /// Mask for the `PhyPARTID3` field.
22052    pub const PHYPARTID3_MASK: u64 = 0b1111111111111111;
22053
22054    /// Returns the value of the `PhyPARTID0` field.
22055    pub const fn phypartid0(self) -> u16 {
22056        ((self.bits() >> Self::PHYPARTID0_SHIFT) & 0b1111111111111111) as u16
22057    }
22058
22059    /// Sets the value of the `PhyPARTID0` field.
22060    pub const fn set_phypartid0(&mut self, value: u16) {
22061        let offset = Self::PHYPARTID0_SHIFT;
22062        assert!(value & (Self::PHYPARTID0_MASK as u16) == value);
22063        *self = Self::from_bits_retain(
22064            (self.bits() & !(Self::PHYPARTID0_MASK << offset)) | ((value as u64) << offset),
22065        );
22066    }
22067
22068    /// Returns a copy with the `PhyPARTID0` field set to the given value.
22069    pub const fn with_phypartid0(mut self, value: u16) -> Self {
22070        self.set_phypartid0(value);
22071        self
22072    }
22073
22074    /// Returns the value of the `PhyPARTID1` field.
22075    pub const fn phypartid1(self) -> u16 {
22076        ((self.bits() >> Self::PHYPARTID1_SHIFT) & 0b1111111111111111) as u16
22077    }
22078
22079    /// Sets the value of the `PhyPARTID1` field.
22080    pub const fn set_phypartid1(&mut self, value: u16) {
22081        let offset = Self::PHYPARTID1_SHIFT;
22082        assert!(value & (Self::PHYPARTID1_MASK as u16) == value);
22083        *self = Self::from_bits_retain(
22084            (self.bits() & !(Self::PHYPARTID1_MASK << offset)) | ((value as u64) << offset),
22085        );
22086    }
22087
22088    /// Returns a copy with the `PhyPARTID1` field set to the given value.
22089    pub const fn with_phypartid1(mut self, value: u16) -> Self {
22090        self.set_phypartid1(value);
22091        self
22092    }
22093
22094    /// Returns the value of the `PhyPARTID2` field.
22095    pub const fn phypartid2(self) -> u16 {
22096        ((self.bits() >> Self::PHYPARTID2_SHIFT) & 0b1111111111111111) as u16
22097    }
22098
22099    /// Sets the value of the `PhyPARTID2` field.
22100    pub const fn set_phypartid2(&mut self, value: u16) {
22101        let offset = Self::PHYPARTID2_SHIFT;
22102        assert!(value & (Self::PHYPARTID2_MASK as u16) == value);
22103        *self = Self::from_bits_retain(
22104            (self.bits() & !(Self::PHYPARTID2_MASK << offset)) | ((value as u64) << offset),
22105        );
22106    }
22107
22108    /// Returns a copy with the `PhyPARTID2` field set to the given value.
22109    pub const fn with_phypartid2(mut self, value: u16) -> Self {
22110        self.set_phypartid2(value);
22111        self
22112    }
22113
22114    /// Returns the value of the `PhyPARTID3` field.
22115    pub const fn phypartid3(self) -> u16 {
22116        ((self.bits() >> Self::PHYPARTID3_SHIFT) & 0b1111111111111111) as u16
22117    }
22118
22119    /// Sets the value of the `PhyPARTID3` field.
22120    pub const fn set_phypartid3(&mut self, value: u16) {
22121        let offset = Self::PHYPARTID3_SHIFT;
22122        assert!(value & (Self::PHYPARTID3_MASK as u16) == value);
22123        *self = Self::from_bits_retain(
22124            (self.bits() & !(Self::PHYPARTID3_MASK << offset)) | ((value as u64) << offset),
22125        );
22126    }
22127
22128    /// Returns a copy with the `PhyPARTID3` field set to the given value.
22129    pub const fn with_phypartid3(mut self, value: u16) -> Self {
22130        self.set_phypartid3(value);
22131        self
22132    }
22133}
22134
22135#[cfg(feature = "el2")]
22136bitflags! {
22137    /// `MPAMVPM1_EL2` system register value.
22138    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22139    #[repr(transparent)]
22140    pub struct Mpamvpm1El2: u64 {
22141    }
22142}
22143
22144#[cfg(feature = "el2")]
22145impl Mpamvpm1El2 {
22146    /// Offset of the `PhyPARTID4` field.
22147    pub const PHYPARTID4_SHIFT: u32 = 0;
22148    /// Mask for the `PhyPARTID4` field.
22149    pub const PHYPARTID4_MASK: u64 = 0b1111111111111111;
22150    /// Offset of the `PhyPARTID5` field.
22151    pub const PHYPARTID5_SHIFT: u32 = 16;
22152    /// Mask for the `PhyPARTID5` field.
22153    pub const PHYPARTID5_MASK: u64 = 0b1111111111111111;
22154    /// Offset of the `PhyPARTID6` field.
22155    pub const PHYPARTID6_SHIFT: u32 = 32;
22156    /// Mask for the `PhyPARTID6` field.
22157    pub const PHYPARTID6_MASK: u64 = 0b1111111111111111;
22158    /// Offset of the `PhyPARTID7` field.
22159    pub const PHYPARTID7_SHIFT: u32 = 48;
22160    /// Mask for the `PhyPARTID7` field.
22161    pub const PHYPARTID7_MASK: u64 = 0b1111111111111111;
22162
22163    /// Returns the value of the `PhyPARTID4` field.
22164    pub const fn phypartid4(self) -> u16 {
22165        ((self.bits() >> Self::PHYPARTID4_SHIFT) & 0b1111111111111111) as u16
22166    }
22167
22168    /// Sets the value of the `PhyPARTID4` field.
22169    pub const fn set_phypartid4(&mut self, value: u16) {
22170        let offset = Self::PHYPARTID4_SHIFT;
22171        assert!(value & (Self::PHYPARTID4_MASK as u16) == value);
22172        *self = Self::from_bits_retain(
22173            (self.bits() & !(Self::PHYPARTID4_MASK << offset)) | ((value as u64) << offset),
22174        );
22175    }
22176
22177    /// Returns a copy with the `PhyPARTID4` field set to the given value.
22178    pub const fn with_phypartid4(mut self, value: u16) -> Self {
22179        self.set_phypartid4(value);
22180        self
22181    }
22182
22183    /// Returns the value of the `PhyPARTID5` field.
22184    pub const fn phypartid5(self) -> u16 {
22185        ((self.bits() >> Self::PHYPARTID5_SHIFT) & 0b1111111111111111) as u16
22186    }
22187
22188    /// Sets the value of the `PhyPARTID5` field.
22189    pub const fn set_phypartid5(&mut self, value: u16) {
22190        let offset = Self::PHYPARTID5_SHIFT;
22191        assert!(value & (Self::PHYPARTID5_MASK as u16) == value);
22192        *self = Self::from_bits_retain(
22193            (self.bits() & !(Self::PHYPARTID5_MASK << offset)) | ((value as u64) << offset),
22194        );
22195    }
22196
22197    /// Returns a copy with the `PhyPARTID5` field set to the given value.
22198    pub const fn with_phypartid5(mut self, value: u16) -> Self {
22199        self.set_phypartid5(value);
22200        self
22201    }
22202
22203    /// Returns the value of the `PhyPARTID6` field.
22204    pub const fn phypartid6(self) -> u16 {
22205        ((self.bits() >> Self::PHYPARTID6_SHIFT) & 0b1111111111111111) as u16
22206    }
22207
22208    /// Sets the value of the `PhyPARTID6` field.
22209    pub const fn set_phypartid6(&mut self, value: u16) {
22210        let offset = Self::PHYPARTID6_SHIFT;
22211        assert!(value & (Self::PHYPARTID6_MASK as u16) == value);
22212        *self = Self::from_bits_retain(
22213            (self.bits() & !(Self::PHYPARTID6_MASK << offset)) | ((value as u64) << offset),
22214        );
22215    }
22216
22217    /// Returns a copy with the `PhyPARTID6` field set to the given value.
22218    pub const fn with_phypartid6(mut self, value: u16) -> Self {
22219        self.set_phypartid6(value);
22220        self
22221    }
22222
22223    /// Returns the value of the `PhyPARTID7` field.
22224    pub const fn phypartid7(self) -> u16 {
22225        ((self.bits() >> Self::PHYPARTID7_SHIFT) & 0b1111111111111111) as u16
22226    }
22227
22228    /// Sets the value of the `PhyPARTID7` field.
22229    pub const fn set_phypartid7(&mut self, value: u16) {
22230        let offset = Self::PHYPARTID7_SHIFT;
22231        assert!(value & (Self::PHYPARTID7_MASK as u16) == value);
22232        *self = Self::from_bits_retain(
22233            (self.bits() & !(Self::PHYPARTID7_MASK << offset)) | ((value as u64) << offset),
22234        );
22235    }
22236
22237    /// Returns a copy with the `PhyPARTID7` field set to the given value.
22238    pub const fn with_phypartid7(mut self, value: u16) -> Self {
22239        self.set_phypartid7(value);
22240        self
22241    }
22242}
22243
22244#[cfg(feature = "el2")]
22245bitflags! {
22246    /// `MPAMVPM2_EL2` system register value.
22247    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22248    #[repr(transparent)]
22249    pub struct Mpamvpm2El2: u64 {
22250    }
22251}
22252
22253#[cfg(feature = "el2")]
22254impl Mpamvpm2El2 {
22255    /// Offset of the `PhyPARTID8` field.
22256    pub const PHYPARTID8_SHIFT: u32 = 0;
22257    /// Mask for the `PhyPARTID8` field.
22258    pub const PHYPARTID8_MASK: u64 = 0b1111111111111111;
22259    /// Offset of the `PhyPARTID9` field.
22260    pub const PHYPARTID9_SHIFT: u32 = 16;
22261    /// Mask for the `PhyPARTID9` field.
22262    pub const PHYPARTID9_MASK: u64 = 0b1111111111111111;
22263    /// Offset of the `PhyPARTID10` field.
22264    pub const PHYPARTID10_SHIFT: u32 = 32;
22265    /// Mask for the `PhyPARTID10` field.
22266    pub const PHYPARTID10_MASK: u64 = 0b1111111111111111;
22267    /// Offset of the `PhyPARTID11` field.
22268    pub const PHYPARTID11_SHIFT: u32 = 48;
22269    /// Mask for the `PhyPARTID11` field.
22270    pub const PHYPARTID11_MASK: u64 = 0b1111111111111111;
22271
22272    /// Returns the value of the `PhyPARTID8` field.
22273    pub const fn phypartid8(self) -> u16 {
22274        ((self.bits() >> Self::PHYPARTID8_SHIFT) & 0b1111111111111111) as u16
22275    }
22276
22277    /// Sets the value of the `PhyPARTID8` field.
22278    pub const fn set_phypartid8(&mut self, value: u16) {
22279        let offset = Self::PHYPARTID8_SHIFT;
22280        assert!(value & (Self::PHYPARTID8_MASK as u16) == value);
22281        *self = Self::from_bits_retain(
22282            (self.bits() & !(Self::PHYPARTID8_MASK << offset)) | ((value as u64) << offset),
22283        );
22284    }
22285
22286    /// Returns a copy with the `PhyPARTID8` field set to the given value.
22287    pub const fn with_phypartid8(mut self, value: u16) -> Self {
22288        self.set_phypartid8(value);
22289        self
22290    }
22291
22292    /// Returns the value of the `PhyPARTID9` field.
22293    pub const fn phypartid9(self) -> u16 {
22294        ((self.bits() >> Self::PHYPARTID9_SHIFT) & 0b1111111111111111) as u16
22295    }
22296
22297    /// Sets the value of the `PhyPARTID9` field.
22298    pub const fn set_phypartid9(&mut self, value: u16) {
22299        let offset = Self::PHYPARTID9_SHIFT;
22300        assert!(value & (Self::PHYPARTID9_MASK as u16) == value);
22301        *self = Self::from_bits_retain(
22302            (self.bits() & !(Self::PHYPARTID9_MASK << offset)) | ((value as u64) << offset),
22303        );
22304    }
22305
22306    /// Returns a copy with the `PhyPARTID9` field set to the given value.
22307    pub const fn with_phypartid9(mut self, value: u16) -> Self {
22308        self.set_phypartid9(value);
22309        self
22310    }
22311
22312    /// Returns the value of the `PhyPARTID10` field.
22313    pub const fn phypartid10(self) -> u16 {
22314        ((self.bits() >> Self::PHYPARTID10_SHIFT) & 0b1111111111111111) as u16
22315    }
22316
22317    /// Sets the value of the `PhyPARTID10` field.
22318    pub const fn set_phypartid10(&mut self, value: u16) {
22319        let offset = Self::PHYPARTID10_SHIFT;
22320        assert!(value & (Self::PHYPARTID10_MASK as u16) == value);
22321        *self = Self::from_bits_retain(
22322            (self.bits() & !(Self::PHYPARTID10_MASK << offset)) | ((value as u64) << offset),
22323        );
22324    }
22325
22326    /// Returns a copy with the `PhyPARTID10` field set to the given value.
22327    pub const fn with_phypartid10(mut self, value: u16) -> Self {
22328        self.set_phypartid10(value);
22329        self
22330    }
22331
22332    /// Returns the value of the `PhyPARTID11` field.
22333    pub const fn phypartid11(self) -> u16 {
22334        ((self.bits() >> Self::PHYPARTID11_SHIFT) & 0b1111111111111111) as u16
22335    }
22336
22337    /// Sets the value of the `PhyPARTID11` field.
22338    pub const fn set_phypartid11(&mut self, value: u16) {
22339        let offset = Self::PHYPARTID11_SHIFT;
22340        assert!(value & (Self::PHYPARTID11_MASK as u16) == value);
22341        *self = Self::from_bits_retain(
22342            (self.bits() & !(Self::PHYPARTID11_MASK << offset)) | ((value as u64) << offset),
22343        );
22344    }
22345
22346    /// Returns a copy with the `PhyPARTID11` field set to the given value.
22347    pub const fn with_phypartid11(mut self, value: u16) -> Self {
22348        self.set_phypartid11(value);
22349        self
22350    }
22351}
22352
22353#[cfg(feature = "el2")]
22354bitflags! {
22355    /// `MPAMVPM3_EL2` system register value.
22356    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22357    #[repr(transparent)]
22358    pub struct Mpamvpm3El2: u64 {
22359    }
22360}
22361
22362#[cfg(feature = "el2")]
22363impl Mpamvpm3El2 {
22364    /// Offset of the `PhyPARTID12` field.
22365    pub const PHYPARTID12_SHIFT: u32 = 0;
22366    /// Mask for the `PhyPARTID12` field.
22367    pub const PHYPARTID12_MASK: u64 = 0b1111111111111111;
22368    /// Offset of the `PhyPARTID13` field.
22369    pub const PHYPARTID13_SHIFT: u32 = 16;
22370    /// Mask for the `PhyPARTID13` field.
22371    pub const PHYPARTID13_MASK: u64 = 0b1111111111111111;
22372    /// Offset of the `PhyPARTID14` field.
22373    pub const PHYPARTID14_SHIFT: u32 = 32;
22374    /// Mask for the `PhyPARTID14` field.
22375    pub const PHYPARTID14_MASK: u64 = 0b1111111111111111;
22376    /// Offset of the `PhyPARTID15` field.
22377    pub const PHYPARTID15_SHIFT: u32 = 48;
22378    /// Mask for the `PhyPARTID15` field.
22379    pub const PHYPARTID15_MASK: u64 = 0b1111111111111111;
22380
22381    /// Returns the value of the `PhyPARTID12` field.
22382    pub const fn phypartid12(self) -> u16 {
22383        ((self.bits() >> Self::PHYPARTID12_SHIFT) & 0b1111111111111111) as u16
22384    }
22385
22386    /// Sets the value of the `PhyPARTID12` field.
22387    pub const fn set_phypartid12(&mut self, value: u16) {
22388        let offset = Self::PHYPARTID12_SHIFT;
22389        assert!(value & (Self::PHYPARTID12_MASK as u16) == value);
22390        *self = Self::from_bits_retain(
22391            (self.bits() & !(Self::PHYPARTID12_MASK << offset)) | ((value as u64) << offset),
22392        );
22393    }
22394
22395    /// Returns a copy with the `PhyPARTID12` field set to the given value.
22396    pub const fn with_phypartid12(mut self, value: u16) -> Self {
22397        self.set_phypartid12(value);
22398        self
22399    }
22400
22401    /// Returns the value of the `PhyPARTID13` field.
22402    pub const fn phypartid13(self) -> u16 {
22403        ((self.bits() >> Self::PHYPARTID13_SHIFT) & 0b1111111111111111) as u16
22404    }
22405
22406    /// Sets the value of the `PhyPARTID13` field.
22407    pub const fn set_phypartid13(&mut self, value: u16) {
22408        let offset = Self::PHYPARTID13_SHIFT;
22409        assert!(value & (Self::PHYPARTID13_MASK as u16) == value);
22410        *self = Self::from_bits_retain(
22411            (self.bits() & !(Self::PHYPARTID13_MASK << offset)) | ((value as u64) << offset),
22412        );
22413    }
22414
22415    /// Returns a copy with the `PhyPARTID13` field set to the given value.
22416    pub const fn with_phypartid13(mut self, value: u16) -> Self {
22417        self.set_phypartid13(value);
22418        self
22419    }
22420
22421    /// Returns the value of the `PhyPARTID14` field.
22422    pub const fn phypartid14(self) -> u16 {
22423        ((self.bits() >> Self::PHYPARTID14_SHIFT) & 0b1111111111111111) as u16
22424    }
22425
22426    /// Sets the value of the `PhyPARTID14` field.
22427    pub const fn set_phypartid14(&mut self, value: u16) {
22428        let offset = Self::PHYPARTID14_SHIFT;
22429        assert!(value & (Self::PHYPARTID14_MASK as u16) == value);
22430        *self = Self::from_bits_retain(
22431            (self.bits() & !(Self::PHYPARTID14_MASK << offset)) | ((value as u64) << offset),
22432        );
22433    }
22434
22435    /// Returns a copy with the `PhyPARTID14` field set to the given value.
22436    pub const fn with_phypartid14(mut self, value: u16) -> Self {
22437        self.set_phypartid14(value);
22438        self
22439    }
22440
22441    /// Returns the value of the `PhyPARTID15` field.
22442    pub const fn phypartid15(self) -> u16 {
22443        ((self.bits() >> Self::PHYPARTID15_SHIFT) & 0b1111111111111111) as u16
22444    }
22445
22446    /// Sets the value of the `PhyPARTID15` field.
22447    pub const fn set_phypartid15(&mut self, value: u16) {
22448        let offset = Self::PHYPARTID15_SHIFT;
22449        assert!(value & (Self::PHYPARTID15_MASK as u16) == value);
22450        *self = Self::from_bits_retain(
22451            (self.bits() & !(Self::PHYPARTID15_MASK << offset)) | ((value as u64) << offset),
22452        );
22453    }
22454
22455    /// Returns a copy with the `PhyPARTID15` field set to the given value.
22456    pub const fn with_phypartid15(mut self, value: u16) -> Self {
22457        self.set_phypartid15(value);
22458        self
22459    }
22460}
22461
22462#[cfg(feature = "el2")]
22463bitflags! {
22464    /// `MPAMVPM4_EL2` system register value.
22465    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22466    #[repr(transparent)]
22467    pub struct Mpamvpm4El2: u64 {
22468    }
22469}
22470
22471#[cfg(feature = "el2")]
22472impl Mpamvpm4El2 {
22473    /// Offset of the `PhyPARTID16` field.
22474    pub const PHYPARTID16_SHIFT: u32 = 0;
22475    /// Mask for the `PhyPARTID16` field.
22476    pub const PHYPARTID16_MASK: u64 = 0b1111111111111111;
22477    /// Offset of the `PhyPARTID17` field.
22478    pub const PHYPARTID17_SHIFT: u32 = 16;
22479    /// Mask for the `PhyPARTID17` field.
22480    pub const PHYPARTID17_MASK: u64 = 0b1111111111111111;
22481    /// Offset of the `PhyPARTID18` field.
22482    pub const PHYPARTID18_SHIFT: u32 = 32;
22483    /// Mask for the `PhyPARTID18` field.
22484    pub const PHYPARTID18_MASK: u64 = 0b1111111111111111;
22485    /// Offset of the `PhyPARTID19` field.
22486    pub const PHYPARTID19_SHIFT: u32 = 48;
22487    /// Mask for the `PhyPARTID19` field.
22488    pub const PHYPARTID19_MASK: u64 = 0b1111111111111111;
22489
22490    /// Returns the value of the `PhyPARTID16` field.
22491    pub const fn phypartid16(self) -> u16 {
22492        ((self.bits() >> Self::PHYPARTID16_SHIFT) & 0b1111111111111111) as u16
22493    }
22494
22495    /// Sets the value of the `PhyPARTID16` field.
22496    pub const fn set_phypartid16(&mut self, value: u16) {
22497        let offset = Self::PHYPARTID16_SHIFT;
22498        assert!(value & (Self::PHYPARTID16_MASK as u16) == value);
22499        *self = Self::from_bits_retain(
22500            (self.bits() & !(Self::PHYPARTID16_MASK << offset)) | ((value as u64) << offset),
22501        );
22502    }
22503
22504    /// Returns a copy with the `PhyPARTID16` field set to the given value.
22505    pub const fn with_phypartid16(mut self, value: u16) -> Self {
22506        self.set_phypartid16(value);
22507        self
22508    }
22509
22510    /// Returns the value of the `PhyPARTID17` field.
22511    pub const fn phypartid17(self) -> u16 {
22512        ((self.bits() >> Self::PHYPARTID17_SHIFT) & 0b1111111111111111) as u16
22513    }
22514
22515    /// Sets the value of the `PhyPARTID17` field.
22516    pub const fn set_phypartid17(&mut self, value: u16) {
22517        let offset = Self::PHYPARTID17_SHIFT;
22518        assert!(value & (Self::PHYPARTID17_MASK as u16) == value);
22519        *self = Self::from_bits_retain(
22520            (self.bits() & !(Self::PHYPARTID17_MASK << offset)) | ((value as u64) << offset),
22521        );
22522    }
22523
22524    /// Returns a copy with the `PhyPARTID17` field set to the given value.
22525    pub const fn with_phypartid17(mut self, value: u16) -> Self {
22526        self.set_phypartid17(value);
22527        self
22528    }
22529
22530    /// Returns the value of the `PhyPARTID18` field.
22531    pub const fn phypartid18(self) -> u16 {
22532        ((self.bits() >> Self::PHYPARTID18_SHIFT) & 0b1111111111111111) as u16
22533    }
22534
22535    /// Sets the value of the `PhyPARTID18` field.
22536    pub const fn set_phypartid18(&mut self, value: u16) {
22537        let offset = Self::PHYPARTID18_SHIFT;
22538        assert!(value & (Self::PHYPARTID18_MASK as u16) == value);
22539        *self = Self::from_bits_retain(
22540            (self.bits() & !(Self::PHYPARTID18_MASK << offset)) | ((value as u64) << offset),
22541        );
22542    }
22543
22544    /// Returns a copy with the `PhyPARTID18` field set to the given value.
22545    pub const fn with_phypartid18(mut self, value: u16) -> Self {
22546        self.set_phypartid18(value);
22547        self
22548    }
22549
22550    /// Returns the value of the `PhyPARTID19` field.
22551    pub const fn phypartid19(self) -> u16 {
22552        ((self.bits() >> Self::PHYPARTID19_SHIFT) & 0b1111111111111111) as u16
22553    }
22554
22555    /// Sets the value of the `PhyPARTID19` field.
22556    pub const fn set_phypartid19(&mut self, value: u16) {
22557        let offset = Self::PHYPARTID19_SHIFT;
22558        assert!(value & (Self::PHYPARTID19_MASK as u16) == value);
22559        *self = Self::from_bits_retain(
22560            (self.bits() & !(Self::PHYPARTID19_MASK << offset)) | ((value as u64) << offset),
22561        );
22562    }
22563
22564    /// Returns a copy with the `PhyPARTID19` field set to the given value.
22565    pub const fn with_phypartid19(mut self, value: u16) -> Self {
22566        self.set_phypartid19(value);
22567        self
22568    }
22569}
22570
22571#[cfg(feature = "el2")]
22572bitflags! {
22573    /// `MPAMVPM5_EL2` system register value.
22574    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22575    #[repr(transparent)]
22576    pub struct Mpamvpm5El2: u64 {
22577    }
22578}
22579
22580#[cfg(feature = "el2")]
22581impl Mpamvpm5El2 {
22582    /// Offset of the `PhyPARTID20` field.
22583    pub const PHYPARTID20_SHIFT: u32 = 0;
22584    /// Mask for the `PhyPARTID20` field.
22585    pub const PHYPARTID20_MASK: u64 = 0b1111111111111111;
22586    /// Offset of the `PhyPARTID21` field.
22587    pub const PHYPARTID21_SHIFT: u32 = 16;
22588    /// Mask for the `PhyPARTID21` field.
22589    pub const PHYPARTID21_MASK: u64 = 0b1111111111111111;
22590    /// Offset of the `PhyPARTID22` field.
22591    pub const PHYPARTID22_SHIFT: u32 = 32;
22592    /// Mask for the `PhyPARTID22` field.
22593    pub const PHYPARTID22_MASK: u64 = 0b1111111111111111;
22594    /// Offset of the `PhyPARTID23` field.
22595    pub const PHYPARTID23_SHIFT: u32 = 48;
22596    /// Mask for the `PhyPARTID23` field.
22597    pub const PHYPARTID23_MASK: u64 = 0b1111111111111111;
22598
22599    /// Returns the value of the `PhyPARTID20` field.
22600    pub const fn phypartid20(self) -> u16 {
22601        ((self.bits() >> Self::PHYPARTID20_SHIFT) & 0b1111111111111111) as u16
22602    }
22603
22604    /// Sets the value of the `PhyPARTID20` field.
22605    pub const fn set_phypartid20(&mut self, value: u16) {
22606        let offset = Self::PHYPARTID20_SHIFT;
22607        assert!(value & (Self::PHYPARTID20_MASK as u16) == value);
22608        *self = Self::from_bits_retain(
22609            (self.bits() & !(Self::PHYPARTID20_MASK << offset)) | ((value as u64) << offset),
22610        );
22611    }
22612
22613    /// Returns a copy with the `PhyPARTID20` field set to the given value.
22614    pub const fn with_phypartid20(mut self, value: u16) -> Self {
22615        self.set_phypartid20(value);
22616        self
22617    }
22618
22619    /// Returns the value of the `PhyPARTID21` field.
22620    pub const fn phypartid21(self) -> u16 {
22621        ((self.bits() >> Self::PHYPARTID21_SHIFT) & 0b1111111111111111) as u16
22622    }
22623
22624    /// Sets the value of the `PhyPARTID21` field.
22625    pub const fn set_phypartid21(&mut self, value: u16) {
22626        let offset = Self::PHYPARTID21_SHIFT;
22627        assert!(value & (Self::PHYPARTID21_MASK as u16) == value);
22628        *self = Self::from_bits_retain(
22629            (self.bits() & !(Self::PHYPARTID21_MASK << offset)) | ((value as u64) << offset),
22630        );
22631    }
22632
22633    /// Returns a copy with the `PhyPARTID21` field set to the given value.
22634    pub const fn with_phypartid21(mut self, value: u16) -> Self {
22635        self.set_phypartid21(value);
22636        self
22637    }
22638
22639    /// Returns the value of the `PhyPARTID22` field.
22640    pub const fn phypartid22(self) -> u16 {
22641        ((self.bits() >> Self::PHYPARTID22_SHIFT) & 0b1111111111111111) as u16
22642    }
22643
22644    /// Sets the value of the `PhyPARTID22` field.
22645    pub const fn set_phypartid22(&mut self, value: u16) {
22646        let offset = Self::PHYPARTID22_SHIFT;
22647        assert!(value & (Self::PHYPARTID22_MASK as u16) == value);
22648        *self = Self::from_bits_retain(
22649            (self.bits() & !(Self::PHYPARTID22_MASK << offset)) | ((value as u64) << offset),
22650        );
22651    }
22652
22653    /// Returns a copy with the `PhyPARTID22` field set to the given value.
22654    pub const fn with_phypartid22(mut self, value: u16) -> Self {
22655        self.set_phypartid22(value);
22656        self
22657    }
22658
22659    /// Returns the value of the `PhyPARTID23` field.
22660    pub const fn phypartid23(self) -> u16 {
22661        ((self.bits() >> Self::PHYPARTID23_SHIFT) & 0b1111111111111111) as u16
22662    }
22663
22664    /// Sets the value of the `PhyPARTID23` field.
22665    pub const fn set_phypartid23(&mut self, value: u16) {
22666        let offset = Self::PHYPARTID23_SHIFT;
22667        assert!(value & (Self::PHYPARTID23_MASK as u16) == value);
22668        *self = Self::from_bits_retain(
22669            (self.bits() & !(Self::PHYPARTID23_MASK << offset)) | ((value as u64) << offset),
22670        );
22671    }
22672
22673    /// Returns a copy with the `PhyPARTID23` field set to the given value.
22674    pub const fn with_phypartid23(mut self, value: u16) -> Self {
22675        self.set_phypartid23(value);
22676        self
22677    }
22678}
22679
22680#[cfg(feature = "el2")]
22681bitflags! {
22682    /// `MPAMVPM6_EL2` system register value.
22683    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22684    #[repr(transparent)]
22685    pub struct Mpamvpm6El2: u64 {
22686    }
22687}
22688
22689#[cfg(feature = "el2")]
22690impl Mpamvpm6El2 {
22691    /// Offset of the `PhyPARTID24` field.
22692    pub const PHYPARTID24_SHIFT: u32 = 0;
22693    /// Mask for the `PhyPARTID24` field.
22694    pub const PHYPARTID24_MASK: u64 = 0b1111111111111111;
22695    /// Offset of the `PhyPARTID25` field.
22696    pub const PHYPARTID25_SHIFT: u32 = 16;
22697    /// Mask for the `PhyPARTID25` field.
22698    pub const PHYPARTID25_MASK: u64 = 0b1111111111111111;
22699    /// Offset of the `PhyPARTID26` field.
22700    pub const PHYPARTID26_SHIFT: u32 = 32;
22701    /// Mask for the `PhyPARTID26` field.
22702    pub const PHYPARTID26_MASK: u64 = 0b1111111111111111;
22703    /// Offset of the `PhyPARTID27` field.
22704    pub const PHYPARTID27_SHIFT: u32 = 48;
22705    /// Mask for the `PhyPARTID27` field.
22706    pub const PHYPARTID27_MASK: u64 = 0b1111111111111111;
22707
22708    /// Returns the value of the `PhyPARTID24` field.
22709    pub const fn phypartid24(self) -> u16 {
22710        ((self.bits() >> Self::PHYPARTID24_SHIFT) & 0b1111111111111111) as u16
22711    }
22712
22713    /// Sets the value of the `PhyPARTID24` field.
22714    pub const fn set_phypartid24(&mut self, value: u16) {
22715        let offset = Self::PHYPARTID24_SHIFT;
22716        assert!(value & (Self::PHYPARTID24_MASK as u16) == value);
22717        *self = Self::from_bits_retain(
22718            (self.bits() & !(Self::PHYPARTID24_MASK << offset)) | ((value as u64) << offset),
22719        );
22720    }
22721
22722    /// Returns a copy with the `PhyPARTID24` field set to the given value.
22723    pub const fn with_phypartid24(mut self, value: u16) -> Self {
22724        self.set_phypartid24(value);
22725        self
22726    }
22727
22728    /// Returns the value of the `PhyPARTID25` field.
22729    pub const fn phypartid25(self) -> u16 {
22730        ((self.bits() >> Self::PHYPARTID25_SHIFT) & 0b1111111111111111) as u16
22731    }
22732
22733    /// Sets the value of the `PhyPARTID25` field.
22734    pub const fn set_phypartid25(&mut self, value: u16) {
22735        let offset = Self::PHYPARTID25_SHIFT;
22736        assert!(value & (Self::PHYPARTID25_MASK as u16) == value);
22737        *self = Self::from_bits_retain(
22738            (self.bits() & !(Self::PHYPARTID25_MASK << offset)) | ((value as u64) << offset),
22739        );
22740    }
22741
22742    /// Returns a copy with the `PhyPARTID25` field set to the given value.
22743    pub const fn with_phypartid25(mut self, value: u16) -> Self {
22744        self.set_phypartid25(value);
22745        self
22746    }
22747
22748    /// Returns the value of the `PhyPARTID26` field.
22749    pub const fn phypartid26(self) -> u16 {
22750        ((self.bits() >> Self::PHYPARTID26_SHIFT) & 0b1111111111111111) as u16
22751    }
22752
22753    /// Sets the value of the `PhyPARTID26` field.
22754    pub const fn set_phypartid26(&mut self, value: u16) {
22755        let offset = Self::PHYPARTID26_SHIFT;
22756        assert!(value & (Self::PHYPARTID26_MASK as u16) == value);
22757        *self = Self::from_bits_retain(
22758            (self.bits() & !(Self::PHYPARTID26_MASK << offset)) | ((value as u64) << offset),
22759        );
22760    }
22761
22762    /// Returns a copy with the `PhyPARTID26` field set to the given value.
22763    pub const fn with_phypartid26(mut self, value: u16) -> Self {
22764        self.set_phypartid26(value);
22765        self
22766    }
22767
22768    /// Returns the value of the `PhyPARTID27` field.
22769    pub const fn phypartid27(self) -> u16 {
22770        ((self.bits() >> Self::PHYPARTID27_SHIFT) & 0b1111111111111111) as u16
22771    }
22772
22773    /// Sets the value of the `PhyPARTID27` field.
22774    pub const fn set_phypartid27(&mut self, value: u16) {
22775        let offset = Self::PHYPARTID27_SHIFT;
22776        assert!(value & (Self::PHYPARTID27_MASK as u16) == value);
22777        *self = Self::from_bits_retain(
22778            (self.bits() & !(Self::PHYPARTID27_MASK << offset)) | ((value as u64) << offset),
22779        );
22780    }
22781
22782    /// Returns a copy with the `PhyPARTID27` field set to the given value.
22783    pub const fn with_phypartid27(mut self, value: u16) -> Self {
22784        self.set_phypartid27(value);
22785        self
22786    }
22787}
22788
22789#[cfg(feature = "el2")]
22790bitflags! {
22791    /// `MPAMVPM7_EL2` system register value.
22792    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22793    #[repr(transparent)]
22794    pub struct Mpamvpm7El2: u64 {
22795    }
22796}
22797
22798#[cfg(feature = "el2")]
22799impl Mpamvpm7El2 {
22800    /// Offset of the `PhyPARTID28` field.
22801    pub const PHYPARTID28_SHIFT: u32 = 0;
22802    /// Mask for the `PhyPARTID28` field.
22803    pub const PHYPARTID28_MASK: u64 = 0b1111111111111111;
22804    /// Offset of the `PhyPARTID29` field.
22805    pub const PHYPARTID29_SHIFT: u32 = 16;
22806    /// Mask for the `PhyPARTID29` field.
22807    pub const PHYPARTID29_MASK: u64 = 0b1111111111111111;
22808    /// Offset of the `PhyPARTID30` field.
22809    pub const PHYPARTID30_SHIFT: u32 = 32;
22810    /// Mask for the `PhyPARTID30` field.
22811    pub const PHYPARTID30_MASK: u64 = 0b1111111111111111;
22812    /// Offset of the `PhyPARTID31` field.
22813    pub const PHYPARTID31_SHIFT: u32 = 48;
22814    /// Mask for the `PhyPARTID31` field.
22815    pub const PHYPARTID31_MASK: u64 = 0b1111111111111111;
22816
22817    /// Returns the value of the `PhyPARTID28` field.
22818    pub const fn phypartid28(self) -> u16 {
22819        ((self.bits() >> Self::PHYPARTID28_SHIFT) & 0b1111111111111111) as u16
22820    }
22821
22822    /// Sets the value of the `PhyPARTID28` field.
22823    pub const fn set_phypartid28(&mut self, value: u16) {
22824        let offset = Self::PHYPARTID28_SHIFT;
22825        assert!(value & (Self::PHYPARTID28_MASK as u16) == value);
22826        *self = Self::from_bits_retain(
22827            (self.bits() & !(Self::PHYPARTID28_MASK << offset)) | ((value as u64) << offset),
22828        );
22829    }
22830
22831    /// Returns a copy with the `PhyPARTID28` field set to the given value.
22832    pub const fn with_phypartid28(mut self, value: u16) -> Self {
22833        self.set_phypartid28(value);
22834        self
22835    }
22836
22837    /// Returns the value of the `PhyPARTID29` field.
22838    pub const fn phypartid29(self) -> u16 {
22839        ((self.bits() >> Self::PHYPARTID29_SHIFT) & 0b1111111111111111) as u16
22840    }
22841
22842    /// Sets the value of the `PhyPARTID29` field.
22843    pub const fn set_phypartid29(&mut self, value: u16) {
22844        let offset = Self::PHYPARTID29_SHIFT;
22845        assert!(value & (Self::PHYPARTID29_MASK as u16) == value);
22846        *self = Self::from_bits_retain(
22847            (self.bits() & !(Self::PHYPARTID29_MASK << offset)) | ((value as u64) << offset),
22848        );
22849    }
22850
22851    /// Returns a copy with the `PhyPARTID29` field set to the given value.
22852    pub const fn with_phypartid29(mut self, value: u16) -> Self {
22853        self.set_phypartid29(value);
22854        self
22855    }
22856
22857    /// Returns the value of the `PhyPARTID30` field.
22858    pub const fn phypartid30(self) -> u16 {
22859        ((self.bits() >> Self::PHYPARTID30_SHIFT) & 0b1111111111111111) as u16
22860    }
22861
22862    /// Sets the value of the `PhyPARTID30` field.
22863    pub const fn set_phypartid30(&mut self, value: u16) {
22864        let offset = Self::PHYPARTID30_SHIFT;
22865        assert!(value & (Self::PHYPARTID30_MASK as u16) == value);
22866        *self = Self::from_bits_retain(
22867            (self.bits() & !(Self::PHYPARTID30_MASK << offset)) | ((value as u64) << offset),
22868        );
22869    }
22870
22871    /// Returns a copy with the `PhyPARTID30` field set to the given value.
22872    pub const fn with_phypartid30(mut self, value: u16) -> Self {
22873        self.set_phypartid30(value);
22874        self
22875    }
22876
22877    /// Returns the value of the `PhyPARTID31` field.
22878    pub const fn phypartid31(self) -> u16 {
22879        ((self.bits() >> Self::PHYPARTID31_SHIFT) & 0b1111111111111111) as u16
22880    }
22881
22882    /// Sets the value of the `PhyPARTID31` field.
22883    pub const fn set_phypartid31(&mut self, value: u16) {
22884        let offset = Self::PHYPARTID31_SHIFT;
22885        assert!(value & (Self::PHYPARTID31_MASK as u16) == value);
22886        *self = Self::from_bits_retain(
22887            (self.bits() & !(Self::PHYPARTID31_MASK << offset)) | ((value as u64) << offset),
22888        );
22889    }
22890
22891    /// Returns a copy with the `PhyPARTID31` field set to the given value.
22892    pub const fn with_phypartid31(mut self, value: u16) -> Self {
22893        self.set_phypartid31(value);
22894        self
22895    }
22896}
22897
22898#[cfg(feature = "el2")]
22899bitflags! {
22900    /// `MPAMVPMV_EL2` system register value.
22901    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22902    #[repr(transparent)]
22903    pub struct MpamvpmvEl2: u64 {
22904        /// `VPM_V<m>` bit 0.
22905        const VPM_V0 = 1 << 0;
22906        /// `VPM_V<m>` bit 1.
22907        const VPM_V1 = 1 << 1;
22908        /// `VPM_V<m>` bit 2.
22909        const VPM_V2 = 1 << 2;
22910        /// `VPM_V<m>` bit 3.
22911        const VPM_V3 = 1 << 3;
22912        /// `VPM_V<m>` bit 4.
22913        const VPM_V4 = 1 << 4;
22914        /// `VPM_V<m>` bit 5.
22915        const VPM_V5 = 1 << 5;
22916        /// `VPM_V<m>` bit 6.
22917        const VPM_V6 = 1 << 6;
22918        /// `VPM_V<m>` bit 7.
22919        const VPM_V7 = 1 << 7;
22920        /// `VPM_V<m>` bit 8.
22921        const VPM_V8 = 1 << 8;
22922        /// `VPM_V<m>` bit 9.
22923        const VPM_V9 = 1 << 9;
22924        /// `VPM_V<m>` bit 10.
22925        const VPM_V10 = 1 << 10;
22926        /// `VPM_V<m>` bit 11.
22927        const VPM_V11 = 1 << 11;
22928        /// `VPM_V<m>` bit 12.
22929        const VPM_V12 = 1 << 12;
22930        /// `VPM_V<m>` bit 13.
22931        const VPM_V13 = 1 << 13;
22932        /// `VPM_V<m>` bit 14.
22933        const VPM_V14 = 1 << 14;
22934        /// `VPM_V<m>` bit 15.
22935        const VPM_V15 = 1 << 15;
22936        /// `VPM_V<m>` bit 16.
22937        const VPM_V16 = 1 << 16;
22938        /// `VPM_V<m>` bit 17.
22939        const VPM_V17 = 1 << 17;
22940        /// `VPM_V<m>` bit 18.
22941        const VPM_V18 = 1 << 18;
22942        /// `VPM_V<m>` bit 19.
22943        const VPM_V19 = 1 << 19;
22944        /// `VPM_V<m>` bit 20.
22945        const VPM_V20 = 1 << 20;
22946        /// `VPM_V<m>` bit 21.
22947        const VPM_V21 = 1 << 21;
22948        /// `VPM_V<m>` bit 22.
22949        const VPM_V22 = 1 << 22;
22950        /// `VPM_V<m>` bit 23.
22951        const VPM_V23 = 1 << 23;
22952        /// `VPM_V<m>` bit 24.
22953        const VPM_V24 = 1 << 24;
22954        /// `VPM_V<m>` bit 25.
22955        const VPM_V25 = 1 << 25;
22956        /// `VPM_V<m>` bit 26.
22957        const VPM_V26 = 1 << 26;
22958        /// `VPM_V<m>` bit 27.
22959        const VPM_V27 = 1 << 27;
22960        /// `VPM_V<m>` bit 28.
22961        const VPM_V28 = 1 << 28;
22962        /// `VPM_V<m>` bit 29.
22963        const VPM_V29 = 1 << 29;
22964        /// `VPM_V<m>` bit 30.
22965        const VPM_V30 = 1 << 30;
22966        /// `VPM_V<m>` bit 31.
22967        const VPM_V31 = 1 << 31;
22968    }
22969}
22970
22971#[cfg(feature = "el2")]
22972impl MpamvpmvEl2 {
22973    /// Offset of the `VPM_V<m>` field.
22974    pub const VPM_V_SHIFT: u32 = 0;
22975}
22976
22977bitflags! {
22978    /// `MPIDR` system register value.
22979    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
22980    #[repr(transparent)]
22981    pub struct Mpidr: u32 {
22982        /// `MT` bit.
22983        const MT = 1 << 24;
22984        /// `U` bit.
22985        const U = 1 << 30;
22986        /// `M` bit.
22987        const M = 1 << 31;
22988    }
22989}
22990
22991impl Mpidr {
22992    /// Offset of the `Aff0` field.
22993    pub const AFF0_SHIFT: u32 = 0;
22994    /// Mask for the `Aff0` field.
22995    pub const AFF0_MASK: u32 = 0b11111111;
22996    /// Offset of the `Aff1` field.
22997    pub const AFF1_SHIFT: u32 = 8;
22998    /// Mask for the `Aff1` field.
22999    pub const AFF1_MASK: u32 = 0b11111111;
23000    /// Offset of the `Aff2` field.
23001    pub const AFF2_SHIFT: u32 = 16;
23002    /// Mask for the `Aff2` field.
23003    pub const AFF2_MASK: u32 = 0b11111111;
23004    /// Offset of the `MT` field.
23005    pub const MT_SHIFT: u32 = 24;
23006    /// Offset of the `U` field.
23007    pub const U_SHIFT: u32 = 30;
23008    /// Offset of the `M` field.
23009    pub const M_SHIFT: u32 = 31;
23010
23011    /// Returns the value of the `Aff0` field.
23012    pub const fn aff0(self) -> u8 {
23013        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
23014    }
23015
23016    /// Sets the value of the `Aff0` field.
23017    pub const fn set_aff0(&mut self, value: u8) {
23018        let offset = Self::AFF0_SHIFT;
23019        assert!(value & (Self::AFF0_MASK as u8) == value);
23020        *self = Self::from_bits_retain(
23021            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u32) << offset),
23022        );
23023    }
23024
23025    /// Returns a copy with the `Aff0` field set to the given value.
23026    pub const fn with_aff0(mut self, value: u8) -> Self {
23027        self.set_aff0(value);
23028        self
23029    }
23030
23031    /// Returns the value of the `Aff1` field.
23032    pub const fn aff1(self) -> u8 {
23033        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
23034    }
23035
23036    /// Sets the value of the `Aff1` field.
23037    pub const fn set_aff1(&mut self, value: u8) {
23038        let offset = Self::AFF1_SHIFT;
23039        assert!(value & (Self::AFF1_MASK as u8) == value);
23040        *self = Self::from_bits_retain(
23041            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u32) << offset),
23042        );
23043    }
23044
23045    /// Returns a copy with the `Aff1` field set to the given value.
23046    pub const fn with_aff1(mut self, value: u8) -> Self {
23047        self.set_aff1(value);
23048        self
23049    }
23050
23051    /// Returns the value of the `Aff2` field.
23052    pub const fn aff2(self) -> u8 {
23053        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
23054    }
23055
23056    /// Sets the value of the `Aff2` field.
23057    pub const fn set_aff2(&mut self, value: u8) {
23058        let offset = Self::AFF2_SHIFT;
23059        assert!(value & (Self::AFF2_MASK as u8) == value);
23060        *self = Self::from_bits_retain(
23061            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u32) << offset),
23062        );
23063    }
23064
23065    /// Returns a copy with the `Aff2` field set to the given value.
23066    pub const fn with_aff2(mut self, value: u8) -> Self {
23067        self.set_aff2(value);
23068        self
23069    }
23070}
23071
23072#[cfg(feature = "el1")]
23073bitflags! {
23074    /// `MPIDR_EL1` system register value.
23075    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23076    #[repr(transparent)]
23077    pub struct MpidrEl1: u64 {
23078        /// RES1 bits in the `MPIDR_EL1` register.
23079        const RES1 = 0b10000000000000000000000000000000;
23080        /// `MT` bit.
23081        const MT = 1 << 24;
23082        /// `U` bit.
23083        const U = 1 << 30;
23084    }
23085}
23086
23087#[cfg(feature = "el1")]
23088impl MpidrEl1 {
23089    /// Offset of the `Aff0` field.
23090    pub const AFF0_SHIFT: u32 = 0;
23091    /// Mask for the `Aff0` field.
23092    pub const AFF0_MASK: u64 = 0b11111111;
23093    /// Offset of the `Aff1` field.
23094    pub const AFF1_SHIFT: u32 = 8;
23095    /// Mask for the `Aff1` field.
23096    pub const AFF1_MASK: u64 = 0b11111111;
23097    /// Offset of the `Aff2` field.
23098    pub const AFF2_SHIFT: u32 = 16;
23099    /// Mask for the `Aff2` field.
23100    pub const AFF2_MASK: u64 = 0b11111111;
23101    /// Offset of the `MT` field.
23102    pub const MT_SHIFT: u32 = 24;
23103    /// Offset of the `U` field.
23104    pub const U_SHIFT: u32 = 30;
23105    /// Offset of the `Aff3` field.
23106    pub const AFF3_SHIFT: u32 = 32;
23107    /// Mask for the `Aff3` field.
23108    pub const AFF3_MASK: u64 = 0b11111111;
23109
23110    /// Returns the value of the `Aff0` field.
23111    pub const fn aff0(self) -> u8 {
23112        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
23113    }
23114
23115    /// Sets the value of the `Aff0` field.
23116    pub const fn set_aff0(&mut self, value: u8) {
23117        let offset = Self::AFF0_SHIFT;
23118        assert!(value & (Self::AFF0_MASK as u8) == value);
23119        *self = Self::from_bits_retain(
23120            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u64) << offset),
23121        );
23122    }
23123
23124    /// Returns a copy with the `Aff0` field set to the given value.
23125    pub const fn with_aff0(mut self, value: u8) -> Self {
23126        self.set_aff0(value);
23127        self
23128    }
23129
23130    /// Returns the value of the `Aff1` field.
23131    pub const fn aff1(self) -> u8 {
23132        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
23133    }
23134
23135    /// Sets the value of the `Aff1` field.
23136    pub const fn set_aff1(&mut self, value: u8) {
23137        let offset = Self::AFF1_SHIFT;
23138        assert!(value & (Self::AFF1_MASK as u8) == value);
23139        *self = Self::from_bits_retain(
23140            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
23141        );
23142    }
23143
23144    /// Returns a copy with the `Aff1` field set to the given value.
23145    pub const fn with_aff1(mut self, value: u8) -> Self {
23146        self.set_aff1(value);
23147        self
23148    }
23149
23150    /// Returns the value of the `Aff2` field.
23151    pub const fn aff2(self) -> u8 {
23152        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
23153    }
23154
23155    /// Sets the value of the `Aff2` field.
23156    pub const fn set_aff2(&mut self, value: u8) {
23157        let offset = Self::AFF2_SHIFT;
23158        assert!(value & (Self::AFF2_MASK as u8) == value);
23159        *self = Self::from_bits_retain(
23160            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
23161        );
23162    }
23163
23164    /// Returns a copy with the `Aff2` field set to the given value.
23165    pub const fn with_aff2(mut self, value: u8) -> Self {
23166        self.set_aff2(value);
23167        self
23168    }
23169
23170    /// Returns the value of the `Aff3` field.
23171    pub const fn aff3(self) -> u8 {
23172        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
23173    }
23174
23175    /// Sets the value of the `Aff3` field.
23176    pub const fn set_aff3(&mut self, value: u8) {
23177        let offset = Self::AFF3_SHIFT;
23178        assert!(value & (Self::AFF3_MASK as u8) == value);
23179        *self = Self::from_bits_retain(
23180            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
23181        );
23182    }
23183
23184    /// Returns a copy with the `Aff3` field set to the given value.
23185    pub const fn with_aff3(mut self, value: u8) -> Self {
23186        self.set_aff3(value);
23187        self
23188    }
23189}
23190
23191bitflags! {
23192    /// `MVBAR` system register value.
23193    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23194    #[repr(transparent)]
23195    pub struct Mvbar: u32 {
23196    }
23197}
23198
23199impl Mvbar {
23200    /// Offset of the `Reserved` field.
23201    pub const RESERVED_SHIFT: u32 = 0;
23202    /// Mask for the `Reserved` field.
23203    pub const RESERVED_MASK: u32 = 0b11111;
23204    /// Offset of the `VBA` field.
23205    pub const VBA_SHIFT: u32 = 5;
23206    /// Mask for the `VBA` field.
23207    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
23208
23209    /// Returns the value of the `Reserved` field.
23210    pub const fn reserved(self) -> u8 {
23211        ((self.bits() >> Self::RESERVED_SHIFT) & 0b11111) as u8
23212    }
23213
23214    /// Sets the value of the `Reserved` field.
23215    pub const fn set_reserved(&mut self, value: u8) {
23216        let offset = Self::RESERVED_SHIFT;
23217        assert!(value & (Self::RESERVED_MASK as u8) == value);
23218        *self = Self::from_bits_retain(
23219            (self.bits() & !(Self::RESERVED_MASK << offset)) | ((value as u32) << offset),
23220        );
23221    }
23222
23223    /// Returns a copy with the `Reserved` field set to the given value.
23224    pub const fn with_reserved(mut self, value: u8) -> Self {
23225        self.set_reserved(value);
23226        self
23227    }
23228
23229    /// Returns the value of the `VBA` field.
23230    pub const fn vba(self) -> u32 {
23231        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
23232    }
23233
23234    /// Sets the value of the `VBA` field.
23235    pub const fn set_vba(&mut self, value: u32) {
23236        let offset = Self::VBA_SHIFT;
23237        assert!(value & (Self::VBA_MASK as u32) == value);
23238        *self = Self::from_bits_retain(
23239            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
23240        );
23241    }
23242
23243    /// Returns a copy with the `VBA` field set to the given value.
23244    pub const fn with_vba(mut self, value: u32) -> Self {
23245        self.set_vba(value);
23246        self
23247    }
23248}
23249
23250bitflags! {
23251    /// `NMRR` system register value.
23252    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23253    #[repr(transparent)]
23254    pub struct Nmrr: u32 {
23255    }
23256}
23257
23258impl Nmrr {
23259    /// Offset of the `IR<n>` field.
23260    pub const IR_SHIFT: u32 = 0;
23261    /// Mask for the `IR<n>` field.
23262    pub const IR_MASK: u32 = 0b11;
23263    /// Offset of the `OR<n>` field.
23264    pub const OR_SHIFT: u32 = 16;
23265    /// Mask for the `OR<n>` field.
23266    pub const OR_MASK: u32 = 0b11;
23267
23268    /// Returns the value of the given `IR<n>` field.
23269    pub const fn ir(self, n: u32) -> u8 {
23270        assert!(n < 8);
23271        ((self.bits() >> (Self::IR_SHIFT + (n - 0) * 2)) & 0b11) as u8
23272    }
23273
23274    /// Sets the value of the `IR<n>` field.
23275    pub const fn set_ir(&mut self, n: u32, value: u8) {
23276        assert!(n < 8);
23277        let offset = Self::IR_SHIFT + (n - 0) * 2;
23278        assert!(value & (Self::IR_MASK as u8) == value);
23279        *self = Self::from_bits_retain(
23280            (self.bits() & !(Self::IR_MASK << offset)) | ((value as u32) << offset),
23281        );
23282    }
23283
23284    /// Returns a copy with the `IR<n>` field set to the given value.
23285    pub const fn with_ir(mut self, n: u32, value: u8) -> Self {
23286        self.set_ir(n, value);
23287        self
23288    }
23289
23290    /// Returns the value of the given `OR<n>` field.
23291    pub const fn or(self, n: u32) -> u8 {
23292        assert!(n < 8);
23293        ((self.bits() >> (Self::OR_SHIFT + (n - 0) * 2)) & 0b11) as u8
23294    }
23295
23296    /// Sets the value of the `OR<n>` field.
23297    pub const fn set_or(&mut self, n: u32, value: u8) {
23298        assert!(n < 8);
23299        let offset = Self::OR_SHIFT + (n - 0) * 2;
23300        assert!(value & (Self::OR_MASK as u8) == value);
23301        *self = Self::from_bits_retain(
23302            (self.bits() & !(Self::OR_MASK << offset)) | ((value as u32) << offset),
23303        );
23304    }
23305
23306    /// Returns a copy with the `OR<n>` field set to the given value.
23307    pub const fn with_or(mut self, n: u32, value: u8) -> Self {
23308        self.set_or(n, value);
23309        self
23310    }
23311}
23312
23313bitflags! {
23314    /// `NSACR` system register value.
23315    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23316    #[repr(transparent)]
23317    pub struct Nsacr: u32 {
23318        /// `cp10` bit.
23319        const CP10 = 1 << 10;
23320        /// `cp11` bit.
23321        const CP11 = 1 << 11;
23322        /// `NSASEDIS` bit.
23323        const NSASEDIS = 1 << 15;
23324        /// `NSTRCDIS` bit.
23325        const NSTRCDIS = 1 << 20;
23326    }
23327}
23328
23329impl Nsacr {
23330    /// Offset of the `cp10` field.
23331    pub const CP10_SHIFT: u32 = 10;
23332    /// Offset of the `cp11` field.
23333    pub const CP11_SHIFT: u32 = 11;
23334    /// Offset of the `NSASEDIS` field.
23335    pub const NSASEDIS_SHIFT: u32 = 15;
23336    /// Offset of the `NSTRCDIS` field.
23337    pub const NSTRCDIS_SHIFT: u32 = 20;
23338}
23339
23340bitflags! {
23341    /// `PAR` system register value.
23342    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23343    #[repr(transparent)]
23344    pub struct Par: u64 {
23345        /// `F` bit.
23346        const F = 1 << 0;
23347        /// `SS` bit.
23348        const SS = 1 << 1;
23349        /// `FS[5]` bit.
23350        const FS_5 = 1 << 6;
23351        /// `S2WLK` bit.
23352        const S2WLK = 1 << 8;
23353        /// `FSTAGE` bit.
23354        const FSTAGE = 1 << 9;
23355        /// `NS` bit.
23356        const NS = 1 << 9;
23357        /// `NOS` bit.
23358        const NOS = 1 << 10;
23359        /// `LPAE` bit.
23360        const LPAE = 1 << 11;
23361    }
23362}
23363
23364impl Par {
23365    /// Offset of the `F` field.
23366    pub const F_SHIFT: u32 = 0;
23367    /// Offset of the `FST` field.
23368    pub const FST_SHIFT: u32 = 1;
23369    /// Mask for the `FST` field.
23370    pub const FST_MASK: u64 = 0b111111;
23371    /// Offset of the `FS[4:0]` field.
23372    pub const FS_4_0_SHIFT: u32 = 1;
23373    /// Mask for the `FS[4:0]` field.
23374    pub const FS_4_0_MASK: u64 = 0b11111;
23375    /// Offset of the `SS` field.
23376    pub const SS_SHIFT: u32 = 1;
23377    /// Offset of the `Outer[1:0]` field.
23378    pub const OUTER_1_0_SHIFT: u32 = 2;
23379    /// Mask for the `Outer[1:0]` field.
23380    pub const OUTER_1_0_MASK: u64 = 0b11;
23381    /// Offset of the `Inner[2:0]` field.
23382    pub const INNER_2_0_SHIFT: u32 = 4;
23383    /// Mask for the `Inner[2:0]` field.
23384    pub const INNER_2_0_MASK: u64 = 0b111;
23385    /// Offset of the `FS[5]` field.
23386    pub const FS_5_SHIFT: u32 = 6;
23387    /// Offset of the `S2WLK` field.
23388    pub const S2WLK_SHIFT: u32 = 8;
23389    /// Offset of the `FSTAGE` field.
23390    pub const FSTAGE_SHIFT: u32 = 9;
23391    /// Offset of the `NS` field.
23392    pub const NS_SHIFT: u32 = 9;
23393    /// Offset of the `NOS` field.
23394    pub const NOS_SHIFT: u32 = 10;
23395    /// Offset of the `LPAE` field.
23396    pub const LPAE_SHIFT: u32 = 11;
23397    /// Offset of the `ATTR` field.
23398    pub const ATTR_SHIFT: u32 = 56;
23399    /// Mask for the `ATTR` field.
23400    pub const ATTR_MASK: u64 = 0b11111111;
23401
23402    /// Returns the value of the `FST` field.
23403    pub const fn fst(self) -> u8 {
23404        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
23405    }
23406
23407    /// Sets the value of the `FST` field.
23408    pub const fn set_fst(&mut self, value: u8) {
23409        let offset = Self::FST_SHIFT;
23410        assert!(value & (Self::FST_MASK as u8) == value);
23411        *self = Self::from_bits_retain(
23412            (self.bits() & !(Self::FST_MASK << offset)) | ((value as u64) << offset),
23413        );
23414    }
23415
23416    /// Returns a copy with the `FST` field set to the given value.
23417    pub const fn with_fst(mut self, value: u8) -> Self {
23418        self.set_fst(value);
23419        self
23420    }
23421
23422    /// Returns the value of the `FS[4:0]` field.
23423    pub const fn fs_4_0(self) -> u8 {
23424        ((self.bits() >> Self::FS_4_0_SHIFT) & 0b11111) as u8
23425    }
23426
23427    /// Sets the value of the `FS[4:0]` field.
23428    pub const fn set_fs_4_0(&mut self, value: u8) {
23429        let offset = Self::FS_4_0_SHIFT;
23430        assert!(value & (Self::FS_4_0_MASK as u8) == value);
23431        *self = Self::from_bits_retain(
23432            (self.bits() & !(Self::FS_4_0_MASK << offset)) | ((value as u64) << offset),
23433        );
23434    }
23435
23436    /// Returns a copy with the `FS[4:0]` field set to the given value.
23437    pub const fn with_fs_4_0(mut self, value: u8) -> Self {
23438        self.set_fs_4_0(value);
23439        self
23440    }
23441
23442    /// Returns the value of the `Outer[1:0]` field.
23443    pub const fn outer_1_0(self) -> u8 {
23444        ((self.bits() >> Self::OUTER_1_0_SHIFT) & 0b11) as u8
23445    }
23446
23447    /// Sets the value of the `Outer[1:0]` field.
23448    pub const fn set_outer_1_0(&mut self, value: u8) {
23449        let offset = Self::OUTER_1_0_SHIFT;
23450        assert!(value & (Self::OUTER_1_0_MASK as u8) == value);
23451        *self = Self::from_bits_retain(
23452            (self.bits() & !(Self::OUTER_1_0_MASK << offset)) | ((value as u64) << offset),
23453        );
23454    }
23455
23456    /// Returns a copy with the `Outer[1:0]` field set to the given value.
23457    pub const fn with_outer_1_0(mut self, value: u8) -> Self {
23458        self.set_outer_1_0(value);
23459        self
23460    }
23461
23462    /// Returns the value of the `Inner[2:0]` field.
23463    pub const fn inner_2_0(self) -> u8 {
23464        ((self.bits() >> Self::INNER_2_0_SHIFT) & 0b111) as u8
23465    }
23466
23467    /// Sets the value of the `Inner[2:0]` field.
23468    pub const fn set_inner_2_0(&mut self, value: u8) {
23469        let offset = Self::INNER_2_0_SHIFT;
23470        assert!(value & (Self::INNER_2_0_MASK as u8) == value);
23471        *self = Self::from_bits_retain(
23472            (self.bits() & !(Self::INNER_2_0_MASK << offset)) | ((value as u64) << offset),
23473        );
23474    }
23475
23476    /// Returns a copy with the `Inner[2:0]` field set to the given value.
23477    pub const fn with_inner_2_0(mut self, value: u8) -> Self {
23478        self.set_inner_2_0(value);
23479        self
23480    }
23481
23482    /// Returns the value of the `ATTR` field.
23483    pub const fn attr(self) -> u8 {
23484        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
23485    }
23486
23487    /// Sets the value of the `ATTR` field.
23488    pub const fn set_attr(&mut self, value: u8) {
23489        let offset = Self::ATTR_SHIFT;
23490        assert!(value & (Self::ATTR_MASK as u8) == value);
23491        *self = Self::from_bits_retain(
23492            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
23493        );
23494    }
23495
23496    /// Returns a copy with the `ATTR` field set to the given value.
23497    pub const fn with_attr(mut self, value: u8) -> Self {
23498        self.set_attr(value);
23499        self
23500    }
23501}
23502
23503#[cfg(feature = "el1")]
23504bitflags! {
23505    /// `PAR_EL1` system register value.
23506    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23507    #[repr(transparent)]
23508    pub struct ParEl1: u64 {
23509        /// RES1 bits in the `PAR_EL1` register.
23510        const RES1 = 0b100000000000;
23511        /// `F` bit.
23512        const F = 1 << 0;
23513        /// `PTW` bit.
23514        const PTW = 1 << 8;
23515        /// `NS` bit.
23516        const NS = 1 << 9;
23517        /// `S` bit.
23518        const S = 1 << 9;
23519        /// `NSE` bit.
23520        const NSE = 1 << 11;
23521        /// `AssuredOnly` bit.
23522        const ASSUREDONLY = 1 << 12;
23523        /// `TopLevel` bit.
23524        const TOPLEVEL = 1 << 13;
23525        /// `Overlay` bit.
23526        const OVERLAY = 1 << 14;
23527        /// `DirtyBit` bit.
23528        const DIRTYBIT = 1 << 15;
23529    }
23530}
23531
23532#[cfg(feature = "el1")]
23533impl ParEl1 {
23534    /// Offset of the `F` field.
23535    pub const F_SHIFT: u32 = 0;
23536    /// Offset of the `FST` field.
23537    pub const FST_SHIFT: u32 = 1;
23538    /// Mask for the `FST` field.
23539    pub const FST_MASK: u64 = 0b111111;
23540    /// Offset of the `SH` field.
23541    pub const SH_SHIFT: u32 = 7;
23542    /// Mask for the `SH` field.
23543    pub const SH_MASK: u64 = 0b11;
23544    /// Offset of the `PTW` field.
23545    pub const PTW_SHIFT: u32 = 8;
23546    /// Offset of the `NS` field.
23547    pub const NS_SHIFT: u32 = 9;
23548    /// Offset of the `S` field.
23549    pub const S_SHIFT: u32 = 9;
23550    /// Offset of the `NSE` field.
23551    pub const NSE_SHIFT: u32 = 11;
23552    /// Offset of the `AssuredOnly` field.
23553    pub const ASSUREDONLY_SHIFT: u32 = 12;
23554    /// Offset of the `PA[47:12]` field.
23555    pub const PA_47_12_SHIFT: u32 = 12;
23556    /// Mask for the `PA[47:12]` field.
23557    pub const PA_47_12_MASK: u64 = 0b111111111111111111111111111111111111;
23558    /// Offset of the `TopLevel` field.
23559    pub const TOPLEVEL_SHIFT: u32 = 13;
23560    /// Offset of the `Overlay` field.
23561    pub const OVERLAY_SHIFT: u32 = 14;
23562    /// Offset of the `DirtyBit` field.
23563    pub const DIRTYBIT_SHIFT: u32 = 15;
23564    /// Offset of the `PA[51:48]` field.
23565    pub const PA_51_48_SHIFT: u32 = 48;
23566    /// Mask for the `PA[51:48]` field.
23567    pub const PA_51_48_MASK: u64 = 0b1111;
23568    /// Offset of the `ATTR` field.
23569    pub const ATTR_SHIFT: u32 = 56;
23570    /// Mask for the `ATTR` field.
23571    pub const ATTR_MASK: u64 = 0b11111111;
23572
23573    /// Returns the value of the `FST` field.
23574    pub const fn fst(self) -> u8 {
23575        ((self.bits() >> Self::FST_SHIFT) & 0b111111) as u8
23576    }
23577
23578    /// Sets the value of the `FST` field.
23579    pub const fn set_fst(&mut self, value: u8) {
23580        let offset = Self::FST_SHIFT;
23581        assert!(value & (Self::FST_MASK as u8) == value);
23582        *self = Self::from_bits_retain(
23583            (self.bits() & !(Self::FST_MASK << offset)) | ((value as u64) << offset),
23584        );
23585    }
23586
23587    /// Returns a copy with the `FST` field set to the given value.
23588    pub const fn with_fst(mut self, value: u8) -> Self {
23589        self.set_fst(value);
23590        self
23591    }
23592
23593    /// Returns the value of the `SH` field.
23594    pub const fn sh(self) -> u8 {
23595        ((self.bits() >> Self::SH_SHIFT) & 0b11) as u8
23596    }
23597
23598    /// Sets the value of the `SH` field.
23599    pub const fn set_sh(&mut self, value: u8) {
23600        let offset = Self::SH_SHIFT;
23601        assert!(value & (Self::SH_MASK as u8) == value);
23602        *self = Self::from_bits_retain(
23603            (self.bits() & !(Self::SH_MASK << offset)) | ((value as u64) << offset),
23604        );
23605    }
23606
23607    /// Returns a copy with the `SH` field set to the given value.
23608    pub const fn with_sh(mut self, value: u8) -> Self {
23609        self.set_sh(value);
23610        self
23611    }
23612
23613    /// Returns the value of the `PA[47:12]` field.
23614    pub const fn pa_47_12(self) -> u64 {
23615        ((self.bits() >> Self::PA_47_12_SHIFT) & 0b111111111111111111111111111111111111) as u64
23616    }
23617
23618    /// Sets the value of the `PA[47:12]` field.
23619    pub const fn set_pa_47_12(&mut self, value: u64) {
23620        let offset = Self::PA_47_12_SHIFT;
23621        assert!(value & (Self::PA_47_12_MASK as u64) == value);
23622        *self = Self::from_bits_retain(
23623            (self.bits() & !(Self::PA_47_12_MASK << offset)) | ((value as u64) << offset),
23624        );
23625    }
23626
23627    /// Returns a copy with the `PA[47:12]` field set to the given value.
23628    pub const fn with_pa_47_12(mut self, value: u64) -> Self {
23629        self.set_pa_47_12(value);
23630        self
23631    }
23632
23633    /// Returns the value of the `PA[51:48]` field.
23634    pub const fn pa_51_48(self) -> u8 {
23635        ((self.bits() >> Self::PA_51_48_SHIFT) & 0b1111) as u8
23636    }
23637
23638    /// Sets the value of the `PA[51:48]` field.
23639    pub const fn set_pa_51_48(&mut self, value: u8) {
23640        let offset = Self::PA_51_48_SHIFT;
23641        assert!(value & (Self::PA_51_48_MASK as u8) == value);
23642        *self = Self::from_bits_retain(
23643            (self.bits() & !(Self::PA_51_48_MASK << offset)) | ((value as u64) << offset),
23644        );
23645    }
23646
23647    /// Returns a copy with the `PA[51:48]` field set to the given value.
23648    pub const fn with_pa_51_48(mut self, value: u8) -> Self {
23649        self.set_pa_51_48(value);
23650        self
23651    }
23652
23653    /// Returns the value of the `ATTR` field.
23654    pub const fn attr(self) -> u8 {
23655        ((self.bits() >> Self::ATTR_SHIFT) & 0b11111111) as u8
23656    }
23657
23658    /// Sets the value of the `ATTR` field.
23659    pub const fn set_attr(&mut self, value: u8) {
23660        let offset = Self::ATTR_SHIFT;
23661        assert!(value & (Self::ATTR_MASK as u8) == value);
23662        *self = Self::from_bits_retain(
23663            (self.bits() & !(Self::ATTR_MASK << offset)) | ((value as u64) << offset),
23664        );
23665    }
23666
23667    /// Returns a copy with the `ATTR` field set to the given value.
23668    pub const fn with_attr(mut self, value: u8) -> Self {
23669        self.set_attr(value);
23670        self
23671    }
23672}
23673
23674bitflags! {
23675    /// `PMCCFILTR` system register value.
23676    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23677    #[repr(transparent)]
23678    pub struct Pmccfiltr: u32 {
23679        /// `RLU` bit.
23680        const RLU = 1 << 21;
23681        /// `NSH` bit.
23682        const NSH = 1 << 27;
23683        /// `NSU` bit.
23684        const NSU = 1 << 28;
23685        /// `NSK` bit.
23686        const NSK = 1 << 29;
23687        /// `U` bit.
23688        const U = 1 << 30;
23689        /// `P` bit.
23690        const P = 1 << 31;
23691    }
23692}
23693
23694impl Pmccfiltr {
23695    /// Offset of the `RLU` field.
23696    pub const RLU_SHIFT: u32 = 21;
23697    /// Offset of the `NSH` field.
23698    pub const NSH_SHIFT: u32 = 27;
23699    /// Offset of the `NSU` field.
23700    pub const NSU_SHIFT: u32 = 28;
23701    /// Offset of the `NSK` field.
23702    pub const NSK_SHIFT: u32 = 29;
23703    /// Offset of the `U` field.
23704    pub const U_SHIFT: u32 = 30;
23705    /// Offset of the `P` field.
23706    pub const P_SHIFT: u32 = 31;
23707}
23708
23709bitflags! {
23710    /// `PMCCNTR` system register value.
23711    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23712    #[repr(transparent)]
23713    pub struct Pmccntr: u64 {
23714    }
23715}
23716
23717impl Pmccntr {
23718    /// Offset of the `CCNT` field.
23719    pub const CCNT_SHIFT: u32 = 0;
23720    /// Mask for the `CCNT` field.
23721    pub const CCNT_MASK: u64 = 0b1111111111111111111111111111111111111111111111111111111111111111;
23722
23723    /// Returns the value of the `CCNT` field.
23724    pub const fn ccnt(self) -> u64 {
23725        ((self.bits() >> Self::CCNT_SHIFT)
23726            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
23727    }
23728
23729    /// Sets the value of the `CCNT` field.
23730    pub const fn set_ccnt(&mut self, value: u64) {
23731        let offset = Self::CCNT_SHIFT;
23732        assert!(value & (Self::CCNT_MASK as u64) == value);
23733        *self = Self::from_bits_retain(
23734            (self.bits() & !(Self::CCNT_MASK << offset)) | ((value as u64) << offset),
23735        );
23736    }
23737
23738    /// Returns a copy with the `CCNT` field set to the given value.
23739    pub const fn with_ccnt(mut self, value: u64) -> Self {
23740        self.set_ccnt(value);
23741        self
23742    }
23743}
23744
23745bitflags! {
23746    /// `PMCEID0` system register value.
23747    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23748    #[repr(transparent)]
23749    pub struct Pmceid0: u32 {
23750        /// `ID<n>` bit 0.
23751        const ID0 = 1 << 0;
23752        /// `ID<n>` bit 1.
23753        const ID1 = 1 << 1;
23754        /// `ID<n>` bit 2.
23755        const ID2 = 1 << 2;
23756        /// `ID<n>` bit 3.
23757        const ID3 = 1 << 3;
23758        /// `ID<n>` bit 4.
23759        const ID4 = 1 << 4;
23760        /// `ID<n>` bit 5.
23761        const ID5 = 1 << 5;
23762        /// `ID<n>` bit 6.
23763        const ID6 = 1 << 6;
23764        /// `ID<n>` bit 7.
23765        const ID7 = 1 << 7;
23766        /// `ID<n>` bit 8.
23767        const ID8 = 1 << 8;
23768        /// `ID<n>` bit 9.
23769        const ID9 = 1 << 9;
23770        /// `ID<n>` bit 10.
23771        const ID10 = 1 << 10;
23772        /// `ID<n>` bit 11.
23773        const ID11 = 1 << 11;
23774        /// `ID<n>` bit 12.
23775        const ID12 = 1 << 12;
23776        /// `ID<n>` bit 13.
23777        const ID13 = 1 << 13;
23778        /// `ID<n>` bit 14.
23779        const ID14 = 1 << 14;
23780        /// `ID<n>` bit 15.
23781        const ID15 = 1 << 15;
23782        /// `ID<n>` bit 16.
23783        const ID16 = 1 << 16;
23784        /// `ID<n>` bit 17.
23785        const ID17 = 1 << 17;
23786        /// `ID<n>` bit 18.
23787        const ID18 = 1 << 18;
23788        /// `ID<n>` bit 19.
23789        const ID19 = 1 << 19;
23790        /// `ID<n>` bit 20.
23791        const ID20 = 1 << 20;
23792        /// `ID<n>` bit 21.
23793        const ID21 = 1 << 21;
23794        /// `ID<n>` bit 22.
23795        const ID22 = 1 << 22;
23796        /// `ID<n>` bit 23.
23797        const ID23 = 1 << 23;
23798        /// `ID<n>` bit 24.
23799        const ID24 = 1 << 24;
23800        /// `ID<n>` bit 25.
23801        const ID25 = 1 << 25;
23802        /// `ID<n>` bit 26.
23803        const ID26 = 1 << 26;
23804        /// `ID<n>` bit 27.
23805        const ID27 = 1 << 27;
23806        /// `ID<n>` bit 28.
23807        const ID28 = 1 << 28;
23808        /// `ID<n>` bit 29.
23809        const ID29 = 1 << 29;
23810        /// `ID<n>` bit 30.
23811        const ID30 = 1 << 30;
23812        /// `ID<n>` bit 31.
23813        const ID31 = 1 << 31;
23814    }
23815}
23816
23817impl Pmceid0 {
23818    /// Offset of the `ID<n>` field.
23819    pub const ID_SHIFT: u32 = 0;
23820}
23821
23822bitflags! {
23823    /// `PMCEID1` system register value.
23824    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23825    #[repr(transparent)]
23826    pub struct Pmceid1: u32 {
23827        /// `ID<n>` bit 0.
23828        const ID0 = 1 << 0;
23829        /// `ID<n>` bit 1.
23830        const ID1 = 1 << 1;
23831        /// `ID<n>` bit 2.
23832        const ID2 = 1 << 2;
23833        /// `ID<n>` bit 3.
23834        const ID3 = 1 << 3;
23835        /// `ID<n>` bit 4.
23836        const ID4 = 1 << 4;
23837        /// `ID<n>` bit 5.
23838        const ID5 = 1 << 5;
23839        /// `ID<n>` bit 6.
23840        const ID6 = 1 << 6;
23841        /// `ID<n>` bit 7.
23842        const ID7 = 1 << 7;
23843        /// `ID<n>` bit 8.
23844        const ID8 = 1 << 8;
23845        /// `ID<n>` bit 9.
23846        const ID9 = 1 << 9;
23847        /// `ID<n>` bit 10.
23848        const ID10 = 1 << 10;
23849        /// `ID<n>` bit 11.
23850        const ID11 = 1 << 11;
23851        /// `ID<n>` bit 12.
23852        const ID12 = 1 << 12;
23853        /// `ID<n>` bit 13.
23854        const ID13 = 1 << 13;
23855        /// `ID<n>` bit 14.
23856        const ID14 = 1 << 14;
23857        /// `ID<n>` bit 15.
23858        const ID15 = 1 << 15;
23859        /// `ID<n>` bit 16.
23860        const ID16 = 1 << 16;
23861        /// `ID<n>` bit 17.
23862        const ID17 = 1 << 17;
23863        /// `ID<n>` bit 18.
23864        const ID18 = 1 << 18;
23865        /// `ID<n>` bit 19.
23866        const ID19 = 1 << 19;
23867        /// `ID<n>` bit 20.
23868        const ID20 = 1 << 20;
23869        /// `ID<n>` bit 21.
23870        const ID21 = 1 << 21;
23871        /// `ID<n>` bit 22.
23872        const ID22 = 1 << 22;
23873        /// `ID<n>` bit 23.
23874        const ID23 = 1 << 23;
23875        /// `ID<n>` bit 24.
23876        const ID24 = 1 << 24;
23877        /// `ID<n>` bit 25.
23878        const ID25 = 1 << 25;
23879        /// `ID<n>` bit 26.
23880        const ID26 = 1 << 26;
23881        /// `ID<n>` bit 27.
23882        const ID27 = 1 << 27;
23883        /// `ID<n>` bit 28.
23884        const ID28 = 1 << 28;
23885        /// `ID<n>` bit 29.
23886        const ID29 = 1 << 29;
23887        /// `ID<n>` bit 30.
23888        const ID30 = 1 << 30;
23889        /// `ID<n>` bit 31.
23890        const ID31 = 1 << 31;
23891    }
23892}
23893
23894impl Pmceid1 {
23895    /// Offset of the `ID<n>` field.
23896    pub const ID_SHIFT: u32 = 0;
23897}
23898
23899bitflags! {
23900    /// `PMCEID2` system register value.
23901    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23902    #[repr(transparent)]
23903    pub struct Pmceid2: u32 {
23904        /// `IDhi<n>` bit 0.
23905        const IDHI0 = 1 << 0;
23906        /// `IDhi<n>` bit 1.
23907        const IDHI1 = 1 << 1;
23908        /// `IDhi<n>` bit 2.
23909        const IDHI2 = 1 << 2;
23910        /// `IDhi<n>` bit 3.
23911        const IDHI3 = 1 << 3;
23912        /// `IDhi<n>` bit 4.
23913        const IDHI4 = 1 << 4;
23914        /// `IDhi<n>` bit 5.
23915        const IDHI5 = 1 << 5;
23916        /// `IDhi<n>` bit 6.
23917        const IDHI6 = 1 << 6;
23918        /// `IDhi<n>` bit 7.
23919        const IDHI7 = 1 << 7;
23920        /// `IDhi<n>` bit 8.
23921        const IDHI8 = 1 << 8;
23922        /// `IDhi<n>` bit 9.
23923        const IDHI9 = 1 << 9;
23924        /// `IDhi<n>` bit 10.
23925        const IDHI10 = 1 << 10;
23926        /// `IDhi<n>` bit 11.
23927        const IDHI11 = 1 << 11;
23928        /// `IDhi<n>` bit 12.
23929        const IDHI12 = 1 << 12;
23930        /// `IDhi<n>` bit 13.
23931        const IDHI13 = 1 << 13;
23932        /// `IDhi<n>` bit 14.
23933        const IDHI14 = 1 << 14;
23934        /// `IDhi<n>` bit 15.
23935        const IDHI15 = 1 << 15;
23936        /// `IDhi<n>` bit 16.
23937        const IDHI16 = 1 << 16;
23938        /// `IDhi<n>` bit 17.
23939        const IDHI17 = 1 << 17;
23940        /// `IDhi<n>` bit 18.
23941        const IDHI18 = 1 << 18;
23942        /// `IDhi<n>` bit 19.
23943        const IDHI19 = 1 << 19;
23944        /// `IDhi<n>` bit 20.
23945        const IDHI20 = 1 << 20;
23946        /// `IDhi<n>` bit 21.
23947        const IDHI21 = 1 << 21;
23948        /// `IDhi<n>` bit 22.
23949        const IDHI22 = 1 << 22;
23950        /// `IDhi<n>` bit 23.
23951        const IDHI23 = 1 << 23;
23952        /// `IDhi<n>` bit 24.
23953        const IDHI24 = 1 << 24;
23954        /// `IDhi<n>` bit 25.
23955        const IDHI25 = 1 << 25;
23956        /// `IDhi<n>` bit 26.
23957        const IDHI26 = 1 << 26;
23958        /// `IDhi<n>` bit 27.
23959        const IDHI27 = 1 << 27;
23960        /// `IDhi<n>` bit 28.
23961        const IDHI28 = 1 << 28;
23962        /// `IDhi<n>` bit 29.
23963        const IDHI29 = 1 << 29;
23964        /// `IDhi<n>` bit 30.
23965        const IDHI30 = 1 << 30;
23966        /// `IDhi<n>` bit 31.
23967        const IDHI31 = 1 << 31;
23968    }
23969}
23970
23971impl Pmceid2 {
23972    /// Offset of the `IDhi<n>` field.
23973    pub const IDHI_SHIFT: u32 = 0;
23974}
23975
23976bitflags! {
23977    /// `PMCEID3` system register value.
23978    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
23979    #[repr(transparent)]
23980    pub struct Pmceid3: u32 {
23981        /// `IDhi<n>` bit 0.
23982        const IDHI0 = 1 << 0;
23983        /// `IDhi<n>` bit 1.
23984        const IDHI1 = 1 << 1;
23985        /// `IDhi<n>` bit 2.
23986        const IDHI2 = 1 << 2;
23987        /// `IDhi<n>` bit 3.
23988        const IDHI3 = 1 << 3;
23989        /// `IDhi<n>` bit 4.
23990        const IDHI4 = 1 << 4;
23991        /// `IDhi<n>` bit 5.
23992        const IDHI5 = 1 << 5;
23993        /// `IDhi<n>` bit 6.
23994        const IDHI6 = 1 << 6;
23995        /// `IDhi<n>` bit 7.
23996        const IDHI7 = 1 << 7;
23997        /// `IDhi<n>` bit 8.
23998        const IDHI8 = 1 << 8;
23999        /// `IDhi<n>` bit 9.
24000        const IDHI9 = 1 << 9;
24001        /// `IDhi<n>` bit 10.
24002        const IDHI10 = 1 << 10;
24003        /// `IDhi<n>` bit 11.
24004        const IDHI11 = 1 << 11;
24005        /// `IDhi<n>` bit 12.
24006        const IDHI12 = 1 << 12;
24007        /// `IDhi<n>` bit 13.
24008        const IDHI13 = 1 << 13;
24009        /// `IDhi<n>` bit 14.
24010        const IDHI14 = 1 << 14;
24011        /// `IDhi<n>` bit 15.
24012        const IDHI15 = 1 << 15;
24013        /// `IDhi<n>` bit 16.
24014        const IDHI16 = 1 << 16;
24015        /// `IDhi<n>` bit 17.
24016        const IDHI17 = 1 << 17;
24017        /// `IDhi<n>` bit 18.
24018        const IDHI18 = 1 << 18;
24019        /// `IDhi<n>` bit 19.
24020        const IDHI19 = 1 << 19;
24021        /// `IDhi<n>` bit 20.
24022        const IDHI20 = 1 << 20;
24023        /// `IDhi<n>` bit 21.
24024        const IDHI21 = 1 << 21;
24025        /// `IDhi<n>` bit 22.
24026        const IDHI22 = 1 << 22;
24027        /// `IDhi<n>` bit 23.
24028        const IDHI23 = 1 << 23;
24029        /// `IDhi<n>` bit 24.
24030        const IDHI24 = 1 << 24;
24031        /// `IDhi<n>` bit 25.
24032        const IDHI25 = 1 << 25;
24033        /// `IDhi<n>` bit 26.
24034        const IDHI26 = 1 << 26;
24035        /// `IDhi<n>` bit 27.
24036        const IDHI27 = 1 << 27;
24037        /// `IDhi<n>` bit 28.
24038        const IDHI28 = 1 << 28;
24039        /// `IDhi<n>` bit 29.
24040        const IDHI29 = 1 << 29;
24041        /// `IDhi<n>` bit 30.
24042        const IDHI30 = 1 << 30;
24043        /// `IDhi<n>` bit 31.
24044        const IDHI31 = 1 << 31;
24045    }
24046}
24047
24048impl Pmceid3 {
24049    /// Offset of the `IDhi<n>` field.
24050    pub const IDHI_SHIFT: u32 = 0;
24051}
24052
24053bitflags! {
24054    /// `PMCNTENCLR` system register value.
24055    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24056    #[repr(transparent)]
24057    pub struct Pmcntenclr: u32 {
24058        /// `P<m>` bit 0.
24059        const P0 = 1 << 0;
24060        /// `P<m>` bit 1.
24061        const P1 = 1 << 1;
24062        /// `P<m>` bit 2.
24063        const P2 = 1 << 2;
24064        /// `P<m>` bit 3.
24065        const P3 = 1 << 3;
24066        /// `P<m>` bit 4.
24067        const P4 = 1 << 4;
24068        /// `P<m>` bit 5.
24069        const P5 = 1 << 5;
24070        /// `P<m>` bit 6.
24071        const P6 = 1 << 6;
24072        /// `P<m>` bit 7.
24073        const P7 = 1 << 7;
24074        /// `P<m>` bit 8.
24075        const P8 = 1 << 8;
24076        /// `P<m>` bit 9.
24077        const P9 = 1 << 9;
24078        /// `P<m>` bit 10.
24079        const P10 = 1 << 10;
24080        /// `P<m>` bit 11.
24081        const P11 = 1 << 11;
24082        /// `P<m>` bit 12.
24083        const P12 = 1 << 12;
24084        /// `P<m>` bit 13.
24085        const P13 = 1 << 13;
24086        /// `P<m>` bit 14.
24087        const P14 = 1 << 14;
24088        /// `P<m>` bit 15.
24089        const P15 = 1 << 15;
24090        /// `P<m>` bit 16.
24091        const P16 = 1 << 16;
24092        /// `P<m>` bit 17.
24093        const P17 = 1 << 17;
24094        /// `P<m>` bit 18.
24095        const P18 = 1 << 18;
24096        /// `P<m>` bit 19.
24097        const P19 = 1 << 19;
24098        /// `P<m>` bit 20.
24099        const P20 = 1 << 20;
24100        /// `P<m>` bit 21.
24101        const P21 = 1 << 21;
24102        /// `P<m>` bit 22.
24103        const P22 = 1 << 22;
24104        /// `P<m>` bit 23.
24105        const P23 = 1 << 23;
24106        /// `P<m>` bit 24.
24107        const P24 = 1 << 24;
24108        /// `P<m>` bit 25.
24109        const P25 = 1 << 25;
24110        /// `P<m>` bit 26.
24111        const P26 = 1 << 26;
24112        /// `P<m>` bit 27.
24113        const P27 = 1 << 27;
24114        /// `P<m>` bit 28.
24115        const P28 = 1 << 28;
24116        /// `P<m>` bit 29.
24117        const P29 = 1 << 29;
24118        /// `P<m>` bit 30.
24119        const P30 = 1 << 30;
24120        /// `C` bit.
24121        const C = 1 << 31;
24122    }
24123}
24124
24125impl Pmcntenclr {
24126    /// Offset of the `P<m>` field.
24127    pub const P_SHIFT: u32 = 0;
24128    /// Offset of the `C` field.
24129    pub const C_SHIFT: u32 = 31;
24130}
24131
24132bitflags! {
24133    /// `PMCNTENSET` system register value.
24134    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24135    #[repr(transparent)]
24136    pub struct Pmcntenset: u32 {
24137        /// `P<m>` bit 0.
24138        const P0 = 1 << 0;
24139        /// `P<m>` bit 1.
24140        const P1 = 1 << 1;
24141        /// `P<m>` bit 2.
24142        const P2 = 1 << 2;
24143        /// `P<m>` bit 3.
24144        const P3 = 1 << 3;
24145        /// `P<m>` bit 4.
24146        const P4 = 1 << 4;
24147        /// `P<m>` bit 5.
24148        const P5 = 1 << 5;
24149        /// `P<m>` bit 6.
24150        const P6 = 1 << 6;
24151        /// `P<m>` bit 7.
24152        const P7 = 1 << 7;
24153        /// `P<m>` bit 8.
24154        const P8 = 1 << 8;
24155        /// `P<m>` bit 9.
24156        const P9 = 1 << 9;
24157        /// `P<m>` bit 10.
24158        const P10 = 1 << 10;
24159        /// `P<m>` bit 11.
24160        const P11 = 1 << 11;
24161        /// `P<m>` bit 12.
24162        const P12 = 1 << 12;
24163        /// `P<m>` bit 13.
24164        const P13 = 1 << 13;
24165        /// `P<m>` bit 14.
24166        const P14 = 1 << 14;
24167        /// `P<m>` bit 15.
24168        const P15 = 1 << 15;
24169        /// `P<m>` bit 16.
24170        const P16 = 1 << 16;
24171        /// `P<m>` bit 17.
24172        const P17 = 1 << 17;
24173        /// `P<m>` bit 18.
24174        const P18 = 1 << 18;
24175        /// `P<m>` bit 19.
24176        const P19 = 1 << 19;
24177        /// `P<m>` bit 20.
24178        const P20 = 1 << 20;
24179        /// `P<m>` bit 21.
24180        const P21 = 1 << 21;
24181        /// `P<m>` bit 22.
24182        const P22 = 1 << 22;
24183        /// `P<m>` bit 23.
24184        const P23 = 1 << 23;
24185        /// `P<m>` bit 24.
24186        const P24 = 1 << 24;
24187        /// `P<m>` bit 25.
24188        const P25 = 1 << 25;
24189        /// `P<m>` bit 26.
24190        const P26 = 1 << 26;
24191        /// `P<m>` bit 27.
24192        const P27 = 1 << 27;
24193        /// `P<m>` bit 28.
24194        const P28 = 1 << 28;
24195        /// `P<m>` bit 29.
24196        const P29 = 1 << 29;
24197        /// `P<m>` bit 30.
24198        const P30 = 1 << 30;
24199        /// `C` bit.
24200        const C = 1 << 31;
24201    }
24202}
24203
24204impl Pmcntenset {
24205    /// Offset of the `P<m>` field.
24206    pub const P_SHIFT: u32 = 0;
24207    /// Offset of the `C` field.
24208    pub const C_SHIFT: u32 = 31;
24209}
24210
24211bitflags! {
24212    /// `PMCR` system register value.
24213    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24214    #[repr(transparent)]
24215    pub struct Pmcr: u32 {
24216        /// `E` bit.
24217        const E = 1 << 0;
24218        /// `P` bit.
24219        const P = 1 << 1;
24220        /// `C` bit.
24221        const C = 1 << 2;
24222        /// `D` bit.
24223        const D = 1 << 3;
24224        /// `X` bit.
24225        const X = 1 << 4;
24226        /// `DP` bit.
24227        const DP = 1 << 5;
24228        /// `LC` bit.
24229        const LC = 1 << 6;
24230        /// `LP` bit.
24231        const LP = 1 << 7;
24232        /// `FZO` bit.
24233        const FZO = 1 << 9;
24234    }
24235}
24236
24237impl Pmcr {
24238    /// Offset of the `E` field.
24239    pub const E_SHIFT: u32 = 0;
24240    /// Offset of the `P` field.
24241    pub const P_SHIFT: u32 = 1;
24242    /// Offset of the `C` field.
24243    pub const C_SHIFT: u32 = 2;
24244    /// Offset of the `D` field.
24245    pub const D_SHIFT: u32 = 3;
24246    /// Offset of the `X` field.
24247    pub const X_SHIFT: u32 = 4;
24248    /// Offset of the `DP` field.
24249    pub const DP_SHIFT: u32 = 5;
24250    /// Offset of the `LC` field.
24251    pub const LC_SHIFT: u32 = 6;
24252    /// Offset of the `LP` field.
24253    pub const LP_SHIFT: u32 = 7;
24254    /// Offset of the `FZO` field.
24255    pub const FZO_SHIFT: u32 = 9;
24256    /// Offset of the `N` field.
24257    pub const N_SHIFT: u32 = 11;
24258    /// Mask for the `N` field.
24259    pub const N_MASK: u32 = 0b11111;
24260    /// Offset of the `IDCODE` field.
24261    pub const IDCODE_SHIFT: u32 = 16;
24262    /// Mask for the `IDCODE` field.
24263    pub const IDCODE_MASK: u32 = 0b11111111;
24264    /// Offset of the `IMP` field.
24265    pub const IMP_SHIFT: u32 = 24;
24266    /// Mask for the `IMP` field.
24267    pub const IMP_MASK: u32 = 0b11111111;
24268
24269    /// Returns the value of the `N` field.
24270    pub const fn n(self) -> u8 {
24271        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
24272    }
24273
24274    /// Sets the value of the `N` field.
24275    pub const fn set_n(&mut self, value: u8) {
24276        let offset = Self::N_SHIFT;
24277        assert!(value & (Self::N_MASK as u8) == value);
24278        *self = Self::from_bits_retain(
24279            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
24280        );
24281    }
24282
24283    /// Returns a copy with the `N` field set to the given value.
24284    pub const fn with_n(mut self, value: u8) -> Self {
24285        self.set_n(value);
24286        self
24287    }
24288
24289    /// Returns the value of the `IDCODE` field.
24290    pub const fn idcode(self) -> u8 {
24291        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
24292    }
24293
24294    /// Sets the value of the `IDCODE` field.
24295    pub const fn set_idcode(&mut self, value: u8) {
24296        let offset = Self::IDCODE_SHIFT;
24297        assert!(value & (Self::IDCODE_MASK as u8) == value);
24298        *self = Self::from_bits_retain(
24299            (self.bits() & !(Self::IDCODE_MASK << offset)) | ((value as u32) << offset),
24300        );
24301    }
24302
24303    /// Returns a copy with the `IDCODE` field set to the given value.
24304    pub const fn with_idcode(mut self, value: u8) -> Self {
24305        self.set_idcode(value);
24306        self
24307    }
24308
24309    /// Returns the value of the `IMP` field.
24310    pub const fn imp(self) -> u8 {
24311        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
24312    }
24313
24314    /// Sets the value of the `IMP` field.
24315    pub const fn set_imp(&mut self, value: u8) {
24316        let offset = Self::IMP_SHIFT;
24317        assert!(value & (Self::IMP_MASK as u8) == value);
24318        *self = Self::from_bits_retain(
24319            (self.bits() & !(Self::IMP_MASK << offset)) | ((value as u32) << offset),
24320        );
24321    }
24322
24323    /// Returns a copy with the `IMP` field set to the given value.
24324    pub const fn with_imp(mut self, value: u8) -> Self {
24325        self.set_imp(value);
24326        self
24327    }
24328}
24329
24330bitflags! {
24331    /// `PMCR_EL0` system register value.
24332    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24333    #[repr(transparent)]
24334    pub struct PmcrEl0: u64 {
24335        /// Enable. Affected counters are enabled by PMCNTENSET_EL0.
24336        const E = 1 << 0;
24337        /// Event counter reset. Reset all affected event counters PMEVCNTR<n>_EL0 to zero.
24338        const P = 1 << 1;
24339        /// Cycle counter reset. Reset PMCCNTR_EL0 to zero.
24340        const C = 1 << 2;
24341        /// Clock divider. If set PMCCNTR_EL0 counts once every 64 clock cycles.
24342        const D = 1 << 3;
24343        /// Enable export of events in an IMPLEMENTATION DEFINED PMU event export bus. If set, export events where not prohibited.
24344        const X = 1 << 4;
24345        /// If set, cycle counting by PMCCNTR_EL0 is disabled in prohibited regions.
24346        const DP = 1 << 5;
24347        /// `LC` bit.
24348        const LC = 1 << 6;
24349        /// `LP` bit.
24350        const LP = 1 << 7;
24351        /// `FZO` bit.
24352        const FZO = 1 << 9;
24353        /// `FZS` bit.
24354        const FZS = 1 << 32;
24355    }
24356}
24357
24358impl PmcrEl0 {
24359    /// Offset of the `E` field.
24360    pub const E_SHIFT: u32 = 0;
24361    /// Offset of the `P` field.
24362    pub const P_SHIFT: u32 = 1;
24363    /// Offset of the `C` field.
24364    pub const C_SHIFT: u32 = 2;
24365    /// Offset of the `D` field.
24366    pub const D_SHIFT: u32 = 3;
24367    /// Offset of the `X` field.
24368    pub const X_SHIFT: u32 = 4;
24369    /// Offset of the `DP` field.
24370    pub const DP_SHIFT: u32 = 5;
24371    /// Offset of the `LC` field.
24372    pub const LC_SHIFT: u32 = 6;
24373    /// Offset of the `LP` field.
24374    pub const LP_SHIFT: u32 = 7;
24375    /// Offset of the `FZO` field.
24376    pub const FZO_SHIFT: u32 = 9;
24377    /// Offset of the `N` field.
24378    pub const N_SHIFT: u32 = 11;
24379    /// Mask for the `N` field.
24380    pub const N_MASK: u64 = 0b11111;
24381    /// Offset of the `IDCODE` field.
24382    pub const IDCODE_SHIFT: u32 = 16;
24383    /// Mask for the `IDCODE` field.
24384    pub const IDCODE_MASK: u64 = 0b11111111;
24385    /// Offset of the `IMP` field.
24386    pub const IMP_SHIFT: u32 = 24;
24387    /// Mask for the `IMP` field.
24388    pub const IMP_MASK: u64 = 0b11111111;
24389    /// Offset of the `FZS` field.
24390    pub const FZS_SHIFT: u32 = 32;
24391
24392    /// Returns the value of the `N` field.
24393    pub const fn n(self) -> u8 {
24394        ((self.bits() >> Self::N_SHIFT) & 0b11111) as u8
24395    }
24396
24397    /// Sets the value of the `N` field.
24398    pub const fn set_n(&mut self, value: u8) {
24399        let offset = Self::N_SHIFT;
24400        assert!(value & (Self::N_MASK as u8) == value);
24401        *self = Self::from_bits_retain(
24402            (self.bits() & !(Self::N_MASK << offset)) | ((value as u64) << offset),
24403        );
24404    }
24405
24406    /// Returns a copy with the `N` field set to the given value.
24407    pub const fn with_n(mut self, value: u8) -> Self {
24408        self.set_n(value);
24409        self
24410    }
24411
24412    /// Returns the value of the `IDCODE` field.
24413    pub const fn idcode(self) -> u8 {
24414        ((self.bits() >> Self::IDCODE_SHIFT) & 0b11111111) as u8
24415    }
24416
24417    /// Sets the value of the `IDCODE` field.
24418    pub const fn set_idcode(&mut self, value: u8) {
24419        let offset = Self::IDCODE_SHIFT;
24420        assert!(value & (Self::IDCODE_MASK as u8) == value);
24421        *self = Self::from_bits_retain(
24422            (self.bits() & !(Self::IDCODE_MASK << offset)) | ((value as u64) << offset),
24423        );
24424    }
24425
24426    /// Returns a copy with the `IDCODE` field set to the given value.
24427    pub const fn with_idcode(mut self, value: u8) -> Self {
24428        self.set_idcode(value);
24429        self
24430    }
24431
24432    /// Returns the value of the `IMP` field.
24433    pub const fn imp(self) -> u8 {
24434        ((self.bits() >> Self::IMP_SHIFT) & 0b11111111) as u8
24435    }
24436
24437    /// Sets the value of the `IMP` field.
24438    pub const fn set_imp(&mut self, value: u8) {
24439        let offset = Self::IMP_SHIFT;
24440        assert!(value & (Self::IMP_MASK as u8) == value);
24441        *self = Self::from_bits_retain(
24442            (self.bits() & !(Self::IMP_MASK << offset)) | ((value as u64) << offset),
24443        );
24444    }
24445
24446    /// Returns a copy with the `IMP` field set to the given value.
24447    pub const fn with_imp(mut self, value: u8) -> Self {
24448        self.set_imp(value);
24449        self
24450    }
24451}
24452
24453bitflags! {
24454    /// `PMINTENCLR` system register value.
24455    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24456    #[repr(transparent)]
24457    pub struct Pmintenclr: u32 {
24458        /// `P<m>` bit 0.
24459        const P0 = 1 << 0;
24460        /// `P<m>` bit 1.
24461        const P1 = 1 << 1;
24462        /// `P<m>` bit 2.
24463        const P2 = 1 << 2;
24464        /// `P<m>` bit 3.
24465        const P3 = 1 << 3;
24466        /// `P<m>` bit 4.
24467        const P4 = 1 << 4;
24468        /// `P<m>` bit 5.
24469        const P5 = 1 << 5;
24470        /// `P<m>` bit 6.
24471        const P6 = 1 << 6;
24472        /// `P<m>` bit 7.
24473        const P7 = 1 << 7;
24474        /// `P<m>` bit 8.
24475        const P8 = 1 << 8;
24476        /// `P<m>` bit 9.
24477        const P9 = 1 << 9;
24478        /// `P<m>` bit 10.
24479        const P10 = 1 << 10;
24480        /// `P<m>` bit 11.
24481        const P11 = 1 << 11;
24482        /// `P<m>` bit 12.
24483        const P12 = 1 << 12;
24484        /// `P<m>` bit 13.
24485        const P13 = 1 << 13;
24486        /// `P<m>` bit 14.
24487        const P14 = 1 << 14;
24488        /// `P<m>` bit 15.
24489        const P15 = 1 << 15;
24490        /// `P<m>` bit 16.
24491        const P16 = 1 << 16;
24492        /// `P<m>` bit 17.
24493        const P17 = 1 << 17;
24494        /// `P<m>` bit 18.
24495        const P18 = 1 << 18;
24496        /// `P<m>` bit 19.
24497        const P19 = 1 << 19;
24498        /// `P<m>` bit 20.
24499        const P20 = 1 << 20;
24500        /// `P<m>` bit 21.
24501        const P21 = 1 << 21;
24502        /// `P<m>` bit 22.
24503        const P22 = 1 << 22;
24504        /// `P<m>` bit 23.
24505        const P23 = 1 << 23;
24506        /// `P<m>` bit 24.
24507        const P24 = 1 << 24;
24508        /// `P<m>` bit 25.
24509        const P25 = 1 << 25;
24510        /// `P<m>` bit 26.
24511        const P26 = 1 << 26;
24512        /// `P<m>` bit 27.
24513        const P27 = 1 << 27;
24514        /// `P<m>` bit 28.
24515        const P28 = 1 << 28;
24516        /// `P<m>` bit 29.
24517        const P29 = 1 << 29;
24518        /// `P<m>` bit 30.
24519        const P30 = 1 << 30;
24520        /// `C` bit.
24521        const C = 1 << 31;
24522    }
24523}
24524
24525impl Pmintenclr {
24526    /// Offset of the `P<m>` field.
24527    pub const P_SHIFT: u32 = 0;
24528    /// Offset of the `C` field.
24529    pub const C_SHIFT: u32 = 31;
24530}
24531
24532bitflags! {
24533    /// `PMINTENSET` system register value.
24534    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24535    #[repr(transparent)]
24536    pub struct Pmintenset: u32 {
24537        /// `P<m>` bit 0.
24538        const P0 = 1 << 0;
24539        /// `P<m>` bit 1.
24540        const P1 = 1 << 1;
24541        /// `P<m>` bit 2.
24542        const P2 = 1 << 2;
24543        /// `P<m>` bit 3.
24544        const P3 = 1 << 3;
24545        /// `P<m>` bit 4.
24546        const P4 = 1 << 4;
24547        /// `P<m>` bit 5.
24548        const P5 = 1 << 5;
24549        /// `P<m>` bit 6.
24550        const P6 = 1 << 6;
24551        /// `P<m>` bit 7.
24552        const P7 = 1 << 7;
24553        /// `P<m>` bit 8.
24554        const P8 = 1 << 8;
24555        /// `P<m>` bit 9.
24556        const P9 = 1 << 9;
24557        /// `P<m>` bit 10.
24558        const P10 = 1 << 10;
24559        /// `P<m>` bit 11.
24560        const P11 = 1 << 11;
24561        /// `P<m>` bit 12.
24562        const P12 = 1 << 12;
24563        /// `P<m>` bit 13.
24564        const P13 = 1 << 13;
24565        /// `P<m>` bit 14.
24566        const P14 = 1 << 14;
24567        /// `P<m>` bit 15.
24568        const P15 = 1 << 15;
24569        /// `P<m>` bit 16.
24570        const P16 = 1 << 16;
24571        /// `P<m>` bit 17.
24572        const P17 = 1 << 17;
24573        /// `P<m>` bit 18.
24574        const P18 = 1 << 18;
24575        /// `P<m>` bit 19.
24576        const P19 = 1 << 19;
24577        /// `P<m>` bit 20.
24578        const P20 = 1 << 20;
24579        /// `P<m>` bit 21.
24580        const P21 = 1 << 21;
24581        /// `P<m>` bit 22.
24582        const P22 = 1 << 22;
24583        /// `P<m>` bit 23.
24584        const P23 = 1 << 23;
24585        /// `P<m>` bit 24.
24586        const P24 = 1 << 24;
24587        /// `P<m>` bit 25.
24588        const P25 = 1 << 25;
24589        /// `P<m>` bit 26.
24590        const P26 = 1 << 26;
24591        /// `P<m>` bit 27.
24592        const P27 = 1 << 27;
24593        /// `P<m>` bit 28.
24594        const P28 = 1 << 28;
24595        /// `P<m>` bit 29.
24596        const P29 = 1 << 29;
24597        /// `P<m>` bit 30.
24598        const P30 = 1 << 30;
24599        /// `C` bit.
24600        const C = 1 << 31;
24601    }
24602}
24603
24604impl Pmintenset {
24605    /// Offset of the `P<m>` field.
24606    pub const P_SHIFT: u32 = 0;
24607    /// Offset of the `C` field.
24608    pub const C_SHIFT: u32 = 31;
24609}
24610
24611bitflags! {
24612    /// `PMMIR` system register value.
24613    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24614    #[repr(transparent)]
24615    pub struct Pmmir: u32 {
24616    }
24617}
24618
24619impl Pmmir {
24620    /// Offset of the `SLOTS` field.
24621    pub const SLOTS_SHIFT: u32 = 0;
24622    /// Mask for the `SLOTS` field.
24623    pub const SLOTS_MASK: u32 = 0b11111111;
24624    /// Offset of the `BUS_SLOTS` field.
24625    pub const BUS_SLOTS_SHIFT: u32 = 8;
24626    /// Mask for the `BUS_SLOTS` field.
24627    pub const BUS_SLOTS_MASK: u32 = 0b11111111;
24628    /// Offset of the `BUS_WIDTH` field.
24629    pub const BUS_WIDTH_SHIFT: u32 = 16;
24630    /// Mask for the `BUS_WIDTH` field.
24631    pub const BUS_WIDTH_MASK: u32 = 0b1111;
24632    /// Offset of the `THWIDTH` field.
24633    pub const THWIDTH_SHIFT: u32 = 20;
24634    /// Mask for the `THWIDTH` field.
24635    pub const THWIDTH_MASK: u32 = 0b1111;
24636    /// Offset of the `EDGE` field.
24637    pub const EDGE_SHIFT: u32 = 24;
24638    /// Mask for the `EDGE` field.
24639    pub const EDGE_MASK: u32 = 0b1111;
24640
24641    /// Returns the value of the `SLOTS` field.
24642    pub const fn slots(self) -> u8 {
24643        ((self.bits() >> Self::SLOTS_SHIFT) & 0b11111111) as u8
24644    }
24645
24646    /// Sets the value of the `SLOTS` field.
24647    pub const fn set_slots(&mut self, value: u8) {
24648        let offset = Self::SLOTS_SHIFT;
24649        assert!(value & (Self::SLOTS_MASK as u8) == value);
24650        *self = Self::from_bits_retain(
24651            (self.bits() & !(Self::SLOTS_MASK << offset)) | ((value as u32) << offset),
24652        );
24653    }
24654
24655    /// Returns a copy with the `SLOTS` field set to the given value.
24656    pub const fn with_slots(mut self, value: u8) -> Self {
24657        self.set_slots(value);
24658        self
24659    }
24660
24661    /// Returns the value of the `BUS_SLOTS` field.
24662    pub const fn bus_slots(self) -> u8 {
24663        ((self.bits() >> Self::BUS_SLOTS_SHIFT) & 0b11111111) as u8
24664    }
24665
24666    /// Sets the value of the `BUS_SLOTS` field.
24667    pub const fn set_bus_slots(&mut self, value: u8) {
24668        let offset = Self::BUS_SLOTS_SHIFT;
24669        assert!(value & (Self::BUS_SLOTS_MASK as u8) == value);
24670        *self = Self::from_bits_retain(
24671            (self.bits() & !(Self::BUS_SLOTS_MASK << offset)) | ((value as u32) << offset),
24672        );
24673    }
24674
24675    /// Returns a copy with the `BUS_SLOTS` field set to the given value.
24676    pub const fn with_bus_slots(mut self, value: u8) -> Self {
24677        self.set_bus_slots(value);
24678        self
24679    }
24680
24681    /// Returns the value of the `BUS_WIDTH` field.
24682    pub const fn bus_width(self) -> u8 {
24683        ((self.bits() >> Self::BUS_WIDTH_SHIFT) & 0b1111) as u8
24684    }
24685
24686    /// Sets the value of the `BUS_WIDTH` field.
24687    pub const fn set_bus_width(&mut self, value: u8) {
24688        let offset = Self::BUS_WIDTH_SHIFT;
24689        assert!(value & (Self::BUS_WIDTH_MASK as u8) == value);
24690        *self = Self::from_bits_retain(
24691            (self.bits() & !(Self::BUS_WIDTH_MASK << offset)) | ((value as u32) << offset),
24692        );
24693    }
24694
24695    /// Returns a copy with the `BUS_WIDTH` field set to the given value.
24696    pub const fn with_bus_width(mut self, value: u8) -> Self {
24697        self.set_bus_width(value);
24698        self
24699    }
24700
24701    /// Returns the value of the `THWIDTH` field.
24702    pub const fn thwidth(self) -> u8 {
24703        ((self.bits() >> Self::THWIDTH_SHIFT) & 0b1111) as u8
24704    }
24705
24706    /// Sets the value of the `THWIDTH` field.
24707    pub const fn set_thwidth(&mut self, value: u8) {
24708        let offset = Self::THWIDTH_SHIFT;
24709        assert!(value & (Self::THWIDTH_MASK as u8) == value);
24710        *self = Self::from_bits_retain(
24711            (self.bits() & !(Self::THWIDTH_MASK << offset)) | ((value as u32) << offset),
24712        );
24713    }
24714
24715    /// Returns a copy with the `THWIDTH` field set to the given value.
24716    pub const fn with_thwidth(mut self, value: u8) -> Self {
24717        self.set_thwidth(value);
24718        self
24719    }
24720
24721    /// Returns the value of the `EDGE` field.
24722    pub const fn edge(self) -> u8 {
24723        ((self.bits() >> Self::EDGE_SHIFT) & 0b1111) as u8
24724    }
24725
24726    /// Sets the value of the `EDGE` field.
24727    pub const fn set_edge(&mut self, value: u8) {
24728        let offset = Self::EDGE_SHIFT;
24729        assert!(value & (Self::EDGE_MASK as u8) == value);
24730        *self = Self::from_bits_retain(
24731            (self.bits() & !(Self::EDGE_MASK << offset)) | ((value as u32) << offset),
24732        );
24733    }
24734
24735    /// Returns a copy with the `EDGE` field set to the given value.
24736    pub const fn with_edge(mut self, value: u8) -> Self {
24737        self.set_edge(value);
24738        self
24739    }
24740}
24741
24742bitflags! {
24743    /// `PMOVSR` system register value.
24744    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24745    #[repr(transparent)]
24746    pub struct Pmovsr: u32 {
24747        /// `P<m>` bit 0.
24748        const P0 = 1 << 0;
24749        /// `P<m>` bit 1.
24750        const P1 = 1 << 1;
24751        /// `P<m>` bit 2.
24752        const P2 = 1 << 2;
24753        /// `P<m>` bit 3.
24754        const P3 = 1 << 3;
24755        /// `P<m>` bit 4.
24756        const P4 = 1 << 4;
24757        /// `P<m>` bit 5.
24758        const P5 = 1 << 5;
24759        /// `P<m>` bit 6.
24760        const P6 = 1 << 6;
24761        /// `P<m>` bit 7.
24762        const P7 = 1 << 7;
24763        /// `P<m>` bit 8.
24764        const P8 = 1 << 8;
24765        /// `P<m>` bit 9.
24766        const P9 = 1 << 9;
24767        /// `P<m>` bit 10.
24768        const P10 = 1 << 10;
24769        /// `P<m>` bit 11.
24770        const P11 = 1 << 11;
24771        /// `P<m>` bit 12.
24772        const P12 = 1 << 12;
24773        /// `P<m>` bit 13.
24774        const P13 = 1 << 13;
24775        /// `P<m>` bit 14.
24776        const P14 = 1 << 14;
24777        /// `P<m>` bit 15.
24778        const P15 = 1 << 15;
24779        /// `P<m>` bit 16.
24780        const P16 = 1 << 16;
24781        /// `P<m>` bit 17.
24782        const P17 = 1 << 17;
24783        /// `P<m>` bit 18.
24784        const P18 = 1 << 18;
24785        /// `P<m>` bit 19.
24786        const P19 = 1 << 19;
24787        /// `P<m>` bit 20.
24788        const P20 = 1 << 20;
24789        /// `P<m>` bit 21.
24790        const P21 = 1 << 21;
24791        /// `P<m>` bit 22.
24792        const P22 = 1 << 22;
24793        /// `P<m>` bit 23.
24794        const P23 = 1 << 23;
24795        /// `P<m>` bit 24.
24796        const P24 = 1 << 24;
24797        /// `P<m>` bit 25.
24798        const P25 = 1 << 25;
24799        /// `P<m>` bit 26.
24800        const P26 = 1 << 26;
24801        /// `P<m>` bit 27.
24802        const P27 = 1 << 27;
24803        /// `P<m>` bit 28.
24804        const P28 = 1 << 28;
24805        /// `P<m>` bit 29.
24806        const P29 = 1 << 29;
24807        /// `P<m>` bit 30.
24808        const P30 = 1 << 30;
24809        /// `C` bit.
24810        const C = 1 << 31;
24811    }
24812}
24813
24814impl Pmovsr {
24815    /// Offset of the `P<m>` field.
24816    pub const P_SHIFT: u32 = 0;
24817    /// Offset of the `C` field.
24818    pub const C_SHIFT: u32 = 31;
24819}
24820
24821bitflags! {
24822    /// `PMOVSSET` system register value.
24823    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24824    #[repr(transparent)]
24825    pub struct Pmovsset: u32 {
24826        /// `P<m>` bit 0.
24827        const P0 = 1 << 0;
24828        /// `P<m>` bit 1.
24829        const P1 = 1 << 1;
24830        /// `P<m>` bit 2.
24831        const P2 = 1 << 2;
24832        /// `P<m>` bit 3.
24833        const P3 = 1 << 3;
24834        /// `P<m>` bit 4.
24835        const P4 = 1 << 4;
24836        /// `P<m>` bit 5.
24837        const P5 = 1 << 5;
24838        /// `P<m>` bit 6.
24839        const P6 = 1 << 6;
24840        /// `P<m>` bit 7.
24841        const P7 = 1 << 7;
24842        /// `P<m>` bit 8.
24843        const P8 = 1 << 8;
24844        /// `P<m>` bit 9.
24845        const P9 = 1 << 9;
24846        /// `P<m>` bit 10.
24847        const P10 = 1 << 10;
24848        /// `P<m>` bit 11.
24849        const P11 = 1 << 11;
24850        /// `P<m>` bit 12.
24851        const P12 = 1 << 12;
24852        /// `P<m>` bit 13.
24853        const P13 = 1 << 13;
24854        /// `P<m>` bit 14.
24855        const P14 = 1 << 14;
24856        /// `P<m>` bit 15.
24857        const P15 = 1 << 15;
24858        /// `P<m>` bit 16.
24859        const P16 = 1 << 16;
24860        /// `P<m>` bit 17.
24861        const P17 = 1 << 17;
24862        /// `P<m>` bit 18.
24863        const P18 = 1 << 18;
24864        /// `P<m>` bit 19.
24865        const P19 = 1 << 19;
24866        /// `P<m>` bit 20.
24867        const P20 = 1 << 20;
24868        /// `P<m>` bit 21.
24869        const P21 = 1 << 21;
24870        /// `P<m>` bit 22.
24871        const P22 = 1 << 22;
24872        /// `P<m>` bit 23.
24873        const P23 = 1 << 23;
24874        /// `P<m>` bit 24.
24875        const P24 = 1 << 24;
24876        /// `P<m>` bit 25.
24877        const P25 = 1 << 25;
24878        /// `P<m>` bit 26.
24879        const P26 = 1 << 26;
24880        /// `P<m>` bit 27.
24881        const P27 = 1 << 27;
24882        /// `P<m>` bit 28.
24883        const P28 = 1 << 28;
24884        /// `P<m>` bit 29.
24885        const P29 = 1 << 29;
24886        /// `P<m>` bit 30.
24887        const P30 = 1 << 30;
24888        /// `C` bit.
24889        const C = 1 << 31;
24890    }
24891}
24892
24893impl Pmovsset {
24894    /// Offset of the `P<m>` field.
24895    pub const P_SHIFT: u32 = 0;
24896    /// Offset of the `C` field.
24897    pub const C_SHIFT: u32 = 31;
24898}
24899
24900bitflags! {
24901    /// `PMSELR` system register value.
24902    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24903    #[repr(transparent)]
24904    pub struct Pmselr: u32 {
24905    }
24906}
24907
24908impl Pmselr {
24909    /// Offset of the `SEL` field.
24910    pub const SEL_SHIFT: u32 = 0;
24911    /// Mask for the `SEL` field.
24912    pub const SEL_MASK: u32 = 0b11111;
24913
24914    /// Returns the value of the `SEL` field.
24915    pub const fn sel(self) -> u8 {
24916        ((self.bits() >> Self::SEL_SHIFT) & 0b11111) as u8
24917    }
24918
24919    /// Sets the value of the `SEL` field.
24920    pub const fn set_sel(&mut self, value: u8) {
24921        let offset = Self::SEL_SHIFT;
24922        assert!(value & (Self::SEL_MASK as u8) == value);
24923        *self = Self::from_bits_retain(
24924            (self.bits() & !(Self::SEL_MASK << offset)) | ((value as u32) << offset),
24925        );
24926    }
24927
24928    /// Returns a copy with the `SEL` field set to the given value.
24929    pub const fn with_sel(mut self, value: u8) -> Self {
24930        self.set_sel(value);
24931        self
24932    }
24933}
24934
24935bitflags! {
24936    /// `PMSWINC` system register value.
24937    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
24938    #[repr(transparent)]
24939    pub struct Pmswinc: u32 {
24940        /// `P<m>` bit 0.
24941        const P0 = 1 << 0;
24942        /// `P<m>` bit 1.
24943        const P1 = 1 << 1;
24944        /// `P<m>` bit 2.
24945        const P2 = 1 << 2;
24946        /// `P<m>` bit 3.
24947        const P3 = 1 << 3;
24948        /// `P<m>` bit 4.
24949        const P4 = 1 << 4;
24950        /// `P<m>` bit 5.
24951        const P5 = 1 << 5;
24952        /// `P<m>` bit 6.
24953        const P6 = 1 << 6;
24954        /// `P<m>` bit 7.
24955        const P7 = 1 << 7;
24956        /// `P<m>` bit 8.
24957        const P8 = 1 << 8;
24958        /// `P<m>` bit 9.
24959        const P9 = 1 << 9;
24960        /// `P<m>` bit 10.
24961        const P10 = 1 << 10;
24962        /// `P<m>` bit 11.
24963        const P11 = 1 << 11;
24964        /// `P<m>` bit 12.
24965        const P12 = 1 << 12;
24966        /// `P<m>` bit 13.
24967        const P13 = 1 << 13;
24968        /// `P<m>` bit 14.
24969        const P14 = 1 << 14;
24970        /// `P<m>` bit 15.
24971        const P15 = 1 << 15;
24972        /// `P<m>` bit 16.
24973        const P16 = 1 << 16;
24974        /// `P<m>` bit 17.
24975        const P17 = 1 << 17;
24976        /// `P<m>` bit 18.
24977        const P18 = 1 << 18;
24978        /// `P<m>` bit 19.
24979        const P19 = 1 << 19;
24980        /// `P<m>` bit 20.
24981        const P20 = 1 << 20;
24982        /// `P<m>` bit 21.
24983        const P21 = 1 << 21;
24984        /// `P<m>` bit 22.
24985        const P22 = 1 << 22;
24986        /// `P<m>` bit 23.
24987        const P23 = 1 << 23;
24988        /// `P<m>` bit 24.
24989        const P24 = 1 << 24;
24990        /// `P<m>` bit 25.
24991        const P25 = 1 << 25;
24992        /// `P<m>` bit 26.
24993        const P26 = 1 << 26;
24994        /// `P<m>` bit 27.
24995        const P27 = 1 << 27;
24996        /// `P<m>` bit 28.
24997        const P28 = 1 << 28;
24998        /// `P<m>` bit 29.
24999        const P29 = 1 << 29;
25000        /// `P<m>` bit 30.
25001        const P30 = 1 << 30;
25002    }
25003}
25004
25005impl Pmswinc {
25006    /// Offset of the `P<m>` field.
25007    pub const P_SHIFT: u32 = 0;
25008}
25009
25010bitflags! {
25011    /// `PMUSERENR` system register value.
25012    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25013    #[repr(transparent)]
25014    pub struct Pmuserenr: u32 {
25015        /// `EN` bit.
25016        const EN = 1 << 0;
25017        /// `SW` bit.
25018        const SW = 1 << 1;
25019        /// `CR` bit.
25020        const CR = 1 << 2;
25021        /// `ER` bit.
25022        const ER = 1 << 3;
25023        /// `TID` bit.
25024        const TID = 1 << 6;
25025    }
25026}
25027
25028impl Pmuserenr {
25029    /// Offset of the `EN` field.
25030    pub const EN_SHIFT: u32 = 0;
25031    /// Offset of the `SW` field.
25032    pub const SW_SHIFT: u32 = 1;
25033    /// Offset of the `CR` field.
25034    pub const CR_SHIFT: u32 = 2;
25035    /// Offset of the `ER` field.
25036    pub const ER_SHIFT: u32 = 3;
25037    /// Offset of the `TID` field.
25038    pub const TID_SHIFT: u32 = 6;
25039}
25040
25041bitflags! {
25042    /// `PMXEVTYPER` system register value.
25043    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25044    #[repr(transparent)]
25045    pub struct Pmxevtyper: u32 {
25046    }
25047}
25048
25049impl Pmxevtyper {
25050    /// Offset of the `ETR` field.
25051    pub const ETR_SHIFT: u32 = 0;
25052    /// Mask for the `ETR` field.
25053    pub const ETR_MASK: u32 = 0b11111111111111111111111111111111;
25054
25055    /// Returns the value of the `ETR` field.
25056    pub const fn etr(self) -> u32 {
25057        ((self.bits() >> Self::ETR_SHIFT) & 0b11111111111111111111111111111111) as u32
25058    }
25059
25060    /// Sets the value of the `ETR` field.
25061    pub const fn set_etr(&mut self, value: u32) {
25062        let offset = Self::ETR_SHIFT;
25063        assert!(value & (Self::ETR_MASK as u32) == value);
25064        *self = Self::from_bits_retain(
25065            (self.bits() & !(Self::ETR_MASK << offset)) | ((value as u32) << offset),
25066        );
25067    }
25068
25069    /// Returns a copy with the `ETR` field set to the given value.
25070    pub const fn with_etr(mut self, value: u32) -> Self {
25071        self.set_etr(value);
25072        self
25073    }
25074}
25075
25076bitflags! {
25077    /// `PRRR` system register value.
25078    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25079    #[repr(transparent)]
25080    pub struct Prrr: u32 {
25081        /// `DS0` bit.
25082        const DS0 = 1 << 16;
25083        /// `DS1` bit.
25084        const DS1 = 1 << 17;
25085        /// `NS0` bit.
25086        const NS0 = 1 << 18;
25087        /// `NS1` bit.
25088        const NS1 = 1 << 19;
25089        /// `NOS<n>` bit 0.
25090        const NOS0 = 1 << 24;
25091        /// `NOS<n>` bit 1.
25092        const NOS1 = 1 << 25;
25093        /// `NOS<n>` bit 2.
25094        const NOS2 = 1 << 26;
25095        /// `NOS<n>` bit 3.
25096        const NOS3 = 1 << 27;
25097        /// `NOS<n>` bit 4.
25098        const NOS4 = 1 << 28;
25099        /// `NOS<n>` bit 5.
25100        const NOS5 = 1 << 29;
25101        /// `NOS<n>` bit 6.
25102        const NOS6 = 1 << 30;
25103        /// `NOS<n>` bit 7.
25104        const NOS7 = 1 << 31;
25105    }
25106}
25107
25108impl Prrr {
25109    /// Offset of the `TR<n>` field.
25110    pub const TR_SHIFT: u32 = 0;
25111    /// Mask for the `TR<n>` field.
25112    pub const TR_MASK: u32 = 0b11;
25113    /// Offset of the `DS0` field.
25114    pub const DS0_SHIFT: u32 = 16;
25115    /// Offset of the `DS1` field.
25116    pub const DS1_SHIFT: u32 = 17;
25117    /// Offset of the `NS0` field.
25118    pub const NS0_SHIFT: u32 = 18;
25119    /// Offset of the `NS1` field.
25120    pub const NS1_SHIFT: u32 = 19;
25121    /// Offset of the `NOS<n>` field.
25122    pub const NOS_SHIFT: u32 = 24;
25123
25124    /// Returns the value of the given `TR<n>` field.
25125    pub const fn tr(self, n: u32) -> u8 {
25126        assert!(n < 8);
25127        ((self.bits() >> (Self::TR_SHIFT + (n - 0) * 2)) & 0b11) as u8
25128    }
25129
25130    /// Sets the value of the `TR<n>` field.
25131    pub const fn set_tr(&mut self, n: u32, value: u8) {
25132        assert!(n < 8);
25133        let offset = Self::TR_SHIFT + (n - 0) * 2;
25134        assert!(value & (Self::TR_MASK as u8) == value);
25135        *self = Self::from_bits_retain(
25136            (self.bits() & !(Self::TR_MASK << offset)) | ((value as u32) << offset),
25137        );
25138    }
25139
25140    /// Returns a copy with the `TR<n>` field set to the given value.
25141    pub const fn with_tr(mut self, n: u32, value: u8) -> Self {
25142        self.set_tr(n, value);
25143        self
25144    }
25145}
25146
25147#[cfg(feature = "el1")]
25148bitflags! {
25149    /// `RGSR_EL1` system register value.
25150    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25151    #[repr(transparent)]
25152    pub struct RgsrEl1: u64 {
25153    }
25154}
25155
25156#[cfg(feature = "el1")]
25157impl RgsrEl1 {
25158    /// Offset of the `TAG` field.
25159    pub const TAG_SHIFT: u32 = 0;
25160    /// Mask for the `TAG` field.
25161    pub const TAG_MASK: u64 = 0b1111;
25162    /// Offset of the `SEED` field.
25163    pub const SEED_SHIFT: u32 = 8;
25164    /// Mask for the `SEED` field.
25165    pub const SEED_MASK: u64 = 0b1111111111111111;
25166
25167    /// Returns the value of the `TAG` field.
25168    pub const fn tag(self) -> u8 {
25169        ((self.bits() >> Self::TAG_SHIFT) & 0b1111) as u8
25170    }
25171
25172    /// Sets the value of the `TAG` field.
25173    pub const fn set_tag(&mut self, value: u8) {
25174        let offset = Self::TAG_SHIFT;
25175        assert!(value & (Self::TAG_MASK as u8) == value);
25176        *self = Self::from_bits_retain(
25177            (self.bits() & !(Self::TAG_MASK << offset)) | ((value as u64) << offset),
25178        );
25179    }
25180
25181    /// Returns a copy with the `TAG` field set to the given value.
25182    pub const fn with_tag(mut self, value: u8) -> Self {
25183        self.set_tag(value);
25184        self
25185    }
25186
25187    /// Returns the value of the `SEED` field.
25188    pub const fn seed(self) -> u16 {
25189        ((self.bits() >> Self::SEED_SHIFT) & 0b1111111111111111) as u16
25190    }
25191
25192    /// Sets the value of the `SEED` field.
25193    pub const fn set_seed(&mut self, value: u16) {
25194        let offset = Self::SEED_SHIFT;
25195        assert!(value & (Self::SEED_MASK as u16) == value);
25196        *self = Self::from_bits_retain(
25197            (self.bits() & !(Self::SEED_MASK << offset)) | ((value as u64) << offset),
25198        );
25199    }
25200
25201    /// Returns a copy with the `SEED` field set to the given value.
25202    pub const fn with_seed(mut self, value: u16) -> Self {
25203        self.set_seed(value);
25204        self
25205    }
25206}
25207
25208bitflags! {
25209    /// `RMR` system register value.
25210    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25211    #[repr(transparent)]
25212    pub struct Rmr: u32 {
25213        /// `AA64` bit.
25214        const AA64 = 1 << 0;
25215        /// `RR` bit.
25216        const RR = 1 << 1;
25217    }
25218}
25219
25220impl Rmr {
25221    /// Offset of the `AA64` field.
25222    pub const AA64_SHIFT: u32 = 0;
25223    /// Offset of the `RR` field.
25224    pub const RR_SHIFT: u32 = 1;
25225}
25226
25227bitflags! {
25228    /// `RVBAR` system register value.
25229    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25230    #[repr(transparent)]
25231    pub struct Rvbar: u32 {
25232        /// RES1 bits in the `RVBAR` register.
25233        const RES1 = 0b1;
25234    }
25235}
25236
25237impl Rvbar {
25238    /// Offset of the `ResetAddress` field.
25239    pub const RESETADDRESS_SHIFT: u32 = 1;
25240    /// Mask for the `ResetAddress` field.
25241    pub const RESETADDRESS_MASK: u32 = 0b1111111111111111111111111111111;
25242
25243    /// Returns the value of the `ResetAddress` field.
25244    pub const fn resetaddress(self) -> u32 {
25245        ((self.bits() >> Self::RESETADDRESS_SHIFT) & 0b1111111111111111111111111111111) as u32
25246    }
25247
25248    /// Sets the value of the `ResetAddress` field.
25249    pub const fn set_resetaddress(&mut self, value: u32) {
25250        let offset = Self::RESETADDRESS_SHIFT;
25251        assert!(value & (Self::RESETADDRESS_MASK as u32) == value);
25252        *self = Self::from_bits_retain(
25253            (self.bits() & !(Self::RESETADDRESS_MASK << offset)) | ((value as u32) << offset),
25254        );
25255    }
25256
25257    /// Returns a copy with the `ResetAddress` field set to the given value.
25258    pub const fn with_resetaddress(mut self, value: u32) -> Self {
25259        self.set_resetaddress(value);
25260        self
25261    }
25262}
25263
25264bitflags! {
25265    /// `SCR` system register value.
25266    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25267    #[repr(transparent)]
25268    pub struct Scr: u32 {
25269        /// `NS` bit.
25270        const NS = 1 << 0;
25271        /// `IRQ` bit.
25272        const IRQ = 1 << 1;
25273        /// `FIQ` bit.
25274        const FIQ = 1 << 2;
25275        /// `EA` bit.
25276        const EA = 1 << 3;
25277        /// `FW` bit.
25278        const FW = 1 << 4;
25279        /// `AW` bit.
25280        const AW = 1 << 5;
25281        /// `nET` bit.
25282        const NET = 1 << 6;
25283        /// `SCD` bit.
25284        const SCD = 1 << 7;
25285        /// `HCE` bit.
25286        const HCE = 1 << 8;
25287        /// `SIF` bit.
25288        const SIF = 1 << 9;
25289        /// `TWI` bit.
25290        const TWI = 1 << 12;
25291        /// `TWE` bit.
25292        const TWE = 1 << 13;
25293        /// `TERR` bit.
25294        const TERR = 1 << 15;
25295    }
25296}
25297
25298impl Scr {
25299    /// Offset of the `NS` field.
25300    pub const NS_SHIFT: u32 = 0;
25301    /// Offset of the `IRQ` field.
25302    pub const IRQ_SHIFT: u32 = 1;
25303    /// Offset of the `FIQ` field.
25304    pub const FIQ_SHIFT: u32 = 2;
25305    /// Offset of the `EA` field.
25306    pub const EA_SHIFT: u32 = 3;
25307    /// Offset of the `FW` field.
25308    pub const FW_SHIFT: u32 = 4;
25309    /// Offset of the `AW` field.
25310    pub const AW_SHIFT: u32 = 5;
25311    /// Offset of the `nET` field.
25312    pub const NET_SHIFT: u32 = 6;
25313    /// Offset of the `SCD` field.
25314    pub const SCD_SHIFT: u32 = 7;
25315    /// Offset of the `HCE` field.
25316    pub const HCE_SHIFT: u32 = 8;
25317    /// Offset of the `SIF` field.
25318    pub const SIF_SHIFT: u32 = 9;
25319    /// Offset of the `TWI` field.
25320    pub const TWI_SHIFT: u32 = 12;
25321    /// Offset of the `TWE` field.
25322    pub const TWE_SHIFT: u32 = 13;
25323    /// Offset of the `TERR` field.
25324    pub const TERR_SHIFT: u32 = 15;
25325}
25326
25327#[cfg(feature = "el3")]
25328bitflags! {
25329    /// `SCR_EL3` system register value.
25330    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25331    #[repr(transparent)]
25332    pub struct ScrEl3: u64 {
25333        /// RES1 bits in the `SCR_EL3` register.
25334        const RES1 = 0b110000;
25335        /// Non-secure.
25336        const NS = 1 << 0;
25337        /// Take physical IRQs at EL3.
25338        const IRQ = 1 << 1;
25339        /// Take physical FIQs at EL3.
25340        const FIQ = 1 << 2;
25341        /// Take external abort and SError exceptions at EL3.
25342        const EA = 1 << 3;
25343        /// Disable SMC instructions.
25344        const SMD = 1 << 7;
25345        /// Enable HVC instructions.
25346        const HCE = 1 << 8;
25347        /// Disable execution from non-secure memory.
25348        const SIF = 1 << 9;
25349        /// Enable AArch64 in lower ELs.
25350        const RW = 1 << 10;
25351        /// Trap physical secure timer to EL3.
25352        const ST = 1 << 11;
25353        /// Trap WFI to EL3.
25354        const TWI = 1 << 12;
25355        /// Trap WFE to EL3.
25356        const TWE = 1 << 13;
25357        /// Trap LOR register access to EL3.
25358        const TLOR = 1 << 14;
25359        /// Trap error record register access to EL3.
25360        const TERR = 1 << 15;
25361        /// Don't trap PAC key registers to EL3.
25362        const APK = 1 << 16;
25363        /// Don't trap PAuth instructions to EL3.
25364        const API = 1 << 17;
25365        /// Enable Secure EL2.
25366        const EEL2 = 1 << 18;
25367        /// Synchronous external aborts are taken as SErrors.
25368        const EASE = 1 << 19;
25369        /// Take SError exceptions at EL3.
25370        const NMEA = 1 << 20;
25371        /// Enable fault injection at lower ELs.
25372        const FIEN = 1 << 21;
25373        /// Trap ID group 3 registers to EL3.
25374        const TID3 = 1 << 22;
25375        /// Trap ID group 5 register to EL3.
25376        const TID5 = 1 << 23;
25377        /// `POE2En` bit.
25378        const POE2EN = 1 << 24;
25379        /// Enable SCXT at lower ELs.
25380        const ENSCXT = 1 << 25;
25381        /// Enable memory tagging at lower ELs.
25382        const ATA = 1 << 26;
25383        /// Enable fine-grained traps to EL2.
25384        const FGTEN = 1 << 27;
25385        /// Enable access to CNTPOFF_EL2.
25386        const ECVEN = 1 << 28;
25387        /// Enable a configurable delay for WFE traps.
25388        const TWEDEN = 1 << 29;
25389        /// Enable activity monitors virtual offsets.
25390        const AMVOFFEN = 1 << 35;
25391        /// Enable ST64BV0 at lower ELs.
25392        const ENAS0 = 1 << 36;
25393        /// Enable ACCDATA_EL1 at lower ELs.
25394        const ADEN = 1 << 37;
25395        /// Enable HCRX_EL2.
25396        const HXEN = 1 << 38;
25397        /// Enable guarded control stack.
25398        const GCSEN = 1 << 39;
25399        /// Trap RNDR and RNDRRS to EL3.
25400        const TRNDR = 1 << 40;
25401        /// Enable TPIDR2_EL0 at lower ELs.
25402        const ENTP2 = 1 << 41;
25403        /// Enable RCW and RCWS mask registers at lower ELs.
25404        const RCWMASKEN = 1 << 42;
25405        /// Enable TCR2_ELx registers at lower ELs.
25406        const TCR2EN = 1 << 43;
25407        /// Enable SCTLR2_ELx registers at lower ELs.
25408        const SCTLR2EN = 1 << 44;
25409        /// Enable permission indirection and overlay registers at lower ELs.
25410        const PIEN = 1 << 45;
25411        /// Enable MAIR2_ELx and AMAIR2_ELx at lower ELs.
25412        const AIEN = 1 << 46;
25413        /// Enable 128-bit system registers at  lower ELs.
25414        const D128EN = 1 << 47;
25415        /// Route GPFs to EL3.
25416        const GPF = 1 << 48;
25417        /// Enable MECID registers at EL2.
25418        const MECEN = 1 << 49;
25419        /// Enable access to FPMR at lower ELs.
25420        const ENFPM = 1 << 50;
25421        /// Take synchronous external abort and physical SError exception to EL3.
25422        const TMEA = 1 << 51;
25423        /// Trap writes to Error Record registers to EL3.
25424        const TWERR = 1 << 52;
25425        /// Enable access to physical fault address registers at lower ELs.
25426        const PFAREN = 1 << 53;
25427        /// Enable access to mask registers at lower ELs.
25428        const SRMASKEN = 1 << 54;
25429        /// Enable implementation-defined 128-bit system registers.
25430        const ENIDCP128 = 1 << 55;
25431        /// `VTLBIDEn` bit.
25432        const VTLBIDEN = 1 << 56;
25433        /// A delegated SError exception is pending.
25434        const DSE = 1 << 57;
25435        /// Enable delegated SError exceptions.
25436        const ENDSE = 1 << 58;
25437        /// Enable fine-grained traps to EL2.
25438        const FGTEN2 = 1 << 59;
25439        /// Enable HDBSSBR_EL2 and HDBSSPROD_EL2 registers at EL2.
25440        const HDBSSEN = 1 << 60;
25441        /// Enable HACDBSBR_EL2 and HACDBSCONS_EL2 registers at EL2.
25442        const HACDBSEN = 1 << 61;
25443        /// Non-secure realm world bit.
25444        const NSE = 1 << 62;
25445        /// `TPLIMEn` bit.
25446        const TPLIMEN = 1 << 63;
25447    }
25448}
25449
25450#[cfg(feature = "el3")]
25451impl ScrEl3 {
25452    /// Offset of the `NS` field.
25453    pub const NS_SHIFT: u32 = 0;
25454    /// Offset of the `IRQ` field.
25455    pub const IRQ_SHIFT: u32 = 1;
25456    /// Offset of the `FIQ` field.
25457    pub const FIQ_SHIFT: u32 = 2;
25458    /// Offset of the `EA` field.
25459    pub const EA_SHIFT: u32 = 3;
25460    /// Offset of the `SMD` field.
25461    pub const SMD_SHIFT: u32 = 7;
25462    /// Offset of the `HCE` field.
25463    pub const HCE_SHIFT: u32 = 8;
25464    /// Offset of the `SIF` field.
25465    pub const SIF_SHIFT: u32 = 9;
25466    /// Offset of the `RW` field.
25467    pub const RW_SHIFT: u32 = 10;
25468    /// Offset of the `ST` field.
25469    pub const ST_SHIFT: u32 = 11;
25470    /// Offset of the `TWI` field.
25471    pub const TWI_SHIFT: u32 = 12;
25472    /// Offset of the `TWE` field.
25473    pub const TWE_SHIFT: u32 = 13;
25474    /// Offset of the `TLOR` field.
25475    pub const TLOR_SHIFT: u32 = 14;
25476    /// Offset of the `TERR` field.
25477    pub const TERR_SHIFT: u32 = 15;
25478    /// Offset of the `APK` field.
25479    pub const APK_SHIFT: u32 = 16;
25480    /// Offset of the `API` field.
25481    pub const API_SHIFT: u32 = 17;
25482    /// Offset of the `EEL2` field.
25483    pub const EEL2_SHIFT: u32 = 18;
25484    /// Offset of the `EASE` field.
25485    pub const EASE_SHIFT: u32 = 19;
25486    /// Offset of the `NMEA` field.
25487    pub const NMEA_SHIFT: u32 = 20;
25488    /// Offset of the `FIEN` field.
25489    pub const FIEN_SHIFT: u32 = 21;
25490    /// Offset of the `TID3` field.
25491    pub const TID3_SHIFT: u32 = 22;
25492    /// Offset of the `TID5` field.
25493    pub const TID5_SHIFT: u32 = 23;
25494    /// Offset of the `POE2En` field.
25495    pub const POE2EN_SHIFT: u32 = 24;
25496    /// Offset of the `EnSCXT` field.
25497    pub const ENSCXT_SHIFT: u32 = 25;
25498    /// Offset of the `ATA` field.
25499    pub const ATA_SHIFT: u32 = 26;
25500    /// Offset of the `FGTEn` field.
25501    pub const FGTEN_SHIFT: u32 = 27;
25502    /// Offset of the `ECVEn` field.
25503    pub const ECVEN_SHIFT: u32 = 28;
25504    /// Offset of the `TWEDEn` field.
25505    pub const TWEDEN_SHIFT: u32 = 29;
25506    /// Offset of the `TWEDEL` field.
25507    pub const TWEDEL_SHIFT: u32 = 30;
25508    /// Mask for the `TWEDEL` field.
25509    pub const TWEDEL_MASK: u64 = 0b1111;
25510    /// Offset of the `AMVOFFEN` field.
25511    pub const AMVOFFEN_SHIFT: u32 = 35;
25512    /// Offset of the `EnAS0` field.
25513    pub const ENAS0_SHIFT: u32 = 36;
25514    /// Offset of the `ADEn` field.
25515    pub const ADEN_SHIFT: u32 = 37;
25516    /// Offset of the `HXEn` field.
25517    pub const HXEN_SHIFT: u32 = 38;
25518    /// Offset of the `GCSEn` field.
25519    pub const GCSEN_SHIFT: u32 = 39;
25520    /// Offset of the `TRNDR` field.
25521    pub const TRNDR_SHIFT: u32 = 40;
25522    /// Offset of the `EnTP2` field.
25523    pub const ENTP2_SHIFT: u32 = 41;
25524    /// Offset of the `RCWMASKEn` field.
25525    pub const RCWMASKEN_SHIFT: u32 = 42;
25526    /// Offset of the `TCR2En` field.
25527    pub const TCR2EN_SHIFT: u32 = 43;
25528    /// Offset of the `SCTLR2En` field.
25529    pub const SCTLR2EN_SHIFT: u32 = 44;
25530    /// Offset of the `PIEn` field.
25531    pub const PIEN_SHIFT: u32 = 45;
25532    /// Offset of the `AIEn` field.
25533    pub const AIEN_SHIFT: u32 = 46;
25534    /// Offset of the `D128En` field.
25535    pub const D128EN_SHIFT: u32 = 47;
25536    /// Offset of the `GPF` field.
25537    pub const GPF_SHIFT: u32 = 48;
25538    /// Offset of the `MECEn` field.
25539    pub const MECEN_SHIFT: u32 = 49;
25540    /// Offset of the `EnFPM` field.
25541    pub const ENFPM_SHIFT: u32 = 50;
25542    /// Offset of the `TMEA` field.
25543    pub const TMEA_SHIFT: u32 = 51;
25544    /// Offset of the `TWERR` field.
25545    pub const TWERR_SHIFT: u32 = 52;
25546    /// Offset of the `PFAREn` field.
25547    pub const PFAREN_SHIFT: u32 = 53;
25548    /// Offset of the `SRMASKEn` field.
25549    pub const SRMASKEN_SHIFT: u32 = 54;
25550    /// Offset of the `EnIDCP128` field.
25551    pub const ENIDCP128_SHIFT: u32 = 55;
25552    /// Offset of the `VTLBIDEn` field.
25553    pub const VTLBIDEN_SHIFT: u32 = 56;
25554    /// Offset of the `DSE` field.
25555    pub const DSE_SHIFT: u32 = 57;
25556    /// Offset of the `EnDSE` field.
25557    pub const ENDSE_SHIFT: u32 = 58;
25558    /// Offset of the `FGTEn2` field.
25559    pub const FGTEN2_SHIFT: u32 = 59;
25560    /// Offset of the `HDBSSEn` field.
25561    pub const HDBSSEN_SHIFT: u32 = 60;
25562    /// Offset of the `HACDBSEn` field.
25563    pub const HACDBSEN_SHIFT: u32 = 61;
25564    /// Offset of the `NSE` field.
25565    pub const NSE_SHIFT: u32 = 62;
25566    /// Offset of the `TPLIMEn` field.
25567    pub const TPLIMEN_SHIFT: u32 = 63;
25568
25569    /// Returns the value of the `TWEDEL` field.
25570    pub const fn twedel(self) -> u8 {
25571        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
25572    }
25573
25574    /// Sets the value of the `TWEDEL` field.
25575    pub const fn set_twedel(&mut self, value: u8) {
25576        let offset = Self::TWEDEL_SHIFT;
25577        assert!(value & (Self::TWEDEL_MASK as u8) == value);
25578        *self = Self::from_bits_retain(
25579            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
25580        );
25581    }
25582
25583    /// Returns a copy with the `TWEDEL` field set to the given value.
25584    pub const fn with_twedel(mut self, value: u8) -> Self {
25585        self.set_twedel(value);
25586        self
25587    }
25588}
25589
25590bitflags! {
25591    /// `SCTLR` system register value.
25592    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25593    #[repr(transparent)]
25594    pub struct Sctlr: u32 {
25595        /// RES1 bits in the `SCTLR` register.
25596        const RES1 = 0b10000000000100000000000;
25597        /// `M` bit.
25598        const M = 1 << 0;
25599        /// `A` bit.
25600        const A = 1 << 1;
25601        /// `C` bit.
25602        const C = 1 << 2;
25603        /// `nTLSMD` bit.
25604        const NTLSMD = 1 << 3;
25605        /// `LSMAOE` bit.
25606        const LSMAOE = 1 << 4;
25607        /// `CP15BEN` bit.
25608        const CP15BEN = 1 << 5;
25609        /// `UNK` bit.
25610        const UNK = 1 << 6;
25611        /// `ITD` bit.
25612        const ITD = 1 << 7;
25613        /// `SED` bit.
25614        const SED = 1 << 8;
25615        /// `EnRCTX` bit.
25616        const ENRCTX = 1 << 10;
25617        /// `I` bit.
25618        const I = 1 << 12;
25619        /// `V` bit.
25620        const V = 1 << 13;
25621        /// `nTWI` bit.
25622        const NTWI = 1 << 16;
25623        /// `nTWE` bit.
25624        const NTWE = 1 << 18;
25625        /// `WXN` bit.
25626        const WXN = 1 << 19;
25627        /// `UWXN` bit.
25628        const UWXN = 1 << 20;
25629        /// `SPAN` bit.
25630        const SPAN = 1 << 23;
25631        /// `EE` bit.
25632        const EE = 1 << 25;
25633        /// `TRE` bit.
25634        const TRE = 1 << 28;
25635        /// `AFE` bit.
25636        const AFE = 1 << 29;
25637        /// `TE` bit.
25638        const TE = 1 << 30;
25639        /// `DSSBS` bit.
25640        const DSSBS = 1 << 31;
25641    }
25642}
25643
25644impl Sctlr {
25645    /// Offset of the `M` field.
25646    pub const M_SHIFT: u32 = 0;
25647    /// Offset of the `A` field.
25648    pub const A_SHIFT: u32 = 1;
25649    /// Offset of the `C` field.
25650    pub const C_SHIFT: u32 = 2;
25651    /// Offset of the `nTLSMD` field.
25652    pub const NTLSMD_SHIFT: u32 = 3;
25653    /// Offset of the `LSMAOE` field.
25654    pub const LSMAOE_SHIFT: u32 = 4;
25655    /// Offset of the `CP15BEN` field.
25656    pub const CP15BEN_SHIFT: u32 = 5;
25657    /// Offset of the `UNK` field.
25658    pub const UNK_SHIFT: u32 = 6;
25659    /// Offset of the `ITD` field.
25660    pub const ITD_SHIFT: u32 = 7;
25661    /// Offset of the `SED` field.
25662    pub const SED_SHIFT: u32 = 8;
25663    /// Offset of the `EnRCTX` field.
25664    pub const ENRCTX_SHIFT: u32 = 10;
25665    /// Offset of the `I` field.
25666    pub const I_SHIFT: u32 = 12;
25667    /// Offset of the `V` field.
25668    pub const V_SHIFT: u32 = 13;
25669    /// Offset of the `nTWI` field.
25670    pub const NTWI_SHIFT: u32 = 16;
25671    /// Offset of the `nTWE` field.
25672    pub const NTWE_SHIFT: u32 = 18;
25673    /// Offset of the `WXN` field.
25674    pub const WXN_SHIFT: u32 = 19;
25675    /// Offset of the `UWXN` field.
25676    pub const UWXN_SHIFT: u32 = 20;
25677    /// Offset of the `SPAN` field.
25678    pub const SPAN_SHIFT: u32 = 23;
25679    /// Offset of the `EE` field.
25680    pub const EE_SHIFT: u32 = 25;
25681    /// Offset of the `TRE` field.
25682    pub const TRE_SHIFT: u32 = 28;
25683    /// Offset of the `AFE` field.
25684    pub const AFE_SHIFT: u32 = 29;
25685    /// Offset of the `TE` field.
25686    pub const TE_SHIFT: u32 = 30;
25687    /// Offset of the `DSSBS` field.
25688    pub const DSSBS_SHIFT: u32 = 31;
25689}
25690
25691#[cfg(feature = "el3")]
25692bitflags! {
25693    /// `SCTLR2_EL3` system register value.
25694    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25695    #[repr(transparent)]
25696    pub struct Sctlr2El3: u64 {
25697        /// `EMEC` bit.
25698        const EMEC = 1 << 1;
25699        /// `EnADERR` bit.
25700        const ENADERR = 1 << 3;
25701        /// `EnANERR` bit.
25702        const ENANERR = 1 << 4;
25703        /// `EnPACM` bit.
25704        const ENPACM = 1 << 7;
25705        /// `CPTA` bit.
25706        const CPTA = 1 << 9;
25707        /// `CPTM` bit.
25708        const CPTM = 1 << 11;
25709        /// `DTZ` bit.
25710        const DTZ = 1 << 14;
25711        /// `TEIS` bit.
25712        const TEIS = 1 << 15;
25713        /// `TEOS` bit.
25714        const TEOS = 1 << 16;
25715        /// `VT` bit.
25716        const VT = 1 << 17;
25717        /// `BTD` bit.
25718        const BTD = 1 << 24;
25719    }
25720}
25721
25722#[cfg(feature = "el3")]
25723impl Sctlr2El3 {
25724    /// Offset of the `EMEC` field.
25725    pub const EMEC_SHIFT: u32 = 1;
25726    /// Offset of the `EnADERR` field.
25727    pub const ENADERR_SHIFT: u32 = 3;
25728    /// Offset of the `EnANERR` field.
25729    pub const ENANERR_SHIFT: u32 = 4;
25730    /// Offset of the `EnPACM` field.
25731    pub const ENPACM_SHIFT: u32 = 7;
25732    /// Offset of the `CPTA` field.
25733    pub const CPTA_SHIFT: u32 = 9;
25734    /// Offset of the `CPTM` field.
25735    pub const CPTM_SHIFT: u32 = 11;
25736    /// Offset of the `DTZ` field.
25737    pub const DTZ_SHIFT: u32 = 14;
25738    /// Offset of the `TEIS` field.
25739    pub const TEIS_SHIFT: u32 = 15;
25740    /// Offset of the `TEOS` field.
25741    pub const TEOS_SHIFT: u32 = 16;
25742    /// Offset of the `VT` field.
25743    pub const VT_SHIFT: u32 = 17;
25744    /// Offset of the `BTD` field.
25745    pub const BTD_SHIFT: u32 = 24;
25746}
25747
25748#[cfg(feature = "el1")]
25749bitflags! {
25750    /// `SCTLR_EL1` system register value.
25751    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
25752    #[repr(transparent)]
25753    pub struct SctlrEl1: u64 {
25754        /// `M` bit.
25755        const M = 1 << 0;
25756        /// `A` bit.
25757        const A = 1 << 1;
25758        /// `C` bit.
25759        const C = 1 << 2;
25760        /// `SA` bit.
25761        const SA = 1 << 3;
25762        /// `SA0` bit.
25763        const SA0 = 1 << 4;
25764        /// `CP15BEN` bit.
25765        const CP15BEN = 1 << 5;
25766        /// `nAA` bit.
25767        const NAA = 1 << 6;
25768        /// `ITD` bit.
25769        const ITD = 1 << 7;
25770        /// `SED` bit.
25771        const SED = 1 << 8;
25772        /// `UMA` bit.
25773        const UMA = 1 << 9;
25774        /// `EnRCTX` bit.
25775        const ENRCTX = 1 << 10;
25776        /// `EOS` bit.
25777        const EOS = 1 << 11;
25778        /// `I` bit.
25779        const I = 1 << 12;
25780        /// `EnDB` bit.
25781        const ENDB = 1 << 13;
25782        /// `DZE` bit.
25783        const DZE = 1 << 14;
25784        /// `UCT` bit.
25785        const UCT = 1 << 15;
25786        /// `nTWI` bit.
25787        const NTWI = 1 << 16;
25788        /// `nTWE` bit.
25789        const NTWE = 1 << 18;
25790        /// `WXN` bit.
25791        const WXN = 1 << 19;
25792        /// `TSCXT` bit.
25793        const TSCXT = 1 << 20;
25794        /// `IESB` bit.
25795        const IESB = 1 << 21;
25796        /// `EIS` bit.
25797        const EIS = 1 << 22;
25798        /// Do not set Privileged Access Never, on taking an exception to EL1.
25799        const SPAN = 1 << 23;
25800        /// `UCI` bit.
25801        const UCI = 1 << 26;
25802        /// `EnDA` bit.
25803        const ENDA = 1 << 27;
25804        /// `nTLSMD` bit.
25805        const NTLSMD = 1 << 28;
25806        /// `LSMAOE` bit.
25807        const LSMAOE = 1 << 29;
25808        /// Enable pointer authentication using APIBKey_EL1.
25809        const ENIB = 1 << 30;
25810        /// Enable pointer authentication using APIAKey_EL1.
25811        const ENIA = 1 << 31;
25812        /// `CMOW` bit.
25813        const CMOW = 1 << 32;
25814        /// `MSCEn` bit.
25815        const MSCEN = 1 << 33;
25816        /// `EnFPM` bit.
25817        const ENFPM = 1 << 34;
25818        /// `BT0` bit.
25819        const BT0 = 1 << 35;
25820        /// `BT1` bit.
25821        const BT1 = 1 << 36;
25822        /// `ITFSB` bit.
25823        const ITFSB = 1 << 37;
25824        /// `ATA0` bit.
25825        const ATA0 = 1 << 42;
25826        /// `ATA` bit.
25827        const ATA = 1 << 43;
25828        /// Default PSTATE.SSBS value on Exception Entry.
25829        const DSSBS = 1 << 44;
25830        /// `TWEDEn` bit.
25831        const TWEDEN = 1 << 45;
25832        /// `EnASR` bit.
25833        const ENASR = 1 << 54;
25834        /// `EnAS0` bit.
25835        const ENAS0 = 1 << 55;
25836        /// `EnALS` bit.
25837        const ENALS = 1 << 56;
25838        /// `EPAN` bit.
25839        const EPAN = 1 << 57;
25840        /// `TCSO0` bit.
25841        const TCSO0 = 1 << 58;
25842        /// `TCSO` bit.
25843        const TCSO = 1 << 59;
25844        /// `EnTP2` bit.
25845        const ENTP2 = 1 << 60;
25846        /// `NMI` bit.
25847        const NMI = 1 << 61;
25848        /// SP Interrupt Mask enable.
25849        const SPINTMASK = 1 << 62;
25850        /// `TIDCP` bit.
25851        const TIDCP = 1 << 63;
25852    }
25853}
25854
25855#[cfg(feature = "el1")]
25856impl SctlrEl1 {
25857    /// Offset of the `M` field.
25858    pub const M_SHIFT: u32 = 0;
25859    /// Offset of the `A` field.
25860    pub const A_SHIFT: u32 = 1;
25861    /// Offset of the `C` field.
25862    pub const C_SHIFT: u32 = 2;
25863    /// Offset of the `SA` field.
25864    pub const SA_SHIFT: u32 = 3;
25865    /// Offset of the `SA0` field.
25866    pub const SA0_SHIFT: u32 = 4;
25867    /// Offset of the `CP15BEN` field.
25868    pub const CP15BEN_SHIFT: u32 = 5;
25869    /// Offset of the `nAA` field.
25870    pub const NAA_SHIFT: u32 = 6;
25871    /// Offset of the `ITD` field.
25872    pub const ITD_SHIFT: u32 = 7;
25873    /// Offset of the `SED` field.
25874    pub const SED_SHIFT: u32 = 8;
25875    /// Offset of the `UMA` field.
25876    pub const UMA_SHIFT: u32 = 9;
25877    /// Offset of the `EnRCTX` field.
25878    pub const ENRCTX_SHIFT: u32 = 10;
25879    /// Offset of the `EOS` field.
25880    pub const EOS_SHIFT: u32 = 11;
25881    /// Offset of the `I` field.
25882    pub const I_SHIFT: u32 = 12;
25883    /// Offset of the `EnDB` field.
25884    pub const ENDB_SHIFT: u32 = 13;
25885    /// Offset of the `DZE` field.
25886    pub const DZE_SHIFT: u32 = 14;
25887    /// Offset of the `UCT` field.
25888    pub const UCT_SHIFT: u32 = 15;
25889    /// Offset of the `nTWI` field.
25890    pub const NTWI_SHIFT: u32 = 16;
25891    /// Offset of the `nTWE` field.
25892    pub const NTWE_SHIFT: u32 = 18;
25893    /// Offset of the `WXN` field.
25894    pub const WXN_SHIFT: u32 = 19;
25895    /// Offset of the `TSCXT` field.
25896    pub const TSCXT_SHIFT: u32 = 20;
25897    /// Offset of the `IESB` field.
25898    pub const IESB_SHIFT: u32 = 21;
25899    /// Offset of the `EIS` field.
25900    pub const EIS_SHIFT: u32 = 22;
25901    /// Offset of the `SPAN` field.
25902    pub const SPAN_SHIFT: u32 = 23;
25903    /// Offset of the `UCI` field.
25904    pub const UCI_SHIFT: u32 = 26;
25905    /// Offset of the `EnDA` field.
25906    pub const ENDA_SHIFT: u32 = 27;
25907    /// Offset of the `nTLSMD` field.
25908    pub const NTLSMD_SHIFT: u32 = 28;
25909    /// Offset of the `LSMAOE` field.
25910    pub const LSMAOE_SHIFT: u32 = 29;
25911    /// Offset of the `EnIB` field.
25912    pub const ENIB_SHIFT: u32 = 30;
25913    /// Offset of the `EnIA` field.
25914    pub const ENIA_SHIFT: u32 = 31;
25915    /// Offset of the `CMOW` field.
25916    pub const CMOW_SHIFT: u32 = 32;
25917    /// Offset of the `MSCEn` field.
25918    pub const MSCEN_SHIFT: u32 = 33;
25919    /// Offset of the `EnFPM` field.
25920    pub const ENFPM_SHIFT: u32 = 34;
25921    /// Offset of the `BT0` field.
25922    pub const BT0_SHIFT: u32 = 35;
25923    /// Offset of the `BT1` field.
25924    pub const BT1_SHIFT: u32 = 36;
25925    /// Offset of the `ITFSB` field.
25926    pub const ITFSB_SHIFT: u32 = 37;
25927    /// Offset of the `TCF0` field.
25928    pub const TCF0_SHIFT: u32 = 38;
25929    /// Mask for the `TCF0` field.
25930    pub const TCF0_MASK: u64 = 0b11;
25931    /// Offset of the `TCF` field.
25932    pub const TCF_SHIFT: u32 = 40;
25933    /// Mask for the `TCF` field.
25934    pub const TCF_MASK: u64 = 0b11;
25935    /// Offset of the `ATA0` field.
25936    pub const ATA0_SHIFT: u32 = 42;
25937    /// Offset of the `ATA` field.
25938    pub const ATA_SHIFT: u32 = 43;
25939    /// Offset of the `DSSBS` field.
25940    pub const DSSBS_SHIFT: u32 = 44;
25941    /// Offset of the `TWEDEn` field.
25942    pub const TWEDEN_SHIFT: u32 = 45;
25943    /// Offset of the `TWEDEL` field.
25944    pub const TWEDEL_SHIFT: u32 = 46;
25945    /// Mask for the `TWEDEL` field.
25946    pub const TWEDEL_MASK: u64 = 0b1111;
25947    /// Offset of the `EnASR` field.
25948    pub const ENASR_SHIFT: u32 = 54;
25949    /// Offset of the `EnAS0` field.
25950    pub const ENAS0_SHIFT: u32 = 55;
25951    /// Offset of the `EnALS` field.
25952    pub const ENALS_SHIFT: u32 = 56;
25953    /// Offset of the `EPAN` field.
25954    pub const EPAN_SHIFT: u32 = 57;
25955    /// Offset of the `TCSO0` field.
25956    pub const TCSO0_SHIFT: u32 = 58;
25957    /// Offset of the `TCSO` field.
25958    pub const TCSO_SHIFT: u32 = 59;
25959    /// Offset of the `EnTP2` field.
25960    pub const ENTP2_SHIFT: u32 = 60;
25961    /// Offset of the `NMI` field.
25962    pub const NMI_SHIFT: u32 = 61;
25963    /// Offset of the `SPINTMASK` field.
25964    pub const SPINTMASK_SHIFT: u32 = 62;
25965    /// Offset of the `TIDCP` field.
25966    pub const TIDCP_SHIFT: u32 = 63;
25967
25968    /// Returns the value of the `TCF0` field.
25969    pub const fn tcf0(self) -> u8 {
25970        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
25971    }
25972
25973    /// Sets the value of the `TCF0` field.
25974    pub const fn set_tcf0(&mut self, value: u8) {
25975        let offset = Self::TCF0_SHIFT;
25976        assert!(value & (Self::TCF0_MASK as u8) == value);
25977        *self = Self::from_bits_retain(
25978            (self.bits() & !(Self::TCF0_MASK << offset)) | ((value as u64) << offset),
25979        );
25980    }
25981
25982    /// Returns a copy with the `TCF0` field set to the given value.
25983    pub const fn with_tcf0(mut self, value: u8) -> Self {
25984        self.set_tcf0(value);
25985        self
25986    }
25987
25988    /// Returns the value of the `TCF` field.
25989    pub const fn tcf(self) -> u8 {
25990        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
25991    }
25992
25993    /// Sets the value of the `TCF` field.
25994    pub const fn set_tcf(&mut self, value: u8) {
25995        let offset = Self::TCF_SHIFT;
25996        assert!(value & (Self::TCF_MASK as u8) == value);
25997        *self = Self::from_bits_retain(
25998            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
25999        );
26000    }
26001
26002    /// Returns a copy with the `TCF` field set to the given value.
26003    pub const fn with_tcf(mut self, value: u8) -> Self {
26004        self.set_tcf(value);
26005        self
26006    }
26007
26008    /// Returns the value of the `TWEDEL` field.
26009    pub const fn twedel(self) -> u8 {
26010        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
26011    }
26012
26013    /// Sets the value of the `TWEDEL` field.
26014    pub const fn set_twedel(&mut self, value: u8) {
26015        let offset = Self::TWEDEL_SHIFT;
26016        assert!(value & (Self::TWEDEL_MASK as u8) == value);
26017        *self = Self::from_bits_retain(
26018            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
26019        );
26020    }
26021
26022    /// Returns a copy with the `TWEDEL` field set to the given value.
26023    pub const fn with_twedel(mut self, value: u8) -> Self {
26024        self.set_twedel(value);
26025        self
26026    }
26027}
26028
26029#[cfg(feature = "el2")]
26030bitflags! {
26031    /// `SCTLR_EL2` system register value.
26032    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26033    #[repr(transparent)]
26034    pub struct SctlrEl2: u64 {
26035        /// `M` bit.
26036        const M = 1 << 0;
26037        /// `A` bit.
26038        const A = 1 << 1;
26039        /// `C` bit.
26040        const C = 1 << 2;
26041        /// `SA` bit.
26042        const SA = 1 << 3;
26043        /// `SA0` bit.
26044        const SA0 = 1 << 4;
26045        /// `CP15BEN` bit.
26046        const CP15BEN = 1 << 5;
26047        /// `nAA` bit.
26048        const NAA = 1 << 6;
26049        /// `SED` bit.
26050        const SED = 1 << 8;
26051        /// `UMA` bit.
26052        const UMA = 1 << 9;
26053        /// `EnRCTX` bit.
26054        const ENRCTX = 1 << 10;
26055        /// `EOS` bit.
26056        const EOS = 1 << 11;
26057        /// `I` bit.
26058        const I = 1 << 12;
26059        /// `EnDB` bit.
26060        const ENDB = 1 << 13;
26061        /// `DZE` bit.
26062        const DZE = 1 << 14;
26063        /// `UCT` bit.
26064        const UCT = 1 << 15;
26065        /// `nTWI` bit.
26066        const NTWI = 1 << 16;
26067        /// `nTWE` bit.
26068        const NTWE = 1 << 18;
26069        /// `WXN` bit.
26070        const WXN = 1 << 19;
26071        /// `IESB` bit.
26072        const IESB = 1 << 21;
26073        /// `EIS` bit.
26074        const EIS = 1 << 22;
26075        /// Do not set Privileged Access Never, on taking an exception to EL2.
26076        const SPAN = 1 << 23;
26077        /// `UCI` bit.
26078        const UCI = 1 << 26;
26079        /// `EnDA` bit.
26080        const ENDA = 1 << 27;
26081        /// `nTLSMD` bit.
26082        const NTLSMD = 1 << 28;
26083        /// `LSMAOE` bit.
26084        const LSMAOE = 1 << 29;
26085        /// Enable pointer authentication using APIBKey_EL1.
26086        const ENIB = 1 << 30;
26087        /// Enable pointer authentication using APIAKey_EL1.
26088        const ENIA = 1 << 31;
26089        /// `CMOW` bit.
26090        const CMOW = 1 << 32;
26091        /// `MSCEn` bit.
26092        const MSCEN = 1 << 33;
26093        /// `EnFPM` bit.
26094        const ENFPM = 1 << 34;
26095        /// `BT0` bit.
26096        const BT0 = 1 << 35;
26097        /// `BT` bit.
26098        const BT = 1 << 36;
26099        /// `ITFSB` bit.
26100        const ITFSB = 1 << 37;
26101        /// `ATA0` bit.
26102        const ATA0 = 1 << 42;
26103        /// `ATA` bit.
26104        const ATA = 1 << 43;
26105        /// Default PSTATE.SSBS value on Exception Entry.
26106        const DSSBS = 1 << 44;
26107        /// `TWEDEn` bit.
26108        const TWEDEN = 1 << 45;
26109        /// `EnASR` bit.
26110        const ENASR = 1 << 54;
26111        /// `EnAS0` bit.
26112        const ENAS0 = 1 << 55;
26113        /// `EnALS` bit.
26114        const ENALS = 1 << 56;
26115        /// `EPAN` bit.
26116        const EPAN = 1 << 57;
26117        /// `TCSO0` bit.
26118        const TCSO0 = 1 << 58;
26119        /// `TCSO` bit.
26120        const TCSO = 1 << 59;
26121        /// `EnTP2` bit.
26122        const ENTP2 = 1 << 60;
26123        /// `NMI` bit.
26124        const NMI = 1 << 61;
26125        /// SP Interrupt Mask enable.
26126        const SPINTMASK = 1 << 62;
26127        /// `TIDCP` bit.
26128        const TIDCP = 1 << 63;
26129    }
26130}
26131
26132#[cfg(feature = "el2")]
26133impl SctlrEl2 {
26134    /// Offset of the `M` field.
26135    pub const M_SHIFT: u32 = 0;
26136    /// Offset of the `A` field.
26137    pub const A_SHIFT: u32 = 1;
26138    /// Offset of the `C` field.
26139    pub const C_SHIFT: u32 = 2;
26140    /// Offset of the `SA` field.
26141    pub const SA_SHIFT: u32 = 3;
26142    /// Offset of the `SA0` field.
26143    pub const SA0_SHIFT: u32 = 4;
26144    /// Offset of the `CP15BEN` field.
26145    pub const CP15BEN_SHIFT: u32 = 5;
26146    /// Offset of the `nAA` field.
26147    pub const NAA_SHIFT: u32 = 6;
26148    /// Offset of the `SED` field.
26149    pub const SED_SHIFT: u32 = 8;
26150    /// Offset of the `UMA` field.
26151    pub const UMA_SHIFT: u32 = 9;
26152    /// Offset of the `EnRCTX` field.
26153    pub const ENRCTX_SHIFT: u32 = 10;
26154    /// Offset of the `EOS` field.
26155    pub const EOS_SHIFT: u32 = 11;
26156    /// Offset of the `I` field.
26157    pub const I_SHIFT: u32 = 12;
26158    /// Offset of the `EnDB` field.
26159    pub const ENDB_SHIFT: u32 = 13;
26160    /// Offset of the `DZE` field.
26161    pub const DZE_SHIFT: u32 = 14;
26162    /// Offset of the `UCT` field.
26163    pub const UCT_SHIFT: u32 = 15;
26164    /// Offset of the `nTWI` field.
26165    pub const NTWI_SHIFT: u32 = 16;
26166    /// Offset of the `nTWE` field.
26167    pub const NTWE_SHIFT: u32 = 18;
26168    /// Offset of the `WXN` field.
26169    pub const WXN_SHIFT: u32 = 19;
26170    /// Offset of the `IESB` field.
26171    pub const IESB_SHIFT: u32 = 21;
26172    /// Offset of the `EIS` field.
26173    pub const EIS_SHIFT: u32 = 22;
26174    /// Offset of the `SPAN` field.
26175    pub const SPAN_SHIFT: u32 = 23;
26176    /// Offset of the `UCI` field.
26177    pub const UCI_SHIFT: u32 = 26;
26178    /// Offset of the `EnDA` field.
26179    pub const ENDA_SHIFT: u32 = 27;
26180    /// Offset of the `nTLSMD` field.
26181    pub const NTLSMD_SHIFT: u32 = 28;
26182    /// Offset of the `LSMAOE` field.
26183    pub const LSMAOE_SHIFT: u32 = 29;
26184    /// Offset of the `EnIB` field.
26185    pub const ENIB_SHIFT: u32 = 30;
26186    /// Offset of the `EnIA` field.
26187    pub const ENIA_SHIFT: u32 = 31;
26188    /// Offset of the `CMOW` field.
26189    pub const CMOW_SHIFT: u32 = 32;
26190    /// Offset of the `MSCEn` field.
26191    pub const MSCEN_SHIFT: u32 = 33;
26192    /// Offset of the `EnFPM` field.
26193    pub const ENFPM_SHIFT: u32 = 34;
26194    /// Offset of the `BT0` field.
26195    pub const BT0_SHIFT: u32 = 35;
26196    /// Offset of the `BT` field.
26197    pub const BT_SHIFT: u32 = 36;
26198    /// Offset of the `ITFSB` field.
26199    pub const ITFSB_SHIFT: u32 = 37;
26200    /// Offset of the `TCF0` field.
26201    pub const TCF0_SHIFT: u32 = 38;
26202    /// Mask for the `TCF0` field.
26203    pub const TCF0_MASK: u64 = 0b11;
26204    /// Offset of the `TCF` field.
26205    pub const TCF_SHIFT: u32 = 40;
26206    /// Mask for the `TCF` field.
26207    pub const TCF_MASK: u64 = 0b11;
26208    /// Offset of the `ATA0` field.
26209    pub const ATA0_SHIFT: u32 = 42;
26210    /// Offset of the `ATA` field.
26211    pub const ATA_SHIFT: u32 = 43;
26212    /// Offset of the `DSSBS` field.
26213    pub const DSSBS_SHIFT: u32 = 44;
26214    /// Offset of the `TWEDEn` field.
26215    pub const TWEDEN_SHIFT: u32 = 45;
26216    /// Offset of the `TWEDEL` field.
26217    pub const TWEDEL_SHIFT: u32 = 46;
26218    /// Mask for the `TWEDEL` field.
26219    pub const TWEDEL_MASK: u64 = 0b1111;
26220    /// Offset of the `EnASR` field.
26221    pub const ENASR_SHIFT: u32 = 54;
26222    /// Offset of the `EnAS0` field.
26223    pub const ENAS0_SHIFT: u32 = 55;
26224    /// Offset of the `EnALS` field.
26225    pub const ENALS_SHIFT: u32 = 56;
26226    /// Offset of the `EPAN` field.
26227    pub const EPAN_SHIFT: u32 = 57;
26228    /// Offset of the `TCSO0` field.
26229    pub const TCSO0_SHIFT: u32 = 58;
26230    /// Offset of the `TCSO` field.
26231    pub const TCSO_SHIFT: u32 = 59;
26232    /// Offset of the `EnTP2` field.
26233    pub const ENTP2_SHIFT: u32 = 60;
26234    /// Offset of the `NMI` field.
26235    pub const NMI_SHIFT: u32 = 61;
26236    /// Offset of the `SPINTMASK` field.
26237    pub const SPINTMASK_SHIFT: u32 = 62;
26238    /// Offset of the `TIDCP` field.
26239    pub const TIDCP_SHIFT: u32 = 63;
26240
26241    /// Returns the value of the `TCF0` field.
26242    pub const fn tcf0(self) -> u8 {
26243        ((self.bits() >> Self::TCF0_SHIFT) & 0b11) as u8
26244    }
26245
26246    /// Sets the value of the `TCF0` field.
26247    pub const fn set_tcf0(&mut self, value: u8) {
26248        let offset = Self::TCF0_SHIFT;
26249        assert!(value & (Self::TCF0_MASK as u8) == value);
26250        *self = Self::from_bits_retain(
26251            (self.bits() & !(Self::TCF0_MASK << offset)) | ((value as u64) << offset),
26252        );
26253    }
26254
26255    /// Returns a copy with the `TCF0` field set to the given value.
26256    pub const fn with_tcf0(mut self, value: u8) -> Self {
26257        self.set_tcf0(value);
26258        self
26259    }
26260
26261    /// Returns the value of the `TCF` field.
26262    pub const fn tcf(self) -> u8 {
26263        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
26264    }
26265
26266    /// Sets the value of the `TCF` field.
26267    pub const fn set_tcf(&mut self, value: u8) {
26268        let offset = Self::TCF_SHIFT;
26269        assert!(value & (Self::TCF_MASK as u8) == value);
26270        *self = Self::from_bits_retain(
26271            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
26272        );
26273    }
26274
26275    /// Returns a copy with the `TCF` field set to the given value.
26276    pub const fn with_tcf(mut self, value: u8) -> Self {
26277        self.set_tcf(value);
26278        self
26279    }
26280
26281    /// Returns the value of the `TWEDEL` field.
26282    pub const fn twedel(self) -> u8 {
26283        ((self.bits() >> Self::TWEDEL_SHIFT) & 0b1111) as u8
26284    }
26285
26286    /// Sets the value of the `TWEDEL` field.
26287    pub const fn set_twedel(&mut self, value: u8) {
26288        let offset = Self::TWEDEL_SHIFT;
26289        assert!(value & (Self::TWEDEL_MASK as u8) == value);
26290        *self = Self::from_bits_retain(
26291            (self.bits() & !(Self::TWEDEL_MASK << offset)) | ((value as u64) << offset),
26292        );
26293    }
26294
26295    /// Returns a copy with the `TWEDEL` field set to the given value.
26296    pub const fn with_twedel(mut self, value: u8) -> Self {
26297        self.set_twedel(value);
26298        self
26299    }
26300}
26301
26302#[cfg(feature = "el3")]
26303bitflags! {
26304    /// `SCTLR_EL3` system register value.
26305    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26306    #[repr(transparent)]
26307    pub struct SctlrEl3: u64 {
26308        /// RES1 bits in the `SCTLR_EL3` register.
26309        const RES1 = 0b110000100001010000000000110000;
26310        /// MMU enable for EL3 stage 1 address translation.
26311        const M = 1 << 0;
26312        /// Alignment check enable.
26313        const A = 1 << 1;
26314        /// Cacheability control, for data accesses at EL3.
26315        const C = 1 << 2;
26316        /// SP alignment check enable.
26317        const SA = 1 << 3;
26318        /// `nAA` bit.
26319        const NAA = 1 << 6;
26320        /// `EOS` bit.
26321        const EOS = 1 << 11;
26322        /// Cacheability control, for instruction accesses at EL3.
26323        const I = 1 << 12;
26324        /// `EnDB` bit.
26325        const ENDB = 1 << 13;
26326        /// 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.
26327        const WXN = 1 << 19;
26328        /// Enable Implicit Error Synchronization events.
26329        const IESB = 1 << 21;
26330        /// `EIS` bit.
26331        const EIS = 1 << 22;
26332        /// `EnDA` bit.
26333        const ENDA = 1 << 27;
26334        /// Enable pointer authentication using APIBKey_EL1.
26335        const ENIB = 1 << 30;
26336        /// Enable pointer authentication using APIAKey_EL1.
26337        const ENIA = 1 << 31;
26338        /// `BT` bit.
26339        const BT = 1 << 36;
26340        /// `ITFSB` bit.
26341        const ITFSB = 1 << 37;
26342        /// `ATA` bit.
26343        const ATA = 1 << 43;
26344        /// `DSSBS` bit.
26345        const DSSBS = 1 << 44;
26346        /// `TCSO` bit.
26347        const TCSO = 1 << 59;
26348        /// `NMI` bit.
26349        const NMI = 1 << 61;
26350        /// `SPINTMASK` bit.
26351        const SPINTMASK = 1 << 62;
26352    }
26353}
26354
26355#[cfg(feature = "el3")]
26356impl SctlrEl3 {
26357    /// Offset of the `M` field.
26358    pub const M_SHIFT: u32 = 0;
26359    /// Offset of the `A` field.
26360    pub const A_SHIFT: u32 = 1;
26361    /// Offset of the `C` field.
26362    pub const C_SHIFT: u32 = 2;
26363    /// Offset of the `SA` field.
26364    pub const SA_SHIFT: u32 = 3;
26365    /// Offset of the `nAA` field.
26366    pub const NAA_SHIFT: u32 = 6;
26367    /// Offset of the `EOS` field.
26368    pub const EOS_SHIFT: u32 = 11;
26369    /// Offset of the `I` field.
26370    pub const I_SHIFT: u32 = 12;
26371    /// Offset of the `EnDB` field.
26372    pub const ENDB_SHIFT: u32 = 13;
26373    /// Offset of the `WXN` field.
26374    pub const WXN_SHIFT: u32 = 19;
26375    /// Offset of the `IESB` field.
26376    pub const IESB_SHIFT: u32 = 21;
26377    /// Offset of the `EIS` field.
26378    pub const EIS_SHIFT: u32 = 22;
26379    /// Offset of the `EnDA` field.
26380    pub const ENDA_SHIFT: u32 = 27;
26381    /// Offset of the `EnIB` field.
26382    pub const ENIB_SHIFT: u32 = 30;
26383    /// Offset of the `EnIA` field.
26384    pub const ENIA_SHIFT: u32 = 31;
26385    /// Offset of the `BT` field.
26386    pub const BT_SHIFT: u32 = 36;
26387    /// Offset of the `ITFSB` field.
26388    pub const ITFSB_SHIFT: u32 = 37;
26389    /// Offset of the `TCF` field.
26390    pub const TCF_SHIFT: u32 = 40;
26391    /// Mask for the `TCF` field.
26392    pub const TCF_MASK: u64 = 0b11;
26393    /// Offset of the `ATA` field.
26394    pub const ATA_SHIFT: u32 = 43;
26395    /// Offset of the `DSSBS` field.
26396    pub const DSSBS_SHIFT: u32 = 44;
26397    /// Offset of the `TCSO` field.
26398    pub const TCSO_SHIFT: u32 = 59;
26399    /// Offset of the `NMI` field.
26400    pub const NMI_SHIFT: u32 = 61;
26401    /// Offset of the `SPINTMASK` field.
26402    pub const SPINTMASK_SHIFT: u32 = 62;
26403
26404    /// Returns the value of the `TCF` field.
26405    pub const fn tcf(self) -> u8 {
26406        ((self.bits() >> Self::TCF_SHIFT) & 0b11) as u8
26407    }
26408
26409    /// Sets the value of the `TCF` field.
26410    pub const fn set_tcf(&mut self, value: u8) {
26411        let offset = Self::TCF_SHIFT;
26412        assert!(value & (Self::TCF_MASK as u8) == value);
26413        *self = Self::from_bits_retain(
26414            (self.bits() & !(Self::TCF_MASK << offset)) | ((value as u64) << offset),
26415        );
26416    }
26417
26418    /// Returns a copy with the `TCF` field set to the given value.
26419    pub const fn with_tcf(mut self, value: u8) -> Self {
26420        self.set_tcf(value);
26421        self
26422    }
26423}
26424
26425bitflags! {
26426    /// `SDCR` system register value.
26427    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26428    #[repr(transparent)]
26429    pub struct Sdcr: u32 {
26430        /// `SPME` bit.
26431        const SPME = 1 << 17;
26432        /// `STE` bit.
26433        const STE = 1 << 18;
26434        /// `TTRF` bit.
26435        const TTRF = 1 << 19;
26436        /// `EDAD` bit.
26437        const EDAD = 1 << 20;
26438        /// `EPMAD` bit.
26439        const EPMAD = 1 << 21;
26440        /// `SCCD` bit.
26441        const SCCD = 1 << 23;
26442        /// `TDCC` bit.
26443        const TDCC = 1 << 27;
26444        /// `MTPME` bit.
26445        const MTPME = 1 << 28;
26446    }
26447}
26448
26449impl Sdcr {
26450    /// Offset of the `SPD` field.
26451    pub const SPD_SHIFT: u32 = 14;
26452    /// Mask for the `SPD` field.
26453    pub const SPD_MASK: u32 = 0b11;
26454    /// Offset of the `SPME` field.
26455    pub const SPME_SHIFT: u32 = 17;
26456    /// Offset of the `STE` field.
26457    pub const STE_SHIFT: u32 = 18;
26458    /// Offset of the `TTRF` field.
26459    pub const TTRF_SHIFT: u32 = 19;
26460    /// Offset of the `EDAD` field.
26461    pub const EDAD_SHIFT: u32 = 20;
26462    /// Offset of the `EPMAD` field.
26463    pub const EPMAD_SHIFT: u32 = 21;
26464    /// Offset of the `SCCD` field.
26465    pub const SCCD_SHIFT: u32 = 23;
26466    /// Offset of the `TDCC` field.
26467    pub const TDCC_SHIFT: u32 = 27;
26468    /// Offset of the `MTPME` field.
26469    pub const MTPME_SHIFT: u32 = 28;
26470
26471    /// Returns the value of the `SPD` field.
26472    pub const fn spd(self) -> u8 {
26473        ((self.bits() >> Self::SPD_SHIFT) & 0b11) as u8
26474    }
26475
26476    /// Sets the value of the `SPD` field.
26477    pub const fn set_spd(&mut self, value: u8) {
26478        let offset = Self::SPD_SHIFT;
26479        assert!(value & (Self::SPD_MASK as u8) == value);
26480        *self = Self::from_bits_retain(
26481            (self.bits() & !(Self::SPD_MASK << offset)) | ((value as u32) << offset),
26482        );
26483    }
26484
26485    /// Returns a copy with the `SPD` field set to the given value.
26486    pub const fn with_spd(mut self, value: u8) -> Self {
26487        self.set_spd(value);
26488        self
26489    }
26490}
26491
26492bitflags! {
26493    /// `SDER` system register value.
26494    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26495    #[repr(transparent)]
26496    pub struct Sder: u32 {
26497        /// `SUIDEN` bit.
26498        const SUIDEN = 1 << 0;
26499        /// `SUNIDEN` bit.
26500        const SUNIDEN = 1 << 1;
26501    }
26502}
26503
26504impl Sder {
26505    /// Offset of the `SUIDEN` field.
26506    pub const SUIDEN_SHIFT: u32 = 0;
26507    /// Offset of the `SUNIDEN` field.
26508    pub const SUNIDEN_SHIFT: u32 = 1;
26509}
26510
26511#[cfg(feature = "el3")]
26512bitflags! {
26513    /// `SMCR_EL3` system register value.
26514    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26515    #[repr(transparent)]
26516    pub struct SmcrEl3: u64 {
26517        /// `EZT0` bit.
26518        const EZT0 = 1 << 30;
26519        /// `FA64` bit.
26520        const FA64 = 1 << 31;
26521    }
26522}
26523
26524#[cfg(feature = "el3")]
26525impl SmcrEl3 {
26526    /// Offset of the `LEN` field.
26527    pub const LEN_SHIFT: u32 = 0;
26528    /// Mask for the `LEN` field.
26529    pub const LEN_MASK: u64 = 0b1111;
26530    /// Offset of the `EZT0` field.
26531    pub const EZT0_SHIFT: u32 = 30;
26532    /// Offset of the `FA64` field.
26533    pub const FA64_SHIFT: u32 = 31;
26534
26535    /// Returns the value of the `LEN` field.
26536    pub const fn len(self) -> u8 {
26537        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
26538    }
26539
26540    /// Sets the value of the `LEN` field.
26541    pub const fn set_len(&mut self, value: u8) {
26542        let offset = Self::LEN_SHIFT;
26543        assert!(value & (Self::LEN_MASK as u8) == value);
26544        *self = Self::from_bits_retain(
26545            (self.bits() & !(Self::LEN_MASK << offset)) | ((value as u64) << offset),
26546        );
26547    }
26548
26549    /// Returns a copy with the `LEN` field set to the given value.
26550    pub const fn with_len(mut self, value: u8) -> Self {
26551        self.set_len(value);
26552        self
26553    }
26554}
26555
26556#[cfg(feature = "el1")]
26557bitflags! {
26558    /// `SPSR_EL1` system register value.
26559    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26560    #[repr(transparent)]
26561    pub struct SpsrEl1: u64 {
26562        /// `M[4]` bit.
26563        const M_4 = 1 << 4;
26564        /// `T` bit.
26565        const T = 1 << 5;
26566        /// `F` bit.
26567        const F = 1 << 6;
26568        /// `I` bit.
26569        const I = 1 << 7;
26570        /// `A` bit.
26571        const A = 1 << 8;
26572        /// `D` bit.
26573        const D = 1 << 9;
26574        /// `E` bit.
26575        const E = 1 << 9;
26576        /// `ALLINT` bit.
26577        const ALLINT = 1 << 13;
26578        /// `BTYPE2` bit.
26579        const BTYPE2 = 1 << 14;
26580        /// `IL` bit.
26581        const IL = 1 << 20;
26582        /// `SS` bit.
26583        const SS = 1 << 21;
26584        /// `PAN` bit.
26585        const PAN = 1 << 22;
26586        /// `UAO` bit.
26587        const UAO = 1 << 23;
26588        /// `DIT` bit.
26589        const DIT = 1 << 24;
26590        /// `TCO` bit.
26591        const TCO = 1 << 25;
26592        /// `Q` bit.
26593        const Q = 1 << 27;
26594        /// `V` bit.
26595        const V = 1 << 28;
26596        /// `C` bit.
26597        const C = 1 << 29;
26598        /// `Z` bit.
26599        const Z = 1 << 30;
26600        /// `N` bit.
26601        const N = 1 << 31;
26602        /// `PM` bit.
26603        const PM = 1 << 32;
26604        /// `PPEND` bit.
26605        const PPEND = 1 << 33;
26606        /// `EXLOCK` bit.
26607        const EXLOCK = 1 << 34;
26608        /// `PACM` bit.
26609        const PACM = 1 << 35;
26610        /// `UINJ` bit.
26611        const UINJ = 1 << 36;
26612    }
26613}
26614
26615#[cfg(feature = "el1")]
26616impl SpsrEl1 {
26617    /// Offset of the `M[3:0]` field.
26618    pub const M_3_0_SHIFT: u32 = 0;
26619    /// Mask for the `M[3:0]` field.
26620    pub const M_3_0_MASK: u64 = 0b1111;
26621    /// Offset of the `M[4]` field.
26622    pub const M_4_SHIFT: u32 = 4;
26623    /// Offset of the `T` field.
26624    pub const T_SHIFT: u32 = 5;
26625    /// Offset of the `F` field.
26626    pub const F_SHIFT: u32 = 6;
26627    /// Offset of the `I` field.
26628    pub const I_SHIFT: u32 = 7;
26629    /// Offset of the `A` field.
26630    pub const A_SHIFT: u32 = 8;
26631    /// Offset of the `D` field.
26632    pub const D_SHIFT: u32 = 9;
26633    /// Offset of the `E` field.
26634    pub const E_SHIFT: u32 = 9;
26635    /// Offset of the `BTYPE` field.
26636    pub const BTYPE_SHIFT: u32 = 10;
26637    /// Mask for the `BTYPE` field.
26638    pub const BTYPE_MASK: u64 = 0b11;
26639    /// Offset of the `ALLINT` field.
26640    pub const ALLINT_SHIFT: u32 = 13;
26641    /// Offset of the `BTYPE2` field.
26642    pub const BTYPE2_SHIFT: u32 = 14;
26643    /// Offset of the `GE` field.
26644    pub const GE_SHIFT: u32 = 16;
26645    /// Mask for the `GE` field.
26646    pub const GE_MASK: u64 = 0b1111;
26647    /// Offset of the `IL` field.
26648    pub const IL_SHIFT: u32 = 20;
26649    /// Offset of the `SS` field.
26650    pub const SS_SHIFT: u32 = 21;
26651    /// Offset of the `PAN` field.
26652    pub const PAN_SHIFT: u32 = 22;
26653    /// Offset of the `UAO` field.
26654    pub const UAO_SHIFT: u32 = 23;
26655    /// Offset of the `DIT` field.
26656    pub const DIT_SHIFT: u32 = 24;
26657    /// Offset of the `TCO` field.
26658    pub const TCO_SHIFT: u32 = 25;
26659    /// Offset of the `Q` field.
26660    pub const Q_SHIFT: u32 = 27;
26661    /// Offset of the `V` field.
26662    pub const V_SHIFT: u32 = 28;
26663    /// Offset of the `C` field.
26664    pub const C_SHIFT: u32 = 29;
26665    /// Offset of the `Z` field.
26666    pub const Z_SHIFT: u32 = 30;
26667    /// Offset of the `N` field.
26668    pub const N_SHIFT: u32 = 31;
26669    /// Offset of the `PM` field.
26670    pub const PM_SHIFT: u32 = 32;
26671    /// Offset of the `PPEND` field.
26672    pub const PPEND_SHIFT: u32 = 33;
26673    /// Offset of the `EXLOCK` field.
26674    pub const EXLOCK_SHIFT: u32 = 34;
26675    /// Offset of the `PACM` field.
26676    pub const PACM_SHIFT: u32 = 35;
26677    /// Offset of the `UINJ` field.
26678    pub const UINJ_SHIFT: u32 = 36;
26679
26680    /// Returns the value of the `M[3:0]` field.
26681    pub const fn m_3_0(self) -> u8 {
26682        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
26683    }
26684
26685    /// Sets the value of the `M[3:0]` field.
26686    pub const fn set_m_3_0(&mut self, value: u8) {
26687        let offset = Self::M_3_0_SHIFT;
26688        assert!(value & (Self::M_3_0_MASK as u8) == value);
26689        *self = Self::from_bits_retain(
26690            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
26691        );
26692    }
26693
26694    /// Returns a copy with the `M[3:0]` field set to the given value.
26695    pub const fn with_m_3_0(mut self, value: u8) -> Self {
26696        self.set_m_3_0(value);
26697        self
26698    }
26699
26700    /// Returns the value of the `BTYPE` field.
26701    pub const fn btype(self) -> u8 {
26702        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
26703    }
26704
26705    /// Sets the value of the `BTYPE` field.
26706    pub const fn set_btype(&mut self, value: u8) {
26707        let offset = Self::BTYPE_SHIFT;
26708        assert!(value & (Self::BTYPE_MASK as u8) == value);
26709        *self = Self::from_bits_retain(
26710            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
26711        );
26712    }
26713
26714    /// Returns a copy with the `BTYPE` field set to the given value.
26715    pub const fn with_btype(mut self, value: u8) -> Self {
26716        self.set_btype(value);
26717        self
26718    }
26719
26720    /// Returns the value of the `GE` field.
26721    pub const fn ge(self) -> u8 {
26722        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
26723    }
26724
26725    /// Sets the value of the `GE` field.
26726    pub const fn set_ge(&mut self, value: u8) {
26727        let offset = Self::GE_SHIFT;
26728        assert!(value & (Self::GE_MASK as u8) == value);
26729        *self = Self::from_bits_retain(
26730            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
26731        );
26732    }
26733
26734    /// Returns a copy with the `GE` field set to the given value.
26735    pub const fn with_ge(mut self, value: u8) -> Self {
26736        self.set_ge(value);
26737        self
26738    }
26739}
26740
26741#[cfg(feature = "el2")]
26742bitflags! {
26743    /// `SPSR_EL2` system register value.
26744    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26745    #[repr(transparent)]
26746    pub struct SpsrEl2: u64 {
26747        /// `M[4]` bit.
26748        const M_4 = 1 << 4;
26749        /// `T` bit.
26750        const T = 1 << 5;
26751        /// `F` bit.
26752        const F = 1 << 6;
26753        /// `I` bit.
26754        const I = 1 << 7;
26755        /// `A` bit.
26756        const A = 1 << 8;
26757        /// `D` bit.
26758        const D = 1 << 9;
26759        /// `E` bit.
26760        const E = 1 << 9;
26761        /// `ALLINT` bit.
26762        const ALLINT = 1 << 13;
26763        /// `BTYPE2` bit.
26764        const BTYPE2 = 1 << 14;
26765        /// `IL` bit.
26766        const IL = 1 << 20;
26767        /// `SS` bit.
26768        const SS = 1 << 21;
26769        /// `PAN` bit.
26770        const PAN = 1 << 22;
26771        /// `UAO` bit.
26772        const UAO = 1 << 23;
26773        /// `DIT` bit.
26774        const DIT = 1 << 24;
26775        /// `TCO` bit.
26776        const TCO = 1 << 25;
26777        /// `Q` bit.
26778        const Q = 1 << 27;
26779        /// `V` bit.
26780        const V = 1 << 28;
26781        /// `C` bit.
26782        const C = 1 << 29;
26783        /// `Z` bit.
26784        const Z = 1 << 30;
26785        /// `N` bit.
26786        const N = 1 << 31;
26787        /// `PM` bit.
26788        const PM = 1 << 32;
26789        /// `PPEND` bit.
26790        const PPEND = 1 << 33;
26791        /// `EXLOCK` bit.
26792        const EXLOCK = 1 << 34;
26793        /// `PACM` bit.
26794        const PACM = 1 << 35;
26795        /// `UINJ` bit.
26796        const UINJ = 1 << 36;
26797    }
26798}
26799
26800#[cfg(feature = "el2")]
26801impl SpsrEl2 {
26802    /// Offset of the `M[3:0]` field.
26803    pub const M_3_0_SHIFT: u32 = 0;
26804    /// Mask for the `M[3:0]` field.
26805    pub const M_3_0_MASK: u64 = 0b1111;
26806    /// Offset of the `M[4]` field.
26807    pub const M_4_SHIFT: u32 = 4;
26808    /// Offset of the `T` field.
26809    pub const T_SHIFT: u32 = 5;
26810    /// Offset of the `F` field.
26811    pub const F_SHIFT: u32 = 6;
26812    /// Offset of the `I` field.
26813    pub const I_SHIFT: u32 = 7;
26814    /// Offset of the `A` field.
26815    pub const A_SHIFT: u32 = 8;
26816    /// Offset of the `D` field.
26817    pub const D_SHIFT: u32 = 9;
26818    /// Offset of the `E` field.
26819    pub const E_SHIFT: u32 = 9;
26820    /// Offset of the `BTYPE` field.
26821    pub const BTYPE_SHIFT: u32 = 10;
26822    /// Mask for the `BTYPE` field.
26823    pub const BTYPE_MASK: u64 = 0b11;
26824    /// Offset of the `ALLINT` field.
26825    pub const ALLINT_SHIFT: u32 = 13;
26826    /// Offset of the `BTYPE2` field.
26827    pub const BTYPE2_SHIFT: u32 = 14;
26828    /// Offset of the `GE` field.
26829    pub const GE_SHIFT: u32 = 16;
26830    /// Mask for the `GE` field.
26831    pub const GE_MASK: u64 = 0b1111;
26832    /// Offset of the `IL` field.
26833    pub const IL_SHIFT: u32 = 20;
26834    /// Offset of the `SS` field.
26835    pub const SS_SHIFT: u32 = 21;
26836    /// Offset of the `PAN` field.
26837    pub const PAN_SHIFT: u32 = 22;
26838    /// Offset of the `UAO` field.
26839    pub const UAO_SHIFT: u32 = 23;
26840    /// Offset of the `DIT` field.
26841    pub const DIT_SHIFT: u32 = 24;
26842    /// Offset of the `TCO` field.
26843    pub const TCO_SHIFT: u32 = 25;
26844    /// Offset of the `Q` field.
26845    pub const Q_SHIFT: u32 = 27;
26846    /// Offset of the `V` field.
26847    pub const V_SHIFT: u32 = 28;
26848    /// Offset of the `C` field.
26849    pub const C_SHIFT: u32 = 29;
26850    /// Offset of the `Z` field.
26851    pub const Z_SHIFT: u32 = 30;
26852    /// Offset of the `N` field.
26853    pub const N_SHIFT: u32 = 31;
26854    /// Offset of the `PM` field.
26855    pub const PM_SHIFT: u32 = 32;
26856    /// Offset of the `PPEND` field.
26857    pub const PPEND_SHIFT: u32 = 33;
26858    /// Offset of the `EXLOCK` field.
26859    pub const EXLOCK_SHIFT: u32 = 34;
26860    /// Offset of the `PACM` field.
26861    pub const PACM_SHIFT: u32 = 35;
26862    /// Offset of the `UINJ` field.
26863    pub const UINJ_SHIFT: u32 = 36;
26864
26865    /// Returns the value of the `M[3:0]` field.
26866    pub const fn m_3_0(self) -> u8 {
26867        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
26868    }
26869
26870    /// Sets the value of the `M[3:0]` field.
26871    pub const fn set_m_3_0(&mut self, value: u8) {
26872        let offset = Self::M_3_0_SHIFT;
26873        assert!(value & (Self::M_3_0_MASK as u8) == value);
26874        *self = Self::from_bits_retain(
26875            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
26876        );
26877    }
26878
26879    /// Returns a copy with the `M[3:0]` field set to the given value.
26880    pub const fn with_m_3_0(mut self, value: u8) -> Self {
26881        self.set_m_3_0(value);
26882        self
26883    }
26884
26885    /// Returns the value of the `BTYPE` field.
26886    pub const fn btype(self) -> u8 {
26887        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
26888    }
26889
26890    /// Sets the value of the `BTYPE` field.
26891    pub const fn set_btype(&mut self, value: u8) {
26892        let offset = Self::BTYPE_SHIFT;
26893        assert!(value & (Self::BTYPE_MASK as u8) == value);
26894        *self = Self::from_bits_retain(
26895            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
26896        );
26897    }
26898
26899    /// Returns a copy with the `BTYPE` field set to the given value.
26900    pub const fn with_btype(mut self, value: u8) -> Self {
26901        self.set_btype(value);
26902        self
26903    }
26904
26905    /// Returns the value of the `GE` field.
26906    pub const fn ge(self) -> u8 {
26907        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
26908    }
26909
26910    /// Sets the value of the `GE` field.
26911    pub const fn set_ge(&mut self, value: u8) {
26912        let offset = Self::GE_SHIFT;
26913        assert!(value & (Self::GE_MASK as u8) == value);
26914        *self = Self::from_bits_retain(
26915            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
26916        );
26917    }
26918
26919    /// Returns a copy with the `GE` field set to the given value.
26920    pub const fn with_ge(mut self, value: u8) -> Self {
26921        self.set_ge(value);
26922        self
26923    }
26924}
26925
26926#[cfg(feature = "el3")]
26927bitflags! {
26928    /// `SPSR_EL3` system register value.
26929    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
26930    #[repr(transparent)]
26931    pub struct SpsrEl3: u64 {
26932        /// `M[4]` bit.
26933        const M_4 = 1 << 4;
26934        /// `T` bit.
26935        const T = 1 << 5;
26936        /// `F` bit.
26937        const F = 1 << 6;
26938        /// `I` bit.
26939        const I = 1 << 7;
26940        /// `A` bit.
26941        const A = 1 << 8;
26942        /// `D` bit.
26943        const D = 1 << 9;
26944        /// `E` bit.
26945        const E = 1 << 9;
26946        /// `ALLINT` bit.
26947        const ALLINT = 1 << 13;
26948        /// `BTYPE2` bit.
26949        const BTYPE2 = 1 << 14;
26950        /// `IL` bit.
26951        const IL = 1 << 20;
26952        /// `SS` bit.
26953        const SS = 1 << 21;
26954        /// `PAN` bit.
26955        const PAN = 1 << 22;
26956        /// `UAO` bit.
26957        const UAO = 1 << 23;
26958        /// `DIT` bit.
26959        const DIT = 1 << 24;
26960        /// `TCO` bit.
26961        const TCO = 1 << 25;
26962        /// `Q` bit.
26963        const Q = 1 << 27;
26964        /// `V` bit.
26965        const V = 1 << 28;
26966        /// `C` bit.
26967        const C = 1 << 29;
26968        /// `Z` bit.
26969        const Z = 1 << 30;
26970        /// `N` bit.
26971        const N = 1 << 31;
26972        /// `PM` bit.
26973        const PM = 1 << 32;
26974        /// `PPEND` bit.
26975        const PPEND = 1 << 33;
26976        /// `EXLOCK` bit.
26977        const EXLOCK = 1 << 34;
26978        /// `PACM` bit.
26979        const PACM = 1 << 35;
26980        /// `UINJ` bit.
26981        const UINJ = 1 << 36;
26982    }
26983}
26984
26985#[cfg(feature = "el3")]
26986impl SpsrEl3 {
26987    /// Offset of the `M[3:0]` field.
26988    pub const M_3_0_SHIFT: u32 = 0;
26989    /// Mask for the `M[3:0]` field.
26990    pub const M_3_0_MASK: u64 = 0b1111;
26991    /// Offset of the `M[4]` field.
26992    pub const M_4_SHIFT: u32 = 4;
26993    /// Offset of the `T` field.
26994    pub const T_SHIFT: u32 = 5;
26995    /// Offset of the `F` field.
26996    pub const F_SHIFT: u32 = 6;
26997    /// Offset of the `I` field.
26998    pub const I_SHIFT: u32 = 7;
26999    /// Offset of the `A` field.
27000    pub const A_SHIFT: u32 = 8;
27001    /// Offset of the `D` field.
27002    pub const D_SHIFT: u32 = 9;
27003    /// Offset of the `E` field.
27004    pub const E_SHIFT: u32 = 9;
27005    /// Offset of the `BTYPE` field.
27006    pub const BTYPE_SHIFT: u32 = 10;
27007    /// Mask for the `BTYPE` field.
27008    pub const BTYPE_MASK: u64 = 0b11;
27009    /// Offset of the `ALLINT` field.
27010    pub const ALLINT_SHIFT: u32 = 13;
27011    /// Offset of the `BTYPE2` field.
27012    pub const BTYPE2_SHIFT: u32 = 14;
27013    /// Offset of the `GE` field.
27014    pub const GE_SHIFT: u32 = 16;
27015    /// Mask for the `GE` field.
27016    pub const GE_MASK: u64 = 0b1111;
27017    /// Offset of the `IL` field.
27018    pub const IL_SHIFT: u32 = 20;
27019    /// Offset of the `SS` field.
27020    pub const SS_SHIFT: u32 = 21;
27021    /// Offset of the `PAN` field.
27022    pub const PAN_SHIFT: u32 = 22;
27023    /// Offset of the `UAO` field.
27024    pub const UAO_SHIFT: u32 = 23;
27025    /// Offset of the `DIT` field.
27026    pub const DIT_SHIFT: u32 = 24;
27027    /// Offset of the `TCO` field.
27028    pub const TCO_SHIFT: u32 = 25;
27029    /// Offset of the `Q` field.
27030    pub const Q_SHIFT: u32 = 27;
27031    /// Offset of the `V` field.
27032    pub const V_SHIFT: u32 = 28;
27033    /// Offset of the `C` field.
27034    pub const C_SHIFT: u32 = 29;
27035    /// Offset of the `Z` field.
27036    pub const Z_SHIFT: u32 = 30;
27037    /// Offset of the `N` field.
27038    pub const N_SHIFT: u32 = 31;
27039    /// Offset of the `PM` field.
27040    pub const PM_SHIFT: u32 = 32;
27041    /// Offset of the `PPEND` field.
27042    pub const PPEND_SHIFT: u32 = 33;
27043    /// Offset of the `EXLOCK` field.
27044    pub const EXLOCK_SHIFT: u32 = 34;
27045    /// Offset of the `PACM` field.
27046    pub const PACM_SHIFT: u32 = 35;
27047    /// Offset of the `UINJ` field.
27048    pub const UINJ_SHIFT: u32 = 36;
27049
27050    /// Returns the value of the `M[3:0]` field.
27051    pub const fn m_3_0(self) -> u8 {
27052        ((self.bits() >> Self::M_3_0_SHIFT) & 0b1111) as u8
27053    }
27054
27055    /// Sets the value of the `M[3:0]` field.
27056    pub const fn set_m_3_0(&mut self, value: u8) {
27057        let offset = Self::M_3_0_SHIFT;
27058        assert!(value & (Self::M_3_0_MASK as u8) == value);
27059        *self = Self::from_bits_retain(
27060            (self.bits() & !(Self::M_3_0_MASK << offset)) | ((value as u64) << offset),
27061        );
27062    }
27063
27064    /// Returns a copy with the `M[3:0]` field set to the given value.
27065    pub const fn with_m_3_0(mut self, value: u8) -> Self {
27066        self.set_m_3_0(value);
27067        self
27068    }
27069
27070    /// Returns the value of the `BTYPE` field.
27071    pub const fn btype(self) -> u8 {
27072        ((self.bits() >> Self::BTYPE_SHIFT) & 0b11) as u8
27073    }
27074
27075    /// Sets the value of the `BTYPE` field.
27076    pub const fn set_btype(&mut self, value: u8) {
27077        let offset = Self::BTYPE_SHIFT;
27078        assert!(value & (Self::BTYPE_MASK as u8) == value);
27079        *self = Self::from_bits_retain(
27080            (self.bits() & !(Self::BTYPE_MASK << offset)) | ((value as u64) << offset),
27081        );
27082    }
27083
27084    /// Returns a copy with the `BTYPE` field set to the given value.
27085    pub const fn with_btype(mut self, value: u8) -> Self {
27086        self.set_btype(value);
27087        self
27088    }
27089
27090    /// Returns the value of the `GE` field.
27091    pub const fn ge(self) -> u8 {
27092        ((self.bits() >> Self::GE_SHIFT) & 0b1111) as u8
27093    }
27094
27095    /// Sets the value of the `GE` field.
27096    pub const fn set_ge(&mut self, value: u8) {
27097        let offset = Self::GE_SHIFT;
27098        assert!(value & (Self::GE_MASK as u8) == value);
27099        *self = Self::from_bits_retain(
27100            (self.bits() & !(Self::GE_MASK << offset)) | ((value as u64) << offset),
27101        );
27102    }
27103
27104    /// Returns a copy with the `GE` field set to the given value.
27105    pub const fn with_ge(mut self, value: u8) -> Self {
27106        self.set_ge(value);
27107        self
27108    }
27109}
27110
27111#[cfg(feature = "el1")]
27112bitflags! {
27113    /// `SP_EL1` system register value.
27114    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27115    #[repr(transparent)]
27116    pub struct SpEl1: u64 {
27117    }
27118}
27119
27120#[cfg(feature = "el1")]
27121impl SpEl1 {
27122    /// Offset of the `StackPointer` field.
27123    pub const STACKPOINTER_SHIFT: u32 = 0;
27124    /// Mask for the `StackPointer` field.
27125    pub const STACKPOINTER_MASK: u64 =
27126        0b1111111111111111111111111111111111111111111111111111111111111111;
27127
27128    /// Returns the value of the `StackPointer` field.
27129    pub const fn stackpointer(self) -> u64 {
27130        ((self.bits() >> Self::STACKPOINTER_SHIFT)
27131            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
27132    }
27133
27134    /// Sets the value of the `StackPointer` field.
27135    pub const fn set_stackpointer(&mut self, value: u64) {
27136        let offset = Self::STACKPOINTER_SHIFT;
27137        assert!(value & (Self::STACKPOINTER_MASK as u64) == value);
27138        *self = Self::from_bits_retain(
27139            (self.bits() & !(Self::STACKPOINTER_MASK << offset)) | ((value as u64) << offset),
27140        );
27141    }
27142
27143    /// Returns a copy with the `StackPointer` field set to the given value.
27144    pub const fn with_stackpointer(mut self, value: u64) -> Self {
27145        self.set_stackpointer(value);
27146        self
27147    }
27148}
27149
27150#[cfg(feature = "el2")]
27151bitflags! {
27152    /// `SP_EL2` system register value.
27153    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27154    #[repr(transparent)]
27155    pub struct SpEl2: u64 {
27156    }
27157}
27158
27159#[cfg(feature = "el2")]
27160impl SpEl2 {
27161    /// Offset of the `StackPointer` field.
27162    pub const STACKPOINTER_SHIFT: u32 = 0;
27163    /// Mask for the `StackPointer` field.
27164    pub const STACKPOINTER_MASK: u64 =
27165        0b1111111111111111111111111111111111111111111111111111111111111111;
27166
27167    /// Returns the value of the `StackPointer` field.
27168    pub const fn stackpointer(self) -> u64 {
27169        ((self.bits() >> Self::STACKPOINTER_SHIFT)
27170            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
27171    }
27172
27173    /// Sets the value of the `StackPointer` field.
27174    pub const fn set_stackpointer(&mut self, value: u64) {
27175        let offset = Self::STACKPOINTER_SHIFT;
27176        assert!(value & (Self::STACKPOINTER_MASK as u64) == value);
27177        *self = Self::from_bits_retain(
27178            (self.bits() & !(Self::STACKPOINTER_MASK << offset)) | ((value as u64) << offset),
27179        );
27180    }
27181
27182    /// Returns a copy with the `StackPointer` field set to the given value.
27183    pub const fn with_stackpointer(mut self, value: u64) -> Self {
27184        self.set_stackpointer(value);
27185        self
27186    }
27187}
27188
27189bitflags! {
27190    /// `SVCR` system register value.
27191    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27192    #[repr(transparent)]
27193    pub struct Svcr: u64 {
27194        /// `SM` bit.
27195        const SM = 1 << 0;
27196        /// `ZA` bit.
27197        const ZA = 1 << 1;
27198    }
27199}
27200
27201impl Svcr {
27202    /// Offset of the `SM` field.
27203    pub const SM_SHIFT: u32 = 0;
27204    /// Offset of the `ZA` field.
27205    pub const ZA_SHIFT: u32 = 1;
27206}
27207
27208#[cfg(feature = "el1")]
27209bitflags! {
27210    /// `TCR2_EL1` system register value.
27211    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27212    #[repr(transparent)]
27213    pub struct Tcr2El1: u64 {
27214        /// `PnCH` bit.
27215        const PNCH = 1 << 0;
27216        /// `PIE` bit.
27217        const PIE = 1 << 1;
27218        /// `E0POE` bit.
27219        const E0POE = 1 << 2;
27220        /// `POE` bit.
27221        const POE = 1 << 3;
27222        /// `AIE` bit.
27223        const AIE = 1 << 4;
27224        /// `D128` bit.
27225        const D128 = 1 << 5;
27226        /// `PTTWI` bit.
27227        const PTTWI = 1 << 10;
27228        /// `HAFT` bit.
27229        const HAFT = 1 << 11;
27230        /// `DisCH0` bit.
27231        const DISCH0 = 1 << 14;
27232        /// `DisCH1` bit.
27233        const DISCH1 = 1 << 15;
27234        /// `A2` bit.
27235        const A2 = 1 << 16;
27236        /// `FNG0` bit.
27237        const FNG0 = 1 << 17;
27238        /// `FNG1` bit.
27239        const FNG1 = 1 << 18;
27240        /// `POE2F` bit.
27241        const POE2F = 1 << 19;
27242        /// `FNGNA0` bit.
27243        const FNGNA0 = 1 << 20;
27244        /// `FNGNA1` bit.
27245        const FNGNA1 = 1 << 21;
27246        /// `TVAD0` bit.
27247        const TVAD0 = 1 << 35;
27248        /// `TVAD1` bit.
27249        const TVAD1 = 1 << 36;
27250    }
27251}
27252
27253#[cfg(feature = "el1")]
27254impl Tcr2El1 {
27255    /// Offset of the `PnCH` field.
27256    pub const PNCH_SHIFT: u32 = 0;
27257    /// Offset of the `PIE` field.
27258    pub const PIE_SHIFT: u32 = 1;
27259    /// Offset of the `E0POE` field.
27260    pub const E0POE_SHIFT: u32 = 2;
27261    /// Offset of the `POE` field.
27262    pub const POE_SHIFT: u32 = 3;
27263    /// Offset of the `AIE` field.
27264    pub const AIE_SHIFT: u32 = 4;
27265    /// Offset of the `D128` field.
27266    pub const D128_SHIFT: u32 = 5;
27267    /// Offset of the `PTTWI` field.
27268    pub const PTTWI_SHIFT: u32 = 10;
27269    /// Offset of the `HAFT` field.
27270    pub const HAFT_SHIFT: u32 = 11;
27271    /// Offset of the `DisCH0` field.
27272    pub const DISCH0_SHIFT: u32 = 14;
27273    /// Offset of the `DisCH1` field.
27274    pub const DISCH1_SHIFT: u32 = 15;
27275    /// Offset of the `A2` field.
27276    pub const A2_SHIFT: u32 = 16;
27277    /// Offset of the `FNG0` field.
27278    pub const FNG0_SHIFT: u32 = 17;
27279    /// Offset of the `FNG1` field.
27280    pub const FNG1_SHIFT: u32 = 18;
27281    /// Offset of the `POE2F` field.
27282    pub const POE2F_SHIFT: u32 = 19;
27283    /// Offset of the `FNGNA0` field.
27284    pub const FNGNA0_SHIFT: u32 = 20;
27285    /// Offset of the `FNGNA1` field.
27286    pub const FNGNA1_SHIFT: u32 = 21;
27287    /// Offset of the `POIW` field.
27288    pub const POIW_SHIFT: u32 = 22;
27289    /// Mask for the `POIW` field.
27290    pub const POIW_MASK: u64 = 0b111;
27291    /// Offset of the `VTB0` field.
27292    pub const VTB0_SHIFT: u32 = 25;
27293    /// Mask for the `VTB0` field.
27294    pub const VTB0_MASK: u64 = 0b11111;
27295    /// Offset of the `VTB1` field.
27296    pub const VTB1_SHIFT: u32 = 30;
27297    /// Mask for the `VTB1` field.
27298    pub const VTB1_MASK: u64 = 0b11111;
27299    /// Offset of the `TVAD0` field.
27300    pub const TVAD0_SHIFT: u32 = 35;
27301    /// Offset of the `TVAD1` field.
27302    pub const TVAD1_SHIFT: u32 = 36;
27303
27304    /// Returns the value of the `POIW` field.
27305    pub const fn poiw(self) -> u8 {
27306        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
27307    }
27308
27309    /// Sets the value of the `POIW` field.
27310    pub const fn set_poiw(&mut self, value: u8) {
27311        let offset = Self::POIW_SHIFT;
27312        assert!(value & (Self::POIW_MASK as u8) == value);
27313        *self = Self::from_bits_retain(
27314            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
27315        );
27316    }
27317
27318    /// Returns a copy with the `POIW` field set to the given value.
27319    pub const fn with_poiw(mut self, value: u8) -> Self {
27320        self.set_poiw(value);
27321        self
27322    }
27323
27324    /// Returns the value of the `VTB0` field.
27325    pub const fn vtb0(self) -> u8 {
27326        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
27327    }
27328
27329    /// Sets the value of the `VTB0` field.
27330    pub const fn set_vtb0(&mut self, value: u8) {
27331        let offset = Self::VTB0_SHIFT;
27332        assert!(value & (Self::VTB0_MASK as u8) == value);
27333        *self = Self::from_bits_retain(
27334            (self.bits() & !(Self::VTB0_MASK << offset)) | ((value as u64) << offset),
27335        );
27336    }
27337
27338    /// Returns a copy with the `VTB0` field set to the given value.
27339    pub const fn with_vtb0(mut self, value: u8) -> Self {
27340        self.set_vtb0(value);
27341        self
27342    }
27343
27344    /// Returns the value of the `VTB1` field.
27345    pub const fn vtb1(self) -> u8 {
27346        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
27347    }
27348
27349    /// Sets the value of the `VTB1` field.
27350    pub const fn set_vtb1(&mut self, value: u8) {
27351        let offset = Self::VTB1_SHIFT;
27352        assert!(value & (Self::VTB1_MASK as u8) == value);
27353        *self = Self::from_bits_retain(
27354            (self.bits() & !(Self::VTB1_MASK << offset)) | ((value as u64) << offset),
27355        );
27356    }
27357
27358    /// Returns a copy with the `VTB1` field set to the given value.
27359    pub const fn with_vtb1(mut self, value: u8) -> Self {
27360        self.set_vtb1(value);
27361        self
27362    }
27363}
27364
27365#[cfg(feature = "el2")]
27366bitflags! {
27367    /// `TCR2_EL2` system register value.
27368    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27369    #[repr(transparent)]
27370    pub struct Tcr2El2: u64 {
27371        /// `PnCH` bit.
27372        const PNCH = 1 << 0;
27373        /// `PIE` bit.
27374        const PIE = 1 << 1;
27375        /// `E0POE` bit.
27376        const E0POE = 1 << 2;
27377        /// `POE` bit.
27378        const POE = 1 << 3;
27379        /// `AIE` bit.
27380        const AIE = 1 << 4;
27381        /// `D128` bit.
27382        const D128 = 1 << 5;
27383        /// `PTTWI` bit.
27384        const PTTWI = 1 << 10;
27385        /// `HAFT` bit.
27386        const HAFT = 1 << 11;
27387        /// `AMEC0` bit.
27388        const AMEC0 = 1 << 12;
27389        /// `AMEC1` bit.
27390        const AMEC1 = 1 << 13;
27391        /// `DisCH0` bit.
27392        const DISCH0 = 1 << 14;
27393        /// `DisCH1` bit.
27394        const DISCH1 = 1 << 15;
27395        /// `A2` bit.
27396        const A2 = 1 << 16;
27397        /// `FNG0` bit.
27398        const FNG0 = 1 << 17;
27399        /// `FNG1` bit.
27400        const FNG1 = 1 << 18;
27401        /// `POE2F` bit.
27402        const POE2F = 1 << 19;
27403        /// `TVAD0` bit.
27404        const TVAD0 = 1 << 35;
27405        /// `TVAD1` bit.
27406        const TVAD1 = 1 << 36;
27407    }
27408}
27409
27410#[cfg(feature = "el2")]
27411impl Tcr2El2 {
27412    /// Offset of the `PnCH` field.
27413    pub const PNCH_SHIFT: u32 = 0;
27414    /// Offset of the `PIE` field.
27415    pub const PIE_SHIFT: u32 = 1;
27416    /// Offset of the `E0POE` field.
27417    pub const E0POE_SHIFT: u32 = 2;
27418    /// Offset of the `POE` field.
27419    pub const POE_SHIFT: u32 = 3;
27420    /// Offset of the `AIE` field.
27421    pub const AIE_SHIFT: u32 = 4;
27422    /// Offset of the `D128` field.
27423    pub const D128_SHIFT: u32 = 5;
27424    /// Offset of the `PTTWI` field.
27425    pub const PTTWI_SHIFT: u32 = 10;
27426    /// Offset of the `HAFT` field.
27427    pub const HAFT_SHIFT: u32 = 11;
27428    /// Offset of the `AMEC0` field.
27429    pub const AMEC0_SHIFT: u32 = 12;
27430    /// Offset of the `AMEC1` field.
27431    pub const AMEC1_SHIFT: u32 = 13;
27432    /// Offset of the `DisCH0` field.
27433    pub const DISCH0_SHIFT: u32 = 14;
27434    /// Offset of the `DisCH1` field.
27435    pub const DISCH1_SHIFT: u32 = 15;
27436    /// Offset of the `A2` field.
27437    pub const A2_SHIFT: u32 = 16;
27438    /// Offset of the `FNG0` field.
27439    pub const FNG0_SHIFT: u32 = 17;
27440    /// Offset of the `FNG1` field.
27441    pub const FNG1_SHIFT: u32 = 18;
27442    /// Offset of the `POE2F` field.
27443    pub const POE2F_SHIFT: u32 = 19;
27444    /// Offset of the `POIW` field.
27445    pub const POIW_SHIFT: u32 = 22;
27446    /// Mask for the `POIW` field.
27447    pub const POIW_MASK: u64 = 0b111;
27448    /// Offset of the `VTB0` field.
27449    pub const VTB0_SHIFT: u32 = 25;
27450    /// Mask for the `VTB0` field.
27451    pub const VTB0_MASK: u64 = 0b11111;
27452    /// Offset of the `VTB1` field.
27453    pub const VTB1_SHIFT: u32 = 30;
27454    /// Mask for the `VTB1` field.
27455    pub const VTB1_MASK: u64 = 0b11111;
27456    /// Offset of the `TVAD0` field.
27457    pub const TVAD0_SHIFT: u32 = 35;
27458    /// Offset of the `TVAD1` field.
27459    pub const TVAD1_SHIFT: u32 = 36;
27460
27461    /// Returns the value of the `POIW` field.
27462    pub const fn poiw(self) -> u8 {
27463        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
27464    }
27465
27466    /// Sets the value of the `POIW` field.
27467    pub const fn set_poiw(&mut self, value: u8) {
27468        let offset = Self::POIW_SHIFT;
27469        assert!(value & (Self::POIW_MASK as u8) == value);
27470        *self = Self::from_bits_retain(
27471            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
27472        );
27473    }
27474
27475    /// Returns a copy with the `POIW` field set to the given value.
27476    pub const fn with_poiw(mut self, value: u8) -> Self {
27477        self.set_poiw(value);
27478        self
27479    }
27480
27481    /// Returns the value of the `VTB0` field.
27482    pub const fn vtb0(self) -> u8 {
27483        ((self.bits() >> Self::VTB0_SHIFT) & 0b11111) as u8
27484    }
27485
27486    /// Sets the value of the `VTB0` field.
27487    pub const fn set_vtb0(&mut self, value: u8) {
27488        let offset = Self::VTB0_SHIFT;
27489        assert!(value & (Self::VTB0_MASK as u8) == value);
27490        *self = Self::from_bits_retain(
27491            (self.bits() & !(Self::VTB0_MASK << offset)) | ((value as u64) << offset),
27492        );
27493    }
27494
27495    /// Returns a copy with the `VTB0` field set to the given value.
27496    pub const fn with_vtb0(mut self, value: u8) -> Self {
27497        self.set_vtb0(value);
27498        self
27499    }
27500
27501    /// Returns the value of the `VTB1` field.
27502    pub const fn vtb1(self) -> u8 {
27503        ((self.bits() >> Self::VTB1_SHIFT) & 0b11111) as u8
27504    }
27505
27506    /// Sets the value of the `VTB1` field.
27507    pub const fn set_vtb1(&mut self, value: u8) {
27508        let offset = Self::VTB1_SHIFT;
27509        assert!(value & (Self::VTB1_MASK as u8) == value);
27510        *self = Self::from_bits_retain(
27511            (self.bits() & !(Self::VTB1_MASK << offset)) | ((value as u64) << offset),
27512        );
27513    }
27514
27515    /// Returns a copy with the `VTB1` field set to the given value.
27516    pub const fn with_vtb1(mut self, value: u8) -> Self {
27517        self.set_vtb1(value);
27518        self
27519    }
27520}
27521
27522#[cfg(feature = "el1")]
27523bitflags! {
27524    /// `TCR_EL1` system register value.
27525    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27526    #[repr(transparent)]
27527    pub struct TcrEl1: u64 {
27528        /// `EPD0` bit.
27529        const EPD0 = 1 << 7;
27530        /// `A1` bit.
27531        const A1 = 1 << 22;
27532        /// `EPD1` bit.
27533        const EPD1 = 1 << 23;
27534        /// `AS` bit.
27535        const AS = 1 << 36;
27536        /// `TBI0` bit.
27537        const TBI0 = 1 << 37;
27538        /// `TBI1` bit.
27539        const TBI1 = 1 << 38;
27540        /// `HA` bit.
27541        const HA = 1 << 39;
27542        /// `HD` bit.
27543        const HD = 1 << 40;
27544        /// `HPD0` bit.
27545        const HPD0 = 1 << 41;
27546        /// `HPD1` bit.
27547        const HPD1 = 1 << 42;
27548        /// `HWU059` bit.
27549        const HWU059 = 1 << 43;
27550        /// `HWU060` bit.
27551        const HWU060 = 1 << 44;
27552        /// `HWU061` bit.
27553        const HWU061 = 1 << 45;
27554        /// `HWU062` bit.
27555        const HWU062 = 1 << 46;
27556        /// `HWU159` bit.
27557        const HWU159 = 1 << 47;
27558        /// `HWU160` bit.
27559        const HWU160 = 1 << 48;
27560        /// `HWU161` bit.
27561        const HWU161 = 1 << 49;
27562        /// `HWU162` bit.
27563        const HWU162 = 1 << 50;
27564        /// `TBID0` bit.
27565        const TBID0 = 1 << 51;
27566        /// `TBID1` bit.
27567        const TBID1 = 1 << 52;
27568        /// `NFD0` bit.
27569        const NFD0 = 1 << 53;
27570        /// `NFD1` bit.
27571        const NFD1 = 1 << 54;
27572        /// `E0PD0` bit.
27573        const E0PD0 = 1 << 55;
27574        /// `E0PD1` bit.
27575        const E0PD1 = 1 << 56;
27576        /// `TCMA0` bit.
27577        const TCMA0 = 1 << 57;
27578        /// `TCMA1` bit.
27579        const TCMA1 = 1 << 58;
27580        /// `DS` bit.
27581        const DS = 1 << 59;
27582        /// `MTX0` bit.
27583        const MTX0 = 1 << 60;
27584        /// `MTX1` bit.
27585        const MTX1 = 1 << 61;
27586    }
27587}
27588
27589#[cfg(feature = "el1")]
27590impl TcrEl1 {
27591    /// Offset of the `T0SZ` field.
27592    pub const T0SZ_SHIFT: u32 = 0;
27593    /// Mask for the `T0SZ` field.
27594    pub const T0SZ_MASK: u64 = 0b111111;
27595    /// Offset of the `EPD0` field.
27596    pub const EPD0_SHIFT: u32 = 7;
27597    /// Offset of the `IRGN0` field.
27598    pub const IRGN0_SHIFT: u32 = 8;
27599    /// Mask for the `IRGN0` field.
27600    pub const IRGN0_MASK: u64 = 0b11;
27601    /// Offset of the `ORGN0` field.
27602    pub const ORGN0_SHIFT: u32 = 10;
27603    /// Mask for the `ORGN0` field.
27604    pub const ORGN0_MASK: u64 = 0b11;
27605    /// Offset of the `SH0` field.
27606    pub const SH0_SHIFT: u32 = 12;
27607    /// Mask for the `SH0` field.
27608    pub const SH0_MASK: u64 = 0b11;
27609    /// Offset of the `TG0` field.
27610    pub const TG0_SHIFT: u32 = 14;
27611    /// Mask for the `TG0` field.
27612    pub const TG0_MASK: u64 = 0b11;
27613    /// Offset of the `T1SZ` field.
27614    pub const T1SZ_SHIFT: u32 = 16;
27615    /// Mask for the `T1SZ` field.
27616    pub const T1SZ_MASK: u64 = 0b111111;
27617    /// Offset of the `A1` field.
27618    pub const A1_SHIFT: u32 = 22;
27619    /// Offset of the `EPD1` field.
27620    pub const EPD1_SHIFT: u32 = 23;
27621    /// Offset of the `IRGN1` field.
27622    pub const IRGN1_SHIFT: u32 = 24;
27623    /// Mask for the `IRGN1` field.
27624    pub const IRGN1_MASK: u64 = 0b11;
27625    /// Offset of the `ORGN1` field.
27626    pub const ORGN1_SHIFT: u32 = 26;
27627    /// Mask for the `ORGN1` field.
27628    pub const ORGN1_MASK: u64 = 0b11;
27629    /// Offset of the `SH1` field.
27630    pub const SH1_SHIFT: u32 = 28;
27631    /// Mask for the `SH1` field.
27632    pub const SH1_MASK: u64 = 0b11;
27633    /// Offset of the `TG1` field.
27634    pub const TG1_SHIFT: u32 = 30;
27635    /// Mask for the `TG1` field.
27636    pub const TG1_MASK: u64 = 0b11;
27637    /// Offset of the `IPS` field.
27638    pub const IPS_SHIFT: u32 = 32;
27639    /// Mask for the `IPS` field.
27640    pub const IPS_MASK: u64 = 0b111;
27641    /// Offset of the `AS` field.
27642    pub const AS_SHIFT: u32 = 36;
27643    /// Offset of the `TBI0` field.
27644    pub const TBI0_SHIFT: u32 = 37;
27645    /// Offset of the `TBI1` field.
27646    pub const TBI1_SHIFT: u32 = 38;
27647    /// Offset of the `HA` field.
27648    pub const HA_SHIFT: u32 = 39;
27649    /// Offset of the `HD` field.
27650    pub const HD_SHIFT: u32 = 40;
27651    /// Offset of the `HPD0` field.
27652    pub const HPD0_SHIFT: u32 = 41;
27653    /// Offset of the `HPD1` field.
27654    pub const HPD1_SHIFT: u32 = 42;
27655    /// Offset of the `HWU059` field.
27656    pub const HWU059_SHIFT: u32 = 43;
27657    /// Offset of the `HWU060` field.
27658    pub const HWU060_SHIFT: u32 = 44;
27659    /// Offset of the `HWU061` field.
27660    pub const HWU061_SHIFT: u32 = 45;
27661    /// Offset of the `HWU062` field.
27662    pub const HWU062_SHIFT: u32 = 46;
27663    /// Offset of the `HWU159` field.
27664    pub const HWU159_SHIFT: u32 = 47;
27665    /// Offset of the `HWU160` field.
27666    pub const HWU160_SHIFT: u32 = 48;
27667    /// Offset of the `HWU161` field.
27668    pub const HWU161_SHIFT: u32 = 49;
27669    /// Offset of the `HWU162` field.
27670    pub const HWU162_SHIFT: u32 = 50;
27671    /// Offset of the `TBID0` field.
27672    pub const TBID0_SHIFT: u32 = 51;
27673    /// Offset of the `TBID1` field.
27674    pub const TBID1_SHIFT: u32 = 52;
27675    /// Offset of the `NFD0` field.
27676    pub const NFD0_SHIFT: u32 = 53;
27677    /// Offset of the `NFD1` field.
27678    pub const NFD1_SHIFT: u32 = 54;
27679    /// Offset of the `E0PD0` field.
27680    pub const E0PD0_SHIFT: u32 = 55;
27681    /// Offset of the `E0PD1` field.
27682    pub const E0PD1_SHIFT: u32 = 56;
27683    /// Offset of the `TCMA0` field.
27684    pub const TCMA0_SHIFT: u32 = 57;
27685    /// Offset of the `TCMA1` field.
27686    pub const TCMA1_SHIFT: u32 = 58;
27687    /// Offset of the `DS` field.
27688    pub const DS_SHIFT: u32 = 59;
27689    /// Offset of the `MTX0` field.
27690    pub const MTX0_SHIFT: u32 = 60;
27691    /// Offset of the `MTX1` field.
27692    pub const MTX1_SHIFT: u32 = 61;
27693
27694    /// Returns the value of the `T0SZ` field.
27695    pub const fn t0sz(self) -> u8 {
27696        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
27697    }
27698
27699    /// Sets the value of the `T0SZ` field.
27700    pub const fn set_t0sz(&mut self, value: u8) {
27701        let offset = Self::T0SZ_SHIFT;
27702        assert!(value & (Self::T0SZ_MASK as u8) == value);
27703        *self = Self::from_bits_retain(
27704            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
27705        );
27706    }
27707
27708    /// Returns a copy with the `T0SZ` field set to the given value.
27709    pub const fn with_t0sz(mut self, value: u8) -> Self {
27710        self.set_t0sz(value);
27711        self
27712    }
27713
27714    /// Returns the value of the `IRGN0` field.
27715    pub const fn irgn0(self) -> u8 {
27716        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
27717    }
27718
27719    /// Sets the value of the `IRGN0` field.
27720    pub const fn set_irgn0(&mut self, value: u8) {
27721        let offset = Self::IRGN0_SHIFT;
27722        assert!(value & (Self::IRGN0_MASK as u8) == value);
27723        *self = Self::from_bits_retain(
27724            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
27725        );
27726    }
27727
27728    /// Returns a copy with the `IRGN0` field set to the given value.
27729    pub const fn with_irgn0(mut self, value: u8) -> Self {
27730        self.set_irgn0(value);
27731        self
27732    }
27733
27734    /// Returns the value of the `ORGN0` field.
27735    pub const fn orgn0(self) -> u8 {
27736        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
27737    }
27738
27739    /// Sets the value of the `ORGN0` field.
27740    pub const fn set_orgn0(&mut self, value: u8) {
27741        let offset = Self::ORGN0_SHIFT;
27742        assert!(value & (Self::ORGN0_MASK as u8) == value);
27743        *self = Self::from_bits_retain(
27744            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
27745        );
27746    }
27747
27748    /// Returns a copy with the `ORGN0` field set to the given value.
27749    pub const fn with_orgn0(mut self, value: u8) -> Self {
27750        self.set_orgn0(value);
27751        self
27752    }
27753
27754    /// Returns the value of the `SH0` field.
27755    pub const fn sh0(self) -> u8 {
27756        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
27757    }
27758
27759    /// Sets the value of the `SH0` field.
27760    pub const fn set_sh0(&mut self, value: u8) {
27761        let offset = Self::SH0_SHIFT;
27762        assert!(value & (Self::SH0_MASK as u8) == value);
27763        *self = Self::from_bits_retain(
27764            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
27765        );
27766    }
27767
27768    /// Returns a copy with the `SH0` field set to the given value.
27769    pub const fn with_sh0(mut self, value: u8) -> Self {
27770        self.set_sh0(value);
27771        self
27772    }
27773
27774    /// Returns the value of the `TG0` field.
27775    pub const fn tg0(self) -> u8 {
27776        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
27777    }
27778
27779    /// Sets the value of the `TG0` field.
27780    pub const fn set_tg0(&mut self, value: u8) {
27781        let offset = Self::TG0_SHIFT;
27782        assert!(value & (Self::TG0_MASK as u8) == value);
27783        *self = Self::from_bits_retain(
27784            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
27785        );
27786    }
27787
27788    /// Returns a copy with the `TG0` field set to the given value.
27789    pub const fn with_tg0(mut self, value: u8) -> Self {
27790        self.set_tg0(value);
27791        self
27792    }
27793
27794    /// Returns the value of the `T1SZ` field.
27795    pub const fn t1sz(self) -> u8 {
27796        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
27797    }
27798
27799    /// Sets the value of the `T1SZ` field.
27800    pub const fn set_t1sz(&mut self, value: u8) {
27801        let offset = Self::T1SZ_SHIFT;
27802        assert!(value & (Self::T1SZ_MASK as u8) == value);
27803        *self = Self::from_bits_retain(
27804            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u64) << offset),
27805        );
27806    }
27807
27808    /// Returns a copy with the `T1SZ` field set to the given value.
27809    pub const fn with_t1sz(mut self, value: u8) -> Self {
27810        self.set_t1sz(value);
27811        self
27812    }
27813
27814    /// Returns the value of the `IRGN1` field.
27815    pub const fn irgn1(self) -> u8 {
27816        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
27817    }
27818
27819    /// Sets the value of the `IRGN1` field.
27820    pub const fn set_irgn1(&mut self, value: u8) {
27821        let offset = Self::IRGN1_SHIFT;
27822        assert!(value & (Self::IRGN1_MASK as u8) == value);
27823        *self = Self::from_bits_retain(
27824            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u64) << offset),
27825        );
27826    }
27827
27828    /// Returns a copy with the `IRGN1` field set to the given value.
27829    pub const fn with_irgn1(mut self, value: u8) -> Self {
27830        self.set_irgn1(value);
27831        self
27832    }
27833
27834    /// Returns the value of the `ORGN1` field.
27835    pub const fn orgn1(self) -> u8 {
27836        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
27837    }
27838
27839    /// Sets the value of the `ORGN1` field.
27840    pub const fn set_orgn1(&mut self, value: u8) {
27841        let offset = Self::ORGN1_SHIFT;
27842        assert!(value & (Self::ORGN1_MASK as u8) == value);
27843        *self = Self::from_bits_retain(
27844            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u64) << offset),
27845        );
27846    }
27847
27848    /// Returns a copy with the `ORGN1` field set to the given value.
27849    pub const fn with_orgn1(mut self, value: u8) -> Self {
27850        self.set_orgn1(value);
27851        self
27852    }
27853
27854    /// Returns the value of the `SH1` field.
27855    pub const fn sh1(self) -> u8 {
27856        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
27857    }
27858
27859    /// Sets the value of the `SH1` field.
27860    pub const fn set_sh1(&mut self, value: u8) {
27861        let offset = Self::SH1_SHIFT;
27862        assert!(value & (Self::SH1_MASK as u8) == value);
27863        *self = Self::from_bits_retain(
27864            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u64) << offset),
27865        );
27866    }
27867
27868    /// Returns a copy with the `SH1` field set to the given value.
27869    pub const fn with_sh1(mut self, value: u8) -> Self {
27870        self.set_sh1(value);
27871        self
27872    }
27873
27874    /// Returns the value of the `TG1` field.
27875    pub const fn tg1(self) -> u8 {
27876        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
27877    }
27878
27879    /// Sets the value of the `TG1` field.
27880    pub const fn set_tg1(&mut self, value: u8) {
27881        let offset = Self::TG1_SHIFT;
27882        assert!(value & (Self::TG1_MASK as u8) == value);
27883        *self = Self::from_bits_retain(
27884            (self.bits() & !(Self::TG1_MASK << offset)) | ((value as u64) << offset),
27885        );
27886    }
27887
27888    /// Returns a copy with the `TG1` field set to the given value.
27889    pub const fn with_tg1(mut self, value: u8) -> Self {
27890        self.set_tg1(value);
27891        self
27892    }
27893
27894    /// Returns the value of the `IPS` field.
27895    pub const fn ips(self) -> u8 {
27896        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
27897    }
27898
27899    /// Sets the value of the `IPS` field.
27900    pub const fn set_ips(&mut self, value: u8) {
27901        let offset = Self::IPS_SHIFT;
27902        assert!(value & (Self::IPS_MASK as u8) == value);
27903        *self = Self::from_bits_retain(
27904            (self.bits() & !(Self::IPS_MASK << offset)) | ((value as u64) << offset),
27905        );
27906    }
27907
27908    /// Returns a copy with the `IPS` field set to the given value.
27909    pub const fn with_ips(mut self, value: u8) -> Self {
27910        self.set_ips(value);
27911        self
27912    }
27913}
27914
27915#[cfg(feature = "el2")]
27916bitflags! {
27917    /// `TCR_EL2` system register value.
27918    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
27919    #[repr(transparent)]
27920    pub struct TcrEl2: u64 {
27921        /// RES1 bits in the `TCR_EL2` register.
27922        const RES1 = 0b10000000100000000000000000000000;
27923        /// `EPD0` bit.
27924        const EPD0 = 1 << 7;
27925        /// `TBI` bit.
27926        const TBI = 1 << 20;
27927        /// `A1` bit.
27928        const A1 = 1 << 22;
27929        /// `EPD1` bit.
27930        const EPD1 = 1 << 23;
27931        /// `HPD` bit.
27932        const HPD = 1 << 24;
27933        /// `HWU59` bit.
27934        const HWU59 = 1 << 25;
27935        /// `HWU60` bit.
27936        const HWU60 = 1 << 26;
27937        /// `HWU61` bit.
27938        const HWU61 = 1 << 27;
27939        /// `HWU62` bit.
27940        const HWU62 = 1 << 28;
27941        /// `TBID` bit.
27942        const TBID = 1 << 29;
27943        /// `TCMA` bit.
27944        const TCMA = 1 << 30;
27945        /// `MTX` bit.
27946        const MTX = 1 << 33;
27947        /// `AS` bit.
27948        const AS = 1 << 36;
27949        /// `TBI0` bit.
27950        const TBI0 = 1 << 37;
27951        /// `TBI1` bit.
27952        const TBI1 = 1 << 38;
27953        /// `HPD0` bit.
27954        const HPD0 = 1 << 41;
27955        /// `HPD1` bit.
27956        const HPD1 = 1 << 42;
27957        /// `HWU059` bit.
27958        const HWU059 = 1 << 43;
27959        /// `HWU060` bit.
27960        const HWU060 = 1 << 44;
27961        /// `HWU061` bit.
27962        const HWU061 = 1 << 45;
27963        /// `HWU062` bit.
27964        const HWU062 = 1 << 46;
27965        /// `HWU159` bit.
27966        const HWU159 = 1 << 47;
27967        /// `HWU160` bit.
27968        const HWU160 = 1 << 48;
27969        /// `HWU161` bit.
27970        const HWU161 = 1 << 49;
27971        /// `HWU162` bit.
27972        const HWU162 = 1 << 50;
27973        /// `TBID0` bit.
27974        const TBID0 = 1 << 51;
27975        /// `TBID1` bit.
27976        const TBID1 = 1 << 52;
27977        /// `NFD0` bit.
27978        const NFD0 = 1 << 53;
27979        /// `TVAD` bit.
27980        const TVAD = 1 << 53;
27981        /// `NFD1` bit.
27982        const NFD1 = 1 << 54;
27983        /// `E0PD0` bit.
27984        const E0PD0 = 1 << 55;
27985        /// `E0PD1` bit.
27986        const E0PD1 = 1 << 56;
27987        /// `TCMA0` bit.
27988        const TCMA0 = 1 << 57;
27989        /// `TCMA1` bit.
27990        const TCMA1 = 1 << 58;
27991        /// `MTX0` bit.
27992        const MTX0 = 1 << 60;
27993        /// `MTX1` bit.
27994        const MTX1 = 1 << 61;
27995    }
27996}
27997
27998#[cfg(feature = "el2")]
27999impl TcrEl2 {
28000    /// Offset of the `T0SZ` field.
28001    pub const T0SZ_SHIFT: u32 = 0;
28002    /// Mask for the `T0SZ` field.
28003    pub const T0SZ_MASK: u64 = 0b111111;
28004    /// Offset of the `EPD0` field.
28005    pub const EPD0_SHIFT: u32 = 7;
28006    /// Offset of the `IRGN0` field.
28007    pub const IRGN0_SHIFT: u32 = 8;
28008    /// Mask for the `IRGN0` field.
28009    pub const IRGN0_MASK: u64 = 0b11;
28010    /// Offset of the `ORGN0` field.
28011    pub const ORGN0_SHIFT: u32 = 10;
28012    /// Mask for the `ORGN0` field.
28013    pub const ORGN0_MASK: u64 = 0b11;
28014    /// Offset of the `SH0` field.
28015    pub const SH0_SHIFT: u32 = 12;
28016    /// Mask for the `SH0` field.
28017    pub const SH0_MASK: u64 = 0b11;
28018    /// Offset of the `TG0` field.
28019    pub const TG0_SHIFT: u32 = 14;
28020    /// Mask for the `TG0` field.
28021    pub const TG0_MASK: u64 = 0b11;
28022    /// Offset of the `PS` field.
28023    pub const PS_SHIFT: u32 = 16;
28024    /// Mask for the `PS` field.
28025    pub const PS_MASK: u64 = 0b111;
28026    /// Offset of the `T1SZ` field.
28027    pub const T1SZ_SHIFT: u32 = 16;
28028    /// Mask for the `T1SZ` field.
28029    pub const T1SZ_MASK: u64 = 0b111111;
28030    /// Offset of the `TBI` field.
28031    pub const TBI_SHIFT: u32 = 20;
28032    /// Offset of the `A1` field.
28033    pub const A1_SHIFT: u32 = 22;
28034    /// Offset of the `EPD1` field.
28035    pub const EPD1_SHIFT: u32 = 23;
28036    /// Offset of the `HPD` field.
28037    pub const HPD_SHIFT: u32 = 24;
28038    /// Offset of the `IRGN1` field.
28039    pub const IRGN1_SHIFT: u32 = 24;
28040    /// Mask for the `IRGN1` field.
28041    pub const IRGN1_MASK: u64 = 0b11;
28042    /// Offset of the `HWU59` field.
28043    pub const HWU59_SHIFT: u32 = 25;
28044    /// Offset of the `HWU60` field.
28045    pub const HWU60_SHIFT: u32 = 26;
28046    /// Offset of the `ORGN1` field.
28047    pub const ORGN1_SHIFT: u32 = 26;
28048    /// Mask for the `ORGN1` field.
28049    pub const ORGN1_MASK: u64 = 0b11;
28050    /// Offset of the `HWU61` field.
28051    pub const HWU61_SHIFT: u32 = 27;
28052    /// Offset of the `HWU62` field.
28053    pub const HWU62_SHIFT: u32 = 28;
28054    /// Offset of the `SH1` field.
28055    pub const SH1_SHIFT: u32 = 28;
28056    /// Mask for the `SH1` field.
28057    pub const SH1_MASK: u64 = 0b11;
28058    /// Offset of the `TBID` field.
28059    pub const TBID_SHIFT: u32 = 29;
28060    /// Offset of the `TCMA` field.
28061    pub const TCMA_SHIFT: u32 = 30;
28062    /// Offset of the `TG1` field.
28063    pub const TG1_SHIFT: u32 = 30;
28064    /// Mask for the `TG1` field.
28065    pub const TG1_MASK: u64 = 0b11;
28066    /// Offset of the `IPS` field.
28067    pub const IPS_SHIFT: u32 = 32;
28068    /// Mask for the `IPS` field.
28069    pub const IPS_MASK: u64 = 0b111;
28070    /// Offset of the `MTX` field.
28071    pub const MTX_SHIFT: u32 = 33;
28072    /// Offset of the `AS` field.
28073    pub const AS_SHIFT: u32 = 36;
28074    /// Offset of the `TBI0` field.
28075    pub const TBI0_SHIFT: u32 = 37;
28076    /// Offset of the `TBI1` field.
28077    pub const TBI1_SHIFT: u32 = 38;
28078    /// Offset of the `HPD0` field.
28079    pub const HPD0_SHIFT: u32 = 41;
28080    /// Offset of the `HPD1` field.
28081    pub const HPD1_SHIFT: u32 = 42;
28082    /// Offset of the `HWU059` field.
28083    pub const HWU059_SHIFT: u32 = 43;
28084    /// Offset of the `HWU060` field.
28085    pub const HWU060_SHIFT: u32 = 44;
28086    /// Offset of the `HWU061` field.
28087    pub const HWU061_SHIFT: u32 = 45;
28088    /// Offset of the `HWU062` field.
28089    pub const HWU062_SHIFT: u32 = 46;
28090    /// Offset of the `HWU159` field.
28091    pub const HWU159_SHIFT: u32 = 47;
28092    /// Offset of the `HWU160` field.
28093    pub const HWU160_SHIFT: u32 = 48;
28094    /// Offset of the `VTB` field.
28095    pub const VTB_SHIFT: u32 = 48;
28096    /// Mask for the `VTB` field.
28097    pub const VTB_MASK: u64 = 0b11111;
28098    /// Offset of the `HWU161` field.
28099    pub const HWU161_SHIFT: u32 = 49;
28100    /// Offset of the `HWU162` field.
28101    pub const HWU162_SHIFT: u32 = 50;
28102    /// Offset of the `TBID0` field.
28103    pub const TBID0_SHIFT: u32 = 51;
28104    /// Offset of the `TBID1` field.
28105    pub const TBID1_SHIFT: u32 = 52;
28106    /// Offset of the `NFD0` field.
28107    pub const NFD0_SHIFT: u32 = 53;
28108    /// Offset of the `TVAD` field.
28109    pub const TVAD_SHIFT: u32 = 53;
28110    /// Offset of the `NFD1` field.
28111    pub const NFD1_SHIFT: u32 = 54;
28112    /// Offset of the `E0PD0` field.
28113    pub const E0PD0_SHIFT: u32 = 55;
28114    /// Offset of the `E0PD1` field.
28115    pub const E0PD1_SHIFT: u32 = 56;
28116    /// Offset of the `TCMA0` field.
28117    pub const TCMA0_SHIFT: u32 = 57;
28118    /// Offset of the `TCMA1` field.
28119    pub const TCMA1_SHIFT: u32 = 58;
28120    /// Offset of the `MTX0` field.
28121    pub const MTX0_SHIFT: u32 = 60;
28122    /// Offset of the `MTX1` field.
28123    pub const MTX1_SHIFT: u32 = 61;
28124
28125    /// Returns the value of the `T0SZ` field.
28126    pub const fn t0sz(self) -> u8 {
28127        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
28128    }
28129
28130    /// Sets the value of the `T0SZ` field.
28131    pub const fn set_t0sz(&mut self, value: u8) {
28132        let offset = Self::T0SZ_SHIFT;
28133        assert!(value & (Self::T0SZ_MASK as u8) == value);
28134        *self = Self::from_bits_retain(
28135            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
28136        );
28137    }
28138
28139    /// Returns a copy with the `T0SZ` field set to the given value.
28140    pub const fn with_t0sz(mut self, value: u8) -> Self {
28141        self.set_t0sz(value);
28142        self
28143    }
28144
28145    /// Returns the value of the `IRGN0` field.
28146    pub const fn irgn0(self) -> u8 {
28147        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
28148    }
28149
28150    /// Sets the value of the `IRGN0` field.
28151    pub const fn set_irgn0(&mut self, value: u8) {
28152        let offset = Self::IRGN0_SHIFT;
28153        assert!(value & (Self::IRGN0_MASK as u8) == value);
28154        *self = Self::from_bits_retain(
28155            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
28156        );
28157    }
28158
28159    /// Returns a copy with the `IRGN0` field set to the given value.
28160    pub const fn with_irgn0(mut self, value: u8) -> Self {
28161        self.set_irgn0(value);
28162        self
28163    }
28164
28165    /// Returns the value of the `ORGN0` field.
28166    pub const fn orgn0(self) -> u8 {
28167        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
28168    }
28169
28170    /// Sets the value of the `ORGN0` field.
28171    pub const fn set_orgn0(&mut self, value: u8) {
28172        let offset = Self::ORGN0_SHIFT;
28173        assert!(value & (Self::ORGN0_MASK as u8) == value);
28174        *self = Self::from_bits_retain(
28175            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
28176        );
28177    }
28178
28179    /// Returns a copy with the `ORGN0` field set to the given value.
28180    pub const fn with_orgn0(mut self, value: u8) -> Self {
28181        self.set_orgn0(value);
28182        self
28183    }
28184
28185    /// Returns the value of the `SH0` field.
28186    pub const fn sh0(self) -> u8 {
28187        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
28188    }
28189
28190    /// Sets the value of the `SH0` field.
28191    pub const fn set_sh0(&mut self, value: u8) {
28192        let offset = Self::SH0_SHIFT;
28193        assert!(value & (Self::SH0_MASK as u8) == value);
28194        *self = Self::from_bits_retain(
28195            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
28196        );
28197    }
28198
28199    /// Returns a copy with the `SH0` field set to the given value.
28200    pub const fn with_sh0(mut self, value: u8) -> Self {
28201        self.set_sh0(value);
28202        self
28203    }
28204
28205    /// Returns the value of the `TG0` field.
28206    pub const fn tg0(self) -> u8 {
28207        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
28208    }
28209
28210    /// Sets the value of the `TG0` field.
28211    pub const fn set_tg0(&mut self, value: u8) {
28212        let offset = Self::TG0_SHIFT;
28213        assert!(value & (Self::TG0_MASK as u8) == value);
28214        *self = Self::from_bits_retain(
28215            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
28216        );
28217    }
28218
28219    /// Returns a copy with the `TG0` field set to the given value.
28220    pub const fn with_tg0(mut self, value: u8) -> Self {
28221        self.set_tg0(value);
28222        self
28223    }
28224
28225    /// Returns the value of the `PS` field.
28226    pub const fn ps(self) -> u8 {
28227        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
28228    }
28229
28230    /// Sets the value of the `PS` field.
28231    pub const fn set_ps(&mut self, value: u8) {
28232        let offset = Self::PS_SHIFT;
28233        assert!(value & (Self::PS_MASK as u8) == value);
28234        *self = Self::from_bits_retain(
28235            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
28236        );
28237    }
28238
28239    /// Returns a copy with the `PS` field set to the given value.
28240    pub const fn with_ps(mut self, value: u8) -> Self {
28241        self.set_ps(value);
28242        self
28243    }
28244
28245    /// Returns the value of the `T1SZ` field.
28246    pub const fn t1sz(self) -> u8 {
28247        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111111) as u8
28248    }
28249
28250    /// Sets the value of the `T1SZ` field.
28251    pub const fn set_t1sz(&mut self, value: u8) {
28252        let offset = Self::T1SZ_SHIFT;
28253        assert!(value & (Self::T1SZ_MASK as u8) == value);
28254        *self = Self::from_bits_retain(
28255            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u64) << offset),
28256        );
28257    }
28258
28259    /// Returns a copy with the `T1SZ` field set to the given value.
28260    pub const fn with_t1sz(mut self, value: u8) -> Self {
28261        self.set_t1sz(value);
28262        self
28263    }
28264
28265    /// Returns the value of the `IRGN1` field.
28266    pub const fn irgn1(self) -> u8 {
28267        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
28268    }
28269
28270    /// Sets the value of the `IRGN1` field.
28271    pub const fn set_irgn1(&mut self, value: u8) {
28272        let offset = Self::IRGN1_SHIFT;
28273        assert!(value & (Self::IRGN1_MASK as u8) == value);
28274        *self = Self::from_bits_retain(
28275            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u64) << offset),
28276        );
28277    }
28278
28279    /// Returns a copy with the `IRGN1` field set to the given value.
28280    pub const fn with_irgn1(mut self, value: u8) -> Self {
28281        self.set_irgn1(value);
28282        self
28283    }
28284
28285    /// Returns the value of the `ORGN1` field.
28286    pub const fn orgn1(self) -> u8 {
28287        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
28288    }
28289
28290    /// Sets the value of the `ORGN1` field.
28291    pub const fn set_orgn1(&mut self, value: u8) {
28292        let offset = Self::ORGN1_SHIFT;
28293        assert!(value & (Self::ORGN1_MASK as u8) == value);
28294        *self = Self::from_bits_retain(
28295            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u64) << offset),
28296        );
28297    }
28298
28299    /// Returns a copy with the `ORGN1` field set to the given value.
28300    pub const fn with_orgn1(mut self, value: u8) -> Self {
28301        self.set_orgn1(value);
28302        self
28303    }
28304
28305    /// Returns the value of the `SH1` field.
28306    pub const fn sh1(self) -> u8 {
28307        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
28308    }
28309
28310    /// Sets the value of the `SH1` field.
28311    pub const fn set_sh1(&mut self, value: u8) {
28312        let offset = Self::SH1_SHIFT;
28313        assert!(value & (Self::SH1_MASK as u8) == value);
28314        *self = Self::from_bits_retain(
28315            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u64) << offset),
28316        );
28317    }
28318
28319    /// Returns a copy with the `SH1` field set to the given value.
28320    pub const fn with_sh1(mut self, value: u8) -> Self {
28321        self.set_sh1(value);
28322        self
28323    }
28324
28325    /// Returns the value of the `TG1` field.
28326    pub const fn tg1(self) -> u8 {
28327        ((self.bits() >> Self::TG1_SHIFT) & 0b11) as u8
28328    }
28329
28330    /// Sets the value of the `TG1` field.
28331    pub const fn set_tg1(&mut self, value: u8) {
28332        let offset = Self::TG1_SHIFT;
28333        assert!(value & (Self::TG1_MASK as u8) == value);
28334        *self = Self::from_bits_retain(
28335            (self.bits() & !(Self::TG1_MASK << offset)) | ((value as u64) << offset),
28336        );
28337    }
28338
28339    /// Returns a copy with the `TG1` field set to the given value.
28340    pub const fn with_tg1(mut self, value: u8) -> Self {
28341        self.set_tg1(value);
28342        self
28343    }
28344
28345    /// Returns the value of the `IPS` field.
28346    pub const fn ips(self) -> u8 {
28347        ((self.bits() >> Self::IPS_SHIFT) & 0b111) as u8
28348    }
28349
28350    /// Sets the value of the `IPS` field.
28351    pub const fn set_ips(&mut self, value: u8) {
28352        let offset = Self::IPS_SHIFT;
28353        assert!(value & (Self::IPS_MASK as u8) == value);
28354        *self = Self::from_bits_retain(
28355            (self.bits() & !(Self::IPS_MASK << offset)) | ((value as u64) << offset),
28356        );
28357    }
28358
28359    /// Returns a copy with the `IPS` field set to the given value.
28360    pub const fn with_ips(mut self, value: u8) -> Self {
28361        self.set_ips(value);
28362        self
28363    }
28364
28365    /// Returns the value of the `VTB` field.
28366    pub const fn vtb(self) -> u8 {
28367        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
28368    }
28369
28370    /// Sets the value of the `VTB` field.
28371    pub const fn set_vtb(&mut self, value: u8) {
28372        let offset = Self::VTB_SHIFT;
28373        assert!(value & (Self::VTB_MASK as u8) == value);
28374        *self = Self::from_bits_retain(
28375            (self.bits() & !(Self::VTB_MASK << offset)) | ((value as u64) << offset),
28376        );
28377    }
28378
28379    /// Returns a copy with the `VTB` field set to the given value.
28380    pub const fn with_vtb(mut self, value: u8) -> Self {
28381        self.set_vtb(value);
28382        self
28383    }
28384}
28385
28386#[cfg(feature = "el3")]
28387bitflags! {
28388    /// `TCR_EL3` system register value.
28389    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28390    #[repr(transparent)]
28391    pub struct TcrEl3: u64 {
28392        /// RES1 bits in the `TCR_EL3` register.
28393        const RES1 = 0b10000000100000000000000000000000;
28394        /// `TBI` bit.
28395        const TBI = 1 << 20;
28396        /// `HA` bit.
28397        const HA = 1 << 21;
28398        /// `HD` bit.
28399        const HD = 1 << 22;
28400        /// `HPD` bit.
28401        const HPD = 1 << 24;
28402        /// `HWU59` bit.
28403        const HWU59 = 1 << 25;
28404        /// `HWU60` bit.
28405        const HWU60 = 1 << 26;
28406        /// `HWU61` bit.
28407        const HWU61 = 1 << 27;
28408        /// `HWU62` bit.
28409        const HWU62 = 1 << 28;
28410        /// `TBID` bit.
28411        const TBID = 1 << 29;
28412        /// `TCMA` bit.
28413        const TCMA = 1 << 30;
28414        /// `DS` bit.
28415        const DS = 1 << 32;
28416        /// `MTX` bit.
28417        const MTX = 1 << 33;
28418        /// `PnCH` bit.
28419        const PNCH = 1 << 34;
28420        /// `PIE` bit.
28421        const PIE = 1 << 35;
28422        /// `POE` bit.
28423        const POE = 1 << 36;
28424        /// `AIE` bit.
28425        const AIE = 1 << 37;
28426        /// `D128` bit.
28427        const D128 = 1 << 38;
28428        /// `PTTWI` bit.
28429        const PTTWI = 1 << 41;
28430        /// `HAFT` bit.
28431        const HAFT = 1 << 42;
28432        /// `DisCH0` bit.
28433        const DISCH0 = 1 << 43;
28434        /// `POE2F` bit.
28435        const POE2F = 1 << 44;
28436        /// `TVAD` bit.
28437        const TVAD = 1 << 53;
28438    }
28439}
28440
28441#[cfg(feature = "el3")]
28442impl TcrEl3 {
28443    /// Offset of the `T0SZ` field.
28444    pub const T0SZ_SHIFT: u32 = 0;
28445    /// Mask for the `T0SZ` field.
28446    pub const T0SZ_MASK: u64 = 0b111111;
28447    /// Offset of the `IRGN0` field.
28448    pub const IRGN0_SHIFT: u32 = 8;
28449    /// Mask for the `IRGN0` field.
28450    pub const IRGN0_MASK: u64 = 0b11;
28451    /// Offset of the `ORGN0` field.
28452    pub const ORGN0_SHIFT: u32 = 10;
28453    /// Mask for the `ORGN0` field.
28454    pub const ORGN0_MASK: u64 = 0b11;
28455    /// Offset of the `SH0` field.
28456    pub const SH0_SHIFT: u32 = 12;
28457    /// Mask for the `SH0` field.
28458    pub const SH0_MASK: u64 = 0b11;
28459    /// Offset of the `TG0` field.
28460    pub const TG0_SHIFT: u32 = 14;
28461    /// Mask for the `TG0` field.
28462    pub const TG0_MASK: u64 = 0b11;
28463    /// Offset of the `PS` field.
28464    pub const PS_SHIFT: u32 = 16;
28465    /// Mask for the `PS` field.
28466    pub const PS_MASK: u64 = 0b111;
28467    /// Offset of the `TBI` field.
28468    pub const TBI_SHIFT: u32 = 20;
28469    /// Offset of the `HA` field.
28470    pub const HA_SHIFT: u32 = 21;
28471    /// Offset of the `HD` field.
28472    pub const HD_SHIFT: u32 = 22;
28473    /// Offset of the `HPD` field.
28474    pub const HPD_SHIFT: u32 = 24;
28475    /// Offset of the `HWU59` field.
28476    pub const HWU59_SHIFT: u32 = 25;
28477    /// Offset of the `HWU60` field.
28478    pub const HWU60_SHIFT: u32 = 26;
28479    /// Offset of the `HWU61` field.
28480    pub const HWU61_SHIFT: u32 = 27;
28481    /// Offset of the `HWU62` field.
28482    pub const HWU62_SHIFT: u32 = 28;
28483    /// Offset of the `TBID` field.
28484    pub const TBID_SHIFT: u32 = 29;
28485    /// Offset of the `TCMA` field.
28486    pub const TCMA_SHIFT: u32 = 30;
28487    /// Offset of the `DS` field.
28488    pub const DS_SHIFT: u32 = 32;
28489    /// Offset of the `MTX` field.
28490    pub const MTX_SHIFT: u32 = 33;
28491    /// Offset of the `PnCH` field.
28492    pub const PNCH_SHIFT: u32 = 34;
28493    /// Offset of the `PIE` field.
28494    pub const PIE_SHIFT: u32 = 35;
28495    /// Offset of the `POE` field.
28496    pub const POE_SHIFT: u32 = 36;
28497    /// Offset of the `AIE` field.
28498    pub const AIE_SHIFT: u32 = 37;
28499    /// Offset of the `D128` field.
28500    pub const D128_SHIFT: u32 = 38;
28501    /// Offset of the `PTTWI` field.
28502    pub const PTTWI_SHIFT: u32 = 41;
28503    /// Offset of the `HAFT` field.
28504    pub const HAFT_SHIFT: u32 = 42;
28505    /// Offset of the `DisCH0` field.
28506    pub const DISCH0_SHIFT: u32 = 43;
28507    /// Offset of the `POE2F` field.
28508    pub const POE2F_SHIFT: u32 = 44;
28509    /// Offset of the `POIW` field.
28510    pub const POIW_SHIFT: u32 = 45;
28511    /// Mask for the `POIW` field.
28512    pub const POIW_MASK: u64 = 0b111;
28513    /// Offset of the `VTB` field.
28514    pub const VTB_SHIFT: u32 = 48;
28515    /// Mask for the `VTB` field.
28516    pub const VTB_MASK: u64 = 0b11111;
28517    /// Offset of the `TVAD` field.
28518    pub const TVAD_SHIFT: u32 = 53;
28519
28520    /// Returns the value of the `T0SZ` field.
28521    pub const fn t0sz(self) -> u8 {
28522        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
28523    }
28524
28525    /// Sets the value of the `T0SZ` field.
28526    pub const fn set_t0sz(&mut self, value: u8) {
28527        let offset = Self::T0SZ_SHIFT;
28528        assert!(value & (Self::T0SZ_MASK as u8) == value);
28529        *self = Self::from_bits_retain(
28530            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
28531        );
28532    }
28533
28534    /// Returns a copy with the `T0SZ` field set to the given value.
28535    pub const fn with_t0sz(mut self, value: u8) -> Self {
28536        self.set_t0sz(value);
28537        self
28538    }
28539
28540    /// Returns the value of the `IRGN0` field.
28541    pub const fn irgn0(self) -> u8 {
28542        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
28543    }
28544
28545    /// Sets the value of the `IRGN0` field.
28546    pub const fn set_irgn0(&mut self, value: u8) {
28547        let offset = Self::IRGN0_SHIFT;
28548        assert!(value & (Self::IRGN0_MASK as u8) == value);
28549        *self = Self::from_bits_retain(
28550            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
28551        );
28552    }
28553
28554    /// Returns a copy with the `IRGN0` field set to the given value.
28555    pub const fn with_irgn0(mut self, value: u8) -> Self {
28556        self.set_irgn0(value);
28557        self
28558    }
28559
28560    /// Returns the value of the `ORGN0` field.
28561    pub const fn orgn0(self) -> u8 {
28562        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
28563    }
28564
28565    /// Sets the value of the `ORGN0` field.
28566    pub const fn set_orgn0(&mut self, value: u8) {
28567        let offset = Self::ORGN0_SHIFT;
28568        assert!(value & (Self::ORGN0_MASK as u8) == value);
28569        *self = Self::from_bits_retain(
28570            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
28571        );
28572    }
28573
28574    /// Returns a copy with the `ORGN0` field set to the given value.
28575    pub const fn with_orgn0(mut self, value: u8) -> Self {
28576        self.set_orgn0(value);
28577        self
28578    }
28579
28580    /// Returns the value of the `SH0` field.
28581    pub const fn sh0(self) -> u8 {
28582        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
28583    }
28584
28585    /// Sets the value of the `SH0` field.
28586    pub const fn set_sh0(&mut self, value: u8) {
28587        let offset = Self::SH0_SHIFT;
28588        assert!(value & (Self::SH0_MASK as u8) == value);
28589        *self = Self::from_bits_retain(
28590            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
28591        );
28592    }
28593
28594    /// Returns a copy with the `SH0` field set to the given value.
28595    pub const fn with_sh0(mut self, value: u8) -> Self {
28596        self.set_sh0(value);
28597        self
28598    }
28599
28600    /// Returns the value of the `TG0` field.
28601    pub const fn tg0(self) -> u8 {
28602        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
28603    }
28604
28605    /// Sets the value of the `TG0` field.
28606    pub const fn set_tg0(&mut self, value: u8) {
28607        let offset = Self::TG0_SHIFT;
28608        assert!(value & (Self::TG0_MASK as u8) == value);
28609        *self = Self::from_bits_retain(
28610            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
28611        );
28612    }
28613
28614    /// Returns a copy with the `TG0` field set to the given value.
28615    pub const fn with_tg0(mut self, value: u8) -> Self {
28616        self.set_tg0(value);
28617        self
28618    }
28619
28620    /// Returns the value of the `PS` field.
28621    pub const fn ps(self) -> u8 {
28622        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
28623    }
28624
28625    /// Sets the value of the `PS` field.
28626    pub const fn set_ps(&mut self, value: u8) {
28627        let offset = Self::PS_SHIFT;
28628        assert!(value & (Self::PS_MASK as u8) == value);
28629        *self = Self::from_bits_retain(
28630            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
28631        );
28632    }
28633
28634    /// Returns a copy with the `PS` field set to the given value.
28635    pub const fn with_ps(mut self, value: u8) -> Self {
28636        self.set_ps(value);
28637        self
28638    }
28639
28640    /// Returns the value of the `POIW` field.
28641    pub const fn poiw(self) -> u8 {
28642        ((self.bits() >> Self::POIW_SHIFT) & 0b111) as u8
28643    }
28644
28645    /// Sets the value of the `POIW` field.
28646    pub const fn set_poiw(&mut self, value: u8) {
28647        let offset = Self::POIW_SHIFT;
28648        assert!(value & (Self::POIW_MASK as u8) == value);
28649        *self = Self::from_bits_retain(
28650            (self.bits() & !(Self::POIW_MASK << offset)) | ((value as u64) << offset),
28651        );
28652    }
28653
28654    /// Returns a copy with the `POIW` field set to the given value.
28655    pub const fn with_poiw(mut self, value: u8) -> Self {
28656        self.set_poiw(value);
28657        self
28658    }
28659
28660    /// Returns the value of the `VTB` field.
28661    pub const fn vtb(self) -> u8 {
28662        ((self.bits() >> Self::VTB_SHIFT) & 0b11111) as u8
28663    }
28664
28665    /// Sets the value of the `VTB` field.
28666    pub const fn set_vtb(&mut self, value: u8) {
28667        let offset = Self::VTB_SHIFT;
28668        assert!(value & (Self::VTB_MASK as u8) == value);
28669        *self = Self::from_bits_retain(
28670            (self.bits() & !(Self::VTB_MASK << offset)) | ((value as u64) << offset),
28671        );
28672    }
28673
28674    /// Returns a copy with the `VTB` field set to the given value.
28675    pub const fn with_vtb(mut self, value: u8) -> Self {
28676        self.set_vtb(value);
28677        self
28678    }
28679}
28680
28681#[cfg(feature = "el1")]
28682bitflags! {
28683    /// `TFSRE0_EL1` system register value.
28684    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28685    #[repr(transparent)]
28686    pub struct Tfsre0El1: u64 {
28687        /// `TF0` bit.
28688        const TF0 = 1 << 0;
28689        /// `TF1` bit.
28690        const TF1 = 1 << 1;
28691    }
28692}
28693
28694#[cfg(feature = "el1")]
28695impl Tfsre0El1 {
28696    /// Offset of the `TF0` field.
28697    pub const TF0_SHIFT: u32 = 0;
28698    /// Offset of the `TF1` field.
28699    pub const TF1_SHIFT: u32 = 1;
28700}
28701
28702#[cfg(feature = "el1")]
28703bitflags! {
28704    /// `TFSR_EL1` system register value.
28705    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28706    #[repr(transparent)]
28707    pub struct TfsrEl1: u64 {
28708        /// `TF0` bit.
28709        const TF0 = 1 << 0;
28710        /// `TF1` bit.
28711        const TF1 = 1 << 1;
28712    }
28713}
28714
28715#[cfg(feature = "el1")]
28716impl TfsrEl1 {
28717    /// Offset of the `TF0` field.
28718    pub const TF0_SHIFT: u32 = 0;
28719    /// Offset of the `TF1` field.
28720    pub const TF1_SHIFT: u32 = 1;
28721}
28722
28723#[cfg(feature = "el2")]
28724bitflags! {
28725    /// `TFSR_EL2` system register value.
28726    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28727    #[repr(transparent)]
28728    pub struct TfsrEl2: u64 {
28729        /// `TF0` bit.
28730        const TF0 = 1 << 0;
28731        /// `TF1` bit.
28732        const TF1 = 1 << 1;
28733    }
28734}
28735
28736#[cfg(feature = "el2")]
28737impl TfsrEl2 {
28738    /// Offset of the `TF0` field.
28739    pub const TF0_SHIFT: u32 = 0;
28740    /// Offset of the `TF1` field.
28741    pub const TF1_SHIFT: u32 = 1;
28742}
28743
28744bitflags! {
28745    /// `TLBTR` system register value.
28746    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28747    #[repr(transparent)]
28748    pub struct Tlbtr: u32 {
28749        /// `nU` bit.
28750        const NU = 1 << 0;
28751    }
28752}
28753
28754impl Tlbtr {
28755    /// Offset of the `nU` field.
28756    pub const NU_SHIFT: u32 = 0;
28757}
28758
28759bitflags! {
28760    /// `TPIDRPRW` system register value.
28761    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28762    #[repr(transparent)]
28763    pub struct Tpidrprw: u32 {
28764    }
28765}
28766
28767impl Tpidrprw {
28768    /// Offset of the `TID` field.
28769    pub const TID_SHIFT: u32 = 0;
28770    /// Mask for the `TID` field.
28771    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
28772
28773    /// Returns the value of the `TID` field.
28774    pub const fn tid(self) -> u32 {
28775        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
28776    }
28777
28778    /// Sets the value of the `TID` field.
28779    pub const fn set_tid(&mut self, value: u32) {
28780        let offset = Self::TID_SHIFT;
28781        assert!(value & (Self::TID_MASK as u32) == value);
28782        *self = Self::from_bits_retain(
28783            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
28784        );
28785    }
28786
28787    /// Returns a copy with the `TID` field set to the given value.
28788    pub const fn with_tid(mut self, value: u32) -> Self {
28789        self.set_tid(value);
28790        self
28791    }
28792}
28793
28794bitflags! {
28795    /// `TPIDRRO_EL0` system register value.
28796    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28797    #[repr(transparent)]
28798    pub struct TpidrroEl0: u64 {
28799    }
28800}
28801
28802impl TpidrroEl0 {
28803    /// Offset of the `ThreadID` field.
28804    pub const THREADID_SHIFT: u32 = 0;
28805    /// Mask for the `ThreadID` field.
28806    pub const THREADID_MASK: u64 =
28807        0b1111111111111111111111111111111111111111111111111111111111111111;
28808
28809    /// Returns the value of the `ThreadID` field.
28810    pub const fn threadid(self) -> u64 {
28811        ((self.bits() >> Self::THREADID_SHIFT)
28812            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
28813    }
28814
28815    /// Sets the value of the `ThreadID` field.
28816    pub const fn set_threadid(&mut self, value: u64) {
28817        let offset = Self::THREADID_SHIFT;
28818        assert!(value & (Self::THREADID_MASK as u64) == value);
28819        *self = Self::from_bits_retain(
28820            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
28821        );
28822    }
28823
28824    /// Returns a copy with the `ThreadID` field set to the given value.
28825    pub const fn with_threadid(mut self, value: u64) -> Self {
28826        self.set_threadid(value);
28827        self
28828    }
28829}
28830
28831bitflags! {
28832    /// `TPIDRURO` system register value.
28833    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28834    #[repr(transparent)]
28835    pub struct Tpidruro: u32 {
28836    }
28837}
28838
28839impl Tpidruro {
28840    /// Offset of the `TID` field.
28841    pub const TID_SHIFT: u32 = 0;
28842    /// Mask for the `TID` field.
28843    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
28844
28845    /// Returns the value of the `TID` field.
28846    pub const fn tid(self) -> u32 {
28847        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
28848    }
28849
28850    /// Sets the value of the `TID` field.
28851    pub const fn set_tid(&mut self, value: u32) {
28852        let offset = Self::TID_SHIFT;
28853        assert!(value & (Self::TID_MASK as u32) == value);
28854        *self = Self::from_bits_retain(
28855            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
28856        );
28857    }
28858
28859    /// Returns a copy with the `TID` field set to the given value.
28860    pub const fn with_tid(mut self, value: u32) -> Self {
28861        self.set_tid(value);
28862        self
28863    }
28864}
28865
28866bitflags! {
28867    /// `TPIDRURW` system register value.
28868    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28869    #[repr(transparent)]
28870    pub struct Tpidrurw: u32 {
28871    }
28872}
28873
28874impl Tpidrurw {
28875    /// Offset of the `TID` field.
28876    pub const TID_SHIFT: u32 = 0;
28877    /// Mask for the `TID` field.
28878    pub const TID_MASK: u32 = 0b11111111111111111111111111111111;
28879
28880    /// Returns the value of the `TID` field.
28881    pub const fn tid(self) -> u32 {
28882        ((self.bits() >> Self::TID_SHIFT) & 0b11111111111111111111111111111111) as u32
28883    }
28884
28885    /// Sets the value of the `TID` field.
28886    pub const fn set_tid(&mut self, value: u32) {
28887        let offset = Self::TID_SHIFT;
28888        assert!(value & (Self::TID_MASK as u32) == value);
28889        *self = Self::from_bits_retain(
28890            (self.bits() & !(Self::TID_MASK << offset)) | ((value as u32) << offset),
28891        );
28892    }
28893
28894    /// Returns a copy with the `TID` field set to the given value.
28895    pub const fn with_tid(mut self, value: u32) -> Self {
28896        self.set_tid(value);
28897        self
28898    }
28899}
28900
28901bitflags! {
28902    /// `TPIDR_EL0` system register value.
28903    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28904    #[repr(transparent)]
28905    pub struct TpidrEl0: u64 {
28906    }
28907}
28908
28909impl TpidrEl0 {
28910    /// Offset of the `ThreadID` field.
28911    pub const THREADID_SHIFT: u32 = 0;
28912    /// Mask for the `ThreadID` field.
28913    pub const THREADID_MASK: u64 =
28914        0b1111111111111111111111111111111111111111111111111111111111111111;
28915
28916    /// Returns the value of the `ThreadID` field.
28917    pub const fn threadid(self) -> u64 {
28918        ((self.bits() >> Self::THREADID_SHIFT)
28919            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
28920    }
28921
28922    /// Sets the value of the `ThreadID` field.
28923    pub const fn set_threadid(&mut self, value: u64) {
28924        let offset = Self::THREADID_SHIFT;
28925        assert!(value & (Self::THREADID_MASK as u64) == value);
28926        *self = Self::from_bits_retain(
28927            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
28928        );
28929    }
28930
28931    /// Returns a copy with the `ThreadID` field set to the given value.
28932    pub const fn with_threadid(mut self, value: u64) -> Self {
28933        self.set_threadid(value);
28934        self
28935    }
28936}
28937
28938#[cfg(feature = "el1")]
28939bitflags! {
28940    /// `TPIDR_EL1` system register value.
28941    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28942    #[repr(transparent)]
28943    pub struct TpidrEl1: u64 {
28944    }
28945}
28946
28947#[cfg(feature = "el1")]
28948impl TpidrEl1 {
28949    /// Offset of the `ThreadID` field.
28950    pub const THREADID_SHIFT: u32 = 0;
28951    /// Mask for the `ThreadID` field.
28952    pub const THREADID_MASK: u64 =
28953        0b1111111111111111111111111111111111111111111111111111111111111111;
28954
28955    /// Returns the value of the `ThreadID` field.
28956    pub const fn threadid(self) -> u64 {
28957        ((self.bits() >> Self::THREADID_SHIFT)
28958            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
28959    }
28960
28961    /// Sets the value of the `ThreadID` field.
28962    pub const fn set_threadid(&mut self, value: u64) {
28963        let offset = Self::THREADID_SHIFT;
28964        assert!(value & (Self::THREADID_MASK as u64) == value);
28965        *self = Self::from_bits_retain(
28966            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
28967        );
28968    }
28969
28970    /// Returns a copy with the `ThreadID` field set to the given value.
28971    pub const fn with_threadid(mut self, value: u64) -> Self {
28972        self.set_threadid(value);
28973        self
28974    }
28975}
28976
28977#[cfg(feature = "el2")]
28978bitflags! {
28979    /// `TPIDR_EL2` system register value.
28980    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
28981    #[repr(transparent)]
28982    pub struct TpidrEl2: u64 {
28983    }
28984}
28985
28986#[cfg(feature = "el2")]
28987impl TpidrEl2 {
28988    /// Offset of the `ThreadID` field.
28989    pub const THREADID_SHIFT: u32 = 0;
28990    /// Mask for the `ThreadID` field.
28991    pub const THREADID_MASK: u64 =
28992        0b1111111111111111111111111111111111111111111111111111111111111111;
28993
28994    /// Returns the value of the `ThreadID` field.
28995    pub const fn threadid(self) -> u64 {
28996        ((self.bits() >> Self::THREADID_SHIFT)
28997            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
28998    }
28999
29000    /// Sets the value of the `ThreadID` field.
29001    pub const fn set_threadid(&mut self, value: u64) {
29002        let offset = Self::THREADID_SHIFT;
29003        assert!(value & (Self::THREADID_MASK as u64) == value);
29004        *self = Self::from_bits_retain(
29005            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
29006        );
29007    }
29008
29009    /// Returns a copy with the `ThreadID` field set to the given value.
29010    pub const fn with_threadid(mut self, value: u64) -> Self {
29011        self.set_threadid(value);
29012        self
29013    }
29014}
29015
29016#[cfg(feature = "el3")]
29017bitflags! {
29018    /// `TPIDR_EL3` system register value.
29019    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29020    #[repr(transparent)]
29021    pub struct TpidrEl3: u64 {
29022    }
29023}
29024
29025#[cfg(feature = "el3")]
29026impl TpidrEl3 {
29027    /// Offset of the `ThreadID` field.
29028    pub const THREADID_SHIFT: u32 = 0;
29029    /// Mask for the `ThreadID` field.
29030    pub const THREADID_MASK: u64 =
29031        0b1111111111111111111111111111111111111111111111111111111111111111;
29032
29033    /// Returns the value of the `ThreadID` field.
29034    pub const fn threadid(self) -> u64 {
29035        ((self.bits() >> Self::THREADID_SHIFT)
29036            & 0b1111111111111111111111111111111111111111111111111111111111111111) as u64
29037    }
29038
29039    /// Sets the value of the `ThreadID` field.
29040    pub const fn set_threadid(&mut self, value: u64) {
29041        let offset = Self::THREADID_SHIFT;
29042        assert!(value & (Self::THREADID_MASK as u64) == value);
29043        *self = Self::from_bits_retain(
29044            (self.bits() & !(Self::THREADID_MASK << offset)) | ((value as u64) << offset),
29045        );
29046    }
29047
29048    /// Returns a copy with the `ThreadID` field set to the given value.
29049    pub const fn with_threadid(mut self, value: u64) -> Self {
29050        self.set_threadid(value);
29051        self
29052    }
29053}
29054
29055bitflags! {
29056    /// `TRFCR` system register value.
29057    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29058    #[repr(transparent)]
29059    pub struct Trfcr: u32 {
29060        /// `E0TRE` bit.
29061        const E0TRE = 1 << 0;
29062        /// `E1TRE` bit.
29063        const E1TRE = 1 << 1;
29064    }
29065}
29066
29067impl Trfcr {
29068    /// Offset of the `E0TRE` field.
29069    pub const E0TRE_SHIFT: u32 = 0;
29070    /// Offset of the `E1TRE` field.
29071    pub const E1TRE_SHIFT: u32 = 1;
29072    /// Offset of the `TS` field.
29073    pub const TS_SHIFT: u32 = 5;
29074    /// Mask for the `TS` field.
29075    pub const TS_MASK: u32 = 0b11;
29076
29077    /// Returns the value of the `TS` field.
29078    pub const fn ts(self) -> u8 {
29079        ((self.bits() >> Self::TS_SHIFT) & 0b11) as u8
29080    }
29081
29082    /// Sets the value of the `TS` field.
29083    pub const fn set_ts(&mut self, value: u8) {
29084        let offset = Self::TS_SHIFT;
29085        assert!(value & (Self::TS_MASK as u8) == value);
29086        *self = Self::from_bits_retain(
29087            (self.bits() & !(Self::TS_MASK << offset)) | ((value as u32) << offset),
29088        );
29089    }
29090
29091    /// Returns a copy with the `TS` field set to the given value.
29092    pub const fn with_ts(mut self, value: u8) -> Self {
29093        self.set_ts(value);
29094        self
29095    }
29096}
29097
29098bitflags! {
29099    /// `TTBCR` system register value.
29100    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29101    #[repr(transparent)]
29102    pub struct Ttbcr: u32 {
29103        /// `PD0` bit.
29104        const PD0 = 1 << 4;
29105        /// `PD1` bit.
29106        const PD1 = 1 << 5;
29107        /// `T2E` bit.
29108        const T2E = 1 << 6;
29109        /// `EPD0` bit.
29110        const EPD0 = 1 << 7;
29111        /// `A1` bit.
29112        const A1 = 1 << 22;
29113        /// `EPD1` bit.
29114        const EPD1 = 1 << 23;
29115        /// `EAE` bit.
29116        const EAE = 1 << 31;
29117    }
29118}
29119
29120impl Ttbcr {
29121    /// Offset of the `N` field.
29122    pub const N_SHIFT: u32 = 0;
29123    /// Mask for the `N` field.
29124    pub const N_MASK: u32 = 0b111;
29125    /// Offset of the `T0SZ` field.
29126    pub const T0SZ_SHIFT: u32 = 0;
29127    /// Mask for the `T0SZ` field.
29128    pub const T0SZ_MASK: u32 = 0b111;
29129    /// Offset of the `PD0` field.
29130    pub const PD0_SHIFT: u32 = 4;
29131    /// Offset of the `PD1` field.
29132    pub const PD1_SHIFT: u32 = 5;
29133    /// Offset of the `T2E` field.
29134    pub const T2E_SHIFT: u32 = 6;
29135    /// Offset of the `EPD0` field.
29136    pub const EPD0_SHIFT: u32 = 7;
29137    /// Offset of the `IRGN0` field.
29138    pub const IRGN0_SHIFT: u32 = 8;
29139    /// Mask for the `IRGN0` field.
29140    pub const IRGN0_MASK: u32 = 0b11;
29141    /// Offset of the `ORGN0` field.
29142    pub const ORGN0_SHIFT: u32 = 10;
29143    /// Mask for the `ORGN0` field.
29144    pub const ORGN0_MASK: u32 = 0b11;
29145    /// Offset of the `SH0` field.
29146    pub const SH0_SHIFT: u32 = 12;
29147    /// Mask for the `SH0` field.
29148    pub const SH0_MASK: u32 = 0b11;
29149    /// Offset of the `T1SZ` field.
29150    pub const T1SZ_SHIFT: u32 = 16;
29151    /// Mask for the `T1SZ` field.
29152    pub const T1SZ_MASK: u32 = 0b111;
29153    /// Offset of the `A1` field.
29154    pub const A1_SHIFT: u32 = 22;
29155    /// Offset of the `EPD1` field.
29156    pub const EPD1_SHIFT: u32 = 23;
29157    /// Offset of the `IRGN1` field.
29158    pub const IRGN1_SHIFT: u32 = 24;
29159    /// Mask for the `IRGN1` field.
29160    pub const IRGN1_MASK: u32 = 0b11;
29161    /// Offset of the `ORGN1` field.
29162    pub const ORGN1_SHIFT: u32 = 26;
29163    /// Mask for the `ORGN1` field.
29164    pub const ORGN1_MASK: u32 = 0b11;
29165    /// Offset of the `SH1` field.
29166    pub const SH1_SHIFT: u32 = 28;
29167    /// Mask for the `SH1` field.
29168    pub const SH1_MASK: u32 = 0b11;
29169    /// Offset of the `EAE` field.
29170    pub const EAE_SHIFT: u32 = 31;
29171
29172    /// Returns the value of the `N` field.
29173    pub const fn n(self) -> u8 {
29174        ((self.bits() >> Self::N_SHIFT) & 0b111) as u8
29175    }
29176
29177    /// Sets the value of the `N` field.
29178    pub const fn set_n(&mut self, value: u8) {
29179        let offset = Self::N_SHIFT;
29180        assert!(value & (Self::N_MASK as u8) == value);
29181        *self = Self::from_bits_retain(
29182            (self.bits() & !(Self::N_MASK << offset)) | ((value as u32) << offset),
29183        );
29184    }
29185
29186    /// Returns a copy with the `N` field set to the given value.
29187    pub const fn with_n(mut self, value: u8) -> Self {
29188        self.set_n(value);
29189        self
29190    }
29191
29192    /// Returns the value of the `T0SZ` field.
29193    pub const fn t0sz(self) -> u8 {
29194        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111) as u8
29195    }
29196
29197    /// Sets the value of the `T0SZ` field.
29198    pub const fn set_t0sz(&mut self, value: u8) {
29199        let offset = Self::T0SZ_SHIFT;
29200        assert!(value & (Self::T0SZ_MASK as u8) == value);
29201        *self = Self::from_bits_retain(
29202            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
29203        );
29204    }
29205
29206    /// Returns a copy with the `T0SZ` field set to the given value.
29207    pub const fn with_t0sz(mut self, value: u8) -> Self {
29208        self.set_t0sz(value);
29209        self
29210    }
29211
29212    /// Returns the value of the `IRGN0` field.
29213    pub const fn irgn0(self) -> u8 {
29214        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
29215    }
29216
29217    /// Sets the value of the `IRGN0` field.
29218    pub const fn set_irgn0(&mut self, value: u8) {
29219        let offset = Self::IRGN0_SHIFT;
29220        assert!(value & (Self::IRGN0_MASK as u8) == value);
29221        *self = Self::from_bits_retain(
29222            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
29223        );
29224    }
29225
29226    /// Returns a copy with the `IRGN0` field set to the given value.
29227    pub const fn with_irgn0(mut self, value: u8) -> Self {
29228        self.set_irgn0(value);
29229        self
29230    }
29231
29232    /// Returns the value of the `ORGN0` field.
29233    pub const fn orgn0(self) -> u8 {
29234        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
29235    }
29236
29237    /// Sets the value of the `ORGN0` field.
29238    pub const fn set_orgn0(&mut self, value: u8) {
29239        let offset = Self::ORGN0_SHIFT;
29240        assert!(value & (Self::ORGN0_MASK as u8) == value);
29241        *self = Self::from_bits_retain(
29242            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
29243        );
29244    }
29245
29246    /// Returns a copy with the `ORGN0` field set to the given value.
29247    pub const fn with_orgn0(mut self, value: u8) -> Self {
29248        self.set_orgn0(value);
29249        self
29250    }
29251
29252    /// Returns the value of the `SH0` field.
29253    pub const fn sh0(self) -> u8 {
29254        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
29255    }
29256
29257    /// Sets the value of the `SH0` field.
29258    pub const fn set_sh0(&mut self, value: u8) {
29259        let offset = Self::SH0_SHIFT;
29260        assert!(value & (Self::SH0_MASK as u8) == value);
29261        *self = Self::from_bits_retain(
29262            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
29263        );
29264    }
29265
29266    /// Returns a copy with the `SH0` field set to the given value.
29267    pub const fn with_sh0(mut self, value: u8) -> Self {
29268        self.set_sh0(value);
29269        self
29270    }
29271
29272    /// Returns the value of the `T1SZ` field.
29273    pub const fn t1sz(self) -> u8 {
29274        ((self.bits() >> Self::T1SZ_SHIFT) & 0b111) as u8
29275    }
29276
29277    /// Sets the value of the `T1SZ` field.
29278    pub const fn set_t1sz(&mut self, value: u8) {
29279        let offset = Self::T1SZ_SHIFT;
29280        assert!(value & (Self::T1SZ_MASK as u8) == value);
29281        *self = Self::from_bits_retain(
29282            (self.bits() & !(Self::T1SZ_MASK << offset)) | ((value as u32) << offset),
29283        );
29284    }
29285
29286    /// Returns a copy with the `T1SZ` field set to the given value.
29287    pub const fn with_t1sz(mut self, value: u8) -> Self {
29288        self.set_t1sz(value);
29289        self
29290    }
29291
29292    /// Returns the value of the `IRGN1` field.
29293    pub const fn irgn1(self) -> u8 {
29294        ((self.bits() >> Self::IRGN1_SHIFT) & 0b11) as u8
29295    }
29296
29297    /// Sets the value of the `IRGN1` field.
29298    pub const fn set_irgn1(&mut self, value: u8) {
29299        let offset = Self::IRGN1_SHIFT;
29300        assert!(value & (Self::IRGN1_MASK as u8) == value);
29301        *self = Self::from_bits_retain(
29302            (self.bits() & !(Self::IRGN1_MASK << offset)) | ((value as u32) << offset),
29303        );
29304    }
29305
29306    /// Returns a copy with the `IRGN1` field set to the given value.
29307    pub const fn with_irgn1(mut self, value: u8) -> Self {
29308        self.set_irgn1(value);
29309        self
29310    }
29311
29312    /// Returns the value of the `ORGN1` field.
29313    pub const fn orgn1(self) -> u8 {
29314        ((self.bits() >> Self::ORGN1_SHIFT) & 0b11) as u8
29315    }
29316
29317    /// Sets the value of the `ORGN1` field.
29318    pub const fn set_orgn1(&mut self, value: u8) {
29319        let offset = Self::ORGN1_SHIFT;
29320        assert!(value & (Self::ORGN1_MASK as u8) == value);
29321        *self = Self::from_bits_retain(
29322            (self.bits() & !(Self::ORGN1_MASK << offset)) | ((value as u32) << offset),
29323        );
29324    }
29325
29326    /// Returns a copy with the `ORGN1` field set to the given value.
29327    pub const fn with_orgn1(mut self, value: u8) -> Self {
29328        self.set_orgn1(value);
29329        self
29330    }
29331
29332    /// Returns the value of the `SH1` field.
29333    pub const fn sh1(self) -> u8 {
29334        ((self.bits() >> Self::SH1_SHIFT) & 0b11) as u8
29335    }
29336
29337    /// Sets the value of the `SH1` field.
29338    pub const fn set_sh1(&mut self, value: u8) {
29339        let offset = Self::SH1_SHIFT;
29340        assert!(value & (Self::SH1_MASK as u8) == value);
29341        *self = Self::from_bits_retain(
29342            (self.bits() & !(Self::SH1_MASK << offset)) | ((value as u32) << offset),
29343        );
29344    }
29345
29346    /// Returns a copy with the `SH1` field set to the given value.
29347    pub const fn with_sh1(mut self, value: u8) -> Self {
29348        self.set_sh1(value);
29349        self
29350    }
29351}
29352
29353bitflags! {
29354    /// `TTBCR2` system register value.
29355    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29356    #[repr(transparent)]
29357    pub struct Ttbcr2: u32 {
29358        /// `HPD0` bit.
29359        const HPD0 = 1 << 9;
29360        /// `HPD1` bit.
29361        const HPD1 = 1 << 10;
29362        /// `HWU059` bit.
29363        const HWU059 = 1 << 11;
29364        /// `HWU060` bit.
29365        const HWU060 = 1 << 12;
29366        /// `HWU061` bit.
29367        const HWU061 = 1 << 13;
29368        /// `HWU062` bit.
29369        const HWU062 = 1 << 14;
29370        /// `HWU159` bit.
29371        const HWU159 = 1 << 15;
29372        /// `HWU160` bit.
29373        const HWU160 = 1 << 16;
29374        /// `HWU161` bit.
29375        const HWU161 = 1 << 17;
29376        /// `HWU162` bit.
29377        const HWU162 = 1 << 18;
29378    }
29379}
29380
29381impl Ttbcr2 {
29382    /// Offset of the `HPD0` field.
29383    pub const HPD0_SHIFT: u32 = 9;
29384    /// Offset of the `HPD1` field.
29385    pub const HPD1_SHIFT: u32 = 10;
29386    /// Offset of the `HWU059` field.
29387    pub const HWU059_SHIFT: u32 = 11;
29388    /// Offset of the `HWU060` field.
29389    pub const HWU060_SHIFT: u32 = 12;
29390    /// Offset of the `HWU061` field.
29391    pub const HWU061_SHIFT: u32 = 13;
29392    /// Offset of the `HWU062` field.
29393    pub const HWU062_SHIFT: u32 = 14;
29394    /// Offset of the `HWU159` field.
29395    pub const HWU159_SHIFT: u32 = 15;
29396    /// Offset of the `HWU160` field.
29397    pub const HWU160_SHIFT: u32 = 16;
29398    /// Offset of the `HWU161` field.
29399    pub const HWU161_SHIFT: u32 = 17;
29400    /// Offset of the `HWU162` field.
29401    pub const HWU162_SHIFT: u32 = 18;
29402}
29403
29404bitflags! {
29405    /// `TTBR0` system register value.
29406    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29407    #[repr(transparent)]
29408    pub struct Ttbr0: u64 {
29409        /// `CnP` bit.
29410        const CNP = 1 << 0;
29411        /// `S` bit.
29412        const S = 1 << 1;
29413        /// `IMP` bit.
29414        const IMP = 1 << 2;
29415        /// `NOS` bit.
29416        const NOS = 1 << 5;
29417    }
29418}
29419
29420impl Ttbr0 {
29421    /// Offset of the `CnP` field.
29422    pub const CNP_SHIFT: u32 = 0;
29423    /// Offset of the `BADDR` field.
29424    pub const BADDR_SHIFT: u32 = 1;
29425    /// Mask for the `BADDR` field.
29426    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
29427    /// Offset of the `S` field.
29428    pub const S_SHIFT: u32 = 1;
29429    /// Offset of the `IMP` field.
29430    pub const IMP_SHIFT: u32 = 2;
29431    /// Offset of the `RGN` field.
29432    pub const RGN_SHIFT: u32 = 3;
29433    /// Mask for the `RGN` field.
29434    pub const RGN_MASK: u64 = 0b11;
29435    /// Offset of the `NOS` field.
29436    pub const NOS_SHIFT: u32 = 5;
29437    /// Offset of the `TTB0` field.
29438    pub const TTB0_SHIFT: u32 = 7;
29439    /// Mask for the `TTB0` field.
29440    pub const TTB0_MASK: u64 = 0b1111111111111111111111111;
29441    /// Offset of the `ASID` field.
29442    pub const ASID_SHIFT: u32 = 48;
29443    /// Mask for the `ASID` field.
29444    pub const ASID_MASK: u64 = 0b11111111;
29445
29446    /// Returns the value of the `BADDR` field.
29447    pub const fn baddr(self) -> u64 {
29448        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
29449            as u64
29450    }
29451
29452    /// Sets the value of the `BADDR` field.
29453    pub const fn set_baddr(&mut self, value: u64) {
29454        let offset = Self::BADDR_SHIFT;
29455        assert!(value & (Self::BADDR_MASK as u64) == value);
29456        *self = Self::from_bits_retain(
29457            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
29458        );
29459    }
29460
29461    /// Returns a copy with the `BADDR` field set to the given value.
29462    pub const fn with_baddr(mut self, value: u64) -> Self {
29463        self.set_baddr(value);
29464        self
29465    }
29466
29467    /// Returns the value of the `RGN` field.
29468    pub const fn rgn(self) -> u8 {
29469        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
29470    }
29471
29472    /// Sets the value of the `RGN` field.
29473    pub const fn set_rgn(&mut self, value: u8) {
29474        let offset = Self::RGN_SHIFT;
29475        assert!(value & (Self::RGN_MASK as u8) == value);
29476        *self = Self::from_bits_retain(
29477            (self.bits() & !(Self::RGN_MASK << offset)) | ((value as u64) << offset),
29478        );
29479    }
29480
29481    /// Returns a copy with the `RGN` field set to the given value.
29482    pub const fn with_rgn(mut self, value: u8) -> Self {
29483        self.set_rgn(value);
29484        self
29485    }
29486
29487    /// Returns the value of the `TTB0` field.
29488    pub const fn ttb0(self) -> u32 {
29489        ((self.bits() >> Self::TTB0_SHIFT) & 0b1111111111111111111111111) as u32
29490    }
29491
29492    /// Sets the value of the `TTB0` field.
29493    pub const fn set_ttb0(&mut self, value: u32) {
29494        let offset = Self::TTB0_SHIFT;
29495        assert!(value & (Self::TTB0_MASK as u32) == value);
29496        *self = Self::from_bits_retain(
29497            (self.bits() & !(Self::TTB0_MASK << offset)) | ((value as u64) << offset),
29498        );
29499    }
29500
29501    /// Returns a copy with the `TTB0` field set to the given value.
29502    pub const fn with_ttb0(mut self, value: u32) -> Self {
29503        self.set_ttb0(value);
29504        self
29505    }
29506
29507    /// Returns the value of the `ASID` field.
29508    pub const fn asid(self) -> u8 {
29509        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
29510    }
29511
29512    /// Sets the value of the `ASID` field.
29513    pub const fn set_asid(&mut self, value: u8) {
29514        let offset = Self::ASID_SHIFT;
29515        assert!(value & (Self::ASID_MASK as u8) == value);
29516        *self = Self::from_bits_retain(
29517            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
29518        );
29519    }
29520
29521    /// Returns a copy with the `ASID` field set to the given value.
29522    pub const fn with_asid(mut self, value: u8) -> Self {
29523        self.set_asid(value);
29524        self
29525    }
29526}
29527
29528#[cfg(feature = "el1")]
29529bitflags! {
29530    /// `TTBR0_EL1` system register value.
29531    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29532    #[repr(transparent)]
29533    pub struct Ttbr0El1: u64 {
29534        /// `CnP` bit.
29535        const CNP = 1 << 0;
29536    }
29537}
29538
29539#[cfg(feature = "el1")]
29540impl Ttbr0El1 {
29541    /// Offset of the `CnP` field.
29542    pub const CNP_SHIFT: u32 = 0;
29543    /// Offset of the `BADDR[47:1]` field.
29544    pub const BADDR_47_1_SHIFT: u32 = 1;
29545    /// Mask for the `BADDR[47:1]` field.
29546    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
29547    /// Offset of the `SKL` field.
29548    pub const SKL_SHIFT: u32 = 1;
29549    /// Mask for the `SKL` field.
29550    pub const SKL_MASK: u64 = 0b11;
29551    /// Offset of the `ASID` field.
29552    pub const ASID_SHIFT: u32 = 48;
29553    /// Mask for the `ASID` field.
29554    pub const ASID_MASK: u64 = 0b1111111111111111;
29555
29556    /// Returns the value of the `BADDR[47:1]` field.
29557    pub const fn baddr_47_1(self) -> u64 {
29558        ((self.bits() >> Self::BADDR_47_1_SHIFT)
29559            & 0b11111111111111111111111111111111111111111111111) as u64
29560    }
29561
29562    /// Sets the value of the `BADDR[47:1]` field.
29563    pub const fn set_baddr_47_1(&mut self, value: u64) {
29564        let offset = Self::BADDR_47_1_SHIFT;
29565        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
29566        *self = Self::from_bits_retain(
29567            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
29568        );
29569    }
29570
29571    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
29572    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
29573        self.set_baddr_47_1(value);
29574        self
29575    }
29576
29577    /// Returns the value of the `SKL` field.
29578    pub const fn skl(self) -> u8 {
29579        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
29580    }
29581
29582    /// Sets the value of the `SKL` field.
29583    pub const fn set_skl(&mut self, value: u8) {
29584        let offset = Self::SKL_SHIFT;
29585        assert!(value & (Self::SKL_MASK as u8) == value);
29586        *self = Self::from_bits_retain(
29587            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
29588        );
29589    }
29590
29591    /// Returns a copy with the `SKL` field set to the given value.
29592    pub const fn with_skl(mut self, value: u8) -> Self {
29593        self.set_skl(value);
29594        self
29595    }
29596
29597    /// Returns the value of the `ASID` field.
29598    pub const fn asid(self) -> u16 {
29599        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
29600    }
29601
29602    /// Sets the value of the `ASID` field.
29603    pub const fn set_asid(&mut self, value: u16) {
29604        let offset = Self::ASID_SHIFT;
29605        assert!(value & (Self::ASID_MASK as u16) == value);
29606        *self = Self::from_bits_retain(
29607            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
29608        );
29609    }
29610
29611    /// Returns a copy with the `ASID` field set to the given value.
29612    pub const fn with_asid(mut self, value: u16) -> Self {
29613        self.set_asid(value);
29614        self
29615    }
29616}
29617
29618#[cfg(feature = "el2")]
29619bitflags! {
29620    /// `TTBR0_EL2` system register value.
29621    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29622    #[repr(transparent)]
29623    pub struct Ttbr0El2: u64 {
29624        /// `CnP` bit.
29625        const CNP = 1 << 0;
29626    }
29627}
29628
29629#[cfg(feature = "el2")]
29630impl Ttbr0El2 {
29631    /// Offset of the `CnP` field.
29632    pub const CNP_SHIFT: u32 = 0;
29633    /// Offset of the `BADDR[47:1]` field.
29634    pub const BADDR_47_1_SHIFT: u32 = 1;
29635    /// Mask for the `BADDR[47:1]` field.
29636    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
29637    /// Offset of the `SKL` field.
29638    pub const SKL_SHIFT: u32 = 1;
29639    /// Mask for the `SKL` field.
29640    pub const SKL_MASK: u64 = 0b11;
29641    /// Offset of the `ASID` field.
29642    pub const ASID_SHIFT: u32 = 48;
29643    /// Mask for the `ASID` field.
29644    pub const ASID_MASK: u64 = 0b1111111111111111;
29645
29646    /// Returns the value of the `BADDR[47:1]` field.
29647    pub const fn baddr_47_1(self) -> u64 {
29648        ((self.bits() >> Self::BADDR_47_1_SHIFT)
29649            & 0b11111111111111111111111111111111111111111111111) as u64
29650    }
29651
29652    /// Sets the value of the `BADDR[47:1]` field.
29653    pub const fn set_baddr_47_1(&mut self, value: u64) {
29654        let offset = Self::BADDR_47_1_SHIFT;
29655        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
29656        *self = Self::from_bits_retain(
29657            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
29658        );
29659    }
29660
29661    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
29662    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
29663        self.set_baddr_47_1(value);
29664        self
29665    }
29666
29667    /// Returns the value of the `SKL` field.
29668    pub const fn skl(self) -> u8 {
29669        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
29670    }
29671
29672    /// Sets the value of the `SKL` field.
29673    pub const fn set_skl(&mut self, value: u8) {
29674        let offset = Self::SKL_SHIFT;
29675        assert!(value & (Self::SKL_MASK as u8) == value);
29676        *self = Self::from_bits_retain(
29677            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
29678        );
29679    }
29680
29681    /// Returns a copy with the `SKL` field set to the given value.
29682    pub const fn with_skl(mut self, value: u8) -> Self {
29683        self.set_skl(value);
29684        self
29685    }
29686
29687    /// Returns the value of the `ASID` field.
29688    pub const fn asid(self) -> u16 {
29689        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
29690    }
29691
29692    /// Sets the value of the `ASID` field.
29693    pub const fn set_asid(&mut self, value: u16) {
29694        let offset = Self::ASID_SHIFT;
29695        assert!(value & (Self::ASID_MASK as u16) == value);
29696        *self = Self::from_bits_retain(
29697            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
29698        );
29699    }
29700
29701    /// Returns a copy with the `ASID` field set to the given value.
29702    pub const fn with_asid(mut self, value: u16) -> Self {
29703        self.set_asid(value);
29704        self
29705    }
29706}
29707
29708#[cfg(feature = "el3")]
29709bitflags! {
29710    /// `TTBR0_EL3` system register value.
29711    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29712    #[repr(transparent)]
29713    pub struct Ttbr0El3: u64 {
29714        /// `CnP` bit.
29715        const CNP = 1 << 0;
29716    }
29717}
29718
29719#[cfg(feature = "el3")]
29720impl Ttbr0El3 {
29721    /// Offset of the `CnP` field.
29722    pub const CNP_SHIFT: u32 = 0;
29723    /// Offset of the `SKL` field.
29724    pub const SKL_SHIFT: u32 = 1;
29725    /// Mask for the `SKL` field.
29726    pub const SKL_MASK: u64 = 0b11;
29727
29728    /// Returns the value of the `SKL` field.
29729    pub const fn skl(self) -> u8 {
29730        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
29731    }
29732
29733    /// Sets the value of the `SKL` field.
29734    pub const fn set_skl(&mut self, value: u8) {
29735        let offset = Self::SKL_SHIFT;
29736        assert!(value & (Self::SKL_MASK as u8) == value);
29737        *self = Self::from_bits_retain(
29738            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
29739        );
29740    }
29741
29742    /// Returns a copy with the `SKL` field set to the given value.
29743    pub const fn with_skl(mut self, value: u8) -> Self {
29744        self.set_skl(value);
29745        self
29746    }
29747}
29748
29749bitflags! {
29750    /// `TTBR1` system register value.
29751    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29752    #[repr(transparent)]
29753    pub struct Ttbr1: u64 {
29754        /// `CnP` bit.
29755        const CNP = 1 << 0;
29756        /// `S` bit.
29757        const S = 1 << 1;
29758        /// `IMP` bit.
29759        const IMP = 1 << 2;
29760        /// `NOS` bit.
29761        const NOS = 1 << 5;
29762    }
29763}
29764
29765impl Ttbr1 {
29766    /// Offset of the `CnP` field.
29767    pub const CNP_SHIFT: u32 = 0;
29768    /// Offset of the `BADDR` field.
29769    pub const BADDR_SHIFT: u32 = 1;
29770    /// Mask for the `BADDR` field.
29771    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
29772    /// Offset of the `S` field.
29773    pub const S_SHIFT: u32 = 1;
29774    /// Offset of the `IMP` field.
29775    pub const IMP_SHIFT: u32 = 2;
29776    /// Offset of the `RGN` field.
29777    pub const RGN_SHIFT: u32 = 3;
29778    /// Mask for the `RGN` field.
29779    pub const RGN_MASK: u64 = 0b11;
29780    /// Offset of the `NOS` field.
29781    pub const NOS_SHIFT: u32 = 5;
29782    /// Offset of the `TTB1` field.
29783    pub const TTB1_SHIFT: u32 = 7;
29784    /// Mask for the `TTB1` field.
29785    pub const TTB1_MASK: u64 = 0b1111111111111111111111111;
29786    /// Offset of the `ASID` field.
29787    pub const ASID_SHIFT: u32 = 48;
29788    /// Mask for the `ASID` field.
29789    pub const ASID_MASK: u64 = 0b11111111;
29790
29791    /// Returns the value of the `BADDR` field.
29792    pub const fn baddr(self) -> u64 {
29793        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
29794            as u64
29795    }
29796
29797    /// Sets the value of the `BADDR` field.
29798    pub const fn set_baddr(&mut self, value: u64) {
29799        let offset = Self::BADDR_SHIFT;
29800        assert!(value & (Self::BADDR_MASK as u64) == value);
29801        *self = Self::from_bits_retain(
29802            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
29803        );
29804    }
29805
29806    /// Returns a copy with the `BADDR` field set to the given value.
29807    pub const fn with_baddr(mut self, value: u64) -> Self {
29808        self.set_baddr(value);
29809        self
29810    }
29811
29812    /// Returns the value of the `RGN` field.
29813    pub const fn rgn(self) -> u8 {
29814        ((self.bits() >> Self::RGN_SHIFT) & 0b11) as u8
29815    }
29816
29817    /// Sets the value of the `RGN` field.
29818    pub const fn set_rgn(&mut self, value: u8) {
29819        let offset = Self::RGN_SHIFT;
29820        assert!(value & (Self::RGN_MASK as u8) == value);
29821        *self = Self::from_bits_retain(
29822            (self.bits() & !(Self::RGN_MASK << offset)) | ((value as u64) << offset),
29823        );
29824    }
29825
29826    /// Returns a copy with the `RGN` field set to the given value.
29827    pub const fn with_rgn(mut self, value: u8) -> Self {
29828        self.set_rgn(value);
29829        self
29830    }
29831
29832    /// Returns the value of the `TTB1` field.
29833    pub const fn ttb1(self) -> u32 {
29834        ((self.bits() >> Self::TTB1_SHIFT) & 0b1111111111111111111111111) as u32
29835    }
29836
29837    /// Sets the value of the `TTB1` field.
29838    pub const fn set_ttb1(&mut self, value: u32) {
29839        let offset = Self::TTB1_SHIFT;
29840        assert!(value & (Self::TTB1_MASK as u32) == value);
29841        *self = Self::from_bits_retain(
29842            (self.bits() & !(Self::TTB1_MASK << offset)) | ((value as u64) << offset),
29843        );
29844    }
29845
29846    /// Returns a copy with the `TTB1` field set to the given value.
29847    pub const fn with_ttb1(mut self, value: u32) -> Self {
29848        self.set_ttb1(value);
29849        self
29850    }
29851
29852    /// Returns the value of the `ASID` field.
29853    pub const fn asid(self) -> u8 {
29854        ((self.bits() >> Self::ASID_SHIFT) & 0b11111111) as u8
29855    }
29856
29857    /// Sets the value of the `ASID` field.
29858    pub const fn set_asid(&mut self, value: u8) {
29859        let offset = Self::ASID_SHIFT;
29860        assert!(value & (Self::ASID_MASK as u8) == value);
29861        *self = Self::from_bits_retain(
29862            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
29863        );
29864    }
29865
29866    /// Returns a copy with the `ASID` field set to the given value.
29867    pub const fn with_asid(mut self, value: u8) -> Self {
29868        self.set_asid(value);
29869        self
29870    }
29871}
29872
29873#[cfg(feature = "el1")]
29874bitflags! {
29875    /// `TTBR1_EL1` system register value.
29876    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29877    #[repr(transparent)]
29878    pub struct Ttbr1El1: u64 {
29879        /// `CnP` bit.
29880        const CNP = 1 << 0;
29881    }
29882}
29883
29884#[cfg(feature = "el1")]
29885impl Ttbr1El1 {
29886    /// Offset of the `CnP` field.
29887    pub const CNP_SHIFT: u32 = 0;
29888    /// Offset of the `BADDR[47:1]` field.
29889    pub const BADDR_47_1_SHIFT: u32 = 1;
29890    /// Mask for the `BADDR[47:1]` field.
29891    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
29892    /// Offset of the `SKL` field.
29893    pub const SKL_SHIFT: u32 = 1;
29894    /// Mask for the `SKL` field.
29895    pub const SKL_MASK: u64 = 0b11;
29896    /// Offset of the `ASID` field.
29897    pub const ASID_SHIFT: u32 = 48;
29898    /// Mask for the `ASID` field.
29899    pub const ASID_MASK: u64 = 0b1111111111111111;
29900
29901    /// Returns the value of the `BADDR[47:1]` field.
29902    pub const fn baddr_47_1(self) -> u64 {
29903        ((self.bits() >> Self::BADDR_47_1_SHIFT)
29904            & 0b11111111111111111111111111111111111111111111111) as u64
29905    }
29906
29907    /// Sets the value of the `BADDR[47:1]` field.
29908    pub const fn set_baddr_47_1(&mut self, value: u64) {
29909        let offset = Self::BADDR_47_1_SHIFT;
29910        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
29911        *self = Self::from_bits_retain(
29912            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
29913        );
29914    }
29915
29916    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
29917    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
29918        self.set_baddr_47_1(value);
29919        self
29920    }
29921
29922    /// Returns the value of the `SKL` field.
29923    pub const fn skl(self) -> u8 {
29924        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
29925    }
29926
29927    /// Sets the value of the `SKL` field.
29928    pub const fn set_skl(&mut self, value: u8) {
29929        let offset = Self::SKL_SHIFT;
29930        assert!(value & (Self::SKL_MASK as u8) == value);
29931        *self = Self::from_bits_retain(
29932            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
29933        );
29934    }
29935
29936    /// Returns a copy with the `SKL` field set to the given value.
29937    pub const fn with_skl(mut self, value: u8) -> Self {
29938        self.set_skl(value);
29939        self
29940    }
29941
29942    /// Returns the value of the `ASID` field.
29943    pub const fn asid(self) -> u16 {
29944        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
29945    }
29946
29947    /// Sets the value of the `ASID` field.
29948    pub const fn set_asid(&mut self, value: u16) {
29949        let offset = Self::ASID_SHIFT;
29950        assert!(value & (Self::ASID_MASK as u16) == value);
29951        *self = Self::from_bits_retain(
29952            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
29953        );
29954    }
29955
29956    /// Returns a copy with the `ASID` field set to the given value.
29957    pub const fn with_asid(mut self, value: u16) -> Self {
29958        self.set_asid(value);
29959        self
29960    }
29961}
29962
29963#[cfg(feature = "el2")]
29964bitflags! {
29965    /// `TTBR1_EL2` system register value.
29966    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
29967    #[repr(transparent)]
29968    pub struct Ttbr1El2: u64 {
29969        /// `CnP` bit.
29970        const CNP = 1 << 0;
29971    }
29972}
29973
29974#[cfg(feature = "el2")]
29975impl Ttbr1El2 {
29976    /// Offset of the `CnP` field.
29977    pub const CNP_SHIFT: u32 = 0;
29978    /// Offset of the `BADDR[47:1]` field.
29979    pub const BADDR_47_1_SHIFT: u32 = 1;
29980    /// Mask for the `BADDR[47:1]` field.
29981    pub const BADDR_47_1_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
29982    /// Offset of the `SKL` field.
29983    pub const SKL_SHIFT: u32 = 1;
29984    /// Mask for the `SKL` field.
29985    pub const SKL_MASK: u64 = 0b11;
29986    /// Offset of the `ASID` field.
29987    pub const ASID_SHIFT: u32 = 48;
29988    /// Mask for the `ASID` field.
29989    pub const ASID_MASK: u64 = 0b1111111111111111;
29990
29991    /// Returns the value of the `BADDR[47:1]` field.
29992    pub const fn baddr_47_1(self) -> u64 {
29993        ((self.bits() >> Self::BADDR_47_1_SHIFT)
29994            & 0b11111111111111111111111111111111111111111111111) as u64
29995    }
29996
29997    /// Sets the value of the `BADDR[47:1]` field.
29998    pub const fn set_baddr_47_1(&mut self, value: u64) {
29999        let offset = Self::BADDR_47_1_SHIFT;
30000        assert!(value & (Self::BADDR_47_1_MASK as u64) == value);
30001        *self = Self::from_bits_retain(
30002            (self.bits() & !(Self::BADDR_47_1_MASK << offset)) | ((value as u64) << offset),
30003        );
30004    }
30005
30006    /// Returns a copy with the `BADDR[47:1]` field set to the given value.
30007    pub const fn with_baddr_47_1(mut self, value: u64) -> Self {
30008        self.set_baddr_47_1(value);
30009        self
30010    }
30011
30012    /// Returns the value of the `SKL` field.
30013    pub const fn skl(self) -> u8 {
30014        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
30015    }
30016
30017    /// Sets the value of the `SKL` field.
30018    pub const fn set_skl(&mut self, value: u8) {
30019        let offset = Self::SKL_SHIFT;
30020        assert!(value & (Self::SKL_MASK as u8) == value);
30021        *self = Self::from_bits_retain(
30022            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
30023        );
30024    }
30025
30026    /// Returns a copy with the `SKL` field set to the given value.
30027    pub const fn with_skl(mut self, value: u8) -> Self {
30028        self.set_skl(value);
30029        self
30030    }
30031
30032    /// Returns the value of the `ASID` field.
30033    pub const fn asid(self) -> u16 {
30034        ((self.bits() >> Self::ASID_SHIFT) & 0b1111111111111111) as u16
30035    }
30036
30037    /// Sets the value of the `ASID` field.
30038    pub const fn set_asid(&mut self, value: u16) {
30039        let offset = Self::ASID_SHIFT;
30040        assert!(value & (Self::ASID_MASK as u16) == value);
30041        *self = Self::from_bits_retain(
30042            (self.bits() & !(Self::ASID_MASK << offset)) | ((value as u64) << offset),
30043        );
30044    }
30045
30046    /// Returns a copy with the `ASID` field set to the given value.
30047    pub const fn with_asid(mut self, value: u16) -> Self {
30048        self.set_asid(value);
30049        self
30050    }
30051}
30052
30053bitflags! {
30054    /// `VBAR` system register value.
30055    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30056    #[repr(transparent)]
30057    pub struct Vbar: u32 {
30058    }
30059}
30060
30061impl Vbar {
30062    /// Offset of the `VBA` field.
30063    pub const VBA_SHIFT: u32 = 5;
30064    /// Mask for the `VBA` field.
30065    pub const VBA_MASK: u32 = 0b111111111111111111111111111;
30066
30067    /// Returns the value of the `VBA` field.
30068    pub const fn vba(self) -> u32 {
30069        ((self.bits() >> Self::VBA_SHIFT) & 0b111111111111111111111111111) as u32
30070    }
30071
30072    /// Sets the value of the `VBA` field.
30073    pub const fn set_vba(&mut self, value: u32) {
30074        let offset = Self::VBA_SHIFT;
30075        assert!(value & (Self::VBA_MASK as u32) == value);
30076        *self = Self::from_bits_retain(
30077            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u32) << offset),
30078        );
30079    }
30080
30081    /// Returns a copy with the `VBA` field set to the given value.
30082    pub const fn with_vba(mut self, value: u32) -> Self {
30083        self.set_vba(value);
30084        self
30085    }
30086}
30087
30088#[cfg(feature = "el1")]
30089bitflags! {
30090    /// `VBAR_EL1` system register value.
30091    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30092    #[repr(transparent)]
30093    pub struct VbarEl1: u64 {
30094        /// `UT` bit.
30095        const UT = 1 << 0;
30096    }
30097}
30098
30099#[cfg(feature = "el1")]
30100impl VbarEl1 {
30101    /// Offset of the `UT` field.
30102    pub const UT_SHIFT: u32 = 0;
30103    /// Offset of the `VBA` field.
30104    pub const VBA_SHIFT: u32 = 11;
30105    /// Mask for the `VBA` field.
30106    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
30107
30108    /// Returns the value of the `VBA` field.
30109    pub const fn vba(self) -> u64 {
30110        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
30111            as u64
30112    }
30113
30114    /// Sets the value of the `VBA` field.
30115    pub const fn set_vba(&mut self, value: u64) {
30116        let offset = Self::VBA_SHIFT;
30117        assert!(value & (Self::VBA_MASK as u64) == value);
30118        *self = Self::from_bits_retain(
30119            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u64) << offset),
30120        );
30121    }
30122
30123    /// Returns a copy with the `VBA` field set to the given value.
30124    pub const fn with_vba(mut self, value: u64) -> Self {
30125        self.set_vba(value);
30126        self
30127    }
30128}
30129
30130#[cfg(feature = "el2")]
30131bitflags! {
30132    /// `VBAR_EL2` system register value.
30133    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30134    #[repr(transparent)]
30135    pub struct VbarEl2: u64 {
30136        /// `UT` bit.
30137        const UT = 1 << 0;
30138    }
30139}
30140
30141#[cfg(feature = "el2")]
30142impl VbarEl2 {
30143    /// Offset of the `UT` field.
30144    pub const UT_SHIFT: u32 = 0;
30145    /// Offset of the `VBA` field.
30146    pub const VBA_SHIFT: u32 = 11;
30147    /// Mask for the `VBA` field.
30148    pub const VBA_MASK: u64 = 0b11111111111111111111111111111111111111111111111111111;
30149
30150    /// Returns the value of the `VBA` field.
30151    pub const fn vba(self) -> u64 {
30152        ((self.bits() >> Self::VBA_SHIFT) & 0b11111111111111111111111111111111111111111111111111111)
30153            as u64
30154    }
30155
30156    /// Sets the value of the `VBA` field.
30157    pub const fn set_vba(&mut self, value: u64) {
30158        let offset = Self::VBA_SHIFT;
30159        assert!(value & (Self::VBA_MASK as u64) == value);
30160        *self = Self::from_bits_retain(
30161            (self.bits() & !(Self::VBA_MASK << offset)) | ((value as u64) << offset),
30162        );
30163    }
30164
30165    /// Returns a copy with the `VBA` field set to the given value.
30166    pub const fn with_vba(mut self, value: u64) -> Self {
30167        self.set_vba(value);
30168        self
30169    }
30170}
30171
30172bitflags! {
30173    /// `VDFSR` system register value.
30174    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30175    #[repr(transparent)]
30176    pub struct Vdfsr: u32 {
30177        /// `ExT` bit.
30178        const EXT = 1 << 12;
30179    }
30180}
30181
30182impl Vdfsr {
30183    /// Offset of the `ExT` field.
30184    pub const EXT_SHIFT: u32 = 12;
30185    /// Offset of the `AET` field.
30186    pub const AET_SHIFT: u32 = 14;
30187    /// Mask for the `AET` field.
30188    pub const AET_MASK: u32 = 0b11;
30189
30190    /// Returns the value of the `AET` field.
30191    pub const fn aet(self) -> u8 {
30192        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
30193    }
30194
30195    /// Sets the value of the `AET` field.
30196    pub const fn set_aet(&mut self, value: u8) {
30197        let offset = Self::AET_SHIFT;
30198        assert!(value & (Self::AET_MASK as u8) == value);
30199        *self = Self::from_bits_retain(
30200            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
30201        );
30202    }
30203
30204    /// Returns a copy with the `AET` field set to the given value.
30205    pub const fn with_aet(mut self, value: u8) -> Self {
30206        self.set_aet(value);
30207        self
30208    }
30209}
30210
30211bitflags! {
30212    /// `VDISR` system register value.
30213    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30214    #[repr(transparent)]
30215    pub struct Vdisr: u32 {
30216        /// `LPAE` bit.
30217        const LPAE = 1 << 9;
30218        /// `ExT` bit.
30219        const EXT = 1 << 12;
30220        /// `A` bit.
30221        const A = 1 << 31;
30222    }
30223}
30224
30225impl Vdisr {
30226    /// Offset of the `STATUS` field.
30227    pub const STATUS_SHIFT: u32 = 0;
30228    /// Mask for the `STATUS` field.
30229    pub const STATUS_MASK: u32 = 0b111111;
30230    /// Offset of the `LPAE` field.
30231    pub const LPAE_SHIFT: u32 = 9;
30232    /// Offset of the `ExT` field.
30233    pub const EXT_SHIFT: u32 = 12;
30234    /// Offset of the `AET` field.
30235    pub const AET_SHIFT: u32 = 14;
30236    /// Mask for the `AET` field.
30237    pub const AET_MASK: u32 = 0b11;
30238    /// Offset of the `A` field.
30239    pub const A_SHIFT: u32 = 31;
30240
30241    /// Returns the value of the `STATUS` field.
30242    pub const fn status(self) -> u8 {
30243        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
30244    }
30245
30246    /// Sets the value of the `STATUS` field.
30247    pub const fn set_status(&mut self, value: u8) {
30248        let offset = Self::STATUS_SHIFT;
30249        assert!(value & (Self::STATUS_MASK as u8) == value);
30250        *self = Self::from_bits_retain(
30251            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u32) << offset),
30252        );
30253    }
30254
30255    /// Returns a copy with the `STATUS` field set to the given value.
30256    pub const fn with_status(mut self, value: u8) -> Self {
30257        self.set_status(value);
30258        self
30259    }
30260
30261    /// Returns the value of the `AET` field.
30262    pub const fn aet(self) -> u8 {
30263        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
30264    }
30265
30266    /// Sets the value of the `AET` field.
30267    pub const fn set_aet(&mut self, value: u8) {
30268        let offset = Self::AET_SHIFT;
30269        assert!(value & (Self::AET_MASK as u8) == value);
30270        *self = Self::from_bits_retain(
30271            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u32) << offset),
30272        );
30273    }
30274
30275    /// Returns a copy with the `AET` field set to the given value.
30276    pub const fn with_aet(mut self, value: u8) -> Self {
30277        self.set_aet(value);
30278        self
30279    }
30280}
30281
30282#[cfg(feature = "el2")]
30283bitflags! {
30284    /// `VDISR_EL2` system register value.
30285    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30286    #[repr(transparent)]
30287    pub struct VdisrEl2: u64 {
30288        /// `LPAE` bit.
30289        const LPAE = 1 << 9;
30290        /// `ExT` bit.
30291        const EXT = 1 << 12;
30292        /// `IDS` bit.
30293        const IDS = 1 << 24;
30294        /// `A` bit.
30295        const A = 1 << 31;
30296    }
30297}
30298
30299#[cfg(feature = "el2")]
30300impl VdisrEl2 {
30301    /// Offset of the `ISS` field.
30302    pub const ISS_SHIFT: u32 = 0;
30303    /// Mask for the `ISS` field.
30304    pub const ISS_MASK: u64 = 0b111111111111111111111111;
30305    /// Offset of the `STATUS` field.
30306    pub const STATUS_SHIFT: u32 = 0;
30307    /// Mask for the `STATUS` field.
30308    pub const STATUS_MASK: u64 = 0b111111;
30309    /// Offset of the `LPAE` field.
30310    pub const LPAE_SHIFT: u32 = 9;
30311    /// Offset of the `ExT` field.
30312    pub const EXT_SHIFT: u32 = 12;
30313    /// Offset of the `AET` field.
30314    pub const AET_SHIFT: u32 = 14;
30315    /// Mask for the `AET` field.
30316    pub const AET_MASK: u64 = 0b11;
30317    /// Offset of the `IDS` field.
30318    pub const IDS_SHIFT: u32 = 24;
30319    /// Offset of the `A` field.
30320    pub const A_SHIFT: u32 = 31;
30321
30322    /// Returns the value of the `ISS` field.
30323    pub const fn iss(self) -> u32 {
30324        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
30325    }
30326
30327    /// Sets the value of the `ISS` field.
30328    pub const fn set_iss(&mut self, value: u32) {
30329        let offset = Self::ISS_SHIFT;
30330        assert!(value & (Self::ISS_MASK as u32) == value);
30331        *self = Self::from_bits_retain(
30332            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
30333        );
30334    }
30335
30336    /// Returns a copy with the `ISS` field set to the given value.
30337    pub const fn with_iss(mut self, value: u32) -> Self {
30338        self.set_iss(value);
30339        self
30340    }
30341
30342    /// Returns the value of the `STATUS` field.
30343    pub const fn status(self) -> u8 {
30344        ((self.bits() >> Self::STATUS_SHIFT) & 0b111111) as u8
30345    }
30346
30347    /// Sets the value of the `STATUS` field.
30348    pub const fn set_status(&mut self, value: u8) {
30349        let offset = Self::STATUS_SHIFT;
30350        assert!(value & (Self::STATUS_MASK as u8) == value);
30351        *self = Self::from_bits_retain(
30352            (self.bits() & !(Self::STATUS_MASK << offset)) | ((value as u64) << offset),
30353        );
30354    }
30355
30356    /// Returns a copy with the `STATUS` field set to the given value.
30357    pub const fn with_status(mut self, value: u8) -> Self {
30358        self.set_status(value);
30359        self
30360    }
30361
30362    /// Returns the value of the `AET` field.
30363    pub const fn aet(self) -> u8 {
30364        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
30365    }
30366
30367    /// Sets the value of the `AET` field.
30368    pub const fn set_aet(&mut self, value: u8) {
30369        let offset = Self::AET_SHIFT;
30370        assert!(value & (Self::AET_MASK as u8) == value);
30371        *self = Self::from_bits_retain(
30372            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
30373        );
30374    }
30375
30376    /// Returns a copy with the `AET` field set to the given value.
30377    pub const fn with_aet(mut self, value: u8) -> Self {
30378        self.set_aet(value);
30379        self
30380    }
30381}
30382
30383bitflags! {
30384    /// `VMPIDR` system register value.
30385    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30386    #[repr(transparent)]
30387    pub struct Vmpidr: u32 {
30388        /// `MT` bit.
30389        const MT = 1 << 24;
30390        /// `U` bit.
30391        const U = 1 << 30;
30392        /// `M` bit.
30393        const M = 1 << 31;
30394    }
30395}
30396
30397impl Vmpidr {
30398    /// Offset of the `Aff0` field.
30399    pub const AFF0_SHIFT: u32 = 0;
30400    /// Mask for the `Aff0` field.
30401    pub const AFF0_MASK: u32 = 0b11111111;
30402    /// Offset of the `Aff1` field.
30403    pub const AFF1_SHIFT: u32 = 8;
30404    /// Mask for the `Aff1` field.
30405    pub const AFF1_MASK: u32 = 0b11111111;
30406    /// Offset of the `Aff2` field.
30407    pub const AFF2_SHIFT: u32 = 16;
30408    /// Mask for the `Aff2` field.
30409    pub const AFF2_MASK: u32 = 0b11111111;
30410    /// Offset of the `MT` field.
30411    pub const MT_SHIFT: u32 = 24;
30412    /// Offset of the `U` field.
30413    pub const U_SHIFT: u32 = 30;
30414    /// Offset of the `M` field.
30415    pub const M_SHIFT: u32 = 31;
30416
30417    /// Returns the value of the `Aff0` field.
30418    pub const fn aff0(self) -> u8 {
30419        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
30420    }
30421
30422    /// Sets the value of the `Aff0` field.
30423    pub const fn set_aff0(&mut self, value: u8) {
30424        let offset = Self::AFF0_SHIFT;
30425        assert!(value & (Self::AFF0_MASK as u8) == value);
30426        *self = Self::from_bits_retain(
30427            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u32) << offset),
30428        );
30429    }
30430
30431    /// Returns a copy with the `Aff0` field set to the given value.
30432    pub const fn with_aff0(mut self, value: u8) -> Self {
30433        self.set_aff0(value);
30434        self
30435    }
30436
30437    /// Returns the value of the `Aff1` field.
30438    pub const fn aff1(self) -> u8 {
30439        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
30440    }
30441
30442    /// Sets the value of the `Aff1` field.
30443    pub const fn set_aff1(&mut self, value: u8) {
30444        let offset = Self::AFF1_SHIFT;
30445        assert!(value & (Self::AFF1_MASK as u8) == value);
30446        *self = Self::from_bits_retain(
30447            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u32) << offset),
30448        );
30449    }
30450
30451    /// Returns a copy with the `Aff1` field set to the given value.
30452    pub const fn with_aff1(mut self, value: u8) -> Self {
30453        self.set_aff1(value);
30454        self
30455    }
30456
30457    /// Returns the value of the `Aff2` field.
30458    pub const fn aff2(self) -> u8 {
30459        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
30460    }
30461
30462    /// Sets the value of the `Aff2` field.
30463    pub const fn set_aff2(&mut self, value: u8) {
30464        let offset = Self::AFF2_SHIFT;
30465        assert!(value & (Self::AFF2_MASK as u8) == value);
30466        *self = Self::from_bits_retain(
30467            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u32) << offset),
30468        );
30469    }
30470
30471    /// Returns a copy with the `Aff2` field set to the given value.
30472    pub const fn with_aff2(mut self, value: u8) -> Self {
30473        self.set_aff2(value);
30474        self
30475    }
30476}
30477
30478#[cfg(feature = "el2")]
30479bitflags! {
30480    /// `VMPIDR_EL2` system register value.
30481    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30482    #[repr(transparent)]
30483    pub struct VmpidrEl2: u64 {
30484        /// RES1 bits in the `VMPIDR_EL2` register.
30485        const RES1 = 0b10000000000000000000000000000000;
30486        /// `MT` bit.
30487        const MT = 1 << 24;
30488        /// `U` bit.
30489        const U = 1 << 30;
30490    }
30491}
30492
30493#[cfg(feature = "el2")]
30494impl VmpidrEl2 {
30495    /// Offset of the `Aff0` field.
30496    pub const AFF0_SHIFT: u32 = 0;
30497    /// Mask for the `Aff0` field.
30498    pub const AFF0_MASK: u64 = 0b11111111;
30499    /// Offset of the `Aff1` field.
30500    pub const AFF1_SHIFT: u32 = 8;
30501    /// Mask for the `Aff1` field.
30502    pub const AFF1_MASK: u64 = 0b11111111;
30503    /// Offset of the `Aff2` field.
30504    pub const AFF2_SHIFT: u32 = 16;
30505    /// Mask for the `Aff2` field.
30506    pub const AFF2_MASK: u64 = 0b11111111;
30507    /// Offset of the `MT` field.
30508    pub const MT_SHIFT: u32 = 24;
30509    /// Offset of the `U` field.
30510    pub const U_SHIFT: u32 = 30;
30511    /// Offset of the `Aff3` field.
30512    pub const AFF3_SHIFT: u32 = 32;
30513    /// Mask for the `Aff3` field.
30514    pub const AFF3_MASK: u64 = 0b11111111;
30515
30516    /// Returns the value of the `Aff0` field.
30517    pub const fn aff0(self) -> u8 {
30518        ((self.bits() >> Self::AFF0_SHIFT) & 0b11111111) as u8
30519    }
30520
30521    /// Sets the value of the `Aff0` field.
30522    pub const fn set_aff0(&mut self, value: u8) {
30523        let offset = Self::AFF0_SHIFT;
30524        assert!(value & (Self::AFF0_MASK as u8) == value);
30525        *self = Self::from_bits_retain(
30526            (self.bits() & !(Self::AFF0_MASK << offset)) | ((value as u64) << offset),
30527        );
30528    }
30529
30530    /// Returns a copy with the `Aff0` field set to the given value.
30531    pub const fn with_aff0(mut self, value: u8) -> Self {
30532        self.set_aff0(value);
30533        self
30534    }
30535
30536    /// Returns the value of the `Aff1` field.
30537    pub const fn aff1(self) -> u8 {
30538        ((self.bits() >> Self::AFF1_SHIFT) & 0b11111111) as u8
30539    }
30540
30541    /// Sets the value of the `Aff1` field.
30542    pub const fn set_aff1(&mut self, value: u8) {
30543        let offset = Self::AFF1_SHIFT;
30544        assert!(value & (Self::AFF1_MASK as u8) == value);
30545        *self = Self::from_bits_retain(
30546            (self.bits() & !(Self::AFF1_MASK << offset)) | ((value as u64) << offset),
30547        );
30548    }
30549
30550    /// Returns a copy with the `Aff1` field set to the given value.
30551    pub const fn with_aff1(mut self, value: u8) -> Self {
30552        self.set_aff1(value);
30553        self
30554    }
30555
30556    /// Returns the value of the `Aff2` field.
30557    pub const fn aff2(self) -> u8 {
30558        ((self.bits() >> Self::AFF2_SHIFT) & 0b11111111) as u8
30559    }
30560
30561    /// Sets the value of the `Aff2` field.
30562    pub const fn set_aff2(&mut self, value: u8) {
30563        let offset = Self::AFF2_SHIFT;
30564        assert!(value & (Self::AFF2_MASK as u8) == value);
30565        *self = Self::from_bits_retain(
30566            (self.bits() & !(Self::AFF2_MASK << offset)) | ((value as u64) << offset),
30567        );
30568    }
30569
30570    /// Returns a copy with the `Aff2` field set to the given value.
30571    pub const fn with_aff2(mut self, value: u8) -> Self {
30572        self.set_aff2(value);
30573        self
30574    }
30575
30576    /// Returns the value of the `Aff3` field.
30577    pub const fn aff3(self) -> u8 {
30578        ((self.bits() >> Self::AFF3_SHIFT) & 0b11111111) as u8
30579    }
30580
30581    /// Sets the value of the `Aff3` field.
30582    pub const fn set_aff3(&mut self, value: u8) {
30583        let offset = Self::AFF3_SHIFT;
30584        assert!(value & (Self::AFF3_MASK as u8) == value);
30585        *self = Self::from_bits_retain(
30586            (self.bits() & !(Self::AFF3_MASK << offset)) | ((value as u64) << offset),
30587        );
30588    }
30589
30590    /// Returns a copy with the `Aff3` field set to the given value.
30591    pub const fn with_aff3(mut self, value: u8) -> Self {
30592        self.set_aff3(value);
30593        self
30594    }
30595}
30596
30597bitflags! {
30598    /// `VPIDR` system register value.
30599    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30600    #[repr(transparent)]
30601    pub struct Vpidr: u32 {
30602    }
30603}
30604
30605impl Vpidr {
30606    /// Offset of the `Revision` field.
30607    pub const REVISION_SHIFT: u32 = 0;
30608    /// Mask for the `Revision` field.
30609    pub const REVISION_MASK: u32 = 0b1111;
30610    /// Offset of the `PartNum` field.
30611    pub const PARTNUM_SHIFT: u32 = 4;
30612    /// Mask for the `PartNum` field.
30613    pub const PARTNUM_MASK: u32 = 0b111111111111;
30614    /// Offset of the `Architecture` field.
30615    pub const ARCHITECTURE_SHIFT: u32 = 16;
30616    /// Mask for the `Architecture` field.
30617    pub const ARCHITECTURE_MASK: u32 = 0b1111;
30618    /// Offset of the `Variant` field.
30619    pub const VARIANT_SHIFT: u32 = 20;
30620    /// Mask for the `Variant` field.
30621    pub const VARIANT_MASK: u32 = 0b1111;
30622    /// Offset of the `Implementer` field.
30623    pub const IMPLEMENTER_SHIFT: u32 = 24;
30624    /// Mask for the `Implementer` field.
30625    pub const IMPLEMENTER_MASK: u32 = 0b11111111;
30626
30627    /// Returns the value of the `Revision` field.
30628    pub const fn revision(self) -> u8 {
30629        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
30630    }
30631
30632    /// Sets the value of the `Revision` field.
30633    pub const fn set_revision(&mut self, value: u8) {
30634        let offset = Self::REVISION_SHIFT;
30635        assert!(value & (Self::REVISION_MASK as u8) == value);
30636        *self = Self::from_bits_retain(
30637            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u32) << offset),
30638        );
30639    }
30640
30641    /// Returns a copy with the `Revision` field set to the given value.
30642    pub const fn with_revision(mut self, value: u8) -> Self {
30643        self.set_revision(value);
30644        self
30645    }
30646
30647    /// Returns the value of the `PartNum` field.
30648    pub const fn partnum(self) -> u16 {
30649        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
30650    }
30651
30652    /// Sets the value of the `PartNum` field.
30653    pub const fn set_partnum(&mut self, value: u16) {
30654        let offset = Self::PARTNUM_SHIFT;
30655        assert!(value & (Self::PARTNUM_MASK as u16) == value);
30656        *self = Self::from_bits_retain(
30657            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u32) << offset),
30658        );
30659    }
30660
30661    /// Returns a copy with the `PartNum` field set to the given value.
30662    pub const fn with_partnum(mut self, value: u16) -> Self {
30663        self.set_partnum(value);
30664        self
30665    }
30666
30667    /// Returns the value of the `Architecture` field.
30668    pub const fn architecture(self) -> u8 {
30669        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
30670    }
30671
30672    /// Sets the value of the `Architecture` field.
30673    pub const fn set_architecture(&mut self, value: u8) {
30674        let offset = Self::ARCHITECTURE_SHIFT;
30675        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
30676        *self = Self::from_bits_retain(
30677            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u32) << offset),
30678        );
30679    }
30680
30681    /// Returns a copy with the `Architecture` field set to the given value.
30682    pub const fn with_architecture(mut self, value: u8) -> Self {
30683        self.set_architecture(value);
30684        self
30685    }
30686
30687    /// Returns the value of the `Variant` field.
30688    pub const fn variant(self) -> u8 {
30689        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
30690    }
30691
30692    /// Sets the value of the `Variant` field.
30693    pub const fn set_variant(&mut self, value: u8) {
30694        let offset = Self::VARIANT_SHIFT;
30695        assert!(value & (Self::VARIANT_MASK as u8) == value);
30696        *self = Self::from_bits_retain(
30697            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u32) << offset),
30698        );
30699    }
30700
30701    /// Returns a copy with the `Variant` field set to the given value.
30702    pub const fn with_variant(mut self, value: u8) -> Self {
30703        self.set_variant(value);
30704        self
30705    }
30706
30707    /// Returns the value of the `Implementer` field.
30708    pub const fn implementer(self) -> u8 {
30709        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
30710    }
30711
30712    /// Sets the value of the `Implementer` field.
30713    pub const fn set_implementer(&mut self, value: u8) {
30714        let offset = Self::IMPLEMENTER_SHIFT;
30715        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
30716        *self = Self::from_bits_retain(
30717            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u32) << offset),
30718        );
30719    }
30720
30721    /// Returns a copy with the `Implementer` field set to the given value.
30722    pub const fn with_implementer(mut self, value: u8) -> Self {
30723        self.set_implementer(value);
30724        self
30725    }
30726}
30727
30728#[cfg(feature = "el2")]
30729bitflags! {
30730    /// `VPIDR_EL2` system register value.
30731    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30732    #[repr(transparent)]
30733    pub struct VpidrEl2: u64 {
30734    }
30735}
30736
30737#[cfg(feature = "el2")]
30738impl VpidrEl2 {
30739    /// Offset of the `Revision` field.
30740    pub const REVISION_SHIFT: u32 = 0;
30741    /// Mask for the `Revision` field.
30742    pub const REVISION_MASK: u64 = 0b1111;
30743    /// Offset of the `PartNum` field.
30744    pub const PARTNUM_SHIFT: u32 = 4;
30745    /// Mask for the `PartNum` field.
30746    pub const PARTNUM_MASK: u64 = 0b111111111111;
30747    /// Offset of the `Architecture` field.
30748    pub const ARCHITECTURE_SHIFT: u32 = 16;
30749    /// Mask for the `Architecture` field.
30750    pub const ARCHITECTURE_MASK: u64 = 0b1111;
30751    /// Offset of the `Variant` field.
30752    pub const VARIANT_SHIFT: u32 = 20;
30753    /// Mask for the `Variant` field.
30754    pub const VARIANT_MASK: u64 = 0b1111;
30755    /// Offset of the `Implementer` field.
30756    pub const IMPLEMENTER_SHIFT: u32 = 24;
30757    /// Mask for the `Implementer` field.
30758    pub const IMPLEMENTER_MASK: u64 = 0b11111111;
30759
30760    /// Returns the value of the `Revision` field.
30761    pub const fn revision(self) -> u8 {
30762        ((self.bits() >> Self::REVISION_SHIFT) & 0b1111) as u8
30763    }
30764
30765    /// Sets the value of the `Revision` field.
30766    pub const fn set_revision(&mut self, value: u8) {
30767        let offset = Self::REVISION_SHIFT;
30768        assert!(value & (Self::REVISION_MASK as u8) == value);
30769        *self = Self::from_bits_retain(
30770            (self.bits() & !(Self::REVISION_MASK << offset)) | ((value as u64) << offset),
30771        );
30772    }
30773
30774    /// Returns a copy with the `Revision` field set to the given value.
30775    pub const fn with_revision(mut self, value: u8) -> Self {
30776        self.set_revision(value);
30777        self
30778    }
30779
30780    /// Returns the value of the `PartNum` field.
30781    pub const fn partnum(self) -> u16 {
30782        ((self.bits() >> Self::PARTNUM_SHIFT) & 0b111111111111) as u16
30783    }
30784
30785    /// Sets the value of the `PartNum` field.
30786    pub const fn set_partnum(&mut self, value: u16) {
30787        let offset = Self::PARTNUM_SHIFT;
30788        assert!(value & (Self::PARTNUM_MASK as u16) == value);
30789        *self = Self::from_bits_retain(
30790            (self.bits() & !(Self::PARTNUM_MASK << offset)) | ((value as u64) << offset),
30791        );
30792    }
30793
30794    /// Returns a copy with the `PartNum` field set to the given value.
30795    pub const fn with_partnum(mut self, value: u16) -> Self {
30796        self.set_partnum(value);
30797        self
30798    }
30799
30800    /// Returns the value of the `Architecture` field.
30801    pub const fn architecture(self) -> u8 {
30802        ((self.bits() >> Self::ARCHITECTURE_SHIFT) & 0b1111) as u8
30803    }
30804
30805    /// Sets the value of the `Architecture` field.
30806    pub const fn set_architecture(&mut self, value: u8) {
30807        let offset = Self::ARCHITECTURE_SHIFT;
30808        assert!(value & (Self::ARCHITECTURE_MASK as u8) == value);
30809        *self = Self::from_bits_retain(
30810            (self.bits() & !(Self::ARCHITECTURE_MASK << offset)) | ((value as u64) << offset),
30811        );
30812    }
30813
30814    /// Returns a copy with the `Architecture` field set to the given value.
30815    pub const fn with_architecture(mut self, value: u8) -> Self {
30816        self.set_architecture(value);
30817        self
30818    }
30819
30820    /// Returns the value of the `Variant` field.
30821    pub const fn variant(self) -> u8 {
30822        ((self.bits() >> Self::VARIANT_SHIFT) & 0b1111) as u8
30823    }
30824
30825    /// Sets the value of the `Variant` field.
30826    pub const fn set_variant(&mut self, value: u8) {
30827        let offset = Self::VARIANT_SHIFT;
30828        assert!(value & (Self::VARIANT_MASK as u8) == value);
30829        *self = Self::from_bits_retain(
30830            (self.bits() & !(Self::VARIANT_MASK << offset)) | ((value as u64) << offset),
30831        );
30832    }
30833
30834    /// Returns a copy with the `Variant` field set to the given value.
30835    pub const fn with_variant(mut self, value: u8) -> Self {
30836        self.set_variant(value);
30837        self
30838    }
30839
30840    /// Returns the value of the `Implementer` field.
30841    pub const fn implementer(self) -> u8 {
30842        ((self.bits() >> Self::IMPLEMENTER_SHIFT) & 0b11111111) as u8
30843    }
30844
30845    /// Sets the value of the `Implementer` field.
30846    pub const fn set_implementer(&mut self, value: u8) {
30847        let offset = Self::IMPLEMENTER_SHIFT;
30848        assert!(value & (Self::IMPLEMENTER_MASK as u8) == value);
30849        *self = Self::from_bits_retain(
30850            (self.bits() & !(Self::IMPLEMENTER_MASK << offset)) | ((value as u64) << offset),
30851        );
30852    }
30853
30854    /// Returns a copy with the `Implementer` field set to the given value.
30855    pub const fn with_implementer(mut self, value: u8) -> Self {
30856        self.set_implementer(value);
30857        self
30858    }
30859}
30860
30861#[cfg(feature = "el2")]
30862bitflags! {
30863    /// `VSESR_EL2` system register value.
30864    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30865    #[repr(transparent)]
30866    pub struct VsesrEl2: u64 {
30867        /// `ExT` bit.
30868        const EXT = 1 << 12;
30869        /// `IDS` bit.
30870        const IDS = 1 << 24;
30871    }
30872}
30873
30874#[cfg(feature = "el2")]
30875impl VsesrEl2 {
30876    /// Offset of the `ISS` field.
30877    pub const ISS_SHIFT: u32 = 0;
30878    /// Mask for the `ISS` field.
30879    pub const ISS_MASK: u64 = 0b111111111111111111111111;
30880    /// Offset of the `ExT` field.
30881    pub const EXT_SHIFT: u32 = 12;
30882    /// Offset of the `AET` field.
30883    pub const AET_SHIFT: u32 = 14;
30884    /// Mask for the `AET` field.
30885    pub const AET_MASK: u64 = 0b11;
30886    /// Offset of the `IDS` field.
30887    pub const IDS_SHIFT: u32 = 24;
30888
30889    /// Returns the value of the `ISS` field.
30890    pub const fn iss(self) -> u32 {
30891        ((self.bits() >> Self::ISS_SHIFT) & 0b111111111111111111111111) as u32
30892    }
30893
30894    /// Sets the value of the `ISS` field.
30895    pub const fn set_iss(&mut self, value: u32) {
30896        let offset = Self::ISS_SHIFT;
30897        assert!(value & (Self::ISS_MASK as u32) == value);
30898        *self = Self::from_bits_retain(
30899            (self.bits() & !(Self::ISS_MASK << offset)) | ((value as u64) << offset),
30900        );
30901    }
30902
30903    /// Returns a copy with the `ISS` field set to the given value.
30904    pub const fn with_iss(mut self, value: u32) -> Self {
30905        self.set_iss(value);
30906        self
30907    }
30908
30909    /// Returns the value of the `AET` field.
30910    pub const fn aet(self) -> u8 {
30911        ((self.bits() >> Self::AET_SHIFT) & 0b11) as u8
30912    }
30913
30914    /// Sets the value of the `AET` field.
30915    pub const fn set_aet(&mut self, value: u8) {
30916        let offset = Self::AET_SHIFT;
30917        assert!(value & (Self::AET_MASK as u8) == value);
30918        *self = Self::from_bits_retain(
30919            (self.bits() & !(Self::AET_MASK << offset)) | ((value as u64) << offset),
30920        );
30921    }
30922
30923    /// Returns a copy with the `AET` field set to the given value.
30924    pub const fn with_aet(mut self, value: u8) -> Self {
30925        self.set_aet(value);
30926        self
30927    }
30928}
30929
30930bitflags! {
30931    /// `VTCR` system register value.
30932    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
30933    #[repr(transparent)]
30934    pub struct Vtcr: u32 {
30935        /// RES1 bits in the `VTCR` register.
30936        const RES1 = 0b10000000000000000000000000000000;
30937        /// `S` bit.
30938        const S = 1 << 4;
30939        /// `HWU59` bit.
30940        const HWU59 = 1 << 25;
30941        /// `HWU60` bit.
30942        const HWU60 = 1 << 26;
30943        /// `HWU61` bit.
30944        const HWU61 = 1 << 27;
30945        /// `HWU62` bit.
30946        const HWU62 = 1 << 28;
30947    }
30948}
30949
30950impl Vtcr {
30951    /// Offset of the `T0SZ` field.
30952    pub const T0SZ_SHIFT: u32 = 0;
30953    /// Mask for the `T0SZ` field.
30954    pub const T0SZ_MASK: u32 = 0b1111;
30955    /// Offset of the `S` field.
30956    pub const S_SHIFT: u32 = 4;
30957    /// Offset of the `SL0` field.
30958    pub const SL0_SHIFT: u32 = 6;
30959    /// Mask for the `SL0` field.
30960    pub const SL0_MASK: u32 = 0b11;
30961    /// Offset of the `IRGN0` field.
30962    pub const IRGN0_SHIFT: u32 = 8;
30963    /// Mask for the `IRGN0` field.
30964    pub const IRGN0_MASK: u32 = 0b11;
30965    /// Offset of the `ORGN0` field.
30966    pub const ORGN0_SHIFT: u32 = 10;
30967    /// Mask for the `ORGN0` field.
30968    pub const ORGN0_MASK: u32 = 0b11;
30969    /// Offset of the `SH0` field.
30970    pub const SH0_SHIFT: u32 = 12;
30971    /// Mask for the `SH0` field.
30972    pub const SH0_MASK: u32 = 0b11;
30973    /// Offset of the `HWU59` field.
30974    pub const HWU59_SHIFT: u32 = 25;
30975    /// Offset of the `HWU60` field.
30976    pub const HWU60_SHIFT: u32 = 26;
30977    /// Offset of the `HWU61` field.
30978    pub const HWU61_SHIFT: u32 = 27;
30979    /// Offset of the `HWU62` field.
30980    pub const HWU62_SHIFT: u32 = 28;
30981
30982    /// Returns the value of the `T0SZ` field.
30983    pub const fn t0sz(self) -> u8 {
30984        ((self.bits() >> Self::T0SZ_SHIFT) & 0b1111) as u8
30985    }
30986
30987    /// Sets the value of the `T0SZ` field.
30988    pub const fn set_t0sz(&mut self, value: u8) {
30989        let offset = Self::T0SZ_SHIFT;
30990        assert!(value & (Self::T0SZ_MASK as u8) == value);
30991        *self = Self::from_bits_retain(
30992            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u32) << offset),
30993        );
30994    }
30995
30996    /// Returns a copy with the `T0SZ` field set to the given value.
30997    pub const fn with_t0sz(mut self, value: u8) -> Self {
30998        self.set_t0sz(value);
30999        self
31000    }
31001
31002    /// Returns the value of the `SL0` field.
31003    pub const fn sl0(self) -> u8 {
31004        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
31005    }
31006
31007    /// Sets the value of the `SL0` field.
31008    pub const fn set_sl0(&mut self, value: u8) {
31009        let offset = Self::SL0_SHIFT;
31010        assert!(value & (Self::SL0_MASK as u8) == value);
31011        *self = Self::from_bits_retain(
31012            (self.bits() & !(Self::SL0_MASK << offset)) | ((value as u32) << offset),
31013        );
31014    }
31015
31016    /// Returns a copy with the `SL0` field set to the given value.
31017    pub const fn with_sl0(mut self, value: u8) -> Self {
31018        self.set_sl0(value);
31019        self
31020    }
31021
31022    /// Returns the value of the `IRGN0` field.
31023    pub const fn irgn0(self) -> u8 {
31024        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
31025    }
31026
31027    /// Sets the value of the `IRGN0` field.
31028    pub const fn set_irgn0(&mut self, value: u8) {
31029        let offset = Self::IRGN0_SHIFT;
31030        assert!(value & (Self::IRGN0_MASK as u8) == value);
31031        *self = Self::from_bits_retain(
31032            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u32) << offset),
31033        );
31034    }
31035
31036    /// Returns a copy with the `IRGN0` field set to the given value.
31037    pub const fn with_irgn0(mut self, value: u8) -> Self {
31038        self.set_irgn0(value);
31039        self
31040    }
31041
31042    /// Returns the value of the `ORGN0` field.
31043    pub const fn orgn0(self) -> u8 {
31044        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
31045    }
31046
31047    /// Sets the value of the `ORGN0` field.
31048    pub const fn set_orgn0(&mut self, value: u8) {
31049        let offset = Self::ORGN0_SHIFT;
31050        assert!(value & (Self::ORGN0_MASK as u8) == value);
31051        *self = Self::from_bits_retain(
31052            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u32) << offset),
31053        );
31054    }
31055
31056    /// Returns a copy with the `ORGN0` field set to the given value.
31057    pub const fn with_orgn0(mut self, value: u8) -> Self {
31058        self.set_orgn0(value);
31059        self
31060    }
31061
31062    /// Returns the value of the `SH0` field.
31063    pub const fn sh0(self) -> u8 {
31064        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
31065    }
31066
31067    /// Sets the value of the `SH0` field.
31068    pub const fn set_sh0(&mut self, value: u8) {
31069        let offset = Self::SH0_SHIFT;
31070        assert!(value & (Self::SH0_MASK as u8) == value);
31071        *self = Self::from_bits_retain(
31072            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u32) << offset),
31073        );
31074    }
31075
31076    /// Returns a copy with the `SH0` field set to the given value.
31077    pub const fn with_sh0(mut self, value: u8) -> Self {
31078        self.set_sh0(value);
31079        self
31080    }
31081}
31082
31083#[cfg(feature = "el2")]
31084bitflags! {
31085    /// `VTCR_EL2` system register value.
31086    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31087    #[repr(transparent)]
31088    pub struct VtcrEl2: u64 {
31089        /// RES1 bits in the `VTCR_EL2` register.
31090        const RES1 = 0b10000000000000000000000000000000;
31091        /// `VS` bit.
31092        const VS = 1 << 19;
31093        /// `HA` bit.
31094        const HA = 1 << 21;
31095        /// `HD` bit.
31096        const HD = 1 << 22;
31097        /// `HWU59` bit.
31098        const HWU59 = 1 << 25;
31099        /// `HWU60` bit.
31100        const HWU60 = 1 << 26;
31101        /// `HWU61` bit.
31102        const HWU61 = 1 << 27;
31103        /// `HWU62` bit.
31104        const HWU62 = 1 << 28;
31105        /// `NSW` bit.
31106        const NSW = 1 << 29;
31107        /// `NSA` bit.
31108        const NSA = 1 << 30;
31109        /// `DS` bit.
31110        const DS = 1 << 32;
31111        /// `SL2` bit.
31112        const SL2 = 1 << 33;
31113        /// `AssuredOnly` bit.
31114        const ASSUREDONLY = 1 << 34;
31115        /// `TL1` bit.
31116        const TL1 = 1 << 35;
31117        /// `S2PIE` bit.
31118        const S2PIE = 1 << 36;
31119        /// `S2POE` bit.
31120        const S2POE = 1 << 37;
31121        /// `D128` bit.
31122        const D128 = 1 << 38;
31123        /// `GCSH` bit.
31124        const GCSH = 1 << 40;
31125        /// `TL0` bit.
31126        const TL0 = 1 << 41;
31127        /// `HAFT` bit.
31128        const HAFT = 1 << 44;
31129        /// `HDBSS` bit.
31130        const HDBSS = 1 << 45;
31131    }
31132}
31133
31134#[cfg(feature = "el2")]
31135impl VtcrEl2 {
31136    /// Offset of the `T0SZ` field.
31137    pub const T0SZ_SHIFT: u32 = 0;
31138    /// Mask for the `T0SZ` field.
31139    pub const T0SZ_MASK: u64 = 0b111111;
31140    /// Offset of the `SL0` field.
31141    pub const SL0_SHIFT: u32 = 6;
31142    /// Mask for the `SL0` field.
31143    pub const SL0_MASK: u64 = 0b11;
31144    /// Offset of the `IRGN0` field.
31145    pub const IRGN0_SHIFT: u32 = 8;
31146    /// Mask for the `IRGN0` field.
31147    pub const IRGN0_MASK: u64 = 0b11;
31148    /// Offset of the `ORGN0` field.
31149    pub const ORGN0_SHIFT: u32 = 10;
31150    /// Mask for the `ORGN0` field.
31151    pub const ORGN0_MASK: u64 = 0b11;
31152    /// Offset of the `SH0` field.
31153    pub const SH0_SHIFT: u32 = 12;
31154    /// Mask for the `SH0` field.
31155    pub const SH0_MASK: u64 = 0b11;
31156    /// Offset of the `TG0` field.
31157    pub const TG0_SHIFT: u32 = 14;
31158    /// Mask for the `TG0` field.
31159    pub const TG0_MASK: u64 = 0b11;
31160    /// Offset of the `PS` field.
31161    pub const PS_SHIFT: u32 = 16;
31162    /// Mask for the `PS` field.
31163    pub const PS_MASK: u64 = 0b111;
31164    /// Offset of the `VS` field.
31165    pub const VS_SHIFT: u32 = 19;
31166    /// Offset of the `HA` field.
31167    pub const HA_SHIFT: u32 = 21;
31168    /// Offset of the `HD` field.
31169    pub const HD_SHIFT: u32 = 22;
31170    /// Offset of the `HWU59` field.
31171    pub const HWU59_SHIFT: u32 = 25;
31172    /// Offset of the `HWU60` field.
31173    pub const HWU60_SHIFT: u32 = 26;
31174    /// Offset of the `HWU61` field.
31175    pub const HWU61_SHIFT: u32 = 27;
31176    /// Offset of the `HWU62` field.
31177    pub const HWU62_SHIFT: u32 = 28;
31178    /// Offset of the `NSW` field.
31179    pub const NSW_SHIFT: u32 = 29;
31180    /// Offset of the `NSA` field.
31181    pub const NSA_SHIFT: u32 = 30;
31182    /// Offset of the `DS` field.
31183    pub const DS_SHIFT: u32 = 32;
31184    /// Offset of the `SL2` field.
31185    pub const SL2_SHIFT: u32 = 33;
31186    /// Offset of the `AssuredOnly` field.
31187    pub const ASSUREDONLY_SHIFT: u32 = 34;
31188    /// Offset of the `TL1` field.
31189    pub const TL1_SHIFT: u32 = 35;
31190    /// Offset of the `S2PIE` field.
31191    pub const S2PIE_SHIFT: u32 = 36;
31192    /// Offset of the `S2POE` field.
31193    pub const S2POE_SHIFT: u32 = 37;
31194    /// Offset of the `D128` field.
31195    pub const D128_SHIFT: u32 = 38;
31196    /// Offset of the `GCSH` field.
31197    pub const GCSH_SHIFT: u32 = 40;
31198    /// Offset of the `TL0` field.
31199    pub const TL0_SHIFT: u32 = 41;
31200    /// Offset of the `HAFT` field.
31201    pub const HAFT_SHIFT: u32 = 44;
31202    /// Offset of the `HDBSS` field.
31203    pub const HDBSS_SHIFT: u32 = 45;
31204
31205    /// Returns the value of the `T0SZ` field.
31206    pub const fn t0sz(self) -> u8 {
31207        ((self.bits() >> Self::T0SZ_SHIFT) & 0b111111) as u8
31208    }
31209
31210    /// Sets the value of the `T0SZ` field.
31211    pub const fn set_t0sz(&mut self, value: u8) {
31212        let offset = Self::T0SZ_SHIFT;
31213        assert!(value & (Self::T0SZ_MASK as u8) == value);
31214        *self = Self::from_bits_retain(
31215            (self.bits() & !(Self::T0SZ_MASK << offset)) | ((value as u64) << offset),
31216        );
31217    }
31218
31219    /// Returns a copy with the `T0SZ` field set to the given value.
31220    pub const fn with_t0sz(mut self, value: u8) -> Self {
31221        self.set_t0sz(value);
31222        self
31223    }
31224
31225    /// Returns the value of the `SL0` field.
31226    pub const fn sl0(self) -> u8 {
31227        ((self.bits() >> Self::SL0_SHIFT) & 0b11) as u8
31228    }
31229
31230    /// Sets the value of the `SL0` field.
31231    pub const fn set_sl0(&mut self, value: u8) {
31232        let offset = Self::SL0_SHIFT;
31233        assert!(value & (Self::SL0_MASK as u8) == value);
31234        *self = Self::from_bits_retain(
31235            (self.bits() & !(Self::SL0_MASK << offset)) | ((value as u64) << offset),
31236        );
31237    }
31238
31239    /// Returns a copy with the `SL0` field set to the given value.
31240    pub const fn with_sl0(mut self, value: u8) -> Self {
31241        self.set_sl0(value);
31242        self
31243    }
31244
31245    /// Returns the value of the `IRGN0` field.
31246    pub const fn irgn0(self) -> u8 {
31247        ((self.bits() >> Self::IRGN0_SHIFT) & 0b11) as u8
31248    }
31249
31250    /// Sets the value of the `IRGN0` field.
31251    pub const fn set_irgn0(&mut self, value: u8) {
31252        let offset = Self::IRGN0_SHIFT;
31253        assert!(value & (Self::IRGN0_MASK as u8) == value);
31254        *self = Self::from_bits_retain(
31255            (self.bits() & !(Self::IRGN0_MASK << offset)) | ((value as u64) << offset),
31256        );
31257    }
31258
31259    /// Returns a copy with the `IRGN0` field set to the given value.
31260    pub const fn with_irgn0(mut self, value: u8) -> Self {
31261        self.set_irgn0(value);
31262        self
31263    }
31264
31265    /// Returns the value of the `ORGN0` field.
31266    pub const fn orgn0(self) -> u8 {
31267        ((self.bits() >> Self::ORGN0_SHIFT) & 0b11) as u8
31268    }
31269
31270    /// Sets the value of the `ORGN0` field.
31271    pub const fn set_orgn0(&mut self, value: u8) {
31272        let offset = Self::ORGN0_SHIFT;
31273        assert!(value & (Self::ORGN0_MASK as u8) == value);
31274        *self = Self::from_bits_retain(
31275            (self.bits() & !(Self::ORGN0_MASK << offset)) | ((value as u64) << offset),
31276        );
31277    }
31278
31279    /// Returns a copy with the `ORGN0` field set to the given value.
31280    pub const fn with_orgn0(mut self, value: u8) -> Self {
31281        self.set_orgn0(value);
31282        self
31283    }
31284
31285    /// Returns the value of the `SH0` field.
31286    pub const fn sh0(self) -> u8 {
31287        ((self.bits() >> Self::SH0_SHIFT) & 0b11) as u8
31288    }
31289
31290    /// Sets the value of the `SH0` field.
31291    pub const fn set_sh0(&mut self, value: u8) {
31292        let offset = Self::SH0_SHIFT;
31293        assert!(value & (Self::SH0_MASK as u8) == value);
31294        *self = Self::from_bits_retain(
31295            (self.bits() & !(Self::SH0_MASK << offset)) | ((value as u64) << offset),
31296        );
31297    }
31298
31299    /// Returns a copy with the `SH0` field set to the given value.
31300    pub const fn with_sh0(mut self, value: u8) -> Self {
31301        self.set_sh0(value);
31302        self
31303    }
31304
31305    /// Returns the value of the `TG0` field.
31306    pub const fn tg0(self) -> u8 {
31307        ((self.bits() >> Self::TG0_SHIFT) & 0b11) as u8
31308    }
31309
31310    /// Sets the value of the `TG0` field.
31311    pub const fn set_tg0(&mut self, value: u8) {
31312        let offset = Self::TG0_SHIFT;
31313        assert!(value & (Self::TG0_MASK as u8) == value);
31314        *self = Self::from_bits_retain(
31315            (self.bits() & !(Self::TG0_MASK << offset)) | ((value as u64) << offset),
31316        );
31317    }
31318
31319    /// Returns a copy with the `TG0` field set to the given value.
31320    pub const fn with_tg0(mut self, value: u8) -> Self {
31321        self.set_tg0(value);
31322        self
31323    }
31324
31325    /// Returns the value of the `PS` field.
31326    pub const fn ps(self) -> u8 {
31327        ((self.bits() >> Self::PS_SHIFT) & 0b111) as u8
31328    }
31329
31330    /// Sets the value of the `PS` field.
31331    pub const fn set_ps(&mut self, value: u8) {
31332        let offset = Self::PS_SHIFT;
31333        assert!(value & (Self::PS_MASK as u8) == value);
31334        *self = Self::from_bits_retain(
31335            (self.bits() & !(Self::PS_MASK << offset)) | ((value as u64) << offset),
31336        );
31337    }
31338
31339    /// Returns a copy with the `PS` field set to the given value.
31340    pub const fn with_ps(mut self, value: u8) -> Self {
31341        self.set_ps(value);
31342        self
31343    }
31344}
31345
31346bitflags! {
31347    /// `VTTBR` system register value.
31348    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31349    #[repr(transparent)]
31350    pub struct Vttbr: u64 {
31351        /// `CnP` bit.
31352        const CNP = 1 << 0;
31353    }
31354}
31355
31356impl Vttbr {
31357    /// Offset of the `CnP` field.
31358    pub const CNP_SHIFT: u32 = 0;
31359    /// Offset of the `BADDR` field.
31360    pub const BADDR_SHIFT: u32 = 1;
31361    /// Mask for the `BADDR` field.
31362    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
31363    /// Offset of the `VMID` field.
31364    pub const VMID_SHIFT: u32 = 48;
31365    /// Mask for the `VMID` field.
31366    pub const VMID_MASK: u64 = 0b11111111;
31367
31368    /// Returns the value of the `BADDR` field.
31369    pub const fn baddr(self) -> u64 {
31370        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
31371            as u64
31372    }
31373
31374    /// Sets the value of the `BADDR` field.
31375    pub const fn set_baddr(&mut self, value: u64) {
31376        let offset = Self::BADDR_SHIFT;
31377        assert!(value & (Self::BADDR_MASK as u64) == value);
31378        *self = Self::from_bits_retain(
31379            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
31380        );
31381    }
31382
31383    /// Returns a copy with the `BADDR` field set to the given value.
31384    pub const fn with_baddr(mut self, value: u64) -> Self {
31385        self.set_baddr(value);
31386        self
31387    }
31388
31389    /// Returns the value of the `VMID` field.
31390    pub const fn vmid(self) -> u8 {
31391        ((self.bits() >> Self::VMID_SHIFT) & 0b11111111) as u8
31392    }
31393
31394    /// Sets the value of the `VMID` field.
31395    pub const fn set_vmid(&mut self, value: u8) {
31396        let offset = Self::VMID_SHIFT;
31397        assert!(value & (Self::VMID_MASK as u8) == value);
31398        *self = Self::from_bits_retain(
31399            (self.bits() & !(Self::VMID_MASK << offset)) | ((value as u64) << offset),
31400        );
31401    }
31402
31403    /// Returns a copy with the `VMID` field set to the given value.
31404    pub const fn with_vmid(mut self, value: u8) -> Self {
31405        self.set_vmid(value);
31406        self
31407    }
31408}
31409
31410#[cfg(feature = "el2")]
31411bitflags! {
31412    /// `VTTBR_EL2` system register value.
31413    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31414    #[repr(transparent)]
31415    pub struct VttbrEl2: u64 {
31416        /// `CnP` bit.
31417        const CNP = 1 << 0;
31418    }
31419}
31420
31421#[cfg(feature = "el2")]
31422impl VttbrEl2 {
31423    /// Offset of the `CnP` field.
31424    pub const CNP_SHIFT: u32 = 0;
31425    /// Offset of the `BADDR` field.
31426    pub const BADDR_SHIFT: u32 = 1;
31427    /// Mask for the `BADDR` field.
31428    pub const BADDR_MASK: u64 = 0b11111111111111111111111111111111111111111111111;
31429    /// Offset of the `SKL` field.
31430    pub const SKL_SHIFT: u32 = 1;
31431    /// Mask for the `SKL` field.
31432    pub const SKL_MASK: u64 = 0b11;
31433    /// Offset of the `VMID` field.
31434    pub const VMID_SHIFT: u32 = 48;
31435    /// Mask for the `VMID` field.
31436    pub const VMID_MASK: u64 = 0b1111111111111111;
31437
31438    /// Returns the value of the `BADDR` field.
31439    pub const fn baddr(self) -> u64 {
31440        ((self.bits() >> Self::BADDR_SHIFT) & 0b11111111111111111111111111111111111111111111111)
31441            as u64
31442    }
31443
31444    /// Sets the value of the `BADDR` field.
31445    pub const fn set_baddr(&mut self, value: u64) {
31446        let offset = Self::BADDR_SHIFT;
31447        assert!(value & (Self::BADDR_MASK as u64) == value);
31448        *self = Self::from_bits_retain(
31449            (self.bits() & !(Self::BADDR_MASK << offset)) | ((value as u64) << offset),
31450        );
31451    }
31452
31453    /// Returns a copy with the `BADDR` field set to the given value.
31454    pub const fn with_baddr(mut self, value: u64) -> Self {
31455        self.set_baddr(value);
31456        self
31457    }
31458
31459    /// Returns the value of the `SKL` field.
31460    pub const fn skl(self) -> u8 {
31461        ((self.bits() >> Self::SKL_SHIFT) & 0b11) as u8
31462    }
31463
31464    /// Sets the value of the `SKL` field.
31465    pub const fn set_skl(&mut self, value: u8) {
31466        let offset = Self::SKL_SHIFT;
31467        assert!(value & (Self::SKL_MASK as u8) == value);
31468        *self = Self::from_bits_retain(
31469            (self.bits() & !(Self::SKL_MASK << offset)) | ((value as u64) << offset),
31470        );
31471    }
31472
31473    /// Returns a copy with the `SKL` field set to the given value.
31474    pub const fn with_skl(mut self, value: u8) -> Self {
31475        self.set_skl(value);
31476        self
31477    }
31478
31479    /// Returns the value of the `VMID` field.
31480    pub const fn vmid(self) -> u16 {
31481        ((self.bits() >> Self::VMID_SHIFT) & 0b1111111111111111) as u16
31482    }
31483
31484    /// Sets the value of the `VMID` field.
31485    pub const fn set_vmid(&mut self, value: u16) {
31486        let offset = Self::VMID_SHIFT;
31487        assert!(value & (Self::VMID_MASK as u16) == value);
31488        *self = Self::from_bits_retain(
31489            (self.bits() & !(Self::VMID_MASK << offset)) | ((value as u64) << offset),
31490        );
31491    }
31492
31493    /// Returns a copy with the `VMID` field set to the given value.
31494    pub const fn with_vmid(mut self, value: u16) -> Self {
31495        self.set_vmid(value);
31496        self
31497    }
31498}
31499
31500#[cfg(feature = "el3")]
31501bitflags! {
31502    /// `ZCR_EL3` system register value.
31503    #[derive(Clone, Copy, Debug, Default, Eq, PartialEq)]
31504    #[repr(transparent)]
31505    pub struct ZcrEl3: u64 {
31506    }
31507}
31508
31509#[cfg(feature = "el3")]
31510impl ZcrEl3 {
31511    /// Offset of the `LEN` field.
31512    pub const LEN_SHIFT: u32 = 0;
31513    /// Mask for the `LEN` field.
31514    pub const LEN_MASK: u64 = 0b1111;
31515
31516    /// Returns the value of the `LEN` field.
31517    pub const fn len(self) -> u8 {
31518        ((self.bits() >> Self::LEN_SHIFT) & 0b1111) as u8
31519    }
31520
31521    /// Sets the value of the `LEN` field.
31522    pub const fn set_len(&mut self, value: u8) {
31523        let offset = Self::LEN_SHIFT;
31524        assert!(value & (Self::LEN_MASK as u8) == value);
31525        *self = Self::from_bits_retain(
31526            (self.bits() & !(Self::LEN_MASK << offset)) | ((value as u64) << offset),
31527        );
31528    }
31529
31530    /// Returns a copy with the `LEN` field set to the given value.
31531    pub const fn with_len(mut self, value: u8) -> Self {
31532        self.set_len(value);
31533        self
31534    }
31535}
31536
31537#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31538read_write_sysreg!(actlr: (p15, 0, c0, c1, 1), u32, safe_read, fake::SYSREGS);
31539#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31540read_write_sysreg!(actlr2: (p15, 0, c0, c1, 3), u32, safe_read, fake::SYSREGS);
31541#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31542read_write_sysreg!(actlr_el1, u64, safe_read, fake::SYSREGS);
31543#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31544read_write_sysreg!(actlr_el2, u64, safe_read, fake::SYSREGS);
31545#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31546read_write_sysreg!(adfsr: (p15, 0, c1, c5, 0), u32, safe_read, fake::SYSREGS);
31547#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31548read_write_sysreg!(afsr0_el1, u64, safe_read, fake::SYSREGS);
31549#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31550read_write_sysreg!(afsr0_el2, u64, safe_read, fake::SYSREGS);
31551#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31552read_write_sysreg!(afsr1_el1, u64, safe_read, fake::SYSREGS);
31553#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31554read_write_sysreg!(afsr1_el2, u64, safe_read, fake::SYSREGS);
31555#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31556read_sysreg!(aidr: (p15, 1, c0, c0, 7), u32, safe, fake::SYSREGS);
31557#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31558read_write_sysreg!(aifsr: (p15, 0, c1, c5, 1), u32, safe_read, fake::SYSREGS);
31559#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31560read_write_sysreg!(amair0: (p15, 0, c3, c10, 0), u32, safe_read, fake::SYSREGS);
31561#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31562read_write_sysreg!(amair1: (p15, 0, c3, c10, 1), u32, safe_read, fake::SYSREGS);
31563#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31564read_write_sysreg!(amair_el1, u64, safe_read, fake::SYSREGS);
31565#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31566read_write_sysreg!(amair_el2, u64, safe_read, fake::SYSREGS);
31567#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31568read_sysreg!(amcfgr: (p15, 0, c2, c13, 1), u32: Amcfgr, safe, fake::SYSREGS);
31569#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31570read_sysreg!(amcgcr: (p15, 0, c2, c13, 2), u32: Amcgcr, safe, fake::SYSREGS);
31571#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31572read_write_sysreg!(amcntenclr0: (p15, 0, c2, c13, 4), u32: Amcntenclr0, safe_read, fake::SYSREGS);
31573#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31574read_write_sysreg!(amcntenclr1: (p15, 0, c3, c13, 0), u32: Amcntenclr1, safe_read, fake::SYSREGS);
31575#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31576read_write_sysreg!(amcntenset0: (p15, 0, c2, c13, 5), u32: Amcntenset0, safe_read, fake::SYSREGS);
31577#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31578read_write_sysreg!(amcntenset1: (p15, 0, c3, c13, 1), u32: Amcntenset1, safe_read, fake::SYSREGS);
31579#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31580read_write_sysreg!(amcr: (p15, 0, c2, c13, 0), u32: Amcr, safe_read, fake::SYSREGS);
31581#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31582read_write_sysreg!(amuserenr: (p15, 0, c2, c13, 3), u32: Amuserenr, safe_read, fake::SYSREGS);
31583#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31584read_write_sysreg!(apiakeyhi_el1: s3_0_c2_c1_1, u64: ApiakeyhiEl1, safe_read, fake::SYSREGS);
31585#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31586read_write_sysreg!(apiakeylo_el1: s3_0_c2_c1_0, u64: ApiakeyloEl1, safe_read, fake::SYSREGS);
31587#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31588read_sysreg!(ccsidr: (p15, 1, c0, c0, 0), u32: Ccsidr, safe, fake::SYSREGS);
31589#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31590read_sysreg!(ccsidr2: (p15, 1, c0, c0, 2), u32: Ccsidr2, safe, fake::SYSREGS);
31591#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31592read_sysreg!(ccsidr_el1, u64: CcsidrEl1, safe, fake::SYSREGS);
31593#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31594read_sysreg!(clidr: (p15, 1, c0, c0, 1), u32: Clidr, safe, fake::SYSREGS);
31595#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31596read_sysreg!(clidr_el1, u64: ClidrEl1, safe, fake::SYSREGS);
31597#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31598read_write_sysreg!(cntfrq: (p15, 0, c0, c14, 0), u32: Cntfrq, safe_read, fake::SYSREGS);
31599#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31600read_write_sysreg!(cntfrq_el0, u64: CntfrqEl0, safe_read, safe_write, fake::SYSREGS);
31601#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31602read_write_sysreg!(cnthctl: (p15, 4, c1, c14, 0), u32: Cnthctl, safe_read, fake::SYSREGS);
31603#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31604read_write_sysreg!(cnthctl_el2, u64: CnthctlEl2, safe_read, safe_write, fake::SYSREGS);
31605#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31606read_write_sysreg!(cnthps_ctl: (p15, 0, c2, c14, 1), u32: CnthpsCtl, safe_read, fake::SYSREGS);
31607#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31608read_write_sysreg!(cnthps_ctl_el2: s3_4_c14_c5_1, u64: CnthpsCtlEl2, safe_read, safe_write, fake::SYSREGS);
31609#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31610read_write_sysreg!(cnthps_cval: (p15, 2, c14), u64: CnthpsCval, safe_read, fake::SYSREGS);
31611#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31612read_write_sysreg!(cnthps_cval_el2: s3_4_c14_c5_2, u64: CnthpsCvalEl2, safe_read, safe_write, fake::SYSREGS);
31613#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31614read_write_sysreg!(cnthps_tval: (p15, 0, c2, c14, 0), u32: CnthpsTval, safe_read, fake::SYSREGS);
31615#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31616read_write_sysreg!(cnthps_tval_el2: s3_4_c14_c5_0, u64: CnthpsTvalEl2, safe_read, safe_write, fake::SYSREGS);
31617#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31618read_write_sysreg!(cnthp_ctl: (p15, 0, c2, c14, 1), u32: CnthpCtl, safe_read, fake::SYSREGS);
31619#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31620read_write_sysreg!(cnthp_ctl_el2: s3_4_c14_c2_1, u64: CnthpCtlEl2, safe_read, safe_write, fake::SYSREGS);
31621#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31622read_write_sysreg!(cnthp_cval: (p15, 2, c14), u64: CnthpCval, safe_read, fake::SYSREGS);
31623#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31624read_write_sysreg!(cnthp_cval_el2: s3_4_c14_c2_2, u64: CnthpCvalEl2, safe_read, safe_write, fake::SYSREGS);
31625#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31626read_write_sysreg!(cnthp_tval: (p15, 0, c2, c14, 0), u32: CnthpTval, safe_read, fake::SYSREGS);
31627#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31628read_write_sysreg!(cnthp_tval_el2: s3_4_c14_c2_0, u64: CnthpTvalEl2, safe_read, safe_write, fake::SYSREGS);
31629#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31630read_write_sysreg!(cnthvs_ctl: (p15, 0, c3, c14, 1), u32: CnthvsCtl, safe_read, fake::SYSREGS);
31631#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31632read_write_sysreg!(cnthvs_ctl_el2: s3_4_c14_c4_1, u64: CnthvsCtlEl2, safe_read, safe_write, fake::SYSREGS);
31633#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31634read_write_sysreg!(cnthvs_cval: (p15, 3, c14), u64: CnthvsCval, safe_read, fake::SYSREGS);
31635#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31636read_write_sysreg!(cnthvs_cval_el2: s3_4_c14_c4_2, u64: CnthvsCvalEl2, safe_read, safe_write, fake::SYSREGS);
31637#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31638read_write_sysreg!(cnthvs_tval: (p15, 0, c3, c14, 0), u32: CnthvsTval, safe_read, fake::SYSREGS);
31639#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31640read_write_sysreg!(cnthvs_tval_el2: s3_4_c14_c4_0, u64: CnthvsTvalEl2, safe_read, safe_write, fake::SYSREGS);
31641#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31642read_write_sysreg!(cnthv_ctl: (p15, 0, c3, c14, 1), u32: CnthvCtl, safe_read, fake::SYSREGS);
31643#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31644read_write_sysreg!(cnthv_ctl_el2: s3_4_c14_c3_1, u64: CnthvCtlEl2, safe_read, safe_write, fake::SYSREGS);
31645#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31646read_write_sysreg!(cnthv_cval: (p15, 3, c14), u64: CnthvCval, safe_read, fake::SYSREGS);
31647#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31648read_write_sysreg!(cnthv_cval_el2: s3_4_c14_c3_2, u64: CnthvCvalEl2, safe_read, safe_write, fake::SYSREGS);
31649#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31650read_write_sysreg!(cnthv_tval: (p15, 0, c3, c14, 0), u32: CnthvTval, safe_read, fake::SYSREGS);
31651#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31652read_write_sysreg!(cnthv_tval_el2: s3_4_c14_c3_0, u64: CnthvTvalEl2, safe_read, safe_write, fake::SYSREGS);
31653#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31654read_write_sysreg!(cntkctl: (p15, 0, c1, c14, 0), u32: Cntkctl, safe_read, fake::SYSREGS);
31655#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31656read_write_sysreg!(cntkctl_el1, u64: CntkctlEl1, safe_read, safe_write, fake::SYSREGS);
31657#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31658read_sysreg!(cntpct: (p15, 0, c14), u64: Cntpct, safe, fake::SYSREGS);
31659#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31660read_sysreg!(cntpctss: (p15, 8, c14), u64: Cntpctss, safe, fake::SYSREGS);
31661#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31662read_sysreg!(cntpctss_el0: s3_3_c14_c0_5, u64: CntpctssEl0, safe, fake::SYSREGS);
31663#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31664read_sysreg!(cntpct_el0, u64: CntpctEl0, safe, fake::SYSREGS);
31665#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31666read_write_sysreg!(cntpoff_el2: s3_4_c14_c0_6, u64: CntpoffEl2, safe_read, safe_write, fake::SYSREGS);
31667#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31668read_write_sysreg!(cntps_ctl_el1, u64: CntpsCtlEl1, safe_read, safe_write, fake::SYSREGS);
31669#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31670read_write_sysreg!(cntps_cval_el1, u64: CntpsCvalEl1, safe_read, safe_write, fake::SYSREGS);
31671#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31672read_write_sysreg!(cntps_tval_el1, u64: CntpsTvalEl1, safe_read, safe_write, fake::SYSREGS);
31673#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31674read_write_sysreg!(cntp_ctl: (p15, 0, c2, c14, 1), u32: CntpCtl, safe_read, fake::SYSREGS);
31675#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31676read_write_sysreg!(cntp_ctl_el0, u64: CntpCtlEl0, safe_read, safe_write, fake::SYSREGS);
31677#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31678read_write_sysreg!(cntp_cval: (p15, 2, c14), u64: CntpCval, safe_read, fake::SYSREGS);
31679#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31680read_write_sysreg!(cntp_cval_el0, u64: CntpCvalEl0, safe_read, safe_write, fake::SYSREGS);
31681#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31682read_write_sysreg!(cntp_tval: (p15, 0, c2, c14, 0), u32: CntpTval, safe_read, fake::SYSREGS);
31683#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31684read_write_sysreg!(cntp_tval_el0, u64: CntpTvalEl0, safe_read, safe_write, fake::SYSREGS);
31685#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31686read_sysreg!(cntvct: (p15, 1, c14), u64: Cntvct, safe, fake::SYSREGS);
31687#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31688read_sysreg!(cntvctss: (p15, 9, c14), u64: Cntvctss, safe, fake::SYSREGS);
31689#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31690read_sysreg!(cntvctss_el0: s3_3_c14_c0_6, u64: CntvctssEl0, safe, fake::SYSREGS);
31691#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31692read_sysreg!(cntvct_el0, u64: CntvctEl0, safe, fake::SYSREGS);
31693#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31694read_write_sysreg!(cntvoff: (p15, 4, c14), u64: Cntvoff, safe_read, fake::SYSREGS);
31695#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31696read_write_sysreg!(cntvoff_el2, u64: CntvoffEl2, safe_read, safe_write, fake::SYSREGS);
31697#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31698read_write_sysreg!(cntv_ctl: (p15, 0, c3, c14, 1), u32: CntvCtl, safe_read, fake::SYSREGS);
31699#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31700read_write_sysreg!(cntv_ctl_el0, u64: CntvCtlEl0, safe_read, safe_write, fake::SYSREGS);
31701#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31702read_write_sysreg!(cntv_cval: (p15, 3, c14), u64: CntvCval, safe_read, fake::SYSREGS);
31703#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31704read_write_sysreg!(cntv_cval_el0, u64: CntvCvalEl0, safe_read, safe_write, fake::SYSREGS);
31705#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31706read_write_sysreg!(cntv_tval: (p15, 0, c3, c14, 0), u32: CntvTval, safe_read, fake::SYSREGS);
31707#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31708read_write_sysreg!(cntv_tval_el0, u64: CntvTvalEl0, safe_read, safe_write, fake::SYSREGS);
31709#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31710read_write_sysreg!(contextidr: (p15, 0, c0, c13, 1), u32: Contextidr, safe_read, fake::SYSREGS);
31711#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31712read_write_sysreg!(contextidr_el1, u64: ContextidrEl1, safe_read, safe_write, fake::SYSREGS);
31713#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31714read_write_sysreg!(contextidr_el2: s3_4_c13_c0_1, u64: ContextidrEl2, safe_read, safe_write, fake::SYSREGS);
31715#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31716read_write_sysreg!(cpacr: (p15, 0, c0, c1, 2), u32: Cpacr, safe_read, fake::SYSREGS);
31717#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31718read_write_sysreg!(cpacr_el1, u64: CpacrEl1, safe_read, fake::SYSREGS);
31719#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31720read_write_sysreg!(cptr_el2, u64: CptrEl2, safe_read, fake::SYSREGS);
31721#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
31722read_write_sysreg!(cptr_el3, u64: CptrEl3, safe_read, fake::SYSREGS);
31723#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31724read_write_sysreg!(csselr: (p15, 2, c0, c0, 0), u32: Csselr, safe_read, fake::SYSREGS);
31725#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31726read_write_sysreg!(csselr_el1, u64: CsselrEl1, safe_read, safe_write, fake::SYSREGS);
31727#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31728read_sysreg!(ctr: (p15, 0, c0, c0, 1), u32: Ctr, safe, fake::SYSREGS);
31729#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31730read_sysreg!(ctr_el0, u64: CtrEl0, safe, fake::SYSREGS);
31731#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31732read_sysreg!(currentel, u64: Currentel, safe, fake::SYSREGS);
31733#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31734read_write_sysreg!(dacr: (p15, 0, c0, c3, 0), u32: Dacr, safe_read, fake::SYSREGS);
31735#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31736read_sysreg!(dbgauthstatus: (p14, 0, c14, c7, 6), u32: Dbgauthstatus, safe, fake::SYSREGS);
31737#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31738read_write_sysreg!(dbgclaimclr: (p14, 0, c9, c7, 6), u32: Dbgclaimclr, safe_read, fake::SYSREGS);
31739#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31740read_write_sysreg!(dbgclaimset: (p14, 0, c8, c7, 6), u32: Dbgclaimset, safe_read, fake::SYSREGS);
31741#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31742read_write_sysreg!(dbgdccint: (p14, 0, c2, c0, 0), u32: Dbgdccint, safe_read, fake::SYSREGS);
31743#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31744read_sysreg!(dbgdevid: (p14, 0, c2, c7, 7), u32: Dbgdevid, safe, fake::SYSREGS);
31745#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31746read_sysreg!(dbgdevid1: (p14, 0, c1, c7, 7), u32: Dbgdevid1, safe, fake::SYSREGS);
31747#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31748read_sysreg!(dbgdevid2: (p14, 0, c0, c7, 7), u32, safe, fake::SYSREGS);
31749#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31750read_sysreg!(dbgdidr: (p14, 0, c0, c0, 0), u32: Dbgdidr, safe, fake::SYSREGS);
31751#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31752read_sysreg!(dbgdrar: (p14, 0, c1), u64: Dbgdrar, safe, fake::SYSREGS);
31753#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31754read_sysreg!(dbgdsar: (p14, 0, c2), u64, safe, fake::SYSREGS);
31755#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31756read_write_sysreg!(dbgdscrext: (p14, 0, c2, c0, 2), u32: Dbgdscrext, safe_read, fake::SYSREGS);
31757#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31758read_sysreg!(dbgdscrint: (p14, 0, c1, c0, 0), u32: Dbgdscrint, safe, fake::SYSREGS);
31759#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31760read_write_sysreg!(dbgdtrrxext: (p14, 0, c0, c0, 2), u32: Dbgdtrrxext, safe_read, fake::SYSREGS);
31761#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31762read_sysreg!(dbgdtrrxint: (p14, 0, c5, c0, 0), u32: Dbgdtrrxint, safe, fake::SYSREGS);
31763#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31764read_write_sysreg!(dbgdtrtxext: (p14, 0, c3, c0, 2), u32: Dbgdtrtxext, safe_read, fake::SYSREGS);
31765#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31766write_sysreg!(dbgdtrtxint: (p14, 0, c5, c0, 0), u32: Dbgdtrtxint, fake::SYSREGS);
31767#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31768read_write_sysreg!(dbgosdlr: (p14, 0, c3, c1, 4), u32: Dbgosdlr, safe_read, fake::SYSREGS);
31769#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31770read_write_sysreg!(dbgoseccr: (p14, 0, c6, c0, 2), u32: Dbgoseccr, safe_read, fake::SYSREGS);
31771#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31772write_sysreg!(dbgoslar: (p14, 0, c0, c1, 4), u32: Dbgoslar, fake::SYSREGS);
31773#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31774read_sysreg!(dbgoslsr: (p14, 0, c1, c1, 4), u32: Dbgoslsr, safe, fake::SYSREGS);
31775#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31776read_write_sysreg!(dbgprcr: (p14, 0, c4, c1, 4), u32: Dbgprcr, safe_read, fake::SYSREGS);
31777#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31778read_write_sysreg!(dbgvcr: (p14, 0, c7, c0, 0), u32: Dbgvcr, safe_read, fake::SYSREGS);
31779#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31780read_write_sysreg!(dbgwfar: (p14, 0, c6, c0, 0), u32, safe_read, fake::SYSREGS);
31781#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31782read_write_sysreg!(dfar: (p15, 0, c0, c6, 0), u32: Dfar, safe_read, fake::SYSREGS);
31783#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31784read_write_sysreg!(dfsr: (p15, 0, c0, c5, 0), u32: Dfsr, safe_read, fake::SYSREGS);
31785#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31786read_write_sysreg!(disr: (p15, 0, c1, c12, 1), u32: Disr, safe_read, fake::SYSREGS);
31787#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31788read_write_sysreg!(disr_el1: s3_0_c12_c1_1, u64: DisrEl1, safe_read, safe_write, fake::SYSREGS);
31789#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
31790read_write_sysreg!(dit: s3_3_c4_c2_5, u64: Dit, safe_read, safe_write, fake::SYSREGS);
31791#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31792read_write_sysreg!(dlr: (p15, 3, c5, c4, 1), u32: Dlr, safe_read, fake::SYSREGS);
31793#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31794read_write_sysreg!(dspsr: (p15, 3, c5, c4, 0), u32: Dspsr, safe_read, fake::SYSREGS);
31795#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31796read_write_sysreg!(dspsr2: (p15, 3, c5, c4, 2), u32: Dspsr2, safe_read, fake::SYSREGS);
31797#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31798read_write_sysreg!(elr_el1, u64: ElrEl1, safe_read, fake::SYSREGS);
31799#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31800read_write_sysreg!(elr_el2, u64: ElrEl2, safe_read, fake::SYSREGS);
31801#[cfg(all(any(test, feature = "fakes", target_arch = "arm"), feature = "el2"))]
31802read_write_sysreg!(elr_hyp, u32: ElrHyp, safe_read, fake::SYSREGS);
31803#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31804read_sysreg!(erridr: (p15, 0, c3, c5, 0), u32: Erridr, safe, fake::SYSREGS);
31805#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31806read_write_sysreg!(errselr: (p15, 0, c3, c5, 1), u32: Errselr, safe_read, fake::SYSREGS);
31807#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31808read_write_sysreg!(erxaddr: (p15, 0, c4, c5, 3), u32: Erxaddr, safe_read, fake::SYSREGS);
31809#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31810read_write_sysreg!(erxaddr2: (p15, 0, c4, c5, 7), u32: Erxaddr2, safe_read, fake::SYSREGS);
31811#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31812read_write_sysreg!(erxctlr: (p15, 0, c4, c5, 1), u32: Erxctlr, safe_read, fake::SYSREGS);
31813#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31814read_write_sysreg!(erxctlr2: (p15, 0, c4, c5, 5), u32: Erxctlr2, safe_read, fake::SYSREGS);
31815#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31816read_sysreg!(erxfr: (p15, 0, c4, c5, 0), u32: Erxfr, safe, fake::SYSREGS);
31817#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31818read_sysreg!(erxfr2: (p15, 0, c4, c5, 4), u32: Erxfr2, safe, fake::SYSREGS);
31819#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31820read_write_sysreg!(erxmisc0: (p15, 0, c5, c5, 0), u32: Erxmisc0, safe_read, fake::SYSREGS);
31821#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31822read_write_sysreg!(erxmisc1: (p15, 0, c5, c5, 1), u32: Erxmisc1, safe_read, fake::SYSREGS);
31823#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31824read_write_sysreg!(erxmisc2: (p15, 0, c5, c5, 4), u32: Erxmisc2, safe_read, fake::SYSREGS);
31825#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31826read_write_sysreg!(erxmisc3: (p15, 0, c5, c5, 5), u32: Erxmisc3, safe_read, fake::SYSREGS);
31827#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31828read_write_sysreg!(erxmisc4: (p15, 0, c5, c5, 2), u32: Erxmisc4, safe_read, fake::SYSREGS);
31829#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31830read_write_sysreg!(erxmisc5: (p15, 0, c5, c5, 3), u32: Erxmisc5, safe_read, fake::SYSREGS);
31831#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31832read_write_sysreg!(erxmisc6: (p15, 0, c5, c5, 6), u32: Erxmisc6, safe_read, fake::SYSREGS);
31833#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31834read_write_sysreg!(erxmisc7: (p15, 0, c5, c5, 7), u32: Erxmisc7, safe_read, fake::SYSREGS);
31835#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31836read_write_sysreg!(erxstatus: (p15, 0, c4, c5, 2), u32: Erxstatus, safe_read, fake::SYSREGS);
31837#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31838read_write_sysreg!(esr_el1, u64: EsrEl1, safe_read, safe_write, fake::SYSREGS);
31839#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31840read_write_sysreg!(esr_el2, u64: EsrEl2, safe_read, safe_write, fake::SYSREGS);
31841#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
31842read_write_sysreg!(esr_el3, u64: EsrEl3, safe_read, safe_write, fake::SYSREGS);
31843#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31844read_write_sysreg!(far_el1, u64: FarEl1, safe_read, fake::SYSREGS);
31845#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31846read_write_sysreg!(far_el2, u64: FarEl2, safe_read, fake::SYSREGS);
31847#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31848read_write_sysreg!(fcseidr: (p15, 0, c0, c13, 0), u32, safe_read, fake::SYSREGS);
31849#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31850read_write_sysreg!(gcr_el1: s3_0_c1_c0_6, u64: GcrEl1, safe_read, fake::SYSREGS);
31851#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31852read_write_sysreg!(gcscr_el1: s3_0_c2_c5_0, u64: GcscrEl1, safe_read, fake::SYSREGS);
31853#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31854read_write_sysreg!(gcscr_el2: s3_4_c2_c5_0, u64: GcscrEl2, safe_read, fake::SYSREGS);
31855#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
31856read_write_sysreg!(gpccr_el3: s3_6_c2_c1_6, u64: GpccrEl3, safe_read, fake::SYSREGS);
31857#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
31858read_write_sysreg!(gptbr_el3: s3_6_c2_c1_4, u64: GptbrEl3, safe_read, fake::SYSREGS);
31859#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31860read_write_sysreg!(hacr: (p15, 4, c1, c1, 7), u32, safe_read, fake::SYSREGS);
31861#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31862read_write_sysreg!(hacr_el2, u64, safe_read, fake::SYSREGS);
31863#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31864read_write_sysreg!(hactlr: (p15, 4, c0, c1, 1), u32, safe_read, fake::SYSREGS);
31865#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31866read_write_sysreg!(hactlr2: (p15, 4, c0, c1, 3), u32, safe_read, fake::SYSREGS);
31867#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31868read_write_sysreg!(hadfsr: (p15, 4, c1, c5, 0), u32, safe_read, fake::SYSREGS);
31869#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31870read_write_sysreg!(hafgrtr_el2: s3_4_c3_c1_6, u64: HafgrtrEl2, safe_read, fake::SYSREGS);
31871#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31872read_write_sysreg!(haifsr: (p15, 4, c1, c5, 1), u32, safe_read, fake::SYSREGS);
31873#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31874read_write_sysreg!(hamair0: (p15, 4, c3, c10, 0), u32, safe_read, fake::SYSREGS);
31875#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31876read_write_sysreg!(hamair1: (p15, 4, c3, c10, 1), u32, safe_read, fake::SYSREGS);
31877#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31878read_write_sysreg!(hcptr: (p15, 4, c1, c1, 2), u32: Hcptr, safe_read, fake::SYSREGS);
31879#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31880read_write_sysreg!(hcr: (p15, 4, c1, c1, 0), u32: Hcr, safe_read, fake::SYSREGS);
31881#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31882read_write_sysreg!(hcr2: (p15, 4, c1, c1, 4), u32: Hcr2, safe_read, fake::SYSREGS);
31883#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31884read_write_sysreg!(hcrx_el2: s3_4_c1_c2_2, u64: HcrxEl2, safe_read, fake::SYSREGS);
31885#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31886read_write_sysreg!(hcr_el2, u64: HcrEl2, safe_read, fake::SYSREGS);
31887#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31888read_write_sysreg!(hdcr: (p15, 4, c1, c1, 1), u32: Hdcr, safe_read, fake::SYSREGS);
31889#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31890read_write_sysreg!(hdfar: (p15, 4, c0, c6, 0), u32: Hdfar, safe_read, fake::SYSREGS);
31891#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31892read_write_sysreg!(hdfgrtr2_el2: s3_4_c3_c1_0, u64: Hdfgrtr2El2, safe_read, fake::SYSREGS);
31893#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31894read_write_sysreg!(hdfgrtr_el2: s3_4_c3_c1_4, u64: HdfgrtrEl2, safe_read, fake::SYSREGS);
31895#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31896read_write_sysreg!(hdfgwtr2_el2: s3_4_c3_c1_1, u64: Hdfgwtr2El2, safe_read, fake::SYSREGS);
31897#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31898read_write_sysreg!(hdfgwtr_el2: s3_4_c3_c1_5, u64: HdfgwtrEl2, safe_read, fake::SYSREGS);
31899#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31900read_write_sysreg!(hfgitr2_el2: s3_4_c3_c1_7, u64: Hfgitr2El2, safe_read, fake::SYSREGS);
31901#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31902read_write_sysreg!(hfgitr_el2: s3_4_c1_c1_6, u64: HfgitrEl2, safe_read, fake::SYSREGS);
31903#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31904read_write_sysreg!(hfgrtr2_el2: s3_4_c3_c1_2, u64: Hfgrtr2El2, safe_read, fake::SYSREGS);
31905#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31906read_write_sysreg!(hfgrtr_el2: s3_4_c1_c1_4, u64: HfgrtrEl2, safe_read, fake::SYSREGS);
31907#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31908read_write_sysreg!(hfgwtr2_el2: s3_4_c3_c1_3, u64: Hfgwtr2El2, safe_read, fake::SYSREGS);
31909#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31910read_write_sysreg!(hfgwtr_el2: s3_4_c1_c1_5, u64: HfgwtrEl2, safe_read, fake::SYSREGS);
31911#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31912read_write_sysreg!(hifar: (p15, 4, c0, c6, 2), u32: Hifar, safe_read, fake::SYSREGS);
31913#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31914read_write_sysreg!(hmair0: (p15, 4, c2, c10, 0), u32: Hmair0, safe_read, fake::SYSREGS);
31915#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31916read_write_sysreg!(hmair1: (p15, 4, c2, c10, 1), u32: Hmair1, safe_read, fake::SYSREGS);
31917#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31918read_write_sysreg!(hpfar: (p15, 4, c0, c6, 4), u32: Hpfar, safe_read, fake::SYSREGS);
31919#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31920read_write_sysreg!(hpfar_el2, u64: HpfarEl2, safe_read, fake::SYSREGS);
31921#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31922read_write_sysreg!(hrmr: (p15, 4, c0, c12, 2), u32: Hrmr, safe_read, fake::SYSREGS);
31923#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31924read_write_sysreg!(hsctlr: (p15, 4, c0, c1, 0), u32: Hsctlr, safe_read, fake::SYSREGS);
31925#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31926read_write_sysreg!(hsr: (p15, 4, c2, c5, 0), u32: Hsr, safe_read, fake::SYSREGS);
31927#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31928read_write_sysreg!(hstr: (p15, 4, c1, c1, 3), u32, safe_read, fake::SYSREGS);
31929#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
31930read_write_sysreg!(hstr_el2, u64, safe_read, safe_write, fake::SYSREGS);
31931#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31932read_write_sysreg!(htcr: (p15, 4, c0, c2, 2), u32: Htcr, safe_read, fake::SYSREGS);
31933#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31934read_write_sysreg!(htpidr: (p15, 4, c0, c13, 2), u32: Htpidr, safe_read, fake::SYSREGS);
31935#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31936read_write_sysreg!(htrfcr: (p15, 4, c2, c1, 1), u32: Htrfcr, safe_read, fake::SYSREGS);
31937#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31938read_write_sysreg!(httbr: (p15, 4, c2), u64: Httbr, safe_read, fake::SYSREGS);
31939#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31940read_write_sysreg!(hvbar: (p15, 4, c0, c12, 0), u32: Hvbar, safe_read, fake::SYSREGS);
31941#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31942read_write_sysreg!(icc_ap0r0_el1, u64, safe_read, fake::SYSREGS);
31943#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31944read_write_sysreg!(icc_ap0r1_el1, u64, safe_read, fake::SYSREGS);
31945#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31946read_write_sysreg!(icc_ap0r2_el1, u64, safe_read, fake::SYSREGS);
31947#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31948read_write_sysreg!(icc_ap0r3_el1, u64, safe_read, fake::SYSREGS);
31949#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31950read_write_sysreg!(icc_ap1r0_el1, u64: IccAp1r0El1, safe_read, fake::SYSREGS);
31951#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31952read_write_sysreg!(icc_ap1r1_el1, u64, safe_read, fake::SYSREGS);
31953#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31954read_write_sysreg!(icc_ap1r2_el1, u64, safe_read, fake::SYSREGS);
31955#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31956read_write_sysreg!(icc_ap1r3_el1, u64, safe_read, fake::SYSREGS);
31957#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31958write_sysreg!(icc_asgi1r: (p15, 1, c12), u64: IccAsgi1r, safe, fake::SYSREGS);
31959#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31960write_sysreg!(icc_asgi1r_el1: s3_0_c12_c11_6, u64: IccAsgi1rEl1, safe, fake::SYSREGS);
31961#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31962read_write_sysreg!(icc_bpr0: (p15, 0, c8, c12, 3), u32: IccBpr0, safe_read, safe_write, fake::SYSREGS);
31963#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31964read_write_sysreg!(icc_bpr0_el1: s3_0_c12_c8_3, u64: IccBpr0El1, safe_read, safe_write, fake::SYSREGS);
31965#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31966read_write_sysreg!(icc_bpr1: (p15, 0, c12, c12, 3), u32: IccBpr1, safe_read, safe_write, fake::SYSREGS);
31967#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31968read_write_sysreg!(icc_bpr1_el1: s3_0_c12_c12_3, u64: IccBpr1El1, safe_read, safe_write, fake::SYSREGS);
31969#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31970read_write_sysreg!(icc_ctlr: (p15, 0, c12, c12, 4), u32: IccCtlr, safe_read, safe_write, fake::SYSREGS);
31971#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31972read_write_sysreg!(icc_ctlr_el1: s3_0_c12_c12_4, u64: IccCtlrEl1, safe_read, safe_write, fake::SYSREGS);
31973#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
31974read_write_sysreg!(icc_ctlr_el3: s3_6_c12_c12_4, u64: IccCtlrEl3, safe_read, safe_write, fake::SYSREGS);
31975#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31976write_sysreg!(icc_dir: (p15, 0, c11, c12, 1), u32: IccDir, safe, fake::SYSREGS);
31977#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31978write_sysreg!(icc_dir_el1: s3_0_c12_c11_1, u64: IccDirEl1, safe, fake::SYSREGS);
31979#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31980write_sysreg!(icc_eoir0: (p15, 0, c8, c12, 1), u32: IccEoir0, safe, fake::SYSREGS);
31981#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31982write_sysreg!(icc_eoir0_el1: s3_0_c12_c8_1, u64: IccEoir0El1, safe, fake::SYSREGS);
31983#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31984write_sysreg!(icc_eoir1: (p15, 0, c12, c12, 1), u32: IccEoir1, safe, fake::SYSREGS);
31985#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31986write_sysreg!(icc_eoir1_el1: s3_0_c12_c12_1, u64: IccEoir1El1, safe, fake::SYSREGS);
31987#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31988read_sysreg!(icc_hppir0: (p15, 0, c8, c12, 2), u32: IccHppir0, safe, fake::SYSREGS);
31989#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31990read_sysreg!(icc_hppir0_el1: s3_0_c12_c8_2, u64: IccHppir0El1, safe, fake::SYSREGS);
31991#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31992read_sysreg!(icc_hppir1: (p15, 0, c12, c12, 2), u32: IccHppir1, safe, fake::SYSREGS);
31993#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
31994read_sysreg!(icc_hppir1_el1: s3_0_c12_c12_2, u64: IccHppir1El1, safe, fake::SYSREGS);
31995#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31996read_write_sysreg!(icc_hsre: (p15, 4, c9, c12, 5), u32: IccHsre, safe_read, fake::SYSREGS);
31997#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
31998read_sysreg!(icc_iar0: (p15, 0, c8, c12, 0), u32: IccIar0, safe, fake::SYSREGS);
31999#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32000read_sysreg!(icc_iar0_el1: s3_0_c12_c8_0, u64: IccIar0El1, safe, fake::SYSREGS);
32001#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32002read_sysreg!(icc_iar1: (p15, 0, c12, c12, 0), u32: IccIar1, safe, fake::SYSREGS);
32003#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32004read_sysreg!(icc_iar1_el1: s3_0_c12_c12_0, u64: IccIar1El1, safe, fake::SYSREGS);
32005#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32006read_write_sysreg!(icc_igrpen0: (p15, 0, c12, c12, 6), u32: IccIgrpen0, safe_read, safe_write, fake::SYSREGS);
32007#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32008read_write_sysreg!(icc_igrpen0_el1: s3_0_c12_c12_6, u64: IccIgrpen0El1, safe_read, safe_write, fake::SYSREGS);
32009#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32010read_write_sysreg!(icc_igrpen1: (p15, 0, c12, c12, 7), u32: IccIgrpen1, safe_read, safe_write, fake::SYSREGS);
32011#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32012read_write_sysreg!(icc_igrpen1_el1: s3_0_c12_c12_7, u64: IccIgrpen1El1, safe_read, safe_write, fake::SYSREGS);
32013#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32014read_write_sysreg!(icc_igrpen1_el3: s3_6_c12_c12_7, u64: IccIgrpen1El3, safe_read, safe_write, fake::SYSREGS);
32015#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32016read_write_sysreg!(icc_mctlr: (p15, 6, c12, c12, 4), u32: IccMctlr, safe_read, safe_write, fake::SYSREGS);
32017#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32018read_write_sysreg!(icc_mgrpen1: (p15, 6, c12, c12, 7), u32: IccMgrpen1, safe_read, safe_write, fake::SYSREGS);
32019#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32020read_write_sysreg!(icc_msre: (p15, 6, c12, c12, 5), u32: IccMsre, safe_read, fake::SYSREGS);
32021#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32022read_sysreg!(icc_nmiar1_el1: s3_0_c12_c9_5, u64: IccNmiar1El1, safe, fake::SYSREGS);
32023#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32024read_write_sysreg!(icc_pmr: (p15, 0, c6, c4, 0), u32: IccPmr, safe_read, safe_write, fake::SYSREGS);
32025#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32026read_write_sysreg!(icc_pmr_el1: s3_0_c4_c6_0, u64: IccPmrEl1, safe_read, safe_write, fake::SYSREGS);
32027#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32028read_sysreg!(icc_rpr: (p15, 0, c11, c12, 3), u32: IccRpr, safe, fake::SYSREGS);
32029#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32030read_sysreg!(icc_rpr_el1: s3_0_c12_c11_3, u64: IccRprEl1, safe, fake::SYSREGS);
32031#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32032write_sysreg!(icc_sgi0r: (p15, 2, c12), u64: IccSgi0r, safe, fake::SYSREGS);
32033#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32034write_sysreg!(icc_sgi0r_el1: s3_0_c12_c11_7, u64: IccSgi0rEl1, safe, fake::SYSREGS);
32035#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32036write_sysreg!(icc_sgi1r: (p15, 0, c12), u64: IccSgi1r, safe, fake::SYSREGS);
32037#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32038write_sysreg!(icc_sgi1r_el1: s3_0_c12_c11_5, u64: IccSgi1rEl1, safe, fake::SYSREGS);
32039#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32040read_write_sysreg!(icc_sre: (p15, 0, c12, c12, 5), u32: IccSre, safe_read, fake::SYSREGS);
32041#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32042read_write_sysreg!(icc_sre_el1: s3_0_c12_c12_5, u64: IccSreEl1, safe_read, fake::SYSREGS);
32043#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32044read_write_sysreg!(icc_sre_el2: s3_4_c12_c9_5, u64: IccSreEl2, safe_read, fake::SYSREGS);
32045#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32046read_write_sysreg! {
32047    /// # Safety
32048    ///
32049    /// The SRE bit of `icc_sre_el3` must not be changed from 1 to 0, as this can result in unpredictable behaviour.
32050    icc_sre_el3: s3_6_c12_c12_5, u64: IccSreEl3, safe_read, fake::SYSREGS
32051}
32052#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32053read_write_sysreg!(ich_hcr_el2: s3_4_c12_c11_0, u64: IchHcrEl2, safe_read, fake::SYSREGS);
32054#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32055read_write_sysreg!(ich_vmcr_el2: s3_4_c12_c11_7, u64: IchVmcrEl2, safe_read, safe_write, fake::SYSREGS);
32056#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32057read_sysreg!(id_aa64dfr0_el1, u64: IdAa64dfr0El1, safe, fake::SYSREGS);
32058#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32059read_sysreg!(id_aa64dfr1_el1, u64: IdAa64dfr1El1, safe, fake::SYSREGS);
32060#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32061read_sysreg!(id_aa64isar1_el1, u64: IdAa64isar1El1, safe, fake::SYSREGS);
32062#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32063read_sysreg!(id_aa64isar2_el1, u64: IdAa64isar2El1, safe, fake::SYSREGS);
32064#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32065read_sysreg!(id_aa64mmfr0_el1, u64: IdAa64mmfr0El1, safe, fake::SYSREGS);
32066#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32067read_sysreg!(id_aa64mmfr1_el1, u64: IdAa64mmfr1El1, safe, fake::SYSREGS);
32068#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32069read_sysreg!(id_aa64mmfr2_el1, u64: IdAa64mmfr2El1, safe, fake::SYSREGS);
32070#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32071read_sysreg!(id_aa64mmfr3_el1, u64: IdAa64mmfr3El1, safe, fake::SYSREGS);
32072#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32073read_sysreg!(id_aa64pfr0_el1, u64: IdAa64pfr0El1, safe, fake::SYSREGS);
32074#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32075read_sysreg!(id_aa64pfr1_el1, u64: IdAa64pfr1El1, safe, fake::SYSREGS);
32076#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32077read_sysreg!(id_aa64smfr0_el1: s3_0_c0_c4_5, u64: IdAa64smfr0El1, safe, fake::SYSREGS);
32078#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32079read_sysreg!(id_afr0: (p15, 0, c1, c0, 3), u32, safe, fake::SYSREGS);
32080#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32081read_sysreg!(id_dfr0: (p15, 0, c1, c0, 2), u32: IdDfr0, safe, fake::SYSREGS);
32082#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32083read_sysreg!(id_dfr1: (p15, 0, c3, c0, 5), u32: IdDfr1, safe, fake::SYSREGS);
32084#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32085read_sysreg!(id_isar0: (p15, 0, c2, c0, 0), u32: IdIsar0, safe, fake::SYSREGS);
32086#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32087read_sysreg!(id_isar1: (p15, 0, c2, c0, 1), u32: IdIsar1, safe, fake::SYSREGS);
32088#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32089read_sysreg!(id_isar2: (p15, 0, c2, c0, 2), u32: IdIsar2, safe, fake::SYSREGS);
32090#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32091read_sysreg!(id_isar3: (p15, 0, c2, c0, 3), u32: IdIsar3, safe, fake::SYSREGS);
32092#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32093read_sysreg!(id_isar4: (p15, 0, c2, c0, 4), u32: IdIsar4, safe, fake::SYSREGS);
32094#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32095read_sysreg!(id_isar5: (p15, 0, c2, c0, 5), u32: IdIsar5, safe, fake::SYSREGS);
32096#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32097read_sysreg!(id_isar6: (p15, 0, c2, c0, 7), u32: IdIsar6, safe, fake::SYSREGS);
32098#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32099read_sysreg!(id_mmfr0: (p15, 0, c1, c0, 4), u32: IdMmfr0, safe, fake::SYSREGS);
32100#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32101read_sysreg!(id_mmfr1: (p15, 0, c1, c0, 5), u32: IdMmfr1, safe, fake::SYSREGS);
32102#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32103read_sysreg!(id_mmfr2: (p15, 0, c1, c0, 6), u32: IdMmfr2, safe, fake::SYSREGS);
32104#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32105read_sysreg!(id_mmfr3: (p15, 0, c1, c0, 7), u32: IdMmfr3, safe, fake::SYSREGS);
32106#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32107read_sysreg!(id_mmfr4: (p15, 0, c2, c0, 6), u32: IdMmfr4, safe, fake::SYSREGS);
32108#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32109read_sysreg!(id_mmfr5: (p15, 0, c3, c0, 6), u32: IdMmfr5, safe, fake::SYSREGS);
32110#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32111read_sysreg!(id_pfr0: (p15, 0, c1, c0, 0), u32: IdPfr0, safe, fake::SYSREGS);
32112#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32113read_sysreg!(id_pfr1: (p15, 0, c1, c0, 1), u32: IdPfr1, safe, fake::SYSREGS);
32114#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32115read_sysreg!(id_pfr2: (p15, 0, c3, c0, 4), u32: IdPfr2, safe, fake::SYSREGS);
32116#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32117read_write_sysreg!(ifar: (p15, 0, c0, c6, 2), u32: Ifar, safe_read, fake::SYSREGS);
32118#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32119read_write_sysreg!(ifsr: (p15, 0, c0, c5, 1), u32: Ifsr, safe_read, fake::SYSREGS);
32120#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32121read_sysreg!(isr: (p15, 0, c1, c12, 0), u32: Isr, safe, fake::SYSREGS);
32122#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32123read_sysreg!(isr_el1, u64: IsrEl1, safe, fake::SYSREGS);
32124#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32125read_sysreg!(jidr: (p14, 7, c0, c0, 0), u32, safe, fake::SYSREGS);
32126#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32127read_write_sysreg!(jmcr: (p14, 7, c0, c2, 0), u32, safe_read, fake::SYSREGS);
32128#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32129read_write_sysreg!(joscr: (p14, 7, c0, c1, 0), u32, safe_read, fake::SYSREGS);
32130#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32131read_write_sysreg!(mair0: (p15, 0, c2, c10, 0), u32: Mair0, safe_read, fake::SYSREGS);
32132#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32133read_write_sysreg!(mair1: (p15, 0, c2, c10, 1), u32: Mair1, safe_read, fake::SYSREGS);
32134#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32135read_write_sysreg!(mair_el1, u64: MairEl1, safe_read, fake::SYSREGS);
32136#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32137read_write_sysreg!(mair_el2, u64: MairEl2, safe_read, fake::SYSREGS);
32138#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32139read_write_sysreg! {
32140    /// # Safety
32141    ///
32142    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 memory attribute indirection register.
32143    mair_el3, u64: MairEl3, safe_read, fake::SYSREGS
32144}
32145#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32146read_write_sysreg!(mdccint_el1, u64: MdccintEl1, safe_read, safe_write, fake::SYSREGS);
32147#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32148read_write_sysreg!(mdcr_el2, u64: MdcrEl2, safe_read, safe_write, fake::SYSREGS);
32149#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32150read_write_sysreg!(mdcr_el3, u64: MdcrEl3, safe_read, safe_write, fake::SYSREGS);
32151#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32152read_write_sysreg!(mdscr_el1, u64: MdscrEl1, safe_read, safe_write, fake::SYSREGS);
32153#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32154read_sysreg!(midr: (p15, 0, c0, c0, 0), u32: Midr, safe, fake::SYSREGS);
32155#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32156read_sysreg!(midr_el1, u64: MidrEl1, safe, fake::SYSREGS);
32157#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32158read_write_sysreg!(mpam2_el2: s3_4_c10_c5_0, u64: Mpam2El2, safe_read, fake::SYSREGS);
32159#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32160read_write_sysreg!(mpam3_el3: s3_6_c10_c5_0, u64: Mpam3El3, safe_read, fake::SYSREGS);
32161#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32162read_write_sysreg!(mpamhcr_el2: s3_4_c10_c4_0, u64: MpamhcrEl2, safe_read, fake::SYSREGS);
32163#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32164read_sysreg!(mpamidr_el1: s3_0_c10_c4_4, u64: MpamidrEl1, safe, fake::SYSREGS);
32165#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32166read_write_sysreg!(mpamvpm0_el2: s3_4_c10_c6_0, u64: Mpamvpm0El2, safe_read, fake::SYSREGS);
32167#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32168read_write_sysreg!(mpamvpm1_el2: s3_4_c10_c6_1, u64: Mpamvpm1El2, safe_read, fake::SYSREGS);
32169#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32170read_write_sysreg!(mpamvpm2_el2: s3_4_c10_c6_2, u64: Mpamvpm2El2, safe_read, fake::SYSREGS);
32171#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32172read_write_sysreg!(mpamvpm3_el2: s3_4_c10_c6_3, u64: Mpamvpm3El2, safe_read, fake::SYSREGS);
32173#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32174read_write_sysreg!(mpamvpm4_el2: s3_4_c10_c6_4, u64: Mpamvpm4El2, safe_read, fake::SYSREGS);
32175#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32176read_write_sysreg!(mpamvpm5_el2: s3_4_c10_c6_5, u64: Mpamvpm5El2, safe_read, fake::SYSREGS);
32177#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32178read_write_sysreg!(mpamvpm6_el2: s3_4_c10_c6_6, u64: Mpamvpm6El2, safe_read, fake::SYSREGS);
32179#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32180read_write_sysreg!(mpamvpm7_el2: s3_4_c10_c6_7, u64: Mpamvpm7El2, safe_read, fake::SYSREGS);
32181#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32182read_write_sysreg!(mpamvpmv_el2: s3_4_c10_c4_1, u64: MpamvpmvEl2, safe_read, fake::SYSREGS);
32183#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32184read_sysreg!(mpidr: (p15, 0, c0, c0, 5), u32: Mpidr, safe, fake::SYSREGS);
32185#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32186read_sysreg!(mpidr_el1, u64: MpidrEl1, safe, fake::SYSREGS);
32187#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32188read_write_sysreg!(mvbar: (p15, 0, c0, c12, 1), u32: Mvbar, safe_read, fake::SYSREGS);
32189#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32190read_write_sysreg!(nmrr: (p15, 0, c2, c10, 1), u32: Nmrr, safe_read, fake::SYSREGS);
32191#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32192read_write_sysreg!(nsacr: (p15, 0, c1, c1, 2), u32: Nsacr, safe_read, fake::SYSREGS);
32193#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32194read_write_sysreg!(par: (p15, 0, c7), u64: Par, safe_read, fake::SYSREGS);
32195#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32196read_write_sysreg!(par_el1, u64: ParEl1, safe_read, fake::SYSREGS);
32197#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32198read_write_sysreg!(pmccfiltr: (p15, 0, c15, c14, 7), u32: Pmccfiltr, safe_read, fake::SYSREGS);
32199#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32200read_write_sysreg!(pmccntr: (p15, 0, c9), u64: Pmccntr, safe_read, fake::SYSREGS);
32201#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32202read_sysreg!(pmceid0: (p15, 0, c12, c9, 6), u32: Pmceid0, safe, fake::SYSREGS);
32203#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32204read_sysreg!(pmceid1: (p15, 0, c12, c9, 7), u32: Pmceid1, safe, fake::SYSREGS);
32205#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32206read_sysreg!(pmceid2: (p15, 0, c14, c9, 4), u32: Pmceid2, safe, fake::SYSREGS);
32207#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32208read_sysreg!(pmceid3: (p15, 0, c14, c9, 5), u32: Pmceid3, safe, fake::SYSREGS);
32209#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32210read_write_sysreg!(pmcntenclr: (p15, 0, c12, c9, 2), u32: Pmcntenclr, safe_read, fake::SYSREGS);
32211#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32212read_write_sysreg!(pmcntenset: (p15, 0, c12, c9, 1), u32: Pmcntenset, safe_read, fake::SYSREGS);
32213#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32214read_write_sysreg!(pmcr: (p15, 0, c12, c9, 0), u32: Pmcr, safe_read, fake::SYSREGS);
32215#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32216read_write_sysreg!(pmcr_el0: s3_3_c9_c12_0, u64: PmcrEl0, safe_read, safe_write, fake::SYSREGS);
32217#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32218read_write_sysreg!(pmintenclr: (p15, 0, c14, c9, 2), u32: Pmintenclr, safe_read, fake::SYSREGS);
32219#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32220read_write_sysreg!(pmintenset: (p15, 0, c14, c9, 1), u32: Pmintenset, safe_read, fake::SYSREGS);
32221#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32222read_sysreg!(pmmir: (p15, 0, c14, c9, 6), u32: Pmmir, safe, fake::SYSREGS);
32223#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32224read_write_sysreg!(pmovsr: (p15, 0, c12, c9, 3), u32: Pmovsr, safe_read, fake::SYSREGS);
32225#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32226read_write_sysreg!(pmovsset: (p15, 0, c14, c9, 3), u32: Pmovsset, safe_read, fake::SYSREGS);
32227#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32228read_write_sysreg!(pmselr: (p15, 0, c12, c9, 5), u32: Pmselr, safe_read, fake::SYSREGS);
32229#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32230write_sysreg!(pmswinc: (p15, 0, c12, c9, 4), u32: Pmswinc, fake::SYSREGS);
32231#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32232read_write_sysreg!(pmuserenr: (p15, 0, c14, c9, 0), u32: Pmuserenr, safe_read, fake::SYSREGS);
32233#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32234read_write_sysreg!(pmxevtyper: (p15, 0, c13, c9, 1), u32: Pmxevtyper, safe_read, fake::SYSREGS);
32235#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32236read_write_sysreg!(prrr: (p15, 0, c2, c10, 0), u32: Prrr, safe_read, fake::SYSREGS);
32237#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32238read_sysreg!(revidr: (p15, 0, c0, c0, 6), u32, safe, fake::SYSREGS);
32239#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32240read_write_sysreg!(rgsr_el1: s3_0_c1_c0_5, u64: RgsrEl1, safe_read, safe_write, fake::SYSREGS);
32241#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32242read_write_sysreg!(rmr: (p15, 0, c0, c12, 2), u32: Rmr, safe_read, fake::SYSREGS);
32243#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32244read_sysreg!(rvbar: (p15, 0, c0, c12, 1), u32: Rvbar, safe, fake::SYSREGS);
32245#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32246read_write_sysreg!(scr: (p15, 0, c1, c1, 0), u32: Scr, safe_read, fake::SYSREGS);
32247#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32248read_write_sysreg!(scr_el3, u64: ScrEl3, safe_read, fake::SYSREGS);
32249#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32250read_write_sysreg!(sctlr: (p15, 0, c0, c1, 0), u32: Sctlr, safe_read, fake::SYSREGS);
32251#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32252read_write_sysreg!(sctlr2_el3: s3_6_c1_c0_3, u64: Sctlr2El3, safe_read, fake::SYSREGS);
32253#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32254read_write_sysreg!(sctlr_el1, u64: SctlrEl1, safe_read, fake::SYSREGS);
32255#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32256read_write_sysreg!(sctlr_el2, u64: SctlrEl2, safe_read, fake::SYSREGS);
32257#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32258read_write_sysreg! {
32259    /// # Safety
32260    ///
32261    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 system control register.
32262    sctlr_el3, u64: SctlrEl3, safe_read, fake::SYSREGS
32263}
32264#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32265read_write_sysreg!(sdcr: (p15, 0, c3, c1, 1), u32: Sdcr, safe_read, fake::SYSREGS);
32266#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32267read_write_sysreg!(sder: (p15, 0, c1, c1, 1), u32: Sder, safe_read, fake::SYSREGS);
32268#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32269read_write_sysreg!(smcr_el3: s3_6_c1_c2_6, u64: SmcrEl3, safe_read, fake::SYSREGS);
32270#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32271read_write_sysreg!(spsr_el1, u64: SpsrEl1, safe_read, fake::SYSREGS);
32272#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32273read_write_sysreg!(spsr_el2, u64: SpsrEl2, safe_read, fake::SYSREGS);
32274#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32275read_write_sysreg!(spsr_el3, u64: SpsrEl3, safe_read, fake::SYSREGS);
32276#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32277read_write_sysreg!(sp_el1, u64: SpEl1, safe_read, fake::SYSREGS);
32278#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32279read_write_sysreg!(sp_el2, u64: SpEl2, safe_read, fake::SYSREGS);
32280#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32281read_write_sysreg!(svcr: s3_3_c4_c2_2, u64: Svcr, safe_read, fake::SYSREGS);
32282#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32283read_sysreg!(tcmtr: (p15, 0, c0, c0, 2), u32, safe, fake::SYSREGS);
32284#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32285read_write_sysreg!(tcr2_el1: s3_0_c2_c0_3, u64: Tcr2El1, safe_read, fake::SYSREGS);
32286#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32287read_write_sysreg!(tcr2_el2: s3_4_c2_c0_3, u64: Tcr2El2, safe_read, fake::SYSREGS);
32288#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32289read_write_sysreg!(tcr_el1, u64: TcrEl1, safe_read, fake::SYSREGS);
32290#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32291read_write_sysreg!(tcr_el2, u64: TcrEl2, safe_read, fake::SYSREGS);
32292#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32293read_write_sysreg! {
32294    /// # Safety
32295    ///
32296    /// The caller must ensure that `value` is a correct and safe configuration value for the EL3 translation control register.
32297    tcr_el3, u64: TcrEl3, safe_read, fake::SYSREGS
32298}
32299#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32300read_write_sysreg!(tfsre0_el1: s3_0_c5_c6_1, u64: Tfsre0El1, safe_read, safe_write, fake::SYSREGS);
32301#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32302read_write_sysreg!(tfsr_el1: s3_0_c5_c6_0, u64: TfsrEl1, safe_read, safe_write, fake::SYSREGS);
32303#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32304read_write_sysreg!(tfsr_el2: s3_4_c5_c6_0, u64: TfsrEl2, safe_read, safe_write, fake::SYSREGS);
32305#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32306read_sysreg!(tlbtr: (p15, 0, c0, c0, 3), u32: Tlbtr, safe, fake::SYSREGS);
32307#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32308read_write_sysreg!(tpidrprw: (p15, 0, c0, c13, 4), u32: Tpidrprw, safe_read, fake::SYSREGS);
32309#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32310read_write_sysreg!(tpidrro_el0, u64: TpidrroEl0, safe_read, fake::SYSREGS);
32311#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32312read_write_sysreg!(tpidruro: (p15, 0, c0, c13, 3), u32: Tpidruro, safe_read, fake::SYSREGS);
32313#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32314read_write_sysreg!(tpidrurw: (p15, 0, c0, c13, 2), u32: Tpidrurw, safe_read, fake::SYSREGS);
32315#[cfg(any(test, feature = "fakes", target_arch = "aarch64"))]
32316read_write_sysreg!(tpidr_el0, u64: TpidrEl0, safe_read, fake::SYSREGS);
32317#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32318read_write_sysreg!(tpidr_el1, u64: TpidrEl1, safe_read, fake::SYSREGS);
32319#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32320read_write_sysreg!(tpidr_el2, u64: TpidrEl2, safe_read, fake::SYSREGS);
32321#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32322read_write_sysreg!(tpidr_el3, u64: TpidrEl3, safe_read, fake::SYSREGS);
32323#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32324read_write_sysreg!(trfcr: (p15, 0, c2, c1, 1), u32: Trfcr, safe_read, fake::SYSREGS);
32325#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32326read_write_sysreg!(ttbcr: (p15, 0, c0, c2, 2), u32: Ttbcr, safe_read, fake::SYSREGS);
32327#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32328read_write_sysreg!(ttbcr2: (p15, 0, c0, c2, 3), u32: Ttbcr2, safe_read, fake::SYSREGS);
32329#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32330read_write_sysreg!(ttbr0: (p15, 0, c2), u64: Ttbr0, safe_read, fake::SYSREGS);
32331#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32332read_write_sysreg! {
32333    /// # Safety
32334    ///
32335    /// The base address must point to a valid and properly aligned translation table.
32336    ttbr0_el1, u64: Ttbr0El1, safe_read, fake::SYSREGS
32337}
32338#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32339read_write_sysreg! {
32340    /// # Safety
32341    ///
32342    /// The base address must point to a valid and properly aligned translation table.
32343    ttbr0_el2, u64: Ttbr0El2, safe_read, fake::SYSREGS
32344}
32345#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32346read_write_sysreg! {
32347    /// # Safety
32348    ///
32349    /// The base address must point to a valid and properly aligned translation table.
32350    ttbr0_el3, u64: Ttbr0El3, safe_read, fake::SYSREGS
32351}
32352#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32353read_write_sysreg!(ttbr1: (p15, 1, c2), u64: Ttbr1, safe_read, fake::SYSREGS);
32354#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32355read_write_sysreg! {
32356    /// # Safety
32357    ///
32358    /// The base address must point to a valid and properly aligned translation table.
32359    ttbr1_el1, u64: Ttbr1El1, safe_read, fake::SYSREGS
32360}
32361#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32362read_write_sysreg! {
32363    /// # Safety
32364    ///
32365    /// The base address must point to a valid and properly aligned translation table.
32366    ttbr1_el2: s3_4_c2_c0_1, u64: Ttbr1El2, safe_read, fake::SYSREGS
32367}
32368#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32369read_write_sysreg!(vbar: (p15, 0, c0, c12, 0), u32: Vbar, safe_read, fake::SYSREGS);
32370#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el1"))]
32371read_write_sysreg! {
32372    /// # Safety
32373    ///
32374    /// The base address must point to a valid exception vector.
32375    vbar_el1, u64: VbarEl1, safe_read, fake::SYSREGS
32376}
32377#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32378read_write_sysreg! {
32379    /// # Safety
32380    ///
32381    /// The base address must point to a valid exception vector.
32382    vbar_el2, u64: VbarEl2, safe_read, fake::SYSREGS
32383}
32384#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32385read_write_sysreg!(vdfsr: (p15, 4, c2, c5, 3), u32: Vdfsr, safe_read, fake::SYSREGS);
32386#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32387read_write_sysreg!(vdisr: (p15, 0, c1, c12, 1), u32: Vdisr, safe_read, fake::SYSREGS);
32388#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32389read_write_sysreg!(vdisr_el2: s3_4_c12_c1_1, u64: VdisrEl2, safe_read, safe_write, fake::SYSREGS);
32390#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32391read_write_sysreg!(vmpidr: (p15, 0, c0, c0, 5), u32: Vmpidr, safe_read, fake::SYSREGS);
32392#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32393read_write_sysreg!(vmpidr_el2, u64: VmpidrEl2, safe_read, safe_write, fake::SYSREGS);
32394#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32395read_write_sysreg!(vpidr: (p15, 0, c0, c0, 0), u32: Vpidr, safe_read, fake::SYSREGS);
32396#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32397read_write_sysreg!(vpidr_el2, u64: VpidrEl2, safe_read, safe_write, fake::SYSREGS);
32398#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32399read_write_sysreg!(vsesr_el2: s3_4_c5_c2_3, u64: VsesrEl2, safe_read, safe_write, fake::SYSREGS);
32400#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32401read_write_sysreg!(vtcr: (p15, 4, c1, c2, 2), u32: Vtcr, safe_read, fake::SYSREGS);
32402#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32403read_write_sysreg!(vtcr_el2, u64: VtcrEl2, safe_read, fake::SYSREGS);
32404#[cfg(any(test, feature = "fakes", target_arch = "arm"))]
32405read_write_sysreg!(vttbr: (p15, 6, c2), u64: Vttbr, safe_read, fake::SYSREGS);
32406#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el2"))]
32407read_write_sysreg! {
32408    /// # Safety
32409    ///
32410    /// The base address must point to a valid and properly aligned stage 2 translation table.
32411    vttbr_el2, u64: VttbrEl2, safe_read, fake::SYSREGS
32412}
32413#[cfg(all(any(test, feature = "fakes", target_arch = "aarch64"), feature = "el3"))]
32414read_write_sysreg!(zcr_el3: s3_6_c1_c2_0, u64: ZcrEl3, safe_read, fake::SYSREGS);