2 * Copyright (c) 2014-2015, Intel Corporation.
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
14 #ifndef __NVDIMM_PFN_H
15 #define __NVDIMM_PFN_H
17 #include <linux/types.h>
18 #include <linux/mmzone.h>
20 #define PFN_SIG_LEN 16
21 #define PFN_SIG "NVDIMM_PFN_INFO\0"
22 #define DAX_SIG "NVDIMM_DAX_INFO\0"
25 u8 signature
[PFN_SIG_LEN
];
31 __le64 dataoff
; /* relative to namespace_base + start_pad */
34 /* minor-version-1 additions for section alignment */
37 /* minor-version-2 record the base alignment of the mapping */
43 #ifdef CONFIG_SPARSEMEM
44 #define PFN_SECTION_ALIGN_DOWN(x) SECTION_ALIGN_DOWN(x)
45 #define PFN_SECTION_ALIGN_UP(x) SECTION_ALIGN_UP(x)
48 * In this case ZONE_DEVICE=n and we will disable 'pfn' device support,
49 * but we still want pmem to compile.
51 #define PFN_SECTION_ALIGN_DOWN(x) (x)
52 #define PFN_SECTION_ALIGN_UP(x) (x)
55 #define PHYS_SECTION_ALIGN_DOWN(x) PFN_PHYS(PFN_SECTION_ALIGN_DOWN(PHYS_PFN(x)))
56 #define PHYS_SECTION_ALIGN_UP(x) PFN_PHYS(PFN_SECTION_ALIGN_UP(PHYS_PFN(x)))
57 #endif /* __NVDIMM_PFN_H */