HP OpenVMS Systems Documentation

Content starts here

Upgrading Privileged-Code Applications on OpenVMS Alpha and OpenVMS I64 Systems


Previous Contents Index


Appendix B
I/O Support Routine Changes

This appendix contains detailed descriptions of the changes to I/O support routines and the new I/O support routines that are available to enhance device drivers to support 64-bit addresses.

The routines are listed in alphabetical order.

B.1 ACP_STD$READBLK and ACP_STD$WRITEBLK

The routines ACP_STD$READBLK and ACP_STD$WRITEBLK are upper-level FDT routines, so their interfaces remain unchanged:


int acp_std$readblk  (IRP *irp, PCB *pcb, UCB *ucb, CCB *ccb) int acp_std$writeblk (IRP *irp, PCB *pcb, UCB *ucb, CCB *ccb) 

These routines obtain the address of the caller's buffer fromirp->irp$l_qio_p1. These routines have been modified to obtain the full 64-bit buffer address fromirp->irp$q_qio_p1and pass it to EXE_STD$READLOCK or EXE_STD$WRITELOCK. Note, however, that the buffer size remains a longword and is obtained fromirp->irp$l_qio_p2 without checking the upper 32-bits.

B.2 EXE_STD$ALLOC_BUFIO_32, EXE_STD$ALLOC_BUFIO_64

Routines EXE_STD$ALLOC_BUFIO_32 and EXE_STD$ALLOC_BUFIO_64 are new routines that device drivers can use to allocate and initialize simple buffered I/O (BUFIO) packets. The appropriate IRP and BUFIO header cells are initialized but it is up to the caller to copy any data into the packet.

The interfaces for these routines are:


int exe_std$alloc_bufio_32 (IRP *irp, PCB *pcb, void *uva,   int pktsiz) int exe_std$alloc_bufio_64 (IRP *irp, PCB *pcb, VOID_PQ uva, int pktsiz) 

Table B-1 summarizes the use of the arguments.

Table B-1 EXE_STD$ALLOC_BUFIO_32, EXE_STD$ALLOC_BUFIO_64 Arguments
Argument Type Access Description
irp IRP * Input Pointer to the current IRP.
pcb PCB * Input Pointer to the process PCB.
uva VOID_PQ Input User virtual address, EXE_STD$ALLOC_BUFIO_64
  void * Input User virtual address, EXE_STD$ALLOC_BUFIO_32
pktsiz int Input Required size of the packet including the packet header.

These routines use the EXE_STD$DEBIT_BYTCNT_ALO routine to allocate the packet and charge the process for the required BYTCNT quota. Any failure status from this routine is returned to the caller.

Table B-2 lists all the implicit outputs that are valid on successful return from these routines.

Table B-2 EXE_STD$ALLOC_BUFIO_32, EXE_STD$ALLOC_BUFIO_64 Implicit Outputs
Field Value on Successful Completion
irp$ps_bufio_pkt Pointer to the allocated BUFIO packet.
irp$l_boff Number of charged bytes and size of allocated packet.
bufio$ps_pktdata Pointer to the packet data region in the allocated BUFIO packet.
bufio$ps_uva32 For EXE_STD$ALLOC_BUFIO_32, value of uva.

For EXE_STD$ALLOC_BUFIO_64, BUFIO$K_64.

bufio$w_size Size of allocated packet.
bufio$b_type DYN$C_BUFIO.
bufio$pq_uva64 For EXE_STD$ALLOC_BUFIO_64, value of uva.

B.3 EXE_STD$ALLOC_DIAGBUF

Routine EXE_STD$ALLOC_DIAGBUF is a new routine that allocates either a 32-bit or 64-bit diagnostic buffer packet and initializes the diagnostic buffer packet header. Diagnostic buffer packets use the same layout as BUFIO packets. This routine initializes the appropriate IRP and BUFIO header cells in the diagnostic buffer packet header but it is up to the caller to copy any data into the packet.

The allocation of a 32-bit or 64-bit format diagnostic buffer packet is controlled by a flag bit in the packet size value that is passed to this routine. This allows callers to simply pass in the value of theddt$w_diagbuf cell directly to this routine.

