diff options
author | Alexandru Gagniuc <alexandrux.gagniuc@intel.com> | 2015-11-16 13:26:33 -0800 |
---|---|---|
committer | Aaron Durbin <adurbin@chromium.org> | 2016-03-10 23:08:26 +0100 |
commit | 555d6c2161683612c415dc4eb99edded68836ff7 (patch) | |
tree | 9bf1eede2753f4ae1d71c6b5acfbaf6a468c7350 /src/lib/imd_cbmem.c | |
parent | 1e70cda320df24e477d8ee80a88e9add2eb535c9 (diff) |
cbmem: Add utility to get memory region occupied by cbmem
Change-Id: I8e57c23565f173afc0f4d450579b8bfb35aeb964
Signed-off-by: Alexandru Gagniuc <alexandrux.gagniuc@intel.com>
Signed-off-by: Andrey Petrov <andrey.petrov@intel.com>
Reviewed-on: https://review.coreboot.org/13363
Tested-by: build bot (Jenkins)
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
Diffstat (limited to 'src/lib/imd_cbmem.c')
-rw-r--r-- | src/lib/imd_cbmem.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/lib/imd_cbmem.c b/src/lib/imd_cbmem.c index 49faad97b4..e75c538cea 100644 --- a/src/lib/imd_cbmem.c +++ b/src/lib/imd_cbmem.c @@ -263,12 +263,19 @@ void *cbmem_entry_start(const struct cbmem_entry *entry) return imd_entry_at(imd, cbmem_to_imd(entry)); } +void cbmem_region_used(uintptr_t *base, size_t *size) +{ + void *baseptr; + imd_region_used(cbmem_get_imd(), &baseptr, size); + *base = (uintptr_t)baseptr; +} + void cbmem_add_bootmem(void) { void *base = NULL; size_t size = 0; - imd_region_used(cbmem_get_imd(), &base, &size); + cbmem_region_used(base, &size); bootmem_add_range((uintptr_t)base, size, LB_MEM_TABLE); } |