libroot/riscv64: define syscall function size, implement time

Change-Id: Ib08b0b700506e3e1eb41d1b30b025bdf688342d9
Reviewed-on: https://review.haiku-os.org/c/haiku/+/4071
Reviewed-by: Alex von Gluck IV <kallisti5@unixzen.com>
This commit is contained in:
X512 2021-06-06 21:09:19 +09:00 committed by Alex von Gluck IV
parent 7b124be096
commit 95d6ecf25d
2 changed files with 6 additions and 2 deletions

View File

@ -10,7 +10,8 @@
name: \
li t0, n; \
ecall; \
ret
ret; \
.size name, .-name
#define SYSCALL0(name, n) _SYSCALL(name, n)
#define SYSCALL1(name, n) _SYSCALL(name, n)

View File

@ -12,6 +12,7 @@
static struct arch_real_time_data *sRealTimeData;
void
__arch_init_time(struct real_time_data *data, bool setDefaults)
{
@ -27,5 +28,7 @@ __arch_init_time(struct real_time_data *data, bool setDefaults)
bigtime_t
__arch_get_system_time_offset(struct real_time_data *data)
{
return 0;
// we don't use atomic_get64 because memory is read-only, maybe
// find another way to lock
return data->arch_data.system_time_offset;
}