diff options
Diffstat (limited to 'nuttx/arch/z16/src/common/up_initialstate.c')
-rw-r--r-- | nuttx/arch/z16/src/common/up_initialstate.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/nuttx/arch/z16/src/common/up_initialstate.c b/nuttx/arch/z16/src/common/up_initialstate.c index 4a7c49a2b..d4430f346 100644 --- a/nuttx/arch/z16/src/common/up_initialstate.c +++ b/nuttx/arch/z16/src/common/up_initialstate.c @@ -78,14 +78,14 @@ void up_initial_state(_TCB *tcb) { - struct xcptcontext *xcp = &tcb->xcp; + uint32 *reg32 = (uint32*)tcb->xcp.regs; /* Initialize the initial exception register context structure */ - memset(xcp, 0, sizeof(struct xcptcontext)); + memset(&tcb->xcp, 0, sizeof(struct xcptcontext)); #ifndef CONFIG_SUPPRESS_INTERRUPTS - xcp->regs[XCPT_I] = Z80_C_FLAG; /* Carry flag will enable interrupts */ + xcp->regs[REG_FLAGS] = Z16F_CNTRL_FLAGS_IRQE << 8; /* IRQE flag will enable interrupts */ #endif - xcp->regs[XCPT_SP] = (chipreg_t)tcb->adj_stack_ptr; - xcp->regs[XCPT_PC] = (chipreg_t)tcb->start; + reg32[REG_SP/2] = (uint32)tcb->adj_stack_ptr; + reg32[REG_PC/2] = (uint32)tcb->start; } |