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

Commit 97b7a42

Browse files
committed
Add CNTP_CVAL_EL0
1 parent 0bbd3d4 commit 97b7a42

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
@@ -14,6 +14,7 @@ mod clidr_el1;
1414
mod cntfrq_el0;
1515
mod cnthctl_el2;
1616
mod cntp_ctl_el0;
17+
mod cntp_cval_el0;
1718
mod cntp_tval_el0;
1819
mod cntpct_el0;
1920
mod cntv_ctl_el0;
@@ -77,6 +78,7 @@ pub use clidr_el1::CLIDR_EL1;
7778
pub use cntfrq_el0::CNTFRQ_EL0;
7879
pub use cnthctl_el2::CNTHCTL_EL2;
7980
pub use cntp_ctl_el0::CNTP_CTL_EL0;
81+
pub use cntp_cval_el0::CNTP_CVAL_EL0;
8082
pub use cntp_tval_el0::CNTP_TVAL_EL0;
8183
pub use cntpct_el0::CNTPCT_EL0;
8284
pub use cntv_ctl_el0::CNTV_CTL_EL0;

src/registers/cntp_cval_el0.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 <[email protected]>
7+
8+
//! Counter-timer Physical Timer CompareValue register - EL0
9+
//!
10+
//! Holds the compare value for the EL1 physical timer.
11+
//!
12+
//! When CNTP_CTL_EL0.ENABLE is 1, the timer condition is met when (CNTPCT_EL0 - CompareValue) is
13+
//! greater than or equal to zero. This means that CompareValue acts like a 64-bit upcounter timer.
14+
//!
15+
//! When the timer condition is met:
16+
//! - CNTP_CTL_EL0.ISTATUS is set to 1.
17+
//! - If CNTP_CTL_EL0.IMASK is 0, an interrupt is generated.
18+
//!
19+
//! When CNTP_CTL_EL0.ENABLE is 0, the timer condition is not met, but CNTPCT_EL0 continues to
20+
//! count.
21+
//!
22+
//! If the Generic counter is implemented at a size less than 64 bits, then this field is permitted
23+
//! to be implemented at the same width as the counter, and the upper bits are RES0.
24+
//!
25+
//! The value of this field is treated as zero-extended in all counter calculations.
26+
//!
27+
//! The reset behaviour of this field is:
28+
//! - On a Warm reset, this field resets to an architecturally UNKNOWN value.
29+
30+
use tock_registers::interfaces::{Readable, Writeable};
31+
32+
pub struct Reg;
33+
34+
impl Readable for Reg {
35+
type T = u64;
36+
type R = ();
37+
38+
sys_coproc_read_raw!(u64, "CNTP_CVAL_EL0", "x");
39+
}
40+
41+
impl Writeable for Reg {
42+
type T = u64;
43+
type R = ();
44+
45+
sys_coproc_write_raw!(u64, "CNTP_CVAL_EL0", "x");
46+
}
47+
48+
pub const CNTP_CVAL_EL0: Reg = Reg {};

0 commit comments

Comments
 (0)