Trailing-Edge
-
PDP-10 Archives
-
bb-bt99e-bb
-
ovrlay.c07
There is 1 other file named ovrlay.c07 in the archive. Click here to see a list.
REP 2/1 ;07C1
SUBTTL D.M.NIXON/DMN/JLd/JNG/MCHC/DZN/PAH/HD 20-Jan-83
WIT
SUBTTL D.M.NIXON/DMN/JLd/JNG/MCHC/DZN/PAH/HD/JBS/TARL 24-Oct-83
REP 30/1 ;07C2
DECEVR==204 ;DEC EDIT VERSION
WIT
DECEVR==210 ;DEC EDIT VERSION
INS 79/7 ;07C3
;205 HD 1-Feb-83
; Fix edit 201. It should ask for default number of output buffers only
; by putting -1,,0 in .FONBF at LFOWRT.
;206 JBS 25-Jul-83
; Make dummy edit for TOPS-10 OVRLAY - two lines were swapped in
; the released version at RLO7.
;207 TARL 28-Aug-83
; Fix problem with running virtual with overlays. OVRLAY could
; request a transfer that wouldn't fit in physical memory, and
; PFH can't split up FILOP. IOWDs. Make OVRLAY check for amount
; of memory allowed to use, and split up its request to fit
; in this size. This should also prove to be a slight performance
; win. TOPS-10 only.
;210 JBS 24-Oct-83
; Set FO.PRV in all FILOP. blocks so privileged users (JACCT and [1,2])
; can run overlaid programs when pathed into another PPN. TOPS-10 only.
REP 27/29 ;07C4
;**; Unrelocate the link here if necessary.
WIT
; Unrelocate the link here if necessary.
REP 16/40 ;07C5
HRRM T0,(T1)
ADD T0,T3
WIT
HRRM T0,(T1) ;[206]
ADD T0,T3 ;[206]
REP 5/48 ;07C6
OVLINI: MOVX T1,FO.ASC ;[100] ALLOCATE A NEW CHANNEL
WIT
OVLINI: MOVX T1,FO.PRV+FO.ASC ;[210] GET EXTENDED CHANNEL WITH PRIVS
REP 8/49 ;07C7
TMPINI: MOVX T1,FO.ASC+.FOWRT ;[100] ASK FOR CHAN AND SUPERSEDE
WIT
TMPINI: MOVX T1,FO.PRV+FO.ASC+.FOWRT ;[210] ASK FOR CHAN, SUPERSEDE, PRIVS
INS 22/49 ;07C8
MOVX T1,FO.PRV ;[210] WANT TO USE PRIVS
IORM T1,TFOREL+.FOFNC ;[210] PUT INTO BLOCK
REP 26/49 ;07C9
MOVX T1,FO.ASC+.FOSAU ;[100] FIX FILOP. BLOCK FOR UPDATE
WIT
MOVX T1,FO.PRV+FO.ASC+.FOSAU ;[210] FIX FILOP. BLOCK FOR UPDATE
INS 20/50 ;07C10
TXO T1,FO.PRV ;[210] ASK FOR PRIVS IF WE'VE GOT THEM
REP 31/50 ;07C11
;THE THREE ROUTINES HERE ALL READ DATA FROM THE OVERLAY OR TEMPORARY FILE,
;PRESERVING ALL ACCUMULATORS. %INB SETS UP A COMPLETE COMMAND LIST ASSUMING 200
;WORDS AT INBFR, %INZ ASSUMES THAT THE COMMAND WORD IS ALREADY IN T0 AND NEEDS
;ONLY THE ENDING 0 IN T1, AND %IN ASSUMES THAT THE ENTIRE LIST IS ALREADY SET
;UP, BEGINNING IN T0.
%INB: MOVE T0,[IOWD 200,INBFR] ;[100] SET UP DEFAULT COMMAND LIST
%INZ: SETZ T1, ;[100] FINISH PRE-SPECIFIED LIST
%IN: PUSH P,T2 ;[100] SAVE AN AC FOR FILOP.
WIT
;[207] THE TWO ROUTINES HERE READ DATA FROM THE OVERLAY OR TEMPORARY
;[207] FILE, PRESERVING ALL ACCUMULATORS. %INB SETS UP A COMPLETE
;[207] COMMAND LIST ASSUMING 200 WORDS AT INBFR, %INZ ASSUMES THAT THE
;[207] COMMAND WORD IS ALREADY IN T0 AND NEEDS ONLY THE ENDING 0 IN
;[207] T1.
%INB: MOVE T0,[IOWD 200,INBFR] ;[100] SET UP DEFAULT COMMAND LIST
%INZ: PUSH P,T2 ;[207] SAVE AN AC FOR FILOP.
REP 45/50 ;07C12
MOVE T2,[.FOIOS+1,,FILBLK] ;[100] READ IN THE DATA
FILOP. T2, ;[100] ..
WIT
PUSHJ P,%FILIO ;[207] DO FILOP I/O
INS 13/51 ;07C13
TXO T1,FO.PRV ;[210] ASK FOR PRIVS IF WE'VE GOT THEM
REP 31/51 ;07C14
MOVE T2,[.FOIOS+1,,FILBLK] ;[100] READ IN THE DATA
FILOP. T2, ;[100] ..
WIT
PUSHJ P,%FILIO ;[207] DO FILOP I/O
INS 37/51 ;07C15
;[207] %FILIO WILL EXECUTE A DUMP MODE IN OR OUT FILOP, BREAKING THE
;[207] IOWD UP INTO SMALL ENOUGH CHUNKS TO FIT INTO PHYSICAL MEMORY
;[207] LIMITS. THIS IS TO GET AROUND A DEFICIENCY IN PFH WHERE IT WILL
;[207] NOT DO BREAKDOWN OF FILOP I/O. ASSUMES T0 HAS THE IOWD,
;[207] TRASHES T1 AND T2.
%FILIO: PUSH P,T0 ;[207] SAVE IOWD
PUSH P,T3 ;[207] SCRATCH REGISTER TO KEEP SIZE IN
HLRO T3,T0 ;[207] GET SIZE TO DO IN NEGATIVE WORDS
MOVN T3,T3 ;[207] MAKE IT POSITIVE WORDS
%FILI1: CAIG T3,1000 ;[207] IS REQUEST LARGER THAN 1 PAGE?
JRST %FILI2 ;[207] NO, JUST DO IT.
PUSHJ P,%IOSIZ ;[207] FIND OUT WHAT SIZE IS ALLOWED
JUMPE T1,%FILI3 ;[207] NOT VIRTUAL, JUST GO DO IT.
CAML T1,T3 ;[207] WILL REQUEST FIT?
JRST %FILI2 ;[207] YES, JUST DO IT
MOVN T1,T1 ;[207] NO, SET UP FOR WHAT WE CAN DO
HRL T0,T1 ;[207] ADJUST IOWD TO DO WHAT WE CAN
%FILI2: SETZ T1, ;[207] END OF IOWD
%FILI3: MOVX T2,FO.PRV ;[210] WANT TO USE PRIVS
IORM T2,FILBLK+.FOFNC ;[210] PUT INTO BLOCK
MOVE T2,[.FOIOS+1,,FILBLK] ;[207] ARGUMENT WORD FOR FILOP
FILOP. T2, ;[207] DO THE I/O
JRST %FILI8 ;[207] FAILED, GIVE FAIL RETURN
HLRO T1,T0 ;[207] NEGATIVE AMOUNT WE DID
ADD T3,T1 ;[207] SUBTRACT AMOUNT DONE FROM
;[207] AMOUNT LEFT
JUMPE T3,%FILI7 ;[207] DONE
SUB T0,T1 ;[207] ADD AMOUNT DONE TO POINTER
MOVN T1,T3 ;[207] NEGATIVE SIZE TO GO
HRL T0,T1 ;[207] MAKE IOWD FOR AMOUNT LEFT TO DO
;[207] NOTE THAT THE CODE FROM %FILI4 THROUGH %FILI7 IS AN EXACT
;[207] DUPLICATE OF THE CODE FROM %FILI1 THROUGH %FILI4. THIS IS TO
;[207] EXPLICITLY DEFEAT THE CHECK IN PFH AT FULL1-2, WHERE HE CHECKS
;[207] THE PC OF THE UUO. THIS WILL CAUSE BIGXFR/1000 PAGE FAULTS AT
;[207] ONE PC, THEN THE SAME NUMBER OF PAGE FAULTS AT THE NEXT PC,
;[207] THEREBY BYPASSING THE DUMP MODE I/O CHECK
%FILI4: CAIG T3,1000 ;[207] IS REQUEST LARGER THAN 1 PAGE?
JRST %FILI5 ;[207] NO, JUST DO IT.
PUSHJ P,%IOSIZ ;[207] FIND OUT WHAT SIZE IS ALLOWED
JUMPE T1,%FILI6 ;[207] NOT VIRTUAL, JUST GO DO IT.
CAML T1,T3 ;[207] WILL REQUEST FIT?
JRST %FILI5 ;[207] YES, JUST DO IT
MOVN T1,T1 ;[207] NO, SET UP FOR WHAT WE CAN DO
HRL T0,T1 ;[207] ADJUST IOWD TO DO WHAT WE CAN
%FILI5: SETZ T1, ;[207] END OF IOWD
%FILI6: MOVX T2,FO.PRV ;[210] WANT TO USE PRIVS
IORM T2,FILBLK+.FOFNC ;[210] PUT INTO BLOCK
MOVE T2,[.FOIOS+1,,FILBLK] ;[207] ARGUMENT WORD FOR FILOP
FILOP. T2, ;[207] DO THE I/O
JRST %FILI8 ;[207] FAILED, GIVE FAIL RETURN
HLRO T1,T0 ;[207] NEGATIVE AMOUNT WE DID
ADD T3,T1 ;[207] SUBTRACT AMOUNT DONE FROM
;[207] AMOUNT LEFT
JUMPE T3,%FILI7 ;[207] DONE
SUB T0,T1 ;[207] ADD AMOUNT DONE TO POINTER
MOVN T1,T3 ;[207] NEGATIVE SIZE TO GO
HRL T0,T1 ;[207] MAKE IOWD FOR AMOUNT LEFT TO DO
JRST %FILI1 ;[207] AND LOOP
%FILI7: AOS -2(P) ;[207] SET UP SUCCESS RETURN
%FILI8: POP P,T3 ;[207] RESTORE SCRATCH REGISTER
POP P,T0 ;[207] AND RESTORE ORIGINAL IOWD
POPJ P, ;[207] AND RETURN
;[207] %IOSIZ - RETURN MAXIMUM SIZE FOR AN I/O REQUEST WHICH WILL NOT
;[207] CAUSE PROBLEMS WITH THE PAGE FAULT HANDLER. RETURNS T1/ NUMBER
;[207] OF WORDS (MULTIPLE OF 1000), PRESERVES ALL OTHER ACS ROUTINE
%IOSIZ: PUSH P,T4 ;[207] SAVE AN AC
HRROI T4,.GTVRT ;[207] GET VIRTUAL SIZE INFO
GETTAB T4, ;[207]
SETZ T4, ;[207]
HRROI T1,.GTSGN ;[207] GET HISEG INFO
GETTAB T1, ;[207]
SETZ T1, ;[207] GENERATE BOGUS VALUE IF IT FAILS
TLNE T1,(SN%SHR) ;[207] IS SEGMENT SHARABLE?
TDZA T1,T1 ;[207] SHARABLE, DON'T COUNT HISEG SIZE
LDB T1,[POINT 9,T4,26] ;[207] GET NUMBER OF HISEG PAGES
ANDI T4,777 ;[207] ISOLATE NUMBER OF LOSEG PAGES
ADD T4,T1 ;[207] ADD TOGETHER FOR VIRTUAL SIZE
HRROI T1,.GTSWP ;[207] GET SWAPPING (PHYSICAL) SIZE
GETTAB T1, ;[207] FROM MONITOR
SETZ T1, ;[207] IF IT FAILS, GENERATE A
;[207] BOGUS VALUE
ANDI T1,777 ;[207] ONLY NUMBER OF PAGES
CAMG T4,T1 ;[207] IS VIRTUAL SIZE GREATER
;[207] THAN PHYS?
JRST [ SETZ T1, ;[207] NO
JRST %IOSI3] ;[207] RETURN WITH FLAG TO DO TRANSFER
HRROI T1,.GTCVL ;[207] CURRENT MEMORY LIMITS
GETTAB T1, ;[207] ASK THE MONITOR
SETZ T1, ;[207] ZERO
TRZE T1,400000 ;[207] LIMIT VS GUIDELINE BIT SET?
TRNN T1,-1 ;[207] DO WE HAVE A LIMIT SET?
TRNA ;[207] NOPE, TRY FOR ACCOUNT LIMIT
JRST %IOSI2 ;[207] HAVE A LIMIT. USE IT.
HRROI T1,.GTMVL ;[207] ACCOUNT MEMORY LIMITS
GETTAB T1, ;[207] ASK THE MONITOR
SETZ T1, ;[207] THIS MONITOR HAS PROBLEMS.
TRNN T1,-1 ;[207] PHYSICAL LIMIT SET?
JRST T1,%IOSI2 ;[207] YES, USE THIS ONE
MOVX T1,%NSCMX ;[207] CORMAX
GETTAB T1, ;[207] ASK FOR MAX LIMIT ON ALL JOBS
SETZ T1, ;[207] SICK MONITOR
LSH T1,-^D9 ;[207] MAKE IT PAGES
%IOSI2: TLZ T1,-1 ;[207] CLEAR LEFT HALF
LSH T1,^D9 ;[207] MAKE INTO WORDS
SUBI T1,SLOSH ;[207] SLOSH FACTOR. SEE BELOW.
CAIL T1,BIGXFR ;[207] DON'T ALLOW LARGER THAN THIS
MOVEI T1,BIGXFR ;[207] MAX
CAIG T1,1000 ;[207] DON'T ALLOW LESS THAN THIS
MOVEI T1,1000 ;[207] MIN
%IOSI3: POP P,T4 ;[207] RESTORE SCRATCH AC
POPJ P, ;[207] RETURN
SLOSH==7*1000 ;[207]
BIGXFR==24*1000 ;[207]
;[207] SLOSH FACTOR ABOVE IS TO ALLOW FOR:
;[207] 2 PAGES PFH
;[207] 1 PAGE WITH PC OF FILOP
;[207] 1 PAGE WITH PSI VECTOR
;[207] 1 PAGE WITH JBINT VECTOR
;[207] 1 PAGE JOBDAT
;[207] 1 PAGE SLOSH
;[207] IF WE EVER NEED A LARGER SLOSH VECTOR, I'LL BE SURPRISED. IT'S
;[207] POSSIBLE BY MAKING PSI VECTOR AND JBINT BLOCK BE ON PAGE
;[207] BOUNDARIES AND HAVE THE IO NOT BE ON PAGE BOUNDARIES, BUT I'M
;[207] NOT GOING TO WORRY ABOUT IT.
;[207] BIGXFR IS SET TO 24 PAGES, WHICH IS TO AVOID TOO MANY PAGE
;[207] FAULTS ON THE SAME UUO AT ONCE. SEE TSTDMP+4 IN PFH. NOTE THAT
;[207] INCREASING THE NUMBER IN PFH WOULD ALLOW INCREASING THIS
;[207] NUMBER, BUT WOULD SHOW UP AS A PERFORMANCE HIT IN ORDINARY DUMP
;[207] MODE IOWD BREAKDOWN.
REP 30/56 ;07C16
MOVX T1,FO.ASC ;[100] ALLOCATE AN EXTENDED CHANNEL
WIT
MOVX T1,FO.PRV+FO.ASC ;[210] ALLOCATE AN EXTENDED CHANNEL
INS 15/58 ;07C17
TXO T1,FO.PRV ;[210] ASK FOR PRIVS IF WE'VE GOT THEM
REP 9/59 ;07C18
JRST LOGCLX ;[100] THEN JUST STOP LOGGING
WIT
JRST LOGCLX ;[210] THEN JUST STOP LOGGING
MOVX T1,FO.PRV ;[210] WANT TO USE PRIVS
IORM T1,LFOREL+.FOFNC ;[210] PUT INTO BLOCK
REP 15/60 ;07C19
-1,,-1 ;[201] DEFAULT NUMBER OF BUFFERS
WIT
-1,,0 ;[205] DEFAULT NUMBER OF BUFFERS
REP 24/67 ;07C20
;**; Find out if spec is user's terminal, and set .OVRLO to -1,,.PRIOU if so.
;**; If so, release the JFN too.
WIT
; Find out if spec is user's terminal, and set .OVRLO to -1,,.PRIOU if so.
; If so, release the JFN too.
SUM 121063