lib: sbi: Replace sbi_hart_pmp_xyz() and sbi_hart_map/unmap_addr()

The sbi_hart_pmp_xyz() and sbi_hart_map/unmap_addr() functions can
now be replaced by various sbi_hart_protection_xyz() functions.

Signed-off-by: Anup Patel <apatel@ventanamicro.com>
Link: https://lore.kernel.org/r/20251209135235.423391-5-apatel@ventanamicro.com
Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
Anup Patel
2025-12-09 19:22:34 +05:30
committed by Anup Patel
parent b6da690ffb
commit 42139bb9b7
9 changed files with 58 additions and 83 deletions

View File

@@ -10,6 +10,7 @@
#include <sbi/sbi_console.h>
#include <sbi/sbi_hsm.h>
#include <sbi/sbi_hart.h>
#include <sbi/sbi_hart_protection.h>
#include <sbi/sbi_heap.h>
#include <sbi/sbi_scratch.h>
#include <sbi/sbi_string.h>
@@ -122,8 +123,8 @@ static int switch_to_next_domain_context(struct hart_context *ctx,
spin_unlock(&target_dom->assigned_harts_lock);
/* Reconfigure PMP settings for the new domain */
sbi_hart_pmp_unconfigure(scratch);
sbi_hart_pmp_configure(scratch);
sbi_hart_protection_unconfigure(scratch);
sbi_hart_protection_configure(scratch);
/* Save current CSR context and restore target domain's CSR context */
ctx->sstatus = csr_swap(CSR_SSTATUS, dom_ctx->sstatus);