diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-14 01:08:39 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2009-02-14 01:08:39 +0000 |
commit | c198c0206fa6d459d2c16713be7ef87f4eee627f (patch) | |
tree | 4e73e8a017a57b6c089f5e4ae1677f0452a1f2a1 /nuttx/arch/sh/src/m16c/m16c_sigdeliver.c | |
parent | ab6cd2a0ec5b37f095ffe26ca2302ec8bbade103 (diff) | |
download | px4-nuttx-c198c0206fa6d459d2c16713be7ef87f4eee627f.tar.gz px4-nuttx-c198c0206fa6d459d2c16713be7ef87f4eee627f.tar.bz2 px4-nuttx-c198c0206fa6d459d2c16713be7ef87f4eee627f.zip |
Add task register intialization logic
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1492 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/sh/src/m16c/m16c_sigdeliver.c')
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_sigdeliver.c | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/nuttx/arch/sh/src/m16c/m16c_sigdeliver.c b/nuttx/arch/sh/src/m16c/m16c_sigdeliver.c index 9efa5f5ba..7cea935e4 100644 --- a/nuttx/arch/sh/src/m16c/m16c_sigdeliver.c +++ b/nuttx/arch/sh/src/m16c/m16c_sigdeliver.c @@ -81,12 +81,9 @@ void up_sigdeliver(void) { -#if 1 -# warning "Missing signal deliver logic" -#else #ifndef CONFIG_DISABLE_SIGNALS _TCB *rtcb = (_TCB*)g_readytorun.head; - uint32 regs[XCPTCONTEXT_REGS]; + ubyte regs[XCPTCONTEXT_SIZE]; sig_deliver_t sigdeliver; /* Save the errno. This must be preserved throughout the @@ -105,8 +102,9 @@ void up_sigdeliver(void) /* Save the real return state on the stack. */ up_copystate(regs, rtcb->xcp.regs); - regs[REG_PC] = rtcb->xcp.saved_pc; - regs[REG_SR] = rtcb->xcp.saved_sr; + regs[REG_PC16] = rtcb->xcp.saved_pc[0]; + regs[REG_PC16+1] = rtcb->xcp.saved_pc[1]; + regs[REG_FLG] = rtcb->xcp.saved_flg; /* Get a local copy of the sigdeliver function pointer. * we do this so that we can nullify the sigdeliver @@ -118,9 +116,9 @@ void up_sigdeliver(void) sigdeliver = rtcb->xcp.sigdeliver; rtcb->xcp.sigdeliver = NULL; - /* Then restore the task interrupt statat. */ + /* Then restore the task interrupt state. */ - irqrestore(regs[REG_SR] & 0x000000f0); + irqrestore(rtcb->xcp.saved_flg); /* Deliver the signals */ @@ -142,7 +140,6 @@ void up_sigdeliver(void) up_ledoff(LED_SIGNAL); up_fullcontextrestore(regs); #endif -#endif } #endif /* !CONFIG_DISABLE_SIGNALS */ |