From 421de422e496c48fdb1aa9cd5711729c5d702f32 Mon Sep 17 00:00:00 2001 From: patacongo Date: Sun, 13 Jan 2008 15:31:26 +0000 Subject: Fix Z16F context structure git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@556 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/arch/z16/src/common/up_sigdeliver.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'nuttx/arch/z16/src/common/up_sigdeliver.c') 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 */ -- cgit v1.2.3