Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Paste
P40
memsize
Active
Public
Actions
Authored by
br
on Dec 15 2014, 2:15 PM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Flag For Later
Award Token
Tags
None
Referenced Files
F58224: memsize
Dec 15 2014, 2:15 PM
2014-12-15 14:15:47 (UTC+0)
Subscribers
None
Index: sys/mips/beri/beri_machdep.c
===================================================================
--- sys/mips/beri/beri_machdep.c (revision 275803)
+++ sys/mips/beri/beri_machdep.c (working copy)
@@ -184,6 +184,8 @@
char **envp = (char **)a2;
long memsize;
#ifdef FDT
+ struct mem_region mr[FDT_MEM_REGIONS];
+ int mr_cnt, err, val;
char buf[2048]; /* early stack supposedly big enough */
vm_offset_t dtbp;
phandle_t chosen;
@@ -268,6 +270,16 @@
cninit();
printf("entry: platform_start()\n");
+#ifdef FDT
+ /*
+ * Try to grab physical memory regions information from device tree.
+ * Override value provided by miniboot on success.
+ */
+ err = fdt_get_mem_regions(mr, &mr_cnt, &val);
+ if (err == 0)
+ memsize = val;
+#endif
+
bootverbose = 1;
if (bootverbose) {
printf("cmd line: ");
Event Timeline
br
edited the content of this paste.
(Show Details)
Dec 15 2014, 2:15 PM
2014-12-15 14:15:47 (UTC+0)
br
changed the title of this paste from untitled to
memsize
.
br
updated the paste's language from
autodetect
to
autodetect
.
Log In to Comment