summaryrefslogtreecommitdiffstats
path: root/sys/boot/uboot/common
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2008-02-23 17:58:12 +0000
committermarcel <marcel@FreeBSD.org>2008-02-23 17:58:12 +0000
commit30c7c35b1480887e4a07caea2b7f618c203a97ea (patch)
treea08a960f742eaa7bc8b7c18a6054373fc0214188 /sys/boot/uboot/common
parent8b1e9609cad9bdf4aeb8812f3935dc2bee900270 (diff)
downloadFreeBSD-src-30c7c35b1480887e4a07caea2b7f618c203a97ea.zip
FreeBSD-src-30c7c35b1480887e4a07caea2b7f618c203a97ea.tar.gz
o Include glue.h
o Support multiple memory regions.
Diffstat (limited to 'sys/boot/uboot/common')
-rw-r--r--sys/boot/uboot/common/main.c22
1 files changed, 10 insertions, 12 deletions
diff --git a/sys/boot/uboot/common/main.c b/sys/boot/uboot/common/main.c
index 2c793e7..762c6ce 100644
--- a/sys/boot/uboot/common/main.c
+++ b/sys/boot/uboot/common/main.c
@@ -30,10 +30,11 @@
__FBSDID("$FreeBSD$");
#include <stand.h>
-#include "bootstrap.h"
-#include "libuboot.h"
#include "api_public.h"
+#include "bootstrap.h"
+#include "glue.h"
+#include "libuboot.h"
struct uboot_devdesc currdev;
struct arch_switch archsw; /* MI/MD interface boundary */
@@ -54,11 +55,6 @@ extern unsigned char __sbss_start[];
extern unsigned char __sbss_end[];
extern unsigned char _end[];
-extern void * syscall_ptr;
-
-struct sys_info * ub_get_sys_info(void);
-
-
void dump_si(struct sys_info *si)
{
#ifdef DEBUG
@@ -96,17 +92,19 @@ dump_addr_info(void)
static uint64_t
memsize(int flags)
{
- int i;
- struct sys_info * si;
+ int i;
+ struct sys_info *si;
+ uint64_t size;
if ((si = ub_get_sys_info()) == NULL)
return 0;
-
+
+ size = 0;
for (i = 0; i < si->mr_no; i++)
if (si->mr[i].flags == flags && si->mr[i].size)
- return (si->mr[i].size);
+ size += (si->mr[i].size);
- return 0;
+ return (size);
}
int
OpenPOWER on IntegriCloud