From:	MERC::"uunet!CRVAX.SRI.COM!RELAY-INFO-VAX" 22-JUL-1992 10:32:15.93
To:	info-vax@kl.sri.com
CC:	
Subj:	Re: Tracing mailbox access


In article <9207211132.AA26821@genrad.com>, dongray@cdclu1.genrad.com (Derek Dongray) writes:
||>	movl	4(ap),r0		; passed mbx_chan by value
|>	movl	g^ctl$gl_ccbbase,r1	; get channel base
|>	subl	r0,r1			; now point to required CCB
|>	movl	(r1),ucbaddr		; extract UCB pointer

DON'T DO THIS!  Use IOC$VERIFYCHAN, instead, to get the CCB address for a 
particular channel number.  If you don't (use the routine interface), you
will regret it at some point in the future.  (For those detractors of
IOC$VERIFYCHAN who claim it is unuseful because of its "previous mode"
access check, please note:  1) it is callable from any mode, 2) it returns
the CCB address even if the access mode check fails).

The code above then becomes:

	movzwl	4(ap),r0
	jsb	g^ioc$verifychan
	movl	ccb$l_ucb(r1),ucbaddr

Note the use of the CCB symbols.  Don't assume that the UCB address will
always be the first thing in the CCB.  The symbols are defined in $CCBDEF
which is in LIB.MLB.
--
-----------------------------------------------------------------------------
Richard Critz					      critz@star.enet.dec.com
      -- I speak only for myself; I make no commitments for Digital. --
-----------------------------------------------------------------------------

