Skip to main content

libarch/arm64/
memory.rs

1// Copyright 2026 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use bitrs::layout;
6use regio::arm64::{SysReg, spec};
7
8/// [arm/v8]: D13.2.95  MAIR_EL1, Memory Attribute Indirection Register, EL1
9pub const MAIR_EL1: SysReg<spec::MAIR_EL1, MemoryAttrIndirectionRegister> = SysReg::new();
10
11/// [arm/v8]: D13.2.96  MAIR_EL2, Memory Attribute Indirection Register, EL2
12pub const MAIR_EL2: SysReg<spec::MAIR_EL2, MemoryAttrIndirectionRegister> = SysReg::new();
13
14layout!({
15    /// The layout of [`MAIR_EL1`] and [`MAIR_EL2`].
16    pub struct MemoryAttrIndirectionRegister(u64);
17    {
18        let attr7 @ 63..56;
19        let attr6 @ 55..48;
20        let attr5 @ 47..40;
21        let attr4 @ 39..32;
22        let attr3 @ 31..24;
23        let attr2 @ 23..16;
24        let attr1 @ 15..8;
25        let attr0 @ 7..0;
26    }
27});