;****************************************************** ; Subroutine - Spill_File_Info ; Author: Bruce Ellis ; Synopsis: This subroutine is called to ; format and display the Device name, file ; name, file id, reads and writes on the ; file since opened, and the number of mapping ; pointers in the file header(s). ; Inputs: address of a block of the following form: ; 8 bytes containing the scsnode ; 4 bytes containing the device name ; 2 bytes containing the unit number of the device ; 6 bytes containing the file id of the file ; 4 bytes containing the count of reads on the window ; 4 bytes containing the count of writes on the window ; ;****************************************************** ;Macros .macro check ?l blbs r0,l $exit_s r0 l: .endm check ;Data dev: .long 15 ;Descriptor holding the device name .address dev_a dev_a: .blkb 15 out_string: ;Output string buffer .long 256 .address 10$ 10$: .blkb 256 ;formats file_dev: .ascid <10><13>/File:/ fid_fmt:.ascid /File id: (!UW,!UW,!UW)/ fmt: .ascid /This file has !10UL mapping pointer(s)./ fmt_rw: .ascid /Reads on window: !10UL Writes on window: !10UL/ out_ptr: ;Output buffer .long 80 .address 10$ 10$: .blkb 80 ptr_count: ;Count of the number of mapping pointers .blkl 1 file_buffer: ;Local copy of the passed file buffer node: .blkb 8 devnam: .blkb 4 unit: .blkw 1 fid: .blkb 6 reads: .long 0 writes: .long 0 buffer_size=.-file_buffer allo: .long 3 ;Allocation class descriptor .address allo_a allo_a_prefix: .ascii /$/ allo_a: .blkb 3 allo_f: .ascid /!UB/ unit_f: .ascid /!UW/ unit_d: .long 5 .address unit_a unit_a: .blkb 5 ;Code .entry spill_file_info,^m<> movc3 #buffer_size,@4(ap),file_buffer ;Copy the buffer to local ; storage cmpw node,#-1 ;Alloclass? bneq no_alloclass ;branch if not ;^^^^^^^^^^^^ ;Format the allocation class to ascii ;^^^^^^^^^^^^ $fao_s ctrstr=allo_f,outbuf=allo,outlen=allo,p1=node+2 check incl allo ;increment to include ; last '$' sign movc3 allo,allo_a_prefix,dev_a brb finish_node ;skip to rest of devnam no_alloclass: movzbl node,r0 ;Get node name size bneq got_node ;Process the node name moval dev_a,r3 ;no node so skip it brb skip_node ; got_node: movc3 r0,,dev_a ;Copy node name finish_node: movb #^a/$/,(r3)+ ;Plug in a $ after node name skip_node: movw devnam+1,(r3)+ ; Get device and controller movb devnam+3,(r3)+ ; portion of the device name movl #5,unit_d ;Format the unit # $fao_s ctrstr=unit_f,outbuf=unit_d,outlen=unit_d,p1=unit check movc3 unit_d,unit_a,(r3) ;Append unit (in ascii) to devnam movb #^a/:/,(r3)+ ;Append ':' subl3 #dev_a,r3,dev ;Calculate size of device name pushal file_dev ;Spill header calls #1,g^lib$put_output pushal dev ;Spill device name calls #1,g^lib$put_output movl #256,out_string ;Alllow for a large file name pushal ptr_count ;Pass location for mapping ;pointer count pushal out_string ;Pass location to return size ; of file name string pushal out_string ;Pass file spec descriptor pushal fid ;Pass the file id pushal dev ;Pass the device name calls #5,g^lib$fid_to_name ;Convert the fid to file name check pushal out_string ;spill the file name calls #1,g^lib$put_output ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ;Format the file id ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ movl #80,out_ptr $fao_s ctrstr=fid_fmt,outbuf=out_ptr,outlen=out_ptr,- p1=fid,p2=fid+2,p3=fid+4 check pushal out_ptr calls #1,g^lib$put_output ;Spill the file id ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ;format the count of mapping pointers ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ movl #80,out_ptr $fao_s ctrstr=fmt,outbuf=out_ptr,outlen=out_ptr,p1=ptr_count blbs r0,ok $exit_s r0 ok: pushal out_ptr ;Spill the count of mapping ptrs calls #1,g^lib$put_output ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ;format the count of reads/writes ;^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ movl #80,out_ptr $fao_s ctrstr=fmt_rw,outbuf=out_ptr,outlen=out_ptr,p1=reads,- p2=writes check pushal out_ptr ;Spill the count calls #1,g^lib$put_output ret ;Sayonara .end