TITLE QSRIPC -- IPC Handler for QUASAR
;
;
; COPYRIGHT (c) 1975,1976,1977,1978,1979
; DIGITAL EQUIPMENT CORPORATION
;
; THIS SOFTWARE IS FURNISHED UNDER A LICENSE AND MAY BE USED
; AND COPIED ONLY IN ACCORDANCE WITH THE TERMS OF SUCH LICENSE
; AND WITH THE INCLUSION OF THE ABOVE COPYRIGHT NOTICE. THIS
; SOFTWARE OR ANY OTHER COPIES THEREOF MAY NOT BE PROVIDED OR
; OTHERWISE MADE AVAILABLE TO ANY OTHER PERSON. NO TITLE TO
; AND OWNERSHIP OF THE SOFTWARE IS HEREBY TRANSFERRED.
;
; THE INFORMATION IN THIS SOFTWARE IS SUBJECT TO CHANGE
; WITHOUT NOTICE AND SHOULD NOT BE CONSTRUED AS A COMMITMENT
; BY DIGITAL EQUIPMENT CORPORATION.
;
; DIGITAL ASSUMES NO RESPONSIBILITY FOR THE USE OR RELIABILITY
; OF ITS SOFTWARE ON EQUIPMENT WHICH IS NOT SUPPLIED BY
; DIGITAL.
SEARCH QSRMAC,GLXMAC ;PARAMETER FILE
PROLOGUE(QSRIPC) ;GENERATE THE NECESSARY SYMBOLS
MSGSIZ: BLOCK 1 ;RECIEVED MESSAGE LENGTH

;CONTINUED FROM THE PREVIOUS PAGE
GET.3: HRLS S1 ;SOURCE = ADDRESS IN GLXIPC
HRRI S1,IPCDAT(AP) ;DESTIN = QUEUE SPACE
STORE S1,IPCMES(AP),IPM.AD ;STORE THAT NOW THAT WE HAVE IT
MOVE S2,G$MPS## ;GET THE MIN PACKET SIZE
CAIGE S2,SPL.SZ ;IF ITS LESS THEN THE SPOOL SIZE,
MOVEI S2,SPL.SZ ; THEN USE THE SPOOL SIZE
CAMGE S2,MSGSIZ ;IF THE MSG SIZE IS GREATER THEN THE
MOVEM S2,MSGSIZ ; QUEUE SIZE,,USE THE QUEUE SIZE
MOVE S2,MSGSIZ ;NOW USE THE MSG LENGTH FOR THE BLT
ADDI S2,(S1) ;COMPUTE END ADDRESS
BLT S1,-1(S2) ;MOVE THE MESSAGE TO OUR QUEUE SPACE
GET.4: PUSHJ P,M$ELNK## ;ADD NEW ENTRY AT THE END
JRST C$GET ;KEEP DOING THIS UNTIL NO MORE MESSAGES

SUBTTL C$PUT -- Routine to return free IPC core
;THIS ROUTINE IS CALLED TO PLACE AN IPC QUEUE ENTRY BACK INTO
; THE FREE SPACE. A CHECK IS MADE TO SEE IF IT IS A PAGED
; MESSAGE, AND IF SO THE PAGE IS RELEASED FIRST. CALLED
; WITH AP POINTING TO THE ENTRY.
C$PUT: MOVEI H,HDRIPC## ;SET UP H FOR M$PFRE
LOAD S1,IPCMES(AP),IPM.AD ;GET THE ADDRESS OF THE MESSAGE
ADR2PG S1 ;CONVERT TO A PAGE NUMBER
MOVE S2,IPCFLG(AP) ;GET FLAGS
TXNE S2,IP.CFV ;IS IT PAGED?
PUSHJ P,M%RELP ;YES, RELEASE THE PAGE
PJRST M$PFRE## ;AND RETURN VIA PFRE