Correct instruction to read aarch64 thread pointer

This commit is contained in:
Jeremy Soller
2022-08-25 18:58:12 -06:00
parent 58ceae44e7
commit b0d3e5b154
+4 -11
View File
@@ -146,17 +146,10 @@ pub unsafe fn init(sp: &'static Stack) {
}
#[cfg(all(target_os = "redox", target_arch = "aarch64"))]
{
let mut env = syscall::EnvRegisters::default();
let file = syscall::open("thisproc:current/regs/env", syscall::O_CLOEXEC | syscall::O_RDONLY)
.expect_notls("failed to open handle for process registers");
let _ = syscall::read(file, &mut env)
.expect_notls("failed to read tpidr_el0");
let _ = syscall::close(file);
tp = env.tpidr_el0;
core::arch::asm!(
"mrs {}, tpidr_el0",
out(reg) tp,
);
}
#[cfg(all(target_os = "redox", target_arch = "x86"))]
{