.title CDDEFIN .sbttl Disk Cache Driver Symbolic Definitions .ident /112888/ ; ;+ ;***** ; ; CDDEFIN.MAR - Defines all symbolic offsets for data structures ; required by the disk data caching driver, CDDRIVER. ; ;- ;***** ; ; Paul Sorenson ; AEP/Engineering Computer Support Center ; Columbus, OH 43215 ; ;***** ; ; Update 7/25/88 -- PRS; Remove symbolic definitions that related ; to caching I/Os directed through the cache driver; this ; will not work as originally conceived due to the XQP/ACP ; using the UCB from the CCB rather than the IRP. ; ; Update 9/7/88 -- PRS; Remove pending/free queue lists from UCB; ; these structures are now part of driver's local data space. ; ; Update 9/15/88 -- PRS; Pull unused UCB fields, add disk device ; name & unit fields, redefine location of various other ; UCB fields. Convert IO$M_VD_GETINFO to IO$_SENSEMODE ; subfunction, remove unused subfunctions. ; ; Update 9/27/88 -- PRS; Add timer queue element and special fork ; block to UCB for support of IO$_READxBLK QIO function ; which records all writes (writes/reads) to disk in user ; buffer. ; ; Update 11/28/88 -- PRS; Add queue list head for linking packets ; of CIBs allocated with each extend operation. ; ;***** ;-- ; .page .SBTTL Cache Driver Specific I/O Function Codes ; ; *** ; .MACRO CD$IODEF,A $IODEF A ; standard I/O function definitions $DEFINI IO,A ; ; *** Declare IO$_READxBLK function modifiers...must not conflict with ; IO$V_TIMED !! ; $VIELD IO,IO$V_FMODIFIERS,<- > ; record all read operations ; ; *** Declare IO$_SETMODE function modifiers ; $VIELD IO,IO$V_FMODIFIERS,<- - ; *** Major SETMODE modifiers; mutually exclusive ,- ; startup caching ,- ; shutdown caching ,- ; add memory to cache ,- ; purge contents of cache ,- ; (currently undefined) ,- ; (currently undefined) - ; *** Common modifier for any major modifier ,- ; zero cache statistical counters - ; *** Declare IO$M_STARTUP modifiers ,- ; allow caching of page/swap I/Os ,- ; load cache contents on write > ; invalidate cache contents on write $EQU IO$M_CD_SETMODES - ; mask for major SETMODE modifiers ; ; *** Declare IO$_SENSEMODE function modifiers ; $VIELD IO,IO$V_FMODIFIERS,<- > ; get information on cache $DEFEND IO .MACRO CD$IODEF,B .ENDM .ENDM ; .page .SBTTL Cache Identification Block Definition ; ; *** Cache Identification Block (CIB) structure...note: size of this structure ; dictates the blocking factor allowed for allocation of cache memory; ; setup so an even number of pages of CIB's are allocated for each ; CD_ALLOCINC pages of memory allocated to cache. ; .MACRO CD$CIBDEF,A $DEFINI CIB,A $DEF CIB$L_LBNQFL ; forward link to data ordered by LBN .BLKL 1 $DEF CIB$L_LBNQBL ; backward link to data ordered by LBN .BLKL 1 $DEF CIB$L_REFQFL ; forward link to data most freq ref .BLKL 1 $DEF CIB$L_REFQBL ; backward link to data most freq ref .BLKL 1 $DEF CIB$L_LBN ; LBN of data cached .BLKL 1 $DEF CIB$L_PFN ; PFN of memory page containing data .BLKL 1 $VIELD CIB,0,<- ; fields within PFN ,- ; mask for page frame number ,- ; reserved bits ,- ; set on subsequent read of data ,- ; set when data loaded by write QIO > ; MSB = cache data valid bit $DEF CIB$K_LENGTH ; length of CIB structure $EQU CD_CACHEINC 64 ; For each 64 pages in cache, ; need 3 pages of CIB's $EQU CD_CACHESIZE 32767 ; Absolute max # pages allowed in cache $DEFEND CIB .MACRO CD$CIBDEF B .ENDM .ENDM ; .page .SBTTL Pending I/O Identification Block Definition ; ; *** Pending I/O Identification Block (PIB) structure saves information ; regarding I/O requests handled by the cache driver that will ; be returned to the cache driver for further processing at some ; future time. PIBs are linked to the "PENDQFL" queue list ; while the operation is pending and are released to the ; "free" list headed at "FREEQFL". The free and pending queue list ; heads are part of the driver's local data space and link PIBs ; for all units of the driver. PIBs are allocated from ; non-paged system pool (an IRP) if the free list is empty. ; .MACRO CD$PIBDEF,A $DEFINI PIB,A $DEF PIB$L_PENDQFL ; forward link .BLKL 1 $DEF PIB$L_PENDQBL ; backward link .BLKL 1 $DEF PIB$L_IRP ; address of IRP associated with request .BLKL 1 $DEF PIB$L_PID ; saved PID from IRP .BLKL 1 $DEF PIB$L_UCB ; address of cache driver UCB .BLKL 1 $DEF PIB$L_CIB ; address of CIB assoc with transfer .BLKL 1 $DEF PIB$L_LBN ; starting LBN of data being transferred .BLKL 1 $DEF PIB$K_LENGTH ; length of PIB structure $DEFEND PIB .MACRO CD$PIBDEF B .ENDM .ENDM ; .page .sbttl Cache Driver UCB Extension Definition ; ; *** Unit Control Block (UCB) extension fields for CDDRIVER. ; .MACRO CD$UCBDEF,A $UCBDEF A ; Unit control block definitions $TQEDEF A ; Timer queue element definitions $FKBDEF A ; Fork block definitions $DEFINI UCB,A ; Start of UCB extension definitions ; ; *** Bit positions for device-dependent status in UCB$L_DEVDEPEND ; $VIELD UCB,0,<- ; Device status ,- ; set to invalidate cache on write ,- ; set to enable loading cache on write ,- ; set to enable caching of page/swap I/O ,- ; set to record read operations ,- ; set when read timeout timer active ,- ; set when memory allocated to cache > ; set when caching active $EQU UCB$M_CD_DEFAULT 0 ; default value for DEVDEPEND ; ; *** Second device dependent status definition ; $EQU UCB$L_CD_DSKUCB UCB$L_DEVDEPND2 ; UCB address of disk being cached .=UCB$K_LENGTH ; Position at end of simple UCB ; ; *** Timer queue element to support IO$_READxBLK!IO$M_TIMED QIO function ; $DEF UCB$T_CD_TQE .BLKB TQE$K_LENGTH ; ; *** Alternate fork block for execution @ IPL$_QUEUEAST ; $DEF UCB$Q_CD_FLBN ; Fork save area for LBN/block count .BLKL 2 $DEF UCB$T_CD_FKB ; Fork block .BLKB FKB$K_LENGTH ; $DEF UCB$L_CD_EXTQFL ; forward link of packets of CIBs .BLKL 1 $DEF UCB$L_CD_EXTQBL ; backward link of packets of CIBs .BLKL 1 ; ; *** LBNQ, REFQ, LBN and PFN must have the same relative positions in UCB as ; declared in CIB !!! ; $DEF UCB$L_CD_LBNQFL ; forward link for CIB's ordered by LBN .BLKL 1 $DEF UCB$L_CD_LBNQBL ; backward link for CIB's ordered by LBN .BLKL 1 $DEF UCB$L_CD_REFQFL ; forward link for CIB's ordered by most .BLKL 1 ; frequently referenced $DEF UCB$L_CD_REFQBL ; backward link for CIB's ordered by most .BLKL 1 ; frequently referenced $DEF UCB$L_CD_LBN ; MUST be set to -1 by unit init !!!! .BLKL 1 $DEF UCB$L_CD_PFN ; MUST be set to 0 by unit init !!!! .BLKL 1 ; $DEF UCB$L_CD_CSPTE ; address of system page table entry .BLKL 1 ; reserved to map cache $DEF UCB$L_CD_CSVA ; system virtual address to reference .BLKL 1 ; when reading/writing cache buffer $DEF UCB$L_CD_USPTE ; address of first of 2 consecutive .BLKL 1 ; system page table entries reserved ; to map user's buffer $DEF UCB$L_CD_USVA ; system virtual address to reference .BLKL 1 ; when reading/writing user's buffer $DEF UCB$L_CD_DSKSTARTIO ; disk driver's start_io entry point .BLKL 1 $DEF UCB$L_CD_DSKDDT ; DDT addr of physical disk being cached .BLKL 1 ; ; *** Start of cache information & statistic counters...these must be long ; word aligned ; $DEF UCB$T_CD_INFO $DEF UCB$T_CD_NAME ; generic device name of cached disk .BLKB 16 $DEF UCB$W_CD_UNIT ; physical unit number of cached disk .BLKW 1 $DEF UCB$W_CD_RESERVED ; (currently undefined) .BLKW 1 $DEF UCB$L_CD_CACHESIZE ; size of cache in blocks (pages) .BLKL 1 $DEF UCB$T_CD_STATS $DEF UCB$L_CD_RDCNT ; number of read operations processed .BLKL 1 $DEF UCB$L_CD_RDBLK ; total number of blocks read .BLKL 1 $DEF UCB$L_CD_RDLOAD ; number of blocks loaded by read QIO .BLKL 1 $DEF UCB$L_CD_RDONCE ; number of blocks loaded by read .BLKL 1 ; that were never re-read $DEF UCB$L_CD_RDHIT ; number of blocks read from cache .BLKL 1 $DEF UCB$L_CD_WRCNT ; number of write operations processed .BLKL 1 $DEF UCB$L_CD_WRBLK ; total number of blocks written .BLKL 1 $DEF UCB$L_CD_WRLOAD ; number of blocks loaded by write QIO .BLKL 1 $DEF UCB$L_CD_WRONCE ; number of blocks loaded by write .BLKL 1 ; that were never re-read $DEF UCB$K_CD_LENGTH ; Length of extended UCB $DEFEND UCB ; End of UCB definitions .MACRO CD$UCBDEF B .ENDM .ENDM ; CD$IODEF GLOBAL ; define I/O function codes globally ; when assembled separately .end