diff options
author | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-07 19:35:47 +0000 |
---|---|---|
committer | patacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3> | 2013-01-07 19:35:47 +0000 |
commit | a5f001189e1a056be275e1d736e38893f96cd395 (patch) | |
tree | fca977319643c4fcdbaeecbd38ee572fb9c31ae1 /nuttx/include | |
parent | 876062fe3a2b6273855b77c0ed1c9d0cbcfc43c6 (diff) | |
download | px4-firmware-a5f001189e1a056be275e1d736e38893f96cd395.tar.gz px4-firmware-a5f001189e1a056be275e1d736e38893f96cd395.tar.bz2 px4-firmware-a5f001189e1a056be275e1d736e38893f96cd395.zip |
This initial vfork() check-in was a little pollyanna-ish
git-svn-id: http://svn.code.sf.net/p/nuttx/code/trunk@5487 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/arch.h | 2 | ||||
-rw-r--r-- | nuttx/include/nuttx/sched.h | 26 |
2 files changed, 27 insertions, 1 deletions
diff --git a/nuttx/include/nuttx/arch.h b/nuttx/include/nuttx/arch.h index 8b4b10ade..958986472 100644 --- a/nuttx/include/nuttx/arch.h +++ b/nuttx/include/nuttx/arch.h @@ -1,7 +1,7 @@ /**************************************************************************** * include/nuttx/arch.h * - * Copyright (C) 2007-2012 Gregory Nutt. All rights reserved. + * Copyright (C) 2007-2013 Gregory Nutt. All rights reserved. * Author: Gregory Nutt <gnutt@nuttx.org> * * Redistribution and use in source and binary forms, with or without diff --git a/nuttx/include/nuttx/sched.h b/nuttx/include/nuttx/sched.h index 6eaba6e9c..940bf1f1b 100644 --- a/nuttx/include/nuttx/sched.h +++ b/nuttx/include/nuttx/sched.h @@ -382,6 +382,32 @@ EXTERN FAR struct streamlist *sched_getstreams(void); EXTERN FAR struct socketlist *sched_getsockets(void); #endif /* CONFIG_NSOCKET_DESCRIPTORS */ +/* Internal vfork support.The overall sequence is: + * + * 1) User code calls vfork(). vfork() is provided in architecture-specific + * code. + * 2) vfork()and calls task_vforksetup(). + * 3) task_vforksetup() allocates and configures the child task's TCB. This + * consists of: + * - Allocation of the child task's TCB. + * - Initialization of file descriptors and streams + * - Configuration of environment variables + * - Setup the intput parameters for the task. + * - Initialization of the TCB (including call to up_initial_state() + * 4) vfork() provides any additional operating context. vfork must: + * - Allocate and initialize the stack + * - Initialize special values in any CPU registers that were not + * already configured by up_initial_state() + * 5) vfork() then calls task_vforkstart() + * 6) task_vforkstart() then executes the child thread. + * + * task_vforkabort() may be called if an error occurs between steps 3 and 6. + */ + +FAR _TCB *task_vforksetup(start_t retaddr); +pid_t task_vforkstart(FAR _TCB *child); +void task_vforkabort(FAR _TCB *child, int errcode); + /* sched_foreach will enumerate over each task and provide the * TCB of each task to a user callback functions. Interrupts * will be disabled throughout this enumeration! |