diff options
author | Konstantin Khlebnikov <khlebnikov@yandex-team.ru> | 2015-09-08 18:00:02 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-09-08 18:35:28 -0400 |
commit | deb945441b9408d6cd15751f5232eeca9f50a5a1 (patch) | |
tree | cc048946ed53eaf107ff451583d8f2f0b634e0f0 /tools/vm | |
parent | a06db751c321546e5563041956a57613259c6720 (diff) |
pagemap: switch to the new format and do some cleanup
This patch removes page-shift bits (scheduled to remove since 3.11) and
completes migration to the new bit layout. Also it cleans messy macro.
Signed-off-by: Konstantin Khlebnikov <khlebnikov@yandex-team.ru>
Reviewed-by: Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>
Cc: Mark Williamson <mwilliamson@undo-software.com>
Tested-by: Mark Williamson <mwilliamson@undo-software.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'tools/vm')
-rw-r--r-- | tools/vm/page-types.c | 25 |
1 files changed, 8 insertions, 17 deletions
diff --git a/tools/vm/page-types.c b/tools/vm/page-types.c index 8bdf16b8ba60..603ec916716b 100644 --- a/tools/vm/page-types.c +++ b/tools/vm/page-types.c | |||
@@ -57,23 +57,14 @@ | |||
57 | * pagemap kernel ABI bits | 57 | * pagemap kernel ABI bits |
58 | */ | 58 | */ |
59 | 59 | ||
60 | #define PM_ENTRY_BYTES sizeof(uint64_t) | 60 | #define PM_ENTRY_BYTES 8 |
61 | #define PM_STATUS_BITS 3 | 61 | #define PM_PFRAME_BITS 55 |
62 | #define PM_STATUS_OFFSET (64 - PM_STATUS_BITS) | 62 | #define PM_PFRAME_MASK ((1LL << PM_PFRAME_BITS) - 1) |
63 | #define PM_STATUS_MASK (((1LL << PM_STATUS_BITS) - 1) << PM_STATUS_OFFSET) | 63 | #define PM_PFRAME(x) ((x) & PM_PFRAME_MASK) |
64 | #define PM_STATUS(nr) (((nr) << PM_STATUS_OFFSET) & PM_STATUS_MASK) | 64 | #define PM_SOFT_DIRTY (1ULL << 55) |
65 | #define PM_PSHIFT_BITS 6 | 65 | #define PM_FILE (1ULL << 61) |
66 | #define PM_PSHIFT_OFFSET (PM_STATUS_OFFSET - PM_PSHIFT_BITS) | 66 | #define PM_SWAP (1ULL << 62) |
67 | #define PM_PSHIFT_MASK (((1LL << PM_PSHIFT_BITS) - 1) << PM_PSHIFT_OFFSET) | 67 | #define PM_PRESENT (1ULL << 63) |
68 | #define __PM_PSHIFT(x) (((uint64_t) (x) << PM_PSHIFT_OFFSET) & PM_PSHIFT_MASK) | ||
69 | #define PM_PFRAME_MASK ((1LL << PM_PSHIFT_OFFSET) - 1) | ||
70 | #define PM_PFRAME(x) ((x) & PM_PFRAME_MASK) | ||
71 | |||
72 | #define __PM_SOFT_DIRTY (1LL) | ||
73 | #define PM_PRESENT PM_STATUS(4LL) | ||
74 | #define PM_SWAP PM_STATUS(2LL) | ||
75 | #define PM_SOFT_DIRTY __PM_PSHIFT(__PM_SOFT_DIRTY) | ||
76 | |||
77 | 68 | ||
78 | /* | 69 | /* |
79 | * kernel page flags | 70 | * kernel page flags |