HP OpenVMS System Services Reference Manual


Previous Contents Index


$CRMPSC_GFILE_64 (Alpha and Integrity servers)

On Alpha and Integrity server systems, allows a process to create a global disk file section and to map a section of its address space to the global section.

This service accepts 64-bit addresses.


Format

SYS$CRMPSC_GFILE_64 gs_name_64 ,ident_64 ,file_offset_64 ,length_64 ,chan ,region_id_64 ,section_offset_64 ,acmode ,flags ,return_va_64 ,return_length_64 [,fault_cluster
[,start_va_64 [,map_length_64]]]


C Prototype

int sys$crmpsc_gfile_64 (void *gs_nam_64, struct _secid *ident_64, unsigned __int64 file_offset_64, unsigned __int64 length_64, unsigned short int chan, struct _generic_64 *region_id_64, unsigned __int64 section_offset_64, unsigned int acmode, unsigned int flags, void *(*(return_va_64)), unsigned __int64 *return_length_64,...);


Arguments

gs_name_64


OpenVMS usage: section_name
type: character-coded text string
access: read only
mechanism: by 32- or 64-bit descriptor--fixed-length string descriptor

Name of the global section. The gs_name_64 argument is the 32- or 64-bit virtual address of a naturally aligned 32- or 64-bit string descriptor pointing to this name string.

ident_64


OpenVMS usage: section_id
type: quadword (unsigned)
access: read only
mechanism: by 32- or 64-bit reference

Identification value specifying the version number of a global section. The ident_64 argument is a quadword containing three fields. The ident_64 argument is the 32- or 64-bit virtual address of a naturally aligned quadword that contains the identification value.

The first longword specifies the matching criteria in its low-order 2 bits. The valid values, symbolic names by which they can be specified, and their meanings are as follows:
Value Symbolic Name Match Criteria
0 SEC$K_MATALL Match all versions of the section.
1 SEC$K_MATEQU Match only if major and minor identifications match.
2 SEC$K_MATLEQ Match if the major identifications are equal and the minor identification of the mapper is less than or equal to the minor identification of the global section.

When a section is mapped at creation time, the match control field is ignored. If you specify the ident_64 argument as 0, the version number and match control fields default to 0.

The version number is in the second longword. The version number contains two fields: a minor identification in the low-order 24 bits and a major identification in the high-order 8 bits. You can assign values for these fields by installation convention to differentiate versions of global sections. If no version number is specified when a section is created, processes that specify a version number when mapping cannot access the global section.

file_offset_64


OpenVMS usage: byte offset
type: quadword (unsigned)
access: read only
mechanism: by value

Byte offset into the file that marks the beginning of the section. The file_offset_64 argument is a quadword containing this number. If you specify the file_offset_64 argument as 0, the section is created beginning with the first byte in the file.

The file offset specified must be a multiple of virtual disk blocks.

length_64


OpenVMS usage: byte count
type: quadword (unsigned)
access: read only
mechanism: by value

Length, in bytes, of the global disk file section to be created. The length specified must be 0 or a multiple of virtual disk blocks. If the length specified is 0 or extends beyond the end-of-file (EOF), the global disk file section is created up to and including the virtual block number that contains EOF.

chan


OpenVMS usage: longword
type: longword (unsigned)
access: read only
mechanism: by value

Number of the channel on which the file has been accessed. The chan argument is a longword containing this number. The access mode at which the channel was opened must be equal to or less privileged than the access mode of the caller.

You can use the OpenVMS Record Management Services (RMS) macro $OPEN to access a file; the file options parameter in the file access block must indicate a user file open (UFO) keyword.

region_id_64


OpenVMS usage: region identifier
type: quadword (unsigned)
access: read only
mechanism: by 64 bit reference

The region ID associated with the region in which to map the global disk file section. The file VADEF.H in SYS$STARLET_C.TLB and the $VADEF macro in STARLET.MLB define a symbolic name for each of the three default regions in P0, P1, and P2 space.

The following region IDs are defined:
Symbol Region
VA$C_P0 Program region
VA$C_P1 Control region
VA$C_P2 64-bit program region

Other region IDs, as returned by the $CREATE_REGION_64 service, can be specified.

section_offset_64


OpenVMS usage: byte offset
type: quadword (unsigned)
access: read only
mechanism: by value

Offset into the global section to start mapping into the process's virtual address space. The offset specified must be a multiple of virtual disk blocks.

acmode


OpenVMS usage: access_mode
type: longword (unsigned)
access: read only
mechanism: by value

Access mode that is to be the owner of the pages created during the mapping. The acmode argument is a longword containing the access mode.

The $PSLDEF macro in STARLET.MLB and the file PSLDEF.H in SYS$STARLET_C.TLB define the following symbols and their values for the four access modes:
Value Symbolic Name Access Mode
0 PSL$C_KERNEL Kernel
1 PSL$C_EXEC Executive
2 PSL$C_SUPER Supervisor
3 PSL$C_USER User

