Date: Mon, 26 Oct 2020 07:23:22 +0100 From: Antonin Houska <ah@melesmeles.cz> To: freebsd-riscv@freebsd.org Subject: locore.S - two cosmetic changes Message-ID: <65290.1603693402@antos>
next in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] Hello, while trying to understand the code, I've spotted two things that might need to be improved - please see the attachments. remove_useless_assignment.patch removes setting of register value which is not used until the next value is set. use_constant_not_literal.patch probably needs no explanation. -- AntonĂn Houska www.melesmeles.cz [-- Attachment #2 --] Index: sys/riscv/riscv/locore.S =================================================================== --- sys/riscv/riscv/locore.S (revision 366768) +++ sys/riscv/riscv/locore.S (working copy) @@ -138,7 +138,6 @@ srli t4, s9, 21 /* Div physmem base by 2 MiB */ li t2, 512 /* Build 512 entries */ add t3, t4, t2 - li t5, 0 li t0, (PTE_KERN | PTE_X) 1: slli t2, t4, PTE_PPN1_S /* << PTE_PPN1_S */ [-- Attachment #3 --] Index: sys/riscv/riscv/locore.S =================================================================== --- sys/riscv/riscv/locore.S (revision 366768) +++ sys/riscv/riscv/locore.S (working copy) @@ -135,7 +135,7 @@ /* Level 2 superpages (512 x 2MiB) */ lla s1, pagetable_l2 - srli t4, s9, 21 /* Div physmem base by 2 MiB */ + srli t4, s9, L2_SHIFT /* Div physmem base by 2 MiB */ li t2, 512 /* Build 512 entries */ add t3, t4, t2 li t5, 0
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65290.1603693402>
