User-Level Native Thread Primitives (GThread) Library White Paper (G06.26+)
User-Level Native Thread Primitives (GThread Library) 03/31/2005
Hewlett-Packard Company--540065-001 Page 24 of 46
GTH_STACK_ORIGIN_( GThread_CB cb )
Description:
Returns the stack origin used by the thread. Callable for either static or swapped threads. This
replaces accessing the thread control block element StackOrigin.
Input:
cb - The address of the thread control block.
Return: void *
The thread’s stack origin address.
Considerations:
Provided for completeness. Can be used for debugging or tracing purposes.
The origin is the address from which the stack grows. For TNS stacks, which grow toward higher
addresses, it is the same as the base of the stack. For TNS/R native stacks, which grow toward
lower addresses, it is at the high end of the stack area. For TNS/E native stacks, it is at the high end
of the memory-stack area.
GTH_ STACK_USED_BASE_( GThread_CB cb )
Description:
Returns the lowest address of the allocated stack area currently in use by the specified thread.
Callable only for a static thread. This replaces accessing the thread control block element
StackStart.
Input:
cb - The address of the thread control block for the thread being checkpointed.
Return: void *
The base address of the used portion of the stack.
Considerations:
Provided for completeness. Can be used for debugging or tracing purposes.
The stack-used base is always the lowest address in use in the allocated stack area, regardless of the
platform architecture or the direction of stack growth or the number of stack components.