If the memory-resident global section is created with shared page
tables, this is the access mode that is stored in the owner, read, and
write fields of the corresponding shared page table entries (PTEs).
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:
The following table describes the flags that are valid for the
$CREATE_GDZRO service:
On a system that does not support resource affinity domains (RADs),
specifying 1 for the rad_mask argument is allowed.
Note: OpenVMS support for RADs is available only on the new AlphaServer GS series systems. For more information about using RADs, refer to the OpenVMS Alpha Partitioning and Galaxy Guide.
The Create Permanent Global Demand-Zero Section service allows a
process to create a permanent, memory-resident, global demand-zero
section. If you set the SEC$M_SHMGS flag, the section is created as a
Galaxy-wide global demand-zero section in shared memory.
You must call either the $CREATE_GDZRO service or the $CRMPSC_GDZRO_64
service on each instance where the Galaxy shared memory will be
accessed.
Memory-resident or Galaxy-wide global sections contain demand-zero
allocation pages that are writable and memory resident. All pages in
these types of global section are shared by all processes that map to
the global section.
The pages are always resident in memory and are not backed up by any
file on any disk. The pages are not placed into the process's working
set list when the process maps to the global section and the virtual
memory is referenced by the process. The pages are also not charged
against the process's working set quota or against any page-file quota.
To create a memory-resident section, the process must have the rights
identifier, VMS$MEM_RESIDENT_USER. The error status, SS$_NOMEMRESID, is
returned if the caller has not been granted this identifier. To create
a Galaxy-wide shared section, the process must have the SHMEM privilege.
Only memory-resident sections can be registered with the Reserved
Memory Registry in the SYSMAN facility. Memory for Galaxy-wide shared
sections is reserved through appropriate settings of the console
environment parameters.
If the section is not registered in the Reserved Memory Registry, or if
the /NOALLOCATE qualifier was specified when the global section was
registered in the Reserved Memory Registry, invalid global PTEs are
written to the global page table. When the global section is mapped,
invalid page table entries are placed in the process page table.
Physical memory is not allocated until the pages are referenced.
If the global section is registered in the Reserved Memory Registry,
the size of the global section need not match the reserved size. If the
global section is not registered in the Reserved Memory Registry, or if
the reserved size is smaller than the size of the global section, the
error status SS$_INSFLPGS is returned if there are not enough fluid
pages in the system to satisfy the request.
If the /ALLOCATE qualifier was specified when the global section was
registered in the Reserved Memory Registry, contiguous, aligned,
physical pages are preallocated during system initialization for this
global section. Valid page table entries are placed in the global page
table and when the global section is mapped, valid page table entries
are placed in the process page table. With the proper virtual
alignment, granularity hints (GH) are used to map to the global pages.
If the global section is not registered in the Reserved Memory
Registry, or if the /PAGE_TABLES qualifier was specified when the
global section was registered, shared page tables are created for the
memory-resident global section.
If the /ALLOCATE and /PAGE_TABLE qualifiers were specified when the
global section was registered in the Reserved Memory Registry,
contiguous, aligned physical pages are preallocated during system
initialization for this global section, and granularity hints are used
to map to the shared page table sections.
The following table lists the factors affecting the creation of shared
page tables for memory-resident global sections. The /ALLOCATE and the
/PAGE_TABLES qualifiers pertain to the Reserved Memory Registry command
RESERVED_MEMORY ADD entered for the memory-resident global section
being created. For more information about using the SYSMAN utility to
create entries to the Reserved Memory Registry, refer to the
OpenVMS System Management Utilities Reference Manual.
/ALLOCATE |
/PAGE_TABLES |
Outcome |
Not registered
|
Not registered
|
Shared page tables created.
Shared page tables cannot use GH.
Returns SS$_CREATED_SHPT.
|
No
|
No
|
No shared page tables created.
Returns SS$_CREATED.
|
No
|
Yes
|
Shared page tables created.
Shared page tables cannot use GH.
Returns SS$CREATED_SHPT.
|
Yes
|
No
|
No shared page tables created.
Returns SS$_CREATED.
|
Yes
|
Yes
|
Shared page tables created.
Shared page tables can use GH.
Returns SS$_CREATED_SHPT.
|
Shared page tables are always created for Galaxy-wide shared sections
of at least 128 pages.
Shared page tables consume the same internal OpenVMS data structures as
global sections. The system parameters GBLPAGES and GBLSECTIONS must
account for the additional global pages and the additional global
section.
Note that only one set of shared page tables can be associated with any
memory-resident or Galaxy-wide section. By default, shared page tables
will allow write access. To create shared page tables that allow only
read access, you must set the READ_ONLY_SHPT flag. A process that
requires write access to a section where the shared page tables only
allow read access must use private page tables to map the section.
To use the shared page tables associated with a memory-resident global
section, a process must first create a shared page table region (with
$CREATE_REGION_64). Additionally, a subsequent request to map to the
memory-resident global section must do the following:
- Specify a shared page table region to the mapping request (see
Table SYS-7 for additional information).
- Specify the same access mode as specified by the
acmode argument to this service.
- Set the flag SEC$M_WRT in the mapping request only if shared page
tables allow write access.
- Set the flag SEC$M_EXPREG in the mapping request or provide a
CPU-specific page table page aligned virtual address. (See the
description of the CREATE_REGION_64 service for information about
calculating virtual addresses that are aligned to a CPU-specific page
table page boundary.)
If a shared page table region is not specified, process-private page
tables are used to map to the global section.
If the service returns an error status value that is neither
SS$_INSFLPGS nor SS$_MRES_PFNSMALL, a value is not returned in the
reserved_length_64 argument.
If the service returns a successful condition value or if SS$_INSFLPGS
or SS$_MRES_PFNSMALL is returned and the
reserved_length_64 argument is specified as a nonzero
address, the length in bytes of the global section as registered in the
Reserved Memory Registry is returned in the
reserved_length_64 argument.
To map a Galaxy shared section or a memory resident section, see the
$CRMPSC_GDZRO_64 service.
Refer to the OpenVMS Alpha Partitioning and Galaxy Guide for additional information.
Required Privileges
To create a permanent memory-resident global DZRO section, the process
must have the following privileges or rights identifiers:
- SYSGBL privilege to create a system global section (if flag
SEC$M_SYSGBL is set)
- PRMGBL privilege to create a permanent global section
- VMS$MEM_RESIDENT_USER rights identifier to create a memory-resident
section
- SHMEM privilege on OpenVMS Galaxy systems to create an object in
Galaxy shared memory.
Required Quota
None
Related Services
$CRMPSC_GDZRO_64, $DGBLSC, $MGBLSC_64
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 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 two
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.
|
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 and 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 do not specify the file_offset_64
argument or specify it as 0, the section is created beginning with the
first byte in the file.
The file_offset_64 argument 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 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).
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
|
flags
OpenVMS usage: |
mask_longword |
type: |
longword (unsigned) |
access: |
read only |
mechanism: |
by value |
Flag mask specifying the type of global section to be created as well
as its characteristics. 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
$CREATE_GFILE service:
Flag |
Description |
SEC$M_CRF
|
Pages are copy-on-reference. By default, pages are shared.
|
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_GBL
|
Pages form a global section. By default, this flag is always present in
this service and cannot be disabled.
|
SEC$M_PERM
|
Global section is permanent. By default, this flag is always present in
this service and cannot be disabled.
|
SEC$M_SYSGBL
|
Pages form a system global section. By default, pages form a group
global section.
|
SEC$M_WRT
|
Pages form a read/write section. By default, pages form a read-only
section.
|
All other bits in the flags argument are reserved for
future use by Compaq 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_length_64
OpenVMS usage: |
byte count |
type: |
quadword (unsigned) |
access: |
write only |
mechanism: |
by 32- or 64-bit reference |
The length of the global section created. The
return_length_64 argument is the 32- or 64-bit virtual
address of a naturally aligned quadword into which the service returns
the length of the global section in bytes.
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 is rounded up to a multiple of CPU-specific
pages.
If this argument is specified as 0, the system default page fault
cluster is used. If this argument is specified as more than the maximum
allowed for the system, no error is returned. The systemwide maximum is
used.