GDSX (Extended General Device Support) Manual

User Exit Descriptions
Extended General Device Support (GDSX) Manual529931-001
9-24
USER^STOP
A call to the TSCODE STOP^TASK procedure is made from USCODE or
TSCODE.
USER^STOP allows you to handle housekeeping for associated files before TSCODE
closes them.
tcb input
INT .EXT:ref
is a pointer to the TCB for the task being stopped.
Considerations
If your GDSX process is configured with a LINE, the USER^STOP procedure must
be able to handle the termination of the LINE and the SUs under the LINE. This
coding usually requires scanning all DCBs corresponding to a LINE, which can be
accomplished by means of the BIT^TEST procedure and two bit maps maintained
in the LCB for each active or configured LINE. See AMAP and CMAP in the
line^template STRUCT in Appendix C, DCCBDECS and ULHDECSE Listings.
The CMAP array defines those SUs (DCBs) that are configured under this LINE.
The AMAP array defines those SUs under this LINE that are currently active.
These two maps are bit arrays, with bit[i] corresponding to the ith DCB, addressed
by DCBTBL[i]. See Section 5, DEVICE^HANDLER Example, Design for a
discussion of Device Control Blocks.
The BIT^TEST function is evaluated for a LINE’s CMAP array by:
BIT^TEST(CMAP, n)
This returns true if the nth bit is on, meaning that DCBTBL[n] is configured.
The BIT^TEST function is evaluated for a LINE’s AMAP array by:
BIT^TEST(AMAP, n)
This returns true if the nth bit is on, meaning that DCBTBL[n] is active.
The following example scans all terminals configured on LINE X:
INT .EXT DCB(USER^DCB^DEF); ! USER^DCB^DEF is the
! same as the DCB^TEMPLATE
! with possible user
! extensions. See ULHDECS.
INT X;
INT .CUR^LINE(LINE) := @LINETBL[X]; ! LINETBL is a
! GDSX global.
USE DEV; DEV := 0;
PROC USER^STOP ( tcb ); !
i