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 PROCEDURE [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 PROCEDURE = 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: PROCEDURE]; Procedure: PROCEDURE = BEGIN -- address of this frame must be same in both MDS's; global frames must be "similar" mdsiOther: BootFile.MDSIndex; Dest: PROCEDURE; mdsiBack: BootFile.MDSIndex; DO [mdsiOther, Dest] _ Port[]; [Dest, mdsiBack] _ Save2AndWriteMDS[Dest, GermSwap.ReadMDS[], mdsiOther]; Dest[]; PrincOpsUtils.WriteMDS[mdsiBack]; ENDLOOP END; Save2AndWriteMDS: PROCEDURE [s1, s2: UNSPECIFIED, mdsi: BootFile.MDSIndex] RETURNS [t1, t2: UNSPECIFIED] = LOOPHOLE[PrincOpsUtils.WriteMDS]; -- t1=s1 AND t2=s2! END. ¼Cedar Nucleus: Interface with Germ. GermSwapImpl.mesa Andrew Birrell May 26, 1983 9:28 am Last Edited by: Levin, June 14, 1983 4:48 pm 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 ʳ˜Jšœ#™#Jšœ™Jšœ$™$J™,J™šÏk ˜ Jšœ œ ˜Jšœ œœJ˜lJšœ œœ˜3Jšœœœ9˜R—J˜šœ˜Jšœ˜Jšœ ˜Jšœ ˜—J˜Jš˜J˜™J˜šÏn œœ œ!˜=Jš˜JšœX™XJšœœ˜)J˜Jšœ6™6Jšœ3Ïc#˜VJ˜ Jšœ9™9J˜-J˜#J˜/J˜J˜Jšœ ™ šœœ˜Jšœ$˜$Jšœ˜Jšœ˜—šœ˜Jšœ˜Jšœ*˜*Jšœ œ˜-—Jšœ™Jš œœœ œœ˜Jšœ*˜*Jšœ˜—J˜Jšœ œ˜#Jšœ œ˜$J˜šž œœ œ˜!Jš˜Jš œ œ œ œ.œœœ˜~Jš œ œ œ(œœœ˜lJšœ˜——J˜šœ™J˜Jš œœœ žœ œ˜CJ˜šž œ œ˜JšœŸT˜ZJšœ˜Jšžœ œ˜Jšœ˜š˜J˜J˜IJ˜J˜!Jš˜—Jšœ˜—J˜š žœ œ œœ œ˜jJšœŸ˜5—J˜—Jšœ˜J˜—…—v å