Centralize identical copies of proc_trampoline code.

(lots more opportunites here for the bored hacker, such as rei and trap0...)
This commit is contained in:
nathanw 2004-03-04 19:53:44 +00:00
parent 4bace323ed
commit 797c90374e
13 changed files with 29 additions and 181 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.137 2003/08/07 16:26:38 agc Exp $ */
/* $NetBSD: locore.s,v 1.138 2004/03/04 19:53:44 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990 The Regents of the University of California.
@ -738,7 +738,6 @@ ENTRY_NOPROFILE(lev7intr)
* (profiling, scheduling) and software interrupts (network, softclock).
* We check for ASTs first, just like the VAX. To avoid excess overhead
* the T_ASTFLT handling code will also check for software interrupts so we
* do not have to do it here.
* do not have to do it here. After identifing that we need an AST we
* drop the IPL to allow device interrupts.
*
@ -1095,20 +1094,6 @@ Lnoflush:
addql #8,%sp | pop SSP and stack adjust count
rte
/*
* proc_trampoline call function in register a2 with a3 as an arg
* and then rei.
*/
ENTRY_NOPROFILE(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | usp to a0
movl %a0,%usp | setup user stack pointer
moveml %sp@+,%d0-%d7/%a0-%a6 | restore all but sp
addql #8,%sp | pop sp and stack adjust
jra _ASM_LABEL(rei) | all done
/*
* Use common m68k sigcode.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.93 2004/02/13 11:36:11 wiz Exp $ */
/* $NetBSD: locore.s,v 1.94 2004/03/04 19:53:44 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990 The Regents of the University of California.
@ -1069,20 +1069,6 @@ Lnoflush:
addql #8,%sp | pop SSP and stack adjust count
rte
/*
* proc_trampoline call function in register a2 with a3 as an arg
* and then rei.
*/
ENTRY_NOPROFILE(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | usp to a0
movl %a0,%usp | setup user stack pointer
moveml %sp@+,#0x7FFF | restore all but sp
addql #8,%sp | pop sp and stack adjust
jra _ASM_LABEL(rei) | all done
/*
* Use common m68k sigcode.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.11 2003/08/07 16:27:14 agc Exp $ */
/* $NetBSD: locore.s,v 1.12 2004/03/04 19:53:44 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -384,17 +384,6 @@ Lmainreturned:
.asciz "main() returned"
.even
GLOBAL(proc_trampoline)
movl %a3,%sp@-
jbsr %a2@
addql #4,%sp
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Trap/interrupt vector routines
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.133 2003/11/17 14:37:59 tsutsui Exp $ */
/* $NetBSD: locore.s,v 1.134 2004/03/04 19:53:44 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -580,21 +580,6 @@ Lnocache0:
PANIC("main() returned")
/* NOTREACHED */
/*
* proc_trampoline: call function in register %a2 with %a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Trap/interrupt vector routines
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.21 2004/02/13 11:36:14 wiz Exp $ */
/* $NetBSD: locore.s,v 1.22 2004/03/04 19:53:44 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -361,20 +361,6 @@ Lenab3:
PANIC("main() returned")
/* NOTREACHED */
/*
* proc_trampoline: call function in register %a2 with %a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | process' frame pointer in sp
jbsr %a2@
addql #4,%sp
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Trap/interrupt vector routines
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: switch_subr.s,v 1.9 2004/01/04 11:33:30 jdolecek Exp $ */
/* $NetBSD: switch_subr.s,v 1.10 2004/03/04 19:53:44 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -545,3 +545,19 @@ ENTRY(m68k_make_fpu_idle_frame)
addql #4,%sp
rts
#endif
/*
* proc_trampoline: call function in register %a2 with %a3 as an arg
* and then rei.
*/
ENTRY_NOPROFILE(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.143 2003/08/07 16:28:22 agc Exp $ */
/* $NetBSD: locore.s,v 1.144 2004/03/04 19:53:44 nathanw Exp $ */
/*
* Copyright (c) 1982, 1990 The Regents of the University of California.
@ -383,20 +383,6 @@ Lnocache0:
PANIC("main() returned")
/* NOTREACHED */
/*
* proc_trampoline
* Call function in register %a2 with %a3 as an arg and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | %usp to %a0
movl %a0,%usp | setup user's stack pointer
movml %sp@+,#0x7fff | restore all but %sp
addql #8,%sp | pop %sp and stack adjust
jra _ASM_LABEL(rei) | all done
/*
* Trap/interrupt vector routines
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.94 2004/02/13 11:36:15 wiz Exp $ */
/* $NetBSD: locore.s,v 1.95 2004/03/04 19:53:45 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -744,20 +744,6 @@ Lmemc040berr:
jbra Lmemc040ret | Done
#endif
/*
* proc_trampoline: call function in register a2 with a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Trap/interrupt vector routines
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.33 2003/08/07 16:28:51 agc Exp $ */
/* $NetBSD: locore.s,v 1.34 2004/03/04 19:53:45 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -497,20 +497,6 @@ Lenab3:
SETLED2(3); | main returned?
/*
* proc_trampoline: call function in register a2 with a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Trap/interrupt vector routines
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.42 2003/08/07 16:28:56 agc Exp $ */
/* $NetBSD: locore.s,v 1.43 2004/03/04 19:53:45 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -505,21 +505,6 @@ Lenab3:
PANIC("main() returned")
/* NOTREACHED */
/*
* proc_trampoline: call function in register %a2 with %a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Trap/interrupt vector routines
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.15 2003/09/21 14:41:33 cl Exp $ */
/* $NetBSD: locore.s,v 1.16 2004/03/04 19:53:45 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -180,20 +180,6 @@ L_high_code:
jbsr _C_LABEL(main) | main(&trapframe)
PANIC("main() returned")
/*
* proc_trampoline: call function in register %a2 with %a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
| That is all the assembly startup code we need on the sun3!
| The rest of this is like the hp300/locore.s where possible.

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.84 2003/08/07 16:29:57 agc Exp $ */
/* $NetBSD: locore.s,v 1.85 2004/03/04 19:53:46 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -178,20 +178,6 @@ L_high_code:
jbsr _C_LABEL(main) | main(&trapframe)
PANIC("main() returned")
/*
* proc_trampoline: call function in register %a2 with %a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
| That is all the assembly startup code we need on the sun3!
| The rest of this is like the hp300/locore.s where possible.

View File

@ -1,4 +1,4 @@
/* $NetBSD: locore.s,v 1.73 2003/08/07 16:30:30 agc Exp $ */
/* $NetBSD: locore.s,v 1.74 2004/03/04 19:53:46 nathanw Exp $ */
/*
* Copyright (c) 1980, 1990, 1993
@ -1006,20 +1006,6 @@ Lenab3:
PANIC("main() returned") | Yow! Main returned!
/* NOTREACHED */
/*
* proc_trampoline: call function in register a2 with a3 as an arg
* and then rei.
*/
GLOBAL(proc_trampoline)
movl %a3,%sp@- | push function arg
jbsr %a2@ | call function
addql #4,%sp | pop arg
movl %sp@(FR_SP),%a0 | grab and load
movl %a0,%usp | user SP
moveml %sp@+,#0x7FFF | restore most user regs
addql #8,%sp | toss SP and stack adjust
jra _ASM_LABEL(rei) | and return
/*
* Use common m68k sigcode.
*/