blob: c5917f040fa7ba56a8229a45c4134ae9a79535ea [file] [log] [blame]
Dan Williamsf295e532016-06-17 11:08:06 -07001#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
Dan Williamsf295e532016-06-17 11:08:06 -07008/* this definition is in it's own header for tools/testing/nvdimm to consume */
9struct pmem_device {
10 /* One contiguous memory region per device */
11 phys_addr_t phys_addr;
12 /* when non-zero this device is hosting a 'pfn' instance */
13 phys_addr_t data_offset;
14 u64 pfn_flags;
Dan Williams7a9eb202016-06-03 18:06:47 -070015 void *virt_addr;
Dan Williamsf295e532016-06-17 11:08:06 -070016 /* immutable base size of the namespace */
17 size_t size;
18 /* trim size when namespace capacity has been section aligned */
19 u32 pfn_pad;
Toshi Kani975750a2017-06-12 16:25:11 -060020 struct kernfs_node *bb_state;
Dan Williamsf295e532016-06-17 11:08:06 -070021 struct badblocks bb;
Dan Williamsc1d6e822017-01-24 23:02:09 -080022 struct dax_device *dax_dev;
23 struct gendisk *disk;
Dan Williamsf295e532016-06-17 11:08:06 -070024};
Dan Williamsc1d6e822017-01-24 23:02:09 -080025
26long __pmem_direct_access(struct pmem_device *pmem, pgoff_t pgoff,
27 long nr_pages, void **kaddr, pfn_t *pfn);
Dan Williamsf295e532016-06-17 11:08:06 -070028#endif /* __NVDIMM_PMEM_H__ */