.TITLE NETSPA Specify user AST routine .IDENT "X1.1" .ENABL LC .NLIST BEX,CND,TOC ;+ ; Index Specify user AST routine ; ; Usage ; int lun; /* Network data mailbox LUN */ ; int efn; /* Event flag # for wait */ ; int status[2]; /* Status block */ ; {typ} cmpast(); /* Completion AST svc. routine */ ; {typ} usrast(); /* Net data arrival AST routn. */ ; int dir_stat; /* Directive status ($DSW) */ ; ; dir_stat = netspa(lun, efn, status, cmpast, usrast); ; ; Description ; ; netspa() may be called by either the client or server task to ; specify a user-written AST service routine to be executed ; whenever network data arrives in the network data queue ; mailbox. A better name for this routine might be "Specify ; Mailbox Arrival AST". ; ; If there are items already in the mailbox when this function is ; called, they do not cause an AST delivery, rather, the second ; word of the "status" block contains the number of items in the ; mailbox at the time of the call when the function returns. ; ; If it is desired to process all incoming network data messages ; at AST state, use the "completion AST" to process existing data ; and the "user AST" to handle messages arriving after the call ; to netspa(). For an example of this and other information, ; see the RSX DECnet Programmer's Reference Manual (May, 1982) ; section 2.8.13. ; ; The function returns $DSW. ; ; Notes ; ; The CX library's AST handling mechanism and functions must ; be used for AST service routines (unless you have some other ; special mechanism set up). Most notable is the fact that ; the normal C register save and restore routines do not ; preserve R0 or R1, making it impossible to use them for ; AST service. ; ; The "user AST" places no trap-dependent parameters on the ; stack, but the "completion AST" does (the usual I/O ; completion flavor). Watch out! ; ;- ; ; Edits: ; ; X1.0 27-Feb-83 RBD Initial edit ; X1.1 31-Jan-02 BQT Changed for I/D space. ; .psect c$code,i,ro .mcall spa$s NETSPA:: mov sp,r0 ; r0 --> parameter list spa$s 2(r0),4(r0),6(r0),10(r0),12(r0) mov $dsw,r0 ; Return $DSW return .end