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: --ControlLink--UNSPECIFIED] RETURNS [gf: GlobalFrameHandle] = TRUSTED { DO OPEN l: LOOPHOLE[link, ControlLink]; SELECT TRUE FROM l = UnboundLink => link _ SIGNAL RuntimeError.UnboundProcedure[link]; 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 => link _ 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: --ControlLink--UNSPECIFIED] RETURNS [gf: GlobalFrameHandle, ep: CARDINAL] = TRUSTED { DO OPEN l: LOOPHOLE[link, ControlLink]; SELECT TRUE FROM l = UnboundLink => link _ SIGNAL RuntimeError.UnboundProcedure[link]; 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 => link _ Read[world, Long[world, LOOPHOLE[l.link, ShortAddress]]]; ENDCASE => ERROR; -- not meaningful for type-0 control links ENDLOOP; }; END. ,RemoteFrameImpl.mesa Stolen from FrameImpl.mesa by Levin on July 1, 1983 4:58 pm last modified by Paul Rovner on July 7, 1983 9:04 am 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 Κ – "Cedar" style˜Jšœ™Jšœ;™;Jšœ4™4J˜šΟk ˜ šœ œ˜Jšœœœ˜T—Jšœœ˜Jšœ œ˜&Jšœœ#˜0J˜—šœ˜Jšœ˜Jšœ˜J˜—Jš œ˜J˜Jšœ4™4J˜šΟnœ˜Jšœ œΟc œ˜AJšœœ˜+š˜Jšœœ˜$šœœ˜Jšœœ%˜Ešœ ˜ šœ˜ šœœœœ˜OJšœœ˜ —šœ˜šœ˜šœœœœ˜IJšœ ˜ —Jšœ™—J˜Jšœ˜J˜——Jšœœœ˜—Jšœ-œ˜NJšœ œœ˜šœœœœ˜WJšœ)™)——Jšœ˜—J˜—J˜šžœ˜Jš œœœŸ œ˜AJšœœœ˜9š˜Jšœœ˜$šœœ˜Jšœœ%˜Ešœ ˜ šœ˜ šœœœœ˜OJšœœ˜ ——šœ˜šœ˜šœœœœ˜IJšœ ˜ ——Jšœ™Jšœ!˜!J˜Jšœ˜$J˜—Jšœœ˜ —Jšœ-œ˜NJšœœŸ*˜=—Jšœ˜—J˜J˜—Jšœ˜J˜—…—R ˆ