Google
 

Trailing-Edge - PDP-10 Archives - AP-4172F-BM - 3a-sources/qsrfss.mac
There are 31 other files named qsrfss.mac in the archive. Click here to see a list.
TITLE	QSRFSS  --  Failsoft System for QUASAR
SUBTTL	Larry Samberg	13 Nov 77




;THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY ONLY BE USED
;  OR COPIED IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE.
;
;COPYRIGHT (C) 1974, 1975, 1976, 1977, 1978 BY
;	DIGITAL EQUIPMENT CORPORATION, MAYNARD, MASS.

	SEARCH	QSRMAC			;PARAMETER FILE

	PROLOGUE(QSRFSS)		;GENERATE THE NECESSARY SYMBOLS

;
;NOTES:
;
;ALL GLOBAL ROUTINES IN THIS MODULE USE "ONLY" ACS S1 AND S2.
;	CALLERS ARE GUARANTEED THAT ALL OTHER ACS WILL BE
;	RETURNED INTACT.
;
;THE GLOBAL ROUTINES IN THIS MODULE MAKE ONLY ONE ASSUMPTION
;	ABOUT THE CONTENTS OF THE QUEUE REQUESTS THAT THEY
;	FAILSOFT, THAT IS THAT THEY CONTAIN A STANDARD MESSAGE
;	HEADER.
;
;THIS ROUTINE USES A DATA-STRUCTURE CALLED THE "FILE INDEX" OR JUST
;	"INDEX".  UNFORTUNATELY, THE TERM "INDEX" IS USED TO DESCRIBE
;	A TYPE OF REGISTER (ACCUMULATOR) IN AN INSTRUCTION.  WHEN THIS
;	USAGE APPEARS, AN ATTEMPT HAS BEEN MADE TO SPECIFICALLY REFER
;	TO IT AS AN "INDEX REGISTER".  THE TWO USAGES OF THIS WORD ARE
;	DIFFERENT AND DISTINCT, AND SHOULD NOT BE CONFUSED.
COMMENT\

	STOPCDs found in QSRFSS

BRS	BAD REQUEST SIZE
CRF	CREATE REJECTED FAILSOFT DATA
CUD	CLEARING UNUSED DPA
DTL	DPA TOO LARGE
DTS	DPA TOO SMALL
FUD	FOUND UNUSED DPA
NMF	NO MORE FILESPACE
RCN	REQUEST COUNT NEGATIVE
RCW	REBUILD COUNT WRONG
TMS	TOO MANY SECTIONS
WQV	WRONG QUEUE VERSION

\
SUBTTL	Description of Failsoft Files

COMMENT	?
;  !=======================================================!
;  !                                                       !
;  !       INDEX AND UNUSED BLOCKS FOR THIS SECTION        !
;  !                                                       !
;  !                                                       !
;  !-------------------------------------------------------!
;  !                                                       !
;  !                                                       !
;  /             DATA BLOCKS FOR THIS SECTION              /
;  /                                                       /
;  /                                                       /
;  !                                                       !
;  !                                                       !
;  !=======================================================!


;  !=======================================================!
;  !FORMAT VERSION OF THE QUEUE!NO. OF REQUESTS IN SECTION !
;  !-------------------------------------------------------!
;  !                 UNUSED  (CONTAINS 0)                  !
;  !-------------------------------------------------------!
;  !                                                       !
;  !                   INDEX SAT MARKERS                   !
;  !                 FOR THIS INDEX BLOCK                  !
;  !                                                       !
;  !-------------------------------------------------------!
;  !                                                       !
;  /                                                       /
;  /    DESCRIPTION OF THE DATA BLOCKS IN THIS SECTION     /
;  /                                                       /
;  !                                                       !
;  !=======================================================!


?
SUBTTL	Storage Cells

INDEX:	BLOCK	1			;ADDRESS OF CURRENT INDEX

INDTAB:	BLOCK	FSSMNS			;TABLE OF INDEX ADDRESSES
SUBTTL	Global Routines

;THE FOLLOWING ARE GLOBAL ENTRY POINTS IN QSRFSS

	INTERN	F$INIT			;INITIALIZE THE FAILSOFT SYSTEM
	INTERN	F$WRRQ			;WRITE OUT A REQUEST
	INTERN	F$RDRQ			;READ IN A REQUEST
	INTERN	F$RLRQ			;RELEASE A REQUEST
