cortex_a/registers/sp_el1.rs
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
8//! The stack pointer - EL1
9//!
10//! Holds the stack pointer associated with EL1. When executing at EL1, the value of SPSel.SP
11//! determines the current stack pointer:
12//!
13//! SPSel.SP | current stack pointer
14//! --------------------------------
15//! 0 | SP_EL0
16//! 1 | SP_EL1
17
18use tock_registers::interfaces::{Readable, Writeable};
19
20pub struct Reg;
21
22impl Readable for Reg {
23 type T = u64;
24 type R = ();
25
26 sys_coproc_read_raw!(u64, "SP_EL1", "x");
27}
28
29impl Writeable for Reg {
30 type T = u64;
31 type R = ();
32
33 sys_coproc_write_raw!(u64, "SP_EL1", "x");
34}
35
36pub const SP_EL1: Reg = Reg {};