diff options
author | Christophe Leroy <christophe.leroy@csgroup.eu> | 2024-02-16 11:12:05 +0100 |
---|---|---|
committer | Michael Ellerman <mpe@ellerman.id.au> | 2024-02-22 21:55:33 +1100 |
commit | 09ca1b11716f96461a4675eb0418d5cb97687389 (patch) | |
tree | 3eb3c07b450cfc281ee4fc442c34fa95897cac90 /arch/powerpc/include/asm/set_memory.h | |
parent | d5835fb60bad641dbae64fe30c02f10857bf4647 (diff) |
powerpc: Implement set_memory_rox()
Same as x86 and s390, add set_memory_rox() to avoid doing
one pass with set_memory_ro() and a second pass with set_memory_x().
See commit 60463628c9e0 ("x86/mm: Implement native set_memory_rox()")
and commit 22e99fa56443 ("s390/mm: implement set_memory_rox()") for
more information.
Signed-off-by: Christophe Leroy <christophe.leroy@csgroup.eu>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Link: https://msgid.link/dc9a794f82ab62572d7d0be5cb4b8b27920a4f78.1708078316.git.christophe.leroy@csgroup.eu
Diffstat (limited to 'arch/powerpc/include/asm/set_memory.h')
-rw-r--r-- | arch/powerpc/include/asm/set_memory.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/arch/powerpc/include/asm/set_memory.h b/arch/powerpc/include/asm/set_memory.h index 7ebc807aa8cc..9a025b776a4b 100644 --- a/arch/powerpc/include/asm/set_memory.h +++ b/arch/powerpc/include/asm/set_memory.h @@ -8,6 +8,7 @@ #define SET_MEMORY_X 3 #define SET_MEMORY_NP 4 /* Set memory non present */ #define SET_MEMORY_P 5 /* Set memory present */ +#define SET_MEMORY_ROX 6 int change_memory_attr(unsigned long addr, int numpages, long action); @@ -41,4 +42,10 @@ static inline int set_memory_p(unsigned long addr, int numpages) return change_memory_attr(addr, numpages, SET_MEMORY_P); } +static inline int set_memory_rox(unsigned long addr, int numpages) +{ + return change_memory_attr(addr, numpages, SET_MEMORY_ROX); +} +#define set_memory_rox set_memory_rox + #endif |