The highest bits of the _count field in struct page_info contain some
page specific flags. However, since they are allocated from top to bottom,
we need some infrastructure to get their values right on all platforms,
namely a macro that defines the size of a "long" value.

Signed-off-by: Petr Tesarik <[email protected]>

---
 makedumpfile.h |   19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

--- a/makedumpfile.h
+++ b/makedumpfile.h
@@ -78,6 +78,12 @@ int get_mem_type(void);
 #define LSEEKED_PDATA  (3)
 
 /*
+ * Xen page flags
+ */
+#define PG_shift(idx)  (BITS_PER_LONG - (idx))
+#define PG_mask(x, idx)        (x ## UL << PG_shift(idx))
+
+/*
  * Memory flags
  */
 #define MEMORY_PAGETABLE_4L    (1 << 0)
@@ -426,6 +432,8 @@ do { \
 #define VMEMMAP_END            (info->vmemmap_end)
 
 #ifdef __arm__
+#define BITS_PER_LONG          32
+
 #define KVBASE_MASK            (0xffff)
 #define KVBASE                 (SYMBOL(_stext) & ~KVBASE_MASK)
 #define _SECTION_SIZE_BITS     (28)
@@ -443,6 +451,8 @@ do { \
 #endif /* arm */
 
 #ifdef __x86__
+#define BITS_PER_LONG          32
+
 #define __PAGE_OFFSET          (0xc0000000)
 #define __VMALLOC_RESERVE       (128 << 20)
 #define MAXMEM                  (-PAGE_OFFSET-__VMALLOC_RESERVE)
@@ -474,6 +484,8 @@ do { \
 #endif /* x86 */
 
 #ifdef __x86_64__
+#define BITS_PER_LONG          64
+
 #define __PAGE_OFFSET_ORIG     (0xffff810000000000) /* 2.6.26, or former */
 #define __PAGE_OFFSET_2_6_27   (0xffff880000000000) /* 2.6.27, or later  */
 
@@ -523,6 +535,8 @@ do { \
 #endif /* x86_64 */
 
 #ifdef __powerpc64__
+#define BITS_PER_LONG          64
+
 #define __PAGE_OFFSET          (0xc000000000000000)
 #define KERNELBASE             PAGE_OFFSET
 #define VMALLOCBASE            (0xD000000000000000)
@@ -532,6 +546,7 @@ do { \
 #endif
 
 #ifdef __powerpc32__
+#define BITS_PER_LONG          32
 
 #define __PAGE_OFFSET          (0xc0000000)
 #define KERNELBASE             PAGE_OFFSET
@@ -543,6 +558,8 @@ do { \
 #endif
 
 #ifdef __s390x__
+#define BITS_PER_LONG          64
+
 #define __PAGE_OFFSET          (info->page_size - 1)
 #define KERNELBASE             (0)
 #define KVBASE                 KERNELBASE
@@ -583,6 +600,8 @@ do { \
 #endif /* __s390x__ */
 
 #ifdef __ia64__ /* ia64 */
+#define BITS_PER_LONG          64
+
 #define REGION_SHIFT           (61)
 
 #define KERNEL_CACHED_REGION   (7)



_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec

Reply via email to