Fix access to tp register for LLVM in syscalls.c (#2791)

The old syntax for accessing the tp register was not recognised by LLVM.

---------

Co-authored-by: JeanRochCoulon <jean-roch.coulon@thalesgroup.com>
This commit is contained in:
Mathieu Gouttenoire 2025-05-23 12:18:40 +01:00 committed by GitHub
parent 0631cfba28
commit 86ad99fda5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 4 additions and 3 deletions

View file

@ -23,8 +23,8 @@ valid_cycles = {
"dhrystone_single": 22407,
"coremark_dual": 981777,
"coremark_single": 1294524,
"dhrystone_cv32a65x": 30056,
"dhrystone_cv32a60x": 37474,
"dhrystone_cv32a65x": 28825,
"dhrystone_cv32a60x": 36631,
}
for arg in sys.argv[1:]:

View file

@ -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,7 +136,6 @@ int __attribute__((weak)) main(int argc, char** argv)
static void init_tls()
{
register void* thread_pointer asm("tp");
extern char _tdata_begin, _tdata_end, _tbss_end;
size_t tdata_size = &_tdata_end - &_tdata_begin;
memcpy(thread_pointer, &_tdata_begin, tdata_size);