.title Reset_tape ; .library 'sys$library:lib.mlb' .link 'sys$system:sys.stb'/selective_search ; $ucbdef $dcdef ; dev_prmt: .ascid /Enter device name: / dev_len: .word 0 dev_dsc: .ascid / / ; .entry main,^m<> ; pushaw dev_dsc pushaq dev_prmt pushaq dev_dsc calls #3,g^lib$get_foreign ;get device name blbc r0,10$ $cmkrnl_s routin=search ;do the dirty work 10$: ret ; .entry search,^m<> ; movab g^exe$sigtoret,(fp);condition handler movaq dev_dsc,r1 ;device name descriptor movl g^ctl$gl_pcb,r4 ;get our pcb jsb g^sch$iolockr ;lock I/O database for read ;+ ; We are now at IPL IPL$_ASTDEL (2) ;- jsb g^ioc$searchdev ;;search for device blbc r0,10$ ;;error movzwl #ss$_notsqdev,r0;;check device type cmpb ucb$b_devclass(r1),#dc$_tape bneq 10$ ;;invalid device movzwl #ss$_normal,r0 ;+ ; If mscp_pkack bit is not set, do nothing ;- bbc #ucb$v_mscp_pkack,ucb$w_devsts(r1),10$ bicw2 #ucb$m_mscp_pkack,ucb$w_devsts(r1) clrw ucb$w_rwaitcnt(r1) 10$: movl r0,-(sp) jsb g^sch$iounlock ;;unlock I/O database movl (sp)+, r0 setipl #0 ;lower IPL ret ; .end main