|
|
HP C
|
Previous | Contents | Index |
The __CMP_SWAP_QUAD function performs a conditional atomic compare and exchange operation on a quadword. The quadword pointed to by source is read and compared with the quadword old_value. If they are equal, the quadword new_value is written into the quadword pointed to by source. The read and write is performed atomically, with no intervening access to the same memory region.
The function returns 1 if the write occurs, and 0 otherwise.
This function has the following format:
int __CMP_SWAP_QUAD (volatile void *source, int old_value, int new_value); |
source
The quadword value to be compared with old_value.old_value
The quadword value source is compared with.new_value
The quadword value written to source if source and old_value are equal.
The __CMP_SWAP_LONG_ACQ function performs a conditional atomic compare and exchange operation with acquire semantics on a longword. The longword pointed to by source is read and compared with the longword old_value. If they are equal, the longword new_value is written into the longword pointed to by source. The read and write is performed atomically, with no intervening access to the same memory region.
Acquire memory ordering guarantees that the memory read/write is made visible before all subsequent data accesses to the same memory location by other processors.
The function returns 1 if the write occurs, and 0 otherwise.
This function has the following format:
int __CMP_SWAP_LONG_ACQ (volatile void *source, int old_value, int new_value); |
source
The longword value to be compared with old_value.old_value
The longword value source is compared with.new_value
The longword value written into source if source and old_value are equal.
The __CMP_SWAP_QUAD_ACQ function performs a conditional atomic compare and exchange operation with acquire semantics on a quadword. The quadword pointed to by source is read and compared with the quadword old_value. If they are equal, the quadword new_value is written into the quadword pointed to by source. The read and write is performed atomically, with no intervening access to the same memory region.
Acquire memory ordering guarantees that the memory read/write is made visible before all subsequent memory data accesses to the same memory location by other processors.
The function returns 1 if the write occurs, and 0 otherwise.
This function has the following format:
int __CMP_SWAP_QUAD_ACQ (volatile void *source, int old_value, int new_value); |
source
The quadword value to be compared with old_value.old_value
The quadword value source is compared with.new_value
The quadword value written into source if source and old_value are equal.
The __CMP_SWAP_LONG_REL function performs a conditional atomic compare and exchange operation with release semantics on a longword. The longword pointed to by source is read and compared with the longword old_value. If they are equal, the longword new_value is written into the longword pointed to by source. The read and write is performed atomically, with no intervening access to the same memory region.
Release memory ordering guarantees that the memory read/write is made visible after all previous data memory acceses to the same memory location by other processors.
The function returns 1 if the write occurs, and 0 otherwise.
This function has the following format:
int __CMP_SWAP_LONG_REL (volatile void *source, int old_value, int new_value); |
source
The longword value to be compared with old_value.old_value
The longword value source is compared with.new_value
The longword value written into source if source and old_value are equal.
The __CMP_SWAP_QUAD_REL function performs a conditional atomic compare and exchange operation with release semantics on a quadword. The quadword pointed to by source is read and compared with the quadword old_value. If they are equal, the quadword new_value is written into the quadword pointed to by source. The read and write is performed atomically, with no intervening access to the same memory region.
Release memory ordering guarantees that the memory read/write is made visible after all previous data memory acceses to the same memory location by other processors.
The function returns 1 if the write occurs, and 0 otherwise.
This function has the following format:
int __CMP_SWAP_QUAD_REL (volatile void *source, int old_value, int new_value); |
source
The quadword value to be compared with old_value.old_value
The quadword value source is compared with.new_value
The quadword value written into source if source and old_value are equal.
The __RETURN_ADDRESS function produces the address to which the function containing the built-in call will return as a 64-bit integer (on Alpha systems, the value of R26 on entry to the function; on I64 systems, the value of B0 on entry to the function).
This built-in function cannot be used within a function specified to use nonstandard linkage.
This function has the following format:
__int64 __RETURN_ADDRESS (void); |
The __break2 function is used to implement the Alpha __PAL_GENTRAP and __PAL_BUGCHK built-in functions on OpenVMS I64 systems.
The __break2 function is equivalent to the __break function with the second parameter passed in general register 17:
R17 = __R17_value; __break (__break_code); |
This function has the following format:
void __break2 (__Integer_Constant __break_code, unsigned __int64 __r17_value); |
__breakcode
The particular software condition that has occurred.__r17_value
The value of R17, a volatile general register reserved by the OpenVMS Itanium calling standard for use by compiled code to communicate with specialized compiler support routines that require out-of-band information passing.
The __flushrs function flushes the register stack.
This function has the following format:
void __flushrs (void); |
The __loadrs function loads the register stack.
This function has the following format:
void __loadrs (void); |
The __prober function determines whether read access to the virtual address specified by __address bits {60:0} and the region register indexed by __address bits {63:61} is permitted at the privilege level given by __mode bits {1:0}. It returns 1 if the access is permitted, and 0 otherwise.
This function can probe only with equal or lower privilege levels. If the specified privilege level is higher (lower number), then the probe is performed with the current privilege level.
This function is the same as the Intel __probe_r function.
This function has the following format:
int __prober (__int64 __address, unsigned int __mode); |
__address
Virtual address for which read-access permission is being checked.__mode
Privilege level for which read-access permission is being checked.
The __probew function determines whether write access to the virtual address specified by __address bits {60:0} and the region register indexed by __address bits {63:61}, is permitted at the privilege level given by __mode bits {1:0}. It returns 1 if the access is permitted, and 0 otherwise.
This function can probe only with equal or lower privilege levels. If the specified privilege level is higher (lower number), then the probe is performed with the current privilege level.
This function is the same as the Intel __probe_w function.
This function has the following format:
int __probew (__int64 __address, unsigned int __mode); |
__address
Virtual address for which write-access permission is being checked.__mode
Privilege level for which write-access permission is being checked.
The __tak function returns the translation access key.
This function has the following format:
unsigned int __tak (__int64 __address); |
__address
Virtual address for translation key is being returned.
The __tpa function translates a virtual address to a physical address.
This function has the following format:
__int64 __tpa(__int64 __address); |
__address
Virtual address to be translated.
The following sections describe the HP C built-in functions available on OpenVMS VAX systems.
The HP C built-in functions use enumerated typedefs to define possible return values. We recommend that you use the enumerated types to store and compare return values.
The __ALLOCA function allocates n bytes from the stack.
This function has the following format:
void *__ALLOCA (unsigned int n); |
n
The number of bytes to be allocated.
A pointer to the allocated memory is returned.
The _ADAWI function adds its source operand to the destination. This function is interlocked against similar operations by other processors or devices in the system.
The _ADAWI function has the following format:
typedef enum { _adawi_sum_neg=--1, _adawi_sum_zero, _adawi_sum_pos} _ADAWI_STATUS; _ADAWI_STATUS _ADAWI (short __src, short *__dest); |
__src
The value to be added to the destination.__dest
A pointer to the destination. The destination must be aligned on a word boundary. (You can achieve alignment using the _align or __align storage-class modifier.)
There are three possible return values:
The _BBCCI function performs the following functions in interlocked fashion:
The _BBCCI function has the following format:
typedef enum { _bbcci_oldval_1, _bbcci_oldval_0} _BBCCI_STATUS; _BBCCI_STATUS _BBCCI (int __position, void *__address); |
__position
The position of the bit within the field.__address
The base address of the field.
The return value of _bbcci_oldval_1 (0) or _bbcci_oldval_0 (1) is the complement of the value of the specified bit before being cleared.
The _BBSSI function performs the following functions in interlocked fashion:
The _BBSSI function has the following format:
typedef enum { _bbssi_oldval_0, _bbcci_oldval_1} _BBSSI_STATUS; _BBSSI_STATUS _BBSSI (int __position, void *__address); |
__position
The position of the bit within the field.__address
The base address of the field.
The return value of _bbssi_oldval_0 (0) or _bbssi_oldval_1 (1) is the value of the specified bit before being set.
The _FFC function finds the position of the first clear bit in a field. The bits are tested for clear status starting at bit 0 and extending to the highest bit in the field.
The _FFC function has the following format:
typedef enum { _ff_bit_not_found, _ff_bit_found} _FF_STATUS; _FF_STATUS _FFC (int __start, char __size, const void *__base, int *__position); |
__start
The start position of the field.__size
The size of the field, in bits. The size must be a value from 0 to 32 bits.__base
The address of the field.__position
The address of an integer to receive the position of the clear bit. If no bit is clear, the integer is set to the position of the first bit past the last bit tested.
There are two possible return values:
The _FFS function finds the position of the first set bit in a field. The bits are tested for set status starting at bit 0 and extending to the highest bit in the field.
The _FFS function has the following format:
typedef enum { _ff_bit_not_found, _ff_bit_found} _FF_STATUS; _FF_STATUS _FFS (int __start, char __size, const void *__base, int *__position); |
__start
The start position of the field.__size
The size of the field, in bits. The size must be a value from 0 to 32 bits.__base
The address of the field.__position
The address of an integer to receive the position of the set bit. If no bit is set, the integer is set to the position of the first bit past the last bit tested.
There are two possible return values:
The _HALT function halts the processor when executed by a process running in kernel mode. This is a privileged function.
The _HALT function has the following format:
void _HALT (void); |
The _INSQHI function inserts an entry into the front of a queue in an indivisible manner. This operation is interlocked against similar operations by other processors or devices in the system.
The _INSQHI function has the following format:
typedef enum {_insqi_inserted_many, _insqi_not_inserted, _insqi_inserted_only} _INSQI_STATUS; _INSQI_STATUS _INSQHI (void *__new_entry, void *__head); |
__new_entry
A pointer to the new entry to be inserted. The entry must be aligned on a quadword boundary. (You can achieve alignment using the _align or __align storage-class modifier.)__head
A pointer to the queue header. The header must be aligned on a quadword boundary. (You can achieve alignment using the _align or __align storage-class modifier.)
There are three possible return values:
The _INSQTI function inserts an entry at the end of a queue in an indivisible manner. This operation is interlocked against similar operations by other processors or devices in the system.
The _INSQTI function has the following format:
typedef enum {_insqi_inserted_many, _insqi_not_inserted, _insqi_inserted_only} _INSQI_STATUS; _INSQI_STATUS _INSQTI (void *__new_entry, void *__head); |
__new_entry
A pointer to the new entry to be inserted. The entry must be aligned on a quadword boundary. (You can achieve alignment using the _align or __align storage-class modifier.)__head
A pointer to the queue header. The header must be aligned on a quadword boundary. (You can achieve alignment using the _align or __align storage-class modifier.)
There are three possible return values:
The _INSQUE function inserts a new entry into a queue following an existing entry.
The _INSQUE function has the following format:
typedef enum { _insque_inserted_only, _insque_inserted_many} _INSQUE_STATUS; _INSQUE_STATUS _INSQUE (void *__new_entry, void *__predecessor); |
__new_entry
A pointer to the new entry to be inserted.__predecessor
A pointer to an existing entry in the queue.
There are two possible return values:
Previous | Next | Contents | Index |
|