|
@@ -132,9 +132,6 @@ extern void *__alloc_bootmem_low_node(pg_data_t *pgdat,
|
|
|
#define alloc_bootmem_low_pages_node(pgdat, x) \
|
|
|
__alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0)
|
|
|
|
|
|
-
|
|
|
-#if defined(CONFIG_HAVE_MEMBLOCK)
|
|
|
-
|
|
|
/* FIXME: use MEMBLOCK_ALLOC_* variants here */
|
|
|
#define BOOTMEM_ALLOC_ACCESSIBLE 0
|
|
|
#define BOOTMEM_ALLOC_ANYWHERE (~(phys_addr_t)0)
|
|
@@ -234,115 +231,6 @@ static inline void __init memblock_free_late(
|
|
|
__memblock_free_late(base, size);
|
|
|
}
|
|
|
|
|
|
-#else
|
|
|
-
|
|
|
-#define BOOTMEM_ALLOC_ACCESSIBLE 0
|
|
|
-
|
|
|
-
|
|
|
-/* Fall back to all the existing bootmem APIs */
|
|
|
-static inline void * __init memblock_virt_alloc(
|
|
|
- phys_addr_t size, phys_addr_t align)
|
|
|
-{
|
|
|
- if (!align)
|
|
|
- align = SMP_CACHE_BYTES;
|
|
|
- return __alloc_bootmem(size, align, BOOTMEM_LOW_LIMIT);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_raw(
|
|
|
- phys_addr_t size, phys_addr_t align)
|
|
|
-{
|
|
|
- if (!align)
|
|
|
- align = SMP_CACHE_BYTES;
|
|
|
- return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_nopanic(
|
|
|
- phys_addr_t size, phys_addr_t align)
|
|
|
-{
|
|
|
- if (!align)
|
|
|
- align = SMP_CACHE_BYTES;
|
|
|
- return __alloc_bootmem_nopanic(size, align, BOOTMEM_LOW_LIMIT);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_low(
|
|
|
- phys_addr_t size, phys_addr_t align)
|
|
|
-{
|
|
|
- if (!align)
|
|
|
- align = SMP_CACHE_BYTES;
|
|
|
- return __alloc_bootmem_low(size, align, 0);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_low_nopanic(
|
|
|
- phys_addr_t size, phys_addr_t align)
|
|
|
-{
|
|
|
- if (!align)
|
|
|
- align = SMP_CACHE_BYTES;
|
|
|
- return __alloc_bootmem_low_nopanic(size, align, 0);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_from_nopanic(
|
|
|
- phys_addr_t size, phys_addr_t align, phys_addr_t min_addr)
|
|
|
-{
|
|
|
- return __alloc_bootmem_nopanic(size, align, min_addr);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_node(
|
|
|
- phys_addr_t size, int nid)
|
|
|
-{
|
|
|
- return __alloc_bootmem_node(NODE_DATA(nid), size, SMP_CACHE_BYTES,
|
|
|
- BOOTMEM_LOW_LIMIT);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_node_nopanic(
|
|
|
- phys_addr_t size, int nid)
|
|
|
-{
|
|
|
- return __alloc_bootmem_node_nopanic(NODE_DATA(nid), size,
|
|
|
- SMP_CACHE_BYTES,
|
|
|
- BOOTMEM_LOW_LIMIT);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_try_nid(phys_addr_t size,
|
|
|
- phys_addr_t align, phys_addr_t min_addr, phys_addr_t max_addr, int nid)
|
|
|
-{
|
|
|
- return __alloc_bootmem_node_high(NODE_DATA(nid), size, align,
|
|
|
- min_addr);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_try_nid_raw(
|
|
|
- phys_addr_t size, phys_addr_t align,
|
|
|
- phys_addr_t min_addr, phys_addr_t max_addr, int nid)
|
|
|
-{
|
|
|
- return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align,
|
|
|
- min_addr, max_addr);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void * __init memblock_virt_alloc_try_nid_nopanic(
|
|
|
- phys_addr_t size, phys_addr_t align,
|
|
|
- phys_addr_t min_addr, phys_addr_t max_addr, int nid)
|
|
|
-{
|
|
|
- return ___alloc_bootmem_node_nopanic(NODE_DATA(nid), size, align,
|
|
|
- min_addr, max_addr);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void __init memblock_free_early(
|
|
|
- phys_addr_t base, phys_addr_t size)
|
|
|
-{
|
|
|
- free_bootmem(base, size);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void __init memblock_free_early_nid(
|
|
|
- phys_addr_t base, phys_addr_t size, int nid)
|
|
|
-{
|
|
|
- free_bootmem_node(NODE_DATA(nid), base, size);
|
|
|
-}
|
|
|
-
|
|
|
-static inline void __init memblock_free_late(
|
|
|
- phys_addr_t base, phys_addr_t size)
|
|
|
-{
|
|
|
- free_bootmem_late(base, size);
|
|
|
-}
|
|
|
-#endif /* defined(CONFIG_HAVE_MEMBLOCK) */
|
|
|
-
|
|
|
extern void *alloc_large_system_hash(const char *tablename,
|
|
|
unsigned long bucketsize,
|
|
|
unsigned long numentries,
|