From:	CRDGW2::CRDGW2::MRGATE::"SMTP::CRVAX.SRI.COM::RELAY-INFO-VAX" 31-AUG-1989 08:33
To:	MRGATE::"ARISIA::EVERHART"
Subj:	SNAP part 8 of 8, that's all folks

Message-Id:  <8908311217.AA28341@crdgw1.ge.com>
Received: From KL.SRI.COM by CRVAX.SRI.COM with TCP; Thu, 31 AUG 89 04:48:05 PDT
Received: from drcvax.af.mil by KL.SRI.COM with TCP; Thu, 31 Aug 89 04:19:24 PDT
Date: 31 Aug 89 07:01:00 EST
From: "Daniel J. Graham" <graham@drcvax.af.mil>
Subject: SNAP part 8 of 8, that's all folks
To: "info-vax" <info-vax@kl.sri.com>

-+-+-+-+-+-+-+-+ START OF PART 8 -+-+-+-+-+-+-+-+
X`009`009MOVC3`009WRITE_SIZE, RING_BUFFER,-;;; Move # calculated from buffer
X`009`009`009BUF_2`009`009`009;;; Move to mailbox write buffer
X`009`009POPR`009#`094M<R0,R1,R2,R3,R4,R5>`009;;; Restore regs
X`009`009JSB`009G`094EXE$FORK`009`009;;; Fork down
X`009`009`009`009`009`009;;; Return to caller at DIPL
X;+
X;`009Following executed at FIPL (IPL 6) whenever things get
X;`009around to it
X;-
X`009`009PUSHR`009#`094M<R0,R1,R2,R3,R4,R5>`009; Save registers
X`009`009MOVAL`009BUF_2, R4`009`009; Address of buffer
X`009`009MOVL`009WRITE_SIZE, R3`009`009; Size of buffer
X`009`009MOVL`009MBX_UCB, R5`009`009; Get UCB Pointer
X`009`009JSB`009G`094EXE$WRTMAILBOX`009; Write to mailbox
X`009`009POPR`009#`094M<R0,R1,R2,R3,R4,R5>`009; Restore registers
X`009`009INSQUE`009(R5), @FKB_LIST+4`009; Insert back onto queue
X10$:`009`009RSB`009`009`009`009; All done
X`012`009`009.SBTTL`009RESET - Reset terminal UCB
X`009`009.ENTRY`009RESET,`094M<R2>
X`009`009MOVL`009TERM_UCB, R2`009`009; Point to terminal UCB
X`009`009BEQL`00910$`009`009`009; Skip if UCB gone
X`009DEVICELOCK -
X`009`009LOCKADDR=UCB$L_DLCK(R2),-
X`009`009SAVIPL=-(SP)
X`009`009TSTL`009SAVED_PORT`009`009;;; Is there a saved port vector
X`009`009BEQL`0091$`009`009`009;;; Skip if not there
X`009`009MOVL`009SAVED_PORT,-`009`009;;; Restore port pointer
X`009`009`009UCB$L_TT_PORT(R2)`009;;;   back to driver
X1$:`009`009TSTL`009SAVED_CLASS`009`009;;; Test saved class address
X`009`009BEQL`0092$`009`009`009;;; Skip null restores
X`009`009MOVL`009SAVED_CLASS,-`009`009;;; Restore class pointer
X`009`009`009UCB$L_TT_CLASS(R2)`009;;;   back to driver
X2$:`009`009TSTL`009CLASS_GETNXT_VEC`009;;; Test for null
X`009`009BEQL`0093$`009`009`009;;; Skip nulls
X`009`009MOVL`009CLASS_GETNXT_VEC,-`009;;; Restore UCB
X`009`009`009UCB$L_TT_GETNXT(R2)`009;;;  getnxt pointer
X3$:`009`009TSTL`009CLASS_PUTNXT_VEC`009;;; Test for null
X`009`009BEQL`0094$`009`009`009;;; Skip if null
X`009`009MOVL`009CLASS_PUTNXT_VEC,-`009;;;  putnxt pointer
X`009`009`009UCB$L_TT_PUTNXT(R2)`009;;;
X4$:`009`009
X`009DEVICEUNLOCK -
X`009`009LOCKADDR=UCB$L_DLCK(R2),-
X`009`009NEWIPL=(SP)+,-
X`009`009CONDITION=RESTORE,-
X`009`009PRESERVE=YES
X
X`009`009CLRL`009TERM_UCB`009`009; Clear UCB pointer
X`009`009MOVL`009#SS$_NORMAL, R0`009`009; All OK!
X10$:`009`009RET`009`009`009`009; All done so far
X`012
X`009`009.SBTTL`009FREE_POOL - Free nonpaged pool block
X`009`009.ENTRY`009FREE_POOL,`094M<R2,R3>
X`009`009DSBINT`009#IPL$_ASTDEL`009`009; Lock out delivery of asts
X`009`009MOVL`009CODE_PTR, R0`009`009; Point to code
X`009`009JSB`009G`094EXE$DEANONPAGED`009; Deallocate it
X`009`009ENBINT
X`009`009RET`009`009
X`012
X`009`009.SBTTL FLUSH_RING - Kernel routine to flush ring buffer
X`009`009.ENTRY`009FLUSH_RING, `094M<R2,R3,R4,R5>
X`009`009MOVL`009#SS$_HANGUP, R0`009`009; Assume hung up
X`009`009TSTL`009TERM_UCB`009`009; UCB There?
X`009`009BEQL`00910$`009`009`009; Nope, quit now.
X`009`009DSBINT`009#21`009`009`009;; Lock down interrupts
X`009`009BSBW`009DUMP_BUFFER`009`009;;; Dump the buffer
X`009`009ENBINT`009`009`009`009;;; Re-enable interrupts
X`009`009MOVL`009#SS$_NORMAL, R0`009`009; It's OK...
X10$:`009`009RET`009`009`009`009; And return
X`012
X`009`009.SBTTL`009SEND_IT - Send a character routine
XSEND_IT:`009MOVL`009#SS$_HANGUP, R0`009`009; Assume hung up
X`009`009MOVL`009TERM_UCB, R5`009`009; Get UCB pointer
X`009`009BEQL`00930$`009`009`009; Quit if none
X`009`009MOVL`0094(AP), R3`009`009; Get character
X`009DEVICELOCK -
X`009`009LOCKADDR=UCB$L_DLCK(R5),-
X`009`009SAVIPL=-(SP)
X`009`009JSB`009@CLASS_PUTNXT_VEC`009;;; Call putnext routine
X`009`009TSTB`009UCB$B_TT_OUTYPE(R5)`009;;; Check output type
X`009`009BEQL`00910$`009`009`009;;; None to do
X`009`009BSBW`009GRAB_STARTIO`009`009;;; Call the start I/O routine
X10$:`009`009
X`009DEVICEUNLOCK -
X`009`009LOCKADDR=UCB$L_DLCK(R5),-
X`009`009NEWIPL=(SP)+,-
X`009`009CONDITION=RESTORE,-
X`009`009PRESERVE=YES
X
X`009`009MOVL`009#SS$_NORMAL, R0`009`009; Normal exit
X30$:`009`009RSB`009`009`009`009; Done!
X
X`009`009KERN_SIZE = .-KERNEL_CODE`009; Size of code to load
X`009`009.END`009WATCH
$ CALL UNPACK WATCH.MAR;2 239612267
$ v=f$verify(v)
$ EXIT


