mirror of
https://github.com/riscv-software-src/opensbi.git
synced 2026-06-12 22:31:45 +01:00
lib: sbi: Move RISC-V PMP encoding functions to sbi_pmp.c
Create a new file for handling the RISC-V PMP format and the new pmp_t type, as opposed to hart PMP CSR specific access. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Reviewed-by: Anup Patel <anup@brainfault.org> Link: https://lore.kernel.org/r/20260430045528.420437-4-npiggin@gmail.com Signed-off-by: Anup Patel <anup@brainfault.org>
This commit is contained in:
committed by
Anup Patel
parent
c93a89f214
commit
e9797b5e57
@@ -0,0 +1,22 @@
|
||||
/*
|
||||
* SPDX-FileCopyrightText: (c) 2025-2026 Tenstorrent USA, Inc.
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#ifndef __SBI_PMP_H__
|
||||
#define __SBI_PMP_H__
|
||||
|
||||
#include <sbi/sbi_types.h>
|
||||
|
||||
struct pmp {
|
||||
unsigned long addr;
|
||||
u8 cfg;
|
||||
};
|
||||
typedef struct pmp pmp_t;
|
||||
|
||||
int sbi_pmp_encode(pmp_t *pmp, unsigned long prot, unsigned long addr,
|
||||
unsigned long log2len);
|
||||
int sbi_pmp_decode(pmp_t *pmp, unsigned long *prot, unsigned long *addr,
|
||||
unsigned long *log2len);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user