RapunzelP2200V2ServerImpl.Mesa
Copyright (C) 1986 by Xerox Corporation. All rights reserved.
Generated by Willie-Sue.pa at February 13, 1987 2:11:42 pm PST
using Sirocco [2.0] of January 31, 1987 1:52:42 am PST
DIRECTORY
CrRPC,
RapunzelP2200V2;
RapunzelP2200V2ServerImpl:
CEDAR
PROGRAM
IMPORTS CrRPC, RapunzelP2200V2 ~ {
OPEN RapunzelP2200V2;
PokeSeqShortCaller:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, beginReturn: CrRPC.BeginReturnProc] ~ {
address: CARD32;
valueSeq: SeqShort;
{
address ← CrRPC.GetCard32[s];
};
{
valueSeq ← UProc16[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 ← UProc17[h, s];
};
[resultSeq] ← DoCmds[h, cmdSeq];
beginReturn[h];
{
MProc18[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];
{
MProc19[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];
};
};
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 {
RapunzelP2200V2.Fault => {
-- (0 )
beginError[h, 0 ];
CrRPC.PutCard16[s, ORD[code]];
CrRPC.PutCard32[s, address];
GOTO Finished;
};
};
IF (pgmVersion # 2)
THEN {
beginReject[h, CrRPC.noSuchVersion];
CrRPC.PutCard16[s, 2]; --low
CrRPC.PutCard16[s, 2]; --high
RETURN
};
SELECT proc
FROM
4 => PokeSeqShortCaller[h, s, beginReturn];
6 => PokeLongCaller[h, s, beginReturn];
8 => SetShftAddrsCaller[h, s, beginReturn];
7 => DoCmdsCaller[h, s, beginReturn];
5 => PeekLongCaller[h, s, beginReturn];
3 => PeekSeqShortCaller[h, s, beginReturn];
1 => PeekShortCaller[h, s, beginReturn];
2 => PokeShortCaller[h, s, beginReturn];
ENDCASE => {
beginReject[h, CrRPC.noSuchProcedure];
};
EXITS
Finished => { NULL };
};
Unmarshal / Marshal Procs --
MProc19:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, val: SeqShort] ~ {
CrRPC.PutCard16[s, val.length];
FOR i20:
CARDINAL
IN [0..val.length)
DO
CrRPC.PutCard16[s, val.body[i20]];
ENDLOOP;
};
UProc17:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM]
RETURNS [res: SeqCmd] ~ {
{
length22: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqCmdObject[length22]];
FOR i21:
CARDINAL
IN [0..length22)
DO
res.body[i21] ← UProc23[h, s];
ENDLOOP;
};
};
MProc18:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM, val: SeqResult] ~ {
CrRPC.PutCard16[s, val.length];
FOR i24:
CARDINAL
IN [0..val.length)
DO
MProc25[h, s, val.body[i24]];
ENDLOOP;
};
UProc16:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM]
RETURNS [res: SeqShort] ~ {
{
length27: CARDINAL ~ CrRPC.GetCard16[s];
res ← NEW[SeqShortObject[length27]];
FOR i26:
CARDINAL
IN [0..length27)
DO
res.body[i26] ← CrRPC.GetCard16[s];
ENDLOOP;
};
};
MProc25:
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.shftRead => {
CrRPC.PutCard16[s, it^.shftRead.numRepeats];
};
it:
REF ResultObject.shftWrite => {
CrRPC.PutCard16[s, it^.shftWrite.numRepeats];
};
it:
REF ResultObject.returnLength => {
NULL; -- RECORD [] --
};
ENDCASE;
};
UProc23:
PROC [h: CrRPC.Handle, s: CrRPC.
STREAM]
RETURNS [res: Cmd] ~ {
{
tag29: OpCode ~ VAL[CrRPC.GetCard16[s]];
SELECT tag29
FROM
peekShort => {
temp30: PeekShortCmd;
temp30.address ← CrRPC.GetCard32[s];
res ← NEW[CmdObject.peekShort ← [peekShort[temp30]]] };
pokeShort => {
temp30: PokeShortCmd;
temp30.address ← CrRPC.GetCard32[s];
temp30.value ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.pokeShort ← [pokeShort[temp30]]] };
shftRead => {
temp30: ShftReadCmd;
temp30.address ← CrRPC.GetCard32[s];
temp30.numRepeats ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.shftRead ← [shftRead[temp30]]] };
shftWrite => {
temp30: ShftWriteCmd;
temp30.address ← CrRPC.GetCard32[s];
temp30.numRepeats ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.shftWrite ← [shftWrite[temp30]]] };
returnLength => {
temp30: ReturnLengthCmd;
temp30.returnLength ← CrRPC.GetCard16[s];
res ← NEW[CmdObject.returnLength ← [returnLength[temp30]]] };
ENDCASE => ERROR;
};
};
CrRPC.RegisterServerProc[pgm~2200, serverProc~Server, pgmVersion~2];
CrRPC.EnsureListener[class~$SPP];
}...