mmflags.h 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /*
  2. * The order of these masks is important. Matching masks will be seen
  3. * first and the left over flags will end up showing by themselves.
  4. *
  5. * For example, if we have GFP_KERNEL before GFP_USER we wil get:
  6. *
  7. * GFP_KERNEL|GFP_HARDWALL
  8. *
  9. * Thus most bits set go first.
  10. */
  11. #define __def_gfpflag_names \
  12. {(unsigned long)GFP_TRANSHUGE, "GFP_TRANSHUGE"}, \
  13. {(unsigned long)GFP_TRANSHUGE_LIGHT, "GFP_TRANSHUGE_LIGHT"}, \
  14. {(unsigned long)GFP_HIGHUSER_MOVABLE, "GFP_HIGHUSER_MOVABLE"},\
  15. {(unsigned long)GFP_HIGHUSER, "GFP_HIGHUSER"}, \
  16. {(unsigned long)GFP_USER, "GFP_USER"}, \
  17. {(unsigned long)GFP_TEMPORARY, "GFP_TEMPORARY"}, \
  18. {(unsigned long)GFP_KERNEL_ACCOUNT, "GFP_KERNEL_ACCOUNT"}, \
  19. {(unsigned long)GFP_KERNEL, "GFP_KERNEL"}, \
  20. {(unsigned long)GFP_NOFS, "GFP_NOFS"}, \
  21. {(unsigned long)GFP_ATOMIC, "GFP_ATOMIC"}, \
  22. {(unsigned long)GFP_NOIO, "GFP_NOIO"}, \
  23. {(unsigned long)GFP_NOWAIT, "GFP_NOWAIT"}, \
  24. {(unsigned long)GFP_DMA, "GFP_DMA"}, \
  25. {(unsigned long)__GFP_HIGHMEM, "__GFP_HIGHMEM"}, \
  26. {(unsigned long)GFP_DMA32, "GFP_DMA32"}, \
  27. {(unsigned long)__GFP_HIGH, "__GFP_HIGH"}, \
  28. {(unsigned long)__GFP_ATOMIC, "__GFP_ATOMIC"}, \
  29. {(unsigned long)__GFP_IO, "__GFP_IO"}, \
  30. {(unsigned long)__GFP_FS, "__GFP_FS"}, \
  31. {(unsigned long)__GFP_COLD, "__GFP_COLD"}, \
  32. {(unsigned long)__GFP_NOWARN, "__GFP_NOWARN"}, \
  33. {(unsigned long)__GFP_REPEAT, "__GFP_REPEAT"}, \
  34. {(unsigned long)__GFP_NOFAIL, "__GFP_NOFAIL"}, \
  35. {(unsigned long)__GFP_NORETRY, "__GFP_NORETRY"}, \
  36. {(unsigned long)__GFP_COMP, "__GFP_COMP"}, \
  37. {(unsigned long)__GFP_ZERO, "__GFP_ZERO"}, \
  38. {(unsigned long)__GFP_NOMEMALLOC, "__GFP_NOMEMALLOC"}, \
  39. {(unsigned long)__GFP_MEMALLOC, "__GFP_MEMALLOC"}, \
  40. {(unsigned long)__GFP_HARDWALL, "__GFP_HARDWALL"}, \
  41. {(unsigned long)__GFP_THISNODE, "__GFP_THISNODE"}, \
  42. {(unsigned long)__GFP_RECLAIMABLE, "__GFP_RECLAIMABLE"}, \
  43. {(unsigned long)__GFP_MOVABLE, "__GFP_MOVABLE"}, \
  44. {(unsigned long)__GFP_ACCOUNT, "__GFP_ACCOUNT"}, \
  45. {(unsigned long)__GFP_NOTRACK, "__GFP_NOTRACK"}, \
  46. {(unsigned long)__GFP_WRITE, "__GFP_WRITE"}, \
  47. {(unsigned long)__GFP_RECLAIM, "__GFP_RECLAIM"}, \
  48. {(unsigned long)__GFP_DIRECT_RECLAIM, "__GFP_DIRECT_RECLAIM"},\
  49. {(unsigned long)__GFP_KSWAPD_RECLAIM, "__GFP_KSWAPD_RECLAIM"},\
  50. {(unsigned long)__GFP_OTHER_NODE, "__GFP_OTHER_NODE"} \
  51. #define show_gfp_flags(flags) \
  52. (flags) ? __print_flags(flags, "|", \
  53. __def_gfpflag_names \
  54. ) : "none"
  55. #ifdef CONFIG_MMU
  56. #define IF_HAVE_PG_MLOCK(flag,string) ,{1UL << flag, string}
  57. #else
  58. #define IF_HAVE_PG_MLOCK(flag,string)
  59. #endif
  60. #ifdef CONFIG_ARCH_USES_PG_UNCACHED
  61. #define IF_HAVE_PG_UNCACHED(flag,string) ,{1UL << flag, string}
  62. #else
  63. #define IF_HAVE_PG_UNCACHED(flag,string)
  64. #endif
  65. #ifdef CONFIG_MEMORY_FAILURE
  66. #define IF_HAVE_PG_HWPOISON(flag,string) ,{1UL << flag, string}
  67. #else
  68. #define IF_HAVE_PG_HWPOISON(flag,string)
  69. #endif
  70. #if defined(CONFIG_IDLE_PAGE_TRACKING) && defined(CONFIG_64BIT)
  71. #define IF_HAVE_PG_IDLE(flag,string) ,{1UL << flag, string}
  72. #else
  73. #define IF_HAVE_PG_IDLE(flag,string)
  74. #endif
  75. #define __def_pageflag_names \
  76. {1UL << PG_locked, "locked" }, \
  77. {1UL << PG_waiters, "waiters" }, \
  78. {1UL << PG_error, "error" }, \
  79. {1UL << PG_referenced, "referenced" }, \
  80. {1UL << PG_uptodate, "uptodate" }, \
  81. {1UL << PG_dirty, "dirty" }, \
  82. {1UL << PG_lru, "lru" }, \
  83. {1UL << PG_active, "active" }, \
  84. {1UL << PG_workingset, "workingset" }, \
  85. {1UL << PG_slab, "slab" }, \
  86. {1UL << PG_owner_priv_1, "owner_priv_1" }, \
  87. {1UL << PG_arch_1, "arch_1" }, \
  88. {1UL << PG_reserved, "reserved" }, \
  89. {1UL << PG_private, "private" }, \
  90. {1UL << PG_private_2, "private_2" }, \
  91. {1UL << PG_writeback, "writeback" }, \
  92. {1UL << PG_head, "head" }, \
  93. {1UL << PG_swapcache, "swapcache" }, \
  94. {1UL << PG_mappedtodisk, "mappedtodisk" }, \
  95. {1UL << PG_reclaim, "reclaim" }, \
  96. {1UL << PG_swapbacked, "swapbacked" }, \
  97. {1UL << PG_unevictable, "unevictable" } \
  98. IF_HAVE_PG_MLOCK(PG_mlocked, "mlocked" ) \
  99. IF_HAVE_PG_UNCACHED(PG_uncached, "uncached" ) \
  100. IF_HAVE_PG_HWPOISON(PG_hwpoison, "hwpoison" ) \
  101. IF_HAVE_PG_IDLE(PG_young, "young" ) \
  102. IF_HAVE_PG_IDLE(PG_idle, "idle" )
  103. #define show_page_flags(flags) \
  104. (flags) ? __print_flags(flags, "|", \
  105. __def_pageflag_names \
  106. ) : "none"
  107. #if defined(CONFIG_X86)
  108. #define __VM_ARCH_SPECIFIC_1 {VM_PAT, "pat" }
  109. #elif defined(CONFIG_PPC)
  110. #define __VM_ARCH_SPECIFIC_1 {VM_SAO, "sao" }
  111. #elif defined(CONFIG_PARISC) || defined(CONFIG_METAG) || defined(CONFIG_IA64)
  112. #define __VM_ARCH_SPECIFIC_1 {VM_GROWSUP, "growsup" }
  113. #elif !defined(CONFIG_MMU)
  114. #define __VM_ARCH_SPECIFIC_1 {VM_MAPPED_COPY,"mappedcopy" }
  115. #else
  116. #define __VM_ARCH_SPECIFIC_1 {VM_ARCH_1, "arch_1" }
  117. #endif
  118. #if defined(CONFIG_X86)
  119. #define __VM_ARCH_SPECIFIC_2 {VM_MPX, "mpx" }
  120. #else
  121. #define __VM_ARCH_SPECIFIC_2 {VM_ARCH_2, "arch_2" }
  122. #endif
  123. #ifdef CONFIG_MEM_SOFT_DIRTY
  124. #define IF_HAVE_VM_SOFTDIRTY(flag,name) {flag, name },
  125. #else
  126. #define IF_HAVE_VM_SOFTDIRTY(flag,name)
  127. #endif
  128. #define __def_vmaflag_names \
  129. {VM_READ, "read" }, \
  130. {VM_WRITE, "write" }, \
  131. {VM_EXEC, "exec" }, \
  132. {VM_SHARED, "shared" }, \
  133. {VM_MAYREAD, "mayread" }, \
  134. {VM_MAYWRITE, "maywrite" }, \
  135. {VM_MAYEXEC, "mayexec" }, \
  136. {VM_MAYSHARE, "mayshare" }, \
  137. {VM_GROWSDOWN, "growsdown" }, \
  138. {VM_UFFD_MISSING, "uffd_missing" }, \
  139. {VM_PFNMAP, "pfnmap" }, \
  140. {VM_DENYWRITE, "denywrite" }, \
  141. {VM_UFFD_WP, "uffd_wp" }, \
  142. {VM_LOCKED, "locked" }, \
  143. {VM_IO, "io" }, \
  144. {VM_SEQ_READ, "seqread" }, \
  145. {VM_RAND_READ, "randread" }, \
  146. {VM_DONTCOPY, "dontcopy" }, \
  147. {VM_DONTEXPAND, "dontexpand" }, \
  148. {VM_LOCKONFAULT, "lockonfault" }, \
  149. {VM_ACCOUNT, "account" }, \
  150. {VM_NORESERVE, "noreserve" }, \
  151. {VM_HUGETLB, "hugetlb" }, \
  152. __VM_ARCH_SPECIFIC_1 , \
  153. __VM_ARCH_SPECIFIC_2 , \
  154. {VM_DONTDUMP, "dontdump" }, \
  155. IF_HAVE_VM_SOFTDIRTY(VM_SOFTDIRTY, "softdirty" ) \
  156. {VM_MIXEDMAP, "mixedmap" }, \
  157. {VM_HUGEPAGE, "hugepage" }, \
  158. {VM_NOHUGEPAGE, "nohugepage" }, \
  159. {VM_MERGEABLE, "mergeable" } \
  160. #define show_vma_flags(flags) \
  161. (flags) ? __print_flags(flags, "|", \
  162. __def_vmaflag_names \
  163. ) : "none"