From 67831847a3fb211784e1d143d472fd86c0e5fab8 Mon Sep 17 00:00:00 2001 From: Kimplul Date: Mon, 5 Jun 2023 20:31:44 +0300 Subject: give compiler more room to optimize rpc invocation + Try to write arguments to memory as fast as possible to free up some registers that the compiler can then play with. Qemu runs ~1 700 000 rpc's per second, visionfive2 @1GHz (I think) ~800 000. --- arch/riscv64/conf/init | Bin 3648 -> 4128 bytes arch/riscv64/conf/init.c | 4 ++-- arch/riscv64/conf/initrd | Bin 4096 -> 4608 bytes 3 files changed, 2 insertions(+), 2 deletions(-) (limited to 'arch/riscv64') diff --git a/arch/riscv64/conf/init b/arch/riscv64/conf/init index 76de753..c372029 100755 Binary files a/arch/riscv64/conf/init and b/arch/riscv64/conf/init differ diff --git a/arch/riscv64/conf/init.c b/arch/riscv64/conf/init.c index 8177992..001d5eb 100644 --- a/arch/riscv64/conf/init.c +++ b/arch/riscv64/conf/init.c @@ -268,8 +268,6 @@ void _start() uint64_t n = 0, i, start, cn, cstart, cend; start = i = sys_ticks(); - print_value("Start ticks", start); - csr_read(CSR_CYCLE, cstart); while (i < start + second) { i = sys_ticks(); @@ -277,6 +275,7 @@ void _start() } csr_read(CSR_CYCLE, cend); + print_value("Start ticks", start); print_value("End ticks", i); print_value("Syscalls per second", n); print_value("Executed cycles per second", cend - cstart); @@ -326,6 +325,7 @@ void _start() puts("Checking shared memory\n"); struct ipc_args r = sys_ipc_req(1, 1, 0, 0, 0); rw_buf = (char *)r.a1; + rw_buf_size = (size_t)r.a2; print_value("Shared memory ptr", (uintptr_t)rw_buf); print_value("Shared memory size", rw_buf_size); diff --git a/arch/riscv64/conf/initrd b/arch/riscv64/conf/initrd index e4d76a2..a489f3a 100644 Binary files a/arch/riscv64/conf/initrd and b/arch/riscv64/conf/initrd differ -- cgit v1.3