summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/examples/ostest/vfork.c6
-rw-r--r--nuttx/arch/arm/src/arm/vfork.S3
-rw-r--r--nuttx/arch/arm/src/armv7-m/vfork.S3
-rw-r--r--nuttx/arch/arm/src/common/up_vfork.c2
4 files changed, 5 insertions, 9 deletions
diff --git a/apps/examples/ostest/vfork.c b/apps/examples/ostest/vfork.c
index 8657f0ceb..4e1b8c892 100644
--- a/apps/examples/ostest/vfork.c
+++ b/apps/examples/ostest/vfork.c
@@ -51,12 +51,6 @@
* Pre-processor Definitions
****************************************************************************/
-/* Disabled this test for now. There are some issues with the vfork
- * implementation.
-*/
-
-#undef CONFIG_ARCH_HAVE_VFORK
-
/****************************************************************************
* Private Data
****************************************************************************/
diff --git a/nuttx/arch/arm/src/arm/vfork.S b/nuttx/arch/arm/src/arm/vfork.S
index b498fd7f7..226d9f7de 100644
--- a/nuttx/arch/arm/src/arm/vfork.S
+++ b/nuttx/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/nuttx/arch/arm/src/armv7-m/vfork.S b/nuttx/arch/arm/src/armv7-m/vfork.S
index 0d9e144cd..386fca33c 100644
--- a/nuttx/arch/arm/src/armv7-m/vfork.S
+++ b/nuttx/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/nuttx/arch/arm/src/common/up_vfork.c b/nuttx/arch/arm/src/common/up_vfork.c
index 3da602679..5349378bc 100644
--- a/nuttx/arch/arm/src/common/up_vfork.c
+++ b/nuttx/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;