<<< NOTED::NOTES$7:[NOTES$LIBRARY]HACKERS.NOTE;1 >>> -< ** Hackers ** >- ================================================================================ Note 1832.11 ldr$unload_image 11 of 15 UTRTSC::VDBURG "Change mode to PANIC" 116 lines 27-MAR-1997 01:40 -< SMON.MAR >- -------------------------------------------------------------------------------- .title Smon - Process state monitor .ident /V1.0/ .library 'sys$library:lib' $ipldef $tqedef $ldrimgdef $inirtndef .if df alpha $ldrdef .endc .macro return .if df alpha ret .iff rsb .endc .endm DECLARE_PSECT EXEC$INIT_CODE .if df alpha INITIALIZATION_ROUTINE NAME=SMON$INIT .iff INITIALIZATION_ROUTINE NAME=SMON$INIT,- SYSTEM_RTN=1 .endc ; ; Input: R4 = LDRIMG block ; R5 = Address of flags longword ; R0,R1,R2,R3 = scratch ; smon$init: .if df alpha .call_entry input=,- output= .endc movzwl #ss$_normal,r0 bbs #inirtn$v_called,(r5),20$ setipl #ipl$_astdel,- environ=uniprocessor ; Avoid scheduling ; ; Now allocate the TQE and queue it to the system. ; pushr #^m jsb g^exe$alloctqe ; Allocate a timer entry blbc r0,10$ ; Any errors ? movl r2,tqeadr ; ; Now setup the TQE to contain the correct parameters. ; movab action,tqe$l_fpc(r2) ; Setup the rtn address movb #tqe$c_ssrept,tqe$b_rqtype(r2) ; Make it repeatable movl r2,r5 ; Copy the TQE address movq g^exe$gq_systime,r0 ; Get current time .iif df alpha, .disable flagging movq #^D1000000,tqe$q_delta(r5) ; 10 Ms delta time .iif df alpha, .enable flagging jsb g^exe$instimq ; Insert it in the queue movab smon$unload,unlvec ; Setup address of unload routine .if ndf alpha bisl2 #inirtn$m_sysrtn,unlvec+4 .endc moval unlvec,ldrimg$l_unlvec(r4) ; Setup address of unload vector movzwl #ss$_normal,r0 10$: setipl #0,- environ=uniprocessor ; Restore IPL popr #^m 20$: blbc r0,30$ ; Stop in case of error calls #0,procinit ; Init of main code 30$: return ; Return to the caller DECLARE_PSECT EXEC$NONPAGED_CODE action: .if df alpha .call_entry .endc lock sched calls #0,procproc unlock sched return ; smon$unload: .if df alpha .call_entry output= .endc movl tqeadr,r4 jsb g^exe$rmvtimq blbc r0,10$ movl r4,r0 jsb g^exe$deanonpaged movzwl #ss$_normal,r0 10$: return DECLARE_PSECT EXEC$NONPAGED_DATA tqeadr: .long 0 ; Our TQE address unlvec: .long 0 ; Unload routine address .long 0 ; Flags .long 0 ; Termination of chain ; DECLARE_PSECT EXEC$UNL_001 ; ; .address smon$unload ; .long 0 .end