DIRECTORY BootFile USING [MDSIndex], GermSwap USING [gCross, lCross, LP, mdsiGerm, nGCross, nLCross, pMon, pRequest, ReadMDS, Request, Switches], PrincOps USING [Port, SD, sBootSwitches, TrapLink], PrincOpsUtils USING [Copy, Free, LongCopy, MyGlobalFrame, MyLocalFrame, WriteMDS]; GermSwapImpl: PROGRAM IMPORTS GermSwap, PrincOpsUtils EXPORTS GermSwap SHARES GermSwap = BEGIN Initialize: PUBLIC PROC [mdsiOther: BootFile.MDSIndex] = BEGIN OPEN port: LOOPHOLE[Port, PrincOps.Port]; InitializeMDS[]; port.dest _ [frame[PrincOpsUtils.MyLocalFrame[]]]; -- temporarily connect Port to self Procedure[]; GermSwap.lCross.accesslink _ GermSwap.gCross; GermSwap.lCross.pc _ port.frame.pc; GermSwap.lCross.returnlink _ PrincOps.TrapLink; PrincOpsUtils.Free[port.frame]; port.frame _ GermSwap.lCross; PrincOpsUtils.Copy[ from: PrincOpsUtils.MyGlobalFrame[], nwords: GermSwap.nGCross, to: GermSwap.gCross]; PrincOpsUtils.LongCopy[ from: GermSwap.lCross, nwords: GermSwap.nLCross+GermSwap.nGCross, to: GermSwap.LP[GermSwap.lCross, mdsiOther]]; GermSwap.pMon.CrossMDSCall _ LOOPHOLE[GermSwap.gCross+(@port-LOOPHOLE[PrincOpsUtils.MyGlobalFrame[], POINTER TO PrincOps.Port])]; GermSwap.pMon.pcCross _ GermSwap.lCross.pc END; switches: PUBLIC GermSwap.Switches; bootedFrom: PUBLIC GermSwap.Request; InitializeMDS: PUBLIC PROC = BEGIN switches _ LOOPHOLE[GermSwap.LP[@PrincOps.SD[PrincOps.sBootSwitches], GermSwap.mdsiGerm], LONG POINTER TO GermSwap.Switches]^; bootedFrom _ LOOPHOLE[GermSwap.LP[GermSwap.pRequest, GermSwap.mdsiGerm], LONG POINTER TO GermSwap.Request]^; END; Port: PORT RETURNS [mdsiOther: BootFile.MDSIndex, Dest: PROC]; Procedure: PROC = BEGIN mdsiOther: BootFile.MDSIndex; Dest: PROC; mdsiBack: BootFile.MDSIndex; DO [mdsiOther, Dest] _ Port[]; [Dest, mdsiBack] _ Save2AndWriteMDS[Dest, GermSwap.ReadMDS[], mdsiOther]; Dest[]; PrincOpsUtils.WriteMDS[mdsiBack]; ENDLOOP END; Save2AndWriteMDS: PROC [p: PROC, d: WORD, mdsi: BootFile.MDSIndex] RETURNS [pp: PROC, nx: BootFile.MDSIndex] = LOOPHOLE[PrincOpsUtils.WriteMDS]; -- t1=s1 AND t2=s2! END. `GermSwapImpl.mesa: Interface with Germ Copyright c 1985 by Xerox Corporation. All rights reserved. Andrew Birrell May 26, 1983 9:28 am Levin, June 14, 1983 4:48 pm Russ Atkinson (RRA) February 19, 1985 5:22:02 pm PST Initialisation Strategy: GermSwap.gCross and lCross are allocated in each MDS, initialised identically. Set up frame for Procedure and make it pending on Port Now set up local and global frames with copy in other MDS now mustn't set global variables connect CrossMDSCall to Port Cross-MDS co-routine address of this frame must be same in both MDS's; global frames must be "similar" Κ©˜codešœ&™&Kšœ Οmœ1™KšœX™XKšžœžœ˜)K˜Kšœ6™6Kšœ3Οc#˜VK˜ Kšœ9™9K˜-K˜#K˜/K˜K˜Kšœ ™ šœ˜Kšœ$˜$Kšœ˜Kšœ˜—šœ˜Kšœ˜Kšœ*˜*Kšœ žœ˜-—Kšœ™Kš œžœžœ žœžœ˜Kšœ*˜*Kšžœ˜—K˜Kšœ žœ˜#Kšœ žœ˜$K˜šŸ œžœžœž˜"Kš œ žœ žœ žœ.žœžœžœ˜~Kš œ žœ žœ(žœžœžœ˜lKšžœ˜——K˜šœ™K˜Kš œžœžœ Ÿœžœ˜>K˜šŸ œžœž˜KšœQ™QKšœ˜KšŸœžœ˜ Kšœ˜šž˜K˜K˜IK˜K˜!Kšž˜—Kšžœ˜—K˜š Ÿœžœžœžœžœžœ˜nKšžœ ˜5—K˜—Kšžœ˜K˜—…—