summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2010-06-03 15:48:59 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2010-06-03 15:48:59 +0000
commit114388914e7c6f69d66c560d7455210c7249aa08 (patch)
treef97e566c33b5d2883eb75f7c351dcace40ced253 /sys/arch
parenta6a27dbe8d531379fbdcf29edcc6876a92d34c55 (diff)
Rename ci_spinup_stack to ci_stack and use it as the stack for both CPU
spin up and FPU emulation. Since all CPUs need a stack for FPU emulation, move the allocation code to cpuattach(). ok kettenis@
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/hppa/dev/cpu.c31
-rw-r--r--sys/arch/hppa/hppa/genassym.cf4
-rw-r--r--sys/arch/hppa/hppa/locore.S14
-rw-r--r--sys/arch/hppa/include/cpu.h4
4 files changed, 26 insertions, 27 deletions
diff --git a/sys/arch/hppa/dev/cpu.c b/sys/arch/hppa/dev/cpu.c
index f1b787cfccf..270ec9ea2bc 100644
--- a/sys/arch/hppa/dev/cpu.c
+++ b/sys/arch/hppa/dev/cpu.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.c,v 1.35 2010/05/21 15:24:29 jsing Exp $ */
+/* $OpenBSD: cpu.c,v 1.36 2010/06/03 15:48:58 jsing Exp $ */
/*
* Copyright (c) 1998-2003 Michael Shalayeff
@@ -96,13 +96,27 @@ cpuattach(struct device *parent, struct device *self, void *aux)
struct cpu_info *ci;
u_int mhz = 100 * cpu_ticksnum / cpu_ticksdenom;
int cpuno = self->dv_unit;
+ struct pglist mlist;
+ struct vm_page *m;
const char *p;
+ int error;
ci = &cpu_info[cpuno];
ci->ci_dev = self;
ci->ci_cpuid = cpuno;
ci->ci_hpa = ca->ca_hpa;
+ /* Allocate stack for spin up and FPU emulation. */
+ TAILQ_INIT(&mlist);
+ error = uvm_pglistalloc(PAGE_SIZE, 0, -1L, 0, 0, &mlist, 1,
+ UVM_PLA_NOWAIT);
+ if (error) {
+ printf(": unable to allocate CPU stack!\n");
+ return;
+ }
+ m = TAILQ_FIRST(&mlist);
+ ci->ci_stack = VM_PAGE_TO_PHYS(m);
+
printf (": %s ", cpu_typename);
if (pdc_model.hvers) {
static const char lvls[4][4] = { "0", "1", "1.5", "2" };
@@ -172,9 +186,7 @@ cpu_boot_secondary_processors(void)
{
struct cpu_info *ci;
struct iomod *cpu;
- struct pglist mlist;
- struct vm_page *m;
- int error, i, j;
+ int i, j;
/* Initialise primary CPU. */
ci = curcpu();
@@ -193,17 +205,6 @@ cpu_boot_secondary_processors(void)
sched_init_cpu(ci);
#endif
- /* Allocate spinup stack. */
- TAILQ_INIT(&mlist);
- error = uvm_pglistalloc(PAGE_SIZE, 0, -1L, 0, 0, &mlist, 1,
- UVM_PLA_NOWAIT);
- if (error) {
- printf("unable to allocate spinup stack!\n");
- return;
- }
- m = TAILQ_FIRST(&mlist);
- ci->ci_spinup_stack = VM_PAGE_TO_PHYS(m);
-
/* Release the specified CPU by triggering an EIR{0}. */
cpu_hatch_info = ci;
cpu = (struct iomod *)(ci->ci_hpa);
diff --git a/sys/arch/hppa/hppa/genassym.cf b/sys/arch/hppa/hppa/genassym.cf
index 1f4617ac2be..622c1e844dc 100644
--- a/sys/arch/hppa/hppa/genassym.cf
+++ b/sys/arch/hppa/hppa/genassym.cf
@@ -1,4 +1,4 @@
-# $OpenBSD: genassym.cf,v 1.38 2010/05/19 13:10:24 jsing Exp $
+# $OpenBSD: genassym.cf,v 1.39 2010/06/03 15:48:58 jsing Exp $
#
# Copyright (c) 1982, 1990, 1993
@@ -158,7 +158,7 @@ member fpswtch
struct cpu_info
member ci_curproc
-member ci_spinup_stack
+member ci_stack
member ci_psw
member ci_cpl
member ci_ipending
diff --git a/sys/arch/hppa/hppa/locore.S b/sys/arch/hppa/hppa/locore.S
index 0e1bcd8bbeb..308e3416d1f 100644
--- a/sys/arch/hppa/hppa/locore.S
+++ b/sys/arch/hppa/hppa/locore.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore.S,v 1.171 2010/05/27 11:52:23 jsing Exp $ */
+/* $OpenBSD: locore.S,v 1.172 2010/06/03 15:48:58 jsing Exp $ */
/*
* Copyright (c) 1998-2004 Michael Shalayeff
@@ -112,7 +112,6 @@ netisr
BSS(pdc_stack, 4) /* temp stack for PDC call */
BSS(emrg_stack, 4) /* stack for HPMC/TOC/PWRF */
- BSS(fpemu_stack, 4) /* stack for FPU emulation */
.export kernelmapped, data
BSS(kernelmapped, 4) /* set when kernel is mapped */
@@ -169,7 +168,6 @@ ENTRY($start,0)
STACK_ALLOC(pdc_stack, PDC_STACKSIZE)
STACK_ALLOC(emrg_stack, EMRG_STACKSIZE)
- STACK_ALLOC(fpemu_stack, FPEMU_STACKSIZE)
#undef STACK_ALLOC
@@ -2366,8 +2364,8 @@ EXIT(fpu_save)
ENTRY($fpu_emulate,320)
copy r31, r9
- ldil L%fpemu_stack, r31
- ldw R%fpemu_stack(r31), r31
+ mfctl cr29, r31
+ ldw CI_STACK(r31), r31
/* stw r1 , TF_R1 (r31) shadowed */
stw r2 , TF_R2 (r31)
@@ -2439,8 +2437,8 @@ ENTRY($fpu_emulate,320)
fdc r0(r25)
sync
- ldil L%fpemu_stack, r31
- ldw R%fpemu_stack(r31), r31
+ mfctl cr29, r31
+ ldw CI_STACK(r31), r31
ldw TF_CR11(r31), r1
ldw TF_R2 (r31), r2
@@ -2988,7 +2986,7 @@ ENTRY(hw_cpu_spinup_trampoline, 0)
* Setup the stack frame for us to call C with and mark this as the
* first frame on the stack.
*/
- ldw CI_SPINUP_STACK(r3), sp
+ ldw CI_STACK(r3), sp
stw,ma r0, HPPA_FRAME_SIZE(sp)
stw r0, HPPA_FRAME_CRP(sp)
stw r0, HPPA_FRAME_PSP(sp)
diff --git a/sys/arch/hppa/include/cpu.h b/sys/arch/hppa/include/cpu.h
index a7b842a0373..576b9189826 100644
--- a/sys/arch/hppa/include/cpu.h
+++ b/sys/arch/hppa/include/cpu.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: cpu.h,v 1.73 2010/06/03 15:05:52 jsing Exp $ */
+/* $OpenBSD: cpu.h,v 1.74 2010/06/03 15:48:58 jsing Exp $ */
/*
* Copyright (c) 2000-2004 Michael Shalayeff
@@ -84,7 +84,7 @@ struct cpu_info {
volatile int ci_flags;
struct proc *ci_curproc;
- paddr_t ci_spinup_stack;
+ paddr_t ci_stack;
register_t ci_psw; /* Processor Status Word. */
volatile int ci_cpl;