set_memory.h 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. /*
  2. * Copyright (C) 1999-2002 Russell King
  3. *
  4. * This program is free software; you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License version 2 as
  6. * published by the Free Software Foundation.
  7. */
  8. #ifndef _ASMARM_SET_MEMORY_H
  9. #define _ASMARM_SET_MEMORY_H
  10. #ifdef CONFIG_MMU
  11. int set_memory_ro(unsigned long addr, int numpages);
  12. int set_memory_rw(unsigned long addr, int numpages);
  13. int set_memory_x(unsigned long addr, int numpages);
  14. int set_memory_nx(unsigned long addr, int numpages);
  15. #else
  16. static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
  17. static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
  18. static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
  19. static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
  20. #endif
  21. #ifdef CONFIG_STRICT_KERNEL_RWX
  22. void set_kernel_text_rw(void);
  23. void set_kernel_text_ro(void);
  24. #else
  25. static inline void set_kernel_text_rw(void) { }
  26. static inline void set_kernel_text_ro(void) { }
  27. #endif
  28. #endif