18c2ecf20Sopenharmony_ci/* SPDX-License-Identifier: GPL-2.0-only */
28c2ecf20Sopenharmony_ci/*
38c2ecf20Sopenharmony_ci * Copyright (C) 1999-2002 Russell King
48c2ecf20Sopenharmony_ci */
58c2ecf20Sopenharmony_ci
68c2ecf20Sopenharmony_ci#ifndef _ASMARM_SET_MEMORY_H
78c2ecf20Sopenharmony_ci#define _ASMARM_SET_MEMORY_H
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ci#ifdef CONFIG_MMU
108c2ecf20Sopenharmony_ciint set_memory_ro(unsigned long addr, int numpages);
118c2ecf20Sopenharmony_ciint set_memory_rw(unsigned long addr, int numpages);
128c2ecf20Sopenharmony_ciint set_memory_x(unsigned long addr, int numpages);
138c2ecf20Sopenharmony_ciint set_memory_nx(unsigned long addr, int numpages);
148c2ecf20Sopenharmony_ci#else
158c2ecf20Sopenharmony_cistatic inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
168c2ecf20Sopenharmony_cistatic inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
178c2ecf20Sopenharmony_cistatic inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
188c2ecf20Sopenharmony_cistatic inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
198c2ecf20Sopenharmony_ci#endif
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci#ifdef CONFIG_STRICT_KERNEL_RWX
228c2ecf20Sopenharmony_civoid set_kernel_text_rw(void);
238c2ecf20Sopenharmony_civoid set_kernel_text_ro(void);
248c2ecf20Sopenharmony_ci#else
258c2ecf20Sopenharmony_cistatic inline void set_kernel_text_rw(void) { }
268c2ecf20Sopenharmony_cistatic inline void set_kernel_text_ro(void) { }
278c2ecf20Sopenharmony_ci#endif
288c2ecf20Sopenharmony_ci
298c2ecf20Sopenharmony_ci#endif
30