	.title		unmvt -- undo mount-verify timeout
;
;  Program to undo a mount-verify timeout state
;
;  Original written by:
;	 John Osudar (Argonne National Laboratory, osudar@cmt.anl.gov)
;
;  Modified by:
;	Richard Critz (Digital Equipment Corporation, critz@star.enet.dec.com)
;		to look up the UCB address from the device name
;
; To build:
;	$ MACRO UNMVT
;	$ LINK UNMVT
;
; NOTE -- Use this program *ONLY* when the disk is really accessible again!
;
	.library	"sys$share:lib.mlb"
	.link		"sys$system:sys.stb" /selective_search
	$ucbdef
	$vcbdef
;
	.psect		data
cmdlin:	.ascid		/????????????????/
prompt:	.ascid		/Disk name: /
done:	.ascid		/Done/
error:	.ascid		/Error/
;
	.psect		code
	.entry	unmvt,0
	pushaw	cmdlin
	pushaq	prompt
	pushaq	cmdlin
	calls	#3,g^lib$get_foreign
	blbc	r0,8$
	clrl	-(sp)
	pushab	doit
	calls	#2,g^sys$cmkrnl
	pushaq	done
	blbs	r0,9$
	tstl	(sp)+
8$:	pushaq	error
9$:	calls	#1,g^lib$put_output
	movl	#1,r0
	ret
;
	.entry	doit,^m<r2,r3>
	jsb	g^sch$iolockw
	movaq	cmdlin,r1
	jsb	g^ioc$searchdev
	blbc	r0,10$
	bisl	#ucb$m_valid,ucb$l_sts(r1)
	movl	ucb$l_vcb(r1),r2
	bisb	#1@vcb$v_mountver,vcb$b_status2(r2)
10$:	jsb	g^sch$iounlock
	setipl	#0
	movl	#1,r0
	ret
	.end	unmvt
