.TITLE SYMDYNUNL ; unload SYMBOL$AST_LEI from memory .IDENT "SYMBOL v3%4.091" ; internals demo program... ;++ ; This routine unloads the Loadable Executive Image (LEI) SYMBOL$AST_LEI ; which contains the AST routines used by SYMBOL. The SYMBOL AST routines ; are maintained in a LEI to provide for a common mechanism for supporting ; SYMBOL on OpenVMS/VAX and OpenVMS/AXP. ; ; *** This program is intended for SYMBOL$AST_LEI development purposes. *** ;-- ; Copyright © 1993, 1994 by Brian Schenkenberger and TMESIS Consulting ; 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 this software or information contain herein for a ; particular purpose. ; ------------------------- ; This software may be copied and distributed only with the inclusion of this ; copyright notice. ;-- ; Modifications: ; 24-FEB-1994: Created. ;-- .SBTTL DECLARATIONS .LINK "SYS$SYSTEM:SYS.STB"/SE .LIBRARY "SYS$LIBRARY:LIB.MLB" ; look here during assembly $LDRIMGDEF ; LEI block definitions ;---------------------------------------------------------------------------- .NTYPE ...ON_ALPHA...,R31 .IIF EQ,<...ON_ALPHA...@-4&^XF>-5, ALPHA=0 .IIF DF,ALPHA, .DISABLE FLAGGING ;---------------------------------------------------------------------------- .SBTTL XDELTA DEBUGGER OPTIONAL BREAKPOINT MACRO ;;; XDELTA_DEBUG = 1 .MACRO XDELTA_BREAKPOINT .IIF DF,XDELTA_DEBUG, JSB G^INI$BRK .ENDM ;---------------------------------------------------------------------------- .PSECT DATA,WRT,NOEXE,LONG E_ARGS: .LONG 2 .ADDRESS SYMBOL$AST_LEI ; loadable image name .ADDRESS LEI_ADR ; adr of cell for LEI base LEI_ADR:.BLKL 3 ;123456789012345678901234567890123456789 SYMBOL$AST_LEI: .ASCID /SYS$LOADABLE_IMAGES:SYMBOL$AST_LEI.EXE/ FMT: .ASCID "Unload SYMBOL$AST_LEI at !XL!/"- " !XL!/"- " !XL" OUT: .ASCID " "- " "- " " ;---------------------------------------------------------------------------- .PSECT $$CODE_RO,PIC,GBL,SHR,NOWRT,EXE,LONG .ENTRY SYMUNLOADER,^M<> $CMKRNL_S ROUTIN=GET_UNLOAD_DATA,- ARGLST=E_ARGS BLBS R0,10$ RET 10$: $FAO_S CTRSTR=FMT,OUTLEN=OUT,OUTBUF=OUT,- P1=LEI_ADR,P2=LEI_ADR+4,P3=LEI_ADR+8 BLBS R0,20$ RET 20$: PUSHAB OUT CALLS #1,G^LIB$PUT_OUTPUT BLBS R0,30$ RET 30$: $CMKRNL_S ROUTIN=G^LDR$UNLOAD_IMAGE,- ; try to unload ARGLST=E_ARGS ; SYMDELSET_LEI RET ;++ ; Rebuild the loader handle for SYMBOL$AST_LEI. Handle is passed to ; LDR$UNLOAD_IMAGE to unload the executive image. ;-- .ENTRY GET_UNLOAD_DATA,0 .IF DF ALPHA MOVAL G^EXE$GQ_BASIMGMTX,R0 ; get adr of QW base image mutex MOVL G^CTL$GL_PCB,R4 ; get our PCB adr JSB G^SCH$LOCKR_QUAD ; lock the QW mutex .IF_FALSE MOVAL G^EXE$GL_BASIMGMTX,R0 ; get adr of base image mutex MOVL G^CTL$GL_PCB,R4 ; get our PCB adr JSB G^SCH$LOCKR ; lock the mutex .ENDC MOVQ @4(AP),R6 ; move SYMBOL_LEI descr to R6:R7 MOVAB @#LDR$GQ_IMAGE_LIST,R4 ; get loadable image listhead address MOVL R4,R5 ; put in r5 so we can walk-the-list 10$: MOVL (R5),R5 ; get an entry from the list CMPL R4,R5 ; check if its the 'end-of-the-line' BEQL 20$ ; list exhausted? ('end-of-the-line') CMPB LDRIMG$B_IMGNAMLEN(R5),-; could this be the one? check if the R6 ; ==- image name is the right size BNEQU 10$ ; better luck next time around CMPC3 R6,(R7),- ; length checked out ok! now check if LDRIMG$T_IMGNAM(R5) ; ==- the image name is correct BNEQU 10$ ; better luck next time around MOVL 8(AP),R2 ; get adr of LDR handle block MOVL LDRIMG$L_BASE(R5),(R2) ; store image base MOVL R5,4(R2) ; address of LDRIMG MOVL LDRIMG$L_SEQ(R5),8(R2) ; store image load seq PUSHL #1 ; return with success. BRB 30$ 20$: PUSHL # ; return warning! non-existant page 30$: .IF DF ALPHA MOVAL G^EXE$GQ_BASIMGMTX,R0 ; get adr of QW base image mutex MOVL G^CTL$GL_PCB,R4 ; get our PCB adr JSB G^SCH$UNLOCK_QUAD ; unlock the QW mutex POPL R0 ; restore the status value .IF_FALSE MOVAL G^EXE$GL_BASIMGMTX,R0 ; get adr of base image mutex MOVL G^CTL$GL_PCB,R4 ; get our PCB adr JSB G^SCH$UNLOCK ; unlock the mutex POPL R0 ; restore the status value .ENDC RET .END SYMUNLOADER