Skip to main content

aarch32_cpu/register/
dccmvac.rs

1//! Code for managing DCCMVAC (*Data Cache line Clean by VA to PoC Register*)
2
3use crate::register::{SysReg, SysRegWrite};
4
5#[derive(Debug, Copy, Clone)]
6#[cfg_attr(feature = "defmt", derive(defmt::Format))]
7#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
8/// DCCMVAC (*Data Cache line Clean by VA to PoC Register*)
9pub struct Dccmvac(pub u32);
10
11impl Dccmvac {
12    #[inline]
13    /// Create a new DCCMVAC containing the Virtual Address to clean
14    pub const fn new(addr: u32) -> Self {
15        Self(addr)
16    }
17}
18
19impl SysReg for Dccmvac {
20    const CP: u32 = 15;
21    const CRN: u32 = 7;
22    const OP1: u32 = 0;
23    const CRM: u32 = 10;
24    const OP2: u32 = 1;
25}
26
27impl crate::register::SysRegWrite for Dccmvac {}
28
29impl Dccmvac {
30    #[inline]
31    /// Writes DCCMVAC (*Data Cache line Clean by VA to PoC Register*)
32    ///
33    /// # Safety
34    ///
35    /// Ensure that this value is appropriate for this register. Generally, the address passed
36    /// to the write call should be aligned to the cache line size.
37    pub unsafe fn write(value: Self) {
38        unsafe {
39            <Self as SysRegWrite>::write_raw(value.0);
40        }
41    }
42}