![]() |
![]() HP OpenVMS Systems Documentation |
![]() |
OpenVMS Alpha Guide to Upgrading Privileged-Code Applications
B.15 IOC_STD$VA_TO_PARoutine IOC_STD$VA_TO_PA is a new routine that is used to derive a 64-bit physical memory address for a 64-bit virtual address. The virtual address is interpreted in the context of the current process and may be in either process-private or system space. It is the caller's responsibility to ensure that the virtual address is a legal address and that the memory page containing the specified virtual address is locked into memory prior to calling this routine. The IOC_STD$VA_TO_PA routine may declare a bugcheck if either of these conditions have not been met. The interface for IOC_STD$VA_TO_PA is:
The returned value of this routine is the 64-bit physical address. Table B-12 summarizes the use of the arguments.
Currently, the physical address for a process virtual address can be
derived by calling MMG_STD$SVAPTECHK followed by IOC$SVAPTE_TO_PA.
However, as described in Section 2.2.3, the MMG_STD$SVAPTECHK routine
no longer accepts a P0/P1 address. The new IOC_STD$VA_TO_PA routine
provides a direct way of computing the physical address from a process
virtual address.
Routine MMG_STD$GET_PTE_FOR_VA is a new routine that is being added for use in the Remote SDA SYSAP within SYS$SCS. Routine MMG_STD$GET_PTE_FOR_VA attempts to obtain the Level-3 PTE containing a PFN that maps the specified virtual address for a specified process. If the requested PTE cannot be accessed either because the virtual address is not mapped or a needed page table page is not currently in physical memory, an error status is returned. Additionally, if the Level-3 PTE does not contain a useable PFN, an error status is returned. A successful return status from this routine means that the PFN field of the returned PTE contains the physical page number for the input virtual address. Note that there are page states where the PTE contains a useable PFN but the PTE$V_VALID bit is clear. Therefore, the PTE$V_VALID bit in the returned PTE might be clear. Note also, that this routine returns a PTE from the Global Page Table when the slave PTE has reverted to GPTX format and the master PTE in the GPT still contains a PFN. This routine is somewhat similar to MMG_STD$CALC_VAPTE except that it does not assume that the virtual address is valid or that the necessary page tables are resident in memory. Because this routine does not assume the virtual address is valid, it uses the reserved system space window to traverse the specified process' page tables in a top-down fashion. It uses this method for all process-private virtual addresses even if the specified process happens to be the current process on this CPU. This allows this routine to locate the Level-3 PTE even if some of the intervening page table pages are in transition. However, for shared system space virtual addresses this routine uses the currently active page tables instead of the reserved system window to locate the corresponding Level-3 PTE. This is possible because shared system space page table pages are not pageable and have PTE$V_VALID set if they are mapped. This routine acquires and restores the MMG spinlock. This routine declares a bugcheck if the reserved system space window is already in use. This routine releases and invalidates the window before returning. The interface for MMG_STD$GET_PTE_FOR_VA is:
Table B-13 summarizes the use of the arguments.
The returned value of this routine is a system condition value:
B.17 MMG_STD$IOLOCK, MMG$IOLOCK, MMG_STD$IOLOCK_BUFThe interface for the MMG_STD$IOLOCK routine is:
This routine returns a 32-bit address by reference (the svapte_p parameter) which, depending on the routine status, may specify the address of the first PTE or the address of a location in the buffer that must be faulted in. The new version of this routine must accept a 64-bit buffer address. In addition, the new version must also return either a 64-bit PTE or buffer address. This is an incompatible interface change because this return parameter is passed by reference. Thus, MMG_STD$IOLOCK has been removed and is replaced by the new MMG_STD$IOLOCK_BUF routine. The interface for MMG_STD$IOLOCK_BUF is:
Table B-14 summarizes the use of the arguments.
The returned value of this routine is a system condition value or the value zero:
Just like MMG_STD$IOLOCK, the MMG_STD$IOLOCK_BUF routine must be called in process context at IPL 2 and it acquires and releases the MMG spinlock. Although the interfaces for the MMG_STD$IOLOCK_BUF and MMG_STD$IOLOCK routines are similar, there are important differences between these routines that go beyond the width of the address parameters.
The existing callers of MMG_STD$IOLOCK need to be very aware of the first of these differences. The second difference is likely to be transparent to most callers.
Because the routine MMG$IOLOCK is simply a JSB-to-CALL jacket routine
around MMG_STD$IOLOCK, the MMG$IOLOCK routine has also been removed.
The CALL_IOLOCK MACRO-32 macro facilitates the use of the MMG_STD$IOLOCK routine by code that was originally written to use the JSB-interface counterpart MMG$IOLOCK. The CALL_IOLOCK macro has implicit register inputs and outputs that correspond to the register inputs and outputs of the JSB-interface for the MMG$IOLOCK routine. Because this macro uses registers for its inputs and outputs, it can be altered to use the full 64-bit values in these registers and it can call the MMG_STD$IOLOCK_BUF routine instead of MMG_STD$IOLOCK. Nevertheless, the CALL_IOLOCK macro has been modified to generate a suppressable interface warning at compile-time, because:
The format of the macro call is:
By default the interface warning is enabled and generates the following warning at compile-time:
The compile-time warning serves to identify the existing callers of
this macro. Once the invoking code has been modified, the warning can
be suppressed by specifying INTERFACE_WARNING=NO.
The interface for the MMG_STD$UNLOCK routine is:
The MMG$UNLOCK routine is simply a JSB-to-CALL jacket routine around MMG_STD$UNLOCK. Because 32-bit PTE addresses that may point to PTE copies are sufficient for the needs of the MMG_STD$UNLOCK routine, there is no absolute requirement to change the interface of these routines. However, it is extremely likely that all callers of MMG_STD$UNLOCK and MMG$UNLOCK need to use the new DIOBM structure and need to call the new routine IOC_STD$RELEASE_DIOBM immediately after unlocking the memory buffer. Therefore, routine MMG_STD$UNLOCK has been renamed to MMG_STD$IOUNLOCK_BUF and the MMG$UNLOCK routine has been removed in order to make it difficult to miss the places where this source change is needed. The interface for MMG_STD$IOUNLOCK_BUF is:
Just like MMG_STD$UNLOCK, the MMG_STD$IOUNLOCK_BUF routine does not
depend on process context. However, the IPL and spinlocks of the caller
must allow this routine to acquire and restore the MMG spinlock.
The CALL_UNLOCK MACRO-32 macro facilitates the use of the MMG_STD$UNLOCK routine by code that was originally written to use the JSB-interface counterpart MMG$UNLOCK. The CALL_UNLOCK macro has implicit register inputs that correspond to the register inputs and outputs of the JSB-interface for the MMG$UNLOCK routine. This macro has been modified to use the full 64-bits of the R3 input which contains the PTE address. The macro calls the new MMG_STD$IOUNLOCK_BUF routine instead of MMG_STD$UNLOCK. In addition, the CALL_UNLOCK macro has been modified to generate a suppressable interface warning at compile-time. The format of the macro call is:
By default the interface warning is enabled and generates the following warning at compile-time:
B.19 MMG_STD$SVAPTECHK, MMG$SVAPTECHKThe current versions of the MMG_STD$SVAPTECHK and MMG$SVAPTECHK routines compute a 32-bit svapte for either a process or system space address. As of OpenVMS Alpha Version 7.0, these routines are be restricted to an S0/S1 system space address and no longer accept an address in P0/P1 space. The MMG_STD$SVAPTECHK and MMG$SVAPTECHK routines check the full 64 bits of the input address and declare a bugcheck for an input address that is not in S0/S1 space. For S0/S1 input addresses, these routines return a 32-bit system virtual address of the PTE through the SPT window. In releases prior to OpenVMS Alpha Version 7.0, the interface for this routine was:
The new interface for this routine is:
The majority of callers of this routine use it with an S0/S1 address and do not need to change.
Appendix C
|
OpenVMS usage | cond_value |
type | longword (unsigned) |
access | write only |
mechanism | by value |
Status indicating the success or failure of the operation.
ipid
OpenVMS usage process_id type longword (unsigned) access read mechanism by value
This argument provides the internal PID to be converted.ktb
OpenVMS usage address type quadword access write mechanism by reference
This argument provides the KTB address.pcb
OpenVMS usage address type quadword access write mechanism by reference
This argument provides the PCB address.
The EXE$CVT_IPID_TO_KTB routine converts an internal PID to a KTB address.
SS$_NONEXPR The process does not exist. SS$_NOSUCHTHREAD The process exists but the thread does not.
Converts an external PID to a KTB address.
EXE$CVT_EPID_TO_KTB epid ,ktb ,pcb
OpenVMS usage cond_value type longword (unsigned) access write only mechanism by value
Status indicating the success or failure of the operation.
epid
OpenVMS usage process_id type longword (unsigned) access read mechanism by value
This argument provides the external PID to be converted.ktb
OpenVMS usage address type quadword access write mechanism by reference
This argument provides the KTB address.pcb
OpenVMS usage address type quadword access write mechanism by reference
This argument provides the PCB address.
The EXE$CVT_EPID_TO_KTB routine converts an external PID to a KTB address.
SS$_NONEXPR The process does not exist. SS$_NOSUCHTHREAD The process exists but the thread does not.
Previous | Next | Contents | Index |