[an error occurred while processing this directive]
HP OpenVMS Systems Documentation |
HP OpenVMS Calling Standard
4.8.5.5 The Write Register RoutinePlace a function pointer for this routine in the LIBICB$PH_UO_WRITE_REG field of the invocation context block. The write register routine is used to write a register in the target process. It is used by LIB$I64_PUT_INVO_REGISTERS for a register that has not been saved in memory. This routine is optional, or subset of registers can be implemented, in this case LIB$I64_PUT_INVO_REGISTERS will return an error if this routine is not present, or is unable to write the desired register.
Arguments:
Function Value Returned:
4.8.5.6 The Memory Allocation RoutineThe memory allocation routine is used to allocate heap storage required during the analysis of unwind descriptors. This routine should mimic the behavior of the C RTL routine malloc.
Arguments:
Function Value Returned:
In the case where local memory is being read, that is, you have not overridden the read memory routines, the malloc requests are reduced to:
The number of the last two required depends on the complexity of the
unwind descriptors for a given procedure being traced.
The memory deallocation routine is used to free heap storage allocated by the memory allocation routine (see Section 4.8.5.6). This routine should mimic the behavior of the C RTL routine free.
Arguments:
Function Value Returned:
None.
In order to make the most effective use of the addressing modes available to Intel Itanium processors, each image's data is partitioned into one or two short data segments and some number of long data segments. The short data segments, addressed by the GP register in each image, contain the following areas:
The long data segments contain either or both of the following areas:
Own data items are those that are either local to an image, or are such that all references to these items from the same image will always refer to these items. Because non-own variables cannot be referenced directly, there is no benefit to placing them in the short data area or bss area. Small own data items are placed in the short bss area or short data areas, and are guaranteed to be within 2 megabytes (in either direction) of the GP address; this allows compilers to use a short direct addressing sequence (using the add with 22-bit immediate instruction) to access any data item allocated in these areas. The compiler should place all own data items that are 8 bytes or less in size (regardless of structure) in one of the short data areas or the short bss area. All other data items, including items that are larger than 8 bytes in size, must be placed in one of the long data areas or long bss areas. The compiler must address these items indirectly, using a linkage table entry. Linkage table entries are typically allocated by the linker in response to a relocation request generated by the compiler; an entry in the linkage table is either a pointer to a data item, or a function descriptor. A function descriptor placed in the linkage table is a local copy of an official function descriptor that is generally allocated by the linker or image activator.
This design allows for a maximum size of 4 megabytes for the short data
segment, because everything must be addressable via the GP register
using the 22-bit add immediate instruction. This allows for up to
256,000 individually-named variables and functions. If an image
requires more than this, linker options may be used to divide the image
into multiple clusters (see Section 4.7.1).
On Itanium hardware, memory references to data that is not naturally aligned can result in alignment faults, which can severely degrade the performance of all procedures that reference the unaligned data. To avoid such performance degradation, all data values should be naturally aligned, as shown in Table 4-18. In addition, common blocks, dynamically allocated (heap) regions (for example from malloc ), and global data items greater than 8 bytes must be aligned on a 16-byte boundary.
For aggregates such as strings, arrays, and records, the data type to be considered for purposes of alignment is not the aggregate itself, but rather the elements of which the aggregate is composed. The alignment requirement of an aggregate is that all elements of the aggregate be naturally aligned. For example, varying 8-bit character strings must start at addresses that are a multiple of at least 2 (word alignment) because of the 16-bit count at the beginning of the string; 32-bit integer arrays start at a longword boundary, irrespective of the extent of the array.
The rules for passing a record in an argument that is passed by
immediate value (see Section 4.7.4) always provide quadword alignment
of the record value independent of the normal alignment requirement of
the record. If deemed appropriate by an implementation, normal
alignment can be established within the called procedure by making a
copy of the record argument at a suitably aligned location.
Access to global variables that are not known (at compile time) to be
defined in the same image must be indirect. Each image has a linkage
table in its data segment, pointed to by the GP register; code must
load a pointer to the global variable from the linkage table, then
access the global variable through the pointer. Access to global
variables known to be defined in the same image or to static locals
that are placed in the short data area may be made with a GP-relative
offset.
Access to short local static data can be made with a GP-relative
offset; access to long local static data must be indirect.
Constants and literals may be placed in the text segment or in the data
segment. If placed in the text segment, the access must be PC-relative
or indirect using a linkage table entry. Literals placed in the data
segment may be placed in the short initialized data area if they are 8
bytes or less in size. Larger literals must be placed in the long
initialized data area or in the text segment. Literals in the long
initialized data area require an indirect access using a linkage table
entry.
The OpenVMS I64 calling standard rules for record layout are designed to provide good run-time performance on all implementations of the Itanium architecture and to provide the required level of compatibility with conventional VAX and Alpha operating environments. Therefore, this standard defines the following record layout conventions:
Only these record layouts may be used across standard interfaces or between languages. Languages can support other language-specific record layout conventions, but such layouts are nonstandard.
The aligned record layout conventions should be used unless interchange
is required with conventional VAX applications that use the OpenVMS VAX
compatible record layouts.
The aligned record layout conventions ensure that:
The aligned record layout is defined by the following conventions:
4.9.5.2 OpenVMS VAX Compatible Record LayoutThe OpenVMS VAX compatible record layout is defined by the following conventions:
4.9.6 Sample Code Sequences
In the sample code sequences in this section, register names of the
form t1, t2, and so on, are temporary registers, and may be assigned to
any available scratch register. The code sequences show necessary cycle
breaks, but no other scheduling considerations have been made. It is
assumed that these code sequences will be scheduled with surrounding
code to make best use of the processor resources.
Own short data can be addressed with a simple direct reference relative to the GP register, as shown in the following example:
Own long data can be addressed either via the linkage table, as shown in Section 4.9.6.2, or directly as shown in the following example:
4.9.6.2 Addressing External Data or Data in a Long Data AreaWhen data is not known to be defined in the current image (that is, it is not own), or if it is too large for the short data region, it must be accessed indirectly through the linkage table, as shown in the following example:
4.9.6.3 Addressing Literals in the Text SegmentLiterals in the text segment may be addressed either through the linkage table, as in Section 4.9.6.2, or with PC-relative addressing, as shown in the following example:
4.9.6.4 Materializing Function PointersFunction pointers must always be obtained from the data segment, either as an initialized quadword or through the linkage table, as shown in the following examples:
Materializing function pointers through linkage table:
Materializing function pointers in data:
|