xref: /aosp_15_r20/external/coreboot/src/arch/riscv/include/arch/pmp.h (revision b9411a12aaaa7e1e6a6fb7c5e057f44ee179a49c)
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