GDSX (Extended General Device Support) Manual

Design and Development
Extended General Device Support (GDSX) Manual529931-001
2-38
Linked Lists
by calling ^RESUMETRANSACTION with trans-begin-tag set to 0D. The user
task subsequently calls ^RESUMETRANSACTION with trans-begin-tag set to the
transid of the suspended transaction to change its status from pending to active.
An example of a GDSX application using the TMF pseudo procedures is given in
Appendix D, Using Pseudo Procedures in a TS/MP Environment. For more
information on TMF and the counterpart procedures of the pseudo procedures, see the
NonStop TMF Application Programmer’s Guide.
Linked Lists
TSCODE maintains a number of two-way linked lists to tie together control blocks
associated with a task, a file open, an I/O request, and so on. The linked lists have a
structure identical to that used by the operating system. TSCODE provides standard
procedures for USCODE-maintained linked lists:
INIT^[X]LIST
INSERT^[X]ITEM
DELETE^[X]ITEM
See Section 8, “Service Routines,” for detailed descriptions of these procedures.
Knowing how to follow these lists is often helpful in debugging GDSX applications.
Each list has a header and a number of items that are linked together. The header of a
linked list has two parts, header[0] and header[1]. Header[0] contains the address of
the first item in the list. If the list is empty, header[0] contains its own address.
Header[1] contains the address of the last item in the list. If the list is empty, header[1]
contains the address of header[0].
Each item in the list also has two parts, item-part[0] and item-part[1]. Item-part[0]
contains the address of the next item in the list. If this item is the last item in the list,
item-part[0] contains the address of header[0]. Item-part[1] contains the address of the
previous item in the list. If this item is the first item in the list, item-part[1] contains the
address of header[0].
For lists in global memory, the header uses two words, and each item in the list uses
two words. For lists in extended memory, the header uses two doublewords, and each
item in the list uses two doublewords.
header[0]: Address of first item in list. If list is empty, contains address of header[0].
header[1]: Address of last item in list. If list is empty, contains address of header[0].
item-part[0]: Address of next item in list. If this item is last in list, contains address of
header[0].
item-part[1]: Address of previous item in list. If this item is first in list, contains address of
header[0].