summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakuya ASADA <syuu@cvs.openbsd.org>2009-11-22 22:44:59 +0000
committerTakuya ASADA <syuu@cvs.openbsd.org>2009-11-22 22:44:59 +0000
commitf829d8789a0980da4a54e6a7e36537af03801691 (patch)
tree5c1f594aa06bcd3c44ff878c9b34fa13aef81196
parent5a32678989a43269dbbfc931f971a8bca22f5919 (diff)
Allocates bootstrap stack by uvm_pglistalloc instead of uvm_km_alloc.
ok miod@, jsing@
-rw-r--r--sys/arch/sgi/sgi/ip30_machdep.c22
1 files changed, 15 insertions, 7 deletions
diff --git a/sys/arch/sgi/sgi/ip30_machdep.c b/sys/arch/sgi/sgi/ip30_machdep.c
index 49fd5174424..19c4af6db4d 100644
--- a/sys/arch/sgi/sgi/ip30_machdep.c
+++ b/sys/arch/sgi/sgi/ip30_machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip30_machdep.c,v 1.21 2009/11/22 19:41:41 syuu Exp $ */
+/* $OpenBSD: ip30_machdep.c,v 1.22 2009/11/22 22:44:58 syuu Exp $ */
/*
* Copyright (c) 2008, 2009 Miodrag Vallat.
@@ -307,6 +307,10 @@ void
hw_cpu_boot_secondary(struct cpu_info *ci)
{
int cpuid = ci->ci_cpuid;
+ struct pglist mlist;
+ struct vm_page *m;
+ int error;
+ vaddr_t kstack;
#ifdef DEBUG
uint64_t stackaddr =
@@ -341,12 +345,16 @@ hw_cpu_boot_secondary(struct cpu_info *ci)
scachesz, fanloads, launch, rndvz,
stackaddr, lparam, rparam, idleflag);
#endif
- vaddr_t kstack;
- kstack = uvm_km_alloc(kernel_map, USPACE);
- if (kstack == 0) {
- panic("prom_boot_secondary: unable to allocate idle stack");
- return;
- }
+
+ TAILQ_INIT(&mlist);
+ error = uvm_pglistalloc(USPACE, 0, -1L, 0, 0,
+ &mlist, 1, UVM_PLA_WAITOK);
+ if (error)
+ panic("unable to allocate idle stack\n");
+
+ m = TAILQ_FIRST(&mlist);
+ kstack = (vaddr_t)PHYS_TO_XKPHYS(VM_PAGE_TO_PHYS(m), CCA_CACHED);
+ bzero((char *)kstack, USPACE);
*(volatile uint64_t *)(mpconf + MPCONF_STACKADDR(cpuid)) =
(uint64_t)(kstack + USPACE);