fix(ld_so): getting TP on linux
`ARCH_GET_FS` is x86_64 specific. On aarch64 it is not platform specific and just need to read out the TP from `TPIDR_EL0` Signed-off-by: Anhad Singh <andypython@protonmail.com>
This commit is contained in:
+2
-2
@@ -139,14 +139,14 @@ pub unsafe fn init(
|
||||
) {
|
||||
let tp: usize;
|
||||
|
||||
#[cfg(target_os = "linux")]
|
||||
#[cfg(all(target_os = "linux", target_arch = "x86_64"))]
|
||||
{
|
||||
const ARCH_GET_FS: usize = 0x1003;
|
||||
let mut val = 0usize;
|
||||
syscall!(ARCH_PRCTL, ARCH_GET_FS, &mut val as *mut usize);
|
||||
tp = val;
|
||||
}
|
||||
#[cfg(all(target_os = "redox", target_arch = "aarch64"))]
|
||||
#[cfg(target_arch = "aarch64")]
|
||||
unsafe {
|
||||
core::arch::asm!(
|
||||
"mrs {}, tpidr_el0",
|
||||
|
||||
Reference in New Issue
Block a user