]>
git.ipfire.org Git - thirdparty/linux.git/blob - arch/riscv/include/asm/set_memory.h
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 * Copyright (C) 2019 SiFive
6 #ifndef _ASM_RISCV_SET_MEMORY_H
7 #define _ASM_RISCV_SET_MEMORY_H
11 * Functions to change memory attributes.
14 int set_memory_ro(unsigned long addr
, int numpages
);
15 int set_memory_rw(unsigned long addr
, int numpages
);
16 int set_memory_x(unsigned long addr
, int numpages
);
17 int set_memory_nx(unsigned long addr
, int numpages
);
19 static inline int set_memory_ro(unsigned long addr
, int numpages
) { return 0; }
20 static inline int set_memory_rw(unsigned long addr
, int numpages
) { return 0; }
21 static inline int set_memory_x(unsigned long addr
, int numpages
) { return 0; }
22 static inline int set_memory_nx(unsigned long addr
, int numpages
) { return 0; }
25 int set_direct_map_invalid_noflush(struct page
*page
);
26 int set_direct_map_default_noflush(struct page
*page
);
28 #endif /* __ASSEMBLY__ */
30 #ifdef CONFIG_ARCH_HAS_STRICT_KERNEL_RWX
32 #define SECTION_ALIGN (1 << 21)
34 #define SECTION_ALIGN (1 << 22)
36 #else /* !CONFIG_ARCH_HAS_STRICT_KERNEL_RWX */
37 #define SECTION_ALIGN L1_CACHE_BYTES
38 #endif /* CONFIG_ARCH_HAS_STRICT_KERNEL_RWX */
40 #endif /* _ASM_RISCV_SET_MEMORY_H */