aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memblock.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memblock.c')
-rw-r--r--mm/memblock.c54
1 files changed, 27 insertions, 27 deletions
diff --git a/mm/memblock.c b/mm/memblock.c
index fc7f97b2d994..ae856d4e25a3 100644
--- a/mm/memblock.c
+++ b/mm/memblock.c
@@ -107,33 +107,6 @@ static void memblock_coalesce_regions(struct memblock_type *type,
107 memblock_remove_region(type, r2); 107 memblock_remove_region(type, r2);
108} 108}
109 109
110void __init memblock_init(void)
111{
112 /* Hookup the initial arrays */
113 memblock.memory.regions = memblock_memory_init_regions;
114 memblock.memory.max = INIT_MEMBLOCK_REGIONS;
115 memblock.reserved.regions = memblock_reserved_init_regions;
116 memblock.reserved.max = INIT_MEMBLOCK_REGIONS;
117
118 /* Write a marker in the unused last array entry */
119 memblock.memory.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
120 memblock.reserved.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
121
122 /* Create a dummy zero size MEMBLOCK which will get coalesced away later.
123 * This simplifies the memblock_add() code below...
124 */
125 memblock.memory.regions[0].base = 0;
126 memblock.memory.regions[0].size = 0;
127 memblock.memory.cnt = 1;
128
129 /* Ditto. */
130 memblock.reserved.regions[0].base = 0;
131 memblock.reserved.regions[0].size = 0;
132 memblock.reserved.cnt = 1;
133
134 memblock.current_limit = MEMBLOCK_ALLOC_ANYWHERE;
135}
136
137void __init memblock_analyze(void) 110void __init memblock_analyze(void)
138{ 111{
139 int i; 112 int i;
@@ -543,3 +516,30 @@ void __init memblock_set_current_limit(phys_addr_t limit)
543 memblock.current_limit = limit; 516 memblock.current_limit = limit;
544} 517}
545 518
519void __init memblock_init(void)
520{
521 /* Hookup the initial arrays */
522 memblock.memory.regions = memblock_memory_init_regions;
523 memblock.memory.max = INIT_MEMBLOCK_REGIONS;
524 memblock.reserved.regions = memblock_reserved_init_regions;
525 memblock.reserved.max = INIT_MEMBLOCK_REGIONS;
526
527 /* Write a marker in the unused last array entry */
528 memblock.memory.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
529 memblock.reserved.regions[INIT_MEMBLOCK_REGIONS].base = (phys_addr_t)RED_INACTIVE;
530
531 /* Create a dummy zero size MEMBLOCK which will get coalesced away later.
532 * This simplifies the memblock_add() code below...
533 */
534 memblock.memory.regions[0].base = 0;
535 memblock.memory.regions[0].size = 0;
536 memblock.memory.cnt = 1;
537
538 /* Ditto. */
539 memblock.reserved.regions[0].base = 0;
540 memblock.reserved.regions[0].size = 0;
541 memblock.reserved.cnt = 1;
542
543 memblock.current_limit = MEMBLOCK_ALLOC_ANYWHERE;
544}
545