-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from islet-project/main
Add multiple registers and update fields
- Loading branch information
Showing
47 changed files
with
1,619 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Counter-timer Physical Offset register - EL2 | ||
//! | ||
//! Holds the 64-bit physical offset. | ||
//! This is the offset for the AArch64 physical timers and counters | ||
//! when Enhanced Counter Virtualization is enabled. | ||
use tock_registers::interfaces::{Readable, Writeable}; | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = (); | ||
|
||
sys_coproc_read_raw!(u64, "CNTPOFF_EL2", "x"); | ||
} | ||
|
||
impl Writeable for Reg { | ||
type T = u64; | ||
type R = (); | ||
|
||
sys_coproc_write_raw!(u64, "CNTPOFF_EL2", "x"); | ||
} | ||
|
||
pub const CNTPOFF_EL2: Reg = Reg {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Architectural Feature Trap Register - EL2 | ||
//! | ||
//! Controls trapping to EL2 of accesses to CPACR, CPACR_EL1, trace, Activity Monitor, SME, | ||
//! Streaming SVE, SVE, and Advanced SIMD and floating-point functionality. | ||
use tock_registers::{ | ||
interfaces::{Readable, Writeable}, | ||
register_bitfields, | ||
}; | ||
|
||
register_bitfields! {u64, | ||
pub CPTR_EL2 [ | ||
/// Trap Activity Monitor access. Traps EL1 and EL0 accesses to all Activity Monitor | ||
/// registers to EL2. | ||
/// | ||
/// 0 Accesses from EL1 and EL0 to Activity Monitor registers are not trapped. | ||
/// | ||
/// 1 Accesses from EL1 and EL0 to Activity Monitor registers are trapped to EL2, | ||
/// when EL2 is enabled in the current Security state. | ||
TAM OFFSET(30) NUMBITS(1) [], | ||
] | ||
} | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = CPTR_EL2::Register; | ||
|
||
sys_coproc_read_raw!(u64, "CPTR_EL2", "x"); | ||
} | ||
|
||
impl Writeable for Reg { | ||
type T = u64; | ||
type R = CPTR_EL2::Register; | ||
|
||
sys_coproc_write_raw!(u64, "CPTR_EL2", "x"); | ||
} | ||
|
||
pub const CPTR_EL2: Reg = Reg {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Hypervisor IPA Fault Address Register - EL2 | ||
//! | ||
//! Holds the faulting IPA for some aborts on a stage 2 translation taken to EL2. | ||
use tock_registers::{interfaces::Readable, register_bitfields}; | ||
|
||
register_bitfields! {u64, | ||
pub HPFAR_EL2 [ | ||
/// Faulting IPA address space. | ||
NS OFFSET(63) NUMBITS(1) [], | ||
|
||
/// Faulting Intermediate Physical Address. | ||
FIPA OFFSET(4) NUMBITS(48) [] | ||
] | ||
} | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = HPFAR_EL2::Register; | ||
|
||
sys_coproc_read_raw!(u64, "HPFAR_EL2", "x"); | ||
} | ||
|
||
pub const HPFAR_EL2: Reg = Reg {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// Copyright (c) 2024 by the author(s) | ||
// | ||
// Author(s): | ||
// - Sangwan Kwon <sangwan.kwon@samsung.com> | ||
|
||
//! Interrupt Controller Control Register - EL1 | ||
//! | ||
//! Controls aspects of the behavior of the GIC CPU interface and provides information | ||
//! about the features implemented. | ||
use tock_registers::{interfaces::Readable, register_bitfields}; | ||
|
||
register_bitfields! {u64, | ||
pub ICC_CTLR_EL1 [ | ||
/// Extended INTID range (read-only). | ||
ExtRange OFFSET(19) NUMBITS(1) [], | ||
] | ||
} | ||
|
||
pub struct Reg; | ||
|
||
impl Readable for Reg { | ||
type T = u64; | ||
type R = ICC_CTLR_EL1::Register; | ||
|
||
sys_coproc_read_raw!(u64, "ICC_CTLR_EL1", "x"); | ||
} | ||
|
||
pub const ICC_CTLR_EL1: Reg = Reg {}; |
Oops, something went wrong.