RapunzelP2200V2ServerImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Willie-Sue.pa at January 8, 1987 11:32:30 am PST
using Sirocco [1.0] of September 25, 1986 3:44:23 am PDT
DIRECTORY
CrRPC,
RapunzelP2200V2;
RapunzelP2200V2ServerImpl: CEDAR PROGRAM
IMPORTS CrRPC, RapunzelP2200V2 ~ {
OPEN RapunzelP2200V2;
Server: CrRPC.ServerProc ~ {
[h: Handle, pgm: CARD, pgmVersion: CARDINAL, proc: CARDINAL, beginReturn: BeginReturnProc, beginError: BeginErrorProc, beginReject: BeginRejectProc]
ENABLE {
RapunzelP2200V2.Fault => { -- (0)
beginError[h, 0];
CrRPC.PutCARDINAL[h, ORD[code]];
CrRPC.PutCARD[h, address];
GO TO Finished;
};
};
IF (pgmVersion # 2) THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCARDINAL[h, 2]; --low
CrRPC.PutCARDINAL[h, 2]; --high
RETURN
};
SELECT proc FROM
4 => { -- PokeSeqShort
address: CARD;
valueSeq: RapunzelP2200V2.SeqShort;
address ← CrRPC.GetCARD[h];
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
valueSeq ← NEW[RapunzelP2200V2.SeqShortObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
valueSeq.body[i0] ← CrRPC.GetCARDINAL[h];
ENDLOOP;
};
[] ← PokeSeqShort[h, address, valueSeq];
beginReturn[h];
};
6 => { -- PokeLong
address: CARD;
value: CARD;
address ← CrRPC.GetCARD[h];
value ← CrRPC.GetCARD[h];
[] ← PokeLong[h, address, value];
beginReturn[h];
};
8 => { -- SetShftAddrs
shftA: CARD;
shftB: CARD;
shftA ← CrRPC.GetCARD[h];
shftB ← CrRPC.GetCARD[h];
[] ← SetShftAddrs[h, shftA, shftB];
beginReturn[h];
};
7 => { -- DoCmds
cmdSeq: RapunzelP2200V2.SeqCmd;
resultSeq: RapunzelP2200V2.SeqResult;
{
length1: CARDINAL ~ CrRPC.GetCARDINAL[h];
cmdSeq ← NEW[RapunzelP2200V2.SeqCmdObject[length1]];
FOR i0: CARDINAL IN [0..length1) DO
TRUSTED {
tag2: RapunzelP2200V2.OpCode ~ VAL[CrRPC.GetCARDINAL[h]];
SELECT tag2 FROM
peekShort => {
x3: RapunzelP2200V2.PeekShortCmd;
x3.address ← CrRPC.GetCARD[h];
cmdSeq.body[i0] ← [peekShort[x3]];
};
pokeShort => {
x4: RapunzelP2200V2.PokeShortCmd;
x4.address ← CrRPC.GetCARD[h];
x4.value ← CrRPC.GetCARDINAL[h];
cmdSeq.body[i0] ← [pokeShort[x4]];
};
shftRead => {
x5: RapunzelP2200V2.ShftReadCmd;
x5.address ← CrRPC.GetCARD[h];
x5.numRepeats ← CrRPC.GetCARDINAL[h];
cmdSeq.body[i0] ← [shftRead[x5]];
};
shftWrite => {
x6: RapunzelP2200V2.ShftWriteCmd;
x6.address ← CrRPC.GetCARD[h];
x6.numRepeats ← CrRPC.GetCARDINAL[h];
cmdSeq.body[i0] ← [shftWrite[x6]];
};
returnLength => {
x7: RapunzelP2200V2.ReturnLengthCmd;
x7.returnLength ← CrRPC.GetCARDINAL[h];
cmdSeq.body[i0] ← [returnLength[x7]];
};
ENDCASE;
};
ENDLOOP;
};
[resultSeq] ← DoCmds[h, cmdSeq];
beginReturn[h];
CrRPC.PutCARDINAL[h, resultSeq.length];
FOR i0: CARDINAL IN [0..resultSeq.length) DO
CrRPC.PutCARDINAL[h, ORD[resultSeq.body[i0].type]];
WITH resultSeq.body[i0] SELECT FROM
it: peekShort RapunzelP2200V2.Result => {
CrRPC.PutCARDINAL[h, it.peekShort.value];
};
it: pokeShort RapunzelP2200V2.Result => {
NULL; -- RECORD []
};
it: shftRead RapunzelP2200V2.Result => {
CrRPC.PutCARDINAL[h, it.shftRead.numRepeats];
};
it: shftWrite RapunzelP2200V2.Result => {
CrRPC.PutCARDINAL[h, it.shftWrite.numRepeats];
};
it: returnLength RapunzelP2200V2.Result => {
NULL; -- RECORD []
};
ENDCASE;
ENDLOOP;
};
5 => { -- PeekLong
address: CARD;
result: CARD;
address ← CrRPC.GetCARD[h];
[result] ← PeekLong[h, address];
beginReturn[h];
CrRPC.PutCARD[h, result];
};
3 => { -- PeekSeqShort
address: CARD;
count: CARDINAL;
resultSeq: RapunzelP2200V2.SeqShort;
address ← CrRPC.GetCARD[h];
count ← CrRPC.GetCARDINAL[h];
[resultSeq] ← PeekSeqShort[h, address, count];
beginReturn[h];
CrRPC.PutCARDINAL[h, resultSeq.length];
FOR i0: CARDINAL IN [0..resultSeq.length) DO
CrRPC.PutCARDINAL[h, resultSeq.body[i0]];
ENDLOOP;
};
1 => { -- PeekShort
address: CARD;
result: CARDINAL;
address ← CrRPC.GetCARD[h];
[result] ← PeekShort[h, address];
beginReturn[h];
CrRPC.PutCARDINAL[h, result];
};
2 => { -- PokeShort
address: CARD;
value: CARDINAL;
address ← CrRPC.GetCARD[h];
value ← CrRPC.GetCARDINAL[h];
[] ← PokeShort[h, address, value];
beginReturn[h];
};
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};
EXITS
Finished => { NULL };
};
CrRPC.RegisterServerProc[pgm~2200, serverProc~Server, pgmVersion~2];
CrRPC.EnsureListener[class~$SPP];
}...