1 /* SPDX-License-Identifier: GPL-2.0 */
2 #ifndef __NVDIMM_PMEM_H__
3 #define __NVDIMM_PMEM_H__
4 #include <linux/page-flags.h>
5 #include <linux/badblocks.h>
6 #include <linux/types.h>
7 #include <linux/pfn_t.h>
10 /* this definition is in it's own header for tools/testing/nvdimm to consume */
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
;
18 /* immutable base size of the namespace */
20 /* trim size when namespace capacity has been section aligned */
22 struct kernfs_node
*bb_state
;
24 struct dax_device
*dax_dev
;
26 struct dev_pagemap pgmap
;
29 long __pmem_direct_access(struct pmem_device
*pmem
, pgoff_t pgoff
,
30 long nr_pages
, void **kaddr
, pfn_t
*pfn
);
32 #ifdef CONFIG_MEMORY_FAILURE
33 static inline bool test_and_clear_pmem_poison(struct page
*page
)
35 return TestClearPageHWPoison(page
);
38 static inline bool test_and_clear_pmem_poison(struct page
*page
)
43 #endif /* __NVDIMM_PMEM_H__ */