NonStop S-Series Server Description Manual (G06.27+)
TNS Execution Modes
HP NonStop S-Series Server Description Manual—520331-004
6-70
An Accelerated Program File in Virtual Memory
An Accelerated Program File in Virtual Memory
An accelerated program file, when it is allocated space in absolute virtual memory as
an executable process, occupies some number of consecutive absolute segments in
the Kseg2 part of the privileged space. That is illustrated on the right side of
Figure 6-38. The illustrated example assumes that the original TNS code is contained
in two absolute segments (A and A+1) and the accelerated code is contained in eight
absolute segments (A+2 through A+9). Shading denotes unallocated space.
When that same program file becomes a code region in nonprivileged space, the
relative segment number assignments are such that the TNS code always begins at
relative segment 0 of the region, and the Accelerator-generated RISC code always
begins at segment 32. That is illustrated on the left side of Figure 6-38. The
illustration expands the assigned segments to show details that will be described in the
remaining topics of this section.
The first couple of segments generated by the Accelerator (in this example) contain
data, not code. This data, beginning at segment 32, consists of a small (2 kilobyte)
header that describes the remainder of the area, and a set of tables called Pmap
tables. The function of Pmap tables is to provide a cross-reference between locations
in the TNS code and corresponding locations in the accelerated code. There is one
Pmap table for each segment of original nonaccelerated code; in this case, there are
two. (If the program file was not accelerated, this fact would be indicated in memory by
the presence of a page of zeros in place of the header.)
After the Pmap tables, beginning at the next segment boundary (in this case,
segment 34), is the accelerated object code. The accelerated object code consists of
directly executable RISC instructions. The illustrated example assumes that this code
occupies the six relative segments numbered 34 through 39.
As indicated, the RISC code itself recognizes no code-segment boundaries; the
accelerated object code is a single, integral entity. Thus there is no need for “external
entry point” tables, as in the TNS environment. Execution can pass from any location
to another with a single, direct jump anywhere within this area, even up to the
maximum achievable size. (This capability also contributes to the “acceleration” of the
code.)
At the end of the accelerated object code may be another table, called the gateway
table, which is present if the accelerated object code contains any procedure with the
CALLABLE attribute.
If there is any resident code in the program, the gateway table and the header are also
made resident. In addition, if any part of the TNS code is resident, the corresponding
parts of the accelerated code and Pmap table are also made resident.