8 * Logical memory blocks.
10 * Copyright (C) 2001 Peter Bergner, IBM Corp.
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version
15 * 2 of the License, or (at your option) any later version.
18 #define MAX_LMB_REGIONS 8
28 struct lmb_property region[MAX_LMB_REGIONS+1];
32 struct lmb_region memory;
33 struct lmb_region reserved;
36 extern struct lmb lmb;
38 extern void lmb_init(struct lmb *lmb);
39 extern long lmb_add(struct lmb *lmb, phys_addr_t base, phys_size_t size);
40 extern long lmb_reserve(struct lmb *lmb, phys_addr_t base, phys_size_t size);
41 extern phys_addr_t lmb_alloc(struct lmb *lmb, phys_size_t size, ulong align);
42 extern phys_addr_t lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align,
43 phys_addr_t max_addr);
44 extern phys_addr_t __lmb_alloc_base(struct lmb *lmb, phys_size_t size, ulong align,
45 phys_addr_t max_addr);
46 extern int lmb_is_reserved(struct lmb *lmb, phys_addr_t addr);
47 extern long lmb_free(struct lmb *lmb, phys_addr_t base, phys_size_t size);
49 extern void lmb_dump_all(struct lmb *lmb);
51 static inline phys_size_t
52 lmb_size_bytes(struct lmb_region *type, unsigned long region_nr)
54 return type->region[region_nr].size;
57 void board_lmb_reserve(struct lmb *lmb);
58 void arch_lmb_reserve(struct lmb *lmb);
60 #endif /* CONFIG_LMB */
61 #endif /* __KERNEL__ */
63 #endif /* _LINUX_LMB_H */