[coreboot] New patch to review for coreboot: 690e7ef cbmem: replace pointer type by uint64_t

Stefan Reinauer (stefan.reinauer@coreboot.org) gerrit at coreboot.org
Fri Jan 11 19:46:41 CET 2013


Stefan Reinauer (stefan.reinauer at coreboot.org) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/2135

-gerrit

commit 690e7ef25330a80f37f378d4fb56511f44b27b21
Author: Stefan Reinauer <stefan.reinauer at coreboot.org>
Date:   Fri Jan 11 10:41:42 2013 -0800

    cbmem: replace pointer type by uint64_t
    
    Since coreboot is compiled into 32bit code, and userspace
    might be 32 or 64bit, putting a pointer into the coreboot
    table is not viable. Instead, use a uint64_t, which is always
    big enough for a pointer, even if we decide to move to a 64bit
    coreboot at some point.
    
    Change-Id: Ic974cdcbc9b95126dd1e07125f3e9dce104545f5
    Signed-off-by: Stefan Reinauer <reinauer at google.com>
---
 src/arch/armv7/boot/coreboot_table.c | 2 +-
 src/arch/x86/boot/coreboot_table.c   | 2 +-
 src/include/boot/coreboot_tables.h   | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/arch/armv7/boot/coreboot_table.c b/src/arch/armv7/boot/coreboot_table.c
index 9f67da0..86a004d 100644
--- a/src/arch/armv7/boot/coreboot_table.c
+++ b/src/arch/armv7/boot/coreboot_table.c
@@ -251,7 +251,7 @@ static void add_cbmem_pointers(struct lb_header *header)
 		}
 		cbmem_ref->tag = sid->table_tag;
 		cbmem_ref->size = sizeof(*cbmem_ref);
-		cbmem_ref->cbmem_addr = cbmem_addr;
+		cbmem_ref->cbmem_addr = (unsigned long)cbmem_addr;
 	}
 }
 
diff --git a/src/arch/x86/boot/coreboot_table.c b/src/arch/x86/boot/coreboot_table.c
index 18ec6d8..8dccd77 100644
--- a/src/arch/x86/boot/coreboot_table.c
+++ b/src/arch/x86/boot/coreboot_table.c
@@ -251,7 +251,7 @@ static void add_cbmem_pointers(struct lb_header *header)
 		}
 		cbmem_ref->tag = sid->table_tag;
 		cbmem_ref->size = sizeof(*cbmem_ref);
-		cbmem_ref->cbmem_addr = cbmem_addr;
+		cbmem_ref->cbmem_addr = (unsigned long)cbmem_addr;
 	}
 }
 
diff --git a/src/include/boot/coreboot_tables.h b/src/include/boot/coreboot_tables.h
index 5d5ca2c..9cf90d3 100644
--- a/src/include/boot/coreboot_tables.h
+++ b/src/include/boot/coreboot_tables.h
@@ -229,7 +229,7 @@ struct lb_cbmem_ref {
 	uint32_t tag;
 	uint32_t size;
 
-	void	*cbmem_addr;
+	uint64_t cbmem_addr;
 };
 
 #define LB_TAG_VBNV		0x0019



More information about the coreboot mailing list