Lines Matching refs:lmb
14 void lmb_dump_all(struct lmb *lmb) in lmb_dump_all() argument
20 debug(" memory.cnt = 0x%lx\n", lmb->memory.cnt); in lmb_dump_all()
22 (unsigned long long)lmb->memory.size); in lmb_dump_all()
23 for (i=0; i < lmb->memory.cnt ;i++) { in lmb_dump_all()
25 (long long unsigned)lmb->memory.region[i].base); in lmb_dump_all()
27 (long long unsigned)lmb->memory.region[i].size); in lmb_dump_all()
31 lmb->reserved.cnt); in lmb_dump_all()
33 (long long unsigned)lmb->reserved.size); in lmb_dump_all()
34 for (i=0; i < lmb->reserved.cnt ;i++) { in lmb_dump_all()
36 (long long unsigned)lmb->reserved.region[i].base); in lmb_dump_all()
38 (long long unsigned)lmb->reserved.region[i].size); in lmb_dump_all()
90 void lmb_init(struct lmb *lmb) in lmb_init() argument
95 lmb->memory.region[0].base = 0; in lmb_init()
96 lmb->memory.region[0].size = 0; in lmb_init()
97 lmb->memory.cnt = 1; in lmb_init()
98 lmb->memory.size = 0; in lmb_init()
101 lmb->reserved.region[0].base = 0; in lmb_init()
102 lmb->reserved.region[0].size = 0; in lmb_init()
103 lmb->reserved.cnt = 1; in lmb_init()
104 lmb->reserved.size = 0; in lmb_init()
175 long lmb_add(struct lmb *lmb, phys_addr_t base, phys_size_t size) in lmb_add() argument
177 struct lmb_region *_rgn = &(lmb->memory); in lmb_add()
182 long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size) in lmb_free() argument
184 struct lmb_region *rgn = &(lmb->reserved); in lmb_free()
231 long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size) in lmb_reserve() argument
233 struct lmb_region *_rgn = &(lmb->reserved); in lmb_reserve()
254 phys_addr_t lmb_alloc(struct lmb *lmb, phys_size_t size, ulong align) in lmb_alloc() argument
256 return lmb_alloc_base(lmb, size, align, LMB_ALLOC_ANYWHERE); in lmb_alloc()
259 phys_addr_t lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align, phys_addr_t max_addr) in lmb_alloc_base() argument
263 alloc = __lmb_alloc_base(lmb, size, align, max_addr); in lmb_alloc_base()
282 phys_addr_t __lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align, phys_addr_t max_addr) in __lmb_alloc_base() argument
288 for (i = lmb->memory.cnt-1; i >= 0; i--) { in __lmb_alloc_base()
289 phys_addr_t lmbbase = lmb->memory.region[i].base; in __lmb_alloc_base()
290 phys_size_t lmbsize = lmb->memory.region[i].size; in __lmb_alloc_base()
306 j = lmb_overlaps_region(&lmb->reserved, base, size); in __lmb_alloc_base()
309 if (lmb_add_region(&lmb->reserved, base, in __lmb_alloc_base()
315 res_base = lmb->reserved.region[j].base; in __lmb_alloc_base()
324 int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr) in lmb_is_reserved() argument
328 for (i = 0; i < lmb->reserved.cnt; i++) { in lmb_is_reserved()
329 phys_addr_t upper = lmb->reserved.region[i].base + in lmb_is_reserved()
330 lmb->reserved.region[i].size - 1; in lmb_is_reserved()
331 if ((addr >= lmb->reserved.region[i].base) && (addr <= upper)) in lmb_is_reserved()
337 __weak void board_lmb_reserve(struct lmb *lmb) in board_lmb_reserve() argument
342 __weak void arch_lmb_reserve(struct lmb *lmb) in arch_lmb_reserve() argument