summaryrefslogtreecommitdiff
path: root/sys/arch/octeon
diff options
context:
space:
mode:
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]);
}