1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef _ASM_POWERPC_SET_MEMORY_H
3 #define _ASM_POWERPC_SET_MEMORY_H
4 
5 #define SET_MEMORY_RO	0
6 #define SET_MEMORY_RW	1
7 #define SET_MEMORY_NX	2
8 #define SET_MEMORY_X	3
9 
10 int change_memory_attr(unsigned long addr, int numpages, long action);
11 
12 static inline int set_memory_ro(unsigned long addr, int numpages)
13 {
14 	return change_memory_attr(addr, numpages, SET_MEMORY_RO);
15 }
16 
17 static inline int set_memory_rw(unsigned long addr, int numpages)
18 {
19 	return change_memory_attr(addr, numpages, SET_MEMORY_RW);
20 }
21 
22 static inline int set_memory_nx(unsigned long addr, int numpages)
23 {
24 	return change_memory_attr(addr, numpages, SET_MEMORY_NX);
25 }
26 
27 static inline int set_memory_x(unsigned long addr, int numpages)
28 {
29 	return change_memory_attr(addr, numpages, SET_MEMORY_X);
30 }
31 
32 int set_memory_attr(unsigned long addr, int numpages, pgprot_t prot);
33 
34 #endif
35