pmem.h 979 B

1234567891011121314151617181920212223242526272829303132333435
  1. #ifndef __NVDIMM_PMEM_H__
  2. #define __NVDIMM_PMEM_H__
  3. #include <linux/badblocks.h>
  4. #include <linux/types.h>
  5. #include <linux/pfn_t.h>
  6. #include <linux/fs.h>
  7. #ifdef CONFIG_ARCH_HAS_PMEM_API
  8. void arch_wb_cache_pmem(void *addr, size_t size);
  9. #else
  10. static inline void arch_wb_cache_pmem(void *addr, size_t size)
  11. {
  12. }
  13. #endif
  14. /* this definition is in it's own header for tools/testing/nvdimm to consume */
  15. struct pmem_device {
  16. /* One contiguous memory region per device */
  17. phys_addr_t phys_addr;
  18. /* when non-zero this device is hosting a 'pfn' instance */
  19. phys_addr_t data_offset;
  20. u64 pfn_flags;
  21. void *virt_addr;
  22. /* immutable base size of the namespace */
  23. size_t size;
  24. /* trim size when namespace capacity has been section aligned */
  25. u32 pfn_pad;
  26. struct badblocks bb;
  27. struct dax_device *dax_dev;
  28. struct gendisk *disk;
  29. };
  30. long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
  31. long nr_pages, void **kaddr, pfn_t *pfn);
  32. #endif /* __NVDIMM_PMEM_H__ */