From 6f11e59d72630bc1a48c77a772a5f8463eb2c254 Mon Sep 17 00:00:00 2001 From: Kristof Provost Date: Wed, 1 Jul 2020 19:12:47 +0000 Subject: [PATCH] riscv locore.S: load constant prior to loop A very minor micro-optimization; t0 is not clobbered between the loop top and bottom and there appear to be no other branches to this label. Submitted by: Nathaniel Filardo Reviewed by: mhorne Differential Revision: https://reviews.freebsd.org/D25524 --- sys/riscv/riscv/locore.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/riscv/riscv/locore.S b/sys/riscv/riscv/locore.S index 05ecd0a41b6c..4a5b01df85b7 100644 --- a/sys/riscv/riscv/locore.S +++ b/sys/riscv/riscv/locore.S @@ -139,8 +139,8 @@ pagetables: li t2, 512 /* Build 512 entries */ add t3, t4, t2 li t5, 0 -1: li t0, (PTE_KERN | PTE_X) +1: slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */ or t5, t0, t2 sd t5, (s1) /* Store PTE entry to position */