NonStop S-Series Server Description Manual (G06.24+)
Memory Addressing and Access
HP NonStop S-Series Server Description Manual—520331-003
4-22
Allocation for TNS and Accelerated Code
Allocation for TNS and Accelerated Code
Figure 4-11 shows an expansion of a code region for a process that uses accelerated
object code. (This does not apply to native processes.) This could be a user code,
user library, or system library region of any given nonprivileged space. The unitary
segment numbers and starting addresses shown within the region are relative to the
beginning of the region.
The TNS code for a given TNS process may or may not have been accelerated,
depending on the performance desired. However, if the program code has been
accelerated, the code region also includes a translation of the TNS object code to
functionally equivalent RISC instructions. An accelerated code file will run faster than
one that has not been accelerated. That is because only RISC instructions can be
directly executed by the instruction processor. A TNS instruction in a nonaccelerated
program must be interpreted each time it is encountered at run time.
In either case, the original TNS object code is contained in one or more unitary
segments (up to 32) at the beginning of the region, as shown in the figure. At unitary
segment 32, only in the case of an accelerated code file, begins the translated RISC
code for the region. Whereas the TNS code is broken up by unitary segment
boundaries (with external calls between segments), the RISC code is not similarly
broken up, and the pieces of code are simply allocated front-to-back throughout the
required space, ignoring unitary segment boundaries.
If there is no accelerated code, its absence is indicated by having a page of zeros as
the first page in unitary segment 32. Normally, when accelerated code is present, this
first page is the beginning of a directory and a set of maps that translate TNS code
addresses to corresponding RISC code addresses.
Because RISC code is generally less compact than the original TNS code (plus the
need for mapping tables), there is a storage expansion factor for RISC code. This
expansion factor can vary considerably, depending on the program and the Accelerator
options used; factors of two to six times are fairly typical. Given the amount of space
available for the RISC code, a full 32-segment TNS program (an unlikely size) can
expand up to seven times. Smaller programs can expand even more—again, an
unlikely situation. Therefore, with 224 unitary segments available in the region, there is
adequate space to accommodate such expansion.
The TNS system code region (SC) starts at 80000000 and is organized like the other
three TNS code regions, with TNS code segments in some of the first 32 unitary
segments and accelerator tables and code starting at 80400000. However, this first
Kseg0 region is shared with many other things (described in a later topic). Only a few
TNS system code segments exist, and the first one is at SC.5, not SC.0.