The most privileged access mode used is the access mode of the caller.

Address space cannot be created within a region that has a create mode associated with it that is more privileged than the caller's mode. The condition value SS$_IVACMODE is returned if the caller is less privileged than the create mode for the region.

flags


OpenVMS usage: mask_longword
type: longword (unsigned)
access: read only
mechanism: by value

Flag mask specifying the characteristics of the global section to be created. The flags argument is a longword bit vector in which each bit corresponds to a flag. The $SECDEF macro and the SECDEF.H file define a symbolic name for each flag. You construct the flags argument by performing a logical OR operation on the symbol names for all desired flags.

The following table describes each flag that is valid for the $CRMPSC_GFILE_64 service:
Flag Description
SEC$M_CRF Pages are copy-on-reference.
SEC$M_GBL Pages form a global section. By default, this flag is always present in this service and cannot be disabled.
SEC$M_WRT Pages form a read/write section. By default, pages form a read-only section.
SEC$M_DZRO Pages are demand-zero pages. By default, they are not zeroed when copied.

Note that SEC$M_DZRO and SEC$M_CRF cannot both be set and that SEC$M_DZRO set and SEC$M_WRT clear is an invalid combination.

SEC$M_EXPREG Pages are mapped into the first available space at the current end of the specified region.
SEC$M_NO_OVERMAP Pages cannot overmap existing address space. By default, pages can overmap existing address space.
SEC$M_PERM Global section is permanent. By default, global sections are temporary.
SEC$M_SYSGBL Pages form a system global section. By default, pages form a group global section.

All other bits in the flags argument are reserved for future use by HP and should be specified as 0. The condition value SS$_IVSECFLG is returned if any undefined bits are set or if an illegal combination of flags is set.

return_va_64


OpenVMS usage: address
type: quadword address
access: write only
mechanism: by 32- or 64-bit reference

The lowest process virtual address into which the global disk file section was mapped. The return_va_64 argument is the 32- or 64-bit virtual address of a naturally aligned quadword into which the service returns the virtual address.

Upon successful completion of this service, if the section_offset_64 argument was specified, the virtual address returned in return_va_64 reflects the offset into the global section mapped such that the virtual address returned cannot be aligned on a CPU-specific page boundary. The virtual address returned will always be on an even virtual disk block boundary.

return_length_64


OpenVMS usage: byte count
type: quadword (unsigned)
access: write only
mechanism: by 32- or 64-bit reference

The 32- or 64-bit virtual address of a naturally aligned quadword into which the service returns the length of the virtual address range mapped in bytes.

Upon successful completion of this service, the value in the return_length_64 argument indicates the amount of created address space backed by the section file.

If the number of disk blocks mapped does not represent an exact multiple of CPU-specific pages, the last page in the mapped address space will not be completely mapped by the section file. In this case, modifying memory beyond the amount indicated by return_length_64 can result in the loss of this data.

Unlike the return_length_64 argument for the $CREATE_GFILE service, upon successful completion of this service, the return_length_64 argument does not represent the total length of the global section created if the section_offset_64 argument was specified as nonzero. The value in the section_offset_64 argument plus the value in the return_length_64 argument is the total length of the global disk file section created.

fault_cluster


OpenVMS usage: byte count
type: longword (unsigned)
access: read only
mechanism: by value

Page fault cluster in byte units indicating how many pages are to be brought into memory when a page fault occurs for a single page. The fault cluster specified will be rounded up to a multiple of CPU-specific pages.

If this argument is specified as 0, the system default page fault cluster will be used. If this argument is specified as more than the maximum allowed for the system, no error will be returned. The systemwide maximum will be used.

start_va_64


OpenVMS usage: address
type: quadword address
access: read only
mechanism: by value

The starting virtual address to map the global disk file section. The specified virtual address must be a CPU-specific page aligned address. If the flag SEC$M_EXPREG is specified, this argument will not be used. If SEC$M_EXPREG is clear and the start_va_64 argument is not specified or is specified as 0, the condition value SS$_IVSECFLG will be returned.

Always refer to the return_va_64 and return_length_64 arguments to determine the usable range of virtual addresses mapped.

map_length_64


OpenVMS usage: byte count
type: quadword unsigned
access: read only
mechanism: by value

Length of the global disk file section to be mapped. The length specified must be a multiple of virtual disk blocks. If this argument is not specified as zero, the global disk section is mapped up to and including the last disk block in the section.

Description

The Create and Map Global Disk File Section service allows a process to create and map to a global disk file section.

Creating a global disk file section involves defining all or part of a disk file as a section. The section is mapped from a low address to a high address whether the section is mapped in a region that grows from low to high addresses or from high to low addresses. If the $CRMPSC_GFILE_64 service specifies a global disk file section that already exists, the service maps it.

