[PATCH 3/4] lib: sbi: Add hart_ prefix to PMP functions

Joel Stanley joel at jms.id.au
Wed Apr 1 05:50:41 PDT 2026


On Tue, 10 Mar 2026 at 11:19, Nicholas Piggin <npiggin at gmail.com> wrote:
>
> Give PMP functions that deal with HART CSRs a hart_ prefix, to help
> distinguish from general PMP encoding functions that will be shared by
> the Tenstorrent IOMMU.
>
> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
> ---
>  include/sbi/riscv_asm.h          |  8 +++----
>  lib/sbi/riscv_asm.c              | 10 ++++-----
>  lib/sbi/sbi_hart_pmp.c           | 14 ++++++-------

Some changes have been made to master since you sent your patch. This
fixup is required for sbi_hart_pmp.c :

--- a/lib/sbi/sbi_hart_pmp.c
+++ b/lib/sbi/sbi_hart_pmp.c
@@ -206,7 +206,7 @@ static int sbi_hart_smepmp_configure(struct
sbi_scratch *scratch)
        }
        /* Disable remaining PMP entries */
        for(; pmp_idx < pmp_count; pmp_idx++)
-               pmp_disable(pmp_idx);
+               hart_pmp_disable(pmp_idx);

        /*
         * All entries are programmed.
@@ -291,7 +291,7 @@ static int sbi_hart_oldpmp_configure(struct
sbi_scratch *scratch)
        }
        /* Disable remaining PMP entries */
        for(; pmp_idx < pmp_count; pmp_idx++)
-               pmp_disable(pmp_idx);
+               hart_pmp_disable(pmp_idx);

        sbi_hart_pmp_fence();
        return 0;



More information about the opensbi mailing list