GDSX (Extended General Device Support) Manual
Design and Development
Extended General Device Support (GDSX) Manual—529931-001
2-101
The LINE^HANDLER Procedure
request’s IOCB. Next, a test is made to determine if this is a WRITE (or WRITEREAD)
request. If it is a WRITE, a call is made to INSERT^WRITE^QUEUE; otherwise,
READ^DEVICE is called.
INSERT^WRITE^QUEUE determines whether the write queue is empty. If the queue
is empty, INSERT^WRITE^QUEUE calls CHECK^HALT^POLL. CHECK^HALT^POLL
maintains a flag named polled^halting in LINE^HANDLER’s locals. If poll^halting is
false and the line is currently polling, a call to HALTPOLL is made, and poll^halting is
set to one. This is necessary because continuous polling is used on the multipoint line.
The only purpose for passing a DCB to CHECK^HALT^POLL is to be able to trace the
select index of the subdevice that necessitated stopping polling. The design strategy is
to favor WRITE operations over READs so that if there are any DCBs in the write
queue, no polling is done (the poll may be halting, however). Next, the DCB for the
current request is linked into the WRITE^QUEUE.
Rather than maintain a list of reading subdevices, a count (readers) of subdevices
whose current request is a READ is maintained. READ^DEVICE increments this count
and calls CHANGELIST to enable polling of this terminal.
After a request has been processed, there is a call to END^WRITE^REQUEST or
END^READ^REQUEST as appropriate.
END^WRITE^REQUEST deletes from the write queue the DCB for the device just
written and calls END^REQUEST. END^READ^REQUEST calls END^REQUEST,
decrements readers, and calls CHANGELIST to disable polling of the device.
END^REQUEST determines whether the passed IOCB is the current request for its
DCB. If it is, END^REQUEST sets dcb.iocbaddr to zero. After setting up iocb.err (if
appropriate), END^REQUEST posts this error for the STATUS SU command in SCF.
Finally, END^REQUEST calls NOTIFY^IO^COMPLETION to complete the
DEVICE^HANDLER task’s I/O operation.
Request cancellation is handled in two steps. Recall that when a cancel event occurs,
the main loop calls CANCEL^REQUESTS. This subprocedure sets the flag
cancel^seen and halts polling. No further action is taken at this time so that there is no
concern about what the state machine is doing with a request when its IOCB is
deallocated. The next time the line is idle, there is a call to subprocedure
CHECK^CANCELS, which finds cancel^seen set and scans all of the line’s active
DCBs checking IOCBs for cancellation.
The line state machine defines six line states, as follows:
Line State Description
0 - line^closed The line is logically closed. This is the initial line state.
1 - line^idle The line is logically up with no current line activity.
2 - line^polling A read is currently posted on the line.
3 - line^writing A write operation is currently posted on the line.
4 - line^readeot A continuation read is posted on the line.
5 - line^resetting A CONTROL 13 is posted on the line.