If the condition value SS$_ACCVIO is returned by this service, a value cannot be returned in the memory locations pointed to by the return_va_64 and return_length_64 arguments.

If a condition value other than SS$_ACCVIO is returned, the returned address and returned length indicate the pages that were successfully mapped before the error occurred. If no pages were mapped, the return_va_64 argument will contain the value --1, and a value cannot be returned in the memory location pointed to by the return_length_64 argument.

The flag SEC$M_WRT applies only to the way in which the newly created section is mapped. For a file to be made writable, the channel used to open the file must allow write access to the file.

Required Privileges

To create a global section, the process must have the following privileges:

Required Quota

If the section pages are copy-on-reference, the process must have sufficient paging file quota (PGFLQUOTA).

The working set quota (WSQUOTA) of the process must be sufficient to accommodate the increased length of the process page table required by the increase in virtual address space.

Related Services

$CREATE_REGION_64, $CRMPSC, $CRMPSC_FILE_64, $CRMPSC_GPFILE_64, $CRMPSC_GPFN_64, $CRMPSC_PFN_64, $DELETE_REGION_64, $DELTVA_64, $DGBLSC, $LCKPAG_64, $LKWSET_64, $MGBLSC_64, $PURGE_WS, $SETPRT_64, $ULKPAG_64, $ULWSET_64, $UPDSEC_64, $UPDSEC_64W


Condition Values Returned

SS$_NORMAL The service completed successfully. The specified global section already exists and has been mapped.
SS$_CREATED The service completed successfully. The specified global section did not previously exist and has been created.
SS$_ACCVIO The gs_name_64 argument cannot be read by the caller, or the return_va_64 or return_length_64 argument cannot be written by the caller.
SS$_CHANVIO The specified channel was assigned from a more privileged access mode.
SS$_ENDOFFILE The file_offset_64 argument specified is beyond the logical end-of-file.
SS$_EXBYTLM The process has exceeded the byte count quota; the system was unable to map the requested file.
SS$_EXPGFLQUOTA The process exceeded its paging file quota, creating copy-on-reference pages.
SS$_GBLSEC_MISMATCH Global section type mismatch. The specified global section was found; however, it was not a global disk file section.
SS$_GPTFULL There is no more room in the system global page table to set up page table entries for the section.
SS$_GSDFULL There is no more room in the system space allocated to maintain control information for global sections.
SS$_INSFWSL The process's working set limit is not large enough to accommodate the increased virtual address space.
SS$_IVACMODE The caller's mode is less privileged than the create mode associated with the region.
SS$_IVCHAN An invalid channel number was specified; the channel number specified was 0 or a channel that is unassigned.
SS$_IVCHNLSEC The channel number specified is currently active or there are no files opened on the specified channel.
SS$_IVIDENT An invalid channel number was specified; the channel number specified is larger than the number of channels available.
SS$_IVLOGNAM The specified global section name has a length of 0 or has more than 43 characters.
SS$_IVREGID Invalid region ID specified.
SS$_IVSECFLG An invalid flag, a reserved flag, or an invalid combination of flags and arguments was specified.
SS$_IVSECIDCTL The match control field of the global section identification is invalid.
SS$_LEN_NOTBLKMULT The length_64 or the map_length_64 argument is not a multiple of virtual disk blocks.
SS$_NOPRMGBL The process does not have the privileges to create or delete a permanent group global section (PRMGBL).
SS$_NOSHPTS The region ID of a shared page table region was specified.
SS$_NOSYSGBL The process does not have the privileges to create or delete a system global section (SYSGBL).
SS$_NOTFILEDEV The device is not a file-oriented, random-access, or directory device.
SS$_NOWRT The file is read-only, and the flag bit SEC$M_CRF is not set.
SS$_OFF_NOTBLKALGN The file_offset_64 or section_offset_64 argument is not virtual disk block aligned.
SS$_OFFSET_TOO_BIG The section_offset_64 argument specified is beyond the logical end-of-file.
SS$_PAGNOTINREG A page in the specified range is not within the specified region.
SS$_PAGOWNVIO A page in the specified input address range is owned by a more privileged access mode.
SS$_REGISFULL The specified virtual region is full; no space is available in the region for the pages created to contain the mapped section.
SS$_SECREFOVF The maximum number of references for a global section has been reached (2,147,483,647).
SS$_SECTBLFUL There are no entries available in the system global section table.
SS$_TOOMANYLNAM The logical name translation of the gs_name_64 argument exceeded the allowed depth of 10.
SS$_VA_IN_USE A page in the specified input address range is already mapped and the flag SEC$M_NO_OVERMAP is set, or the existing underlying page cannot be deleted because it is associated with a buffer object.
SS$_VA_NOTPAGALGN The start_va_64 argument is not CPU-specific page aligned.


Previous Next Contents Index