set_memory.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Copyright 2017, Michael Ellerman, IBM Corporation.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License version
  6. * 2 as published by the Free Software Foundation;
  7. */
  8. #ifndef _LINUX_SET_MEMORY_H_
  9. #define _LINUX_SET_MEMORY_H_
  10. #ifdef CONFIG_ARCH_HAS_SET_MEMORY
  11. #include <asm/set_memory.h>
  12. #else
  13. static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; }
  14. static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; }
  15. static inline int set_memory_x(unsigned long addr, int numpages) { return 0; }
  16. static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; }
  17. #endif
  18. #ifndef set_mce_nospec
  19. static inline int set_mce_nospec(unsigned long pfn)
  20. {
  21. return 0;
  22. }
  23. #endif
  24. #ifndef clear_mce_nospec
  25. static inline int clear_mce_nospec(unsigned long pfn)
  26. {
  27. return 0;
  28. }
  29. #endif
  30. #ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT
  31. static inline int set_memory_encrypted(unsigned long addr, int numpages)
  32. {
  33. return 0;
  34. }
  35. static inline int set_memory_decrypted(unsigned long addr, int numpages)
  36. {
  37. return 0;
  38. }
  39. #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */
  40. #endif /* _LINUX_SET_MEMORY_H_ */