Files
opensbi/include/sbi/sbi_pmp.h
T
Nicholas Piggin e9797b5e57 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>
2026-06-10 13:17:30 +05:30

23 lines
471 B
C

/*
* 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