DIRECTORY Basics USING [charsPerWord], PrincOpsUtils USING [LongCOPY], RPC USING [Zones], RPCLupine USING [DataLength, maxDataLength, --PktLength,-- RPCPkt, StubPkt]; LupineRuntime: DEFINITIONS IMPORTS PrincOpsUtils = BEGIN OPEN RpcPrivate: RPCLupine; TranslationError: ERROR; BindingError: ERROR; RuntimeError: ERROR; MarshalingError: PROCEDURE; MarshalingExprError: PROCEDURE RETURNS [never: UNSPECIFIED]; UnmarshalingError: PROCEDURE; UnmarshalingExprError: PROCEDURE RETURNS [never: UNSPECIFIED]; DispatchingError: PROCEDURE RETURNS [never: UNSPECIFIED]; defaultZones: RPC.Zones; NilHeader: TYPE = BOOLEAN _ NULL; RopeHeader: TYPE = CARDINAL _ NULL; ListHeader, SequenceHeader: TYPE = LONG CARDINAL _ NULL; StringHeader: TYPE = MACHINE DEPENDENT RECORD [ header (0): SELECT OVERLAID * FROM Lengths => [maxLength (0), length (1): CARDINAL_NULL], All => [all (0): LONG CARDINAL], ENDCASE] _ [Lengths[]]; DoubleWord: TYPE = LONG CARDINAL; -- LONG UNSPECIFIED doesn't work well StubPktDoubleWord: PROC [pkt: RpcPrivate.StubPkt, index: RpcPrivate.DataLength] RETURNS [--ptrToDoubleWord:-- POINTER TO DoubleWord] = INLINE {RETURN[LOOPHOLE[@pkt.data[index]]]}; RpcPktDoubleWord: PROC [pkt: RpcPrivate.RPCPkt, index: RpcPrivate.DataLength] RETURNS [--ptrToDoubleWord:-- LONG POINTER TO DoubleWord] = INLINE {RETURN[LOOPHOLE[@pkt.data[index]]]}; SHORT: PROCEDURE [long: LONG CARDINAL] RETURNS [CARDINAL] = INLINE BEGIN IF long <= LAST[CARDINAL] THEN RETURN[long] ELSE RETURN[UnmarshalingExprError[]]; END; Words: TYPE = --LONG-- CARDINAL _ NULL; WordsForChars: PROCEDURE [chars: CARDINAL] RETURNS [--words:-- Words] = INLINE BEGIN RETURN[(chars+Basics.charsPerWord-1)/Basics.charsPerWord]; END; CheckPktLength: PROCEDURE [ pkt: RpcPrivate.RPCPkt, lastPkt: BOOLEAN _ TRUE, pktLength: RpcPrivate.DataLength ] = INLINE BEGIN END; FinishThisPkt, StartNextPkt: PROCEDURE [ pkt: RpcPrivate.RPCPkt, pktLength: RpcPrivate.DataLength ] RETURNS [zeroPktLength: RpcPrivate.DataLength]; CopyToPkt: PROCEDURE [ pkt: RpcPrivate.RPCPkt, pktLength: RpcPrivate.DataLength, dataAdr: LONG POINTER, dataLength: Words, alwaysOnePkt: BOOLEAN_FALSE ] RETURNS [--newPktLength:-- RpcPrivate.DataLength] = INLINE BEGIN IF alwaysOnePkt OR pktLength+dataLength <= RpcPrivate.maxDataLength THEN BEGIN PrincOpsUtils.LongCOPY[to: @pkt.data[pktLength], from: dataAdr, nwords: dataLength]; RETURN[pktLength+dataLength]; END ELSE RETURN[ CopyToMultiplePkts[pkt, pktLength, dataAdr, dataLength] ]; END; CopyFromPkt: PROCEDURE [ pkt: RpcPrivate.RPCPkt, pktLength: RpcPrivate.DataLength, dataAdr: LONG POINTER, dataLength: Words, alwaysOnePkt: BOOLEAN_FALSE ] RETURNS [--newPktLength:-- RpcPrivate.DataLength] = INLINE BEGIN IF alwaysOnePkt OR pktLength+dataLength <= RpcPrivate.maxDataLength THEN BEGIN PrincOpsUtils.LongCOPY[to: dataAdr, from: @pkt.data[pktLength], nwords: dataLength]; RETURN[pktLength+dataLength]; END ELSE RETURN[ CopyFromMultiplePkts[pkt, pktLength, dataAdr, dataLength] ]; END; CopyToMultiplePkts, CopyFromMultiplePkts: PRIVATE PROCEDURE [ pkt: RpcPrivate.RPCPkt, pktLength: RpcPrivate.DataLength, dataAdr: LONG POINTER, dataLength: Words ] RETURNS [--newPktLength:-- RpcPrivate.DataLength]; END. -- LupineRuntime. File [Ivy]Lupine>LupineRuntime.mesa. Last edited by BZM on 11-May-82 16:17:07. Last Edited by: Birrell, September 12, 1983 2:02 pm This interface is used at runtime for marshaling and other common functions. Lupine's no-nonsense errors. These procedures map into ERRORs (for now). These procedures map into RpcRuntime ERRORs. Default parameter storage zones. Parameter protocol headers. Parameter marshaling routines. IF RpcPrivate.PktLength[pkt: pkt] # [lastPkt: lastPkt, pktLength: pktLength] THEN UnmarshalingError; Ê&˜Jšœ,™,Jšœ)™)Jšœ3™3JšœL™LJ™šÏk ˜ Jšœœ˜Jšœœ ˜Jšœœ ˜Jšœ œÏcœ˜LJ˜J˜—šœ ˜Jšœ˜Jšœœ˜!J˜J˜—Jšœ™˜Jšœœ˜Jšœœ˜Jšœœ˜J˜—Jšœ+™+˜JšÏnœ œ˜JšŸœ œœ œ˜JšŸœ œœ œ˜9J˜J˜J˜—Jšœ ™ ˜J˜J˜J˜—Jšœ™˜Jšœ œœœ˜!Jšœ œœœ˜#Jš œœœœœ˜8J˜š œœœ œœ˜/šœ œœ˜"Jšœ'œœ˜6Jšœœœ˜ Jšœ˜J˜J˜———J˜Jšœ™˜Jšœ œœœž%˜GJ˜šŸœœ8˜OJšœžœœœ˜6Jšœœœ˜,J˜—šŸœœ7˜MJš œžœœœœ˜;Jšœœœ˜,J˜—š œ œœœœœ˜;Jšœ˜ Jšœ œœœœœœ˜QJšœ˜J˜J˜—Jš œœžœœœ˜'J˜š Ÿ œ œ œœž œ ˜GJšœ˜ Jšœ4˜:Jšœ˜J˜J˜—šŸœ œ˜J˜Jšœ œœ˜J˜$Jšœ˜ JšœL™LJšœ™Jšœ˜J˜—šœŸ œ œ˜(J˜J˜"Jšœ(˜/J˜—šŸ œ œ˜J˜J˜!Jšœ œœ˜J˜Jšœœœ˜Jšœžœ˜3Jšœ˜ šœœ1˜Cšœ˜ J˜TJšœ˜Jš˜—Jšœœ<˜G—Jšœ˜J˜—šŸ œ œ˜J˜J˜!Jšœ œœ˜J˜Jšœœœ˜Jšœžœ˜3Jšœ˜ šœœ1˜Cšœ˜ J˜TJšœ˜Jš˜—Jšœœ>˜I—Jšœ˜J˜—šœŸœœ œ˜=J˜J˜!Jšœ œœ˜J˜Jšœžœ˜2J˜J˜——Jšœž˜J˜—…— ¦â