Ronald G. Minnich (rminnich@gmail.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/7069
-gerrit
commit 1f0f2103af69e081b1f4b192403a4eac1704a463 Author: Ronald G. Minnich rminnich@gmail.com Date: Thu Oct 16 10:58:09 2014 +0000
cbmem: 64/32 cleanup
Change-Id: I4b55b635cc233a9d48b284623399277d941b0d5a Signed-off-by: Ronald G. Minnich rminnich@gmail.com --- src/lib/dynamic_cbmem.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/lib/dynamic_cbmem.c b/src/lib/dynamic_cbmem.c index 1382f1d..ba96e8c 100644 --- a/src/lib/dynamic_cbmem.c +++ b/src/lib/dynamic_cbmem.c @@ -97,17 +97,18 @@ static inline void *get_top_aligned(void)
static inline void *get_root(void) { - unsigned long pointer_addr; + uintptr_t pointer_addr; struct cbmem_root_pointer *pointer;
- pointer_addr = (unsigned long)get_top_aligned(); + pointer_addr = (uintptr_t)get_top_aligned(); pointer_addr -= sizeof(struct cbmem_root_pointer);
pointer = (void *)pointer_addr; if (pointer->magic != CBMEM_POINTER_MAGIC) return NULL;
- return (void *)pointer->root; + pointer_addr = pointer->root; + return (void *)pointer_addr; }
static inline void cbmem_entry_assign(struct cbmem_entry *entry, @@ -190,7 +191,7 @@ static int validate_entries(struct cbmem_root *root) unsigned int i; u32 current_end;
- current_end = (u32)get_top_aligned(); + current_end = (uintptr_t)get_top_aligned();
printk(BIOS_DEBUG, "CBMEM: recovering %d/%d entries from root @ %p\n", root->num_entries, root->max_entries, root); @@ -270,14 +271,16 @@ int cbmem_recovery(int is_wakeup) static void *cbmem_base(void) { struct cbmem_root *root; - u32 low_addr; + uintptr_t low_addr;
root = get_root();
if (root == NULL) return NULL;
- low_addr = (u32)root; + low_addr = (uintptr_t)root; + /* a low address is low. */ + low_addr &= 0xffffffff;
/* Assume the lowest address is the last one added. */ if (root->num_entries > 0) { @@ -411,7 +414,8 @@ u64 cbmem_entry_size(const struct cbmem_entry *entry)
void *cbmem_entry_start(const struct cbmem_entry *entry) { - return (void *)entry->start; + uintptr_t addr = entry->start; + return (void *)addr; }