Trailing-Edge
-
PDP-10 Archives
-
BB-H348C-RM_1982
-
swskit-v21/listings/rsx11s/drreg.list
There are no other files named drreg.list in the archive.
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 3
1 .TITLE DRREG
2 .IDENT /01/
3
4 ;
5 ; COPYRIGHT (C) 1976, 1978
6 ; DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.
7 ;
8 ; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
9 ; OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
10 ;
11 ; VERSION 01
12 ;
13 ; T. J. MILLER 12-MAR-76
14 ;
15 ; MODIFIED BY:
16 ;
17 ; T. J. MILLER 7-DEC-76
18 ;
19 ; TM069 -- ADD CHECK FOR OUTSTANDING TERMINAL I/O.
20 ;
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4
22 ;
23 ; THE FOLLOWING DIRECTIVES RECEIVE AS INPUT A POINTER TO A REGION DEFINITION
24 ; BLOCK WHICH SERVES AS A COMMUNICATION AREA BETWEEN THE ISSUING TASK AND
25 ; THE EXECUTIVE. THE REGION DEFINITION BLOCK HAS THE FOLLOWING FORMAT:
26 ;
27 ; -------------------------------------------------
28 ; ! !
29 ; R.GID ! REGION ID !
30 ; ! !
31 ; !-----------------------------------------------!
32 ; ! !
33 ; R.GSIZ ! SIZE OF REGION (32W BLOCKS) !
34 ; ! !
35 ; !-----------------------------------------------!
36 ; ! !
37 ; ! !
38 ; ! !
39 ; R.GNAM ! NAME OF REGION (RAD50) !
40 ; ! !
41 ; ! !
42 ; ! !
43 ; !-----------------------------------------------!
44 ; ! !
45 ; ! !
46 ; ! !
47 ; R.GPAR ! REGION'S MAIN PARTITION NAME (RAD50) !
48 ; ! !
49 ; ! !
50 ; ! !
51 ; !-----------------------------------------------!
52 ; ! !
53 ; R.GSTS ! REGION STATUS WORD !
54 ; ! !
55 ; !-----------------------------------------------!
56 ; ! !
57 ; R.GPRO ! PROTECTION CODE OF REGION !
58 ; ! !
59 ; -------------------------------------------------
60 ;
61
62 ;
63 ; GLOBAL SYMBOL DEFINITION
64 ;
65 ; DEFINE $DETRG FOR MCR IF PLAS IS NOT SELECTED
66 ;
67
68
69 .IF NDF P$$LAS
70
71 000001 $DETRG==1 ;SET TO TRAP IF REFERENCED
72
73 .IFF
74
75 ;
76 ; MACRO LIBRARY CALLS
77 ;
78
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-1
79 .MCALL HDRDF$,PCBDF$,RDBDF$,TCBDF$
80 HDRDF$ ;DEFINE HEADER AND WINDOW BLOCK OFFSETS
81 PCBDF$ ;DEFINE PCB AND ATTACHMENT DESCRIPTOR OFFSETS
82 RDBDF$ ;DEFINE REGION DEFINITION BLOCK OFFSETS
83 TCBDF$ ;DEFINE TCB OFFSETS
84
85 ;+
86 ; **-$DRCRR-CREATE REGION
87 ;
88 ; THIS DIRECTIVE INSTRUCTS THE SYSTEM TO CREATE A REGION AND OPTIONALLY
89 ; ATTACH TO IT.
90 ;
91 ; DPB FORMAT:
92 ;
93 ; WD. 00 -- DIC(55.),DPB SIZE(2.)
94 ; WD. 01 -- ADDRESS OF REGION DEFINITION BLOCK
95 ;
96 ; INPUTS:
97 ;
98 ; R2=ADDRESS OF THE TASK STATUS WORD OF THE CURRENT TASK.
99 ; R3=ADDRESS OF THE REGION DEFINITION BLOCK.
100 ; R4=ADDRESS OF THE HEADER OF THE CURRENT TASK.
101 ; R5=ADDRESS OF THE TCB OF THE CURRENT TASK.
102 ;
103 ; INPUT FIELDS IN THE REGION DEFINITION BLOCK ARE:
104 ; R.GSIZ=SIZE OF REGION TO CREATE.
105 ; R.GNAM=NAME OF REGION TO CREATE OR 0 FOR NO NAME.
106 ; R.GPAR=NAME OF SYSTEM PARTITION IN WHICH TO ALLOCATE REGION
107 ; OR 0 FOR MAIN SYSTEM PARTITION OF TASK.
108 ; R.GSTS=CONTROL INFORMATION.
109 ; RS.NDL=1 IF REGION SHOULD NOT BE DELETED ON LAST
110 ; DETACH.
111 ; RS.ATT=1 IF CREATED REGION SHOULD BE ATTACHED.
112 ; RS.RED=1 IF READ ACCESS IS DESIRED ON ATTACH.
113 ; RS.WRT=1 IF WRITE ACCESS IS DESIRED ON ATTACH.
114 ; RS.EXT=1 IF EXTEND ACCESS IS DESIRED ON ATTACH.
115 ; RS.DEL=1 IF DELETE ACCESS IS DESIRED ON ATTACH.
116 ; R.GPRO=PROTECTION CODE FOR REGION [DEWR,DEWR,DEWR,DEWR].
117 ;
118 ; OUTPUTS: (DIRECTIVE STATUS AND PS RETURNED TO TASK)
119 ;
120 ; C=0 IF DIRECTIVE IS SUCCESSFULLY COMPLETED.
121 ; DIRECTIVE STATUS OF +1 IS RETURNED.
122 ; C=1 IF DIRECTIVE IS REJECTED.
123 ; DIRECTIVE STATUS OF 'D.RS1' IS RETURNED IF A PCB OR ATTACH-
124 ; MENT DESCRIPTOR COULD NOT BE ALLOCATED.
125 ; DIRECTIVE STATUS OF 'D.RS16' IS RETURNED IF THE DESIRED
126 ; ACCESS IS DENIED IN THE ATTACHMENT STAGE.
127 ; DIRECTIVE STATUS OF 'D.RS84' IS RETURNED IF THE SPECIFIED
128 ; PARTITION IN WHICH THE REGION IS TO BE ALLOCATED
129 ; DOES NOT EXIST, OR IF NO PARTITION NAME HAS BEEN
130 ; SPECIFIED AND RS.ATT=0.
131 ;
132 ; OUTPUT FIELDS IN THE REGION DEFINITION BLOCK ARE:
133 ; R.GID=ASSIGNED REGION ID (RS.ATT=1).
134 ; R.GSTS=DIRECTIVE COMPLETION INFORMATION.
135 ; RS.CRR=1 IF REGION WAS CREATED.
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-2
136 ;-
137
138 .ENABL LSB
139 $DRCRR:: ;
140
141
142 .IF DF D$$YNM&M$$MGE
143
144 ADD #R.GPAR,R3 ;PNT TO NAME OF PAR IN WHICH TO ALLOCATE
145 MOV T.PCB(R5),R2 ;ASSUME ALLOCATING IN TASK'S PARTITION
146 MOV P.MAIN(R2),R2 ;POINT TO MAIN PARTITION PCB
147 TST (R3) ;PARTITION NAME SPECIFIED?
148 BEQ 5$ ;IF EQ NO
149 CALL $SRNAM ;SEARCH FOR NAMED PARTITION'S PCB
150 BCS 90$ ;IF CS, PARTITION NOT IN SYSTEM
151 CMP R2,P.MAIN(R2) ;IS IT A MAIN PARTITION?
152 BNE 90$ ;IF NE NO
153 5$: BIT #PS.SYS,P.STAT(R2) ;IS IT A SYSTEM CONTROLLED PARTITION?
154 BEQ 90$ ;IF EQ NO
155 MOV R2,R0 ;COPY POINTER TO PCB
156 TST -(R3) ;POINT TO REGION NAME (R.GNAM+2)
157 TST -(R3) ;REGION NAME SPECIFIED? (R.GNAM)
158 BEQ 10$ ;IF EQ NO
159
160 .IFF
161
162 CMP (R3)+,(R3)+ ;POINT TO REGION NAME (R.GID)(R.GSIZ)
163
164 .IFTF
165
166 CALL $SRNAM ;DETERMINE IF NAME IS UNIQUE
167
168 .IFF
169
170 BCS 90$ ;IF CS REGION DOES NOT EXIST
171
172 .IFT
173
174 BCC 35$ ;IF CC, NAME IS NOT UNIQUE
175 10$: MOV R3,-(SP) ;PUSH NONZERO WORD (P.ATT+2)
176 CLR -(SP) ;(P.ATT)
177 MOV R.GPRO-R.GNAM(R3),-(SP) ;SET PROTECTION MASK (P.PRO)
178 BIC #210,(SP) ;INSURE OWNER AND SYSTEM DELETE ACCESS (P.PRO)
179 CLR -(SP) ;CLEAR HEADER POINTER (P.HDR)
180 MOV #PS.COM!PS.DEL!PS.PIC!PS.SYS,-(SP) ;SET STATUS WORD (P.STAT)
181 MOV H.CUIC(R4),-(SP) ;SET OWNER UIC (P.OWN)
182 CLR -(SP) ;CLEAR BUSY FLAGS (P.BUSY)
183 CLR -(SP) ;CLEAR SWAP SIZE (P.SWSZ)
184 CLR -(SP) ;CLEAR WAIT QUEUE POINTER (P.WAIT)
185 MOV R.GSIZ-R.GNAM(R3),-(SP) ;STORE SIZE OF REGION (P.SIZE)
186 CLR -(SP) ;CLEAR RELOCATION BIAS (P.REL)
187 MOV R0,-(SP) ;SET MAIN PCB POINTER (P.MAIN)
188 CLR -(SP) ;CLEAR SUBPARTITION LINK (P.LNK)
189 MOV 2(R3),-(SP) ;SET SECOND WORD OF PAR NAME (R.GNAM+2)(P.NAM+2)
190 MOV (R3),-(SP) ;SET FIRST WORD OF PAR NAME (R.GNAM)(P.NAM)
191 BNE 30$ ;IF NE NAME WAS SPECIFIED
192 BIT #RS.ATT,R.GSTS-R.GNAM(R3) ;IS REGION TO BE ATTACHED
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-3
193 BEQ 90$ ;IF EQ NO, PARTITION NAME ERROR
194 CLR 2(SP) ;ELSE CLEAR SECOND WORD OF NAME (P.NAM+2)
195 30$: CLR -(SP) ;ZERO I/O COUNT AND PRIORITY (P.IOC)
196 CLR -(SP) ;CLEAR LINK WORD (P.LNK)
197 MOV SP,R2 ;COPY POINTER TO PCB ON STACK
198
199 .IFTF
200
201 35$: BIT #RS.ATT,R.GSTS-R.GNAM(R3) ;ATTACH DESIRED?
202 BEQ 36$ ;IF EQ NO
203 CALL ATT ;ATTACH REGION
204 36$: ;REF LABEL
205
206 .IFT
207
208 TST (SP) ;WAS THE REGION CREATED?
209 BNE 80$ ;IF NE NO, DONE
210 MOV R1,R5 ;COPY POINTER TO ATTACHMENT DESCRIPTOR
211 MOV #P.LGTH,R1 ;PICK UP PCB SIZE
212 CALL $ALOCB ;ALLOCATE A PCB
213 BCS 110$ ;IF CS ALLOCATION FAILURE
214 MOV #P.LGTH/2,R1 ;PICK UP PCB SIZE IN WORDS
215 MOV R0,R4 ;COPY POINTER TO PCB
216 40$: MOV (SP)+,(R0)+ ;FILL IN PCB
217 DEC R1 ;DONE YET?
218 BGT 40$ ;IF GT NO
219 CMP -(R0),-(R0) ;WAS THE PCB ATTACHED?
220 BEQ 50$ ;IF EQ YES
221 MOV R0,2(R0) ;SET UP LISTHEAD
222 CMP -(R3),-(R3) ;POINT TO REGION ID (R.GSIZ)(R.GID)
223 BR 60$ ;
224 50$: MOV (R0),R5 ;PICK UP ADDRESS OF ATTACHMENT DESCRIPTOR
225 MOV R4,A.PCB(R5) ;POINT IT TO THE REAL PCB
226 60$: MOV P.MAIN(R4),R5 ;POINT TO MAIN PCB
227 CALL $FNDSP ;ATTEMPT TO ALLOCATE SPACE IN PARTITION
228 BCS 120$ ;IF CS ALLOCATION FAILURE
229 BIS #RS.CRR,R.GSTS(R3) ;INDICATE REGION WAS CREATED
230 BIT #RS.NDL,R.GSTS(R3) ;IS NO DELETION DESIRED?
231 BEQ 80$ ;IF EQ NO
232 BIC #PS.DEL,P.STAT(R4) ;CLEAR DELETE ON LAST DETACH FLAG
233
234 .IFTF
235
236 80$: RETURN ;
237 90$: DRSTS D.RS94 ;PARTITION NAME ERROR
238
239 .IFT
240
241 110$: BIC #PS.SYS,P.STAT(SP) ;INSURE DETACH DOES NOT ATTEMPT TO DEALLOCATE
242 MOV SP,R4 ;POINT TO PCB ON STACK
243 MOV #80$,(SP) ;POINT TO NULL ROUTINE
244 BR 125$ ;JOIN COMMON CODE
245 120$: MOV #$DEACB,(SP) ;ASSUME PCB MUST BE DEALLOCATED
246 125$: MOV (R3),R5 ;PICK UP ATT DESCRIPTOR ADDRESS (R.GID)
247 MOV R4,R0 ;POINT TO PCB TO DEALLOCATE
248 MOV #P.LGTH,R1 ;PICK UP PCB SIZE
249 TST P.ATT(R4) ;WAS THE PCB ATTACHED?
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-4
250 BEQ 126$ ;IF EQ NO
251 MOV #$DETRG,(SP) ;SET TO DETACH REGION
252 126$: CALL @(SP)+ ;CALL APPRORIATE ROUTINE
253 DRSTS D.RS1 ;ALLOCATION FAILURE
254
255 .IFTF
256
257 ;+
258 ; **-$DRATR-ATTACH REGION
259 ;
260 ; THIS DIRECTIVE INSTRUCTS THE SYSTEM TO ATTACH THE SPECIFIED REGION
261 ; TO THE CURRENT TASK.
262 ;
263 ; DPB FORMAT:
264 ;
265 ; WD. 00 -- DIC(57.),DPB SIZE(2.)
266 ; WD. 01 -- ADDRESS OF REGION DEFINITION BLOCK
267 ;
268 ; INPUTS:
269 ;
270 ; R2=ADDRESS OF THE TASK STATUS WORD OF THE CURRENT TASK.
271 ; R3=ADDRESS OF THE REGION DEFINITION BLOCK.
272 ; R4=ADDRESS OF THE HEADER OF THE CURRENT TASK.
273 ; R5=ADDRESS OF THE TCB OF THE CURRENT TASK.
274 ;
275 ; INPUT FIELDS IN THE REGION DEFINITION BLOCK ARE:
276 ; R.GNAM=NAME OF REGION TO ATTACH TO OR 0 FOR TASK REGION.
277 ; R.GSTS=DESIRED ACCESS TO REGION.
278 ; RS.RED=1 IF READ ACCESS IS DESIRED.
279 ; RS.WRT=1 IF WRITE ACCESS IS DESIRED.
280 ; RS.EXT=1 IF EXTEND ACCESS IS DESIRED.
281 ; RS.DEL=1 IF DELETE ACCESS IS DESIRED.
282 ;
283 ; OUTPUTS: (DIRECTIVE STATUS AND PS RETURNED TO TASK)
284 ;
285 ; C=0 IF DIRECTIVE IS SUCCESSFULLY COMPLETED.
286 ; DIRECTIVE OF +1 IS RETURNED.
287 ; C=1 IF DIRECTIVE IS REJECTED.
288 ; DIRECTIVE STATUS OF 'D.RS1' IS RETURNED IF AN ATTACHMENT
289 ; DESCRIPTOR CANNOT BE ALLOCATED.
290 ; DIRECTIVE STATUS OF 'D.RS16' IS RETURNED IF THE DESIRED
291 ; ACCESS IS DENIED.
292 ; DIRECTIVE STATUS OF 'D.RS84' IS RETURNED IF THE SPECIFIED
293 ; REGION NAME DOES NOT EXIST.
294 ;
295 ; OUTPUT FIELDS IN THE REGION DEFINITION BLOCK ARE:
296 ; R.GID=ASSIGNED REGION ID.
297 ; R.GSIZ=SIZE OF ATTACHED REGION.
298 ;-
299
300 $DRATR::ADD #R.GNAM,R3 ;POINT TO SPECIFIED REGION NAME
301 TST (R3) ;REGION NAME SPECIFIED?
302 BEQ 90$ ;IF EQ NO, ILLEGAL
303 CALL $SRNAM ;SEARCH FOR NAMED REGION
304 BCS 90$ ;IF CS NAMED REGION DOES NOT EXIST
305 ATT: BIT #PS.COM,P.STAT(R2) ;IS THE PARTITION COMMON?
306 BEQ 90$ ;IF EQ NO
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-5
307
308 .IFT
309
310 BIT #PS.SYS,P.STAT(R2) ;IS IT A SYSTEM CONTROLLED PARTITION?
311 BEQ 130$ ;IF EQ NO
312 CMP R2,P.MAIN(R2) ;IS IT THE MAIN SYSTEM CONTROLLED PARTITION?
313 BR 140$ ;
314
315 .IFTF
316
317 130$: BITB P.BUSY(R2),P.BUSY+1(R2) ;IS COMMON BLOCK NOT LOADED?
318 140$: BEQ 90$ ;IF EQ YES
319 MOV R.GSTS-R.GNAM(R3),R0 ;PICK UP STATUS WORD
320 BIT #17,R0 ;ATTACH DESIRED?
321 BNE 147$ ;IF NE YES
322 MOV T.ATT(R5),R1 ;POINT TO FIRST ATTACHMENT DESCRIPTOR
323 146$: SUB #A.TCBL,R1 ;POINT TO START OF DESCRIPTOR
324 CMP A.PCB(R1),R2 ;ATTACHED TO THIS PCB?
325 BEQ 155$ ;IF EQ YES
326 MOV A.TCBL(R1),R1 ;POINT TO NEXT ATTACHMENT DESCRIPTOR
327 BNE 146$ ;IF NE THERE IS ONE
328 DRSTS D.RS86 ;NO SUCH REGION ID
329 147$: MOV H.CUIC(R4),R1 ;PICK UP CURRENT TASK UIC
330 MOV R0,R4 ;COPY STATUS WORD
331
332 .IFT
333
334 CMP R2,PC ;IS REGION BEING CREATED?
335 BLO 150$ ;IF LO YES, SKIP PROTECTION CHECK
336
337 .IFTF
338
339 BIT #T3.PRV,T.ST3(R5) ;ISSUING TASK PRIVILEGED?
340 BNE 150$ ;IF NE YES, SKIP ACCESS CHECK
341 CALL $CKACC ;DETERMINE IF DESIRED ACCESS IS ALLOWED
342 150$: CALL $CRATT ;CREATE ATT DESCRIPTOR AND LINK IT IN
343 BCS 160$ ;IF CS ALLOCATION FAILURE
344 155$: MOV P.SIZE(R2),-(R3) ;RETURN SIZE OF REGION (R.GSIZ)
345 MOV R1,-(R3) ;STORE DESCRIPTOR ADDR AS REG ID (R.GID)
346 RETURN ;
347 160$: DRSTS D.RS1 ;ALLOCATION FAILURE
348 .DSABL LSB
349
350 ;+
351 ; **-$DRDTR-DETACH REGION
352 ;
353 ; THIS DIRECTIVE INSTRUCTS THE SYSTEM TO DETACH THE SPECIFIED REGION,
354 ; UNMAPPING IF NECESSARY.
355 ;
356 ; DPB FORMAT:
357 ;
358 ; WD. 00 -- DIC(59.),DPB SIZE(2.)
359 ; WD. 01 -- ADDRESS OF REGION DEFINITION BLOCK
360 ;
361 ; INPUTS:
362 ;
363 ; R2=ADDRESS OF THE TASK STATUS WORD OF THE CURRENT TASK.
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-6
364 ; R3=ADDRESS OF THE REGION DEFINITION BLOCK.
365 ; R4=ADDRESS OF THE HEADER OF THE CURRENT TASK.
366 ; R5=ADDRESS OF THE TCB OF THE CURRENT TASK.
367 ;
368 ; INPUT FIELDS IN THE REGION DEFINITION BLOCK ARE:
369 ; R.GID=REGION ID OF REGION TO DETACH.
370 ; R.GSTS=CONTROL INFORMATION.
371 ; RS.MDL=1 IF REGION SHOULD BE MARKED FOR DELETE ON
372 ; THE LAST DETACH.
373 ;
374 ; OUTPUTS: (DIRECTIVE STATUS AND PS RETURNED TO TASK)
375 ;
376 ; C=0 IF DIRECTIVE IS SUCCESSFULLY COMPLETED.
377 ; DIRECTIVE STATUS OF +1 IS RETURNED.
378 ; C=1 IF DIRECTIVE IS REJECTED.
379 ; DIRECTIVE STATUS OF 'D.RS16' IS RETURNED IF AN ATTEMPT IS MADE
380 ; TO MARK THE REGION FOR DELETE WITHOUT DELETE ACCESS.
381 ; DIRECTIVE STATUS OF 'D.RS86' IS RETURNED IF AN INVALID REGION
382 ; ID IS SPECIFIED OR IF AN ATTEMPT IS MADE TO DETACH
383 ; REGION 0.
384 ;
385 ; OUTPUT FIELDS IN THE REGION DEFINITION BLOCK ARE:
386 ; R.GSTS=INDICATION OF ANY CHANGES IN MAPPING CONTEXT.
387 ; RS.UNM=1 IF ANY WINDOWS WERE UNMAPPED.
388 ;-
389
390 .ENABL LSB
391 $DRDTR::TSTB T.IOC(R5) ;ANY OUTSTANDING I/O?
392 BNE 70$ ;IF NE YES, REJECT FOR NOW
393 ; TM069
394 ; TM069
395 .IF DF A$$TRP&C$$CKP&T$$BUF ; TM069
396 ; TM069
397 BIT #T2.TIO,(R2) ;TASK HAVE OUTSTANDING TERMINAL I/O? ; TM069
398 BNE 70$ ;IF NE YES ; TM069
399 ; TM069
400 .ENDC ; TM069
401 ; TM069
402 ; TM069
403 CALL $SRATT ;SEARCH FOR AND VERIFY REGION ID
404 MOV A.PCB(R5),R0 ;POINT TO PCB
405 BIT #PS.COM,P.STAT(R0) ;DETACHING FROM COMMON REGION?
406 BEQ 60$ ;IF EQ NO, DETACHING FROM TASK REGION
407 MOV H.WND(R4),R4 ;POINT TO NUMBER OF WINDOW BLOCKS
408 TST (R4)+ ;POINT TO FIRST WINDOW BLOCK
409
410 .IFT
411
412 BIT #PS.SYS,P.STAT(R0) ;SYSTEM CONTROLLED PARTITION?
413 BEQ 10$ ;IF EQ NO
414 BIT #RS.MDL,R.GSTS(R3) ;MARK FOR DELETE DESIRED?
415 BEQ 10$ ;IF EQ NO
416 BITB #AS.DEL,A.STAT(R5) ;DOES TASK HAVE DELETE ACCESS?
417 BEQ 70$ ;IF EQ NO
418 BIS #PS.DEL,P.STAT(R0) ;MARK REGION FOR DELETE
419
420 .IFTF
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-7
421
422 10$: CMP W.BATT(R4),R5 ;THIS WINDOW MAPPED TO REGION TO DETACH
423 BNE 20$ ;IF NE NO
424 CALL $UNMAP ;UNMAP WINDOW
425 BIS #RS.UNM,R.GSTS(R3) ;INDICATE WINDOW WAS UNMAPPED
426 20$: ADD #W.BLGH,R4 ;POINT TO NEXT WINDOW BLOCK
427 TSTB A.MPCT(R5) ;ANY MORE WINDOWS MAPPED TO THIS REGION?
428 BNE 10$ ;IF NE YES
429
430 ;+
431 ; **-$DETRG-DETACH REGION BY ATTACHMENT DESCRIPTOR ADDRESS
432 ;
433 ; THIS ROUTINE DETACHES A TASK FROM A REGION AND DEALLOCATES THE ATTACHMENT
434 ; DESCRIPTOR. ON THE LAST DETACH OF A REGION IT IS CHECKED FOR DELETION.
435 ; WHEN APPRORIATE, $NXTSK IS CALLED.
436 ;
437 ; INPUTS:
438 ;
439 ; R5=ADDRESS OF ATTACHMENT DESCRIPTOR
440 ;
441 ; OUTPUTS:
442 ;
443 ; R0,R1,R2,R3 ARE MODIFIED.
444 ;-
445
446 $DETRG::MOV A.PCB(R5),R0 ;POINT TO PCB OF REGION
447 ADD #P.ATT,R0 ;POINT TO ATTACHMENT DESCR LISTHEAD
448 CLR R1 ;CLEAR SEARCH KEY
449 MOV A.TCB(R5),-(SP) ;SAVE TCB ADDRESS
450 CLR A.TCB(R5) ;MARK ATTACHMENT DESCRIPTOR FOR REMOVAL
451 CALL $QRMVT ;REMOVE DESCRIPTOR FROM PCB'S QUEUE
452
453 .IFT
454
455 TST (R0) ;IS ANYONE ELSE ATTACHED? (P.ATT)
456 BNE 50$ ;IF NE YES
457 BIT #PS.SYS,P.STAT-P.ATT(R0) ;IS PARTITION SYSTEM CONTROLLED?
458 BEQ 50$ ;IF EQ NO
459 TST P.NAM-P.ATT(R0) ;IS THIS A NAMED REGION?
460 BEQ 25$ ;IF EQ NO, FORCE DELETION
461 BIT #PS.DEL,P.STAT-P.ATT(R0) ;IS REGION MARKED FOR DELETE?
462 BEQ 55$ ;IF EQ NO
463 25$: SUB #P.ATT,R0 ;POINT TO START OF PCB
464 MOV P.MAIN(R0),R1 ;POINT TO MAIN PARTITION PCB
465 30$: CMP P.SUB(R1),R0 ;DOES THIS PARTITION LINK TO ONE TO DELETE?
466 BEQ 40$ ;IF EQ YES
467 MOV P.SUB(R1),R1 ;POINT TO NEXT SUBPARTITION
468 BNE 30$ ;IF NE THERE IS ONE
469 BR 45$ ;SKIP UNLINK OF PCB (THIS INDICATES $DRCRR CALL)
470 40$: MOV P.SUB(R0),P.SUB(R1) ;UNLINK DETACHED PARTITION
471 45$: MOV #P.LGTH,R1 ;PICK UP SIZE FOR DELETE
472 CALL $DEACB ;DEALLOCATE PCB
473
474 .ENDC
475
476
477 .IF DF D$$ISK
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-8
478
479 49$: MOV A.PCB(R5),R0 ;POINT TO DETACHED PCB
480 MOV R0,R1 ;COPY PCB POINTER
481 MOV P.MAIN(R1),R3 ;POINT TO MAIN PARTITION PCB
482 CALL $RLPR1 ;RELEASE THE PARTITION
483 BR 55$ ;
484 50$: BIT #PS.COM!PS.SYS,P.STAT-P.ATT(R0) ;FIXED TASK PARTITION?
485 BEQ 49$ ;IF EQ NO, RELEASE FIXED TASK PARTITION
486
487 .IFF
488
489 50$: ;REF LABEL
490
491 .ENDC
492
493
494 55$: MOV (SP)+,R0 ;RESTORE TCB ADDRESS
495 ADD #T.ATT,R0 ;POINT TO ATTACHMENT DESCRIPTOR LISTHEAD
496 CLR R1 ;CLEAR SEARCH KEY
497 CLR A.PCB(R5) ;MARK ATTACHMENT DESCRIPTOR FOR REMOVAL
498 CALL $QRMVT ;REMOVE DESCRIPTOR FROM TCB'S LIST
499 MOV R5,R0 ;COPY DESCRIPTOR ADDRESS
500 MOV #A.LGTH,R1 ;SET SIZE TO DEALLOCATE
501 CALLR $DEACB ;DEALLOCATE ATTACHMENT DESCRIPTOR
502 60$: DRSTS D.RS86 ;INVALID REGION ID
503 70$: DRSTS D.RS16 ;ATTEMPT TO MARK FOR DELETE WITHOUT ACCESS
504 .DSABL LSB
505
506 .ENDC
507
508
509 000001 .END
DRREG MACRO M1110 22-AUG-79 07:03 PAGE 4-9
SYMBOL TABLE
A$$CHK= 000000 I$$RDN= 000000 L$$DRV= 000000 P$$RTY= 000000 R$$11S= 000000
A$$CPS= 000000 K$$CNT= 177546 M$$CRB= 000124 P$$TPT= 000000 S$$YSZ= 001740
A$$TRP= 000000 K$$CSR= 177546 M$$MGE= 000000 R$$DER= 000000 V$$CTR= 001200
C$$ORE= 002000 K$$IEN= 000115 M$$NET= 000000 R$$EXV= 000000 V$$RSN= 000031
G$$TPP= 000000 K$$LDC= 000001 M$$NT2= 000000 R$$SND= 000000 X$$DBT= 000000
G$$TTK= 000000 K$$TPS= 000074 N$$LDV= 000001 R$$11M= 000000 $DETRG= 000001 G
H$$RTZ= 000074 L$$ASG= 000000
. ABS. 000000 000
000000 001
ERRORS DETECTED: 0
VIRTUAL MEMORY USED: 1145 WORDS ( 5 PAGES)
DYNAMIC MEMORY: 2980 WORDS ( 11 PAGES)
ELAPSED TIME: 00:00:17
[11,24]DRREG,SY0:[11,34]DRREG/-SP=[1,1]EXEMC/ML,[11,10]RSXMC/PA:1,DRREG