aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorJohannes Weiner <hannes@saeurebad.de>2008-07-24 00:28:00 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-07-24 13:47:19 -0400
commit223e8dc9249c9e15f6c8b638d73fcad78ccb0a88 (patch)
treedff068c99609163c1632926c7f321279d8f945d8 /include
parent7251ff78b94c2a68d267623d09b32672b20662c1 (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')
-rw-r--r--include/linux/bootmem.h86
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 {
41extern bootmem_data_t bootmem_node_data[]; 41extern bootmem_data_t bootmem_node_data[];
42 42
43extern unsigned long bootmem_bootmap_pages(unsigned long); 43extern unsigned long bootmem_bootmap_pages(unsigned long);
44
45extern unsigned long init_bootmem_node(pg_data_t *pgdat,
46 unsigned long freepfn,
47 unsigned long startpfn,
48 unsigned long endpfn);
44extern unsigned long init_bootmem(unsigned long addr, unsigned long memend); 49extern unsigned long init_bootmem(unsigned long addr, unsigned long memend);
50
51extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
52extern unsigned long free_all_bootmem(void);
53
54extern void free_bootmem_node(pg_data_t *pgdat,
55 unsigned long addr,
56 unsigned long size);
45extern void free_bootmem(unsigned long addr, unsigned long size); 57extern void free_bootmem(unsigned long addr, unsigned long size);
46extern 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
70extern 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
75extern int reserve_bootmem(unsigned long addr, unsigned long size, int flags);
76#endif
77
78extern void *__alloc_bootmem_nopanic(unsigned long size,
47 unsigned long align, 79 unsigned long align,
48 unsigned long goal); 80 unsigned long goal);
49extern void *__alloc_bootmem_nopanic(unsigned long size, 81extern void *__alloc_bootmem(unsigned long size,
50 unsigned long align, 82 unsigned long align,
51 unsigned long goal); 83 unsigned long goal);
52extern void *__alloc_bootmem_low(unsigned long size, 84extern void *__alloc_bootmem_low(unsigned long size,
53 unsigned long align, 85 unsigned long align,
54 unsigned long goal); 86 unsigned long goal);
87extern void *__alloc_bootmem_node(pg_data_t *pgdat,
88 unsigned long size,
89 unsigned long align,
90 unsigned long goal);
91extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat,
92 unsigned long size,
93 unsigned long align,
94 unsigned long goal);
55extern void *__alloc_bootmem_low_node(pg_data_t *pgdat, 95extern 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 */
73extern 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
84extern int reserve_bootmem_generic(unsigned long addr, unsigned long size, 110extern int reserve_bootmem_generic(unsigned long addr, unsigned long size,
85 int flags); 111 int flags);
86extern unsigned long free_all_bootmem(void);
87extern unsigned long free_all_bootmem_node(pg_data_t *pgdat);
88extern void *__alloc_bootmem_node(pg_data_t *pgdat,
89 unsigned long size,
90 unsigned long align,
91 unsigned long goal);
92extern void *__alloc_bootmem_node_nopanic(pg_data_t *pgdat,
93 unsigned long size,
94 unsigned long align,
95 unsigned long goal);
96extern unsigned long init_bootmem_node(pg_data_t *pgdat,
97 unsigned long freepfn,
98 unsigned long startpfn,
99 unsigned long endpfn);
100extern int reserve_bootmem_node(pg_data_t *pgdat,
101 unsigned long physaddr,
102 unsigned long size,
103 int flags);
104extern void free_bootmem_node(pg_data_t *pgdat,
105 unsigned long addr,
106 unsigned long size);
107extern 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
120extern 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
120extern void *alloc_remap(int nid, unsigned long size); 124extern void *alloc_remap(int nid, unsigned long size);