The interface for this routine is:


int exe_std$alloc_diagbuf (IRP *irp, VOID_PQ *uva, int pktsiz) 

Table B-3 summarizes the use of the arguments.

Table B-3 EXE_STD$ALLOC_DIAGBUF Arguments
Argument Type Access Description
irp IRP * Input Pointer to the current IRP.
uva VOID_PQ Input User virtual address.
pktsiz int Input The low-order 15-bits of this parameter specify the required size of the packet including the diagnostic packet header. If bit-16 (DDT$M_DIAGBUF64) is set a 64-bit diagnostic buffer packet is allocated. Otherwise a 32-bit diagnostic buffer packet is allocated.

This routine uses the EXE_STD$ALLOCBUF routine to allocate the packet. Any failure status from this routine is returned to the caller of EXE_STD$ALLOC_DIAGBUF. Note that the EXE_STD$ALLOCBUF routine may put the process in a resource wait state and there is no additional process quota charge for a diagnostic buffer packet.

Table B-4 lists all the implicit outputs that are valid on successful return from this routine.

Table B-4 EXE_STD$ALLOC_DIAGBUF Implicit Outputs
Field Value on Successful Completion
irp$l_diagbuf Pointer to the allocated diagnostic buffer packet.
irp$l_sts Status flag IRP$M_DIAGBUF is set to indicate that the IRP has an associated diagnostic buffer packet.
bufio$ps_pktdata Pointer to the packet data region in the allocated diagnostic BUFIO packet.
bufio$ps_uva32 If DDT$M_DIAGBUF64 clear, value of uva.

If DDT$M_DIAGBUF64 set, BUFIO$K_64.

bufio$w_size Size of allocated diagnostic buffer packet.
bufio$b_type DYN$C_BUFIO
bufio$pq_uva64 If DDT$M_DIAGBUF64 set, value of uva.

B.4 EXE_STD$LOCK_ERR_CLEANUP

Routine EXE_STD$LOCK_ERR_CLEANUP is a new routine. This routine unlocks any previously locked down buffers that are associated with the specified IRP or any IRPEs that are attached to it. Additionally, all the attached IRPEs are deallocated.

This routine is designed to be called in a driver-supplied error callback routine that is called if any error is encountered in the EXE_STD$READLOCK, EXE_STD$WRITELOCK, or EXE_STD$MODIFY_LOCK routines.

The interface for this routine is:


void exe_std$lock_err_cleanup (IRP *irp) 

Table B-5 summarizes the use of the arguments.

Table B-5 EXE_STD$LOCK_ERR_CLEANUP Arguments
Argument Type Access Description
irp IRP * Input Pointer to the current IRP.

Table B-6 lists all the implicit inputs and outputs that are used by this routine.

Table B-6 EXE_STD$LOCK_ERR_CLEANUP Implicit Inputs and Outputs
Implicit Inputs from the IRP
Field Use
irp$l_svapte If non-zero, points to the first PTE for a set of pages that will be unlocked.
irp$l_bcnt Used only if irp$l_svapte is non-zero to calculate number of pages that will be unlocked.
irp$l_boff Used only if irp$l_svapte is non-zero to calculate number of pages that will be unlocked.
irp$v_extend If set, the IRPE pointed to by irp$l_extend will be processed.
irp$l_extend Used only if irp$v_extend is set to find the first IRPE.
Implicit Inputs from Each IRPE
Field Use
irpe$l_svapte If non-zero, points to the first PTE for a set of pages that will be unlocked.
irpe$l_bcnt Used only if irpe$l_svapte is non-zero to calculate number of pages that will be unlocked.
irpe$l_boff Used only if irpe$l_svapte is non-zero to calculate number of pages that will be unlocked.
irpe$v_extend If set, the IRPE pointed to by irpe$l_extend will be processed.
irpe$l_extend Used only if irpe$v_extend is set to find the next IRPE.
Implicit Outputs in the IRP
Field Value Written
irp$l_svapte Cleared to indicate no locked pages.
irp$v_extend Cleared to indicate no attached IRPEs.


Previous Next Contents Index