Skip to content

Commit

Permalink
Update syscalls.c
Browse files Browse the repository at this point in the history
  • Loading branch information
math-gout authored Mar 3, 2025
1 parent cc8f9d3 commit f8b871a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions verif/tests/custom/common/syscalls.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit f8b871a

Please sign in to comment.