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. --- include/kmi/assert.h | 2 +- include/kmi/tcb.h | 23 ----------------------- 2 files changed, 1 insertion(+), 24 deletions(-) (limited to 'include') diff --git a/include/kmi/assert.h b/include/kmi/assert.h index 89e809b..69eb9ce 100644 --- a/include/kmi/assert.h +++ b/include/kmi/assert.h @@ -22,7 +22,7 @@ #include /** \todo should this exit or do something explosive like that? */ -#if !defined(DNDEBUG) +#if defined(DEBUG) /** * The kernel is in an irrepairable state, just give up. diff --git a/include/kmi/tcb.h b/include/kmi/tcb.h index 420c432..b98b2cc 100644 --- a/include/kmi/tcb.h +++ b/include/kmi/tcb.h @@ -391,27 +391,4 @@ void set_return(struct tcb *t, vm_t r); */ bool running(struct tcb *t); -/** - * Save thread context for rpc call. - * Assumes t->rpc is pointing to the correct virtual memory. - * - * @param t Thread whose context to save. - */ -void enter_rpc(struct tcb *t); - -/** - * Load thread context from rpc call. - * - * @param t Thread whose context to restore. - */ -void leave_rpc(struct tcb *t); - -/** - * Check that we have enough rpc stack. - * - * @param t Thread whose rpc stack to check. - * @return \ref true if we have enough, \ref false otherwise. - */ -bool enough_rpc_stack(struct tcb *t); - #endif /* KMI_TCB_H */ -- cgit v1.3