User Tools

Site Tools


ibm:vm370-lib:macro:lock.macro_src

LOCK Source

References

Source Listing

LOCK.MACRO.txt
  1. MACRO @V407510 00001000
  2. &NAME LOCK &REQUEST,&TYPE=,&SPIN=,&OPTION=,&SAVE @V407510 00002000
  3. .* NEW MACRO FOR ATTACHED PROCESSOR SUPPORT @V407510 00003000
  4. GBLB &AP @V407510 00004000
  5. GBLB &LOCK @V407510 00005000
  6. LCLC &ID @V407510 00006000
  7. LCLC &C @V407510 00007000
  8. LCLB &A,&B,&S,&SA,&U @V407510 00008000
  9. AIF (T'&NAME EQ 'O').NOLABEL @V407510 00009000
  10. &NAME DS 0H @V407510 00010000
  11. .NOLABEL ANOP @V407510 00011000
  12. &ID SETC '&SYSNDX' @V407510 00012000
  13. AIF ('&AP' EQ '0').SETCC0 @V407510 00013000
  14. TM APSTAT1,APUOPER RUNNING AP? @V407510 00014000
  15. BNO LOK&ID.B NO, BRANCH AROUND LOCKING @V407510 00015000
  16. &LOCK SETB 0 SET GLOBAL VARIABLE FOR ABEND @V407510 00016000
  17. &A SETB 0 INDICATE OBTAIN REQUEST @V407510 00017000
  18. &B SETB 0 INDICATE NOT VM BLOCK @V407510 00018000
  19. &U SETB 0 INDICATE UPDATE @V407510 00019000
  20. AIF (T'&REQUEST EQ 'O').ERR1 @V407510 00020000
  21. AIF ('&REQUEST' EQ 'OBTAIN').OBTAIN @V407510 00021000
  22. AIF ('&REQUEST' NE 'RELEASE').ERR2 @V407510 00022000
  23. .RELEASE ANOP @V407510 00023000
  24. &A SETB 1 INDICATE RELEASE REQUEST @V407510 00024000
  25. .OBTAIN ANOP @V407510 00025000
  26. AIF (T'&TYPE EQ 'O').ERR3 @V407510 00026000
  27. AIF ('&TYPE' EQ 'SYS').SYS @V407510 00027000
  28. AIF ('&TYPE' EQ 'VMBLOK').VM @V407510 00028000
  29. AIF ('&TYPE' EQ 'DS').DS @V407510 00030000
  30. AIF ('&TYPE' EQ 'IO').IO @V407510 00031000
  31. AIF ('&TYPE' EQ 'RL').RL @V407510 00032000
  32. AIF ('&TYPE' EQ 'FREE').FREE @V407510 00033000
  33. AIF ('&TYPE' EQ 'TR').TR @V407510 00034000
  34. AIF ('&TYPE' NE 'PRIVATE').ERR4 @V407510 00035000
  35. .PRIVATE ANOP @V407510 00036000
  36. &C SETC '0(,R1)' @V407510 00037000
  37. AGO .LABEL @V407510 00038000
  38. .DS ANOP @V407510 00039000
  39. &C SETC '=V(DMKLOKDS)' @V407510 00040000
  40. AGO .LABEL @V407510 00041000
  41. .FREE ANOP @V407510 00042000
  42. &C SETC 'ALOKFR'
  43. AGO .LABEL @V407510 00044000
  44. .RL ANOP @V407510 00045000
  45. &C SETC '=V(DMKLOKRL)' @V407510 00046000
  46. AGO .LABEL @V407510 00047000
  47. .IO ANOP @V407510 00048000
  48. &C SETC '=V(DMKLOKIO)' @V407510 00049000
  49. AGO .LABEL @V407510 00050000
  50. .TR ANOP @V407510 00051000
  51. &C SETC '=V(DMKLOKTR)' @V407510 00052000
  52. AGO .LABEL @V407510 00053000
  53. .SYS ANOP @V407510 00054000
  54. &C SETC 'ALOKSY'
  55. AGO .LABEL @V407510 00056000
  56. .VM ANOP @V407510 00057000
  57. &B SETB 1 INDICATE VMBLOK LOCK REQUEST @V407510 00058000
  58. .LABEL ANOP @V407510 00059000
  59. &S SETB 0 INDICATE SPIN=NO @V407510 00060000
  60. AIF ('&A' EQ '1').SAVE @V407510 00061000
  61. AIF ('&SPIN' EQ 'NO').SAVE @V407510 00062000
  62. AIF (T'&SPIN EQ 'O').SPIN @V407510 00063000
  63. AIF ('&SPIN' NE 'YES').ERR5 @V407510 00064000
  64. .SPIN AIF ('&B' EQ '1').ERR6 @V407510 00065000
  65. &S SETB 1 INDICATE SPIN=YES @V407510 00066000
  66. .SAVE ANOP @V407510 00067000
  67. &SA SETB 0 INDICATE NO SAVE @V407510 00068000
  68. AIF ('&SAVE' EQ '').UPDT @V407510 00069000
  69. AIF ('&SAVE' NE 'SAVE').ERR7 @V407510 00070000
  70. STM R14,R1,LOCKSAV SAVE REGS 14 - 1 @V407510 00071000
  71. &SA SETB 1 INDICATE SAVE OPTION @V407510 00072000
  72. .UPDT ANOP @V407510 00073000
  73. AIF (T'&OPTION EQ 'O').TEST @V407510 00074000
  74. AIF ('&OPTION' NE 'NOUPDT').ERR8 @V407510 00075000
  75. &U SETB 1 INDICATE NOUPDATE OPTION @V407510 00076000
  76. .TEST ANOP @V407510 00077000
  77. AIF ('&A' EQ '1').REL @V407510 00078000
  78. .* &A = 0 - OBTAIN REQUEST @V407510 00079000
  79. AIF ('&B' EQ '0').OBT OBTAIN NON-VMBLOK @V407510 00080000
  80. .* &A=0, &B=1 - OBTAIN VMBLOK REQUEST @V407510 00081000
  81. AIF ('&U' EQ '1').OBTVM OBTAIN, VMBLOK, NOUPDATE @V407510 00082000
  82. .* &A=0, &B=1, &U=0 - UPDATE OBTAIN VMBLOK @V407510 00083000
  83. .* NORMAL VMBLOK OBTAIN- GOTO LOCK MGR @V407510 00085000
  84. L R15,ALOKVM ADDRESS OF DMKLOKVM @V407510 00086000
  85. BALR R14,R15 CALL DMKLOKVM @V407510 00087000
  86. AGO .END @V407510 00088000
  87. .* &A=0, &B=0 NON VMBLOK OBTAIN REQUEST @V407510 00109000
  88. .OBT ANOP @V407510 00110000
  89. LH R0,LPUADDR PROCESSOR ADDRESS @V407510 00111000
  90. AIF ('&TYPE' EQ 'PRIVATE').SKIP1 @V407510 00112000
  91. L R1,&C LOCKWORD ADDRESS @V407510 00113000
  92. .SKIP1 ANOP @V407510 00114000
  93. SR R14,R14 ZERO FOR LOCK NOT HELD @V407510 00115000
  94. CS R14,R0,0(R1) TRY TO OBTAIN LOCK @V407510 00116000
  95. AIF ('&TYPE' EQ 'PRIVATE').SK1 @V407510 00117000
  96. AIF ('&TYPE' EQ 'FREE').SK1 00117100
  97. BNZ LOK&ID.C UNSUCCESSFUL, CALL LOCK MGR @V407510 00118000
  98. ST R12,4(,R1) SAVE LOCKER R12 @V407510 00119000
  99. AIF ('&SA' EQ '0').SKIP2 SAVE SPECIFIED? @V407510 00120000
  100. B LOK&ID.A BRANCH TO RESTORE REGISTERS @V407510 00121000
  101. AGO .SKIP3 @V407510 00122000
  102. .SK1 ANOP PRIVATE LOCK, NO R12 STORE @V407510 00123000
  103. AIF ('&SA' EQ '0').SK2 SAVE SPECIFIED? @V407510 00124000
  104. BZ LOK&ID.A BRANCH TO RESTORE REGS @V407510 00125000
  105. AGO .SK3 BRANCH TO ERROR CODE @V407510 00126000
  106. .SK2 ANOP SAVE NOT SPECIFIED @V407510 00127000
  107. BZ LOK&ID.B FINISHED @V407510 00128000
  108. AGO .SK3 BRANCH TO ERROR CODE @V407510 00129000
  109. .SKIP2 ANOP @V407510 00130000
  110. B LOK&ID.B FINISHED @V407510 00131000
  111. .SKIP3 ANOP @V407510 00132000
  112. LOK&ID.C DS 0H LOCK NOT OBTAINED @V407510 00133000
  113. .SK3 ANOP @V407510 00134000
  114. AIF ('&S' EQ '1').CHECK1 SPIN = YES? @V407510 00135000
  115. &C SETC '=V(DMKLOKDF)' SET UP FOR DEFER ENTRY @V407510 00136000
  116. AGO .BRANCH1 @V407510 00137000
  117. .CHECK1 ANOP @V407510 00138000
  118. &C SETC 'ALOKSP' SET UP FOR SPIN ENTRY @V407510 00139000
  119. .BRANCH1 ANOP @V407510 00140000
  120. L R15,&C ADDRESS OF LOCK MANAGER @V407510 00141000
  121. BALR R14,R15 BRANCH TO LOCK MANAGER @V407510 00142000
  122. AGO .END FINISH EXPANSION @V407510 00143000
  123. .OBTVM ANOP OBTAIN VMBLOK NOUPDATE @V407510 00144000
  124. LH R0,LPUADDR PROCESSOR ADDRESS @V407510 00145000
  125. SR R14,R14 ZERO FOR LOCK NOT HELD @V407510 00146000
  126. CS R14,R0,VMLOCK-VMBLOK(R1) TRY TO OBTAIN LOCK @V407510 00147000
  127. BNZ LOK&ID.C UNSUCCESSFUL, CALL LOCK MGR @V407510 00148000
  128. ST R12,VMLOCKER-VMBLOK(,R1) SAVE LOCKER R12 @V407510 00149000
  129. AIF ('&SA' EQ '0').SKIP8 SAVE SPECIFIED? @V407510 00150000
  130. B LOK&ID.A BRANCH TO RESTORE REGISTERS @V407510 00151000
  131. AGO .SKIP9 @V407510 00152000
  132. .SKIP8 ANOP @V407510 00153000
  133. B LOK&ID.B FINISHED @V407510 00154000
  134. .SKIP9 ANOP @V407510 00155000
  135. LOK&ID.C DS 0H LOCK NOT OBTAINED @V407510 00156000
  136. LA R1,VMLOCK-VMBLOK(,R1) LOCKWORD ADDRESS @V407510 00157000
  137. L R15,=V(DMKLOKDF) ADDRESS OF LOCK MANAGER @V407510 00158000
  138. BALR R14,R15 BRANCH TO LOCK MANAGER @V407510 00159000
  139. AGO .END FINISH EXPANSION @V407510 00160000
  140. .* &A=1 RELEASE REQUEST @V407510 00161000
  141. .REL ANOP @V407510 00162000
  142. LH R0,LPUADDR PROCESSOR ADDRESS @V407510 00163000
  143. AIF ('&TYPE' EQ 'PRIVATE').SKIP4 @V407510 00164000
  144. AIF ('&B' EQ '1').SKIP4 @V407510 00165000
  145. L R1,&C LOCKWORD ADDRESS @V407510 00166000
  146. .SKIP4 ANOP @V407510 00167000
  147. SR R14,R14 ZERO FOR LOCK NOT HELD @V407510 00168000
  148. AIF ('&B' EQ '1').SKIP5 @V407510 00169000
  149. C R0,0(,R1) LOCK CURRENTLY OWNED? @V4M0160 00170100
  150. BE LOK&ID.D YES, CLEAR LOCKWORD @V4M0160 00170200
  151. &LOCK SETB 1 @V4M0160 00170300
  152. ABEND 03 LOCK NOT HELD, LOK003 ABEND @V4M0160 00170400
  153. &LOCK SETB 0 @V4M0160 00170500
  154. LOK&ID.D DS 0H @V4M0160 00170600
  155. ST R14,0(,R1) CLEAR LOCKWORD @V4M0160 00170700
  156. AGO .SKIP6 @V407510 00171000
  157. .SKIP5 ANOP @V407510 00172000
  158. C R0,VMLOCK-VMBLOK(R1) LOCK CURRENTLY OWNED? @V4M0160 00173100
  159. BE LOK&ID.D YES, CLEAR LOCKWORD @V4M0160 00173200
  160. &LOCK SETB 1 @V4M0160 00173300
  161. ABEND 03 LOCK NOT HELD, LOK003 ABEND @V4M0160 00173400
  162. &LOCK SETB 0 @V4M0160 00173500
  163. LOK&ID.D DS 0H @V4M0160 00173600
  164. ST R14,VMLOCK-VMBLOK(R1) CLEAR LOCKWORD @V4M0160 00173700
  165. .SKIP6 ANOP @V407510 00174000
  166. AGO .END @V407510 00185000
  167. .ERR1 ANOP @V407510 00190000
  168. MNOTE 8,'REQUIRED POSITIONAL OPERAND MISSING' @V407510 00191000
  169. AGO .EXIT @V407510 00192000
  170. .ERR2 ANOP @V407510 00193000
  171. MNOTE 8,'INVALID POSITIONAL OPERAND' @V407510 00194000
  172. AGO .EXIT @V407510 00195000
  173. .ERR3 ANOP @V407510 00196000
  174. MNOTE 8,TYPE OPERAND REQUIRED, NOT SPECIFIED' @V407510 00197000
  175. AGO .EXIT @V407510 00198000
  176. .ERR4 ANOP @V407510 00199000
  177. MNOTE 8,'INVALID TYPE= OPERAND SPECIFIED' @V407510 00200000
  178. AGO .EXIT @V407510 00201000
  179. .ERR5 ANOP @V407510 00202000
  180. MNOTE 8,'INVALID SPIN= OPERAND SPECIFIED' @V407510 00203000
  181. AGO .EXIT @V407510 00204000
  182. .ERR6 ANOP @V407510 00205000
  183. MNOTE 8,'MUTUALLY EXCLUSIVE KEYWORDS SPIN=YES, TYPE=VMBLOK' 00206000
  184. AGO .EXIT @V407510 00207000
  185. .ERR7 ANOP @V407510 00208000
  186. MNOTE 8,'INVALID SAVE PARAMETER' @V407510 00209000
  187. AGO .EXIT @V407510 00210000
  188. .ERR8 ANOP @V407510 00211000
  189. MNOTE 8,'INVALID OPTION= OPERAND SPECIFIED' @V407510 00212000
  190. AGO .EXIT @V407510 00213000
  191. .END ANOP @V407510 00214000
  192. AIF ('&SA' EQ '0').END1 @V407510 00215000
  193. LOK&ID.A DS 0H @V407510 00216000
  194. LM R14,R1,LOCKSAV RESTORE REGS 14-1 @V407510 00217000
  195. .END1 ANOP @V407510 00218000
  196. .EXIT ANOP @V407510 00219000
  197. LOK&ID.B DS 0H END OF EXPANSION @V407510 00220000
  198. MEXIT @V407510 00221000
  199. .SETCC0 ANOP @V407510 00222000
  200. AIF ('&REQUEST' EQ 'RELEASE').NOGEN @V4M0160 00222100
  201. AIF ('&SPIN' NE 'NO').NOGEN 00222110
  202. CLR R0,R0 SET CONDITION CODE = 0 00223000
  203. MEXIT @V4M0160 00223100
  204. .NOGEN ANOP @V4M0160 00223200
  205. MEND @V407510 00224000
ibm/vm370-lib/macro/lock.macro_src.txt ยท Last modified: 2023/08/06 13:38 by Site Administrator