Michael Ellerman | 938f846 | 2017-07-06 15:35:52 -0700 | [diff] [blame] | 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 | |
| 11 | #ifdef CONFIG_ARCH_HAS_SET_MEMORY |
| 12 | #include <asm/set_memory.h> |
| 13 | #else |
| 14 | static inline int set_memory_ro(unsigned long addr, int numpages) { return 0; } |
| 15 | static inline int set_memory_rw(unsigned long addr, int numpages) { return 0; } |
| 16 | static inline int set_memory_x(unsigned long addr, int numpages) { return 0; } |
| 17 | static inline int set_memory_nx(unsigned long addr, int numpages) { return 0; } |
| 18 | #endif |
| 19 | |
Christoph Hellwig | b7fa074 | 2018-03-19 11:38:22 +0100 | [diff] [blame] | 20 | #ifndef CONFIG_ARCH_HAS_MEM_ENCRYPT |
| 21 | static inline int set_memory_encrypted(unsigned long addr, int numpages) |
| 22 | { |
| 23 | return 0; |
| 24 | } |
| 25 | |
| 26 | static inline int set_memory_decrypted(unsigned long addr, int numpages) |
| 27 | { |
| 28 | return 0; |
| 29 | } |
| 30 | #endif /* CONFIG_ARCH_HAS_MEM_ENCRYPT */ |
| 31 | |
Michael Ellerman | 938f846 | 2017-07-06 15:35:52 -0700 | [diff] [blame] | 32 | #endif /* _LINUX_SET_MEMORY_H_ */ |