Lines Matching refs:bdata

49 	bootmem_data_t *bdata = pgdat->bdata;  in init_bootmem_core()  local
56 bdata->node_bootmem_map = phys_to_virt(mapstart << PAGE_SHIFT); in init_bootmem_core()
57 bdata->node_boot_start = (start << PAGE_SHIFT); in init_bootmem_core()
58 bdata->node_low_pfn = end; in init_bootmem_core()
64 memset(bdata->node_bootmem_map, 0xff, mapsize); in init_bootmem_core()
74 static void __init reserve_bootmem_core(bootmem_data_t *bdata, unsigned long addr, unsigned long si… in reserve_bootmem_core() argument
81 unsigned long sidx = (addr - bdata->node_boot_start)/PAGE_SIZE; in reserve_bootmem_core()
82 unsigned long eidx = (addr + size - bdata->node_boot_start + in reserve_bootmem_core()
94 if ((addr >> PAGE_SHIFT) >= bdata->node_low_pfn) in reserve_bootmem_core()
96 if (end > bdata->node_low_pfn) in reserve_bootmem_core()
99 if (test_and_set_bit(i, bdata->node_bootmem_map)) in reserve_bootmem_core()
103 static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr, unsigned long size) in free_bootmem_core() argument
112 unsigned long eidx = (addr + size - bdata->node_boot_start)/PAGE_SIZE; in free_bootmem_core()
116 if (end > bdata->node_low_pfn) in free_bootmem_core()
123 sidx = start - (bdata->node_boot_start/PAGE_SIZE); in free_bootmem_core()
126 if (!test_and_clear_bit(i, bdata->node_bootmem_map)) in free_bootmem_core()
144 static void * __init __alloc_bootmem_core (bootmem_data_t *bdata, in __alloc_bootmem_core() argument
151 unsigned long eidx = bdata->node_low_pfn - (bdata->node_boot_start >> in __alloc_bootmem_core()
161 (bdata->node_boot_start & (align - 1UL)) != 0) in __alloc_bootmem_core()
162 offset = (align - (bdata->node_boot_start & (align - 1UL))); in __alloc_bootmem_core()
169 if (goal && (goal >= bdata->node_boot_start) && in __alloc_bootmem_core()
170 ((goal >> PAGE_SHIFT) < bdata->node_low_pfn)) { in __alloc_bootmem_core()
171 preferred = goal - bdata->node_boot_start; in __alloc_bootmem_core()
183 if (test_bit(i, bdata->node_bootmem_map)) in __alloc_bootmem_core()
188 if (test_bit (j, bdata->node_bootmem_map)) in __alloc_bootmem_core()
210 && bdata->last_offset && bdata->last_pos+1 == start) { in __alloc_bootmem_core()
211 offset = (bdata->last_offset+align-1) & ~(align-1); in __alloc_bootmem_core()
218 bdata->last_offset = offset+size; in __alloc_bootmem_core()
219 ret = phys_to_virt(bdata->last_pos*PAGE_SIZE + offset + in __alloc_bootmem_core()
220 bdata->node_boot_start); in __alloc_bootmem_core()
224 ret = phys_to_virt(bdata->last_pos*PAGE_SIZE + offset + in __alloc_bootmem_core()
225 bdata->node_boot_start); in __alloc_bootmem_core()
226 bdata->last_pos = start+areasize-1; in __alloc_bootmem_core()
227 bdata->last_offset = remaining_size; in __alloc_bootmem_core()
229 bdata->last_offset &= ~PAGE_MASK; in __alloc_bootmem_core()
231 bdata->last_pos = start + areasize - 1; in __alloc_bootmem_core()
232 bdata->last_offset = size & ~PAGE_MASK; in __alloc_bootmem_core()
233 ret = phys_to_virt(start * PAGE_SIZE + bdata->node_boot_start); in __alloc_bootmem_core()
239 if (test_and_set_bit(i, bdata->node_bootmem_map)) in __alloc_bootmem_core()
248 bootmem_data_t *bdata = pgdat->bdata; in free_all_bootmem_core() local
252 if (!bdata->node_bootmem_map) BUG(); in free_all_bootmem_core()
255 idx = bdata->node_low_pfn - (bdata->node_boot_start >> PAGE_SHIFT); in free_all_bootmem_core()
257 if (!test_bit(i, bdata->node_bootmem_map)) { in free_all_bootmem_core()
270 page = virt_to_page(bdata->node_bootmem_map); in free_all_bootmem_core()
272 …for (i = 0; i < ((bdata->node_low_pfn-(bdata->node_boot_start >> PAGE_SHIFT))/8 + PAGE_SIZE-1)/PAG… in free_all_bootmem_core()
279 bdata->node_bootmem_map = NULL; in free_all_bootmem_core()
291 reserve_bootmem_core(pgdat->bdata, physaddr, size); in reserve_bootmem_node()
296 return(free_bootmem_core(pgdat->bdata, physaddr, size)); in free_bootmem_node()
313 reserve_bootmem_core(contig_page_data.bdata, addr, size); in reserve_bootmem()
318 return(free_bootmem_core(contig_page_data.bdata, addr, size)); in free_bootmem()
332 if ((ptr = __alloc_bootmem_core(pgdat->bdata, size, in __alloc_bootmem()
348 ptr = __alloc_bootmem_core(pgdat->bdata, size, align, goal); in __alloc_bootmem_node()