1 /* SPDX-License-Identifier: GPL-2.0-only */ 2 3 #ifndef __RISCV_PMP_H__ 4 #define __RISCV_PMP_H__ 5 6 #include <stdint.h> 7 8 /* 9 * this function needs to be implemented by a specific SoC. 10 * return number of PMP entries for current hart 11 */ 12 int pmp_entries_num(void); 13 14 /* reset PMP setting */ 15 void reset_pmp(void); 16 17 /* 18 * set up PMP record 19 * reminder: base and size are 34-bits on RV32. 20 */ 21 void setup_pmp(u64 base, u64 size, u8 flags); 22 23 /* write the last PMP record, i.e. the "default" case. */ 24 void close_pmp(void); 25 26 #endif /* __RISCV_PMP_H__ */ 27