Removed duplicate stores and loads of the stack pointer during context

switches. Removed some dead debugging code from the __FORK_BRAINDAMAGE
days.
This commit is contained in:
mark 1996-03-27 21:24:39 +00:00
parent 02aafe8ddb
commit c1dff5e43e
1 changed files with 2 additions and 33 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpuswitch.S,v 1.5 1996/03/13 21:39:10 mark Exp $ */
/* $NetBSD: cpuswitch.S,v 1.6 1996/03/27 21:24:39 mark Exp $ */
/*
* Copyright (c) 1994-1996 Mark Brinicombe.
@ -518,10 +518,6 @@ findqueue:
add r7, r1, #(PCB_R8)
stmia r7, {r8-r13}
/* Don't really need to do this. as the stmia above does it */
/* str sp, [r1, #(PCB_SP)]*/
/*
* This can be optimised... We know we want to go from SVC32 mode to UND32
* mode
@ -600,10 +596,6 @@ switch_exited:
add r7, r1, #PCB_R8
ldmia r7, {r8-r13}
/* This is not really needed ! */
/* ldr sp, [r1, #(PCB_SP)]*/
/* Remember the pcb currently in use */
ldr r7, Lcurpcb
@ -647,18 +639,6 @@ switch_return:
*/
ldmfd sp!, {r4-r7, pc}
Ltext30:
.asciz "nkt: cpu_switch: sp=%08x pcb=%08x\n"
.align 0
Ltext31:
.asciz "nkt: process facing firing squad\ncpu_switch: sp=%08x saved sp=%08x\n"
.align 0
Ltext32:
.asciz "nkt: process checksum failure was %08x instead of %08x\n"
.align 0
Lproc0:
.word _proc0
@ -737,7 +717,7 @@ _switch_exit:
ldr r0, [sp]
/*
* Have top wait until we have switched to proc0 as the pmap gets released
* Have to wait until we have switched to proc0 as the pmap gets released
* in vmspace_free()
*/
@ -776,22 +756,11 @@ _savectx:
stmfd sp!, {r4-r7, lr}
/* Push the current spl level onto the stack */
ldr r2, Lcurrent_spl_level
ldr r2, [r2]
str r2, [sp, #-0x0004]!
/* Store all the registers in the process's pcb */
add r2, r0, #(PCB_R8)
stmia r2, {r8-r13}
/* Skip the pushed spl mask */
add sp, sp, #0x0000004
/* Pull the regs of the stack */
ldmfd sp!, {r4-r7, pc}