summaryrefslogtreecommitdiff
path: root/include/linux/mmzone.h
diff options
context:
space:
mode:
authorDave Hansen <haveblue@us.ibm.com>2005-06-23 11:07:40 +0400
committerLinus Torvalds <torvalds@ppc970.osdl.org>2005-06-23 20:45:01 +0400
commit348f8b6c4837a07304d2f72b11ce8d96588065e0 (patch)
treef4c6c332b2c327630b284598325dff2f44e6c9cf /include/linux/mmzone.h
parent6f167ec721108c9282d54424516a12c805e3c306 (diff)
downloadlinux-348f8b6c4837a07304d2f72b11ce8d96588065e0.tar.xz
[PATCH] sparsemem base: reorganize page->flags bit operations
Generify the value fields in the page_flags. The aim is to allow the location and size of these fields to be varied. Additionally we want to move away from fixed allocations per field whilst still enforcing the overall bit utilisation limits. We rely on the compiler to spot and optimise the accessor functions. Signed-off-by: Andy Whitcroft <apw@shadowen.org> Signed-off-by: Dave Hansen <haveblue@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/mmzone.h')
-rw-r--r--include/linux/mmzone.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index b79633d3a97b..39e912708e2a 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -414,30 +414,25 @@ extern struct pglist_data contig_page_data;
#include <asm/mmzone.h>
+#endif /* !CONFIG_DISCONTIGMEM */
+
#if BITS_PER_LONG == 32 || defined(ARCH_HAS_ATOMIC_UNSIGNED)
/*
* with 32 bit page->flags field, we reserve 8 bits for node/zone info.
* there are 3 zones (2 bits) and this leaves 8-2=6 bits for nodes.
*/
-#define MAX_NODES_SHIFT 6
+#define FLAGS_RESERVED 8
+
#elif BITS_PER_LONG == 64
/*
* with 64 bit flags field, there's plenty of room.
*/
-#define MAX_NODES_SHIFT 10
-#endif
+#define FLAGS_RESERVED 32
-#endif /* !CONFIG_DISCONTIGMEM */
-
-#if NODES_SHIFT > MAX_NODES_SHIFT
-#error NODES_SHIFT > MAX_NODES_SHIFT
-#endif
+#else
-/* There are currently 3 zones: DMA, Normal & Highmem, thus we need 2 bits */
-#define MAX_ZONES_SHIFT 2
+#error BITS_PER_LONG not defined
-#if ZONES_SHIFT > MAX_ZONES_SHIFT
-#error ZONES_SHIFT > MAX_ZONES_SHIFT
#endif
#endif /* !__ASSEMBLY__ */