DIRECTORY PrincOps USING [ControlLink, EPRange, GFT, GFTItem, GlobalFrameHandle, SD, sGFTLength, UnboundLink], RemotePrincOpsUtils USING [], RuntimeError USING [UnboundProcedure], WorldVM USING [ShortAddress, World, Read, Long]; RemoteFrameImpl: PROGRAM IMPORTS RuntimeError, WorldVM EXPORTS RemotePrincOpsUtils = BEGIN OPEN PrincOps, WorldVM; RemoteGlobalFrame: PUBLIC SAFE PROC [world: World, link: WORD] RETURNS [gf: GlobalFrameHandle] = TRUSTED { l: ControlLink _ LOOPHOLE[link]; DO SELECT TRUE FROM l = UnboundLink => l _ SIGNAL RuntimeError.UnboundProcedure[l]; l.proc => IF l.gfi IN [1..LOOPHOLE[Read[world, Long[world, LOOPHOLE[SD + sGFTLength, ShortAddress]]], NAT]) THEN { gftItem: GFTItem _ LOOPHOLE[Read[world, Long[world, LOOPHOLE[GFT + l.gfi, ShortAddress]]], GFTItem]; gftItem.epbias _ 0; RETURN[gftItem.framePtr]; } ELSE RETURN[NIL]; l.indirect => l _ LOOPHOLE[Read[world, Long[world, LOOPHOLE[l.link, ShortAddress]]]]; link = 0 => RETURN[NIL]; ENDCASE => RETURN[LOOPHOLE[Read[world, Long[world, LOOPHOLE[l.frame, ShortAddress]]]]]; ENDLOOP; }; RemoteGlobalFrameAndEntryPoint: PUBLIC SAFE PROC [world: World, link: WORD] RETURNS [gf: GlobalFrameHandle, ep: CARDINAL] = TRUSTED { l: ControlLink _ LOOPHOLE[link, ControlLink]; DO SELECT TRUE FROM l = UnboundLink => l _ SIGNAL RuntimeError.UnboundProcedure[l]; l.proc => IF l.gfi IN [1..LOOPHOLE[Read[world, Long[world, LOOPHOLE[SD + sGFTLength, ShortAddress]]], NAT]) THEN { gftItem: GFTItem _ LOOPHOLE[Read[world, Long[world, LOOPHOLE[GFT + l.gfi, ShortAddress]]], GFTItem]; ep _ gftItem.epbias*EPRange+l.ep; gftItem.epbias _ 0; RETURN[gf: gftItem.framePtr, ep: ep] } ELSE ERROR; l.indirect => l _ LOOPHOLE[Read[world, Long[world, LOOPHOLE[l.link, ShortAddress]]]]; ENDCASE => ERROR; ENDLOOP; }; END. °RemoteFrameImpl.mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Stolen from FrameImpl.mesa by Levin on July 1, 1983 4:58 pm Rovner on July 7, 1983 9:04 am Russ Atkinson (RRA) February 11, 1985 7:09:32 pm PST Exported to RemotePrincOpsUtils (Global Frame stuff) NOTE assume GFTItem is one word NOTE assume accesslink is addressed by fh NOTE assume GFTItem is one word not meaningful for type-0 control links ΚΣ– "Cedar" style˜codešœ™Kšœ Οmœ1™