From 4ebf07ab45ecff2d8e766b13bb8cc2eef5176b96 Mon Sep 17 00:00:00 2001 From: patacongo Date: Mon, 7 Jan 2013 23:50:25 +0000 Subject: [PATCH] Fixed ARM vfork; re-enabled vfork OS test git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5490 42af7a65-404d-4744-a932-0658087f49c3 --- arch/arm/src/arm/vfork.S | 3 ++- arch/arm/src/armv7-m/vfork.S | 3 ++- arch/arm/src/common/up_vfork.c | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/arch/arm/src/arm/vfork.S b/arch/arm/src/arm/vfork.S index b498fd7f70b..226d9f7de46 100644 --- a/arch/arm/src/arm/vfork.S +++ b/arch/arm/src/arm/vfork.S @@ -102,7 +102,7 @@ vfork: /* Create a stack frame */ - mov r0, sp /* Save the value of the stack frame on entry */ + mov r0, sp /* Save the value of the stack on entry */ sub sp, sp, #VFORK_SIZEOF /* Allocate the structure on the stack */ /* Save the volatile registers */ @@ -128,6 +128,7 @@ vfork: /* Release the stack data and return the value returned by up_vfork */ + ldr lr, [sp, #VFORK_LR_OFFSET] add sp, sp, #VFORK_SIZEOF mov pc, lr .size vfork, .-vfork diff --git a/arch/arm/src/armv7-m/vfork.S b/arch/arm/src/armv7-m/vfork.S index 0d9e144cdfb..386fca33c40 100644 --- a/arch/arm/src/armv7-m/vfork.S +++ b/arch/arm/src/armv7-m/vfork.S @@ -105,7 +105,7 @@ vfork: /* Create a stack frame */ - mov r0, sp /* Save the value of the stack frame on entry */ + mov r0, sp /* Save the value of the stack on entry */ sub sp, sp, #VFORK_SIZEOF /* Allocate the structure on the stack */ /* Save the volatile registers */ @@ -131,6 +131,7 @@ vfork: /* Release the stack data and return the value returned by up_vfork */ + ldr lr, [sp, #VFORK_LR_OFFSET] add sp, sp, #VFORK_SIZEOF bx lr .size vfork, .-vfork diff --git a/arch/arm/src/common/up_vfork.c b/arch/arm/src/common/up_vfork.c index 3da6026797b..5349378bc4d 100644 --- a/arch/arm/src/common/up_vfork.c +++ b/arch/arm/src/common/up_vfork.c @@ -124,7 +124,7 @@ * ****************************************************************************/ -pid_t up_vfork(struct vfork_s *context) +pid_t up_vfork(const struct vfork_s *context) { _TCB *parent = (FAR _TCB *)g_readytorun.head; _TCB *child;