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

TOMOYO Linux Cross Reference
Linux/arch/s390/include/asm/page-states.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ 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 /*
  3  *    Copyright IBM Corp. 2017
  4  *    Author(s): Claudio Imbrenda <imbrenda@linux.vnet.ibm.com>
  5  */
  6 
  7 #ifndef PAGE_STATES_H
  8 #define PAGE_STATES_H
  9 
 10 #include <asm/sections.h>
 11 #include <asm/page.h>
 12 
 13 #define ESSA_GET_STATE                  0
 14 #define ESSA_SET_STABLE                 1
 15 #define ESSA_SET_UNUSED                 2
 16 #define ESSA_SET_VOLATILE               3
 17 #define ESSA_SET_POT_VOLATILE           4
 18 #define ESSA_SET_STABLE_RESIDENT        5
 19 #define ESSA_SET_STABLE_IF_RESIDENT     6
 20 #define ESSA_SET_STABLE_NODAT           7
 21 
 22 #define ESSA_MAX        ESSA_SET_STABLE_NODAT
 23 
 24 extern int __bootdata_preserved(cmma_flag);
 25 
 26 static __always_inline unsigned long essa(unsigned long paddr, unsigned char cmd)
 27 {
 28         unsigned long rc;
 29 
 30         asm volatile(
 31                 "       .insn   rrf,0xb9ab0000,%[rc],%[paddr],%[cmd],0"
 32                 : [rc] "=d" (rc)
 33                 : [paddr] "d" (paddr),
 34                   [cmd] "i" (cmd));
 35         return rc;
 36 }
 37 
 38 static __always_inline void __set_page_state(void *addr, unsigned long num_pages, unsigned char cmd)
 39 {
 40         unsigned long paddr = __pa(addr) & PAGE_MASK;
 41 
 42         while (num_pages--) {
 43                 essa(paddr, cmd);
 44                 paddr += PAGE_SIZE;
 45         }
 46 }
 47 
 48 static inline void __set_page_unused(void *addr, unsigned long num_pages)
 49 {
 50         __set_page_state(addr, num_pages, ESSA_SET_UNUSED);
 51 }
 52 
 53 static inline void __set_page_stable_dat(void *addr, unsigned long num_pages)
 54 {
 55         __set_page_state(addr, num_pages, ESSA_SET_STABLE);
 56 }
 57 
 58 static inline void __set_page_stable_nodat(void *addr, unsigned long num_pages)
 59 {
 60         __set_page_state(addr, num_pages, ESSA_SET_STABLE_NODAT);
 61 }
 62 
 63 static inline void __arch_set_page_nodat(void *addr, unsigned long num_pages)
 64 {
 65         if (!cmma_flag)
 66                 return;
 67         if (cmma_flag < 2)
 68                 __set_page_stable_dat(addr, num_pages);
 69         else
 70                 __set_page_stable_nodat(addr, num_pages);
 71 }
 72 
 73 static inline void __arch_set_page_dat(void *addr, unsigned long num_pages)
 74 {
 75         if (!cmma_flag)
 76                 return;
 77         __set_page_stable_dat(addr, num_pages);
 78 }
 79 
 80 #endif
 81 

~ [ 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