SUBTTL	Initialization


;FAILSOFT SYSTEM INITIALIZATION


F$INIT:	PUSHJ	P,.SAVE1##		;SAVE P1
	PUSHJ	P,I$OQUE##		;GO OPEN UP THE MASTER QUEUES
	PUSHJ	P,REDIDX		;AND GO READ THE MASTER

	HLRZ	S1,@INDTAB		;GET INDEX VERSION NUMBER
	CAIE	S1,FSSQFV		;IS IT RIGHT?
	STOPCD	(WQV,FATAL)		;++WRONG QUEUE VERSION


INIT.1:	CLEAR	P1,			;CLEAR OUT AN INDEX REG
INIT.2:	MOVE	S1,P1			;COPY ARGUMENT FOR REBILD
	SKIPN	INDTAB(S1)		;IS THERE ANOTHER INDEX?
	POPJ	P,			;NO, RETURN
	PUSHJ	P,REBILD		;REBUILD THIS SECTION
	CAIGE	P1,FSSMNS-1		;GOT THEM ALL?
	AOJA	P1,INIT.2		;NO, LOOP
	POPJ	P,			;YES, RETURN
;REBILD  --  LOCAL ROUTINE TO REBUILD THE IN-CORE QUEUES FROM THE
;	CURRENT SECTION.
;
;REBILD IS CALLED DURING INITIALIZATION (ONLY) TO READ IN AND "RE-CREATE"
;	ALL THE REQUESTS IN THE SECTION WHOSE NUMBER IS IN S1.

REBILD:	PUSHJ	P,.SAVE4##		;SAVE P1-P4
	SETZM	G$ERR##			;CLEAR GLOBAL ERROR FLAG
	MOVE	S2,INDTAB(S1)		;GET ADR OF SECTION INDEX
	MOVEM	S2,INDEX		;SAVE AS CURRENT SECTION
	IMULI	S1,FSSBPS		;GET BASE DPA
	MOVEM	S1,REBI.E		;AND SAVE IT
	HRRZ	P1,@INDEX		;GET THE NUMBER OF REQUESTS
	PJUMPE	P1,.POPJ##		;RETURN IF ZERO
	MOVEM	P1,REBI.B		;AND SAVE IT
	MOVE	P2,INDEX		;GET ADDRESS OF INDEX
	ADDI	P2,FSSFDB		;POINT TO FIRST DATA BLOCK
	MOVEM	P2,REBI.A		;AND SAVE IT
	MOVE	P3,INDEX		;GET ADDRESS OF INDEX
	ADDI	P3,777			;POINT TO LAST WORD
	MOVEM	P3,REBI.C		;AND STORE IT
REBI.1:	SKIPN	S1,0(P2)		;GET THE NEXT ENTRY
REBI.2:	JRST	REBI.3			;ZERO, GO ON TO NEXT
	AOJE	S1,REBI.3		;-1 MEANS CONTINUATION, IGNORE
	MOVE	S1,P2			;GET THE ADDRESS
	SUB	S1,INDEX		;MAKE IT A DPA
	ADD	S1,REBI.E		;ADD IN THE BASE
	MOVE	P3,S1			;SAVE DPA IN P3
	PUSHJ	P,F$RDRQ		;AND READ THE REQUEST
	MOVEM	S1,REBI.D		;SAVE THE ADDRESS
	MOVE	M,S1			;AND PUT IT IN M
	TXO	P3,.QIFNC		;SET "INTERNAL FUNCTION" BIT
	STORE	P3,.MSTYP(M),MS.TYP	;AND STORE IN FUNCTION FIELD
					;   THE CREATE ROUTINE TREATS THE
					;   LOW ORDER 17 BITS OF THE MSG
					;   TYPE AS THE DPA ON AN INTERNAL
					;   CALL
	PUSHJ	P,Q$CREATE##		;DO THE CREATE
	SKIPE	G$ERR##			;DID AN ERROR OCCUR
	  STOPCD(CRF,FATAL)		;++CREATE REJECTED FAILSOFT DATA
	MOVE	AP,REBI.D		;GET THE ADDRESS OF THE REQEST
	ADR2PG	AP			;CONVERT TO A PAGE
	PUSHJ	P,M$RELP##		;RELEASE THE PAGE
	SOSG	P1,REBI.B		;DECREMENT AND