aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRod Whitby <rod@whitby.id.au>2006-01-04 12:17:13 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2006-01-04 12:17:13 -0500
commit313cbb5519405966e3e65fca86c0305ab24f2a3b (patch)
tree949bb8daf7a32d5921cabe9d129df1d6342d40da
parent8d27e6992bc6a7ca7eaa1d29fb1a8d6cb6022c45 (diff)
[ARM] 3218/1: PAGE_SHIFT undeclared in arch-ixp4xx/memory.h (adjust_zones moved out of line)
Patch from Rod Whitby PAGE_SHIFT is undeclared in include/asm-arm/arch-ixp4xx/memory.h, identified by the following kernel compilation error: CC [M] sound/core/memory.o In file included from include/asm/memory.h:27, from include/asm/io.h:28, from sound/core/memory.c:24: include/asm/arch/memory.h: In function `__arch_adjust_zones': include/asm/arch/memory.h:28: error: `PAGE_SHIFT' undeclared (first use in this function) This patch replaces my previous attempt at fixing this problem (Patch 3214/1) and is based on the following feedback: Russell King wrote: > The error you see came up on SA1100. The best solution was to move > the __arch_adjust_zones() function out of line. I suggest ixp4xx > does the same. I have moved the function out of line into arch/arm/mach-ixp4xx/common-pci.c as suggested. Signed-off-by: Rod Whitby <rod@whitby.id.au> Signed-off-by: Deepak Saxena <dsaxena@plexity.net> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
-rw-r--r--arch/arm/mach-ixp4xx/common-pci.c23
-rw-r--r--include/asm-arm/arch-ixp4xx/memory.h25
2 files changed, 25 insertions, 23 deletions
diff --git a/arch/arm/mach-ixp4xx/common-pci.c b/arch/arm/mach-ixp4xx/common-pci.c
index 9795da270e3a..6e3462ed5306 100644
--- a/arch/arm/mach-ixp4xx/common-pci.c
+++ b/arch/arm/mach-ixp4xx/common-pci.c
@@ -341,6 +341,29 @@ int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size)
341 return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M); 341 return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M);
342} 342}
343 343
344/*
345 * Only first 64MB of memory can be accessed via PCI.
346 * We use GFP_DMA to allocate safe buffers to do map/unmap.
347 * This is really ugly and we need a better way of specifying
348 * DMA-capable regions of memory.
349 */
350void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size,
351 unsigned long *zhole_size)
352{
353 unsigned int sz = SZ_64M >> PAGE_SHIFT;
354
355 /*
356 * Only adjust if > 64M on current system
357 */
358 if (node || (zone_size[0] <= sz))
359 return;
360
361 zone_size[1] = zone_size[0] - sz;
362 zone_size[0] = sz;
363 zhole_size[1] = zhole_size[0];
364 zhole_size[0] = 0;
365}
366
344void __init ixp4xx_pci_preinit(void) 367void __init ixp4xx_pci_preinit(void)
345{ 368{
346 unsigned long processor_id; 369 unsigned long processor_id;
diff --git a/include/asm-arm/arch-ixp4xx/memory.h b/include/asm-arm/arch-ixp4xx/memory.h
index e024d0a1a669..ee211d28a3ef 100644
--- a/include/asm-arm/arch-ixp4xx/memory.h
+++ b/include/asm-arm/arch-ixp4xx/memory.h
@@ -16,31 +16,10 @@
16 16
17#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
18 18
19/* 19void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes);
20 * Only first 64MB of memory can be accessed via PCI.
21 * We use GFP_DMA to allocate safe buffers to do map/unmap.
22 * This is really ugly and we need a better way of specifying
23 * DMA-capable regions of memory.
24 */
25static inline void __arch_adjust_zones(int node, unsigned long *zone_size,
26 unsigned long *zhole_size)
27{
28 unsigned int sz = SZ_64M >> PAGE_SHIFT;
29
30 /*
31 * Only adjust if > 64M on current system
32 */
33 if (node || (zone_size[0] <= sz))
34 return;
35
36 zone_size[1] = zone_size[0] - sz;
37 zone_size[0] = sz;
38 zhole_size[1] = zhole_size[0];
39 zhole_size[0] = 0;
40}
41 20
42#define arch_adjust_zones(node, size, holes) \ 21#define arch_adjust_zones(node, size, holes) \
43 __arch_adjust_zones(node, size, holes) 22 ixp4xx_adjust_zones(node, size, holes)
44 23
45#define ISA_DMA_THRESHOLD (SZ_64M - 1) 24#define ISA_DMA_THRESHOLD (SZ_64M - 1)
46 25