libroot/riscv64: minor riscv64 fixes

Change-Id: I96b604aabe18307d7376473b8d9cd50eccb537d1
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4709
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
This commit is contained in:
X512 2021-11-09 16:26:26 -06:00 committed by Alex von Gluck IV
parent 5070f59750
commit ec8a8f1c02
4 changed files with 31 additions and 0 deletions

View File

@ -22,6 +22,8 @@ for architectureObject in [ MultiArchSubDirSetup riscv64 ] {
time.cpp
thread.cpp
cachectl.cpp
generic_atomic.cpp
generic_stack_trace.cpp
generic_system_time_nsecs.cpp

View File

@ -0,0 +1,11 @@
/*
* Copyright 2021, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
extern "C" void
__riscv_flush_icache(void *start, void *end, unsigned long int flags)
{
__asm__ volatile ("fence.i");
}

View File

@ -32,6 +32,7 @@ for architectureObject in [ MultiArchSubDirSetup ] {
l64a.c
lcong48.c
lcong48_r.c
longlong.c
lrand48.c
lrand48_r.c
mrand48.c

View File

@ -0,0 +1,17 @@
/*
* Copyright 2021, Haiku, Inc.
* Distributed under the terms of the MIT License.
*/
const char __clz_tab[256] =
{
0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8
};