RapunzelP2200V4ServerImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Willie-Sue.pa at April 9, 1987 4:58:21 pm PDT
using Sirocco [2.0] of January 31, 1987 1:52:42 am PST
DIRECTORY
CrRPC,
RapunzelP2200V4;
RapunzelP2200V4ServerImpl: CEDAR PROGRAM
IMPORTS CrRPC, RapunzelP2200V4 ~ {
OPEN RapunzelP2200V4;
PokeSeqShortCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
valueSeq: SeqShort;
{
address ← CrRPC.GetCard32[s];
};
{
valueSeq ← UProc21[h, s];
};
[] ← PokeSeqShort[h, address, valueSeq];
beginReturn[h];
};
PokeLongCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
value: CARD32;
{
address ← CrRPC.GetCard32[s];
};
{
value ← CrRPC.GetCard32[s];
};
[] ← PokeLong[h, address, value];
beginReturn[h];
};
SetShftAddrsCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
shftA: CARD32;
shftB: CARD32;
{
shftA ← CrRPC.GetCard32[s];
};
{
shftB ← CrRPC.GetCard32[s];
};
[] ← SetShftAddrs[h, shftA, shftB];
beginReturn[h];
};
DoCmdsCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
cmdSeq: SeqCmd;
resultSeq: SeqResult;
{
cmdSeq ← UProc22[h, s];
};
[resultSeq] ← DoCmds[h, cmdSeq];
beginReturn[h];
{
MProc23[h, s, resultSeq];
};
};
PeekSeqLongCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
count: CARD16;
resultSeq: SeqLong;
{
address ← CrRPC.GetCard32[s];
};
{
count ← CrRPC.GetCard16[s];
};
[resultSeq] ← PeekSeqLong[h, address, count];
beginReturn[h];
{
MProc24[h, s, resultSeq];
};
};
PeekLongCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
result: CARD32;
{
address ← CrRPC.GetCard32[s];
};
[result] ← PeekLong[h, address];
beginReturn[h];
{
CrRPC.PutCard32[s, result];
};
};
PeekSeqShortCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
count: CARD16;
resultSeq: SeqShort;
{
address ← CrRPC.GetCard32[s];
};
{
count ← CrRPC.GetCard16[s];
};
[resultSeq] ← PeekSeqShort[h, address, count];
beginReturn[h];
{
MProc25[h, s, resultSeq];
};
};
PeekShortCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
result: CARD16;
{
address ← CrRPC.GetCard32[s];
};
[result] ← PeekShort[h, address];
beginReturn[h];
{
CrRPC.PutCard16[s, result];
};
};
WriteSequentialCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
startingAddress: CARD32;
count: CARD16;
seq: SeqLong;
{
startingAddress ← CrRPC.GetCard32[s];
};
{
count ← CrRPC.GetCard16[s];
};
{
seq ← UProc26[h, s];
};
[] ← WriteSequential[h, startingAddress, count, seq];
beginReturn[h];
};
PokeShortCaller: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
value: CARD16;
{
address ← CrRPC.GetCard32[s];
};
{
value ← CrRPC.GetCard16[s];
};
[] ← PokeShort[h, address, value];
beginReturn[h];
};
Server: CrRPC.ServerProc ~ {
[h: Handle, s: STREAM, pgm: CARD32, pgmVersion: CARD16, proc: CARD16, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc]
ENABLE {
RapunzelP2200V4.Fault => { -- (0 )
beginError[h, 0 ];
CrRPC.PutCard16[s, ORD[code]];
CrRPC.PutCard32[s, address];
GOTO Finished;
};
};
IF (pgmVersion # 4) THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCard16[s, 4]; --low
CrRPC.PutCard16[s, 4]; --high
RETURN
};
SELECT proc FROM
6 => PokeSeqShortCaller[h, s, beginReturn];
8 => PokeLongCaller[h, s, beginReturn];
10 => SetShftAddrsCaller[h, s, beginReturn];
9 => DoCmdsCaller[h, s, beginReturn];
5 => PeekSeqLongCaller[h, s, beginReturn];
7 => PeekLongCaller[h, s, beginReturn];
4 => PeekSeqShortCaller[h, s, beginReturn];
1 => PeekShortCaller[h, s, beginReturn];
11 => WriteSequentialCaller[h, s, beginReturn];
3 => PokeShortCaller[h, s, beginReturn];
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};
EXITS
Finished => { NULL };
};
Unmarshal / Marshal Procs --
MProc24: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: SeqLong] ~ {
CrRPC.PutCard16[s, val.length];
FOR i27: CARDINAL IN [0..val.length) DO
CrRPC.PutCard32[s, val.body[i27]];
ENDLOOP;
};
MProc23: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: SeqResult] ~ {
CrRPC.PutCard16[s, val.length];
FOR i28: CARDINAL IN [0..val.length) DO
MProc29[h, s, val.body[i28]];
ENDLOOP;
};
UProc21: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: SeqShort] ~ {
{
length31: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqShortObject[length31]];
FOR i30: CARDINAL IN [0..length31) DO
res.body[i30] ← CrRPC.GetCard16[s];
ENDLOOP;
};
};
MProc29: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: Result] ~ {
CrRPC.PutCard16[s, ORD[val.type]];
WITH val SELECT FROM
it: REF ResultObject.peekShort => {
CrRPC.PutCard16[s, it^.peekShort.value];
};
it: REF ResultObject.pokeShort => {
NULL; -- RECORD [] --
};
it: REF ResultObject.pokeLong => {
NULL; -- RECORD [] --
};
it: REF ResultObject.shftRead => {
CrRPC.PutCard16[s, it^.shftRead.numRepeats];
};
it: REF ResultObject.shftWrite => {
CrRPC.PutCard16[s, it^.shftWrite.numRepeats];
};
it: REF ResultObject.returnLength => {
NULL; -- RECORD [] --
};
ENDCASE;
};
MProc25: PROC [h: CrRPC.Handle, s: CrRPC.STREAM, val: SeqShort] ~ {
CrRPC.PutCard16[s, val.length];
FOR i33: CARDINAL IN [0..val.length) DO
CrRPC.PutCard16[s, val.body[i33]];
ENDLOOP;
};
UProc22: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: SeqCmd] ~ {
{
length35: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqCmdObject[length35]];
FOR i34: CARDINAL IN [0..length35) DO
res.body[i34] ← UProc36[h, s];
ENDLOOP;
};
};
UProc26: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: SeqLong] ~ {
{
length38: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqLongObject[length38]];
FOR i37: CARDINAL IN [0..length38) DO
res.body[i37] ← CrRPC.GetCard32[s];
ENDLOOP;
};
};
UProc36: PROC [h: CrRPC.Handle, s: CrRPC.STREAM] RETURNS [res: Cmd] ~ {
{
tag39: OpCode ~ VAL[CrRPC.GetCard16[s]];
SELECT tag39 FROM
peekShort => {
temp40: PeekShortCmd;
temp40.address ← CrRPC.GetCard32[s];
res ← NEW[CmdObject.peekShort ← [peekShort[temp40]]] };
pokeShort => {
temp40: PokeShortCmd;
temp40.address ← CrRPC.GetCard32[s];
temp40.value ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.pokeShort ← [pokeShort[temp40]]] };
pokeLong => {
temp40: PokeLongCmd;
temp40.address ← CrRPC.GetCard32[s];
temp40.value ← CrRPC.GetCard32[s];
res ← NEW[CmdObject.pokeLong ← [pokeLong[temp40]]] };
shftRead => {
temp40: ShftReadCmd;
temp40.address ← CrRPC.GetCard32[s];
temp40.numRepeats ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.shftRead ← [shftRead[temp40]]] };
shftWrite => {
temp40: ShftWriteCmd;
temp40.address ← CrRPC.GetCard32[s];
temp40.numRepeats ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.shftWrite ← [shftWrite[temp40]]] };
returnLength => {
temp40: ReturnLengthCmd;
temp40.returnLength ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.returnLength ← [returnLength[temp40]]] };
ENDCASE => ERROR;
};
};
CrRPC.RegisterServerProc[pgm~2200, serverProc~Server, pgmVersion~4];
CrRPC.EnsureListener[class~$SPP];
}...