mirror of
https://github.com/openhwgroup/cva6.git
synced 2025-06-28 01:06:16 -04:00
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:
parent
0631cfba28
commit
86ad99fda5
2 changed files with 4 additions and 3 deletions
|
@ -23,8 +23,8 @@ valid_cycles = {
|
||||||
"dhrystone_single": 22407,
|
"dhrystone_single": 22407,
|
||||||
"coremark_dual": 981777,
|
"coremark_dual": 981777,
|
||||||
"coremark_single": 1294524,
|
"coremark_single": 1294524,
|
||||||
"dhrystone_cv32a65x": 30056,
|
"dhrystone_cv32a65x": 28825,
|
||||||
"dhrystone_cv32a60x": 37474,
|
"dhrystone_cv32a60x": 36631,
|
||||||
}
|
}
|
||||||
|
|
||||||
for arg in sys.argv[1:]:
|
for arg in sys.argv[1:]:
|
||||||
|
|
|
@ -15,6 +15,8 @@
|
||||||
extern volatile uint64_t tohost;
|
extern volatile uint64_t tohost;
|
||||||
extern volatile uint64_t fromhost;
|
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 is 64 bits wide, irrespective of XLEN. The structure expected in Spike is:
|
||||||
// - tohost[63:56] == device (syscall: 0)
|
// - tohost[63:56] == device (syscall: 0)
|
||||||
// - tohost[55:48] == command (syscall: 0)
|
// - tohost[55:48] == command (syscall: 0)
|
||||||
|
@ -134,7 +136,6 @@ int __attribute__((weak)) main(int argc, char** argv)
|
||||||
|
|
||||||
static void init_tls()
|
static void init_tls()
|
||||||
{
|
{
|
||||||
register void* thread_pointer asm("tp");
|
|
||||||
extern char _tdata_begin, _tdata_end, _tbss_end;
|
extern char _tdata_begin, _tdata_end, _tbss_end;
|
||||||
size_t tdata_size = &_tdata_end - &_tdata_begin;
|
size_t tdata_size = &_tdata_end - &_tdata_begin;
|
||||||
memcpy(thread_pointer, &_tdata_begin, tdata_size);
|
memcpy(thread_pointer, &_tdata_begin, tdata_size);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue