forked from Mirrors/opensbi
lib: sbi_platform: Add platform specific pmp_set() and pmp_disable()
Allow platforms to implement platform specific PMP setup and PMP disable functions which are called before actual PMP CSRs are configured. Also, implement pmp_set() and pmp_disable() for MIPS P8700. Signed-off-by: Chao-ying Fu <cfu@mips.com> Signed-off-by: Anup Patel <apatel@ventanamicro.com> Link: https://lore.kernel.org/r/20250614172756.153902-1-apatel@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
#include <sbi/sbi_string.h>
|
||||
#include <sbi/sbi_domain.h>
|
||||
#include <sbi/sbi_domain_context.h>
|
||||
#include <sbi/sbi_platform.h>
|
||||
#include <sbi/sbi_trap.h>
|
||||
|
||||
/** Context representation for a hart within a domain */
|
||||
@@ -115,6 +116,7 @@ static void switch_to_next_domain_context(struct hart_context *ctx,
|
||||
|
||||
/* Reconfigure PMP settings for the new domain */
|
||||
for (int i = 0; i < pmp_count; i++) {
|
||||
sbi_platform_pmp_disable(sbi_platform_thishart_ptr(), i);
|
||||
pmp_disable(i);
|
||||
}
|
||||
sbi_hart_pmp_configure(scratch);
|
||||
|
Reference in New Issue
Block a user