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

Commit f1688b7

Browse files
Javier-varezandre-richter
authored andcommitted
Add VBAR_EL2 register
1 parent 50e1b16 commit f1688b7

File tree

2 files changed

+33
-0
lines changed

2 files changed

+33
-0
lines changed

src/registers.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ mod ttbr0_el1;
5454
mod ttbr0_el2;
5555
mod ttbr1_el1;
5656
mod vbar_el1;
57+
mod vbar_el2;
5758

5859
pub use cntfrq_el0::CNTFRQ_EL0;
5960
pub use cnthctl_el2::CNTHCTL_EL2;
@@ -103,3 +104,4 @@ pub use ttbr0_el1::TTBR0_EL1;
103104
pub use ttbr0_el2::TTBR0_EL2;
104105
pub use ttbr1_el1::TTBR1_EL1;
105106
pub use vbar_el1::VBAR_EL1;
107+
pub use vbar_el2::VBAR_EL2;

src/registers/vbar_el2.rs

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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+
//! Vector Base Address Register - EL2
10+
//!
11+
//! Holds the vector base address for any exception that is taken to EL2.
12+
13+
use tock_registers::interfaces::{Readable, Writeable};
14+
15+
pub struct Reg;
16+
17+
impl Readable for Reg {
18+
type T = u64;
19+
type R = ();
20+
21+
sys_coproc_read_raw!(u64, "VBAR_EL2", "x");
22+
}
23+
24+
impl Writeable for Reg {
25+
type T = u64;
26+
type R = ();
27+
28+
sys_coproc_write_raw!(u64, "VBAR_EL2", "x");
29+
}
30+
31+
pub const VBAR_EL2: Reg = Reg {};

0 commit comments

Comments
 (0)