Guardian Programmer's Guide

Table Of Contents
Creating and Managing Processes
Guardian Programmer’s Guide 421922-014
16 - 9
Process Organization
Data Spaces for Native Processes
A TNS/R native process has the following data segments:
A globals-heap segment, containing program global data and, optionally, a heap.
A main stack segment, containing the stack for unprivileged native procedures.
A priv stack segment, containing the stack for privileged native procedures.
Zero or more SRL data segments, used for optional global data owned by each
shared run-time library (SRL).
A process file segment (PFS), used by the operating system.
A TNS/E native process has the following data segments:
A globals-heap segment, containing program global data and, optionally, a heap.
A main memory stack for nonprivileged TNS/E native procedures
A privileged memory stack for privileged procedures
A main register stack engine (RSE) backing store for nonprivileged procedures
A privileged RSE backing store for privileged procedures
Zero or more DLL data segments
Zero or more private DLL code segments
A process file segment (PFS), used by the operating system
Optional program-allocated extended data segments (selectable or flat segments)
For native C and C++ programs, the native Common Run-Time Environment (CRE)
automatically manages a heap in the globals-heap segment. The heap is optional for
other programs.
The main stack segment contains the stack for unprivileged native procedure calls.
Execution automatically switches to the priv stack when a privileged procedure is
called, and switches back to the main stack when that privileged procedure finishes.
(An unprivileged procedure can call only selected privileged procedures, which have
the CALLABLE attribute.)
RISC and Itanium stack growth is as follows: (Note that TNS stacks grow upwards.)
RISC stacks grow downwards (from higher to lower addresses)
The Itanium RSE backing store grows upwards
Itanium memory stacks grow downwards
On both TNS/R and TNS/E CPUs, the main stacks (main RISC stack on TNS/R, main
memory stack on TNS/E) and the heap grow automatically as needed, to a maximum
size. On the TNS/R platform, the default maximum stack size is 1 MB, and on the
TNS/E platform, the default maximum stack size is 2 MB. You can increase the