-- File: GCPR.mesa -- Last Edit: L. Stewart September 21, 1978 10:48 PM DIRECTORY AltoPRDefs: FROM "AltoPRDefs" USING [ PRDriverVars, PRRouteSet], DriverDefs: FROM "DriverDefs" USING [ debugPointer, GiantVector], GCDefs: FROM "GCDefs" USING [ GCInterface, Get, GetFailure, Put, PutFailure, Read], IODefs: FROM "IODefs" USING [ CR, ReadChar, ReadNumber, Rubout, WriteChar, WriteDecimal, WriteLine, WriteNumber, WriteString]; GCPR: PROGRAM [gc: GCDefs.GCInterface] IMPORTS GCDefs, IODefs EXPORTS GCDefs = BEGIN OPEN gc, IODefs, GCDefs; giantVectorLoc: POINTER TO DriverDefs.GiantVector; giantVector: DriverDefs.GiantVector; myVars: AltoPRDefs.PRDriverVars; myRoutes: AltoPRDefs.PRRouteSet; localDataValid: BOOLEAN _ FALSE; GCPRThings: PUBLIC PROCEDURE = BEGIN ENABLE GetFailure => BEGIN WriteLine[" GetFailure!"]; GOTO Return; END; WriteString["Packet Radio "L]; IF newPartner[2] THEN BEGIN localDataValid _ FALSE; newPartner[2] _ FALSE; END; SELECT ReadChar[] FROM 'A, 'a => BEGIN WriteLine["Assembly Queue Things."L]; SetPRAssemblyQueueParams[]; END; 'I, 'i => BEGIN WriteLine["I'm Alive Things."L]; SetPRImAliveParams[]; END; 'O, 'o => BEGIN WriteLine["Output Queue Things."L]; SetPROutputQueueParams[]; END; 'P, 'p => BEGIN WriteLine["Put Remote Data."L]; PutRemoteVars[]; END; 'R, 'r => BEGIN WriteLine["Route."L]; SetPRRoute[]; END; 'T, 't => BEGIN GetRemoteVars[]; WriteLine["TOP Interval."L]; SetValue[" New Value (ticks) : ",@(myVars.prTOPInterval)]; END; 'V, 'v => BEGIN WriteLine["Driver Variables."L]; VariablePrint[]; END; '? => WriteLine["A(ssembly Queue), I('m Alive), O(utput Queue), P(ut Remote Data), R(oute), T(OP Interval), or V(ariables)."L]; ENDCASE => WriteLine["???"L]; EXITS Return => NULL; END; GetRemoteVars: PROCEDURE = BEGIN IF ~localDataValid THEN BEGIN giantVectorLoc _ Read[DriverDefs.debugPointer]; Get[to: @giantVector,from: giantVectorLoc,size: SIZE[DriverDefs.GiantVector]]; Get[to: @myVars,from: giantVector.prThings,size: SIZE[AltoPRDefs.PRDriverVars]]; Get[to: @myRoutes,from: myVars.prRouteSetp,size: SIZE[AltoPRDefs.PRRouteSet]]; localDataValid _ TRUE; END; END; PutRemoteVars: PROCEDURE = BEGIN ENABLE PutFailure => BEGIN WriteLine[" PutFailure!"]; GOTO Return; END; IF localDataValid THEN BEGIN Put[to: myVars.prRouteSetp,from: @myRoutes,size: SIZE[AltoPRDefs.PRRouteSet]]; Put[to: giantVector.prThings,from: @myVars,size: SIZE[AltoPRDefs.PRDriverVars]]; END; EXITS Return => NULL; END; VariablePrint: PROCEDURE = BEGIN GetRemoteVars[]; D10[myVars.prTOPInterval]; WriteLine[" TOP Interval"]; D10[myVars.outputTimeoutInterval]; WriteLine[" Output Timeout Interval"]; D10[myVars.assemblyTimeoutInterval]; WriteLine[" Assembly Timeout Interval"]; D10[myVars.imAliveInterval]; WriteLine[" I'm Alive Interval"]; D10[myVars.prHostAliveTimeoutInterval]; WriteLine[" Host Alive Timeout Interval"]; D10[myVars.maxOutputQueueLength]; WriteLine[" Maximum Output Queue Length"]; D10[myVars.maxAssemblyQueueLength]; WriteLine[" Maximum Assembly Queue Length"]; END; SetPRRoute: PROCEDURE = BEGIN to: INTEGER _ 1; i: INTEGER; GetRemoteVars[]; WriteLine["Route."L]; SetValue[" To PR Host: ",@to]; FOR i IN [1..5] DO WriteString[" Route word "]; WriteDecimal[i]; WriteString[" : "]; myRoutes[to][i] _ ReadNumber[myRoutes[to][i],8 ! Rubout => GOTO Reject]; WriteChar[CR]; ENDLOOP; EXITS Reject => WriteLine["xxx"L]; END; SetPRAssemblyQueueParams: PROCEDURE = BEGIN GetRemoteVars[]; SetValue[" Assembly Queue Maximum Length: ",@(myVars.maxAssemblyQueueLength)]; SetValue[" Assembly Queue Timeout Interval (ticks) : ",@(myVars.assemblyTimeoutInterval)]; END; SetPROutputQueueParams: PROCEDURE = BEGIN GetRemoteVars[]; SetValue[" Output Queue Maximum Length: ",@(myVars.maxOutputQueueLength)]; SetValue[" Output Queue Timeout Interval (ticks) : ",@(myVars.outputTimeoutInterval)]; END; SetPRImAliveParams: PROCEDURE = BEGIN GetRemoteVars[]; SetValue[" I'm Alive Interval: ",@(myVars.imAliveInterval)]; SetValue[" Host Alive Timeout Interval: ",@(myVars.prHostAliveTimeoutInterval)]; END; SetValue: PROCEDURE [s: STRING, v: POINTER] = BEGIN WriteString[s]; v^ _ ReadNumber[v^,10 ! Rubout => GOTO Reject]; WriteChar[CR]; EXITS Reject => WriteLine["xxx"L]; END; D10: PROCEDURE [n: CARDINAL] = BEGIN IODefs.WriteNumber[n,[10,FALSE,TRUE,10]]; END; END. -- GCPR(2048)\456b4B93t2 2t0 205b10B1239b13B405b13B358b14B581b10B382b24B229b22B221b18B201b8B176b3B88b