diff options
author | Johannes Weiner <hannes@saeurebad.de> | 2008-07-24 00:28:00 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-24 13:47:19 -0400 |
commit | 223e8dc9249c9e15f6c8b638d73fcad78ccb0a88 (patch) | |
tree | dff068c99609163c1632926c7f321279d8f945d8 /include/linux/bootmem.h | |
parent | 7251ff78b94c2a68d267623d09b32672b20662c1 (diff) |
bootmem: reorder code to match new bootmem structure
This only reorders functions so that further patches will be easier to
read. No code changed.
Signed-off-by: Johannes Weiner <hannes@saeurebad.de>
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 | 86 |
1 files changed, 45 insertions, 41 deletions
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h index f352c5f125b4..5000fd70b04f 100644 --- a/include/linux/bootmem.h +++ b/include/linux/bootmem.h | |||
@@ -41,36 +41,62 @@ typedef struct bootmem_data { | |||
41 | extern bootmem_data_t bootmem_node_data[]; | 41 | extern bootmem_data_t bootmem_node_data[]; |
42 | 42 | ||
43 | extern unsigned long bootmem_bootmap_pages(unsigned long); | 43 | extern unsigned long bootmem_bootmap_pages(unsigned long); |
44 | |||
45 | extern unsigned long init_bootmem_node(pg_data_t *pgdat, | ||
46 | unsigned long freepfn, | ||
47 | unsigned long startpfn, | ||
48 | unsigned long endpfn); | ||
44 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); | 49 | extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); |
50 | |||
51 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | ||
52 | extern unsigned long free_all_bootmem(void); | ||
53 | |||
54 | extern void free_bootmem_node(pg_data_t *pgdat, | ||
55 | unsigned long addr, | ||
56 | unsigned long size); | ||
45 | extern void free_bootmem(unsigned long addr, unsigned long size); | 57 | extern void free_bootmem(unsigned long addr, unsigned long size); |
46 | extern void *__alloc_bootmem(unsigned long size, | 58 | |
59 | /* | ||
60 | * Flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
61 | * the architecture-specific code should honor this). | ||
62 | * | ||
63 | * If flags is 0, then the return value is always 0 (success). If | ||
64 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
65 | * memory already was reserved. | ||
66 | */ | ||
67 | #define BOOTMEM_DEFAULT 0 | ||
68 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
69 | |||
70 | extern int reserve_bootmem_node(pg_data_t *pgdat, | ||
71 | unsigned long physaddr, | ||
72 | unsigned long size, | ||
73 | int flags); | ||
74 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | ||
75 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
76 | #endif | ||
77 | |||
78 | extern void *__alloc_bootmem_nopanic(unsigned long size, | ||
47 | unsigned long align, | 79 | unsigned long align, |
48 | unsigned long goal); | 80 | unsigned long goal); |
49 | extern void *__alloc_bootmem_nopanic(unsigned long size, | 81 | extern void *__alloc_bootmem(unsigned long size, |
50 | unsigned long align, | 82 | unsigned long align, |
51 | unsigned long goal); | 83 | unsigned long goal); |
52 | extern void *__alloc_bootmem_low(unsigned long size, | 84 | extern void *__alloc_bootmem_low(unsigned long size, |
53 | unsigned long align, | 85 | unsigned long align, |
54 | unsigned long goal); | 86 | unsigned long goal); |
87 | extern void *__alloc_bootmem_node(pg_data_t *pgdat, | ||
88 | unsigned long size, | ||
89 | unsigned long align, | ||
90 | unsigned long goal); | ||
91 | extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat, | ||
92 | unsigned long size, | ||
93 | unsigned long align, | ||
94 | unsigned long goal); | ||
55 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, | 95 | extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, |
56 | unsigned long size, | 96 | unsigned long size, |
57 | unsigned long align, | 97 | unsigned long align, |
58 | unsigned long goal); | 98 | unsigned long goal); |
59 | |||
60 | /* | ||
61 | * flags for reserve_bootmem (also if CONFIG_HAVE_ARCH_BOOTMEM_NODE, | ||
62 | * the architecture-specific code should honor this) | ||
63 | */ | ||
64 | #define BOOTMEM_DEFAULT 0 | ||
65 | #define BOOTMEM_EXCLUSIVE (1<<0) | ||
66 | |||
67 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | 99 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE |
68 | /* | ||
69 | * If flags is 0, then the return value is always 0 (success). If | ||
70 | * flags contains BOOTMEM_EXCLUSIVE, then -EBUSY is returned if the | ||
71 | * memory already was reserved. | ||
72 | */ | ||
73 | extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | ||
74 | #define alloc_bootmem(x) \ | 100 | #define alloc_bootmem(x) \ |
75 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 101 | __alloc_bootmem(x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
76 | #define alloc_bootmem_low(x) \ | 102 | #define alloc_bootmem_low(x) \ |
@@ -83,38 +109,16 @@ extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags); | |||
83 | 109 | ||
84 | extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, | 110 | extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, |
85 | int flags); | 111 | int flags); |
86 | extern unsigned long free_all_bootmem(void); | ||
87 | extern unsigned long free_all_bootmem_node(pg_data_t *pgdat); | ||
88 | extern void *__alloc_bootmem_node(pg_data_t *pgdat, | ||
89 | unsigned long size, | ||
90 | unsigned long align, | ||
91 | unsigned long goal); | ||
92 | extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat, | ||
93 | unsigned long size, | ||
94 | unsigned long align, | ||
95 | unsigned long goal); | ||
96 | extern unsigned long init_bootmem_node(pg_data_t *pgdat, | ||
97 | unsigned long freepfn, | ||
98 | unsigned long startpfn, | ||
99 | unsigned long endpfn); | ||
100 | extern int reserve_bootmem_node(pg_data_t *pgdat, | ||
101 | unsigned long physaddr, | ||
102 | unsigned long size, | ||
103 | int flags); | ||
104 | extern void free_bootmem_node(pg_data_t *pgdat, | ||
105 | unsigned long addr, | ||
106 | unsigned long size); | ||
107 | extern void *alloc_bootmem_section(unsigned long size, | ||
108 | unsigned long section_nr); | ||
109 | 112 | ||
110 | #ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE | ||
111 | #define alloc_bootmem_node(pgdat, x) \ | 113 | #define alloc_bootmem_node(pgdat, x) \ |
112 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 114 | __alloc_bootmem_node(pgdat, x, SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) |
113 | #define alloc_bootmem_pages_node(pgdat, x) \ | 115 | #define alloc_bootmem_pages_node(pgdat, x) \ |
114 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 116 | __alloc_bootmem_node(pgdat, x, PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
115 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | 117 | #define alloc_bootmem_low_pages_node(pgdat, x) \ |
116 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) | 118 | __alloc_bootmem_low_node(pgdat, x, PAGE_SIZE, 0) |
117 | #endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ | 119 | |
120 | extern void *alloc_bootmem_section(unsigned long size, | ||
121 | unsigned long section_nr); | ||
118 | 122 | ||
119 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP | 123 | #ifdef CONFIG_HAVE_ARCH_ALLOC_REMAP |
120 | extern void *alloc_remap(int nid, unsigned long size); | 124 | extern void *alloc_remap(int nid, unsigned long size); |