The most privileged access mode used is the access mode of the caller. For the $LCKPAG_64 service to complete successfully, the resultant access mode must be equal to or more privileged than the access mode already associated with the pages to be locked.
OpenVMS usage: | address |
type: | quadword address |
access: | write only |
mechanism: | by 32- or 64-bit reference |
OpenVMS usage: | byte count |
type: | quadword (unsigned) |
access: | write only |
mechanism: | by 32- or 64-bit reference |
The Lock Pages in Memory service locks a range of pages in memory. The specified virtual pages are forced into the working set and then locked in memory. A locked page is not swapped out of memory if the working set of the process is swapped out. These pages are not candidates for page replacement and, in this sense, are locked in the working set as well.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 locked before the error occurred. If no pages were locked, 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.
Required Privileges
A process must have PSWAPM privilege to call the $LCKPAG_64 service.
Required Quota
Related Services
$LCKPAG, $ULKPAG, $ULKPAG_64
SS$_WASCLR The service completed successfully. All of the specified pages were previously unlocked. SS$_WASSET The service completed successfully. At least one of the specified pages was previously locked in the working set. SS$_ACCVIO The return_va_64 argument or the return_length_64 argument cannot be written by the caller, or an attempt was made to lock pages by a caller whose access mode is less privileged than the access mode associated with the pages. SS$_LCKPAGFUL The system-defined maximum limit on the number of pages that can be locked in memory has been reached. SS$_LKWSETFUL The locked working set is full. If any more pages are locked, not enough dynamic pages will be available to continue execution. SS$_NOPSWAPM The process does not have the privilege to lock pages in memory. SS$_PAGOWNVIO The pages could not be locked because the access mode associated with the call to $LCKPAG_64 was less privileged than the access mode associated with the pages that were to be locked.
Locks a range of pages in the working set; if the pages are not already in the working set, it brings them in and locks them. A page locked in the working set does not become a candidate for replacement.
SYS$LKWSET inadr ,[retadr] ,[acmode]
int sys$lkwset ( struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode);
inadr
OpenVMS usage: address_range type: longword (unsigned) access: read only mechanism: by reference
Starting and ending virtual addresses of the range of pages to be locked in the working set. The inadr argument is the address of a 2-longword array containing, in order, the starting and ending process virtual addresses. Only the virtual page number portion of each virtual address is used; the low-order byte-within-page bits are ignored.On VAX systems, if the starting and ending virtual addresses are the same, a single page is locked.
retadr
OpenVMS usage: address_range type: longword (unsigned) access: write only mechanism: by reference
Starting and ending process virtual addresses of the range of pages actually locked by $LCKWSET. The retadr argument is the address of a 2-longword array containing, in order, the starting and ending process virtual addresses.acmode
OpenVMS usage: access_mode type: longword (unsigned) access: read only mechanism: by value
Access mode to be associated with the pages to be locked. The acmode argument is a longword containing the access mode. The $PSLDEF macro defines the four access modes.The most privileged access mode used is the access mode of the caller. For the $LKWSET service to complete successfully, the resultant access mode must be equal to or more privileged than the access mode already associated with the pages to be locked.
The Lock Pages in Working Set service locks a range of pages in the working set; if the pages are not already in the working set, it brings them in and locks them. A page locked in the working set does not become a candidate for replacement.If more than one page is being locked and you need to determine specifically which pages were previously locked, the pages should be locked one at a time.
If an error occurs while the $LKWSET service is locking pages, the return array, if requested, indicates the pages that were successfully locked before the error occurred. If no pages are locked, both longwords in the return address array contain the value --1.
Global pages with write access cannot be locked into the working set.
On Alpha systems, if you are attempting to lock executable code, you should issue multiple $LKWSET calls: one to lock the code pages and others to lock the linkage section references into these pages.
Required Access or Privileges
Required Quota
Related Services
You can unlock pages locked in the working set with the Unlock Page from Working Set ($ULWSET) service.
For more information, see the chapter on memory management in the OpenVMS Programming Concepts Manual.
SS$_WASCLR The service completed successfully. All of the specified pages were previously unlocked. SS$_WASSET The service completed successfully. At least one of the specified pages was previously locked in the working set. SS$_ACCVIO The input address array cannot be read; the output address array cannot be written; a page in the specified range is inaccessible or nonexistent; or an attempt was made to lock pages by a caller whose access mode is less privileged than the access mode associated with the pages. SS$_LKWSETFUL The locked working set is full. If any more pages are locked, not enough dynamic pages will be available to continue execution. SS$_NOPRIV A page in the specified range is in the system address space, or a global page with write access was specified. SS$_PAGOWNVIO The pages could not be locked because the access mode associated with the call to $LKWSET was less privileged than the access mode associated with the pages that were to be locked.
On Alpha systems, locks a range of virtual addresses in the working set; if the pages are not already in the working set, the service brings them in and locks them. A page locked in the working set does not become a candidate for replacement.This service accepts 64-bit addresses.
SYS$LKWSET_64 start_va_64 ,length_64 ,acmode ,return_va_64 ,return_length_64
int sys$lkwset_64 (void *start_va_64, unsigned __int64 length_64, unsigned int acmode, void *(*(return_va_64)), unsigned __int64 *return_length_64);
start_va_64
OpenVMS usage: address type: quadword address access: read only mechanism: by value
The starting virtual address of the pages to be locked in the working set. The specified virtual address will be rounded down to a CPU-specific page boundary.length_64
OpenVMS usage: byte count type: quadword (unsigned) access: read only mechanism: by value
Length of the virtual address space to be locked in the working set. The specified length will be rounded up to a CPU-specific page boundary so that it includes all CPU-specific pages in the requested range.acmode
OpenVMS usage: access_mode type: longword (unsigned) access: read only mechanism: by value
Access mode associated with the pages to be locked. 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. For the $LKWSET_64 service to complete successfully, the resultant access mode must be equal to or more privileged than the access mode already associated with the pages to be locked.
return_va_64
OpenVMS usage: address type: quadword address access: write only mechanism: by 32- or 64-bit reference
The lowest process virtual address of the pages locked in the working set. 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.return_length_64
OpenVMS usage: byte count type: quadword (unsigned) access: write only mechanism: by 32- or 64-bit reference
The length of the virtual address range locked in the working set. 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 virtual address range in bytes.
The Lock Pages in Working Set service locks a range of pages in the working set; if the pages are not already in the working set, it brings them in and locks them. A page locked in the working set does not become a candidate for replacement.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 locked before the error occurred. If no pages were locked, 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.
Global pages with write access cannot be locked into the working set.
Required Privileges
Required Quota
Related Services
$LKWSET, $ULWSET, $ULWSET_64
SS$_WASCLR The service completed successfully. All of the specified pages were previously unlocked. SS$_WASSET The service completed successfully. At least one of the specified pages was previously locked in the working set. SS$_ACCVIO The return_va_64 or return_length_64 argument cannot be written by the caller, or an attempt was made to lock pages by a caller whose access mode is less privileged than the access mode associated with the pages. SS$_LKWSETFUL The locked working set is full. If any more pages are locked, not enough dynamic pages will be available to continue execution. SS$_NOPRIV No privilege; global pages with write access cannot be locked into the working set. SS$_PAGNOTINREG A page in the specified range is not within the specified region. SS$_PAGOWNVIO The pages could not be locked because the access mode associated with the call to $LKWSET_64 was less privileged than the access mode associated with the pages that were to be locked.
Establishes a correspondence between pages (maps) in the virtual address space of the process and physical pages occupied by a global section.
SYS$MGBLSC inadr ,[retadr] ,[acmode] ,[flags] ,gsdnam ,[ident] ,[relpag]
int sys$mgblsc (struct _va_range *inadr, struct _va_range *retadr, unsigned int acmode, unsigned int flags, void *gsdnam, struct _secid *ident, unsigned int relpag);
inadr
OpenVMS usage: address_range type: longword (unsigned) access: read only mechanism: by reference
Starting and ending virtual addresses into which the section is to be mapped. The inadr argument is the address of a 2-longword array containing, in order, the starting and ending process virtual addresses. Only the virtual page number portion of each virtual address is used to specify which pages are to be mapped; the low-order byte-within-page bits are ignored for this purpose.retadr
OpenVMS usage: address_range type: longword (unsigned) access: write only mechanism: by reference
Starting and ending process virtual addresses into which the section was actually mapped by $MGBLSC. The retadr argument is the address of a 2-longword array containing, in order, the starting and ending process virtual addresses.On Alpha systems, the retadr argument returns the starting and ending addresses of the usable range of addresses. This might differ from the total amount mapped. The retadr argument is required when the relpag argument is specified. If the section being mapped does not completely fill the last page used to map the section, the retadr argument indicates the highest address that actually maps the section. If the relpag argument is used to specify an offset into the section, the retadr argument reflects the offset.
acmode
OpenVMS usage: access_mode type: longword (unsigned) access: read only mechanism: by value
Access mode to be associated with the pages mapped into the process virtual address space. The acmode argument is a longword containing the access mode. The $PSLDEF macro defines symbols for the four access modes.The most privileged access mode used is the access mode of the caller.
flags
OpenVMS usage: mask_longword type: longword (unsigned) access: read only mechanism: by value
Flag mask specifying options for the operation. The flags argument is a longword bit vector wherein a bit when set specifies the corresponding option.The $SECDEF macro defines symbolic names for the flag bits. You construct the flags argument by specifying the symbolic names of each desired option in a logical OR operation. The following table describes each flag option.
Flag Option Description SEC$M_WRT Map the section with read/write access. By default, the section is mapped with read-only access. If SEC$M_WRT is specified and the section is not copy-on-reference, write access is required. SEC$M_SYSGBL Map a system global section. By default, the section is a group global section. SEC$M_EXPREG Map the section into the first available virtual address range. By default, the section is mapped into the range specified by the inadr argument. See the inadr argument description for a complete explanation of how to set the SEC$M_EXPREG flag.
gsdnam
OpenVMS usage: section_name type: character-coded text string access: read only mechanism: by descriptor--fixed-length string descriptor
Name of the global section. The gsdnam argument is the address of a character string descriptor pointing to this name string.For group global sections, the operating system interprets the group UIC as part of the global section name; thus, the names of global sections are unique to UIC groups. Further, all global section names are implicitly qualified by their identification fields.
ident
OpenVMS usage: section_id type: quadword (unsigned) access: read only mechanism: by reference
Identification value specifying the version number of a global section, and, for processes mapping to an existing global section, the criteria for matching the identification. The ident argument is the address of a quadword structure containing three fields.The first longword specifies, in the low-order two bits, the matching criteria. Their valid values, the symbolic names by which they can be specified, and their meanings are as follows.
Value/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. 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.
If you do not specify ident or specify it as the value 0 (the default), the version number and match control fields default to the value 0.
relpag
OpenVMS usage: longword_unsigned type: longword (unsigned) access: read only mechanism: by value
Relative page number within the section of the first page to be mapped. The relpag argument is a longword containing this number.On Alpha systems, the relpag argument is interpreted as an index into the section file, measured in pagelets for a file-backed section or CPU-specific pages for a PFN-mapped section.
On Alpha and VAX systems, if you do not specify relpag or specify it as the value 0 (the default), the global section is mapped beginning with the first virtual block in a file-backed section or the first CPU-specific page in a PFN-mapped section.
The Map Global Section service establishes a correspondence between pages (maps) in the virtual address space of the process and physical pages occupied by a global section. The protection mask specified at the time the global section is created determines the type of access (for example, read/write or read only) that a particular process has to the section.When $MGBLSC maps a global section, it adds pages to the virtual address space of the process. The section is mapped from a low address to a high address, whether the section is mapped in the program or control region.
If an error occurs during the mapping of a global section, the return address array, if specified, indicates the pages that were successfully mapped when the error occurred. If no pages were mapped, both longwords of the return address array contain the value --1.
Required Access or Privileges
Read access is required. If the SEC$M_WRT flag is specified, write access is required.
Required Quota
The working set quota (WSQUOTA) of the process must be sufficient to accommodate the increased size of the virtual address space when the $MGBLSC service maps a section.
If the section pages are copy-on-reference, the process must also have sufficient paging file quota (PGFLQUOTA).
This system service causes the working set of the calling process to be adjusted to the size specified by the working set quota (WSQUOTA). If the working set size of the process is less than quota, the working set size is increased; if the working set size of the process is greater than quota, the working set size is decreased.
Related Services
$ADJSTK, $ADJWSL, $CRETVA, $CRMPSC, $DELTVA, $DGBLSC, $EXPREG, $LCKPAG, $LKWSET, $PURGWS, $SETPRT, $SETSTK, $SETSWM, $ULKPAG, $ULWSET, $UPDSEC, $UPDSECW
For more information, see the chapter on memory management in the OpenVMS Programming Concepts Manual.
SS$_NORMAL The service completed successfully. SS$_ACCVIO The input address array, the global section name or name descriptor, or the section identification field cannot be read by the caller; or the return address array cannot be written by the caller. SS$_ENDOFFILE The starting virtual block number specified is beyond the logical end-of-file. SS$_EXQUOTA The process exceeded its paging file quota, creating copy-on-reference pages. SS$_INSFWSL The working set limit of the process is not large enough to accommodate the increased virtual address space. SS$_IVLOGNAM The global section name has a length of 0 or has more than 43 characters. SS$_IVSECFLG You set a reserved flag. SS$_IVSECIDCTL The match control field of the global section identification is invalid. SS$_NOPRIV The file protection mask specified when the global section was created prohibits the type of access requested by the caller; or a page in the input address range is in the system address space. SS$_NOSHPTS The region ID of a shared page-table region was specified. SS$_NOSUCHSEC The specified global section does not exist. SS$_PAGOWNVIO A page in the specified input address range is owned by a more privileged access mode. SS$_TOOMANYLNAM Logical name translation of the gsdnam string exceeded the allowed depth. SS$_VASFULL The virtual address space of the process is full; no space is available in the page tables for the pages created to contain the mapped global section.
On Alpha systems, establishes a correspondence between pages in the virtual address space of the process and the pages occupied by a global disk file, page file, or demand-zero section and can map to a demand-zero section with shared page tables.
Previous | Next | Contents | [Home] | [Comments] | [Ordering info] | [Help]
![]()
4527P053.HTM OSSG Documentation 22-NOV-1996 13:00:09.78Copyright © Digital Equipment Corporation 1996. All Rights Reserved.