Trailing-Edge
-
PDP-10 Archives
-
bb-bt99e-bb
-
mosser.c08
There is 1 other file named mosser.c08 in the archive. Click here to see a list.
REP 1/6 ;08C1
;HERE TO SETUP TO GIVE THGA CONTROL TO FIDDLE WITH THE MF20
DIAGTM::CAIL P1,4 ;MUST BE AT LEAST 4 ARGUMENTS
CAILE P1,5 ;AND FOR THE TIME BEING, NO MORE THAN 5
WIT
;HERE TO SETUP TO GIVE THGA CONTROL TO FIDDLE WITH THE MF/G20
DIAGTM::CAIL P1,4 ;MUST BE AT LEAST 4 ARGUMENTS
IFE FTKLP,<
CAILE P1,5 ;AND FOR THE TIME BEING, NO MORE THAN 5
>
IFN FTKLP,<
CAILE P1,6 ;6 IS ALLOWED FOR THE MG20
>
REP 20/6 ;08C2
ADD T1,P3 ;HIGHEST USER PAGE
WIT
ADDI T1,-1(P3) ;HIGHEST USER PAGE
IFN FTKLP,<
CAIGE P1,6 ;TGHA VERSION 4 OR LATER?
JRST DIAGT0 ;NO, DO IT THE OLD WAY
CAIL T1,MXSECN*PAGSIZ##+PG.BDY ;HIGHEST PAGE NUMBER MUST BE IN A LEGAL SECTION
JRST DIABAL## ;NOT, ILLEGAL ARGUMENT LIST
TRZ T1,PG.BDY## ;HIGHEST PAGE NUMBER ROUNDED DOWN TO A SECTION BOUNDARY
TRZ T2,PG.BDY## ;ROUND DOWN
CAIN T1,(T2) ;ALL REQUESTED PAGES MUST BE IN THE SAME SECTION
CAIGE P2,2000 ; AND MUST BE IN A SECTION GREATER THAN 2
JRST DIABAL## ;NOT, BAD ARGUMENT LIST
HRRI M,2(M) ;POINT AT SIXTH ARGUMENT
PUSHJ P,GETWDU## ;GET USER SUPPLIED SCRATCH PAGES ARGUMENT
HLRZ T3,T1 ;GET NUMBER OF PAGES PROVIDED
CAIGE T3,3 ;MUST BE AT LEAST 3, UPT, MAP, NZS MAP
JRST WRONGN## ;WRONG NUMBER
HRRZS P4,T1 ;FIRST USER SCRATCH PAGE NUMBER
DIAGTA: PUSHJ P,GTPME## ;GET CONTENTS OF USER'S MAP
TLNE T2,(<PM.ACD>B2) ;MUST EXIST, ACCESS ALLOWED,
TLNN T2,(PM.WRT) ; AND BE WRITABLE
JRST DIABAL## ;BAD ARGUMENT LIST FOR LACK OF A BETTER RETURN
AOS T1 ;NEXT PAGE
SOJG T3,DIAGTA ;LOOP OVER ALL PAGES SUPPLIED
LSH P4,P2WLSH## ;CONVERT TO USER VIRTUAL ADDRESS
MOVSI T1,.UPMAP ;COPY THE MAP AND UPT TO USER SCRATCH PAGES
HRRI T1,(P4)
EXCTXU <BLT T1,2*PAGSIZ##-1(P4)>
HRRZ T1,P2 ;FIRST USER PAGE
ANDI T1,PG.BDY## ;PAGE NUMBER WITHIN SECTION
ADDI T1,2*PAGSIZ##(P4) ;STARTING ADDRESS IN SUBSTITUTION SECTION MAP
HLRZ T2,P2 ;FIRST PHYSICAL PAGE
HRLI T2,(<PM.DCD>B2+PM.WRT+PM.PUB) ;PAGE POINTER
MOVE T3,P3 ;NUMBER OF PAGES
DIAGTB: EXCTUX <MOVEM T2,(T1)> ;STORE POINTER IN SCRATCH SECTION MAP
AOS T1 ;NEXT PAGE IN SECTION
AOS T2 ;NEXT PHYSICAL PAGE
SOJG T3,DIAGTB ;LOOP FOR ALL PAGES
EXCTUX <MAP T1,(P4)> ;PHYSICAL ADDRESS OF WHAT WILL BE THE SECTION 0 MAP
TLZ T1,777760 ;CLEAR EXTRANEOUS BITS
LSH T1,W2PLSH## ;CONVERT TO PAGE NUMBER
HRLI T1,(<PM.DCD>B2+PM.PUB+PM.WRT)
EXCTXU <MOVEM T1,PAGSIZ##+SECTAB+0(P4)> ;SECTION 0 MAP POINTER
MOVSI T1,SECTAB+0(<PM.ICD>B2+PM.WRT+PM.PUB)
EXCTXU <MOVEM T1,PAGSIZ##+SECTAB+1(P4)> ;SECTION 1 IS @ SECTION 0
EXCTUX <MAP T1,2*PAGSIZ##(P4)> ;PHYSICAL ADDRESS OF WHAT WILL BE
; SUBSTITUTION SECTION MAP
TLZ T1,777760 ;CLEAR EXTRANEOUS BITS
LSH T1,W2PLSH## ;CONVERT TO PAGE NUMBER
HRLI T1,(<PM.DCD>B2+PM.WRT+PM.PUB)
MOVE T2,P2 ;SECTION NUMBER TO MAP
LSH T2,W2PLSH##
ADD T2,P4
EXCTXU <MOVEM T1,PAGSIZ##+SECTAB(T2)> ;MAP POINTER FOR SUBSTITUTION SECTION
EXCTUX <MAP T1,PAGSIZ##(P4)> ;PHYSICAL PAGE NUMBER OF WHAT WILL BE UPT
TLZ T1,777760 ;CLEAR EXTRANEOUS BITS
LSH T1,W2PLSH## ;CONVERT TO PAGE NUMBER
EXCTUX <HRRM T1,PAGSIZ##+.UPMP/PAGSIZ##(P4)> ;MAP UPMP PER PROCESS IN THIS UPT
EXCTUX <HRRM T1,PAGSIZ##+.UUPMP/PAGSIZ##(P4)> ;DITTO FOR CACHED
HRLI T1,(LG.LUB) ;SET TO LOAD THE USER BASE REGISTER
HRRZ P2,JBTUPM##(J) ;GET CURRENT UPT
CONO PI,PI.OFF ;NO PIS
HRRM T1,.CPSPT## ;SETUP THE SPT
HRRM T1,JBTUPM##(J) ;AND JBTUPM
DATAO PAG,T1 ;AND IF WE DIDN'T MISS ANY IMPORTANT POINTERS,
; EVERYTHING IS NOW ADDRESSABLE THROUGH THE SCRACH MAPS
CONO PI,PI.ON ;PIS ARE NOW OK
HRRI M,-2(M) ;POINT M BACK AT 4TH ARGUMNET
MOVE P3,P4 ;VIRTUAL ADDRESS OF SCRATCH MAPS
TLO P3,400000 ;TO DISTINGUISH IT FROM NUMBER OF PAGES
JRST DIAGTC ;JOIN COMMON CODE FOR OLD TGHA
DIAGT0:>
REP 38/6 ;08C3
CAIG P1,4 ;A FIFTH ARGUMENT SUPPLIED?
WIT
DIAGTC: CAIG P1,4 ;A FIFTH ARGUMENT SUPPLIED?
REP 42/6 ;08C4
MOVEI T2,2 ;TWO WORDS OF FUNNY SPACE
PUSHJ P,GTFWDC## ;GET IT
WIT
MOVEI T2,2 ;TWO WORDS OF FREE SPACE
PUSHJ P,GETWDS## ;GET IT
INS 27/7 ;08C5
CONO PAG,@.CPEBR## ;LET THE HARDWARE KNOW
REP 1/8 ;08C6
;HERE WHEN THGA RELENQUISHES CONTROL AFTER FIDDLING WITH THE MF20
WIT
;HERE WHEN THGA RELENQUISHES CONTROL AFTER FIDDLING WITH THE MF/G20
REP 13/8 ;08C7
PUSHJ P,SLEEP## ;SO CAN CALL CPUAPP AND GET THE THINGS STARTED AGAIN EVERWHERE
WIT
PUSHJ P,SLEEP## ;SO CAN CALL CPUAPP AND GET THINGS STARTED AGAIN EVERWHERE
REP 22/8 ;08C8
>
WIT
>
INS 27/8 ;08C9
IFN FTKLP,<
JUMPG T3,DIAGVA ;JUMP IF OLD VERSION OF TGHA
; PUSHJ P,STEUB## ;RESTORE MAPS (CAN'T DO A PUSHJ)
HRRZ T1,(T1) ;T1 = THE PAGE NUMBER OF THE USER PROCESS TABLE
CONO PI,PI.OFF ;NO INTERRUPTS WHILE CHANGING UBR/SPT
HRRM T1,.CPSPT## ;SETUP NEW SPT
HRRM T1,JBTUPM##(J) ;AND JBTUPM
HRLI T1,(LG.LUB) ;REQUEST LOADING UBR
DATAO PAG,T1 ;SETUP THE UBR AND CLEAR PAGING MEMORY
CONO PI,PI.ON ;INTERRUPTS ARE OK NOW
MOVSI T1,PAGSIZ##(T3) ;WHERE THE PDL IS
HRRI T1,JOBPDO ;WHERE IT SHOULD BE
EXCTUX <BLT T1,JOBPDO+PDLLEN-1> ;PUT IT BACK
JRST DIAGVB ;JOIN COMMON CODE
DIAGVA:>
REP 33/8 ;08C10
MOVE T2,.PDDIA##(W) ;ADDRESS OF ARGUMENT SAVE BLOCK
SETZM .PDDIA##(W) ;ZERO DIAG WORD
MOVEI T1,2 ;2 WORDS TO RETURN
PUSHJ P,GVFWDS## ;RETURN THE FUNNY SPACE
WIT
DIAGVB: MOVE T2,.PDDIA##(W) ;ADDRESS OF ARGUMENT SAVE BLOCK
SETZM .PDDIA##(W) ;ZERO DIAG WORD
MOVEI T1,2 ;2 WORDS TO RETURN
PUSHJ P,GIVWDS## ;RETURN THE FUNNY SPACE
REP 41/8 ;08C11
WIT
SUM 233874