summaryrefslogtreecommitdiffstats
path: root/vendor/redox_syscall/src/arch/aarch64.rs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-18 02:49:50 +0000
commit9835e2ae736235810b4ea1c162ca5e65c547e770 (patch)
tree3fcebf40ed70e581d776a8a4c65923e8ec20e026 /vendor/redox_syscall/src/arch/aarch64.rs
parentReleasing progress-linux version 1.70.0+dfsg2-1~progress7.99u1. (diff)
downloadrustc-9835e2ae736235810b4ea1c162ca5e65c547e770.tar.xz
rustc-9835e2ae736235810b4ea1c162ca5e65c547e770.zip
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/redox_syscall/src/arch/aarch64.rs')
-rw-r--r--vendor/redox_syscall/src/arch/aarch64.rs32
1 files changed, 25 insertions, 7 deletions
diff --git a/vendor/redox_syscall/src/arch/aarch64.rs b/vendor/redox_syscall/src/arch/aarch64.rs
index e771396e3..e792427cf 100644
--- a/vendor/redox_syscall/src/arch/aarch64.rs
+++ b/vendor/redox_syscall/src/arch/aarch64.rs
@@ -3,6 +3,8 @@ use core::ops::{Deref, DerefMut};
use super::error::{Error, Result};
+pub const PAGE_SIZE: usize = 4096;
+
macro_rules! syscall {
($($name:ident($a:ident, $($b:ident, $($c:ident, $($d:ident, $($e:ident, $($f:ident, )?)?)?)?)?);)+) => {
$(
@@ -49,13 +51,6 @@ syscall! {
#[derive(Copy, Clone, Debug, Default)]
#[repr(C)]
pub struct IntRegisters {
- pub elr_el1: usize,
- pub tpidr_el0: usize,
- pub tpidrro_el0: usize,
- pub spsr_el1: usize,
- pub esr_el1: usize,
- pub sp_el0: usize, // Shouldn't be used if interrupt occurred at EL1
- pub padding: usize, // To keep the struct even number aligned
pub x30: usize,
pub x29: usize,
pub x28: usize,
@@ -130,3 +125,26 @@ impl DerefMut for FloatRegisters {
}
}
}
+
+#[derive(Clone, Copy, Debug, Default)]
+#[repr(packed)]
+pub struct EnvRegisters {
+ pub tpidr_el0: usize,
+ pub tpidrro_el0: usize,
+}
+impl Deref for EnvRegisters {
+ type Target = [u8];
+ fn deref(&self) -> &[u8] {
+ unsafe {
+ slice::from_raw_parts(self as *const EnvRegisters as *const u8, mem::size_of::<EnvRegisters>())
+ }
+ }
+}
+
+impl DerefMut for EnvRegisters {
+ fn deref_mut(&mut self) -> &mut [u8] {
+ unsafe {
+ slice::from_raw_parts_mut(self as *mut EnvRegisters as *mut u8, mem::size_of::<EnvRegisters>())
+ }
+ }
+}