Some fixes needed for STM32 build after recent scheduler changes
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5620 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
parent
057413339c
commit
fd9eac63a9
@ -127,7 +127,7 @@
|
|||||||
pid_t up_vfork(const struct vfork_s *context)
|
pid_t up_vfork(const struct vfork_s *context)
|
||||||
{
|
{
|
||||||
struct tcb_s *parent = (FAR struct tcb_s *)g_readytorun.head;
|
struct tcb_s *parent = (FAR struct tcb_s *)g_readytorun.head;
|
||||||
struct tcb_s *child;
|
struct task_tcb_s *child;
|
||||||
size_t stacksize;
|
size_t stacksize;
|
||||||
uint32_t newsp;
|
uint32_t newsp;
|
||||||
uint32_t newfp;
|
uint32_t newfp;
|
||||||
@ -161,7 +161,7 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
|
|
||||||
/* Allocate the stack for the TCB */
|
/* Allocate the stack for the TCB */
|
||||||
|
|
||||||
ret = up_create_stack(child, stacksize);
|
ret = up_create_stack((FAR struct tcb_s *)child, stacksize);
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
sdbg("up_create_stack failed: %d\n", ret);
|
sdbg("up_create_stack failed: %d\n", ret);
|
||||||
@ -187,7 +187,7 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
* effort is overkill.
|
* effort is overkill.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
newsp = (uint32_t)child->adj_stack_ptr - stackutil;
|
newsp = (uint32_t)child->cmn.adj_stack_ptr - stackutil;
|
||||||
memcpy((void *)newsp, (const void *)context->sp, stackutil);
|
memcpy((void *)newsp, (const void *)context->sp, stackutil);
|
||||||
|
|
||||||
/* Was there a frame pointer in place before? */
|
/* Was there a frame pointer in place before? */
|
||||||
@ -196,7 +196,7 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
context->fp >= (uint32_t)parent->adj_stack_ptr - stacksize)
|
context->fp >= (uint32_t)parent->adj_stack_ptr - stacksize)
|
||||||
{
|
{
|
||||||
uint32_t frameutil = (uint32_t)parent->adj_stack_ptr - context->fp;
|
uint32_t frameutil = (uint32_t)parent->adj_stack_ptr - context->fp;
|
||||||
newfp = (uint32_t)child->adj_stack_ptr - frameutil;
|
newfp = (uint32_t)child->cmn.adj_stack_ptr - frameutil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -206,7 +206,7 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
svdbg("Old stack base:%08x SP:%08x FP:%08x\n",
|
svdbg("Old stack base:%08x SP:%08x FP:%08x\n",
|
||||||
parent->adj_stack_ptr, context->sp, context->fp);
|
parent->adj_stack_ptr, context->sp, context->fp);
|
||||||
svdbg("New stack base:%08x SP:%08x FP:%08x\n",
|
svdbg("New stack base:%08x SP:%08x FP:%08x\n",
|
||||||
child->adj_stack_ptr, newsp, newfp);
|
child->cmn.adj_stack_ptr, newsp, newfp);
|
||||||
|
|
||||||
/* Update the stack pointer, frame pointer, and volatile registers. When
|
/* Update the stack pointer, frame pointer, and volatile registers. When
|
||||||
* the child TCB was initialized, all of the values were set to zero.
|
* the child TCB was initialized, all of the values were set to zero.
|
||||||
@ -215,15 +215,15 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
* child thread.
|
* child thread.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
child->xcp.regs[REG_R4] = context->r4; /* Volatile register r4 */
|
child->cmn.xcp.regs[REG_R4] = context->r4; /* Volatile register r4 */
|
||||||
child->xcp.regs[REG_R5] = context->r5; /* Volatile register r5 */
|
child->cmn.xcp.regs[REG_R5] = context->r5; /* Volatile register r5 */
|
||||||
child->xcp.regs[REG_R6] = context->r6; /* Volatile register r6 */
|
child->cmn.xcp.regs[REG_R6] = context->r6; /* Volatile register r6 */
|
||||||
child->xcp.regs[REG_R7] = context->r7; /* Volatile register r7 */
|
child->cmn.xcp.regs[REG_R7] = context->r7; /* Volatile register r7 */
|
||||||
child->xcp.regs[REG_R8] = context->r8; /* Volatile register r8 */
|
child->cmn.xcp.regs[REG_R8] = context->r8; /* Volatile register r8 */
|
||||||
child->xcp.regs[REG_R9] = context->r9; /* Volatile register r9 */
|
child->cmn.xcp.regs[REG_R9] = context->r9; /* Volatile register r9 */
|
||||||
child->xcp.regs[REG_R10] = context->r10; /* Volatile register r10 */
|
child->cmn.xcp.regs[REG_R10] = context->r10; /* Volatile register r10 */
|
||||||
child->xcp.regs[REG_FP] = newfp; /* Frame pointer */
|
child->cmn.xcp.regs[REG_FP] = newfp; /* Frame pointer */
|
||||||
child->xcp.regs[REG_SP] = newsp; /* Stack pointer */
|
child->cmn.xcp.regs[REG_SP] = newsp; /* Stack pointer */
|
||||||
|
|
||||||
/* And, finally, start the child task. On a failure, task_vforkstart()
|
/* And, finally, start the child task. On a failure, task_vforkstart()
|
||||||
* will discard the TCB by calling task_vforkabort().
|
* will discard the TCB by calling task_vforkabort().
|
||||||
|
@ -114,7 +114,7 @@
|
|||||||
pid_t up_vfork(const struct vfork_s *context)
|
pid_t up_vfork(const struct vfork_s *context)
|
||||||
{
|
{
|
||||||
struct tcb_s *parent = (FAR struct tcb_s *)g_readytorun.head;
|
struct tcb_s *parent = (FAR struct tcb_s *)g_readytorun.head;
|
||||||
struct tcb_s *child;
|
struct task_tcb_s *child;
|
||||||
size_t stacksize;
|
size_t stacksize;
|
||||||
uint32_t newsp;
|
uint32_t newsp;
|
||||||
#if CONFIG_MIPS32_FRAMEPOINTER
|
#if CONFIG_MIPS32_FRAMEPOINTER
|
||||||
@ -167,7 +167,7 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
|
|
||||||
/* Allocate the stack for the TCB */
|
/* Allocate the stack for the TCB */
|
||||||
|
|
||||||
ret = up_create_stack(child, stacksize);
|
ret = up_create_stack((FAR struct tcb_s *)child, stacksize);
|
||||||
if (ret != OK)
|
if (ret != OK)
|
||||||
{
|
{
|
||||||
sdbg("up_create_stack failed: %d\n", ret);
|
sdbg("up_create_stack failed: %d\n", ret);
|
||||||
@ -193,7 +193,7 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
* effort is overkill.
|
* effort is overkill.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
newsp = (uint32_t)child->adj_stack_ptr - stackutil;
|
newsp = (uint32_t)child->cmn.adj_stack_ptr - stackutil;
|
||||||
memcpy((void *)newsp, (const void *)context->sp, stackutil);
|
memcpy((void *)newsp, (const void *)context->sp, stackutil);
|
||||||
|
|
||||||
/* Was there a frame pointer in place before? */
|
/* Was there a frame pointer in place before? */
|
||||||
@ -203,7 +203,7 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
context->fp >= (uint32_t)parent->adj_stack_ptr - stacksize)
|
context->fp >= (uint32_t)parent->adj_stack_ptr - stacksize)
|
||||||
{
|
{
|
||||||
uint32_t frameutil = (uint32_t)parent->adj_stack_ptr - context->fp;
|
uint32_t frameutil = (uint32_t)parent->adj_stack_ptr - context->fp;
|
||||||
newfp = (uint32_t)child->adj_stack_ptr - frameutil;
|
newfp = (uint32_t)child->cmn.adj_stack_ptr - frameutil;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -213,12 +213,12 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
svdbg("Old stack base:%08x SP:%08x FP:%08x\n",
|
svdbg("Old stack base:%08x SP:%08x FP:%08x\n",
|
||||||
parent->adj_stack_ptr, context->sp, context->fp);
|
parent->adj_stack_ptr, context->sp, context->fp);
|
||||||
svdbg("New stack base:%08x SP:%08x FP:%08x\n",
|
svdbg("New stack base:%08x SP:%08x FP:%08x\n",
|
||||||
child->adj_stack_ptr, newsp, newfp);
|
child->cmn.adj_stack_ptr, newsp, newfp);
|
||||||
#else
|
#else
|
||||||
svdbg("Old stack base:%08x SP:%08x\n",
|
svdbg("Old stack base:%08x SP:%08x\n",
|
||||||
parent->adj_stack_ptr, context->sp);
|
parent->adj_stack_ptr, context->sp);
|
||||||
svdbg("New stack base:%08x SP:%08x\n",
|
svdbg("New stack base:%08x SP:%08x\n",
|
||||||
child->adj_stack_ptr, newsp);
|
child->cmn.adj_stack_ptr, newsp);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Update the stack pointer, frame pointer, global pointer and saved
|
/* Update the stack pointer, frame pointer, global pointer and saved
|
||||||
@ -228,22 +228,22 @@ pid_t up_vfork(const struct vfork_s *context)
|
|||||||
* indication to the newly started child thread.
|
* indication to the newly started child thread.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
child->xcp.regs[REG_S0] = context->s0; /* Saved register s0 */
|
child->cmn.xcp.regs[REG_S0] = context->s0; /* Saved register s0 */
|
||||||
child->xcp.regs[REG_S1] = context->s1; /* Saved register s1 */
|
child->cmn.xcp.regs[REG_S1] = context->s1; /* Saved register s1 */
|
||||||
child->xcp.regs[REG_S2] = context->s2; /* Saved register s2 */
|
child->cmn.xcp.regs[REG_S2] = context->s2; /* Saved register s2 */
|
||||||
child->xcp.regs[REG_S3] = context->s3; /* Volatile register s3 */
|
child->cmn.xcp.regs[REG_S3] = context->s3; /* Volatile register s3 */
|
||||||
child->xcp.regs[REG_S4] = context->s4; /* Volatile register s4 */
|
child->cmn.xcp.regs[REG_S4] = context->s4; /* Volatile register s4 */
|
||||||
child->xcp.regs[REG_S5] = context->s5; /* Volatile register s5 */
|
child->cmn.xcp.regs[REG_S5] = context->s5; /* Volatile register s5 */
|
||||||
child->xcp.regs[REG_S6] = context->s6; /* Volatile register s6 */
|
child->cmn.xcp.regs[REG_S6] = context->s6; /* Volatile register s6 */
|
||||||
child->xcp.regs[REG_S7] = context->s7; /* Volatile register s7 */
|
child->cmn.xcp.regs[REG_S7] = context->s7; /* Volatile register s7 */
|
||||||
#if CONFIG_MIPS32_FRAMEPOINTER
|
#if CONFIG_MIPS32_FRAMEPOINTER
|
||||||
child->xcp.regs[REG_FP] = newfp; /* Frame pointer */
|
child->cmn.xcp.regs[REG_FP] = newfp; /* Frame pointer */
|
||||||
#else
|
#else
|
||||||
child->xcp.regs[REG_S8] = context->s8; /* Volatile register s8 */
|
child->cmn.xcp.regs[REG_S8] = context->s8; /* Volatile register s8 */
|
||||||
#endif
|
#endif
|
||||||
child->xcp.regs[REG_SP] = newsp; /* Stack pointer */
|
child->cmn.xcp.regs[REG_SP] = newsp; /* Stack pointer */
|
||||||
#if MIPS32_SAVE_GP
|
#if MIPS32_SAVE_GP
|
||||||
child->xcp.regs[REG_GP] = newsp; /* Global pointer */
|
child->cmn.xcp.regs[REG_GP] = newsp; /* Global pointer */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* And, finally, start the child task. On a failure, task_vforkstart()
|
/* And, finally, start the child task. On a failure, task_vforkstart()
|
||||||
|
Loading…
Reference in New Issue
Block a user