~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/arch/s390/include/asm/set_memory.h

Version: ~ [ linux-6.12-rc7 ] ~ [ linux-6.11.7 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.60 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.116 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.171 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.229 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.285 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.323 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef _ASMS390_SET_MEMORY_H
  3 #define _ASMS390_SET_MEMORY_H
  4 
  5 #include <linux/mutex.h>
  6 
  7 extern struct mutex cpa_mutex;
  8 
  9 enum {
 10         _SET_MEMORY_RO_BIT,
 11         _SET_MEMORY_RW_BIT,
 12         _SET_MEMORY_NX_BIT,
 13         _SET_MEMORY_X_BIT,
 14         _SET_MEMORY_4K_BIT,
 15         _SET_MEMORY_INV_BIT,
 16         _SET_MEMORY_DEF_BIT,
 17 };
 18 
 19 #define SET_MEMORY_RO   BIT(_SET_MEMORY_RO_BIT)
 20 #define SET_MEMORY_RW   BIT(_SET_MEMORY_RW_BIT)
 21 #define SET_MEMORY_NX   BIT(_SET_MEMORY_NX_BIT)
 22 #define SET_MEMORY_X    BIT(_SET_MEMORY_X_BIT)
 23 #define SET_MEMORY_4K   BIT(_SET_MEMORY_4K_BIT)
 24 #define SET_MEMORY_INV  BIT(_SET_MEMORY_INV_BIT)
 25 #define SET_MEMORY_DEF  BIT(_SET_MEMORY_DEF_BIT)
 26 
 27 int __set_memory(unsigned long addr, unsigned long numpages, unsigned long flags);
 28 
 29 #define set_memory_rox set_memory_rox
 30 
 31 /*
 32  * Generate two variants of each set_memory() function:
 33  *
 34  * set_memory_yy(unsigned long addr, int numpages);
 35  * __set_memory_yy(void *start, void *end);
 36  *
 37  * The second variant exists for both convenience to avoid the usual
 38  * (unsigned long) casts, but unlike the first variant it can also be used
 39  * for areas larger than 8TB, which may happen at memory initialization.
 40  */
 41 #define __SET_MEMORY_FUNC(fname, flags)                                 \
 42 static inline int fname(unsigned long addr, int numpages)               \
 43 {                                                                       \
 44         return __set_memory(addr, numpages, (flags));                   \
 45 }                                                                       \
 46                                                                         \
 47 static inline int __##fname(void *start, void *end)                     \
 48 {                                                                       \
 49         unsigned long numpages;                                         \
 50                                                                         \
 51         numpages = (end - start) >> PAGE_SHIFT;                         \
 52         return __set_memory((unsigned long)start, numpages, (flags));   \
 53 }
 54 
 55 __SET_MEMORY_FUNC(set_memory_ro, SET_MEMORY_RO)
 56 __SET_MEMORY_FUNC(set_memory_rw, SET_MEMORY_RW)
 57 __SET_MEMORY_FUNC(set_memory_nx, SET_MEMORY_NX)
 58 __SET_MEMORY_FUNC(set_memory_x, SET_MEMORY_X)
 59 __SET_MEMORY_FUNC(set_memory_rox, SET_MEMORY_RO | SET_MEMORY_X)
 60 __SET_MEMORY_FUNC(set_memory_rwnx, SET_MEMORY_RW | SET_MEMORY_NX)
 61 __SET_MEMORY_FUNC(set_memory_4k, SET_MEMORY_4K)
 62 
 63 int set_direct_map_invalid_noflush(struct page *page);
 64 int set_direct_map_default_noflush(struct page *page);
 65 
 66 #endif
 67 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php