mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
Add set_memory_ro/rw/x/nx architecture hooks to change the page attribution. Use own set_memory.h rather than generic set_memory.h (i.e. include/asm-generic/set_memory.h), because we want to add other function prototypes here. Signed-off-by: Zong Li <zong.li@sifive.com> Signed-off-by: Palmer Dabbelt <palmerdabbelt@google.com>
24 lines
794 B
C
24 lines
794 B
C
/* SPDX-License-Identifier: GPL-2.0-only */
|
|
/*
|
|
* Copyright (C) 2019 SiFive
|
|
*/
|
|
|
|
#ifndef _ASM_RISCV_SET_MEMORY_H
|
|
#define _ASM_RISCV_SET_MEMORY_H
|
|
|
|
/*
|
|
* Functions to change memory attributes.
|
|
*/
|
|
#ifdef CONFIG_MMU
|
|
int set_memory_ro(unsigned long addr, int numpages);
|
|
int set_memory_rw(unsigned long addr, int numpages);
|
|
int set_memory_x(unsigned long addr, int numpages);
|
|
int set_memory_nx(unsigned long addr, int numpages);
|
|
#else
|
|
static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
|
|
static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
|
|
static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
|
|
static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
|
|
#endif
|
|
|
|
#endif /* _ASM_RISCV_SET_MEMORY_H */
|