|
HP OpenVMS System Services Reference Manual
$IEEE_SET_FP_CONTROL (Alpha and I64)
On Alpha and I64 systems, modifies IEEE floating-point state and,
optionally, returns the previous value.
The service provides the mechanism to set the specified state bits, to
clear the specified state bits, and to swap one set of state bits for
another.
Format
SYS$IEEE_SET_FP_CONTROL [clrmsk] ,[setmsk] ,[prvmsk]
C Prototype
int sys$ieee_set_fp_control (struct _ieee *clrmsk, struct _ieee
*setmsk, struct _ieee *prvmsk);
Arguments
clrmsk
OpenVMS usage: |
mask_quadword |
type: |
quadword (unsigned) |
access: |
read only |
mechanism: |
by reference |
Address of a quadword bit mask to be cleared in the IEEE floating-point
control register.
The $IEEEDEF macro defines symbols for the floating-point control
register. Table SYS-47 shows the symbols, their corresponding masks,
and their meaning:
Table SYS-47 Format of the IEEE Floating-Point Control Register (Alpha and I64)
Symbol |
Mask |
Meaning |
IEEE$M_TRAP_ENABLE_INV
|
2
|
Enable invalid operation exception
|
IEEE$M_TRAP_ENABLE_DZE
|
4
|
Enable divide by 0 exception
|
IEEE$M_TRAP_ENABLE_OVF
|
8
|
Enable overflow exception
|
IEEE$M_TRAP_ENABLE_UNF
|
10
|
Enable underflow exception
|
IEEE$M_TRAP_ENABLE_INE
|
20
|
Enable inexact exception
|
IEEE$M_TRAP_ENABLE_DNOE
|
40
|
Enable denormal operand exception
|
IEEE$M_MAP_DNZ
|
2000
|
Denormal operands are mapped to 0.0
|
IEEE$M_MAP_UMZ
|
4000
|
Underflow results are mapped to 0.0
|
IEEE$M_INHERIT
|
8000
|
Inherit FP state on thread create
|
IEEE$M_STATUS_INV
|
20000
|
Invalid operation
|
IEEE$M_STATUS_DZE
|
40000
|
Divide by 0
|
IEEE$M_STATUS_OVF
|
80000
|
Overflow
|
IEEE$M_STATUS_UNF
|
100000
|
Underflow
|
IEEE$M_STATUS_INE
|
200000
|
Inexact
|
IEEE$M_STATUS_DNO
|
400000
|
Denormal operand
|
setmsk
OpenVMS usage: |
mask_quadword |
type: |
quadword (unsigned) |
access: |
read only |
mechanism: |
by reference |
Address of a quadword bit mask to be set in the IEEE floating-point
control register.
Table SYS-47 shows the format of the IEEE floating-point control
register.
prvmsk
OpenVMS usage: |
mask_quadword |
type: |
quadword (unsigned) |
access: |
write only |
mechanism: |
by reference |
Address of a quadword to receive the previous value of the IEEE
floating-point control register.
Description
The Set IEEE Floating-Point Control Register service updates the IEEE
floating-point control register, maintained by the operating system,
with the values supplied by the calling program.
The following steps are used to update the register:
- If the prvmsk argument is specified,
$IEEE_SET_FP_CONTROL first reads the previous value of the IEEE
floating-point control register.
- If the clrmsk argument is specified,
$IEEE_SET_FP_CONTROL then clears the specified bit masks in the
clrmsk argument.
- If the setmsk argument is specified,
$IEEE_SET_FP_CONTROL then sets the specified bit masks in the
setmsk argument.
A program can swap the IEEE floating-point control register (that is,
save the old value and specify a new value) by specifying the following:
- The clrmsk argument with the address of a quadword
of all 1s
- The setmsk argument with the address of a quadword
that holds the new register value
- The prvmsk argument with the address of a quadword
to save the old register value
On I64 systems, the initial state value and the scope
of the modified state values differ depending on the location of the
call to this routine, as shown in the following table.
Location of Call |
State Value |
Scope of New State Value |
Mainline
|
Determined by the compiler switches used when compiling the modules.
|
Change is in effect until this service is called again, with the
exception of ASTs (see below).
|
Condition handler
|
The same as the state in effect when the condition occurs, unless the
setting was changed by a previous condition handler.
|
Change is in effect until all remaining condition handlers have been
called or this service is called again.
|
AST routine
|
Determined by the compiler switches used when compiling the modules,
regardless of the state value in effect when the AST was triggered.
|
Change is in effect only until the AST completes or this service is
called again.
|
On Alpha systems, calling this routine changes the
setting for ASTs as well as the mainline program.
Required Access or Privilege
None
Required Quota
None
Related Services
$IEEE_SET_PRECISION_MODE
$IEEE_SET_ROUNDING_MODE
Condition Values Returned
SS$_NORMAL
|
The service completed successfully.
|
SS$_ACCVIO
|
The specified argument cannot be read or cannot be written.
|
$IEEE_SET_PRECISION_MODE (I64 Only)
On I64 systems, modifies the IEEE precision mode and, optionally,
returns the previous value.
Format
SYS$IEEE_SET_PRECISION_MODE new_value , [*prev_value]
C Prototype
int sys$ieee_set_rounding_mode (int new_value, int *prev_value);
Arguments
new_value
OpenVMS usage: |
IEEE precision mode |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
The new value can be one of the following:
Symbol |
Value |
Meaning |
IEEE$C_PM_NO_CHANGE
|
-1
|
No change. Just get previous value
|
IEEE$C_PM_SINGLE
|
0
|
Single Precision
|
IEEE$C_PM_DOUBLE
|
2
|
Double Precision
|
IEEE$C_PM_DOUBLE_EXTENDED
|
3
|
Double-Extended Precision
|
prev_value
OpenVMS usage: |
IEEE precision mode |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by reference |
The previous value is a pointer to a return value that can be one of
the last three items from the table showing new values.
Description
The initial precision mode and the scope of the modified precision mode
differ depending on the location of the call to this routine, as shown
in the following table.
Location of Call |
Initial Precision Mode |
Scope of New Precision Mode |
Mainline
|
Determined by the compiler switches used when compiling the modules.
|
Change is in effect until this service is called again with the
exception of ASTs (see below).
|
Condition handler
|
The same as the precision mode in effect when the condition occurs,
unless the setting was changed by a previous condition handler.
|
Change is in effect until all remaining condition handlers have been
called or this service is called again.
|
AST routine
|
Determined by the compiler switches used when compiling the modules,
regardless of the precision in effect when the AST was triggered.
|
Change is in effect only until the AST completes or this service is
called again.
|
Required Access or Privileges
None
Required Quotas
None
Related Services
$IEEE_SET_FP_CONTROL
$IEEE_SET_ROUNDING_MODE
$IEEE_SET_ROUNDING_MODE (I64 Only)
On I64 systems, modifies the IEEE rounding mode and, optionally,
returns the previous value.
Format
SYS$IEEE_SET_ROUNDING_MODE new_value , [*prev_value]
C Prototype
int sys$ieee_set_rounding_mode (int new_value, int *prev_value);
Arguments
new_value
OpenVMS usage: |
IEEE rounding mode |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
The new value can be one of the following:
Symbol |
Value |
Meaning |
IEEE$C_RM_NO_CHANGE
|
-1
|
No change. Just get previous value
|
IEEE$C_RM_NEAREST
|
0
|
Nearest (or even)
|
IEEE$C_RM_DOWN
|
1
|
-Infinity (down)
|
IEEE$C_RM_UP
|
2
|
+Infinity (up)
|
IEEE$C_RM_TRUNCATE
|
3
|
Zero (truncate/chop)
|
prev_value
OpenVMS usage: |
IEEE rounding mode |
type: |
longword (unsigned) |
access: |
write only |
mechanism: |
by reference |
The previous value is a pointer to a return value that can be one of
the last four items from the table showing new values.
Description
The initial rounding mode and the scope of the modified rounding mode
differ depending on the location of the call to this routine, as shown
in the following table.
Location of Call |
Initial Rounding Mode |
Scope of New Rounding Mode |
Mainline
|
Determined by the compiler switches used when compiling the modules.
|
Change is in effect until this service is called again, with the
exception of ASTs (see below).
|
Condition handler
|
The same as the rounding mode in effect when the condition occurs,
unless the setting was changed by a previous condition handler.
|
Change is in effect until all remaining condition handlers have been
called or this service is called again.
|
AST routine
|
Determined by the compiler switches used when compiling the modules,
regardless of the rounding in effect when the AST was triggered.
|
Change is in effect only until the AST completes or this service is
called again.
|
Required Access or Privileges
None
Required Quota
None
Related Services
$IEEE_SET_FP_CONTROL
$IEEE_SET_PRECISION_MODE
$INIT_SYS_ALIGN_FAULT_REPORT (Alpha and I64)
On Alpha and I64 systems, initializes system process alignment fault
reporting.
This service accepts 64-bit addresses.
Format
SYS$INIT_SYS_ALIGN_FAULT_REPORT match_table ,buffer_size ,flags
C Prototype
int sys$init_sys_align_fault_report (void *match_table, int
buffer_size, unsigned int flags);
Arguments
match_table
OpenVMS usage: |
address |
type: |
longword (unsigned) |
access: |
read |
mechanism: |
by 32-bit or 64-bit reference |
Describes the system fault match table. The
match_table argument is the 32-bit or 64-bit virtual
address of an array of longwords describing the system fault match
table. The first longword is the number of match entries; the remaining
longwords are the match entries.
The match table is used to restrict the number of alignment faults
reported. Each entry in the table is a bit mask divided into three
groups: mode bits, program counter (PC) space bits, and virtual address
(VA) space bits.
The following table lists the symbols that can be used to define these
bits:
Bit Type |
Symbols |
|
Mode bits
|
AME$M_KERNEL_MODE
|
Kernel mode
|
|
AME$M_EXEC_MODE
|
Executive mode
|
|
AME$M_SUPER_MODE
|
Supervisor mode
|
|
AME$M_USER_MODE
|
User mode
|
Program counter bits
|
AME$M_USER_PC
|
PC in User space
|
|
AME$M_SYSTEM_PC
|
PC in System space
|
Virtual address bits
|
AME$M_SYSTEM_VA
|
VA in System space
|
|
AME$M_USER_VA_P0
|
VA in User P0 space
|
|
AME$M_USER_VA_P1
|
VA in User P1 space
|
|
AME$M_USER_VA_P2
|
VA in User P2 space
|
The following diagram illustrates the data structure of the match table:
When an alignment fault occurs, a fault bit mask is created with one
bit set in each group. The alignment fault handler then compares this
fault bit mask against each entry in the match table. If the fault bit
mask is a subset of an entry in the match table, the fault is reported.
buffer_size
OpenVMS usage: |
byte count |
type: |
longword (signed) |
access: |
read |
mechanism: |
by value |
The number of bytes to allocate, from nonpaged pool, to save the
alignment fault data. The buffer you allocate must be sufficient to
accommodate one data item of the size specified in the
flags argument.
flags
OpenVMS usage: |
mask_longword |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Flag bit mask specifying options for the $GET_SYS_ALIGN_FAULT_DATA
operation.
If the flags argument is 0, data items of size
AFR$K_VMS_LENGTH will be returned. If the flags
argument is AFR$M_USER_INFO, the user name and image name are added to
each data item and they are returned in a buffer of length
AFR$K_EXTENDED_LENGTH. If the user name and image name are not
available, an empty string is returned in the data item.
Description
The Initialize System Alignment Fault Reporting service initializes
system alignment fault reporting.
System alignment faults must be written to a buffer. The following
diagram illustrates the format in which system alignment fault data is
saved in the buffer:
Only one user on a system can initialize system alignment fault
reporting at any time. Subsequent calls will return SS$_AFR_ENABLED.
System alignment fault reporting is disabled when the program that
called the service completes.
Required Access or Privileges
CMKRNL privilege is required.
Required Quota
None
Related Services
$GET_ALIGN_FAULT_DATA, $GET_SYS_ALIGN_FAULT_DATA,
$PERM_DIS_ALIGN_FAULT_REPORT, $PERM_REPORT_ALIGN_FAULT,
$START_ALIGN_FAULT_REPORT, $STOP_ALIGN_FAULT_REPORT,
$STOP_SYS_ALIGN_FAULT_REPORT
Condition Values Returned
SS$_NORMAL
|
The service completed successfully.
|
SS$_ACCVIO
|
The match table is not read accessible.
|
SS$_AFR_ENABLED
|
The service was already called.
|
SS$_BADPARAM
|
The
buffer_size argument is less than the minimum size
required. If the
flags argument is 0, AFR$K_VMS_LENGTH + 32 is
required. If the
flags argument is 1, AFR$K_EXTENDED_LENGTH + 32 is
required.
|
SS$_NOPRIV
|
The caller does not have CMKRNL privilege.
|
$INIT_VOL
Formats a disk or magnetic tape volume and writes a label on the
volume. At the end of initialization, the disk is empty except for the
system files containing the structure information. All former contents
of the volume are lost.
Format
SYS$INIT_VOL devnam, volnam [,itmlst]
C Prototype
int sys$init_vol (void *devnam, void *volnam, void *itmlst);
Arguments
devnam
OpenVMS usage: |
char_string |
type: |
character string |
access: |
read only |
mechanism: |
by descriptor |
Name of the device on which the volume is physically mounted. The
descriptor must point to the device name, a character string of 1 to 64
characters. The device name can be a physical device name or a logical
name; if it is a logical name, it must translate to a physical name.
The device does not have to be currently allocated; however, allocating
the device before initializing it is recommended.
volnam
OpenVMS usage: |
char_string |
type: |
character string |
access: |
read only |
mechanism: |
by descriptor |
Identification to be encoded on the volume. The descriptor must point
to the volume name, a character string of 1 to 12 characters. For a
disk volume name, you can specify a maximum of 12 ANSI characters; for
a magnetic tape volume name, you can specify a maximum of 6 ANSI
"a" characters.
Any valid ANSI "a" characters can be used; these include
numbers, uppercase letters, and any one of the following
nonalphanumeric characters:
! " % ' ( ) * + , - . / : ; < = >
HP strongly recommends that a disk volume name consist of only
alphanumeric characters, dollar signs ($), underscores (_), and hyphens
(-).
itmlst
OpenVMS usage: |
item_list_3 |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by reference |
Item list specifying options that can be used when initializing the
volume. The itmlst argument is the address of a list
of item descriptors, each of which describes one option. The list of
item descriptors is terminated by a longword of 0.
The following diagram depicts the format of a single item descriptor:
The following table defines the item descriptor fields:
Descriptor Field |
Definition |
Buffer length
|
A word specifying the length (in bytes) of the buffer that supplies the
information $INIT_VOL needs to process the specific item code. The
length of the buffer needed depends on the item code specified in the
item descriptor.
|
Item code
|
A word containing an option for the initialize operation. These codes
are defined by the $INITDEF macro. There are three types of item codes:
|
|
Boolean item code
|
Boolean item codes specify a true or false value. The form INIT$_
code specifies a true value and the form INIT$_NO_
code specifies a false value. For Boolean item codes, the
buffer length and buffer address fields of the item descriptor must be
0.
|
Symbolic value item code
|
Symbolic value item codes specify one of a specified range of possible
choices. The buffer length and buffer address fields of the item
descriptor must be 0.
|
Input value item code
|
Input value item codes specify a value to be used by $INIT_VOL. The
buffer length and buffer address fields of the item descriptor must be
nonzero.
|
|
Buffer address
|
A longword containing the address of the buffer that supplies
information to $INIT_VOL.
|
Return length address
|
This field is not used.
|
Item Codes
INIT$_ACCESSED
An input item code that specifies the number of directories allowed in
system space on the volume.
You must specify an integer between 0 and 255 in the input buffer. The
default value is 3.
The INIT$_ACCESSED item code applies only to Files-11 On-Disk Structure
Level 1 disks.
INIT$_BADBLOCKS_LBN
An input item code that enables $INIT_VOL to mark bad blocks on the
volume; no data is written to those faulty areas. INIT$_BADBLOCKS_LBN
specifies faulty areas on the volume by logical block number and block
count.
The buffer from which $INIT_VOL reads the option information contains
an array of quadwords containing information in the following format:
The following table describes the information to be specified for
INIT$_BADBLOCKS_LBN:
Field |
Symbol Name |
Description |
Logical block number
|
INIT$L_BADBLOCKS_LBN
|
Specifies the logical block number of the first block to be marked as
allocated.
|
Count
|
INIT$L_BADBLOCKS_COUNT
|
Specifies the number of blocks to be allocated. This range begins with
the first block, as specified in INIT$L_BADBLOCKS_LBN.
|
|