Google
 

Trailing-Edge - PDP-10 Archives - bb-bt99e-bb - sched1.c11
There is 1 other file named sched1.c11 in the archive. Click here to see a list.
 REP 3/33	;11C1
	BQFOR::	SKIPG	RRFLAG##	;CLASS SCHEDULING?
 WIT
	BQFOR::	SKIPN	BBFIT##		;ALREADY FITTING IN A BB JOB?
		SKIPG	RRFLAG##	;CLASS SCHEDULING?
 REP 46/42	;11C2
		JRST	SWAP1
 WIT
		JRST	FININ5
 REP 3/44	;11C3
		SKIPN	BBFIT##		;IS JOB IN BACKGROUND BATCH?
		JRST	FININ6		;NO
		IORM	F,JBTST2##(J)	;SET THE BACKGROUND BATCH BIT
		SKIPE	JBTJIL##(J)	;SHOULD BE ZERO
		JRST	FININ7		;OOPS
		HLRZ	T1,JBTBBQ##	;CURRENT LAST ENTRY IN B B QUEUE
		HRLM	J,JBTBBQ##	;NEW LAST ENTRY
		HRRM	J,JBTJIL##(T1)	;FORWARD LINK
		HRLI	T1,MBBQ##	;OFFSET OF BBQ HEADER
		MOVSM	T1,JBTJIL##(J)	;OLD LAST ENTRY,,HEADER
		JRST	FININ7		;AND PROCEED
	FININ6:	ANDCAM	F,JBTST2##(J)	;CLEAR THE BACKGROUND BATCH BIT
		SKIPGE	JBTSCD##(J)	;IS JOB IN PQ2?
	>
 WIT
		CAME	J,BBFIT##	;IS THIS JOB IN BACKGROUND BATCH?
		JRST	FININ6		;NO
		IORM	F,JBTST2##(J)	;SET THE BACKGROUND BATCH BIT
		MOVEI	T1,MBBQ##	;OFFSET TO BBQ
		JRST	FNIN6A
	FININ6:	ANDCAM	F,JBTST2##(J)	;CLEAR THE BACKGROUND BATCH BIT
		MOVEI	T1,-JIQ##	;OFFSET TO JBTJIQ
		SKIPGE	JBTSCD##(J)	;IS JOB IN PQ2?
	FNIN6A:>
 REP 23/44	;11C4
		HLRZ	T1,JBTJIQ##	;CURRENT LAST ENTRY
		HRLM	J,JBTJIQ##	;NEW LAST ENTRY
		HRRM	J,JBTJIL##(T1)	;NEW FORWARD POINTER
		HRLOM	T1,JBTJIL##(J)	;SETUP THIS JOBS POINTERS
 WIT
	IFN FTMP,<
		CPLOCK	(SCD)
	>
		HLL	T1,JBTJIL##(T1)	;PREVIOUS LAST JOB
		HRLM	J,JBTJIL##(T1)	;LAST JOB IS NOW US
		MOVEM 	T1,JBTJIL##(J)	;HE IS OUR PREDECESSOR & QUEUE HEADER SUCCESSOR
		HLRZS	T1		;POINT TO HIM
		HRRM	J,JBTJIL##(T1)	;POINT HIM TO US
	IFN FTMP,<
		CPUNLK	(SCD)
	>
 INS 30/44	;11C5
		CAMN	J,BBFIT##	;BB JOB BEING FIT IN?
 INS 59/44	;11C6

	;HERE IF THERE'S A COLLISION ON A HIGH SEG FOR A JOB WHICH JUST
	;FINISHED SWAPPING (JOB # IN J)

	FININ5:	SKIPE	JBTJIL##(J)	;THIS BETTER BE ZERO
		JRST	SWAP1		;ELSE WE'VE BEEN HERE BEFORE
	;NOTE THAT THE FOLLOWING 5 LINES ARE NOT UNDER THE SCHEDULAR INTERLOCK.
	;THIS IS BECAUSE IT CAN ONLY BE EXECUTED ON POLICY RIGHT NOW (SWAPPER
	;DOESN'T RUNO ON NON-POLICY), AND THE JOBS IN THE QUEUE ARE NOT RUNNABLE
	;SO CANNOT BE RUN BY THE SCHEDULAR.  SHOULD ANY OF THE ABOVE CHANGE,
	;THE CODE WILL AHVE TO BE PUT UNDER SCDLOK.
		HLRZ	T1,JBTHSQ##	;LAST JOB WAITING FOR A HIGH SEG
		HRLM	J,JBTHSQ##	;NEW LAST JOB IS US
		HRRM	J,JBTJIL##(T1)	;POINT PREVIOUS LAST TO US
		HRLI	T1,-HSQ##	;WE ARE LAST SO POINT AT HEADER
		MOVSM	T1,JBTJIL##(J)
		JRST	SWAP1		;AND IGNORE US FOR NOW
 INS 54/45	;11C7
		CAMN	J,BBFIT##	;WAS THIS A BB JOB?
		SETZM	BBFIT##		;YES, CLEAR FLAG SO OTHERS CAN COME IN
 REP 2/47	;11C8
	SWP2:	SKIPE	J,FORCE##	;WAITING FOR JOB TO BECOME SWAPPABLE?
 WIT
	SWP2:
		SKIPG	J,JBTHSQ##	;IS THERE A HIGH SEG WAITING TO FINISH?
		JRST	SWP9		;NO
	SWP3:	HRRZS	J		;YES, SEE IF WE CAN DO ANYTHING WITH IT
		CAME	J,FORCE##	;WAITING TO GO OUT?
		CAMN	J,FORCEF	;?
		JRST	SWP5		;YES, IGNORE FOR NOW
		PUSH	P,J		;SAVEJOB # TO DEQUEUE
		PUSHJ	P,FINCHK##	;WELL?
		  JRST	SWP4		;NO
		  SKIPA	T1,[FIT1]	;WHERE TO GO TO IN THIS CASE
		MOVEI	T1,FININ3	;AND IN THIS
		EXCH	T1,(P)		;STORE ADDRESS, GET OLD JOB
		EXCH	T1,J		;NEW JOB TO T1,OLD JOB TO J
		PUSH	P,T1		;SAVE NEW JOB
		MOVE	T1,JBTJIL##(J)	;GET PREDECESSOR,,SUCCESSOR
		HLLM	T1,JBTJIL##(T1)	;STORE PREDECESSOR TO SUCCESSOR
		MOVSS	T1
		HLRM	T1,JBTJIL##(T1)	;FIX UP THE QUEUE
		SETZM	JBTJIL##(J)	;CLEAR
		POP	P,J		;RESTORE J
		POPJ	P,		;RETURN TO THE APPROPRIATE PLACE
	SWP4:	POP	P,J		;RESTORE J WE STARTED WITH
	SWP5:	HRRE	J,JBTJIL##(J)	;NEXT
		JUMPG	J,SWP3
	SWP9:
		SKIPE	J,FORCE##	;WAITING FOR JOB TO BECOME SWAPPABLE?
 DEL 2/49	;11C9
	IFN FTNSCHED,<
		SETZM	BBFLAG##	;WE ARE NOT SCANNING THE BACKGROUND BATCH QUEUE YET
	>
 INS 15/49	;11C10
	IFN FTNSCHED,<
		SETZM	BBFLAG##	;WE ARE NOT SCANNING THE BACKGROUND BATCH QUEUE YET
	>
 REP 4/60	;11C11
		SKIPN	BBFIT##		;WAS BACKGROUND BATCH SELECTED FOR SWAPIN?
 WIT
		SKIPE	J,BBFIT##	;WAS BACKGROUND BATCH SELECTED FOR SWAPIN?
		CAME	J,FIT##		;REALLY JUST SELECTED?
 REP 37/60	;11C12
	NOFITZ:	SETZM	FIT##		;CLEAR JOB BEING FIT IN
	IFN FTNSCHED,<
 WIT
	NOFITZ:	SKIPE	J,FIT##		;GET JOB IN FIT BEFORE ZAPPING IT
		SETZM	FIT##
	IFN FTNSCHED,<
		CAMN	J,BBFIT##	;DON'T CLEAR UNLESS WE'RE SUPPOSED TO
 REP 44/60	;11C13
	ZERFIT:	SETZM	FIT##		;CLEAR FIT SO WE CAN RESELECT
	IFN FTNSCHED,<
 WIT
	ZERFIT:	SKIPE	W,FIT##		;GET JOB # IN FIT
		SETZM	FIT##		;CLEAR FIT SO WE CAN RESELECT
	IFN FTNSCHED,<
		CAMN	W,BBFIT##	;DON'T CLEAR UNLESS WE'RE SUPPOSED TO
 SUM 196284