Thomas Gleixner | 2025cf9 | 2019-05-29 07:18:02 -0700 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-only */ |
Dan Williams | e145574 | 2015-07-30 17:57:47 -0400 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (c) 2014-2015, Intel Corporation. |
Dan Williams | e145574 | 2015-07-30 17:57:47 -0400 | [diff] [blame] | 4 | */ |
| 5 | |
| 6 | #ifndef __NVDIMM_PFN_H |
| 7 | #define __NVDIMM_PFN_H |
| 8 | |
| 9 | #include <linux/types.h> |
Dan Williams | d9cbe09 | 2016-03-03 09:14:36 -0800 | [diff] [blame] | 10 | #include <linux/mmzone.h> |
Dan Williams | e145574 | 2015-07-30 17:57:47 -0400 | [diff] [blame] | 11 | |
| 12 | #define PFN_SIG_LEN 16 |
| 13 | #define PFN_SIG "NVDIMM_PFN_INFO\0" |
Dan Williams | c5ed926 | 2016-05-18 14:50:12 -0700 | [diff] [blame] | 14 | #define DAX_SIG "NVDIMM_DAX_INFO\0" |
Dan Williams | e145574 | 2015-07-30 17:57:47 -0400 | [diff] [blame] | 15 | |
| 16 | struct nd_pfn_sb { |
| 17 | u8 signature[PFN_SIG_LEN]; |
| 18 | u8 uuid[16]; |
| 19 | u8 parent_uuid[16]; |
| 20 | __le32 flags; |
| 21 | __le16 version_major; |
| 22 | __le16 version_minor; |
Dan Williams | cfe30b8 | 2016-03-03 09:38:00 -0800 | [diff] [blame] | 23 | __le64 dataoff; /* relative to namespace_base + start_pad */ |
Dan Williams | e145574 | 2015-07-30 17:57:47 -0400 | [diff] [blame] | 24 | __le64 npfns; |
| 25 | __le32 mode; |
Dan Williams | cfe30b8 | 2016-03-03 09:38:00 -0800 | [diff] [blame] | 26 | /* minor-version-1 additions for section alignment */ |
| 27 | __le32 start_pad; |
| 28 | __le32 end_trunc; |
Dan Williams | 45a0dac | 2016-03-31 15:41:18 -0700 | [diff] [blame] | 29 | /* minor-version-2 record the base alignment of the mapping */ |
| 30 | __le32 align; |
Dan Williams | 7e3e888 | 2019-07-18 15:58:36 -0700 | [diff] [blame] | 31 | /* minor-version-3 guarantee the padding and flags are zero */ |
Aneesh Kumar K.V | edbb52c | 2019-09-05 21:16:00 +0530 | [diff] [blame] | 32 | /* minor-version-4 record the page size and struct page size */ |
| 33 | __le32 page_size; |
| 34 | __le16 page_struct_size; |
| 35 | u8 padding[3994]; |
Dan Williams | e145574 | 2015-07-30 17:57:47 -0400 | [diff] [blame] | 36 | __le64 checksum; |
| 37 | }; |
Dan Williams | d9cbe09 | 2016-03-03 09:14:36 -0800 | [diff] [blame] | 38 | |
Dan Williams | e145574 | 2015-07-30 17:57:47 -0400 | [diff] [blame] | 39 | #endif /* __NVDIMM_PFN_H */ |