.TITLE SETUNAME_SUB .IDENT /01.0/ ; ; This module has all the macro modules which support the BECOME program ; ; Revision history: ; ; V1.0 20-Aug-1989 ; Stolen from WEW's BECOME ; ; Include files: ; .LIBRARY /SYS$LIBRARY:LIB/ ; Executive macro library .LINK 'SYS$SYSTEM:SYS.STB'/SELECTIVE_SEARCH $PCBDEF ; Process Control Block offsets $JIBDEF ; Job Information Block offsets ;------------------------------------------------------------------------------- ; ; Since this is a kernel mode routine R4 already points to the PCB ; of the current process ; .PSECT CODE RD,NOWRT,PIC,EXE,LONG .ENTRY SET_UIC ^M<> ; Routine entry point $CMKRNL_S ROUTIN=10$, - ; Kick into kernel ARGLST=(AP) ; & pass along the argument list RET ; back to the Pascal mainline 10$: .WORD 0 ; Kernel entry point MOVAL HANDLER ,(FP) ; Establish anti-crashing handler MOVL @4(AP),PCB$L_UIC(R4) ; Stuff the new UIC MOVZBL #SS$_NORMAL, R0 ; Set success RET ; from kernel ;------------------------------------------------------------------------------- .ENTRY SET_USERNAME ^M ; Routine entry point $CMKRNL_S ROUTIN=10$, - ; Kick into kernel ARGLST=(AP) ; & pass along the argument list RET ; back to the Pascal mainline 10$: .WORD 0 ; Kernel entry point MOVAL HANDLER, (FP) ; Establish anti-crashing handler MOVL PCB$L_JIB(R4),R0 ; Get JIB address MOVC3 #JIB$S_USERNAME,@4(AP),-; Copy the username JIB$T_USERNAME(R0) ; into the JIB MOVC3 #JIB$S_USERNAME,@4(AP),-; Copy the username G^CTL$T_USERNAME ; into the CTL region MOVZBL #SS$_NORMAL, R0 ; Set success RET ; from kernel ;------------------------------------------------------------------------------- .PSECT COND_HANDLER RD,NOWRT,PIC,EXE,LONG .ENTRY HANDLER ^M<> ; ; First get the mutex count out of our PCB to see if we should ; release the I/O sub-system before exiting ; MOVL G^CTL$GL_PCB, R4 ; Get our current PCB TSTW PCB$W_MTXCNT(R4) ; Any mutex's held ? BEQL 10$ ; Branch if nope... JSB G^LNM$UNLOCK ; Release our mutex SETIPL #0 ; Drop our IPL to zero 10$: $EXIT_S ; Cause process to exit .END