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:
Anhad Singh
2025-12-01 14:25:55 +11:00
parent 35a10eb940
commit 6262c4ae50
+2 -2
View File
@@ -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",