diff options
author | Ravikiran G Thirumalai <kiran@scalex86.org> | 2006-01-06 03:11:01 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-01-06 11:33:26 -0500 |
commit | 008857c1a49ccffc31a54c3ea7e182833bd61304 (patch) | |
tree | ba65452db097f57e05d2e3df550d55d45feabc94 /include/linux | |
parent | 085cc7d5de3cc662da7ea78296464a0d52f3f01f (diff) |
[PATCH] Cleanup bootmem allocator and fix alloc_bootmem_low
Patch cleans up the alloc_bootmem fix for swiotlb. Patch removes
alloc_bootmem_*_limit api and fixes alloc_boot_*low api to do the right
thing -- allocate from low32 memory.
Signed-off-by: Ravikiran Thirumalai <kiran@scalex86.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux')
-rw-r--r-- | include/linux/bootmem.h | 46 |
1 files changed, 12 insertions, 34 deletions
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index 3b03b0b868dd..993da8cc9706 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -43,50 +43,38 @@ typedef struct bootmem_data { | |||
43 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); | 43 | extern unsigned long __init bootmem_bootmap_pages (unsigned long); |
44 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); | 44 | extern unsigned long __init init_bootmem (unsigned long addr, unsigned long memend); |
45 | extern void __init free_bootmem (unsigned long addr, unsigned long size); | 45 | extern void __init free_bootmem (unsigned long addr, unsigned long size); |
46 | extern void * __init __alloc_bootmem_limit (unsigned long size, unsigned long align, unsigned long goal, unsigned long limit); | 46 | extern void * __init __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); |
47 | extern void * __init __alloc_bootmem_low(unsigned long size, | ||
48 | unsigned long align, | ||
49 | unsigned long goal); | ||
50 | extern void * __init __alloc_bootmem_low_node(pg_data_t *pgdat, | ||
51 | unsigned long size, | ||
52 | unsigned long align, | ||
53 | unsigned long goal); | ||
47 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 54 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
48 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); | 55 | extern void __init reserve_bootmem (unsigned long addr, unsigned long size); |
49 | #define alloc_bootmem(x) \ | 56 | #define alloc_bootmem(x) \ |
50 | __alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 57 | __alloc_bootmem((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
51 | #define alloc_bootmem_low(x) \ | 58 | #define alloc_bootmem_low(x) \ |
52 | __alloc_bootmem((x), SMP_CACHE_BYTES, 0) | 59 | __alloc_bootmem_low((x), SMP_CACHE_BYTES, 0) |
53 | #define alloc_bootmem_pages(x) \ | 60 | #define alloc_bootmem_pages(x) \ |
54 | __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 61 | __alloc_bootmem((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
55 | #define alloc_bootmem_low_pages(x) \ | 62 | #define alloc_bootmem_low_pages(x) \ |
56 | __alloc_bootmem((x), PAGE_SIZE, 0) | 63 | __alloc_bootmem_low((x), PAGE_SIZE, 0) |
57 | |||
58 | #define alloc_bootmem_limit(x, limit) \ | ||
59 | __alloc_bootmem_limit((x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit)) | ||
60 | #define alloc_bootmem_low_limit(x, limit) \ | ||
61 | __alloc_bootmem_limit((x), SMP_CACHE_BYTES, 0, (limit)) | ||
62 | #define alloc_bootmem_pages_limit(x, limit) \ | ||
63 | __alloc_bootmem_limit((x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit)) | ||
64 | #define alloc_bootmem_low_pages_limit(x, limit) \ | ||
65 | __alloc_bootmem_limit((x), PAGE_SIZE, 0, (limit)) | ||
66 | |||
67 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 64 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
68 | extern unsigned long __init free_all_bootmem (void); | 65 | extern unsigned long __init free_all_bootmem (void); |
69 | 66 | extern void * __init __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); | |
70 | extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn); | 67 | extern unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn); |
71 | extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); | 68 | extern void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); |
72 | extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); | 69 | extern void __init free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); |
73 | extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); | 70 | extern unsigned long __init free_all_bootmem_node (pg_data_t *pgdat); |
74 | extern void * __init __alloc_bootmem_node_limit (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal, unsigned long limit); | ||
75 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 71 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
76 | #define alloc_bootmem_node(pgdat, x) \ | 72 | #define alloc_bootmem_node(pgdat, x) \ |
77 | __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 73 | __alloc_bootmem_node((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
78 | #define alloc_bootmem_pages_node(pgdat, x) \ | 74 | #define alloc_bootmem_pages_node(pgdat, x) \ |
79 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 75 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
80 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 76 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
81 | __alloc_bootmem_node((pgdat), (x), PAGE_SIZE, 0) | 77 | __alloc_bootmem_low_node((pgdat), (x), PAGE_SIZE, 0) |
82 | |||
83 | #define alloc_bootmem_node_limit(pgdat, x, limit) \ | ||
84 | __alloc_bootmem_node_limit((pgdat), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS), (limit)) | ||
85 | #define alloc_bootmem_pages_node_limit(pgdat, x, limit) \ | ||
86 | __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS), (limit)) | ||
87 | #define alloc_bootmem_low_pages_node_limit(pgdat, x, limit) \ | ||
88 | __alloc_bootmem_node_limit((pgdat), (x), PAGE_SIZE, 0, (limit)) | ||
89 | |||
90 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 78 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ |
91 | 79 | ||
92 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 80 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
@@ -123,15 +111,5 @@ extern void *__init alloc_large_system_hash(const char *tablename, | |||
123 | #endif | 111 | #endif |
124 | extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ | 112 | extern int __initdata hashdist; /* Distribute hashes across NUMA nodes? */ |
125 | 113 | ||
126 | static inline void *__alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal) | ||
127 | { | ||
128 | return __alloc_bootmem_limit(size, align, goal, 0); | ||
129 | } | ||
130 | |||
131 | static inline void *__alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, | ||
132 | unsigned long goal) | ||
133 | { | ||
134 | return __alloc_bootmem_node_limit(pgdat, size, align, goal, 0); | ||
135 | } | ||
136 | 114 | ||
137 | #endif /* _LINUX_BOOTMEM_H */ | 115 | #endif /* _LINUX_BOOTMEM_H */ |