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_schedulesigaction.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_schedulesigaction.c')
-rw-r--r-- | nuttx/arch/sh/src/m16c/m16c_schedulesigaction.c | 35 |
1 files changed, 16 insertions, 19 deletions
diff --git a/nuttx/arch/sh/src/m16c/m16c_schedulesigaction.c b/nuttx/arch/sh/src/m16c/m16c_schedulesigaction.c index 074f189b5..d33e63378 100644 --- a/nuttx/arch/sh/src/m16c/m16c_schedulesigaction.c +++ b/nuttx/arch/sh/src/m16c/m16c_schedulesigaction.c @@ -141,25 +141,24 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) else { -#if 1 -# warning "Missing logic to schedule signals" -#else /* Save the return PC and SR 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 = current_regs[REG_PC]; - tcb->xcp.saved_sr = current_regs[REG_SR]; + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc[0] = current_regs[REG_PC16]; + tcb->xcp.saved_pc[1] = current_regs[REG_PC16+1]; + tcb->xcp.saved_flg = current_regs[REG_FLG]; /* Then set up to vector to the trampoline with interrupts * disabled */ - current_regs[REG_PC] = (uint32)up_sigdeliver; - current_regs[REG_SR] |= 0x000000f0; -#endif + current_regs[REG_PC16] = (uint32)up_sigdeliver >> 8; + current_regs[REG_PC16+1] = (uint32)up_sigdeliver; + current_regs[REG_FLG] &= ~M16C_FLG_I; + /* And make sure that the saved context in the TCB * is the same as the interrupt return context. */ @@ -176,25 +175,23 @@ void up_schedule_sigaction(_TCB *tcb, sig_deliver_t sigdeliver) else { - #if 1 -# warning "Missing logic to schedule signals" -#else - /* Save the return PC and SR and one scratch register + /* Save the return PC and SR 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[REG_PC]; - tcb->xcp.saved_sr = tcb->xcp.regs[REG_SR]; + tcb->xcp.sigdeliver = sigdeliver; + tcb->xcp.saved_pc[0] = tcb->xcp.regs[REG_PC16]; + tcb->xcp.saved_pc[1] = tcb->xcp.regs[REG_PC16+1]; + tcb->xcp.saved_flg = tcb->xcp.regs[REG_FLG]; /* Then set up to vector to the trampoline with interrupts * disabled */ - tcb->xcp.regs[REG_PC] = (uint32)up_sigdeliver; - tcb->xcp.regs[REG_SR] |= 0x000000f0 ; -#endif + tcb->xcp.regs[REG_PC16] = (uint32)up_sigdeliver >> 8; + tcb->xcp.regs[REG_PC16+1] = (uint32)up_sigdeliver; + tcb->xcp.regs[REG_FLG] &= ~M16C_FLG_I; } irqrestore(flags); |