summaryrefslogtreecommitdiff
path: root/sys/arch/m88k
diff options
context:
space:
mode:
authorMiod Vallat <miod@cvs.openbsd.org>2004-08-09 20:52:12 +0000
committerMiod Vallat <miod@cvs.openbsd.org>2004-08-09 20:52:12 +0000
commit689b07784d3264ee333643cf0520d609057aaaae (patch)
tree8c1f32f2baea8cccd05de21d4eebbce79da80f09 /sys/arch/m88k
parentcab0e16349812f35522b5ca57d43969fb5cfcd3a (diff)
Take advantage of the recent ABI change to use less stack space and do
less stack pointer manipulation; the kernel needs to be compiled by an up-to-date compiler now, or a tree will fall on your house.
Diffstat (limited to 'sys/arch/m88k')
-rw-r--r--sys/arch/m88k/m88k/m88100_fp.S53
-rw-r--r--sys/arch/m88k/m88k/m88110_fp.S38
-rw-r--r--sys/arch/m88k/m88k/process.S28
3 files changed, 53 insertions, 66 deletions
diff --git a/sys/arch/m88k/m88k/m88100_fp.S b/sys/arch/m88k/m88k/m88100_fp.S
index 4a411105464..4e52dc3e237 100644
--- a/sys/arch/m88k/m88k/m88100_fp.S
+++ b/sys/arch/m88k/m88k/m88100_fp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88100_fp.S,v 1.3 2004/08/09 20:18:14 miod Exp $ */
+/* $OpenBSD: m88100_fp.S,v 1.4 2004/08/09 20:52:11 miod Exp $ */
/*
* Mach Operating System
* Copyright (c) 1991 Carnegie Mellon University
@@ -73,9 +73,9 @@
ASENTRY(m88100_Xfp_precise)
or r29, r3, r0 /* r29 is now the E.F. */
- subu r31, r31, 40
- st r1, r31, 32
- st r29, r31, 36
+ subu r31, r31, 16
+ st r1, r31, 8
+ st r29, r31, 12
ld r2, r29, EF_FPSR * 4
ld r3, r29, EF_FPCR * 4
@@ -118,16 +118,13 @@ ASENTRY(m88100_Xfp_precise)
or.u r4, r4, 0xffff
ASLOCAL(FPuimp)
- subu r31,r31,40 /* allocate stack */
- st r1,r31,36 /* save return address */
-#if 0
- st r3,r31,32 /* save exception frame */
-#endif
+ subu r31,r31,16 /* allocate stack */
+ st r1,r31,0 /* save return address */
or r2,r0,T_FPEPFLT /* load trap type */
- or r3, r29, r0
- bsr _C_LABEL(m88100_trap)
- ld r1,r31,36 /* recover return address */
- addu r31,r31,40 /* deallocate stack */
+ bsr.n _C_LABEL(m88100_trap)
+ or r3, r29, r0
+ ld r1,r31,0 /* recover return address */
+ addu r31,r31,16 /* deallocate stack */
jmp r1
/*
@@ -148,9 +145,9 @@ ASLOCAL(wrapup)
set r10, r10, 1<PSR_INTERRUPT_DISABLE_BIT>
stcr r10, cr1
- ld r1, r31, 32
- ld r29, r31, 36
- addu r31, r31, 40
+ ld r1, r31, 8
+ ld r29, r31, 12
+ addu r31, r31, 16
fstcr r2, FPSR /* write revised value of FPSR */
fstcr r3, FPCR /* write revised value of FPCR */
@@ -166,8 +163,8 @@ ASLOCAL(wrapup)
/* unspecified register */
clr r2, r2, 27<5> /* perform equivalent of mod 32 */
ASLOCAL(writesingle)
- st r6, r3 [r2] /* write low word into memory */
- jmp r1
+ jmp.n r1
+ st r6, r3 [r2] /* write low word into memory */
/*
* Check if the numerator is zero. If the numerator is zero, then handle
@@ -175,8 +172,8 @@ ASLOCAL(writesingle)
*/
ASLOCAL(FPdivzero)
- st r1,r31,0 /* save return address */
- bb1 s1size,r9,1f /* branch if numerator double */
+ bb1.n s1size,r9,1f /* branch if numerator double */
+ st r1,r31,0 /* save return address */
/* single number */
clr r10,r5,1<sign> /* clear sign bit */
extu r11,r6,3<29> /* grab upper bits of lower word */
@@ -2303,9 +2300,9 @@ operation:
ASENTRY(Xfp_imprecise)
/* input: r3 is the exception frame */
or r29, r3, r0 /* r29 is now the E.F. */
- subu r31, r31, 40
- st r1, r31, 32
- st r29, r31, 36
+ subu r31, r31, 16
+ st r1, r31, 4
+ st r29, r31, 8
ld r2 , r29, EF_FPSR * 4
ld r3 , r29, EF_FPCR * 4
@@ -2337,9 +2334,9 @@ fpui_wrapup:
#endif
set r4, r4, 1<PSR_INTERRUPT_DISABLE_BIT>
stcr r4, cr1
- ld r1, r31, 32
- ld r29,r31, 36
- addu r31, r31, 40
+ ld r1, r31, 4
+ ld r29,r31, 8
+ addu r31, r31, 16
fstcr r2, FPSR /* write revised value of FPSR */
fstcr r3, FPCR /* write revised value of FPCR */
@@ -2352,5 +2349,5 @@ fpui_wrapup:
addu r2, r2, 1
clr r2, r2, 27<5>
Iwritesingle:
- st r11, r3 [r2]
- jmp r1
+ jmp.n r1
+ st r11, r3 [r2]
diff --git a/sys/arch/m88k/m88k/m88110_fp.S b/sys/arch/m88k/m88k/m88110_fp.S
index 254a14894aa..9b296235ea1 100644
--- a/sys/arch/m88k/m88k/m88110_fp.S
+++ b/sys/arch/m88k/m88k/m88110_fp.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: m88110_fp.S,v 1.1 2004/04/29 14:33:27 miod Exp $ */
+/* $OpenBSD: m88110_fp.S,v 1.2 2004/08/09 20:52:11 miod Exp $ */
/*
* Copyright (c) 1999 Steve Murphree, Jr.
* All rights reserved.
@@ -54,9 +54,9 @@
ASENTRY(m88110_Xfp_precise)
or r29, r3, r0 /* r29 is now the E.F. */
- subu r31, r31, 40
- st r1, r31, 32
- st r29, r31, 36
+ subu r31, r31, 16
+ st r1, r31, 0
+ st r29, r31, 4
ld r2, r29, EF_FPSR * 4
ld r3, r29, EF_FPCR * 4
@@ -78,26 +78,26 @@ ASENTRY(m88110_Xfp_precise)
or.u r4, r4, 0xffff
ASLOCAL(m88110_FPuimp)
- subu r31,r31,40 /* allocate stack */
- st r1,r31,36 /* save return address */
- st r3,r31,32 /* save exception frame */
+ subu r31,r31,16 /* allocate stack */
+ st r1,r31,4 /* save return address */
+ st r3,r31,0 /* save exception frame */
or r2,r0,T_FPEPFLT /* load trap type */
- or r3, r29, r0
- bsr _C_LABEL(m88110_trap) /* trap */
- ld r1,r31,36 /* recover return address */
- addu r31,r31,40 /* deallocate stack */
- jmp r1
+ bsr.n _C_LABEL(m88110_trap) /* trap */
+ or r3, r29, r0
+ ld r1,r31,4 /* recover return address */
+ jmp.n r1
+ addu r31,r31,16 /* deallocate stack */
ASLOCAL(m88110_FPpriviol)
- subu r31,r31,40 /* allocate stack */
- st r1,r31,36 /* save return address */
- st r3,r31,32 /* save exception frame */
+ subu r31,r31,16 /* allocate stack */
+ st r1,r31,4 /* save return address */
+ st r3,r31,0 /* save exception frame */
or r2,r0,T_PRIVINFLT /* load trap type */
- or r3, r29, r0
- bsr _C_LABEL(m88110_trap) /* trap */
- ld r1,r31,36 /* recover return address */
+ bsr.n _C_LABEL(m88110_trap) /* trap */
+ or r3, r29, r0
+ ld r1,r31,4 /* recover return address */
jmp.n r1
- addu r31,r31,40 /* deallocate stack */
+ addu r31,r31,16 /* deallocate stack */
ENTRY(set_tcfp)
or.u r2, r0, hi16(0x200000)
diff --git a/sys/arch/m88k/m88k/process.S b/sys/arch/m88k/m88k/process.S
index 3968ad74663..93ce7611b78 100644
--- a/sys/arch/m88k/m88k/process.S
+++ b/sys/arch/m88k/m88k/process.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: process.S,v 1.6 2004/08/02 17:30:08 miod Exp $ */
+/* $OpenBSD: process.S,v 1.7 2004/08/09 20:52:11 miod Exp $ */
/*
* Copyright (c) 1996 Nivas Madhur
* All rights reserved.
@@ -80,13 +80,11 @@ ENTRY(switch_exit)
addu r31, r30, USIZE /* now on idle_u stack */
or.u r10, r0, hi16(_C_LABEL(curpcb))
st r30, r10,lo16(_C_LABEL(curpcb)) /* curpcb = &idle_u */
- or.u r10, r0, hi16(_C_LABEL(curproc))
- st r0, r10, lo16(_C_LABEL(curproc)) /* curproc = NULL */
/* Schedule the vmspace and stack to be freed. */
+ or.u r10, r0, hi16(_C_LABEL(curproc))
bsr.n _C_LABEL(exit2)
- subu r31, r31, 48 /* allocate stack */
- addu r31, r31, 48 /* restore stack */
+ st r0, r10, lo16(_C_LABEL(curproc)) /* curproc = NULL */
bsr _C_LABEL(cpu_switch) /* goto final switch */
/*
@@ -110,9 +108,7 @@ ENTRY(cpu_switch)
ld r2, r11, lo16(_C_LABEL(curproc))
bcnd eq0, r2, 1f
- bsr.n _C_LABEL(pmap_deactivate)
- subu r31, r31,48
- addu r31, r31,48
+ bsr _C_LABEL(pmap_deactivate)
or.u r11, r0, hi16(_C_LABEL(curproc))
1:
@@ -225,19 +221,15 @@ ASLOCAL(Ldoneloop)
st r3, r10, lo16(_C_LABEL(curpcb)) /* curpcb = p->p_addr */
/* pmap_activate() the process' pmap */
- or r2, r0, r9 /* r2 = p */
or r14, r0, r9 /* save p in r14 */
bsr.n _C_LABEL(pmap_activate)
- subu r31, r31,48
- addu r31, r31,48
+ or r2, r0, r9
or r9, r0, r14 /* restore p saved in r14 */
or.u r31, r0, hi16(_ASM_LABEL(intstack_end))
or r31,r31, lo16(_ASM_LABEL(intstack_end))
- subu r31, r31,48
bsr.n _C_LABEL(load_u_area)
or r2, r0, r9
- addu r31, r31,48
or.u r10, r0, hi16(_C_LABEL(curpcb))
ld r10, r10, lo16(_C_LABEL(curpcb))
@@ -265,10 +257,8 @@ ASLOCAL(Ldoneloop)
ld r28,r10, PCB_R28
ld r29,r10, PCB_R29
or r14,r10, r0 /* preserve curpcb in a register... */
- subu r31,r31,32
bsr.n _C_LABEL(setipl)
ld r2, r10, PCB_IPL /* restore interrupt mask */
- addu r31,r31,32
ld r1, r14, PCB_PC
ld r30,r14, PCB_R30 /* restore frame pointer & stack */
ld r31,r14, PCB_SP
@@ -310,13 +300,13 @@ ASLOCAL(__savectx)
* We need to save r1 on the stack because we don't know if we were
* called as savectx or __savectx.
*/
- subu r31, r31, 40 /* allocate stack for r1 and args */
- st r1, r31, 32
+ subu r31, r31, 16 /* allocate stack for r1 and args */
+ st r1, r31, 0
bsr.n _C_LABEL(getipl) /* get the current interrupt mask */
or r14, r0, r2
st r2, r14, PCB_IPL /* save interrupt mask */
- ld r1, r31, 32 /* recover return address */
- addu r31, r31, 40 /* put stack pointer back */
+ ld r1, r31, 0 /* recover return address */
+ addu r31, r31, 16 /* put stack pointer back */
/*
* Save FP state.