#include <cafe/os.h> u32 OSGetUserStackPointer(OSThread* thread);
|thread||Pointer to the thread that obtains the user stack pointer(*): The thread specified in this case must be in a suspended state.|
* The user stack in this case means the one specified at the time of thread creation.
If the specified thread is being suspended, return the user stack pointer.
If not, return
This function obtains the user stack pointer for the specified thread.
The user stack in this case indicates the one specified at the time of thread creation.
Even if an API in SDK has switched stacks by
you can still obtain the latest stack pointer for using the user stack.
OSSwitchFiber save the stack pointer into the OSThread structure
of the current thread before switching stacks.
In doing so, even when stacks have been switched, the user stack pointer can return.
However, OSCoroutine-related APIs do not save the pointer as described above.
(OSCoroutine provides a mechanism to achieve high-speed context switching.
For more information on OSCoroutine, see
It takes some time to obtain the current thread when saving.
Because execution speed is especially important to OSCoroutine, it is exempt from saving the user stack pointer.
With middleware using
OSGetUserStackPointer may not function properly.
The target thread needs to be in a suspended state.
2015/03/10 Removed private note.
2013/05/08 Automated cleanup pass.
2012/07/31 Cleanup Pass
2011/10/14 Initial version.