Dan Williams | f295e53 | 2016-06-17 11:08:06 -0700 | [diff] [blame] | 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 | |
| 8 | long pmem_direct_access(struct block_device *bdev, sector_t sector, |
Dan Williams | 7a9eb20 | 2016-06-03 18:06:47 -0700 | [diff] [blame] | 9 | void **kaddr, pfn_t *pfn, long size); |
Dan Williams | f295e53 | 2016-06-17 11:08:06 -0700 | [diff] [blame] | 10 | /* this definition is in it's own header for tools/testing/nvdimm to consume */ |
| 11 | struct pmem_device { |
| 12 | /* One contiguous memory region per device */ |
| 13 | phys_addr_t phys_addr; |
| 14 | /* when non-zero this device is hosting a 'pfn' instance */ |
| 15 | phys_addr_t data_offset; |
| 16 | u64 pfn_flags; |
Dan Williams | 7a9eb20 | 2016-06-03 18:06:47 -0700 | [diff] [blame] | 17 | void *virt_addr; |
Dan Williams | f295e53 | 2016-06-17 11:08:06 -0700 | [diff] [blame] | 18 | /* immutable base size of the namespace */ |
| 19 | size_t size; |
| 20 | /* trim size when namespace capacity has been section aligned */ |
| 21 | u32 pfn_pad; |
| 22 | struct badblocks bb; |
| 23 | }; |
| 24 | #endif /* __NVDIMM_PMEM_H__ */ |