/**/ /***************************************************************************/ /** **/ /** © Copyright 2010, Hewlett-Packard Development Company, L.P. **/ /** **/ /** Confidential computer software. Valid license from HP and/or **/ /** its subsidiaries required for possession, use, or copying. **/ /** **/ /** Consistent with FAR 12.211 and 12.212, Commercial Computer Software, **/ /** Computer Software Documentation, and Technical Data for Commercial **/ /** Items are licensed to the U.S. Government under vendor's standard **/ /** commercial license. **/ /** **/ /** Neither HP nor any of its subsidiaries shall be liable for technical **/ /** or editorial errors or omissions contained herein. The information **/ /** in this document is provided "as is" without warranty of any kind and **/ /** is subject to change without notice. The warranties for HP products **/ /** are set forth in the express limited warranty statements accompanying **/ /** such products. Nothing herein should be construed as constituting an **/ /** additional warranty. **/ /** **/ /***************************************************************************/ /********************************************************************************************************************************/ /* Created: 30-Mar-2010 17:24:46 by OpenVMS SDL EV3-3 */ /* Source: 23-OCT-1995 16:47:14 $1$DGA7274:[LIB_H.SRC]DIOBMDEF.SDL;1 */ /********************************************************************************************************************************/ /*** MODULE $DIOBMDEF ***/ #ifndef __DIOBMDEF_LOADED #define __DIOBMDEF_LOADED 1 #pragma __nostandard /* This file uses non-ANSI-Standard features */ #pragma __member_alignment __save #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __save /* Save the previously-defined required ptr size */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif #ifdef __cplusplus extern "C" { #define __unknown_params ... #define __optional_params ... #else #define __unknown_params #define __optional_params ... #endif #ifndef __struct #if !defined(__VAXC) #define __struct struct #else #define __struct variant_struct #endif #endif #ifndef __union #if !defined(__VAXC) #define __union union #else #define __union variant_union #endif #endif /*+ */ /* DIOBM - Direct I/O Buffer Map */ /* */ /* The DIOBM structure is used to solve the "cross-process PTE problem" for */ /* buffers that have been locked into memory for direct I/O. The */ /* cross-process PTE access problem results from memory management */ /* infrastructure changes made to support 64-bit virtual addressing. */ /* Because the process page tables are in process-private page table space */ /* and no longer in the balance set slots in S0/S1 space, only the PTEs for */ /* the current process can be accessed directly. Moreover, the virtual */ /* address for these PTEs in page table space requires a full 64-bits. */ /* */ /* There are two variants of the DIOBM structure. The first is the primary */ /* DIOBM structure. The primary DIOBM structure can be used in the */ /* following mutually exclusive ways: */ /* */ /* 1. To contain copies of the actual PTEs that map the buffer. */ /* */ /* 2. To point to a larger secondary DIOBM structure if the primary DIOBM */ /* structure has insufficient room for all the PTEs that map the user */ /* buffer. */ /* */ /* 3. To manage a PTE window in S0/S1 space onto the actual PTEs that map */ /* the buffer if the required PTE count exceeds the capacity of the */ /* largest allowable DIOBM structure. */ /* */ /* Each of the above methods yield a 32-bit system virtual address for the */ /* PTEs that map the buffer. This address is valid regardless of process */ /* or system context. */ /* */ /* The fixed-size DIOBM structure contains room for exactly */ /* DIOBM$K_PTECNT_FIX (9) PTEs which are enough to map a 64 Kb buffer with */ /* an 8 Kb page size. The IRP, IRPE, VCRP, and DCBE structures all contain */ /* an embedded fixed-sized primary DIOBM structure. A secondary DIOBM */ /* structure is used only for PTE copies and can have room for up to the */ /* number of PTEs specified in the IOC$GL_DIOBM_PTECNT_MAX data cell. */ /* The value of the IOC$GL_DIOBM_PTECNT_MAX data cell is set to */ /* DIOBM$K_PTECNT_MAX_UNI (94) on a uniprocessor system and */ /* DIOBM$K_PTECNT_MAX_SMP (430) on an SMP system. */ /* */ /* For additional details about the usage of the DIOBM, see "Chapter 20: */ /* QIO and Device Drivers" in DOCD$:[EVMS.CMS_64B]DS-64BITS.PS. */ /*- */ #include /* Define the PTE type; DIOBM contains a vector of PTEs */ #define DIOBM$M_REL_DEALLOC 0x1 #define DIOBM$M_PTE_WINDOW 0x2 #define DIOBM$M_AUX_INUSE 0x4 #define DIOBM$M_INUSE 0x8 #define DIOBM$M_S0PTE_WINDOW 0x10 #define DIOBM$K_HDRLEN 16 /* Size of minimal DIOBM packet header excluding PTE vector */ #define DIOBM$K_PTECNT_FIX 9 /* Number of PTE entries in fixed size DIOBM */ /* Max PTE entries in variably sized DIOBM before using PTE window */ #define DIOBM$K_PTECNT_MAX_UNI 94 /* Max PTE entries on uniprocessor system (experimentally derived) */ #define DIOBM$K_PTECNT_MAX_SMP 430 /* Higher value for max PTE entries on SMP system (experimentally derived) */ #if !defined(__NOBASEALIGN_SUPPORT) && !defined(__cplusplus) /* If using pre DECC V4.0 or C++ */ #pragma __nomember_alignment __quadword #else #pragma __nomember_alignment #endif typedef struct _diobm { #pragma __nomember_alignment struct _diobm *diobm$ps_aux_diobm; /* Pointer to a secondary DIOBM structure */ /* Valid if and only if DIOBM$V_AUX_INUSE set */ unsigned int diobm$l_pte_count; /* If DIOBM$V_PTE_WINDOW is clear, count of */ /* PTEs copied to the PTE vector */ /* If DIOBM$V_PTE_WINDOW is set, count of */ /* SPTEs allocated for a PTE window */ unsigned short int diobm$w_size; /* Structure size */ unsigned char diobm$b_type; /* Structure type, DYN$C_MISC */ unsigned char diobm$b_subtype; /* Structure subtype, DYN$C_DIOBM */ __union { unsigned int diobm$l_flags; /* Flag bits: */ __struct { unsigned diobm$v_rel_dealloc : 1; /* Deallocate this DIOBM on release */ unsigned diobm$v_pte_window : 1; /* This DIOBM manages a PTE window */ unsigned diobm$v_aux_inuse : 1; /* DIOBM$PS_AUX_DIOBM points to secondary DIOBM */ unsigned diobm$v_inuse : 1; /* This DIOBM is in use (if "full checking" enabled) */ unsigned diobm$v_s0pte_window : 1; /* S0/S1 PTE window was used to derive 32-bit SVAPTE */ unsigned diobm$v_fill_2_ : 3; } diobm$r_fill_1_; } diobm$r_fill_0_; /* The PTE window is more expensive on an SMP system */ #if !defined(__NOBASEALIGN_SUPPORT) && !defined(__cplusplus) /* If using pre DECC V4.0 or C++ */ #pragma __nomember_alignment __quadword #else #pragma __nomember_alignment #endif __union { PTE diobm$q_pte_vector [9]; /* Vector of PTEs */ /* that are copies of the PTEs that map the buffer */ /* Valid only if both DIOBM$V_PTE_WINDOW and DIOBM$V_AUX_INUSE clear */ #pragma __nomember_alignment __struct { #if !defined(__NOBASEALIGN_SUPPORT) && !defined(__cplusplus) /* If using pre DECC V4.0 or C++ */ #pragma __nomember_alignment __quadword #else #pragma __nomember_alignment #endif #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __long /* And set ptr size default to 64-bit pointers */ struct _pte *diobm$pq_ptew_va_spte; /* 64-bit VA for first SPTE allocated for window */ #else unsigned __int64 diobm$pq_ptew_va_spte; #endif /* Valid if and only if DIOBM$V_PTE_WINDOW set */ #pragma __nomember_alignment #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __short /* And set ptr size default to 32-bit pointers */ #endif void *diobm$ps_ptew_s0va; /* Lowest S0/S1 va mapped by SPTEs for PTE window */ /* Valid if and only if DIOBM$V_PTE_WINDOW set */ } diobm$r_ptew; } diobm$r_pte_vector_overlay; } DIOBM; #if !defined(__VAXC) #define diobm$l_flags diobm$r_fill_0_.diobm$l_flags #define diobm$v_rel_dealloc diobm$r_fill_0_.diobm$r_fill_1_.diobm$v_rel_dealloc #define diobm$v_pte_window diobm$r_fill_0_.diobm$r_fill_1_.diobm$v_pte_window #define diobm$v_aux_inuse diobm$r_fill_0_.diobm$r_fill_1_.diobm$v_aux_inuse #define diobm$v_inuse diobm$r_fill_0_.diobm$r_fill_1_.diobm$v_inuse #define diobm$v_s0pte_window diobm$r_fill_0_.diobm$r_fill_1_.diobm$v_s0pte_window #define diobm$q_pte_vector diobm$r_pte_vector_overlay.diobm$q_pte_vector #define diobm$pq_ptew_va_spte diobm$r_pte_vector_overlay.diobm$r_ptew.diobm$pq_ptew_va_spte #define diobm$ps_ptew_s0va diobm$r_pte_vector_overlay.diobm$r_ptew.diobm$ps_ptew_s0va #endif /* #if !defined(__VAXC) */ #define DIOBM$K_LENGTH 88 /* Size of fixed size DIOBM */ /* Flag bit mask definitions for use on the flags parameter to routines */ /* IOC_STD$CREATE_DIOBM and IOC_STD$FILL_DIOBM */ /* */ #define DIOBM$M_NORESWAIT 1 /* No resource wait; return error */ #pragma __member_alignment __restore #ifdef __INITIAL_POINTER_SIZE /* Defined whenever ptr size pragmas supported */ #pragma __required_pointer_size __restore /* Restore the previously-defined required ptr size */ #endif #ifdef __cplusplus } #endif #pragma __standard #endif /* __DIOBMDEF_LOADED */