qdosmsq:vectors:ssq
IO_SERQ/IOU_SSQ - Vector $E8
This vector can be used in a simple device driver to deal with queues.
Call Parameters | Return Parameters |
D0.L | Trap #3 value | D0.L | Error code. |
D1.L | IOSS value. | D1.L | IOSS value. |
D2.L | IOSS value. | D2.L | IOSS value. |
D3.L | IOSS value. | D3.L | IOSS value. |
A0.L | Channel ID. | A0.L | Preserved. |
A1.L | IOSS value. | A1.L | IOSS value. |
A2.L | Unused | A2.L | Corrupted. |
A3.L | Unused | A3.L | Corrupted. |
A6.L | System variables address | A6.L | Preserved. |
Errors
ERR_BP | Wrong Trap #3 code |
ERR_NC | Queue full (for input) or empty (for output) |
Notes
All registers not shown above are not used on entry and are preserved on exit.
Must be called in supervisor mode only.
This vector can be used as the IO routine in the device driver for a queue. It makes use of
IO_SERIO with
IO_QTEST,
IO_QOUT and
IO_QIN as the three fundamental routines.
When the channel block is set, by the OPEN routine, the 7th and 8th long words must point to the queues for input and output respectively. The two pointers could be the same, of course.
It is expected that this vector will be used to provide communication between tasks. Thus one task could open a channel to the queue for entering data and a second task could open a channel to the same queue to extract data from it. Attempts to add items to a full queue or extract data from an empty one result in a Not Complete error. This causes the operating system to retry the operation until completion. Thus one task requesting data from a queue initially empty will have its request satisfied as soon as another task puts data into the queue.
The only values allowed in D0 are for the ten IOSS values shown below. Other values give the error bad parameter.
Warning 1 - In pre SMSQ/E roms this vector can work up to a point if the same task provides input to the queue and also extracts data from it. But there is trouble if a queue becomes too full for input or is empty when output is requested. In this case the error Not Complete produced by IO_SERQ causes the Trap #3 routine to be called again and again until completion - which is never.
qdosmsq/vectors/ssq.txt · Last modified: 2011/05/04 10:30 by george.gwilt