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

TOMOYO Linux Cross Reference
Linux/include/linux/memregion.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 #ifndef _MEMREGION_H_
  3 #define _MEMREGION_H_
  4 #include <linux/types.h>
  5 #include <linux/errno.h>
  6 #include <linux/range.h>
  7 #include <linux/bug.h>
  8 
  9 struct memregion_info {
 10         int target_node;
 11         struct range range;
 12 };
 13 
 14 #ifdef CONFIG_MEMREGION
 15 int memregion_alloc(gfp_t gfp);
 16 void memregion_free(int id);
 17 #else
 18 static inline int memregion_alloc(gfp_t gfp)
 19 {
 20         return -ENOMEM;
 21 }
 22 static inline void memregion_free(int id)
 23 {
 24 }
 25 #endif
 26 
 27 /**
 28  * cpu_cache_invalidate_memregion - drop any CPU cached data for
 29  *     memregions described by @res_desc
 30  * @res_desc: one of the IORES_DESC_* types
 31  *
 32  * Perform cache maintenance after a memory event / operation that
 33  * changes the contents of physical memory in a cache-incoherent manner.
 34  * For example, device memory technologies like NVDIMM and CXL have
 35  * device secure erase, and dynamic region provision that can replace
 36  * the memory mapped to a given physical address.
 37  *
 38  * Limit the functionality to architectures that have an efficient way
 39  * to writeback and invalidate potentially terabytes of address space at
 40  * once.  Note that this routine may or may not write back any dirty
 41  * contents while performing the invalidation. It is only exported for
 42  * the explicit usage of the NVDIMM and CXL modules in the 'DEVMEM'
 43  * symbol namespace on bare platforms.
 44  *
 45  * Returns 0 on success or negative error code on a failure to perform
 46  * the cache maintenance.
 47  */
 48 #ifdef CONFIG_ARCH_HAS_CPU_CACHE_INVALIDATE_MEMREGION
 49 int cpu_cache_invalidate_memregion(int res_desc);
 50 bool cpu_cache_has_invalidate_memregion(void);
 51 #else
 52 static inline bool cpu_cache_has_invalidate_memregion(void)
 53 {
 54         return false;
 55 }
 56 
 57 static inline int cpu_cache_invalidate_memregion(int res_desc)
 58 {
 59         WARN_ON_ONCE("CPU cache invalidation required");
 60         return -ENXIO;
 61 }
 62 #endif
 63 #endif /* _MEMREGION_H_ */
 64 

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