summaryrefslogtreecommitdiff
path: root/packages/linux/nslu2-kernel/2.6.15/00-memory-h-page-shift.patch
blob: 30d34952d5a89cd5d2418eea9b5c7978c26fc7d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=3218/1

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>
 
--- linux-2.6.15-rc7/include/asm-arm/arch-ixp4xx/memory.h~	2005-12-30 05:18:27.000000000 +1030
+++ linux-2.6.15-rc7/include/asm-arm/arch-ixp4xx/memory.h	2005-12-30 05:36:04.000000000 +1030
@@ -16,31 +16,10 @@
 
 #ifndef __ASSEMBLY__
 
-/*
- * Only first 64MB of memory can be accessed via PCI.
- * We use GFP_DMA to allocate safe buffers to do map/unmap.
- * This is really ugly and we need a better way of specifying
- * DMA-capable regions of memory.
- */
-static inline void __arch_adjust_zones(int node, unsigned long *zone_size, 
-	unsigned long *zhole_size) 
-{
-	unsigned int sz = SZ_64M >> PAGE_SHIFT;
-
-	/*
-	 * Only adjust if > 64M on current system
-	 */
-	if (node || (zone_size[0] <= sz))
-		return;
-
-	zone_size[1] = zone_size[0] - sz;
-	zone_size[0] = sz;
-	zhole_size[1] = zhole_size[0];
-	zhole_size[0] = 0;
-}
+void ixp4xx_adjust_zones(int node, unsigned long *size, unsigned long *holes);
 
 #define arch_adjust_zones(node, size, holes) \
-	__arch_adjust_zones(node, size, holes)
+	ixp4xx_adjust_zones(node, size, holes)
 
 #define ISA_DMA_THRESHOLD (SZ_64M - 1)
 
--- linux-2.6.15-rc7/arch/arm/mach-ixp4xx/common-pci.c~	2005-12-30 05:16:03.000000000 +1030
+++ linux-2.6.15-rc7/arch/arm/mach-ixp4xx/common-pci.c	2005-12-30 05:43:55.000000000 +1030
@@ -341,6 +341,29 @@ int dma_needs_bounce(struct device *dev,
 	return (dev->bus == &pci_bus_type ) && ((dma_addr + size) >= SZ_64M);
 }
 
+/*
+ * Only first 64MB of memory can be accessed via PCI.
+ * We use GFP_DMA to allocate safe buffers to do map/unmap.
+ * This is really ugly and we need a better way of specifying
+ * DMA-capable regions of memory.
+ */
+void __init ixp4xx_adjust_zones(int node, unsigned long *zone_size, 
+	unsigned long *zhole_size) 
+{
+	unsigned int sz = SZ_64M >> PAGE_SHIFT;
+
+	/*
+	 * Only adjust if > 64M on current system
+	 */
+	if (node || (zone_size[0] <= sz))
+		return;
+
+	zone_size[1] = zone_size[0] - sz;
+	zone_size[0] = sz;
+	zhole_size[1] = zhole_size[0];
+	zhole_size[0] = 0;
+}
+
 void __init ixp4xx_pci_preinit(void)
 {  
 	unsigned long processor_id;