GDSX (Extended General Device Support) Manual
Design and Development
Extended General Device Support (GDSX) Manual—529931-001
2-99
USER^STOP
Opens are associated with devices by the simple expediency of assigning an openid
equal to the address of the associated DCB. Consequently, the procedure
USER^START merely sets openid to @DCB, clears dcb.link and dcb.iocbaddr, and
returns.
USER^STOP
The procedure USER^STOP must be able to handle the termination of both
LINE^HANDLER tasks and DEVICE^HANDLER tasks; the subprocedures STOP^LINE
and STOP^DEVICE^HANDLER handle these cases.
STOP^LINE does the following:
Initializes the local variable lineno from the task’s TCB state word. This is the line for
which the terminating task was the handler.
1. Initializes the local STRUCT pointer line to point to linetbl[lineno].
2. Scans the DCB table looking for active terminals on line LINENO. When one is
found, the first link word in the DCB is set to zero; this is done so that when the line
is restarted, attempts to insert the DCB on a linked list will not fail.
Also cleared is dcb.iocbaddr. This is done to prevent hanging up terminals on the
line that are also stopping (see STOP^DEVICE^HANDLER below).
3. The state word in the line table entry for the line being downed is set to zero.
STOP^DEVICE^HANDLER simply cancels any outstanding terminal I/O. Notice that
the subprocedure waits until dcb.iocbaddr is zero before returning. This is to ensure
that the LINE^HANDLER (STOP^LINE) has processed the cancel before the task is
deleted.
Note that in the USER^STOP procedure body, the determination of which
subprocedure to call is based on whether the openid for the stopping task is equal to
-1. If it is not -1, this is a DEVICE^HANDLER task being terminated, and GDSX is
functioning as an Envoy LINE^HANDLER. As the default value of openid is -1, if the
current openid is -1, this is either a LINE^HANDLER terminating, or GDSX is not
functioning as an Envoy LINE^HANDLER. This determination is made by testing
MAXLINES, which is nonzero if GDSX is functioning as a LINE^HANDLER.
The LINE^HANDLER Procedure
The following paragraphs comprise a top-down description of LINE^HANDLER
processing:
The main body of LINE^HANDLER consists solely of a call to the subprocedure
LINE^HANDLER^BODY. LINE^HANDLER^BODY declares an IOCB pointer, the
address of which is assigned by a call to ^LISTEN.