.TITLE SETTMBU .IDENT \ISUQUOTA 2.9\ ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; THIS ROUTINE SETS A TERMINATION MAILBOX FOR A GIVEN PROCESS, AND RETURNS THE ; PREVIOUS CONTENTS OF THE TMBU FIELD. THE ROUTINE RUNS IN KERNEL MODE AND IS ; INVOKED BY: ; $CMKRNL_S SETTMBU,ARGS_SETTMBU ; WHERE ; SETTMBU - ROUTINE NAME ; ARGS_SETTMBU - CALLG TYPE ARGUMENT LIST CONTAINING: ; .LONG 3 ; .LONG PID ; .LONG TMBU ; .LONG PRVTMBU ; ; WHERE ; PID - PROCESS ID FOR PROCESS WHICH IS TO HAVE TMBU SET ; INPUT. LONGWORD. ; TMBU - TERMINATION MAILBOX UNIT TO BE SET ; INPUT. WORD. ; PRVTMBU - PREVIOUS CONTENTS OF TMBU FIELD ; OUTPUT. WORD. ; ; THE FOLLOWING TWO DCL COMMANDS ILLUSTRATE ASSEMBLING THE ROUTINE AND THEN ; LINKING IT WITH A CALLING ROUTINE (MAIN): ; ; $ MACRO SETTMBU+SYS$LIBRARY:LIB/LIB ; $ LINK MAIN,SETTMBU,SYS$SYSTEM:SYS/SELECTIVE_SEARCH ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; .PAGE .SBTTL SYSTEM MACROS $IPLDEF $PCBDEF $PRDEF $SSDEF .PAGE .SBTTL CODE .PSECT CODE,RD,NOWRT,EXE .ENTRY SETTMBU,^M MOVL #SS$_NORMAL,R0 ; INIT SUCCESS RETURN CODE TSTB RET_SETTMBU ; NO PFLT AT ELEVATED IPL MOVL @4(AP),R10 ; PID MOVW @8(AP),R9 ; TMBU MOVZWL R10,R6 ; PROCESS SLOT NUMBER MOVL @SCH$GL_PCBVEC[R6],R11 ; ADR PCB DSBINT #IPL$_SYNCH ; DISABLE INTERRUPTS CMPL R10,PCB$L_PID(R11) ; VERIFY CORRECT PROCESS BEQL 10$ CLRL R0 ; ERROR RETURN CODE BRB 20$ 10$: CMPW PCB$W_TMBU(R11),R9 ; NO CHANGE IF PREVIOUS TMBU BNEQ 15$ ; SAME AS NEW TMBU CLRL R8 ; NULL PREVIOUS TMBU BRB 20$ 15$: MOVW PCB$W_TMBU(R11),R8 ; CURRENT TMBU MOVW R9,PCB$W_TMBU(R11) ; NEW TMBU 20$: ENBINT ; RE-ENABLE INTERRUPTS MOVW R8,@12(AP) ; RETURN PREVIOUS TMBU RET_SETTMBU: RET .END