-- Copyright (C) 1987 by Xerox Corporation. All rights reserved. -- Stub file was translated on February 13, 1987 6:01:51 pm PST by Lupine of February 22, 1986 5:15:54 pm PST -- Source interface GPIB came from file GPIB.bcd, which was created on February 13, 1987 5:49:49 pm PST with version stamp 234#307#35204215357 from source of February 13, 1987 5:49:47 pm PST. -- The RPC stub modules for GPIB are: -- GPIBRpcControl.mesa; -- GPIBRpcClientImpl.mesa; -- GPIBRpcBinderImpl.mesa; -- GPIBRpcServerImpl.mesa. -- The parameters for this translation are: -- Target language = Cedar -- Default parameter passing = VALUE -- Deallocate server heap arguments = TRUE -- Inline RpcServerImpl dispatcher stubs = TRUE -- Declare signals = TRUE -- Warn about short POINTER ("MDS") allocations = TRUE -- Maximum number of dynamic heap NEWs = 50, MDS NEWs = 50 -- Acceptable parameter protocols = VersionRange[1..1]. DIRECTORY Rope, GPIB, GPIBRpcControl USING [InterfaceRecord, InterMdsCallsOnly, LupineProtocolVersion, ProcedureIndex, SignalIndex], RPC --USING SOME OF [InterfaceName, standardZones, Zones]--, RPCLupine --USING SOME OF [Alloc, Call, DataLength, DeAlloc, Dispatcher, -- GetPkt, GetStubPkt, ImportHandle, ImportInterface, maxDataLength, -- maxPrincipalLength, maxShortStringLength, pktOverhead, ReceiveExtraPkt, -- SendPrelimPkt, StartCall, StartSignal, StubPkt, UnimportInterface]--, RPCLupineExtras --USING SOME OF [ImportInterfaceWithHost, noHost, -- RPCHost]--, LupineRuntime --USING SOME OF [BindingError, CheckPktLength, CopyFromPkt, -- CopyFromMultiplePkts, CopyToPkt, CopyToMultiplePkts, defaultZones, -- DispatchingError, FinishThisPkt, ListHeader, MarshalingError, -- MarshalingExprError, MarshalAtom, MarshalRope, NilHeader, ProtocolError, -- RopeHeader, RpcPktDoubleWord, RuntimeError, SequenceHeader, SHORT, -- StartNextPkt, StringHeader, StubPktDoubleWord, TranslationError, -- UnmarshalingError, UnmarshalingExprError, UnmarshalAtom, UnmarshalRope, -- WordsForChars]--, Atom --USING SOME OF [GetPName, MakeAtom]--, PrincOpsUtils --USING SOME OF [Enter, Exit]--, VM --USING SOME OF [AddressForPageNumber, PageCount, PageNumber, -- PageNumberForAddress, PagesForWords]--; GPIBRpcClientImpl: MONITOR IMPORTS RpcPrivate: RPCLupine, RpcPrivateExtras: RPCLupineExtras, Lupine: LupineRuntime, Atom, PrincOpsUtils, Rope EXPORTS GPIB, GPIBRpcControl SHARES GPIB, GPIBRpcControl, Rope = BEGIN OPEN GPIB, RpcControl: GPIBRpcControl, RpcPublic: RPC; -- Standard remote binding routines. bound: BOOLEAN ← FALSE; myInterface: RpcPrivate.ImportHandle; paramZones: RpcPublic.Zones ← RpcPublic.standardZones; ImportInterface: PUBLIC ENTRY SAFE PROCEDURE [ interfaceName: RpcPublic.InterfaceName, parameterStorage: RpcPublic.Zones, hostHint: RpcPrivateExtras.RPCHost←RpcPrivateExtras.noHost ] = TRUSTED BEGIN ENABLE UNWIND => NULL; IsNull: PROCEDURE [string: Rope.ROPE] RETURNS [BOOLEAN] = INLINE {RETURN[string.Length[] = 0]}; myInterface ← RpcPrivateExtras.ImportInterfaceWithHost [ interface: [ type: IF ~IsNull[interfaceName.type] THEN interfaceName.type ELSE "GPIB~234#307#35204215357", instance: interfaceName.instance, version: interfaceName.version ], localOnly: RpcControl.InterMdsCallsOnly, stubProtocol: RpcControl.LupineProtocolVersion, hostHint: hostHint ]; paramZones ← [ gc: IF parameterStorage.gc # NIL THEN parameterStorage.gc ELSE Lupine.defaultZones.gc, heap: IF parameterStorage.heap # NIL THEN parameterStorage.heap ELSE Lupine.defaultZones.heap, mds: IF parameterStorage.mds # NIL THEN parameterStorage.mds ELSE Lupine.defaultZones.mds ]; bound ← TRUE; END; UnimportInterface: PUBLIC ENTRY SAFE PROCEDURE = TRUSTED BEGIN ENABLE UNWIND => NULL; IF ~bound THEN Lupine.BindingError; myInterface ← RpcPrivate.UnimportInterface[myInterface]; paramZones ← RpcPublic.standardZones; bound ← FALSE; END; -- Remote public procedure stubs. Command: PUBLIC PROCEDURE [sendMsg: Rope.ROPE] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← Command]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← Command; BEGIN -- Marshal sendMsg: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← sendMsg=NIL; pktLength ← pktLength+1; IF sendMsg # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: sendMsg]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF sendMsg # NIL. END; -- Marshal sendMsg. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[]; END; -- UNWIND. END; -- Command. DevicesClear: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← DevicesClear]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← DevicesClear; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- DevicesClear. GoToLocal: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← GoToLocal]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← GoToLocal; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- GoToLocal. GroupExecuteTrigger: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← GroupExecuteTrigger]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← GroupExecuteTrigger; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- GroupExecuteTrigger. InterfaceClear: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← InterfaceClear]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← InterfaceClear; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- InterfaceClear. LocalLockout: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← LocalLockout]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← LocalLockout; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- LocalLockout. RemoteEnable: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← RemoteEnable]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← RemoteEnable; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- RemoteEnable. SelectedDeviceClear: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SelectedDeviceClear, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- SelectedDeviceClear. SelectedGoToLocal: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SelectedGoToLocal, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- SelectedGoToLocal. SelectedGroupEnableTrigger: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SelectedGroupEnableTrigger, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- SelectedGroupEnableTrigger. SelectedRemoteEnable: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SelectedRemoteEnable, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- SelectedRemoteEnable. ParallelPollConfigure: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ParallelPollConfigure, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- ParallelPollConfigure. ParallelPollUnconfigure: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ParallelPollUnconfigure]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← ParallelPollUnconfigure; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- ParallelPollUnconfigure. SelectedParallelPollConfigure: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SelectedParallelPollConfigure, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- SelectedParallelPollConfigure. SelectedParallelPollUnconfigure: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SelectedParallelPollUnconfigure, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- SelectedParallelPollUnconfigure. PollDevice: PUBLIC PROCEDURE [device: DeviceAddr, labels: SRQLabels] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← PollDevice, device (1): DeviceAddr]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; BEGIN -- Marshal labels: SRQLabels to pkt.data[pktLength]. FOR element1: StatusFlag IN StatusFlag DO BEGIN -- Marshal labels[element1]: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← labels[element1]=NIL; pktLength ← pktLength+1; IF labels[element1] # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: labels[element1]]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF labels[element1] # NIL. END; -- Marshal labels[element1]. ENDLOOP; -- FOR element1. END; -- Marshal labels. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[]; END; -- UNWIND. END; -- PollDevice. ReadDevice: PUBLIC PROCEDURE [device: DeviceAddr, terminator: Terminator] RETURNS [recvMsg: Rope.ROPE, end: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ReadDevice, device (1): DeviceAddr, terminator (2): Terminator]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ end (0): BOOL]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device, terminator: terminator]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 254, signalHandler: ClientDispatcher]; pktLength ← 1; BEGIN -- OnePkt. -- Move statics from pkt now. [end: end] ← resPkt↑; BEGIN -- Unmarshal recvMsg: Rope.ROPE from pkt.data[pktLength]. ropeIsNIL: Lupine.NilHeader; IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.FinishThisPkt[pkt: pkt, pktLength: pktLength]; ropeIsNIL ← pkt.data[pktLength]; pktLength ← pktLength+1; IF ropeIsNIL THEN recvMsg ← NIL ELSE BEGIN ropeLength: Lupine.RopeHeader; textRope: Rope.Text; ropeLength ← pkt.data[pktLength]; pktLength ← pktLength+1; IF ropeLength > LAST[NAT] THEN Lupine.UnmarshalingError; recvMsg ← textRope ← Rope.NewText[size: ropeLength]; pktLength ← Lupine.CopyFromPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[ropeLength], alwaysOnePkt: FALSE]; END; -- IF ropeIsNIL. END; -- Unmarshal recvMsg. Lupine.CheckPktLength[pkt: pkt, pktLength: pktLength]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[recvMsg, end]; END; -- OnePkt. END; -- UNWIND. END; -- ReadDevice. ReadOnInterrupt: PUBLIC PROCEDURE [device: DeviceAddr, recvMsg: Rope.ROPE, labels: SRQLabels] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ReadOnInterrupt, device (1): DeviceAddr]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; BEGIN -- Marshal recvMsg: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← recvMsg=NIL; pktLength ← pktLength+1; IF recvMsg # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: recvMsg]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF recvMsg # NIL. END; -- Marshal recvMsg. BEGIN -- Marshal labels: SRQLabels to pkt.data[pktLength]. FOR element1: StatusFlag IN StatusFlag DO BEGIN -- Marshal labels[element1]: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← labels[element1]=NIL; pktLength ← pktLength+1; IF labels[element1] # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: labels[element1]]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF labels[element1] # NIL. END; -- Marshal labels[element1]. ENDLOOP; -- FOR element1. END; -- Marshal labels. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[]; END; -- UNWIND. END; -- ReadOnInterrupt. SelectedReadSerialPoll: PUBLIC PROCEDURE [device: DeviceAddr] RETURNS [statusByte: CHAR] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SelectedReadSerialPoll, device (1): DeviceAddr]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ statusByte (0): CHAR]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 1, signalHandler: ClientDispatcher]; [statusByte: statusByte] ← resPkt↑; Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; RETURN[statusByte]; END; -- SelectedReadSerialPoll. ReadStatusByte: PUBLIC PROCEDURE [device: DeviceAddr] RETURNS [char: CHAR] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ReadStatusByte, device (1): DeviceAddr]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ char (0): CHAR]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 1, signalHandler: ClientDispatcher]; [char: char] ← resPkt↑; Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; RETURN[char]; END; -- ReadStatusByte. WriteDevice: PUBLIC PROCEDURE [device: DeviceAddr, sendMsg: Rope.ROPE] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WriteDevice, device (1): DeviceAddr]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; BEGIN -- Marshal sendMsg: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← sendMsg=NIL; pktLength ← pktLength+1; IF sendMsg # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: sendMsg]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF sendMsg # NIL. END; -- Marshal sendMsg. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[]; END; -- UNWIND. END; -- WriteDevice. WriteDeviceBuffered: PUBLIC PROCEDURE [device: DeviceAddr, sendMsg: Rope.ROPE, hold: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WriteDeviceBuffered, device (1): DeviceAddr, hold (2): BOOL]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device, hold: hold]; BEGIN -- Marshal sendMsg: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← sendMsg=NIL; pktLength ← pktLength+1; IF sendMsg # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: sendMsg]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF sendMsg # NIL. END; -- Marshal sendMsg. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[]; END; -- UNWIND. END; -- WriteDeviceBuffered. InitializeController: PUBLIC PROCEDURE RETURNS [open: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← InitializeController]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ open (0): BOOL]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← InitializeController; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 1, signalHandler: ClientDispatcher]; [open: open] ← resPkt↑; Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; RETURN[open]; END; -- InitializeController. FinalizeController: PUBLIC PROCEDURE = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← FinalizeController]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← FinalizeController; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- FinalizeController. SRQAsserted: PUBLIC PROCEDURE RETURNS [asserted: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← SRQAsserted]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ asserted (0): BOOL]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← SRQAsserted; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 1, signalHandler: ClientDispatcher]; [asserted: asserted] ← resPkt↑; Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; RETURN[asserted]; END; -- SRQAsserted. WriteDeviceInitial: PUBLIC PROCEDURE [device: DeviceAddr, sendMsg: Rope.ROPE] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WriteDeviceInitial, device (1): DeviceAddr]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; BEGIN -- Marshal sendMsg: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← sendMsg=NIL; pktLength ← pktLength+1; IF sendMsg # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: sendMsg]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF sendMsg # NIL. END; -- Marshal sendMsg. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[]; END; -- UNWIND. END; -- WriteDeviceInitial. WriteDeviceContinued: PUBLIC PROCEDURE [device: DeviceAddr, sendMsg: Rope.ROPE, last: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WriteDeviceContinued, device (1): DeviceAddr, last (2): BOOL]; pkt: RpcPrivate.RPCPkt = RpcPrivate.GetPkt[space: RpcPrivate.AllocInline[RpcPrivate.pktOverhead+254]]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 3; lastPkt: BOOLEAN; BEGIN ENABLE UNWIND => RpcPrivate.DeAlloc[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device, last: last]; BEGIN -- Marshal sendMsg: Rope.ROPE to pkt.data[pktLength]. IF pktLength+2 > RpcPrivate.maxDataLength THEN pktLength ← Lupine.StartNextPkt[pkt: pkt, pktLength: pktLength]; pkt.data[pktLength] ← sendMsg=NIL; pktLength ← pktLength+1; IF sendMsg # NIL THEN BEGIN textRope: Rope.Text = Rope.InlineFlatten[r: sendMsg]; pkt.data[pktLength] ← textRope.length; pktLength ← pktLength+1; pktLength ← Lupine.CopyToPkt[pkt: pkt, pktLength: pktLength, dataAdr: BASE[DESCRIPTOR[textRope.text]], dataLength: Lupine.WordsForChars[textRope.length], alwaysOnePkt: FALSE]; END; -- IF sendMsg # NIL. END; -- Marshal sendMsg. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RpcPrivate.DeAllocInline[LOOPHOLE[pkt], RpcPrivate.pktOverhead+254]; RETURN[]; END; -- UNWIND. END; -- WriteDeviceContinued. WriteDeviceBlock: PUBLIC PROCEDURE [device: DeviceAddr, lp: LONG POINTER TO WORD, quadWordCnt: CARDINAL, last: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WriteDeviceBlock, device (1): DeviceAddr, quadWordCnt (2): CARDINAL, last (3): BOOL]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+6] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 4; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device, quadWordCnt: quadWordCnt, last: last]; BEGIN -- Marshal lp: LONG POINTER TO WORD to pkt.data[pktLength]. pkt.data[pktLength] ← lp=NIL; pktLength ← pktLength+1; IF lp # NIL THEN BEGIN pkt.data[pktLength] ← lp↑; pktLength ← pktLength+1; END; END; -- Marshal lp. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- WriteDeviceBlock. WriteDMABlock: PUBLIC PROCEDURE [device: DeviceAddr, multiBusAddress: LONG POINTER TO WORD, byteCnt: CARDINAL, last: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← WriteDMABlock, device (1): DeviceAddr, byteCnt (2): CARDINAL, last (3): BOOL]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+6] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 4; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device, byteCnt: byteCnt, last: last]; BEGIN -- Marshal multiBusAddress: LONG POINTER TO WORD to pkt.data[pktLength]. pkt.data[pktLength] ← multiBusAddress=NIL; pktLength ← pktLength+1; IF multiBusAddress # NIL THEN BEGIN pkt.data[pktLength] ← multiBusAddress↑; pktLength ← pktLength+1; END; END; -- Marshal multiBusAddress. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- WriteDMABlock. ReadDeviceInitial: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ReadDeviceInitial, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- ReadDeviceInitial. ReadDMABlock: PUBLIC PROCEDURE [device: DeviceAddr, multiBusAddress: LONG POINTER TO WORD, byteCnt: CARDINAL, last: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ReadDMABlock, device (1): DeviceAddr, byteCnt (2): CARDINAL, last (3): BOOL]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+6] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 4; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device, byteCnt: byteCnt, last: last]; BEGIN -- Marshal multiBusAddress: LONG POINTER TO WORD to pkt.data[pktLength]. pkt.data[pktLength] ← multiBusAddress=NIL; pktLength ← pktLength+1; IF multiBusAddress # NIL THEN BEGIN pkt.data[pktLength] ← multiBusAddress↑; pktLength ← pktLength+1; END; END; -- Marshal multiBusAddress. [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- ReadDMABlock. ReadDMADone: PUBLIC PROCEDURE [device: DeviceAddr] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← ReadDMADone, device (1): DeviceAddr]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+2] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 2; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt↑ ← [device: device]; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 0, signalHandler: ClientDispatcher]; Lupine.CheckPktLength[pkt: pkt, pktLength: 0]; RETURN[]; END; -- ReadDMADone. CheckDMADone: PUBLIC PROCEDURE RETURNS [anonP1id4481431: BOOL] = BEGIN ArgumentOverlay: TYPE = MACHINE DEPENDENT RECORD [ transferIndex (0): RpcControl.ProcedureIndex ← CheckDMADone]; ResultOverlay: TYPE = MACHINE DEPENDENT RECORD [ anonP1id4481431 (0): BOOL]; pktBuffer: ARRAY [1..RpcPrivate.pktOverhead+1] OF WORD; pkt: RpcPrivate.StubPkt = RpcPrivate.GetStubPkt[space: @pktBuffer]; argPkt: LONG POINTER TO ArgumentOverlay = @pkt.data[0]; resPkt: LONG POINTER TO ResultOverlay = @pkt.data[0]; pktLength: RpcPrivate.DataLength ← 1; lastPkt: BOOLEAN; RpcPrivate.StartCall[callPkt: pkt, interface: myInterface]; argPkt.transferIndex ← CheckDMADone; [returnLength: , lastPkt: lastPkt] ← RpcPrivate.Call[ pkt: pkt, callLength: pktLength, maxReturnLength: 1, signalHandler: ClientDispatcher]; [anonP1id4481431: anonP1id4481431] ← resPkt↑; Lupine.CheckPktLength[pkt: pkt, pktLength: 1]; RETURN[anonP1id4481431]; END; -- CheckDMADone. -- Remote public signals and errors. -- Public signal and error dispatcher. ClientDispatcher: --PROCEDURE [pkt: RPCPkt, callLength: DataLength, -- lastPkt: BOOLEAN, localConversation: Conversation] RETURNS [returnLength: -- DataLength]-- RpcPrivate.Dispatcher = BEGIN SELECT LOOPHOLE[pkt.data[0], RpcControl.SignalIndex] FROM ENDCASE => RETURN[Lupine.DispatchingError[]]; END; -- ClientDispatcher -- Public signal and error dispatcher stubs. -- No module initialization. END. -- GPIBRpcClientImpl.