summaryrefslogtreecommitdiff
path: root/include/asm-arm
diff options
context:
space:
mode:
authorAndrew Morton <akpm@osdl.org>2003-10-04 21:02:34 -0700
committerLinus Torvalds <torvalds@home.osdl.org>2003-10-04 21:02:34 -0700
commitb9fa8456448312e96e993335ecb6407038ad5b03 (patch)
tree86937f0e7f1b42930a7db8e9c6dad3cd8077ff30 /include/asm-arm
parentdbe9770241821acf2c3f1961b32df766ded1169d (diff)
[PATCH] Clean up MAX_NR_NODES/NUMNODES/etc. [4/5]
From: Matthew Dobson <colpatch@us.ibm.com> Fix up the arm arch. This needs to be reviewed. Relatively straightforward replacement of NR_NODES with standard MAX_NUMNODES.
Diffstat (limited to 'include/asm-arm')
-rw-r--r--include/asm-arm/arch-clps711x/memory.h2
-rw-r--r--include/asm-arm/arch-sa1100/memory.h2
-rw-r--r--include/asm-arm/memory.h9
-rw-r--r--include/asm-arm/numnodes.h5
4 files changed, 9 insertions, 9 deletions
diff --git a/include/asm-arm/arch-clps711x/memory.h b/include/asm-arm/arch-clps711x/memory.h
index efa55531eae2..a116a7fa5232 100644
--- a/include/asm-arm/arch-clps711x/memory.h
+++ b/include/asm-arm/arch-clps711x/memory.h
@@ -109,8 +109,6 @@
* node 3: 0xd8000000 - 0xdfffffff
*/
-#define NR_NODES 4
-
/*
* Given a kernel address, find the home node of the underlying memory.
*/
diff --git a/include/asm-arm/arch-sa1100/memory.h b/include/asm-arm/arch-sa1100/memory.h
index 6303e6cce320..076b3a9d41b6 100644
--- a/include/asm-arm/arch-sa1100/memory.h
+++ b/include/asm-arm/arch-sa1100/memory.h
@@ -74,8 +74,6 @@
* node 3: 0xd8000000 - 0xdfffffff
*/
-#define NR_NODES 4
-
/*
* Given a kernel address, find the home node of the underlying memory.
*/
diff --git a/include/asm-arm/memory.h b/include/asm-arm/memory.h
index 588c47d26338..c6c9fa67479a 100644
--- a/include/asm-arm/memory.h
+++ b/include/asm-arm/memory.h
@@ -89,6 +89,9 @@ static inline void *phys_to_virt(unsigned long x)
* This is more complex. We have a set of mem_map arrays spread
* around in memory.
*/
+#include <asm/numnodes.h>
+#define NUM_NODES (1 << NODES_SHIFT)
+
#define page_to_pfn(page) \
(( (page) - page_zone(page)->zone_mem_map) \
+ page_zone(page)->zone_start_pfn)
@@ -96,12 +99,12 @@ static inline void *phys_to_virt(unsigned long x)
#define pfn_to_page(pfn) \
(PFN_TO_MAPBASE(pfn) + LOCAL_MAP_NR((pfn) << PAGE_SHIFT))
-#define pfn_valid(pfn) (PFN_TO_NID(pfn) < NR_NODES)
+#define pfn_valid(pfn) (PFN_TO_NID(pfn) < NUM_NODES)
#define virt_to_page(kaddr) \
(ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr))
-#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < NR_NODES)
+#define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < NUM_NODES)
/*
* Common discontigmem stuff.
@@ -109,6 +112,8 @@ static inline void *phys_to_virt(unsigned long x)
*/
#define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT)
+#undef NUM_NODES
+
#endif
/*
diff --git a/include/asm-arm/numnodes.h b/include/asm-arm/numnodes.h
index 4c12812f73dc..609f73b00b6a 100644
--- a/include/asm-arm/numnodes.h
+++ b/include/asm-arm/numnodes.h
@@ -10,8 +10,7 @@
#ifndef __ASM_ARM_NUMNODES_H
#define __ASM_ARM_NUMNODES_H
-#include <asm/memory.h>
-
-#define MAX_NUMNODES NR_NODES
+/* Max 4 Nodes */
+#define NODES_SHIFT 2
#endif