aarch32_cpu/register/
ccsidr.rs1use crate::register::{SysReg, SysRegRead};
4use arbitrary_int::{u10, u15, u3};
5
6#[bitbybit::bitfield(u32, debug, defmt_bitfields(feature = "defmt"))]
8#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
9pub struct Ccsidr {
10 #[bit(31, rw)]
12 write_through: bool,
13 #[bit(30, rw)]
15 write_back: bool,
16 #[bit(29, rw)]
18 read_alloc: bool,
19 #[bit(28, rw)]
21 write_alloc: bool,
22 #[bits(13..=27, rw)]
24 num_sets: u15,
25 #[bits(3..=12, rw)]
27 associativity: u10,
28 #[bits(0..=2, rw)]
30 line_size: u3,
31}
32
33impl SysReg for Ccsidr {
34 const CP: u32 = 15;
35 const CRN: u32 = 0;
36 const OP1: u32 = 1;
37 const CRM: u32 = 0;
38 const OP2: u32 = 0;
39}
40
41impl crate::register::SysRegRead for Ccsidr {}
42
43impl Ccsidr {
44 #[inline]
45 pub fn read() -> Ccsidr {
47 Self::new_with_raw_value(<Self as SysRegRead>::read_raw())
48 }
49}