{"id":409,"date":"2012-01-16T17:20:41","date_gmt":"2012-01-16T23:20:41","guid":{"rendered":"http:\/\/tommysprinkle.com\/txxos\/?p=409"},"modified":"2021-04-17T18:20:52","modified_gmt":"2021-04-17T23:20:52","slug":"txxsio-schedule-io-request","status":"publish","type":"post","link":"https:\/\/tommysprinkle.com\/txxos\/?p=409","title":{"rendered":"TXXSIO &#8211; Schedule I\/O Request"},"content":{"rendered":"<p>This is the routine that schedules I\/O requests. \u00a0The request is passed in the form of an IORB. \u00a0If the device is available a Start I\/O command is issued. \u00a0If the device is busy the IORB is placed on the UCB IORB queue to be scheduled when the device becomes available.<\/p>\n<pre>000000                               15 TXXSIO   CSECT , \r\n000000 900F 102C      0002C          16          STM   R0,R15,IORBWORK-@IORB(R1)   SAVE CALLER'S REGS\r\n000004 18CF                          17          LR    R12,R15            R12 IS BASE REG\r\n                            00000    18          USING TXXSIO,R12\r\n                                     19 * \r\n000006 18B1                          20          LR    R11,R1             COPY IORB ADDRESS\r\n                            00000    21          USING @IORB,R11\r\n                                     22 *  \r\n000008 5840 B004      00004          23          L     R4,IORBUCB         GET UCB ADDRESS \r\n                            00000    24          USING @UCB,R4 \r\n                                     25 * \r\n00000C 9101 B020      00020          26          TM    IORBFLAG,IORBOFLN  SECHEDULE TO OFFLINE DEVICE \r\n000010 4710 C01C      0001C          27          BO    SIO005               YES - SKIP UCB CHECK\r\n                                     28 *\r\n000014 9180 4007      00007          29          TM    UCBSTAT,UCBSONLN   DEVICE ONLINE?  \r\n000018 47E0 C070      00070          30          BNO   SIO030               NO - CAN'T SCHEDULE I\/O \r\n                                     31 *\r\n00001C                               32 SIO005   DS    0H<\/pre>\n<p>To begin the IORB address passed in Register 1 is saved into R11. \u00a0A check is made to see if this I\/O request should be scheduled to an offline UCB. \u00a0If not a check is made to see if the device is online. \u00a0If the device is offline the I\/O request is rejected.<\/p>\n<pre>00001C D703 B000 B000 00000 00000 \u00a0 \u00a033 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0XC \u00a0 \u00a0IORBNEXT,IORBNEXT \u00a0ZERO FWD POINTER\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a034 *\r\n000022 5820 400C \u00a0 \u00a0 \u00a00000C \u00a0 \u00a0 \u00a0 \u00a0 \u00a035 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0L \u00a0 \u00a0 R2,UCBIOB \u00a0 \u00a0 \u00a0 \u00a0 \u00a0IORB CHAIN HEAD\u00a0\r\n000026 1222 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a036 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LTR \u00a0 R2,R2 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0ANY QUEUED I\/O REQUESTS\r\n000028 4780 C042 \u00a0 \u00a0 \u00a000042 \u00a0 \u00a0 \u00a0 \u00a0 \u00a037 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0BZ \u00a0 \u00a0SIO020 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 NO - GO ISSUE I\/O\u00a0\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a038 *\r\n00002C 1832 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a039 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LR \u00a0 \u00a0R3,R2 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0FIRST IORB\r\n00002E \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 40 SIO010 \u00a0 DS \u00a0 \u00a00H\r\n00002E 1823 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a041 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LR \u00a0 \u00a0R2,R3 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0COPY IORB ADDRESS\r\n000030 5830 2000 \u00a0 \u00a0 \u00a000000 \u00a0 \u00a0 \u00a0 \u00a0 \u00a042 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0L \u00a0 \u00a0 R3,IORBNEXT-@IORB(,R2) \u00a0 NEXT IORB ON CHAIN\u00a0\r\n000034 1233 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a043 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0LTR \u00a0 R3,R3 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0END OF CHAIN\u00a0\r\n000036 4770 C02E \u00a0 \u00a0 \u00a00002E \u00a0 \u00a0 \u00a0 \u00a0 \u00a044 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0BNZ \u00a0 SIO010 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 NO - LOOP BACK\r\n\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a045 *\r\n00003A 50B0 2000 \u00a0 \u00a0 \u00a000000 \u00a0 \u00a0 \u00a0 \u00a0 \u00a046 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0ST \u00a0 \u00a0R11,0(,R2) \u00a0 \u00a0 \u00a0 \u00a0 ADD TO CHAIN\r\n\f00003E 47F0 C068 \u00a0 \u00a0 \u00a000068 \u00a0 \u00a0 \u00a0 \u00a0 \u00a047 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0B \u00a0 \u00a0 SIOXT \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0AND EXIT<\/pre>\n<p>Next a check is done to see if any I\/O requests are currently queued to the UCB. \u00a0If the queue is empty we branch to issue the SIO to the device. \u00a0If there are any IORB&#8217;s on the UCB queue this IORB is placed at the end of the list.<\/p>\n<pre>000042                               50 SIO020   DS    0H\r\n000042 50B0 400C      0000C          51          ST    R11,UCBIOB         CHAIN IORB ONTO UCB\r\n000046 5810 B00C      0000C          52          L     R1,IORBCCW         CCW ADDRESS\r\n00004A 5010 0048      00048          53          ST    R1,CAW-@LOWCORE    SAVE INTO CAW\r\n00004E 1F11                          54          SLR   R1,R1 \r\n000050 BF13 4004      00004          55          ICM   R1,B'0011',UCBCUA  DEVICE ADDRESS\r\n000054 9C00 1000      00000          56          SIO   0(R1)              START I\/O \r\n000058 4780 C068      00068          57          BC    8,SIOXT             CC=0 SIO ACCEPTED \r\n00005C 4740 C07A      0007A          58          BC    4,SIO040            CC=1 CCW STORED\r\n000060 4720 C092      00092          59          BC    2,SIO060            CC=2 BUSY \r\n000064 4710 C08A      0008A          60          BC    1,SIO050            CC=1 NOT-OPERATIONAL<\/pre>\n<p>The IORB is queued to the UCB as the active request (top IORB). \u00a0The CCW address from the IORB is copied to the CAW and a SIO is issued to the device. \u00a0A return code is then set depending on the Condition Code set by the SIO.<\/p>\n<pre>000068                               62 SIOXT    DS    0H\r\n000068 980E B02C      0002C          63          LM    R0,R14,IORBWORK    RESTORE CALLER'S REGS\r\n00006C 1FFF                          64          SLR   R15,R15            SET RC\r\n00006E 07FE                          65          BR    R14                RETURN TO CALLER\r\n                                     66 *\r\n000070                               68 SIO030   DS   0H \r\n000070 980E B02C      0002C          69          LM   R0,R14,IORBWORK     RESTORE CALLER'S REGS\r\n000074 41F0 000C      0000C          70          LA   R15,12              DEVICE OFFLINE\r\n000078 07FE                          71          BR   R14                 RETURN TO CALLER \r\n                                     72 *\r\n00007A                               74 SIO040   DS   0H \r\n00007A D207 B024 0040 00024 00040    75          MVC  IORBCSW,CSW-@LOWCORE  COPY CSW \r\n000080 980E B02C      0002C          76          LM   R0,R14,IORBWORK     RESTORE CALLER'S REGS\r\n000084 41F0 0008      00008          77          LA   R15,8               CSW STORED\r\n000088 07FE                          78          BR   R14                 RETURN TO CALLER\r\n                                     79 * \r\n00008A                               81 SIO050   DS   0H \r\n00008A 947F 4007      00007          82          NI   UCBSTAT,X'FF'-UCBSONLN  TAKE UCB OFFLINE \r\n00008E 47F0 C070      00070          83          B    SIO030              DEVICE OFFLINE \r\n                                     84 *\r\n000092                               86 SIO060   DS   0H\r\n000092 980E B02C      0002C          87          LM   R0,R14,IORBWORK     RESTORE CALLER'S REGS\r\n000096 41F0 0010      00010          88          LA   R15,16              DEVICE BUSY\r\n00009A 07FE                          89          BR   R14                 RETURN TO CALLER<\/pre>\n<p>Here the caller&#8217;s registers are restored and and the appropriate return code is set in Register 15 based on the SIO condition code. \u00a0If Condition Code 4 was returned indicating a CSW was stored the CSW is copied into the IORB. \u00a0If Condition Code 1was returned indicating the device is not operational the device is marked offline.<\/p>\n<p>[Next &#8211; ]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is the routine that schedules I\/O requests. \u00a0The request is passed in the form of an IORB. \u00a0If the device is available a Start I\/O command is issued. \u00a0If the device is busy the IORB is placed on the &hellip; <a href=\"https:\/\/tommysprinkle.com\/txxos\/?p=409\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"template-page-builder-no-sidebar.php","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-409","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p1CPQT-6B","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/409","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=409"}],"version-history":[{"count":1,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/409\/revisions"}],"predecessor-version":[{"id":410,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=\/wp\/v2\/posts\/409\/revisions\/410"}],"wp:attachment":[{"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=409"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=409"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tommysprinkle.com\/txxos\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=409"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}