mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 23:03:27 +08:00
Initial AVR32 task state
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@3026 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -81,19 +81,39 @@ void up_initial_state(_TCB *tcb)
|
|||||||
{
|
{
|
||||||
struct xcptcontext *xcp = &tcb->xcp;
|
struct xcptcontext *xcp = &tcb->xcp;
|
||||||
|
|
||||||
/* Initialize the initial exception register context structure */
|
/* Initialize the initial exception register context structure. Zeroing
|
||||||
|
* all registers is a good debug helper, but should not be necessary.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG
|
||||||
memset(xcp, 0, sizeof(struct xcptcontext));
|
memset(xcp, 0, sizeof(struct xcptcontext));
|
||||||
|
#else
|
||||||
|
/* No pending signal delivery */
|
||||||
|
|
||||||
/* Save the initial stack pointer */
|
xcp->sigdeliver = NULL;
|
||||||
/* Save the task entry point (stripping off the thumb bit) */
|
|
||||||
|
|
||||||
# warning "Not implemented"
|
/* Clear the frame pointer and link register since this is the outermost
|
||||||
|
* frame.
|
||||||
|
*/
|
||||||
|
|
||||||
|
xcp->regs[REG_R7] = 0;
|
||||||
|
xcp->regs[REG_LR] = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Set the initial stack pointer to the "base" of the allocated stack */
|
||||||
|
|
||||||
|
xcp->regs[REG_SP] = (uint32_t)tcb->adj_stack_ptr;
|
||||||
|
|
||||||
|
/* Save the task entry point */
|
||||||
|
|
||||||
|
xcp->regs[REG_PC] = (uint32_t)tcb->start;
|
||||||
|
|
||||||
/* Enable or disable interrupts, based on user configuration */
|
/* Enable or disable interrupts, based on user configuration */
|
||||||
|
|
||||||
# ifdef CONFIG_SUPPRESS_INTERRUPTS
|
# ifdef CONFIG_SUPPRESS_INTERRUPTS
|
||||||
# warning "Not implemented"
|
xcp->regs[REG_SR] = ;
|
||||||
|
# else
|
||||||
|
xcp->regs[REG_SR] = 0;
|
||||||
# endif
|
# endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user