;-- ; Copyright © 1994 by Brian Schenkenberger. All rights reserved. ; ------------------------- ; This software is provided "as is" and is supplied for informational purpose ; only. No warranty is expressed or implied and no liability can be accepted ; for any actions or circumstances incurred from the use of this software or ; from the information contained herein. The author makes no claim as to the ; suitablility or fitness of the software or information contained herein for ; a particular purpose. ; ------------------------- ; This software may be copied and distributed only with the inclusion of this ; copyright notice. ;-- ; Modified: 12-AUG-1994 ; Added code to find the terminal name if called in a subprocess. ; ; Modified: 10-SEP-1994 ; Added code which uses the DCL$ATTACH_ logicals as a way to ; determine the active interactive process in the job tree. This ; code is added so that the CTRLV OOB AST routine is completed in ; the active process only thus, the OOB AST can be unique to each ; subprocess. It is checked in this manner due to the way an OOB ; AST is processed in several of DEC terminal drivers. Certain ; terminal drivers clear the field UCB$L_TL_CTLPID which is used ; by SCH$DELAST to deliver the AST to the process controlling the ; terminal. This check only works on OpenVMS V5.5 or higher. ;-- .TITLE CTRLV_AST ; this is the AST shareable image routine ; which accompanies the P1 pool load demo .IDENT /V2.4%253/ ;++ ; This routine contains the code which is to be loaded into P1 virtual ; address space to eventually become the AST routine for the CTRL-Verify ; OOB (out-of-band) AST. ;-- .LIBRARY "SYS$LIBRARY:LIB" .LINK "SYS$SYSTEM:SYS.STB"/SE ; (/SYSEXE on Alpha) .LINK "SYS$SYSTEM:DCLDEF.STB"/SE ; use .OPT on Alpha ;++ ; Determine the target architecture ;-- .ntype ...on_alpha...,R31 .iif eq,<...on_alpha...@-4&^xF>-5, alpha=0 .iif df,alpha, .disable flagging ;++ ; Include file definitions ;-- $IODEF ; $QIO function codes and modifiers $LNMDEF ; logical name service definitions $PCBDEF ; process control block definitions ;++ ; Program data section ;-- .PSECT DATA,WRT,EXE,5 ASTRTN: .ADDRESS KEY_AST ;- routine entry point vector INIRTN: .ADDRESS INITRTN ;/ V$OFF: .QUAD 0 V$ON: .QUAD 0 LNMSTR: .ASCID /DCL$ATTACH_!XL45678/ .ALIGN LONG LNMTBL: .ASCID /LNM$JOB/ .ALIGN LONG ;++ ; Program code section ;-- .if df alpha ; if on alpha, create a .LINKAGE_PSECT LINK ; linkage sect called link .PSECT LINK,WRT,EXE,5 ; set attributes like code .endc .PSECT ZCODE,WRT,EXE,5 .ENTRY KEY_AST,0 $TRNLNM_S TABNAM=LNMTBL,- ; is this logical defined LOGNAM=LNMSTR ; in the job table BLBC R0,10$ ; continue if not defined RET ; don't toggle process 10$: MOVL @#CTL$AG_CLIDATA+PPD$L_PRC,R0 ; get base of PPD area XORW #PRC_M_VERIFY,PRC_W_FLAGS(R0) ; toggle flag's verify bit BBS #PRC_V_VERIFY,PRC_W_FLAGS(R0),20$ ; which message? MOVAB V$OFF,R1 ; address of "verify off" message BRB 30$ ; branch to common output routine 20$: MOVAB V$ON,R1 ; address of "verify on" message 30$: OUTPUT_FUNCT = ; refresh read ops $QIOW_S CHAN = PRC_W_INPCHAN(R0),- ; use DCL's channel FUNC = #OUTPUT_FUNCT,- ; unfmt brkthru wrt P1=@4(R1),P2=(R1) ; buffer and length RET ;++ ; Initialization routine to build the DCL$ATTACH_ logical name for ; the process loading CTRL-Verify. ;-- .ALIGN LONG .ENTRY INITRTN,0 MOVL @#CTL$GL_PCB,R0 ; get this process's PCB $FAO_S CTRSTR=LNMSTR,- ; format the process PID OUTBUF=LNMSTR,- ; into the logical name OUTLEN=LNMSTR,- ; DCL$ATTACH_ P1=PCB$L_EPID(R0) RET .END