Skip to content
This repository was archived by the owner on Nov 7, 2022. It is now read-only.

Commit ef805f3

Browse files
Javier-varezandre-richter
authored andcommitted
Add OSLAR_EL1 register
1 parent de9ff59 commit ef805f3

File tree

2 files changed

+50
-0
lines changed

2 files changed

+50
-0
lines changed

src/registers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ mod mair_el1;
3232
mod mair_el2;
3333
mod midr_el1;
3434
mod mpidr_el1;
35+
mod oslar_el1;
3536
mod par_el1;
3637
mod scr_el3;
3738
mod sctlr_el1;
@@ -79,6 +80,7 @@ pub use mair_el1::MAIR_EL1;
7980
pub use mair_el2::MAIR_EL2;
8081
pub use midr_el1::MIDR_EL1;
8182
pub use mpidr_el1::MPIDR_EL1;
83+
pub use oslar_el1::OSLAR_EL1;
8284
pub use par_el1::PAR_EL1;
8385
pub use scr_el3::SCR_EL3;
8486
pub use sctlr_el1::SCTLR_EL1;

src/registers/oslar_el1.rs

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// SPDX-License-Identifier: Apache-2.0 OR MIT
2+
//
3+
// Copyright (c) 2018-2022 by the author(s)
4+
//
5+
// Author(s):
6+
// - Andre Richter <andre.o.richter@gmail.com>
7+
// - Javier Alvarez <javier.alvarez@allthingsembedded.net>
8+
9+
//! OS Lock Access Register
10+
//!
11+
//! Used to lock or unlock the OS Lock.
12+
//!
13+
//! AArch64 System register OSLAR_EL1 bits [31:0] are architecturally mapped to External register
14+
//! OSLAR_EL1[31:0]. The OS Lock can also be locked or unlocked using DBGOSLAR.
15+
16+
use tock_registers::{
17+
interfaces::{Readable, Writeable},
18+
register_bitfields,
19+
};
20+
21+
register_bitfields! {u64,
22+
pub OSLAR_EL1 [
23+
/// On writes to OSLAR_EL1, bit[0] is copied to the OS Lock.
24+
/// Use OSLSR_EL1.OSLK to check the current status of the lock.
25+
OSLK OFFSET(0) NUMBITS(1) [
26+
Unlocked = 0,
27+
Locked = 1
28+
]
29+
]
30+
}
31+
32+
pub struct Reg;
33+
34+
impl Readable for Reg {
35+
type T = u64;
36+
type R = OSLAR_EL1::Register;
37+
38+
sys_coproc_read_raw!(u64, "OSLAR_EL1", "x");
39+
}
40+
41+
impl Writeable for Reg {
42+
type T = u64;
43+
type R = OSLAR_EL1::Register;
44+
45+
sys_coproc_write_raw!(u64, "OSLAR_EL1", "x");
46+
}
47+
48+
pub const OSLAR_EL1: Reg = Reg {};

0 commit comments

Comments
 (0)