public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH] [RFC] memsize.c: adapt get_ram_size() for address spaces >32 bit
@ 2010-05-27 18:11 Wolfgang Denk
  2010-05-27 18:16 ` [U-Boot] [PATCH v2] " Wolfgang Denk
                   ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Wolfgang Denk @ 2010-05-27 18:11 UTC (permalink / raw)
  To: u-boot

get_ram_size() used to use "long" data types for addresses and data,
which in limited it to systems with less than 4 GiB memory. As more
and more systems are coming up with bigger memory resources, we adapt
the code to use phys_addr_t / phys_size_t data types instead.

Signed-off-by: Wolfgang Denk <wd@denx.de>
Cc: Timur Tabi <timur@freescale.com>
---
Note: this is only minimally tested - I just compiled a dozen of ppc
boards with it without appearent problems. Please review and test
carefully.

 common/memsize.c |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/common/memsize.c b/common/memsize.c
index 6c275c9..b99e51b 100644
--- a/common/memsize.c
+++ b/common/memsize.c
@@ -37,14 +37,14 @@
  * the actually available RAM size between addresses `base' and
  * `base + maxsize'.
  */
-long get_ram_size(volatile long *base, long maxsize)
+phys_size_t get_ram_size(volatile phys_addr_t *base, phys_size_t maxsize)
 {
-	volatile long *addr;
-	long           save[32];
-	long           cnt;
-	long           val;
-	long           size;
-	int            i = 0;
+	volatile phys_addr_t *addr;
+	phys_size_t	save[32];
+	phys_size_t	cnt;
+	phys_size_t	val;
+	phys_size_t	size;
+	int		i = 0;
 
 	for (cnt = (maxsize / sizeof (long)) >> 1; cnt > 0; cnt >>= 1) {
 		addr = base + cnt;	/* pointer arith! */
-- 
1.6.6.1

^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2010-05-27 21:16 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-27 18:11 [U-Boot] [PATCH] [RFC] memsize.c: adapt get_ram_size() for address spaces >32 bit Wolfgang Denk
2010-05-27 18:16 ` [U-Boot] [PATCH v2] " Wolfgang Denk
2010-05-27 19:46   ` Scott Wood
2010-05-27 19:57     ` Wolfgang Denk
2010-05-27 20:00       ` Scott Wood
2010-05-27 20:53         ` Wolfgang Denk
2010-05-27 18:23 ` [U-Boot] [PATCH] " Timur Tabi
2010-05-27 19:44   ` Wolfgang Denk
2010-05-27 20:01     ` Timur Tabi
2010-05-27 20:57       ` Wolfgang Denk
2010-05-27 21:05         ` Timur Tabi
2010-05-27 21:13           ` Wolfgang Denk
2010-05-27 21:10         ` Kumar Gala
2010-05-27 21:16           ` Wolfgang Denk
2010-05-27 20:06     ` Scott Wood
2010-05-27 21:06       ` Wolfgang Denk
2010-05-27 18:59 ` Wolfgang Wegner
2010-05-27 19:49   ` Wolfgang Denk

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox