diff --git a/Documentation/NuttxPortingGuide.html b/Documentation/NuttxPortingGuide.html index 279bb57f0f..0a336ec00f 100644 --- a/Documentation/NuttxPortingGuide.html +++ b/Documentation/NuttxPortingGuide.html @@ -12,7 +12,7 @@
Last Updated: September 13, 2014
+Last Updated: September 14, 2014
@@ -119,7 +119,9 @@ 4.4.11up_addrenv_ustackalloc()
4.4.12 up_addrenv_ustackfree()
4.4.13 up_addrenv_vustack()
- 4.4.14 up_addrenv_ustackselect()
+ 4.4.14 up_addrenv_ustackselect()
+ 4.4.15 up_addrenv_kstackalloc()
+ 4.4.16 up_addrenv_kstackfree()
4.5 APIs Exported by NuttX to Architecture-Specific Logic
up_addrenv_ustackalloc()
:
Create a stack address environment
+ up_addrenv_ustackfree()
:
Destroy a stack address environment.
+ 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()
:
+ Allocate the process kernel stack.
+ up_addrenv_kstackfree()
:
+ Free the process kernel stack.
+ OK
) on success; a negated errno
value on failure.
+up_addrenv_kstackalloc()
Function Prototype:
+
int up_addrenv_kstackalloc(FAR struct tcb_s *tcb, size_t stacksize);
+Description:
++ This function is called when a new thread is created to allocate the new thread's kernel stack. +
+Input Parameters:
+tcb
: The TCB of the thread that requires the kernel stack.stacksize
: The size (in bytes) of the kernel stack needed by the thread.Returned Value:
+OK
) on success; a negated errno
value on failure.
+up_addrenv_kstackfree()
Function Prototype:
+
int up_addrenv_kstackfree(FAR struct tcb_s *tcb);
+Description:
++ This function is called when any thread exits. This function frees the kernel stack. +
+Input Parameters:
+tcb
: The TCB of the thread that no longer requires the kernel stack.Returned Value:
+OK
) on success; a negated errno
value on failure.
+These are standard interfaces that are exported by the OS