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_sigdeliver.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_sigdeliver.c')
-rw-r--r-- | nuttx/arch/z16/src/common/up_sigdeliver.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/nuttx/arch/z16/src/common/up_sigdeliver.c b/nuttx/arch/z16/src/common/up_sigdeliver.c index 9083c596f..5cd96d202 100644 --- a/nuttx/arch/z16/src/common/up_sigdeliver.c +++ b/nuttx/arch/z16/src/common/up_sigdeliver.c @@ -83,6 +83,7 @@ void up_sigdeliver(void) #ifndef CONFIG_DISABLE_SIGNALS _TCB *rtcb = (_TCB*)g_readytorun.head; chipreg_t regs[XCPTCONTEXT_REGS]; + uint32 *regs32 = (uint32*)regs; sig_deliver_t sigdeliver; /* Save the errno. This must be preserved throughout the signal handling @@ -101,8 +102,8 @@ void up_sigdeliver(void) /* Save the real return state on the stack. */ up_copystate(regs, rtcb->xcp.regs); - regs[XCPT_PC] = rtcb->xcp.saved_pc; - regs[XCPT_I] = rtcb->xcp.saved_i; + regs32[REG_PC/2] = rtcb->xcp.saved_pc; + regs[REG_FLAGS] = rtcb->xcp.saved_i; /* Get a local copy of the sigdeliver function pointer. * we do this so that we can nullify the sigdeliver @@ -116,7 +117,10 @@ void up_sigdeliver(void) /* Then restore the task interrupt state. */ - irqrestore(regs[XCPT_I]); + if ((reg[REG_FLAGS] & (Z16F_CNTRL_FLAGS_IRQE << 8)) != 0) + { + EI(); + } /* Deliver the signals */ |