SVN TITLE 'DMSSVN (CMS) VM/370 - RELEASE 6' 00001000
SPACE 2 00002000
*. 00003000
* 00004000
* 00005000
*********************************************************************** 00006000
* OS SUPERVISOR SIMULATION ROUTINES 00007000
* SEVERAL ROUTINES MUST BE KEPT WITHIN THE CMS NUCLEUS 00008000
* 00009000
******************************************************************** 00010000
* 00011000
*MODULE NAME: 00012000
* 00013000
* DMSSVN (DMSSVN) 00014000
* 00015000
*FUNCTION: 00016000
* 00017000
* THE CMS DMSSVN ROUTINE PROCESSES OS WAIT AND POST 00018000
* MACROS. ALL THE OS MACRO OPTIONS ARE SUPPORTED. 00019000
* 00020000
*ATTRIBUTES: 00021000
* 00022000
* REENTRANT, SEGMENT RESIDENT 00023000
* 00024000
*ENTRY POINTS: 00025000
* 00026000
* DMSSVN1 - OS WAIT MACRO 00027000
* DMSSVN2 - OS POST MACRO 00028000
* DMSSVN93 - TSO TGET-TPUT MACRO 00029000
* DMSSVN94 - TSO TCLEARQ MACRO 00030000
* 00031000
*ENTRY CONDITIONS: 00032000
* 00033000
* MUST BE CALLED BY OS WAIT OR POST MACRO 00034000
* 00035000
*EXIT CONDITIONS: 00036000
* 00037000
* NORMAL -- CONTROL IS RETURNED TO THE USER. 00038000
* ERROR -- USER IS ABENDED IF WAIT COUNT IS LARGER THAN ECB COUNT 00039000
* 00040000
*CALLS TO OTHER ROUTINES: 00041000
* 00042000
* DMSSAB. 00043000
* 00044000
*ENTERNAL REFERENCES: 00045000
* 00046000
* NUCON 00047000
* 00048000
*TABLES/WORKAREAS: 00049000
* 00050000
* NONE 00051000
* 00052000
*REGISTER USAGE: 00053000
* 00054000
* R0-R9 WORK 00055000
* R10 OPSECT DSECT 00056000
* R11 MACSECT DSECT 00057000
* R12 DMSSVN BASE 00058000
* R13 SAVE AREA 00059000
* R14,R15 WORK 00060000
* 00061000
*NOTES: 00062000
* 00063000
* NONE 00064000
* 00065000
*OPERATION: 00066000
* 00067000
* THE DMSSVN ROUTINE HAS FOUR ENTRY POINTS: DMSSVN1,DMSSVN2, 00068000
* DMSSVN93 AND DMSSVN94. 00069000
* 00070000
* IF AN OS WAIT MACRO IS ISSUED, CONTROL IS PASSED TO THE 00071000
* DMSSVN1 ENTRY POINT IN DMSSVN. DMSSVN CHECKS TO SEE 00072000
* IF ENOUGH ECB'S ARE POSTED TO SATISFY THE ECB COUNT 00073000
* INDICATED. IF NOT, THE WAIT BITS IN THE ECB'S ARE TURNED 00074000
* ON AND SUCCESSIVE WAIT PSW'S ARE LOADED UNTIL THE WAIT 00075000
* COUNT IS SATISFIED. AFTER THE WAIT COUNT IS SATISFIED, THE 00076000
* WAIT BITS IN THE ECB'S SPECIFIED ARE TURNED OFF AND CONTROL 00077000
* IS RETURNED TO THE USER. IF THE WAIT COUNT IS LARGER THAN THE 00078000
* ECB COUNT, THE USER IS ABENDED. 00079000
* 00080000
* IF AN OS POST MACRO IS ISSUED, CONTROL IS PASSED TO THE 00081000
* DMSSVN2 ENTRY POINT IN DMSSVN. DMSSVN STORES THE 00082000
* COMPLETION CODE IN THE ECB, SETS THE COMPLETION BIT IN 00083000
* THE FIRST BYTE OF THE ECB AND RETURNS CONTROL TO THE 00084000
* USER. 00085000
* 00086000
* 00087000
* IF A TGET OR TPUT SVC IS ISSUED, CONTROL IS PASSED TO THE 00088000
* DMSSVN93 (SVC 93) ENTRY POINT IN DMSSVN. THIS ROUTINE 00089000
* CHECKS THE HIGH ORDER BIT OF USER REGISTER 1. IF IT IS ON, 00090000
* TGET HAS BEEN REQUESTED, IF OFF, THE REQUEST IS FOR TPUT. 00091000
* 00092000
* TGET STORES THE ADDRESS OF THE USER'S I/O AREA INTO THE 00093000
* 'WAITRD' PLIST, AND ISSUES A CALL TO DMSCRD VIA AN SVC. 00094000
* UPON RETURN FROM DMSCRD, THE LENGTH OF THE I/O OPERATION 00095000
* IS STORED INTO THE USER'S REGISTER SAVE AREA, AND RETURN IS MADE 00096000
* THROUGH A COMMON RETURN ROUTINE, DESCRIBED IN TPUT. 00097000
* 00098000
* TPUT STORES THE USER'S BUFFER ADDRESS AND I/O LENGTH INTO 00099000
* THE DMSCWR P-LIST AND LINKS TO DMSCWR VIA SVC. UPON RETURN, 00100000
* RETURN IS MADE AFTER CHECKING IF AN ATTENTION 00101000
* INTERUPT HAS OCCURRED DURING THE I/O OPERATION. IF IT HAS NOT, 00102000
* A RETURN CODE OF '0' IS STORED INTO THE USER'S REGISTER SAVE 00103000
* AREA,IF THE INTERUPT HAS OCCURRED A RETURN CODE OF '4' IS SET. 00104000
* 00105000
* IF A TCLEARQ SVC (SVC 94) IS ISSUED, CONTROL IS PASSED TO 00106000
* ENTRY POINT DMSSVN94 IN DMSSVN. A CHECK IS MADE TO DETERMINE 00107000
* IF THE REQUEST IS FOR INPUT OR OUTPUT BY CHECKING THE HI- 00108000
* ORDER BIT OF REGISTER 0. IF THE BIT IS OFF, THE REQUEST IS FOR 00109000
* OUTPUT. SINCE THIS OPTION IS NOT SUPPORTED, CONTROL IS RETURNED 00110000
* TO THE USER. IF THE BIT IS ON, A CALL IS MADE TO DMSCIT 00111000
* (DMSCITDB/DESBUF) TO DESTROY THE TERMINAL INPUT BUFFER VIA BALR. 00112000
* UPON RETURN, CONTROL IS RETURNED TO THE CALLER. 00113000
* 00114000
* 00115000
*. 00116000
EJECT 00117000
MACRO 00118000
&LABEL INITIAL 00119000
&LABEL DS 0H 00120000
USING *,R12 00121000
L R12,AOSSVC SET COMMON ADDRESSABILITY 00122000
USING DMSSVN,R12 00123000
BAL R5,OSINIT SET BASE REGS 00124000
MEND 00125000
DMSSVN START 0 00126000
ENTRY DMSSVN1,DMSSVN2,DMSSVN93,DMSSVN94 00127000
USING DMSSVN,R12 00128000
USING FCBSECT,R8 00129000
USING OPSECT,R10 00130000
USING NUCON,R0 00131000
USING SSAVE,R13 00132000
OSINIT DS 0H PERFORM COMMON INITIALIZATION 00133000
L R13,CURRSAVE 00134000
L R10,AOPSECT 00135000
BR R5 00136000
EJECT 00137000
********************************************************************** 00138000
DMSSVN2 INITIAL 00139000
POST EQU * 02-SIGNIFY END OF OPERATION 00140000
* C(R1) = A(ECB), C(R0) = COMPLETION CODE 00141000
ST R0,0(,R1) STORE CC IN ECN 00142000
NI 0(R1),X'7F' SET BIT 0 = 0 00143000
OI 0(R1),X'40' SET BIT 1 = 1 00144000
B CMSCLEAR 00145000
SPACE 00146000
*********************************************************************** 00147000
DMSSVN1 INITIAL 00148000
WAIT DS 0H 01 - WAIT FOR I/O COMPLETION 00149000
LISTCHK EQU * @VM08901 00151000
SSM *+1 DISABLE FOR ECB SCAN @VA07966 00151100
LTR R1,R1 ECB POINTER OR LIST POINTER? 00152000
BP ONEECB ECB POINTER. 00153000
LPR R5,R1 RESTORE LIST PTR ADDRESS, SAVE R1 @VA01924 00154000
* R0=WAIT EVENT COUNT R1=ECB LIST POINTER 00155000
LISTECB DS 0H A(ECB LIST) WAS SPECIFIED 00156000
LTR R2,R0 GET EVENT COUNT 00157000
BZ WAITEND IF ZERO, THEN RETURN 00158000
SR R3,R3 CLEAR INDEX REGISTER 00159000
LIST01 EQU * SEARCH LIST FOR POSTED ECB'S 00160000
L R4,0(R3,R5) GET A(ECB) @VA01924 00161000
LA R3,4(0,R3) ADVANCE INDEX 00162000
TM 0(R4),X'40' POSTED? 00163000
BZ LIST02 NO. CONTINUE 00164000
BCT R2,LIST02 DECREMENT TEST COUNTER 00165000
SR R3,R3 CLEAR REG 3 00166000
RESETECB L R4,0(R3,R5) GET A(ECB) @VA01924 00167000
LA R3,4(,R3) UPDATE POINTER 00168000
NI 0(R4),X'7F' TURN OFF WAIT BIT 00169000
LTR R4,R4 IS THIS LAST ECB 00170000
BNM RESETECB NO, GO GET NEXT ECB 00171000
B WAITEND YES, RETURN TO USER 00172000
LIST02 OI 0(R4),X'80' TURN ON WAIT BIT 00173000
LTR R4,R4 IS THIS LAST ECB 00174000
BNM LIST01 NO, GO GET NEXT ECB 00175000
SRL R3,2 GET COUNT OF ECBS 00176000
CR R0,R3 WAIT COUNT GREATER THAN ECB COUNT 00177000
BH WAITERR YES, THEN ABEND 00178000
OI OSSFLAGS,OSWAIT INDICATE OS WAIT @V305665 00179000
LPSW ECBPSW ENTER WAIT STATE @VM08901 00180000
WAKEUP EQU * @VM08901 00181000
L R3,AEXTSECT @VM08901 00182000
USING EXTSECT,R3 @VM08901 00183000
L R4,STIMEXIT GET 'STIMER EXIT ADD' IF ANY @VA04419 00184000
LA R4,0(R4) @VA04419 00185000
TM EXTFLAG,REALTIMR REAL TIMER BEING USED? @VA04419 00186000
BZ LISTCHK NO, THEN CONTINUE ELSEWHERE @VA05500 00187000
NI EXTFLAG,255-REALTIMR TURN OFF REAL TIMER FLAG @VA04419 00188000
CKBLIP LTR R4,R4 IS THERE AN STIMER IN EFFECT? @VA04419 00189000
BNZ RESTORE YES, THEN RESTORE THE REMAINING @VA04419 00190000
* TIME 00191000
CLI TIMCHAR,0 IS BLIP ON? @VA04419 00192000
BNE RESTORE NO, THEN RESTORE TIME @VA04419 00193000
MVC TIMINIT(4),=X'000258F6' SET 2 SECOND VALUE @VA04419 00194000
RESTORE MVC TIMER(4),TIMINIT RESET INTERVAL TIMER @VA04419 00195000
B LISTCHK AND CONTINUE @VA04419 00196000
DROP R3 @VA04419 00197000
* R1=V(SINGLE ECB) 00198000
ONEECB TM 0(R1),X'40' IS ECB POSTED? 00199000
BO WAITEND YES, COMPLETE 00200000
OI 0(R1),X'80' SET WAIT BIT ON 00201000
OI OSSFLAGS,OSWAIT INDICATE OS WAIT @V305665 00202000
LPSW ECBPSW GO TO WAIT STATE 00203000
WAITEND EQU * @V305665 00204000
NI OSSFLAGS,255-OSWAIT REMOVE WAIT INDICATOR @V305665 00205000
B CMSCLEAR @V305665 00206000
WAITERR ABEND X'101' 00207000
* 00208000
ENTRY WAKEUP ...FOR DMSCIT'S USE AFTER STAX EXIT @V2D4598 00209000
DS 0D 00210000
ECBPSW DC X'FF060000',A(WAKEUP) @VM08901 00211000
SPACE 3 @VA04603 00212000
* 00213000
* RETURN TO CMS 00214000
* 00215000
CMSCLEAR SR R15,R15 NO ERROR 00216000
CMSRET ST R15,EGPR15 SET ERROR CODE INTO SAVE 00217000
BR R14 00218000
EJECT @VA04603 00219000
PRINT GEN 00220000
*********************************************************************** 00221000
* 00222000
* TGET AND TPUT SIMULATION ROUTINE 00223000
* 00224000
*********************************************************************** 00225000
DMSSVN93 INITIAL 00226000
USING SSAVE,R13 SET UP USER REG. SAVE DSECT 00227000
NI TSOFLAGS,255-TSOATCNL RESET ATTENTION INDICATOR P3108 00228000
TM EGPR1,TPUTFLG CHECK IF REQUEST FOR TGET OR TPUT 00229000
* AS INDICATED BY HI-ORDER BIT OF REG 1 00230000
BZ TPUT IF BIT IS OFF, IT'S TPUT 00231000
TGET LA R1,CONREAD GET ADDR OF READ PLIST V0022 00232000
MVI CONRDCOD,CHARS SET OPTION TO 'NO TRANSLATE' @VA07268 00233000
SVC 202 V0022 00234000
DC AL4(*+4) V0022 00235000
MVI CONRDCOD,CHARU RESET OPTION TO UPPER CASE @VA07268 00236000
LH R2,CONRDCNT GET NO. BYTES READ V0022 00237000
LH R15,EGPR0+2 GET BYTES REQUESTED V0022 00238000
L R6,EGPR1 GET BUFFER ADDR V0022 00239000
CR R2,R15 BYTES< BYTES REQUESTED V0022 00240000
BNH SETRDCNT YES, SET READ COUNT V0022 00241000
LR R2,R15 BYTES READ= BYTES REQUESTED V0022 00242000
SETRDCNT ST R2,EGPR1 SET BYTES READ V0022 00243000
L R2,CONRDBUF GET CMS CON BUFF V0022 00244000
BCTR R15,R0 DECREMENT ONE FOR MOVE @VA04474 00245000
EX R15,MOVEBUF MOVE DATA TO USER AREA V0022 00246000
B SVC93RET RETURN TO USER V0022 00247000
TPUT MVC CONWRCNT(2),EGPR0+2 SET NO. TO BE WRITTEN V0022 00248000
MVC CONWRBUF+1(3),EGPR1+1 SET BUFFER ADDR V0022 00249000
OI CONWRCOD+1,LONGOP SET SPECIAL "LONG WRITE" BIT @VA04603 00250000
LA R1,CONWRITE GET PLIST ADDR V0022 00251000
SVC 202 V0022 00252000
DC AL4(*+4) V0022 00253000
NI CONWRCOD+1,255-LONGOP RESET LONGOP BIT @VA04603 00254000
SVC93RET EQU * V0022 00255000
LA R15,0 SET UP NORMAL RETURN 00256000
TM TSOFLAGS,TSOATCNL DID ATTENTION OCCUR DURING READP3108 00257000
BZ RCSET IF NOT EVERYTHING IS SET 00258000
LA R15,8 RETURN CODE FOR ATTENTION CONDITION P3108 00259000
RCSET EQU * 00260000
ST R15,EGPR15 SET IT UP IN USER'S SVC SAVE AREA 00261000
BR R14 BACK TO CALLER 00262000
SPACE 2 @VA04603 00263000
LONGOP EQU X'10' "LONG WRITE" BIT FOR DMSCWR (Q.V.) @VA04603 00264000
EJECT @VA04854 00265000
******************************************************************** 00266000
* TCLEARQ SIMULATION 00267000
* TCLEARQ WILL CLEAR THE TERMINAL INPUT QUEUE BY CALLING 00268000
* DESBUF , AND THEN RETURN TO THE USER 00269000
********************************************************************** 00270000
DMSSVN94 INITIAL 00271000
LR R4,R14 SAVE RETURN ADDR 00272000
LA R2,X'80' CHECK IF 'INPUT' IS SPECIFIED 00273000
CR R1,R2 IF NOT, JUST RETURN 00274000
BNE SVC94RET THROUGH COMMON RETURN 00275000
LA R14,CONSTACK RESET WRITE-STACK POINTER @V305665 00276000
ST R14,PENDWRIT @V305665 00277000
SR R3,R3 CLEAR REGISTER @V305665 00278000
STH R3,NUMPNDWR CLEAR PENDING WRITES @V305665 00279000
LH R4,NUMFINRD GET READ BUFFERS @V305665 00280000
LTR R4,R4 ARE THERE ANY? @V305665 00281000
BZ CKPENRD BRANCH IF NOT, MAYBE NO @V305665 00282000
L R5,FSTFINRD MAYBE YES @V305665 00283000
CKFINRD EQU * @V305665 00284000
LTR R1,R5 IS THERE A CHAIN? @V305665 00285000
BZ CKPENRD BRANCH IF NOT @V305665 00286000
L R5,0(,R4) GET NEXT AREA ADDRESS @V305665 00287000
TM 4(R1),ATTN IS IT AN 'ATTN' BUFFER? @V305066 00288000
BZ CKR4 BRANCH IF NOT @V305665 00289000
LA R0,SEVTEEN FREE THE BUFFER @V305066 00290000
DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR @V305665 00291000
CKR4 EQU * @V305665 00292000
BCT R4,CKFINRD LOOP IF MORE @V305665 00293000
CKPENRD EQU * @V305665 00294000
ST R3,FSTFINRD SET CONSTANTS TO ZERO @V305665 00295000
ST R3,LSTFINRD @V305665 00296000
STH R3,NUMFINRD @V305665 00297000
L R5,PENDREAD GET PENDING READ ADDRESS @V305665 00298000
LTR R1,R5 IS THERE ONE? @V305665 00299000
BZ ENDES BRANCH IF NOT @V305665 00300000
TM 4(R1),ATTN IS IT AN ATTENTION READ? @V305066 00301000
BZ ENDES BRANCH IF NOT @V305665 00302000
LA R0,SEVTEEN FREE THE BUFFER @V305066 00303000
DMSFRET DWORDS=(0),LOC=(1),TYPCALL=BALR @V305665 00304000
ENDES EQU * @V305665 00305000
ST R3,PENDREAD ZERO THIS FIELD, TOO @V305665 00306000
SVC94RET EQU * 00307000
LA R15,0 SET NORMAL RETURN CODE 00308000
ST R15,EGPR15 STORE IN USER'S SAVE AREA 00309000
LR R14,R4 RESET RETURN REG. 00310000
BR R14 RETURN TO SVCINT AND USER 00311000
EJECT 00312000
AOSSVC DC A(DMSSVN) 00313000
DS 0D 00314000
TPUTFLG EQU X'80' TPUT-TGET FLAG, IF ON, TGET REQUEST 00315000
MOVEBUF MVC 0(0,R6),0(R2) MOVE I/O READ V0022 00316000
ATTN EQU X'40' ATTENTION BUFFER/READ @V305066 00317000
SEVTEEN EQU 17 DOUBLEWORDS FREE/FRET @V305066 00318000
CHARS EQU C'S' CHARACTER 'S' @VA07268 00319000
CHARU EQU C'U' CHARACTER 'U' @VA07268 00320000
* 00321000
DCBD DSORG=(PS) 00322000
CMSCB 00323000
IO 00324000
FSTB 00325000
NUCON 00326000
CMSAVE 00327000
REGEQU 00328000
EXTSECT @VM08901 00329000
END 00330000