From f8b871a3d8d39ae1e65567173a75cdf469f5d114 Mon Sep 17 00:00:00 2001 From: Mathieu Gouttenoire Date: Mon, 3 Mar 2025 10:55:02 +0100 Subject: [PATCH] Update syscalls.c --- verif/tests/custom/common/syscalls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/verif/tests/custom/common/syscalls.c b/verif/tests/custom/common/syscalls.c index 04995b61f6..045f35c4d1 100644 --- a/verif/tests/custom/common/syscalls.c +++ b/verif/tests/custom/common/syscalls.c @@ -15,6 +15,8 @@ extern volatile uint64_t tohost; extern volatile uint64_t fromhost; +register void *thread_pointer asm("tp"); + // tohost is 64 bits wide, irrespective of XLEN. The structure expected in Spike is: // - tohost[63:56] == device (syscall: 0) // - tohost[55:48] == command (syscall: 0) @@ -134,8 +136,6 @@ int __attribute__((weak)) main(int argc, char** argv) static void init_tls() { - register void *thread_pointer; - asm("mv %0, tp" : "=r"(thread_pointer)); extern char _tdata_begin, _tdata_end, _tbss_end; size_t tdata_size = &_tdata_end - &_tdata_begin; memcpy(thread_pointer, &_tdata_begin, tdata_size);