diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-05-07 12:40:33 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-07-16 05:57:35 -0400 |
commit | be370302742ff9948f2a42b15cb2ba174d97b930 (patch) | |
tree | 977bfa71c1e1483c22a40d85dfd3b233e5ac5d06 /arch/arm/include | |
parent | 7961239599de71130c852ecfa9a4140f3f60547b (diff) |
ARM: Remove DISCONTIGMEM support
Everything should now be using sparsemem rather than discontigmem, so
remove the code supporting discontigmem from ARM.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/memory.h | 65 | ||||
-rw-r--r-- | arch/arm/include/asm/mmzone.h | 30 | ||||
-rw-r--r-- | arch/arm/include/asm/setup.h | 8 |
3 files changed, 3 insertions, 100 deletions
diff --git a/arch/arm/include/asm/memory.h b/arch/arm/include/asm/memory.h index 4312ee5e3d0b..e263ec7c5dcb 100644 --- a/arch/arm/include/asm/memory.h +++ b/arch/arm/include/asm/memory.h | |||
@@ -234,76 +234,11 @@ static inline __deprecated void *bus_to_virt(unsigned long x) | |||
234 | * virt_to_page(k) convert a _valid_ virtual address to struct page * | 234 | * virt_to_page(k) convert a _valid_ virtual address to struct page * |
235 | * virt_addr_valid(k) indicates whether a virtual address is valid | 235 | * virt_addr_valid(k) indicates whether a virtual address is valid |
236 | */ | 236 | */ |
237 | #ifndef CONFIG_DISCONTIGMEM | ||
238 | |||
239 | #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET | 237 | #define ARCH_PFN_OFFSET PHYS_PFN_OFFSET |
240 | 238 | ||
241 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) | 239 | #define virt_to_page(kaddr) pfn_to_page(__pa(kaddr) >> PAGE_SHIFT) |
242 | #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) | 240 | #define virt_addr_valid(kaddr) ((unsigned long)(kaddr) >= PAGE_OFFSET && (unsigned long)(kaddr) < (unsigned long)high_memory) |
243 | 241 | ||
244 | #define PHYS_TO_NID(addr) (0) | ||
245 | |||
246 | #else /* CONFIG_DISCONTIGMEM */ | ||
247 | |||
248 | /* | ||
249 | * This is more complex. We have a set of mem_map arrays spread | ||
250 | * around in memory. | ||
251 | */ | ||
252 | #include <linux/numa.h> | ||
253 | |||
254 | #define arch_pfn_to_nid(pfn) PFN_TO_NID(pfn) | ||
255 | #define arch_local_page_offset(pfn, nid) LOCAL_MAP_NR((pfn) << PAGE_SHIFT) | ||
256 | |||
257 | #define virt_to_page(kaddr) \ | ||
258 | (ADDR_TO_MAPBASE(kaddr) + LOCAL_MAP_NR(kaddr)) | ||
259 | |||
260 | #define virt_addr_valid(kaddr) (KVADDR_TO_NID(kaddr) < MAX_NUMNODES) | ||
261 | |||
262 | /* | ||
263 | * Common discontigmem stuff. | ||
264 | * PHYS_TO_NID is used by the ARM kernel/setup.c | ||
265 | */ | ||
266 | #define PHYS_TO_NID(addr) PFN_TO_NID((addr) >> PAGE_SHIFT) | ||
267 | |||
268 | /* | ||
269 | * Given a kaddr, ADDR_TO_MAPBASE finds the owning node of the memory | ||
270 | * and returns the mem_map of that node. | ||
271 | */ | ||
272 | #define ADDR_TO_MAPBASE(kaddr) NODE_MEM_MAP(KVADDR_TO_NID(kaddr)) | ||
273 | |||
274 | /* | ||
275 | * Given a page frame number, find the owning node of the memory | ||
276 | * and returns the mem_map of that node. | ||
277 | */ | ||
278 | #define PFN_TO_MAPBASE(pfn) NODE_MEM_MAP(PFN_TO_NID(pfn)) | ||
279 | |||
280 | #ifdef NODE_MEM_SIZE_BITS | ||
281 | #define NODE_MEM_SIZE_MASK ((1 << NODE_MEM_SIZE_BITS) - 1) | ||
282 | |||
283 | /* | ||
284 | * Given a kernel address, find the home node of the underlying memory. | ||
285 | */ | ||
286 | #define KVADDR_TO_NID(addr) \ | ||
287 | (((unsigned long)(addr) - PAGE_OFFSET) >> NODE_MEM_SIZE_BITS) | ||
288 | |||
289 | /* | ||
290 | * Given a page frame number, convert it to a node id. | ||
291 | */ | ||
292 | #define PFN_TO_NID(pfn) \ | ||
293 | (((pfn) - PHYS_PFN_OFFSET) >> (NODE_MEM_SIZE_BITS - PAGE_SHIFT)) | ||
294 | |||
295 | /* | ||
296 | * Given a kaddr, LOCAL_MEM_MAP finds the owning node of the memory | ||
297 | * and returns the index corresponding to the appropriate page in the | ||
298 | * node's mem_map. | ||
299 | */ | ||
300 | #define LOCAL_MAP_NR(addr) \ | ||
301 | (((unsigned long)(addr) & NODE_MEM_SIZE_MASK) >> PAGE_SHIFT) | ||
302 | |||
303 | #endif /* NODE_MEM_SIZE_BITS */ | ||
304 | |||
305 | #endif /* !CONFIG_DISCONTIGMEM */ | ||
306 | |||
307 | /* | 242 | /* |
308 | * Optional coherency support. Currently used only by selected | 243 | * Optional coherency support. Currently used only by selected |
309 | * Intel XSC3-based systems. | 244 | * Intel XSC3-based systems. |
diff --git a/arch/arm/include/asm/mmzone.h b/arch/arm/include/asm/mmzone.h deleted file mode 100644 index ae63a4fd28c8..000000000000 --- a/arch/arm/include/asm/mmzone.h +++ /dev/null | |||
@@ -1,30 +0,0 @@ | |||
1 | /* | ||
2 | * arch/arm/include/asm/mmzone.h | ||
3 | * | ||
4 | * 1999-12-29 Nicolas Pitre Created | ||
5 | * | ||
6 | * This program is free software; you can redistribute it and/or modify | ||
7 | * it under the terms of the GNU General Public License version 2 as | ||
8 | * published by the Free Software Foundation. | ||
9 | */ | ||
10 | #ifndef __ASM_MMZONE_H | ||
11 | #define __ASM_MMZONE_H | ||
12 | |||
13 | /* | ||
14 | * Currently defined in arch/arm/mm/discontig.c | ||
15 | */ | ||
16 | extern pg_data_t discontig_node_data[]; | ||
17 | |||
18 | /* | ||
19 | * Return a pointer to the node data for node n. | ||
20 | */ | ||
21 | #define NODE_DATA(nid) (&discontig_node_data[nid]) | ||
22 | |||
23 | /* | ||
24 | * NODE_MEM_MAP gives the kaddr for the mem_map of the node. | ||
25 | */ | ||
26 | #define NODE_MEM_MAP(nid) (NODE_DATA(nid)->node_mem_map) | ||
27 | |||
28 | #include <mach/memory.h> | ||
29 | |||
30 | #endif | ||
diff --git a/arch/arm/include/asm/setup.h b/arch/arm/include/asm/setup.h index f392fb4437af..f1e5a9bca249 100644 --- a/arch/arm/include/asm/setup.h +++ b/arch/arm/include/asm/setup.h | |||
@@ -201,8 +201,7 @@ static struct tagtable __tagtable_##fn __tag = { tag, fn } | |||
201 | struct membank { | 201 | struct membank { |
202 | unsigned long start; | 202 | unsigned long start; |
203 | unsigned long size; | 203 | unsigned long size; |
204 | unsigned short node; | 204 | unsigned int highmem; |
205 | unsigned short highmem; | ||
206 | }; | 205 | }; |
207 | 206 | ||
208 | struct meminfo { | 207 | struct meminfo { |
@@ -212,9 +211,8 @@ struct meminfo { | |||
212 | 211 | ||
213 | extern struct meminfo meminfo; | 212 | extern struct meminfo meminfo; |
214 | 213 | ||
215 | #define for_each_nodebank(iter,mi,no) \ | 214 | #define for_each_bank(iter,mi) \ |
216 | for (iter = 0; iter < (mi)->nr_banks; iter++) \ | 215 | for (iter = 0; iter < (mi)->nr_banks; iter++) |
217 | if ((mi)->bank[iter].node == no) | ||
218 | 216 | ||
219 | #define bank_pfn_start(bank) __phys_to_pfn((bank)->start) | 217 | #define bank_pfn_start(bank) __phys_to_pfn((bank)->start) |
220 | #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size) | 218 | #define bank_pfn_end(bank) __phys_to_pfn((bank)->start + (bank)->size) |