Guardian Programmer's Guide

Table Of Contents
Mixed Data Model Programming
Guardian Programmer’s Guide 421922-014
A - 2
Allocating a 64-bit Segment
PROC64ADDR - The 64-bit address of a procedure
Additionally, new built-ins are enabled by __EXT64:
$EXT64ADDR_TO_EXTADDR - converts 64-bit address values to 32-bit
extaddr address values; no checking is performed to see if the 32-bit address
value is valid.
$EXT64ADDR_TO_EXTADDR_OV - converts 64-bit address values to 32-bit
EXTADDR address values. If the address cannot be represented in 32-bits, an
overflow trap occurs.
$EXTADDR_TO_EXT64ADDR - converts 32-bit address values to 64-bit
address values.
$FIXED0_TO_EXT64ADDR - converts a FIXED integer to a 64-bit address
EXT64ADDR.
$IS_32BIT_ADDR - Returns -1 only if the specified address value can be
represented as a 32-bit byte address; otherwise, returns 0. Input values may
be any of the address types except SGWADDR and SGBADDR, which are 16-
bits in length.
$PROCADDR - also accepts a PROC64ADDR expression.
$PROC64ADDR - Converts a PROCADDR or PROC64ADDR expression to a
PROC64ADDR. The bit pattern is unchanged.
$XADR64 - 64-bit counterpart of $XADR.
Also, the $FIX function now accepts an EXT64ADDR expression, converting it to
FIXED(0). The new function $UFIX converts an INT(32) into a zero-extended
FIXED(0).
Allocating a 64-bit Segment
A 64-bit segment is allocated by calling SEGMENT_ALLOCATE64_(). The C/C++
prototype for the function is found in the header kmem.h while the epTAL external
declaration is in kmem. The following procedures are used to allocate and manage 64-
bit segments:
SEGMENT_ALLOCATE64_
A 64-bit version of the existing SEGMENT_ALLOCATE_ procedure.
SEGMENT_GETINFO64_
A 64-bit version of the SEGMENT_GETINFO_ procedure; it supports only native
callers. This procedure is superseded by SEGMENT_GETINFOSTRUCT_; it is
convenient for widening existing calls to SEGMENT_GETINFO_, but is not
recommended for new code.
An additional bit in the usage-flags parameter output identifies 64-bit segments.
The bit is selected by mask 0x1000 (MM_SegIs64Mask in KMEM[.h]); in TAL