Skip to content

Commit b542a14

Browse files
committed
Use symbolic constant for __NR_set_thread_area
Magic numbers... Now using the proper constant from linux_raw_sys like civilized folk.
1 parent 4d4e2cf commit b542a14

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/arch/mips32.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ use linux_raw_sys::general::{__NR_mprotect, PROT_READ};
1515
#[cfg(feature = "thread")]
1616
use {
1717
core::ffi::c_void,
18-
linux_raw_sys::general::{__NR_clone, __NR_exit, __NR_munmap},
18+
linux_raw_sys::general::{__NR_clone, __NR_exit, __NR_munmap, __NR_set_thread_area},
1919
rustix::thread::RawPid,
2020
};
2121

@@ -338,9 +338,10 @@ pub(super) unsafe fn set_thread_pointer(ptr: *mut c_void) {
338338
asm!(
339339
"move $a0, {0}",
340340
".set noreorder",
341-
"li $v0, 4283", // __NR_set_thread_area
341+
"li $v0, {__NR_set_thread_area}",
342342
"syscall",
343343
".set reorder",
344+
__NR_set_thread_area = const __NR_set_thread_area,
344345
in(reg) ptr,
345346
out("$v0") _,
346347
out("$a0") _,

0 commit comments

Comments
 (0)