Add the frame pointer (r14) to the list of registers to save in

the pcb during a context switch.
This commit is contained in:
scw 2002-08-29 16:04:10 +00:00
parent b13c46b64c
commit 1256340461
3 changed files with 7 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: frame.h,v 1.2 2002/08/26 10:38:53 scw Exp $ */
/* $NetBSD: frame.h,v 1.3 2002/08/29 16:04:10 scw Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -162,6 +162,7 @@ struct switchframe {
register_t sf_pc; /* Saved program counter */
register_t sf_sr; /* Status register */
register_t sf_sp; /* Kernel stack pointer */
register_t sf_fp; /* Kernel frame pointer */
struct exc_calleesave sf_regs; /* Saved registers */
struct fpregs sf_fpregs;
};

View File

@ -1,4 +1,4 @@
/* $NetBSD: cpu_switch.S,v 1.5 2002/08/26 10:23:56 scw Exp $ */
/* $NetBSD: cpu_switch.S,v 1.6 2002/08/29 16:04:10 scw Exp $ */
/*
* Copyright 2002 Wasabi Systems, Inc.
@ -91,6 +91,7 @@
getcon sr, r0 /* Fetch status register */ ;\
st.q pcb, PCB_CTX_PC, r18 /* Save return address */ ;\
st.q pcb, PCB_CTX_SP, r15 /* Save stack pointer */ ;\
st.q pcb, PCB_CTX_FP, r14 /* Save frame pointer */ ;\
st.q pcb, PCB_CTX_SR, r0 /* Save status register */ ;\
st.q pcb, PCB_CTX_REGS_R10, r10 /* Save callee-saved regs */ ;\
st.q pcb, PCB_CTX_REGS_R11, r11 ;\
@ -161,6 +162,7 @@
ptabs/u r0, tr7 ;\
ld.q pcb, PCB_CTX_PC, r18 /* Restore return address */ ;\
ld.q pcb, PCB_CTX_SP, r15 /* Restore stack pointer */ ;\
ld.q pcb, PCB_CTX_FP, r14 /* Restore frame pointer */ ;\
ld.q pcb, PCB_CTX_REGS_R10, r10 /* Restore callee-saved regs*/;\
ld.q pcb, PCB_CTX_REGS_R11, r11 ;\
ld.q pcb, PCB_CTX_REGS_R12, r12 ;\

View File

@ -1,4 +1,4 @@
# $NetBSD: genassym.cf,v 1.3 2002/08/26 10:38:52 scw Exp $
# $NetBSD: genassym.cf,v 1.4 2002/08/29 16:04:10 scw Exp $
# Copyright 2002 Wasabi Systems, Inc.
# All rights reserved.
@ -79,6 +79,7 @@ define CI_TSCRATCH offsetof(struct cpu_info, ci_tscratch)
define PCB_CTX_PC offsetof(struct pcb, pcb_ctx.sf_pc)
define PCB_CTX_SR offsetof(struct pcb, pcb_ctx.sf_sr)
define PCB_CTX_SP offsetof(struct pcb, pcb_ctx.sf_sp)
define PCB_CTX_FP offsetof(struct pcb, pcb_ctx.sf_fp)
define PCB_CTX_REGS_R10 offsetof(struct pcb, pcb_ctx.sf_regs.r10)
define PCB_CTX_REGS_R11 offsetof(struct pcb, pcb_ctx.sf_regs.r11)
define PCB_CTX_REGS_R12 offsetof(struct pcb, pcb_ctx.sf_regs.r12)