QRQ TITLE 'DMTQRQ (RSCS) VM/370 - RELEASE 6' 00001000
*. 00002000
* MODULE NAME - 00003000
* 00004000
* DMTQRQ 00005000
* 00006000
* FUNCTION - 00007000
* 00008000
* THE DMTQRQ MODULE MANAGES THE MSUP SUPERVISOR 00009000
* STATUS QUEUE FOR OTHER MSUP FUNCTIONS. DMTQRQ IS 00010000
* INTENDED FOR USE ONLY WITHIN THE SUPERVISOR 00011000
* ITSELF, AND MUST BE ENTERED WITH ALL PSW MASKS OFF 00012000
* (EXCEPT MACHINE CHECK). 00013000
* 00014000
* ATTRIBUTES - 00015000
* 00016000
* REUSABLE 00017000
* 00018000
* ENTRY POINTS - 00019000
* 00020000
* DMTQRQ - RESERVE OR RELEASE A SUP QUEUE ELEMENT 00021000
* 00022000
* ENTRY CONDITIONS - 00023000
* 00024000
* GPR1 = 0 IMPLIES A REQUEST TO RESERVE AN ELEMENT 00025000
* ¬= 0 IMPLIES A REQUEST TO RELEASE THE ELEMENT 00026000
* WHOSE ADDRESS IS IN GPR1 00027000
* 00028000
* EXIT CONDITIONS - 00029000
* 00030000
* NORMAL - 00031000
* 00032000
* GPR1 = RESERVD ELEM ADDR ON RESERVE REQ 00033000
* GPR15 = X'00' IMPLIES NORMAL REQ COMPLETION 00034000
* 00035000
* ERROR - 00036000
* 00037000
* GPR15 = X'10' IMPLIES NO ELEMENT AVAILABLE ON 00038000
* A RESERVE REQUEST 00039000
EJECT 00040000
* 00041000
* CALLS TO OTHER ROUTINES - 00042000
* 00043000
* NONE 00044000
* 00045000
* EXTERNAL REFERENCES - 00046000
* 00047000
* DMTVEC - SUPERVISOR COMMON AREA 00048000
* 00049000
* TABLES / WORKAREAS - 00050000
* 00051000
* FREE QUEUE ELEMENT 00052000
* 00053000
* REGISTER USAGE - 00054000
* 00055000
* GPR0 = UNUSED 00056000
* GPR1 = FREE ELEMENT POINTER 00057000
* GPR2 = UNUSED 00058000
* GPR3 = UNUSED 00059000
* GPR4 = UNUSED 00060000
* GPR5 = UNUSED 00061000
* GPR6 = UNUSED 00062000
* GPR7 = UNUSED 00063000
* GPR8 = UNUSED 00064000
* GPR9 = UNUSED 00065000
* GPR10 = UNUSED 00066000
* GPR11 = UNUSED 00067000
* GPR12 = UNUSED 00068000
* GPR13 = UNUSED 00069000
* GPR14 = RETURN ADDRESS 00070000
* GPR15 = ENTRY ADDRESS AND RETURN CODE 00071000
* 00072000
* NOTES - 00073000
* 00074000
* NO VALIDATION IS PERFORMED ON QUEUE ELEMENTS TO BE 00075000
* RELEASED - THE CALLING ROUTINES ARE RESPONSIBLE FOR 00076000
* THAT FUNCTION. 00077000
* 00078000
* OPERATION - 00079000
* 00080000
* THE RELEASE OR 'FREE' FUNCTION OF DMTQRQ ENQUEUES 00081000
* THE ELEMENT SPECIFIED BY THE CALLER TO BE RELEASED 00082000
* ON THE QUEUE OF FREE SUPERVISOR ELEMENTS, AND 00083000
* RETURNS WITHOUT ANY POSSIBLE ERROR CONDITIONS. 00084000
* 00085000
* THE RESERVE OR 'GET' FUNCTION OF DMTQRQ DEQUEUES 00086000
* THE FIRST ELEMENT ON THE FREE SUPERVISOR ELEMENT QUEUE 00087000
* AND RETURNS IT'S ADDRESS TO THE CALLER IN GPR1. 00088000
* IF NO FREE ELEMENT IS AVAILABLE, AN ERROR CODE IS 00089000
* RETURNED TO THE CALLER IN GPR15. 00090000
* 00091000
*. 00092000
EJECT 00093000
DMTQRQ CSECT 00094000
SPACE 00095000
USING DMTQRQ,R15 00096000
USING SVECTORS,0 GET SVECTORS ADDRESSABILITY 00097000
USING FREEE,R1 GET FREE ELEMENT ADDRESSABILITY 00098000
SPACE 00099000
LTR R1,R1 IS REQUEST FOR GET OR FREE? 00100000
BNZ QFREE ADDRESS SUPPLIED - MUST BE FREE 00101000
ICM R1,B'1111',FREEQ R1 ADDR OF START FREE QUEUE, END? 00102000
BZ QERROR NOPE - ERROR RETURN 00103000
MVC FREEQ(4),FREENEXT SET NEXT ELEMENT AS START OF QUEUE 00104000
B QEXIT AND RETURN WITH ELEMENT ADDRESS IN REG.1 00105000
SPACE 00106000
QFREE EQU * 00107000
LA R1,0(R1) SET HIGH ORDER BYTE TO ZERO JUST IN CASE ... 00108000
MVI FREEID,X'00' CLEAR FREE QUEUE ELEMENT ID FIELD 00109000
MVC FREENEXT(4),FREEQ CHAIN CURRENT FREE QUEUE 00110000
ST 1,FREEQ AND SET IT AT THE FRONT OF THE FREE QUEUE 00111000
QEXIT EQU * 00112000
SR R15,R15 SET RETURN CODE TO ZERO 00113000
BR R14 AND RETURN SUCCESSFULLY 00114000
SPACE 00115000
QERROR EQU * 00116000
LA R15,16 LOAD ERROR RETURN CODE 00117000
BR R14 AND RETURN TO CALLER 00118000
EJECT 00119000
COPY RSSEQU 00120000
EJECT 00121000
COPY SVECTORS 00122000
EJECT 00123000
COPY FREEE 00124000
END 00125000