summaryrefslogtreecommitdiff
path: root/sys/arch/octeon
diff options
context:
space:
mode:
authorPaul Irofti <pirofti@cvs.openbsd.org>2013-08-23 08:18:26 +0000
committerPaul Irofti <pirofti@cvs.openbsd.org>2013-08-23 08:18:26 +0000
commit31c0b4558fe394c4f3252cb6e42a089d49a19034 (patch)
tree85a6f85deb492eac4567d0791fe6b375e8f0eed9 /sys/arch/octeon
parent324b27c203a4ae9da41e3b9f618f35c790872b81 (diff)
Fix memory initialization for octeon's with less than 256MB.
Don't substract the 256MB upperbound from realmem_bytes if the current available memory is less than that. Makes my DSR-500 kernel reach userland. Okay miod@
Diffstat (limited to 'sys/arch/octeon')
-rw-r--r--sys/arch/octeon/octeon/machdep.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index 479fa435ab8..e1d8f0c2ba8 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.39 2013/08/21 11:25:33 pirofti Exp $ */
+/* $OpenBSD: machdep.c,v 1.40 2013/08/23 08:18:25 pirofti Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -168,12 +168,13 @@ octeon_memory_init(struct boot_info *boot_info)
if (boot_info->board_type == BOARD_TYPE_SIM) {
phys_avail[1] = (96 << 20);
} else {
- if (realmem_bytes > OCTEON_DRAM_FIRST_256_END)
+ if (realmem_bytes > OCTEON_DRAM_FIRST_256_END) {
phys_avail[1] = OCTEON_DRAM_FIRST_256_END;
- else
+ realmem_bytes -= OCTEON_DRAM_FIRST_256_END;
+ realmem_bytes &= ~(PAGE_SIZE - 1);
+ } else
phys_avail[1] = realmem_bytes;
- realmem_bytes -= OCTEON_DRAM_FIRST_256_END;
- realmem_bytes &= ~(PAGE_SIZE - 1);
+
mem_layout[0].mem_last_page = atop(phys_avail[1]);
}