mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2025-12-17 12:31:37 +00:00
lib: sbi: Factor-out PMP programming into separate sources
The PMP programming is a significant part of sbi_hart.c so factor-out this into separate sources sbi_hart_pmp.c and sbi_hart_pmp.h for better maintainability. Signed-off-by: Anup Patel <apatel@ventanamicro.com> Link: https://lore.kernel.org/r/20251209135235.423391-6-apatel@ventanamicro.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
20
include/sbi/sbi_hart_pmp.h
Normal file
20
include/sbi/sbi_hart_pmp.h
Normal file
@@ -0,0 +1,20 @@
|
||||
/*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*
|
||||
* Copyright (c) 2025 Ventana Micro Systems Inc.
|
||||
*/
|
||||
|
||||
#ifndef __SBI_HART_PMP_H__
|
||||
#define __SBI_HART_PMP_H__
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
struct sbi_scratch;
|
||||
|
||||
unsigned int sbi_hart_pmp_count(struct sbi_scratch *scratch);
|
||||
unsigned int sbi_hart_pmp_log2gran(struct sbi_scratch *scratch);
|
||||
unsigned int sbi_hart_pmp_addrbits(struct sbi_scratch *scratch);
|
||||
bool sbi_hart_smepmp_is_fw_region(unsigned int pmp_idx);
|
||||
int sbi_hart_pmp_init(struct sbi_scratch *scratch);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user