Guardian Procedure Calls Reference Manual
• The STACK_ALLOCATE_ procedure is only supported in pTAL; it is not supported in TAL.
Parameters
stacksize
input, output
INT(32) .EXT:ref:1
specifies the overall stack size in bytes (which includes all the components of the stack) and
returns the size actually allocated. The unsigned integer input value is rounded up to a multiple
of the memory page size (16 KB) and may be adjusted further as needed to satisfy the minimum
size of each component. If any error is returned, stacksize is unchanged.
guardsize input
INT(32):value
specifies the minimum size in bytes of the guard area. The unsigned integer input value is
rounded up to a multiple of the page size, with a minimum of one memory page. The size of
the guard area is greater than its minimum when the stack has room for growth, because the
guard area is the portion of the overall stack that has not been mapped.
stackaddr output
EXTADDR .EXT:ref:1
if the operation was successful, this output parameter contains the base address of the newly
allocated stack and is always 16KB-page aligned. If any error other than 0 is returned,
stackaddr is unchanged.
stackoptions
input
INT(32):value
specifies special actions to be performed on the stack. This parameter is composed of multiple
unsigned integer values, specifying attributes of the stack components and whether a special
action is to be taken. Literals are defined in KMEM and kmem.h.
specifies no bit set; all options default.ST_NONE
specifies that this stack segment is to be copied to a child process upon fork(),
even if the stack is not currently active. By default, a thread stack is copied only if
a thread running on this stack calls fork(). Stacks are not copied across exec().
ST_COF
where g is a constant in the range 0 to 100. This value specifies the percentage
of the stack pages (excluding the minimum guard pages) to be reserved for growth
ST_GROWTH*g
(by remaining unmapped initially), subject to the constraint that the minimum size
and granularity of each component is one page. The ST_GROWTH*g percentage
is applied to the total pages excluding the specified or default minimum guard
pages; it is rounded down to whole pages (and can round to zero). The remaining
pages are mapped as the segment is initialized, and have KMSF backing store
reserved. When growth occurs, additional page(s) are mapped and backing store
reserved. A value of 0 results in all pages (excluding the minimum number of guard
pages) being initially mapped, with none reserved for growth. A value of 100
results in initially mapping just one page to the memory area and one page to the
RSE area, with any remaining pages reserved for growth. A value greater than
100 is erroneous; it will be rejected if less than 4096 but otherwise has undefined
effect.
where r is a constant in the range 0 to 100. This value specifies the percentage
of all initially mapped pages to be mapped to the register stack rather than the
ST_RSE*r
memory stack area. A value of 0 defaults to 50. A value greater than 100 is
erroneous; it will be rejected if less than 4096 but otherwise has undefined effect.
The ST_GROWTH*g percentage is applied first; the pages not reserved for guard
pages and growth are then apportioned to the memory and register stack areas.
Any fractional page is rounded in favor of the memory stack area, subject to the
constraint that each area has at least one page
STACK_ALLOCATE_ Procedure 1391