aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/bootmem.h42
-rw-r--r--mm/bootmem.c28
2 files changed, 47 insertions, 23 deletions
diff --git a/include/linux/bootmem.h b/include/linux/bootmem.h
index fa2523f47628..1e8dddfb3083 100644
--- a/include/linux/bootmem.h
+++ b/include/linux/bootmem.h
@@ -44,18 +44,24 @@ typedef struct bootmem_data {
44extern unsigned long bootmem_bootmap_pages (unsigned long); 44extern unsigned long bootmem_bootmap_pages (unsigned long);
45extern unsigned long init_bootmem (unsigned long addr, unsigned long memend); 45extern unsigned long init_bootmem (unsigned long addr, unsigned long memend);
46extern void free_bootmem (unsigned long addr, unsigned long size); 46extern void free_bootmem (unsigned long addr, unsigned long size);
47extern void * __alloc_bootmem (unsigned long size, unsigned long align, unsigned long goal); 47extern void * __alloc_bootmem (unsigned long size,
48extern void * __alloc_bootmem_nopanic (unsigned long size, unsigned long align, unsigned long goal); 48 unsigned long align,
49 unsigned long goal);
50extern void * __alloc_bootmem_nopanic (unsigned long size,
51 unsigned long align,
52 unsigned long goal);
49extern void * __alloc_bootmem_low(unsigned long size, 53extern void * __alloc_bootmem_low(unsigned long size,
50 unsigned long align, 54 unsigned long align,
51 unsigned long goal); 55 unsigned long goal);
52extern void * __alloc_bootmem_low_node(pg_data_t *pgdat, 56extern void * __alloc_bootmem_low_node(pg_data_t *pgdat,
53 unsigned long size, 57 unsigned long size,
54 unsigned long align, 58 unsigned long align,
55 unsigned long goal); 59 unsigned long goal);
56extern void * __alloc_bootmem_core(struct bootmem_data *bdata, 60extern void * __alloc_bootmem_core(struct bootmem_data *bdata,
57 unsigned long size, unsigned long align, unsigned long goal, 61 unsigned long size,
58 unsigned long limit); 62 unsigned long align,
63 unsigned long goal,
64 unsigned long limit);
59#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 65#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
60extern void reserve_bootmem (unsigned long addr, unsigned long size); 66extern void reserve_bootmem (unsigned long addr, unsigned long size);
61#define alloc_bootmem(x) \ 67#define alloc_bootmem(x) \
@@ -68,10 +74,20 @@ extern void reserve_bootmem (unsigned long addr, unsigned long size);
68 __alloc_bootmem_low(x, PAGE_SIZE, 0) 74 __alloc_bootmem_low(x, PAGE_SIZE, 0)
69#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */ 75#endif /* !CONFIG_HAVE_ARCH_BOOTMEM_NODE */
70extern unsigned long free_all_bootmem (void); 76extern unsigned long free_all_bootmem (void);
71extern void * __alloc_bootmem_node (pg_data_t *pgdat, unsigned long size, unsigned long align, unsigned long goal); 77extern void * __alloc_bootmem_node (pg_data_t *pgdat,
72extern unsigned long init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn); 78 unsigned long size,
73extern void reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size); 79 unsigned long align,
74extern void free_bootmem_node (pg_data_t *pgdat, unsigned long addr, unsigned long size); 80 unsigned long goal);
81extern unsigned long init_bootmem_node (pg_data_t *pgdat,
82 unsigned long freepfn,
83 unsigned long startpfn,
84 unsigned long endpfn);
85extern void reserve_bootmem_node (pg_data_t *pgdat,
86 unsigned long physaddr,
87 unsigned long size);
88extern void free_bootmem_node (pg_data_t *pgdat,
89 unsigned long addr,
90 unsigned long size);
75extern unsigned long free_all_bootmem_node (pg_data_t *pgdat); 91extern unsigned long free_all_bootmem_node (pg_data_t *pgdat);
76#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE 92#ifndef CONFIG_HAVE_ARCH_BOOTMEM_NODE
77#define alloc_bootmem_node(pgdat, x) \ 93#define alloc_bootmem_node(pgdat, x) \
diff --git a/mm/bootmem.c b/mm/bootmem.c
index 70f1528a3c8a..9083f5029673 100644
--- a/mm/bootmem.c
+++ b/mm/bootmem.c
@@ -102,7 +102,8 @@ static unsigned long __init init_bootmem_core (pg_data_t *pgdat,
102 * might be used for boot-time allocations - or it might get added 102 * might be used for boot-time allocations - or it might get added
103 * to the free page pool later on. 103 * to the free page pool later on.
104 */ 104 */
105static void __init reserve_bootmem_core(bootmem_data_t *bdata, unsigned long addr, unsigned long size) 105static void __init reserve_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
106 unsigned long size)
106{ 107{
107 unsigned long i; 108 unsigned long i;
108 /* 109 /*
@@ -127,7 +128,8 @@ static void __init reserve_bootmem_core(bootmem_data_t *bdata, unsigned long add
127 } 128 }
128} 129}
129 130
130static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr, unsigned long size) 131static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
132 unsigned long size)
131{ 133{
132 unsigned long i; 134 unsigned long i;
133 unsigned long start; 135 unsigned long start;
@@ -355,17 +357,20 @@ static unsigned long __init free_all_bootmem_core(pg_data_t *pgdat)
355 return total; 357 return total;
356} 358}
357 359
358unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn, unsigned long startpfn, unsigned long endpfn) 360unsigned long __init init_bootmem_node (pg_data_t *pgdat, unsigned long freepfn,
361 unsigned long startpfn, unsigned long endpfn)
359{ 362{
360 return(init_bootmem_core(pgdat, freepfn, startpfn, endpfn)); 363 return(init_bootmem_core(pgdat, freepfn, startpfn, endpfn));
361} 364}
362 365
363void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size) 366void __init reserve_bootmem_node (pg_data_t *pgdat, unsigned long physaddr,
367 unsigned long size)
364{ 368{
365 reserve_bootmem_core(pgdat->bdata, physaddr, size); 369 reserve_bootmem_core(pgdat->bdata, physaddr, size);
366} 370}
367 371
368void __init free_bootmem_node (pg_data_t *pgdat, unsigned long physaddr, unsigned long size) 372void __init free_bootmem_node (pg_data_t *pgdat, unsigned long physaddr,
373 unsigned long size)
369{ 374{
370 free_bootmem_core(pgdat->bdata, physaddr, size); 375 free_bootmem_core(pgdat->bdata, physaddr, size);
371} 376}
@@ -399,7 +404,8 @@ unsigned long __init free_all_bootmem (void)
399 return(free_all_bootmem_core(NODE_DATA(0))); 404 return(free_all_bootmem_core(NODE_DATA(0)));
400} 405}
401 406
402void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align, unsigned long goal) 407void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align,
408 unsigned long goal)
403{ 409{
404 bootmem_data_t *bdata; 410 bootmem_data_t *bdata;
405 void *ptr; 411 void *ptr;
@@ -410,7 +416,8 @@ void * __init __alloc_bootmem_nopanic(unsigned long size, unsigned long align, u
410 return NULL; 416 return NULL;
411} 417}
412 418
413void * __init __alloc_bootmem(unsigned long size, unsigned long align, unsigned long goal) 419void * __init __alloc_bootmem(unsigned long size, unsigned long align,
420 unsigned long goal)
414{ 421{
415 void *mem = __alloc_bootmem_nopanic(size,align,goal); 422 void *mem = __alloc_bootmem_nopanic(size,align,goal);
416 if (mem) 423 if (mem)
@@ -424,8 +431,8 @@ void * __init __alloc_bootmem(unsigned long size, unsigned long align, unsigned
424} 431}
425 432
426 433
427void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, unsigned long align, 434void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size,
428 unsigned long goal) 435 unsigned long align, unsigned long goal)
429{ 436{
430 void *ptr; 437 void *ptr;
431 438
@@ -438,7 +445,8 @@ void * __init __alloc_bootmem_node(pg_data_t *pgdat, unsigned long size, unsigne
438 445
439#define LOW32LIMIT 0xffffffff 446#define LOW32LIMIT 0xffffffff
440 447
441void * __init __alloc_bootmem_low(unsigned long size, unsigned long align, unsigned long goal) 448void * __init __alloc_bootmem_low(unsigned long size, unsigned long align,
449 unsigned long goal)
442{ 450{
443 bootmem_data_t *bdata; 451 bootmem_data_t *bdata;
444 void *ptr; 452 void *ptr;