diff options
author | Yinghai Lu <yinghai@kernel.org> | 2010-07-12 00:36:09 -0400 |
---|---|---|
committer | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2010-07-14 03:14:00 -0400 |
commit | 95f72d1ed41a66f1c1c29c24d479de81a0bea36f (patch) | |
tree | bd92b3804ff0bea083d69af0ede52f99ab34c0af /arch/powerpc/platforms/pseries | |
parent | 1c5474a65bf15a4cb162dfff86d6d0b5a08a740c (diff) |
lmb: rename to memblock
via following scripts
FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')
sed -i \
-e 's/lmb/memblock/g' \
-e 's/LMB/MEMBLOCK/g' \
$FILES
for N in $(find . -name lmb.[ch]); do
M=$(echo $N | sed 's/lmb/memblock/g')
mv $N $M
done
and remove some wrong change like lmbench and dlmb etc.
also move memblock.c from lib/ to mm/
Suggested-by: Ingo Molnar <mingo@elte.hu>
Acked-by: "H. Peter Anvin" <hpa@zytor.com>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Acked-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc/platforms/pseries')
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-memory.c | 38 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/iommu.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/phyp_dump.c | 4 |
3 files changed, 22 insertions, 22 deletions
diff --git a/arch/powerpc/platforms/pseries/hotplug-memory.c b/arch/powerpc/platforms/pseries/hotplug-memory.c index 01e7b5bb3c1d..deab5f946090 100644 --- a/arch/powerpc/platforms/pseries/hotplug-memory.c +++ b/arch/powerpc/platforms/pseries/hotplug-memory.c | |||
@@ -10,14 +10,14 @@ | |||
10 | */ | 10 | */ |
11 | 11 | ||
12 | #include <linux/of.h> | 12 | #include <linux/of.h> |
13 | #include <linux/lmb.h> | 13 | #include <linux/memblock.h> |
14 | #include <linux/vmalloc.h> | 14 | #include <linux/vmalloc.h> |
15 | #include <asm/firmware.h> | 15 | #include <asm/firmware.h> |
16 | #include <asm/machdep.h> | 16 | #include <asm/machdep.h> |
17 | #include <asm/pSeries_reconfig.h> | 17 | #include <asm/pSeries_reconfig.h> |
18 | #include <asm/sparsemem.h> | 18 | #include <asm/sparsemem.h> |
19 | 19 | ||
20 | static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) | 20 | static int pseries_remove_memblock(unsigned long base, unsigned int memblock_size) |
21 | { | 21 | { |
22 | unsigned long start, start_pfn; | 22 | unsigned long start, start_pfn; |
23 | struct zone *zone; | 23 | struct zone *zone; |
@@ -26,7 +26,7 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) | |||
26 | start_pfn = base >> PAGE_SHIFT; | 26 | start_pfn = base >> PAGE_SHIFT; |
27 | 27 | ||
28 | if (!pfn_valid(start_pfn)) { | 28 | if (!pfn_valid(start_pfn)) { |
29 | lmb_remove(base, lmb_size); | 29 | memblock_remove(base, memblock_size); |
30 | return 0; | 30 | return 0; |
31 | } | 31 | } |
32 | 32 | ||
@@ -41,20 +41,20 @@ static int pseries_remove_lmb(unsigned long base, unsigned int lmb_size) | |||
41 | * to sysfs "state" file and we can't remove sysfs entries | 41 | * to sysfs "state" file and we can't remove sysfs entries |
42 | * while writing to it. So we have to defer it to here. | 42 | * while writing to it. So we have to defer it to here. |
43 | */ | 43 | */ |
44 | ret = __remove_pages(zone, start_pfn, lmb_size >> PAGE_SHIFT); | 44 | ret = __remove_pages(zone, start_pfn, memblock_size >> PAGE_SHIFT); |
45 | if (ret) | 45 | if (ret) |
46 | return ret; | 46 | return ret; |
47 | 47 | ||
48 | /* | 48 | /* |
49 | * Update memory regions for memory remove | 49 | * Update memory regions for memory remove |
50 | */ | 50 | */ |
51 | lmb_remove(base, lmb_size); | 51 | memblock_remove(base, memblock_size); |
52 | 52 | ||
53 | /* | 53 | /* |
54 | * Remove htab bolted mappings for this section of memory | 54 | * Remove htab bolted mappings for this section of memory |
55 | */ | 55 | */ |
56 | start = (unsigned long)__va(base); | 56 | start = (unsigned long)__va(base); |
57 | ret = remove_section_mapping(start, start + lmb_size); | 57 | ret = remove_section_mapping(start, start + memblock_size); |
58 | 58 | ||
59 | /* Ensure all vmalloc mappings are flushed in case they also | 59 | /* Ensure all vmalloc mappings are flushed in case they also |
60 | * hit that section of memory | 60 | * hit that section of memory |
@@ -69,7 +69,7 @@ static int pseries_remove_memory(struct device_node *np) | |||
69 | const char *type; | 69 | const char *type; |
70 | const unsigned int *regs; | 70 | const unsigned int *regs; |
71 | unsigned long base; | 71 | unsigned long base; |
72 | unsigned int lmb_size; | 72 | unsigned int memblock_size; |
73 | int ret = -EINVAL; | 73 | int ret = -EINVAL; |
74 | 74 | ||
75 | /* | 75 | /* |
@@ -80,16 +80,16 @@ static int pseries_remove_memory(struct device_node *np) | |||
80 | return 0; | 80 | return 0; |
81 | 81 | ||
82 | /* | 82 | /* |
83 | * Find the bae address and size of the lmb | 83 | * Find the bae address and size of the memblock |
84 | */ | 84 | */ |
85 | regs = of_get_property(np, "reg", NULL); | 85 | regs = of_get_property(np, "reg", NULL); |
86 | if (!regs) | 86 | if (!regs) |
87 | return ret; | 87 | return ret; |
88 | 88 | ||
89 | base = *(unsigned long *)regs; | 89 | base = *(unsigned long *)regs; |
90 | lmb_size = regs[3]; | 90 | memblock_size = regs[3]; |
91 | 91 | ||
92 | ret = pseries_remove_lmb(base, lmb_size); | 92 | ret = pseries_remove_memblock(base, memblock_size); |
93 | return ret; | 93 | return ret; |
94 | } | 94 | } |
95 | 95 | ||
@@ -98,7 +98,7 @@ static int pseries_add_memory(struct device_node *np) | |||
98 | const char *type; | 98 | const char *type; |
99 | const unsigned int *regs; | 99 | const unsigned int *regs; |
100 | unsigned long base; | 100 | unsigned long base; |
101 | unsigned int lmb_size; | 101 | unsigned int memblock_size; |
102 | int ret = -EINVAL; | 102 | int ret = -EINVAL; |
103 | 103 | ||
104 | /* | 104 | /* |
@@ -109,43 +109,43 @@ static int pseries_add_memory(struct device_node *np) | |||
109 | return 0; | 109 | return 0; |
110 | 110 | ||
111 | /* | 111 | /* |
112 | * Find the base and size of the lmb | 112 | * Find the base and size of the memblock |
113 | */ | 113 | */ |
114 | regs = of_get_property(np, "reg", NULL); | 114 | regs = of_get_property(np, "reg", NULL); |
115 | if (!regs) | 115 | if (!regs) |
116 | return ret; | 116 | return ret; |
117 | 117 | ||
118 | base = *(unsigned long *)regs; | 118 | base = *(unsigned long *)regs; |
119 | lmb_size = regs[3]; | 119 | memblock_size = regs[3]; |
120 | 120 | ||
121 | /* | 121 | /* |
122 | * Update memory region to represent the memory add | 122 | * Update memory region to represent the memory add |
123 | */ | 123 | */ |
124 | ret = lmb_add(base, lmb_size); | 124 | ret = memblock_add(base, memblock_size); |
125 | return (ret < 0) ? -EINVAL : 0; | 125 | return (ret < 0) ? -EINVAL : 0; |
126 | } | 126 | } |
127 | 127 | ||
128 | static int pseries_drconf_memory(unsigned long *base, unsigned int action) | 128 | static int pseries_drconf_memory(unsigned long *base, unsigned int action) |
129 | { | 129 | { |
130 | struct device_node *np; | 130 | struct device_node *np; |
131 | const unsigned long *lmb_size; | 131 | const unsigned long *memblock_size; |
132 | int rc; | 132 | int rc; |
133 | 133 | ||
134 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); | 134 | np = of_find_node_by_path("/ibm,dynamic-reconfiguration-memory"); |
135 | if (!np) | 135 | if (!np) |
136 | return -EINVAL; | 136 | return -EINVAL; |
137 | 137 | ||
138 | lmb_size = of_get_property(np, "ibm,lmb-size", NULL); | 138 | memblock_size = of_get_property(np, "ibm,memblock-size", NULL); |
139 | if (!lmb_size) { | 139 | if (!memblock_size) { |
140 | of_node_put(np); | 140 | of_node_put(np); |
141 | return -EINVAL; | 141 | return -EINVAL; |
142 | } | 142 | } |
143 | 143 | ||
144 | if (action == PSERIES_DRCONF_MEM_ADD) { | 144 | if (action == PSERIES_DRCONF_MEM_ADD) { |
145 | rc = lmb_add(*base, *lmb_size); | 145 | rc = memblock_add(*base, *memblock_size); |
146 | rc = (rc < 0) ? -EINVAL : 0; | 146 | rc = (rc < 0) ? -EINVAL : 0; |
147 | } else if (action == PSERIES_DRCONF_MEM_REMOVE) { | 147 | } else if (action == PSERIES_DRCONF_MEM_REMOVE) { |
148 | rc = pseries_remove_lmb(*base, *lmb_size); | 148 | rc = pseries_remove_memblock(*base, *memblock_size); |
149 | } else { | 149 | } else { |
150 | rc = -EINVAL; | 150 | rc = -EINVAL; |
151 | } | 151 | } |
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c index d26182d42cbf..395848e30c52 100644 --- a/arch/powerpc/platforms/pseries/iommu.c +++ b/arch/powerpc/platforms/pseries/iommu.c | |||
@@ -66,7 +66,7 @@ static int tce_build_pSeries(struct iommu_table *tbl, long index, | |||
66 | tcep = ((u64 *)tbl->it_base) + index; | 66 | tcep = ((u64 *)tbl->it_base) + index; |
67 | 67 | ||
68 | while (npages--) { | 68 | while (npages--) { |
69 | /* can't move this out since we might cross LMB boundary */ | 69 | /* can't move this out since we might cross MEMBLOCK boundary */ |
70 | rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; | 70 | rpn = (virt_to_abs(uaddr)) >> TCE_SHIFT; |
71 | *tcep = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT; | 71 | *tcep = proto_tce | (rpn & TCE_RPN_MASK) << TCE_RPN_SHIFT; |
72 | 72 | ||
diff --git a/arch/powerpc/platforms/pseries/phyp_dump.c b/arch/powerpc/platforms/pseries/phyp_dump.c index 7ebd9e88d369..6e7742da0072 100644 --- a/arch/powerpc/platforms/pseries/phyp_dump.c +++ b/arch/powerpc/platforms/pseries/phyp_dump.c | |||
@@ -255,12 +255,12 @@ void invalidate_last_dump(struct phyp_dump_header *ph, unsigned long addr) | |||
255 | 255 | ||
256 | /* ------------------------------------------------- */ | 256 | /* ------------------------------------------------- */ |
257 | /** | 257 | /** |
258 | * release_memory_range -- release memory previously lmb_reserved | 258 | * release_memory_range -- release memory previously memblock_reserved |
259 | * @start_pfn: starting physical frame number | 259 | * @start_pfn: starting physical frame number |
260 | * @nr_pages: number of pages to free. | 260 | * @nr_pages: number of pages to free. |
261 | * | 261 | * |
262 | * This routine will release memory that had been previously | 262 | * This routine will release memory that had been previously |
263 | * lmb_reserved in early boot. The released memory becomes | 263 | * memblock_reserved in early boot. The released memory becomes |
264 | * available for genreal use. | 264 | * available for genreal use. |
265 | */ | 265 | */ |
266 | static void release_memory_range(unsigned long start_pfn, | 266 | static void release_memory_range(unsigned long start_pfn, |