mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-06-12 22:31:45 +01:00
lib: sbi: Move hart PMP functions to sbi_hart_pmp.c
The sbi_hart_pmp.c looks like a good place for the hart PMP CSR access functions. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260430045528.420437-9-npiggin@gmail.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
63350c6ea6
commit
a59c8fb9fb
@@ -81,8 +81,6 @@
|
||||
|
||||
#ifndef __ASSEMBLER__
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
#define csr_swap(csr, val) \
|
||||
({ \
|
||||
register unsigned long __v = (unsigned long)(val); \
|
||||
@@ -211,18 +209,6 @@ int misa_xlen(void);
|
||||
/* Get RISC-V ISA string representation */
|
||||
void misa_string(int xlen, char *out, unsigned int out_sz);
|
||||
|
||||
/* Disable pmp entry at a given index */
|
||||
int sbi_hart_pmp_disable(unsigned int n);
|
||||
|
||||
/* Check if the matching field is set */
|
||||
bool sbi_hart_is_pmp_enabled(unsigned int n);
|
||||
|
||||
int sbi_hart_pmp_set(unsigned int n, unsigned long prot, unsigned long addr,
|
||||
unsigned long log2len);
|
||||
|
||||
int sbi_hart_pmp_get(unsigned int n, unsigned long *prot_out, unsigned long *addr_out,
|
||||
unsigned long *log2len);
|
||||
|
||||
#endif /* !__ASSEMBLER__ */
|
||||
|
||||
#endif
|
||||
|
||||
@@ -9,6 +9,18 @@
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
/* Disable pmp entry at a given index */
|
||||
int sbi_hart_pmp_disable(unsigned int n);
|
||||
|
||||
/* Check if the matching field is set */
|
||||
bool sbi_hart_is_pmp_enabled(unsigned int n);
|
||||
|
||||
int sbi_hart_pmp_set(unsigned int n, unsigned long prot,
|
||||
unsigned long addr, unsigned long log2len);
|
||||
|
||||
int sbi_hart_pmp_get(unsigned int n, unsigned long *prot_out,
|
||||
unsigned long *addr_out, unsigned long *log2len);
|
||||
|
||||
struct sbi_scratch;
|
||||
|
||||
unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch);
|
||||
|
||||
Reference in New Issue
Block a user