Skip to content

Commit 5f1f194

Browse files
authored
Merge pull request #57 from kisum9/add-auxiliary-faults-register
Add auxiliary faults register
2 parents 71723e8 + 60806fe commit 5f1f194

File tree

3 files changed

+64
-0
lines changed

3 files changed

+64
-0
lines changed

src/registers.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@ mod macros;
88
mod actlr_el1;
99
mod actlr_el2;
1010
mod actlr_el3;
11+
mod afsr0_el1;
12+
mod afsr1_el1;
1113
mod amair_el1;
1214
mod apdakeyhi_el1;
1315
mod apdakeylo_el1;
@@ -149,6 +151,8 @@ mod vttbr_el2;
149151
pub use actlr_el1::ACTLR_EL1;
150152
pub use actlr_el2::ACTLR_EL2;
151153
pub use actlr_el3::ACTLR_EL3;
154+
pub use afsr0_el1::AFSR0_EL1;
155+
pub use afsr1_el1::AFSR1_EL1;
152156
pub use amair_el1::AMAIR_EL1;
153157
pub use apdakeyhi_el1::APDAKEYHI_EL1;
154158
pub use apdakeylo_el1::APDAKEYLO_EL1;

src/registers/afsr0_el1.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// SPDX-License-Identifier: Apache-2.0 OR MIT
2+
//
3+
// Copyright (c) 2025 by the author(s)
4+
//
5+
// Author(s):
6+
// - Yan Tan <[email protected]>
7+
8+
//! Auxiliary Fault Status Register 0 - EL1
9+
//!
10+
//! Provides IMPLEMENTATION DEFINED fault status information for synchronous aborts that are taken to EL1.
11+
12+
use tock_registers::interfaces::{Readable, Writeable};
13+
14+
pub struct Reg;
15+
16+
impl Readable for Reg {
17+
type T = u64;
18+
type R = ();
19+
20+
sys_coproc_read_raw!(u64, "S3_0_C5_C1_0", "x");
21+
}
22+
23+
impl Writeable for Reg {
24+
type T = u64;
25+
type R = ();
26+
27+
sys_coproc_write_raw!(u64, "S3_0_C5_C1_0", "x");
28+
}
29+
30+
pub const AFSR0_EL1: Reg = Reg {};

src/registers/afsr1_el1.rs

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// SPDX-License-Identifier: Apache-2.0 OR MIT
2+
//
3+
// Copyright (c) 2025 by the author(s)
4+
//
5+
// Author(s):
6+
// - Yan Tan <[email protected]>
7+
8+
//! Auxiliary Fault Status Register 1 - EL1
9+
//!
10+
//! Provides IMPLEMENTATION DEFINED fault status information for synchronous aborts that are taken to EL1.
11+
12+
use tock_registers::interfaces::{Readable, Writeable};
13+
14+
pub struct Reg;
15+
16+
impl Readable for Reg {
17+
type T = u64;
18+
type R = ();
19+
20+
sys_coproc_read_raw!(u64, "S3_0_C5_C1_1", "x");
21+
}
22+
23+
impl Writeable for Reg {
24+
type T = u64;
25+
type R = ();
26+
27+
sys_coproc_write_raw!(u64, "S3_0_C5_C1_1", "x");
28+
}
29+
30+
pub const AFSR1_EL1: Reg = Reg {};

0 commit comments

Comments
 (0)