Nick de Smith, 09-Mar-88 AST notes: AST type Call IPL ACB deallocated ACB$B_MODE AST address/parameter -------------- ---- --- --------------- ---------- --------------------- Special KERNEL JSB IPL$_ASTDEL(3) No (1) ACB$V_KAST (5) ACB$L_KAST n/a Piggy-Back-KAST (6) JSB IPL$_ASTDEL(4) No (1) ACB$V_PKAST ACB$L_KAST n/a KERNEL,SUPER,EXEC,USER CALLG 0 Yes (1) (2) PSL$C_USER etc. ACB$L_AST / ACB$L_ASTPRM (call mechanism/parameters as per $DCLAST) Notes: (1) Where the ACB is not deallocated by the system, it is the responsibility of the AST routine to free it, otherwise non-paged pool will be consumed. Note that you can read most system data areas from EXEC mode, but you can't write to them. Therefore you can only deallocate an ACB at KERNEL mode. (2) The ACB is deallocated before the AST routine is called unless ACB$V_PKAST or ACB$V_NODELETE was set in ACB$B_MODE, in which case it is the ASTs responsibility to deallocate the ACB (see (1) above). (3) Special KERNEL mode ASTs can drop and raise IPL as the calling routine (SCH$ASTDEL) resets it for you. (4) PKASTs can drop and raise IPL, but must exit with IPL$_ASTDEL. (5) If ACB$V_KAST is set, only a special KERNEL mode AST will be delivered. No other bits in ACB$B_MODE are used. (6) PKASTs are called before the associated "normal" AST. There must be both an ACB$L_KAST and a ACB$L_AST address specified if ACB$V_PKAST is set. To queue an AST to another process: movl #ACB$K_LENGTH, r1 ; Set size of ACB jsb g^EXE$ALONONPAGED ; Allocate nonpaged pool space for normal ACB movl r2, r5 ; R5 => New ACB movb #DYN$C_ACB, ACB$B_TYPE(r5) ; Say block is an ACB movw r1, ACB$W_SIZE(r5) ; Store size of structure movl #, ACB$L_PID(r5) ; Store IPID of target process (could be our IPID) movb #, ACB$B_RMOD(r5) ; Store type of AST in ACB movab , ACB$L_xAST(r5) ; Set the AST address movl #PRI$_xxx, r2 ; SCH$QAST needs priority boost in R2 jsb g^SCH$QAST ; Queue the AST This piece of code is simplistic. It would probably work in some/most situations. There again, it will crash your system in some situations too! See K_AST.MAR for a better (definitive?) treatment. [end]