STO TITLE 'DMTSTO (RSCS) VM/370 - RELEASE 6' 00001000
*. 00002000
* MODULE NAME - 00003000
* 00004000
* DMTSTO 00005000
* 00006000
* FUNCTION - 00007000
* 00008000
* THE DMTSTO MODULE IS THE SERVICE ROUTINE WHICH 00009000
* RESERVES PAGES OF FREE MAIN STORAGE FOR USE BY 00010000
* CALLING TASK PROGRAMS. TASK PROGRAMS FREE PAGES OF 00011000
* MAIN STORAGE BY SIMPLY CLEARING TO ZERO THE 00012000
* ASSOCIATED MAP BYTE IN THE MAIN STORAGE MAP. 00013000
* 00014000
* ATTRIBUTES - 00015000
* 00016000
* REUSABLE, NON-INTERRUPTABLE 00017000
* 00018000
* ENTRY POINTS - 00019000
* 00020000
* DMTSTO - RESERVE A BLOCK OF MAIN STORAGE 00021000
* 00022000
* ENTRY CONDITIONS - 00023000
* 00024000
* GPR0 = NUMBER OF CONTIG PAGES REQUESTED (BINARY) 00025000
* GPR1 = PAGE NUMBER OF FIRST PAGE REQUESTED (BINARY) 00026000
* GPR14 = RETURN ADDRESS 00027000
* GPR15 = ENTRY ADDRESS 00028000
* 00029000
* EXIT CONDITIONS - 00030000
* 00031000
* NORMAL - 00032000
* 00033000
* GPR15 = X'00' REQUESTED PAGES NOW RESERVED 00034000
* 00035000
* ERROR - 00036000
* 00037000
* GPR15 = X'10' AT LEAST ONE REQUESTED PAGE IS 00038000
* ALREADY RESERVED 00039000
EJECT 00040000
* 00041000
* CALLS TO OTHER ROUTINES - 00042000
* 00043000
* NONE 00044000
* 00045000
* EXTERNAL REFERENCES - 00046000
* 00047000
* NONE 00048000
* 00049000
* TABLES / WORKAREAS - 00050000
* 00051000
* DMTVEC - SUPERVISOR COMMON AREA 00052000
* DMTMAP - FREE STORAGE MAP 00053000
* TASK ELEMENT 00054000
* 00055000
* REGISTER USAGE - 00056000
* 00057000
* GPR0 = NUMBER OF PAGES REQUESTED ON ENTRY 00058000
* GPR1 = PAGE NUM OF FIRST REQUESTED PAGE ON ENTRY 00059000
* GPR2 = PAGE COUNT WORK REG 00060000
* GPR3 = MAIN STORAGE MAP ENTRY POINTER 00061000
* GPR4 = TASK ELEMENT POINTER 00062000
* GPR5 = UNUSED 00063000
* GPR6 = UNUSED 00064000
* GPR7 = UNUSED 00065000
* GPR8 = UNUSED 00066000
* GPR9 = UNUSED 00067000
* GPR10 = UNUSED 00068000
* GPR11 = UNUSED 00069000
* GPR12 = UNUSED 00070000
* GPR13 = UNUSED 00071000
* GPR14 = TASK SAVE AREA POINTER 00072000
* GPR15 = ENTRY ADDRESS, DMTSTO BASE REGISTER 00073000
* 00074000
* NOTES - 00075000
* 00076000
* DMTSTO IS INTENDED TO BE USED WITH SOME TASK LEVEL 00077000
* SOFTWARE SUPPORT. IN PARTICULAR, A SIMPLE ROUTINE 00078000
* TO GET ONE OR MORE UNSPECIFIED PAGES COULD BE WRITTEN 00079000
* AS A SHARED REENTRANT ROUTINE. MORE EXOTIC AND 00080000
* COMPLEX STORAGE ALLOCATION SYSTEMS MAY BE BASED ON 00081000
* DMTSTO AND RUN AS TASK PROGRAMMING. 00082000
* 00083000
* OPERATION - 00084000
* 00085000
* ON A REQUEST FOR MAIN STORAGE RESERVATION, DMTSTO 00086000
* IMMEDIATELY SUSPENDS THE CALLING TASK'S EXECUTION 00087000
* THROUGH THE FREEZE SVC FUNCTION. WITH THE ACTIVE 00088000
* PSW MASKS SET OFF, DMTSTO INSPECTS THE REQUESTED 00089000
* PAGE ENTRIES IN THE MAIN STORAGE MAP. IF THE PAGES 00090000
* ARE FREE, THEY ARE RESERVED FOR THE TASK BY 00091000
* INSERTING THE CALLING TASK'S ID IN EACH MAP ENTRY. 00092000
* IF SOME PAGE REQUESTED IS NOT FREE AT THE TIME OF 00093000
* THE REQUEST PROCESSING, NO PAGES ARE RESERVED AND 00094000
* AN ERROR CONDITION IS RETURNED TO THE CALLING 00095000
* TASK. (IT IS THE RESPONSIBILITY OF THE CALLING 00096000
* TASK TO RETRY THE REQUEST IN THIS CASE.) DMTSTO 00097000
* EXITS TO THE DISPATCHER. 00098000
* 00099000
* 00100000
*. 00101000
EJECT 00102000
DMTSTO CSECT 00103000
SPACE 00104000
* ENTRY POINT FOR CALL TO DMTSTO ROUTINE 00105000
SPACE 00106000
FREEZE SET REG.14 = ADDR OF TASK SAVE AREA AND SAVE STATE 00107000
SPACE 00108000
USING TAREA,R14 DEFINE TASK SAVE AREA DSECT ADDRESSA 00109000
USING DMTSTO,R15 USE ENTRY REGISTER FOR DMTSTO BASE 00110000
USING SVECTORS,0 GET SVECTORS ADDRESSABILITY 00111000
USING TASKE,R4 GET TASK ELEMENT ADDRESSABILTIY 00112000
SPACE 00113000
XC TGREG15(4),TGREG15 CLEAR REG.15 S/A (RETURN CODE) 00114000
LTR R2,R0 REG.2 = REQUESTED PAGE COUNT - IS IT ZERO? 00115000
BZ MAINDONE EASY REQUEST IF IT IS 00116000
BCTR R2,0 DECREMENT REQUEST COUNT FOR EXECUTE OF CHAR INSTR 00117000
L R3,MAINMAP REG.3 = ADDRESS OF START OF CORE MAP 00118000
SR R1,R1 CLEAR CALLER'S PAGE ADDRESS REGISTER 00119000
IC R1,TGREG1+3 AND SET THE LOW ORDER BYTE AS HE HAD IT 00120000
ALR R3,R1 REG.3 = ADDRESS OF STARTING PAGE ENTRY IN MAP 00121000
EX R2,MAINCHEK MAKE SURE THIS AREA IS FREE... 00122000
BNZ MAINPUNT TOO BAD - NO GO 00123000
L R4,ACTIVE REG.4 = ADDRESS OF CALLER'S TASK ELEMENT 00124000
MVC 0(1,R3),TASKID SET FIRST PAGE TO CALLER'S ID 00125000
LTR R2,R2 IS THIS A MULTIPLE PAGE REQUEST? 00126000
BZ MAINDONE ALL DONE IF IT IS NOT 00127000
BCTR R2,0 BUMP COUNT DOWN AGAIN FOR ID PROPOGATION 00128000
EX R2,MAINSET SET ALL REQUESTED PAGE ENTRIES TO CALLER'S ID 00129000
SPACE 00130000
MAINDONE EQU * 00131000
L R15,DISPATCH REG.15 = ADDRESS OF DISPATCHER ENTRY 00132000
BALR R14,R15 EXIT BACK TO CALLER VIA DISPATCH 00133000
SPACE 00134000
MAINPUNT EQU * 00135000
MVI TGREG15+3,16 SET RETURN CODE IN REG.15 SAVE AREA 00136000
B MAINDONE AND GO TO NORMAL RESTORE AND RETURN 00137000
SPACE 00138000
MAINCHEK OC 0(0,R3),0(R3) TO BE EXECUTED TO TEST FOR ZEROS 00139000
MAINSET MVC 1(0,R3),0(R3) TO BE EXECUTED TO PROPOGATE ID BYTE 00140000
EJECT 00141000
COPY RSSEQU 00142000
EJECT 00143000
COPY SVECTORS 00144000
EJECT 00145000
COPY TAREA 00146000
EJECT 00147000
COPY TASKE 00148000
END 00149000