diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-13 15:31:26 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2008-01-13 15:31:26 +0000 |
commit | 421de422e496c48fdb1aa9cd5711729c5d702f32 (patch) | |
tree | b73222a61ec92e40f3e764da1ec0b08df9dd7546 /nuttx/arch/z16/src/common/up_schedulesigaction.c | |
parent | cbb53cff763928f52d5d4851d9993b0b0fc73d8a (diff) | |
download | px4-nuttx-421de422e496c48fdb1aa9cd5711729c5d702f32.tar.gz px4-nuttx-421de422e496c48fdb1aa9cd5711729c5d702f32.tar.bz2 px4-nuttx-421de422e496c48fdb1aa9cd5711729c5d702f32.zip |
Fix Z16F context structure
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@556 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/z16/src/common/up_schedulesigaction.c')
-rw-r--r-- | nuttx/arch/z16/src/common/up_schedulesigaction.c | 24 |
1 files changed, 14 insertions, 10 deletions
diff --git a/nuttx/arch/z16/src/common/up_schedulesigaction.c b/nuttx/arch/z16/src/common/up_schedulesigaction.c index 6d1aa00ed..3284fd1bf 100644 --- a/nuttx/arch/z16/src/common/up_schedulesigaction.c +++ b/nuttx/arch/z16/src/common/up_schedulesigaction.c @@ -141,21 +141,23 @@ void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver) else { + uint32 *current_pc = (uint32*)¤t_regs[REG_PC]; + /* Save the return address and interrupt state. * These will be restored by the signal trampoline after * the signals have been delivered. */ - tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = current_regs[XCPT_PC]; - tcb->xcp.saved_i = current_regs[XCPT_I]; + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = *current_pc; + tcb->xcp.saved_i = current_regs[REG_FLAGS]; /* Then set up to vector to the trampoline with interrupts * disabled */ - current_regs[XCPT_PC] = (chipreg_t)up_sigdeliver; - current_regs[XCPT_I] = 0; + *current_pc = (uint32)up_sigdeliver; + current_regs[REG_FLAGS] = 0; /* And make sure that the saved context in the TCB * is the same as the interrupt return context. @@ -173,21 +175,23 @@ void up_schedule_sigaction(FAR _TCB *tcb, sig_deliver_t sigdeliver) else { + uint32 *saved_pc = (uint32*)&tcb->xcp.regs[REG_PC]; + /* Save the return lr and cpsr and one scratch register * These will be restored by the signal trampoline after * the signals have been delivered. */ - tcb->xcp.sigdeliver = sigdeliver; - tcb->xcp.saved_pc = tcb->xcp.regs[XCPT_PC]; - tcb->xcp.saved_i = tcb->xcp.regs[XCPT_I]; + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc = *saved_pc; + tcb->xcp.saved_i = tcb->xcp.regs[REG_FLAGS]; /* Then set up to vector to the trampoline with interrupts * disabled */ - tcb->xcp.regs[XCPT_PC] = (chipreg_t)up_sigdeliver; - tcb->xcp.regs[XCPT_I] = 0; + *saved_pc = (uint32)up_sigdeliver; + tcb->xcp.regs[REG_FLAGS] = 0; } irqrestore(flags); |