This is the routine that schedules I/O requests. The request is passed in the form of an IORB. If the device is available a Start I/O command is issued. If the device is busy the IORB is placed on the UCB IORB queue to be scheduled when the device becomes available.
000000 15 TXXSIO CSECT , 000000 900F 102C 0002C 16 STM R0,R15,IORBWORK-@IORB(R1) SAVE CALLER'S REGS 000004 18CF 17 LR R12,R15 R12 IS BASE REG 00000 18 USING TXXSIO,R12 19 * 000006 18B1 20 LR R11,R1 COPY IORB ADDRESS 00000 21 USING @IORB,R11 22 * 000008 5840 B004 00004 23 L R4,IORBUCB GET UCB ADDRESS 00000 24 USING @UCB,R4 25 * 00000C 9101 B020 00020 26 TM IORBFLAG,IORBOFLN SECHEDULE TO OFFLINE DEVICE 000010 4710 C01C 0001C 27 BO SIO005 YES - SKIP UCB CHECK 28 * 000014 9180 4007 00007 29 TM UCBSTAT,UCBSONLN DEVICE ONLINE? 000018 47E0 C070 00070 30 BNO SIO030 NO - CAN'T SCHEDULE I/O 31 * 00001C 32 SIO005 DS 0H
To begin the IORB address passed in Register 1 is saved into R11. A check is made to see if this I/O request should be scheduled to an offline UCB. If not a check is made to see if the device is online. If the device is offline the I/O request is rejected.
00001C D703 B000 B000 00000 00000 33 XC IORBNEXT,IORBNEXT ZERO FWD POINTER 34 * 000022 5820 400C 0000C 35 L R2,UCBIOB IORB CHAIN HEAD 000026 1222 36 LTR R2,R2 ANY QUEUED I/O REQUESTS 000028 4780 C042 00042 37 BZ SIO020 NO - GO ISSUE I/O 38 * 00002C 1832 39 LR R3,R2 FIRST IORB 00002E 40 SIO010 DS 0H 00002E 1823 41 LR R2,R3 COPY IORB ADDRESS 000030 5830 2000 00000 42 L R3,IORBNEXT-@IORB(,R2) NEXT IORB ON CHAIN 000034 1233 43 LTR R3,R3 END OF CHAIN 000036 4770 C02E 0002E 44 BNZ SIO010 NO - LOOP BACK 45 * 00003A 50B0 2000 00000 46 ST R11,0(,R2) ADD TO CHAIN 00003E 47F0 C068 00068 47 B SIOXT AND EXIT
Next a check is done to see if any I/O requests are currently queued to the UCB. If the queue is empty we branch to issue the SIO to the device. If there are any IORB’s on the UCB queue this IORB is placed at the end of the list.
000042 50 SIO020 DS 0H 000042 50B0 400C 0000C 51 ST R11,UCBIOB CHAIN IORB ONTO UCB 000046 5810 B00C 0000C 52 L R1,IORBCCW CCW ADDRESS 00004A 5010 0048 00048 53 ST R1,CAW-@LOWCORE SAVE INTO CAW 00004E 1F11 54 SLR R1,R1 000050 BF13 4004 00004 55 ICM R1,B'0011',UCBCUA DEVICE ADDRESS 000054 9C00 1000 00000 56 SIO 0(R1) START I/O 000058 4780 C068 00068 57 BC 8,SIOXT CC=0 SIO ACCEPTED 00005C 4740 C07A 0007A 58 BC 4,SIO040 CC=1 CCW STORED 000060 4720 C092 00092 59 BC 2,SIO060 CC=2 BUSY 000064 4710 C08A 0008A 60 BC 1,SIO050 CC=1 NOT-OPERATIONAL
The IORB is queued to the UCB as the active request (top IORB). The CCW address from the IORB is copied to the CAW and a SIO is issued to the device. A return code is then set depending on the Condition Code set by the SIO.
000068 62 SIOXT DS 0H 000068 980E B02C 0002C 63 LM R0,R14,IORBWORK RESTORE CALLER'S REGS 00006C 1FFF 64 SLR R15,R15 SET RC 00006E 07FE 65 BR R14 RETURN TO CALLER 66 * 000070 68 SIO030 DS 0H 000070 980E B02C 0002C 69 LM R0,R14,IORBWORK RESTORE CALLER'S REGS 000074 41F0 000C 0000C 70 LA R15,12 DEVICE OFFLINE 000078 07FE 71 BR R14 RETURN TO CALLER 72 * 00007A 74 SIO040 DS 0H 00007A D207 B024 0040 00024 00040 75 MVC IORBCSW,CSW-@LOWCORE COPY CSW 000080 980E B02C 0002C 76 LM R0,R14,IORBWORK RESTORE CALLER'S REGS 000084 41F0 0008 00008 77 LA R15,8 CSW STORED 000088 07FE 78 BR R14 RETURN TO CALLER 79 * 00008A 81 SIO050 DS 0H 00008A 947F 4007 00007 82 NI UCBSTAT,X'FF'-UCBSONLN TAKE UCB OFFLINE 00008E 47F0 C070 00070 83 B SIO030 DEVICE OFFLINE 84 * 000092 86 SIO060 DS 0H 000092 980E B02C 0002C 87 LM R0,R14,IORBWORK RESTORE CALLER'S REGS 000096 41F0 0010 00010 88 LA R15,16 DEVICE BUSY 00009A 07FE 89 BR R14 RETURN TO CALLER
Here the caller’s registers are restored and and the appropriate return code is set in Register 15 based on the SIO condition code. If Condition Code 4 was returned indicating a CSW was stored the CSW is copied into the IORB. If Condition Code 1was returned indicating the device is not operational the device is marked offline.
[Next – ]