diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-04 17:43:32 +0300 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2023-06-04 17:43:32 +0300 |
| commit | c7df9ae5f60ef1d36a20dbfbb8b4b0f4cd1a601a (patch) | |
| tree | c7d4d044c5657cb57649d828d6a52b847b33ea83 /arch/riscv64/conf | |
| parent | 3dbd8c34176312b0bd3aba2309d284ac83181411 (diff) | |
| download | kmi-c7df9ae5f60ef1d36a20dbfbb8b4b0f4cd1a601a.tar.gz kmi-c7df9ae5f60ef1d36a20dbfbb8b4b0f4cd1a601a.zip | |
add some docs about visionfive2
Diffstat (limited to 'arch/riscv64/conf')
| -rwxr-xr-x | arch/riscv64/conf/init | bin | 3600 -> 3648 bytes | |||
| -rw-r--r-- | arch/riscv64/conf/init.c | 7 | ||||
| -rw-r--r-- | arch/riscv64/conf/initrd | bin | 4096 -> 4096 bytes |
3 files changed, 6 insertions, 1 deletions
diff --git a/arch/riscv64/conf/init b/arch/riscv64/conf/init Binary files differindex c77c048..76de753 100755 --- a/arch/riscv64/conf/init +++ b/arch/riscv64/conf/init diff --git a/arch/riscv64/conf/init.c b/arch/riscv64/conf/init.c index b2f4024..8177992 100644 --- a/arch/riscv64/conf/init.c +++ b/arch/riscv64/conf/init.c @@ -256,6 +256,8 @@ void callback(long status, long tid, long d0, long d1, long d2, long d3) #define csr_read(csr, \ res) __asm__ volatile ("csrr %0, " csr : "=r" (res) :: "memory") +#define CSR_CYCLE "0xc00" + void _start() { sys_noop(); @@ -264,17 +266,20 @@ void _start() uint64_t second = sys_timebase(); print_value("Timebase", second); - uint64_t n = 0, i, 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(); n++; } + csr_read(CSR_CYCLE, cend); print_value("End ticks", i); print_value("Syscalls per second", n); + print_value("Executed cycles per second", cend - cstart); puts("Setting callback..."); sys_ipc_server(callback); diff --git a/arch/riscv64/conf/initrd b/arch/riscv64/conf/initrd Binary files differindex fb6f525..e4d76a2 100644 --- a/arch/riscv64/conf/initrd +++ b/arch/riscv64/conf/initrd |
