summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/armv7-a/arm_addrenv.c
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-09-14 09:53:54 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-09-14 09:53:54 -0600
commitdef9063a49cb5c309b03ad0dcd858d71a31a0ad5 (patch)
treedb1a6538db4823142b5e4ca2817f64e06f163a78 /nuttx/arch/arm/src/armv7-a/arm_addrenv.c
parent659cb309b3e0dde2ce2f69320569bcd3ebda93af (diff)
downloadpx4-nuttx-def9063a49cb5c309b03ad0dcd858d71a31a0ad5.tar.gz
px4-nuttx-def9063a49cb5c309b03ad0dcd858d71a31a0ad5.tar.bz2
px4-nuttx-def9063a49cb5c309b03ad0dcd858d71a31a0ad5.zip
Add the initial implementation of the process kernel stack logic. Not yet integrated into the main OS logic nor tested.
Diffstat (limited to 'nuttx/arch/arm/src/armv7-a/arm_addrenv.c')
-rw-r--r--nuttx/arch/arm/src/armv7-a/arm_addrenv.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/nuttx/arch/arm/src/armv7-a/arm_addrenv.c b/nuttx/arch/arm/src/armv7-a/arm_addrenv.c
index fcc1eb1f1..d1ff06c52 100644
--- a/nuttx/arch/arm/src/armv7-a/arm_addrenv.c
+++ b/nuttx/arch/arm/src/armv7-a/arm_addrenv.c
@@ -58,9 +58,9 @@
*
* up_addrenv_attach - Clone the address environment assigned to one TCB
* to another. This operation is done when a pthread
- * is created that share's the same address
+ * is created that share's the same group address
* environment.
- * up_addrenv_detach - Release the threads reference to an address
+ * up_addrenv_detach - Release the thread's reference to an address
* environment when a task/thread exits.
*
* CONFIG_ARCH_STACK_DYNAMIC=y indicates that the user process stack resides
@@ -84,6 +84,21 @@
* up_addrenv_vustack - Returns the virtual base address of the stack
* up_addrenv_ustackselect - Instantiate a stack address environment
*
+ * If CONFIG_ARCH_KERNEL_STACK is selected, then each user process will have
+ * two stacks: (1) a large (and possibly dynamic) user stack and (2) a
+ * smaller kernel stack. However, this option is *required* if both
+ * CONFIG_BUILD_KERNEL and CONFIG_LIBC_EXECFUNCS are selected. Why? Because
+ * when we instantiate and initialize the address environment of the new
+ * user process, we will temporarily lose the address environment of the old
+ * user process, including its stack contents. The kernel C logic will crash
+ * immediately with no valid stack in place.
+ *
+ * If CONFIG_ARCH_KERNEL_STACK=y is selected then the platform specific
+ * code must export these additional interfaces:
+ *
+ * up_addrenv_kstackalloc - Create a stack in the kernel address environment
+ * up_addrenv_kstackfree - Destroy the kernel stack.
+ *
****************************************************************************/
/****************************************************************************