diff options
author | Yinghai Lu <yinghai@kernel.org> | 2014-01-27 20:06:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-01-28 00:02:38 -0500 |
commit | ad6492b80f60a2139fa9bf8fd79b182fe5e3647c (patch) | |
tree | f52530fb2240679a0f88ba5047a3bedc6dacf796 /include/linux/bootmem.h | |
parent | ba635f8cd20ebc7bddf1eb8e1f4eae28a034e916 (diff) |
memblock, nobootmem: add memblock_virt_alloc_low()
The new memblock_virt APIs are used to replaced old bootmem API.
We need to allocate page below 4G for swiotlb.
That should fix regression on Andrew's system that is using swiotlb.
Signed-off-by: Yinghai Lu <yinghai@kernel.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Acked-by: Santosh Shilimkar <santosh.shilimkar@ti.com>
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: "H. Peter Anvin" <hpa@zytor.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/linux/bootmem.h')
-rw-r--r-- | include/linux/bootmem.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 2fae55def608..b388223bd4a9 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -175,6 +175,27 @@ static inline void * __init memblock_virt_alloc_nopanic( | |||
175 | NUMA_NO_NODE); | 175 | NUMA_NO_NODE); |
176 | } | 176 | } |
177 | 177 | ||
178 | #ifndef ARCH_LOW_ADDRESS_LIMIT | ||
179 | #define ARCH_LOW_ADDRESS_LIMIT 0xffffffffUL | ||
180 | #endif | ||
181 | |||
182 | static inline void * __init memblock_virt_alloc_low( | ||
183 | phys_addr_t size, phys_addr_t align) | ||
184 | { | ||
185 | return memblock_virt_alloc_try_nid(size, align, | ||
186 | BOOTMEM_LOW_LIMIT, | ||
187 | ARCH_LOW_ADDRESS_LIMIT, | ||
188 | NUMA_NO_NODE); | ||
189 | } | ||
190 | static inline void * __init memblock_virt_alloc_low_nopanic( | ||
191 | phys_addr_t size, phys_addr_t align) | ||
192 | { | ||
193 | return memblock_virt_alloc_try_nid_nopanic(size, align, | ||
194 | BOOTMEM_LOW_LIMIT, | ||
195 | ARCH_LOW_ADDRESS_LIMIT, | ||
196 | NUMA_NO_NODE); | ||
197 | } | ||
198 | |||
178 | static inline void * __init memblock_virt_alloc_from_nopanic( | 199 | static inline void * __init memblock_virt_alloc_from_nopanic( |
179 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | 200 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) |
180 | { | 201 | { |
@@ -238,6 +259,22 @@ static inline void * __init memblock_virt_alloc_nopanic( | |||
238 | return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT); | 259 | return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT); |
239 | } | 260 | } |
240 | 261 | ||
262 | static inline void * __init memblock_virt_alloc_low( | ||
263 | phys_addr_t size, phys_addr_t align) | ||
264 | { | ||
265 | if (!align) | ||
266 | align = SMP_CACHE_BYTES; | ||
267 | return __alloc_bootmem_low(size, align, BOOTMEM_LOW_LIMIT); | ||
268 | } | ||
269 | |||
270 | static inline void * __init memblock_virt_alloc_low_nopanic( | ||
271 | phys_addr_t size, phys_addr_t align) | ||
272 | { | ||
273 | if (!align) | ||
274 | align = SMP_CACHE_BYTES; | ||
275 | return __alloc_bootmem_low_nopanic(size, align, BOOTMEM_LOW_LIMIT); | ||
276 | } | ||
277 | |||
241 | static inline void * __init memblock_virt_alloc_from_nopanic( | 278 | static inline void * __init memblock_virt_alloc_from_nopanic( |
242 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) | 279 | phys_addr_t size, phys_addr_t align, phys_addr_t min_addr) |
243 | { | 280 | { |