summaryrefslogtreecommitdiff
path: root/sys/arch/loongson
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2010-02-01 05:23:22 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2010-02-01 05:23:22 +0000
commit03c203c2d5f3765ae5960d64fcf8c53435e254df (patch)
tree8bde314a79abc367ce88188985a375a44f3a9a71 /sys/arch/loongson
parenta7ebb0674ce56139021625aa1e048da75e3ab6d6 (diff)
Fix thinko in previous.
Diffstat (limited to 'sys/arch/loongson')
-rw-r--r--sys/arch/loongson/loongson/machdep.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/sys/arch/loongson/loongson/machdep.c b/sys/arch/loongson/loongson/machdep.c
index 8d9c407fef2..0351134303d 100644
--- a/sys/arch/loongson/loongson/machdep.c
+++ b/sys/arch/loongson/loongson/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.4 2010/01/31 15:29:59 miod Exp $ */
+/* $OpenBSD: machdep.c,v 1.5 2010/02/01 05:23:21 miod Exp $ */
/*
* Copyright (c) 2009 Miodrag Vallat.
@@ -349,14 +349,14 @@ mips_init(int32_t argc, int32_t argv, int32_t envp, int32_t cv)
paddr_t firstkernpa, lastkernpa;
/* kernel is linked in CKSEG0 */
- firstkernpa = CKSEG0_TO_PHYS((vaddr_t)start) +
+ firstkernpa = CKSEG0_TO_PHYS((vaddr_t)start);
+ lastkernpa = CKSEG0_TO_PHYS((vaddr_t)ekern);
+
+ firstkernpage = atop(trunc_page(firstkernpa)) +
mem_layout[0].mem_first_page - 1;
- lastkernpa = CKSEG0_TO_PHYS((vaddr_t)ekern) +
+ lastkernpage = atop(round_page(lastkernpa)) +
mem_layout[0].mem_first_page - 1;
- firstkernpage = atop(trunc_page(firstkernpa));
- lastkernpage = atop(round_page(lastkernpa));
-
fp = mem_layout[i].mem_first_page;
lp = mem_layout[i].mem_last_page;
freelist = mem_layout[i].mem_freelist;