diff options
| author | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-01 13:22:59 +0200 |
|---|---|---|
| committer | Kimplul <kimi.h.kuparinen@gmail.com> | 2024-11-01 13:22:59 +0200 |
| commit | bfd2c0235881fa3bc0b9dd0e9d25edacb8b0eb69 (patch) | |
| tree | 7bc6ad1ce87af33614fd7889551647b9e6dc87d5 | |
| parent | 6d30470de8ba82d2d01fc9ea1860c7e15aa44adf (diff) | |
| download | kmi-bfd2c0235881fa3bc0b9dd0e9d25edacb8b0eb69.tar.gz kmi-bfd2c0235881fa3bc0b9dd0e9d25edacb8b0eb69.zip | |
calculate rpc stack top slightly differently
+ Saves a multiplication, very minor
| -rw-r--r-- | arch/riscv64/kernel/vmem.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/riscv64/kernel/vmem.c b/arch/riscv64/kernel/vmem.c index 5a6e71c..7bcdc1e 100644 --- a/arch/riscv64/kernel/vmem.c +++ b/arch/riscv64/kernel/vmem.c @@ -641,13 +641,13 @@ void destroy_rpc_stack(struct tcb *t) void reset_rpc_stack(struct tcb *t) { - t->rpc_stack = RPC_STACK_BASE + (BASE_PAGE_SIZE * rpc_pages); + t->rpc_stack = RPC_STACK_BASE + (BASE_PAGE_SIZE * order_size(MM_O1)); t->arch.rpc_idx = rpc_pages - 1; } bool rpc_stack_empty(pm_t addr) { - return addr == RPC_STACK_BASE + (BASE_PAGE_SIZE * rpc_pages); + return addr == RPC_STACK_BASE + order_size(MM_O1); } @@ -674,7 +674,7 @@ void reuse_rpc(struct tcb *t) struct vmem *b = t->arch.rpc_leaf; int top_idx = t->arch.rpc_idx; - const int max = rpc_pages - 1; + int max = rpc_pages - 1; for (; top_idx < max; --top_idx) { pm_t *pte = (pm_t *)&b->leaf[top_idx]; if (!(pte_flags(*pte) & VM_U)) |
