DIRECTORY Rope USING [ROPE], TargetArchitecture USING [Address, Displacement, nullDisplacement, Contents, Instruction]; BreakWorldArchitecture: CEDAR DEFINITIONS ~ { BreakWorld: TYPE ~ REF BreakWorldRep ฌ nullBreakWorld; nullBreakWorld: BreakWorld ~ NIL; BreakWorldRep: TYPE; WorldAccess: TYPE ~ REF WorldAccessRep ฌ nullWorldAccess; nullWorldAccess: WorldAccess ~ NIL; WorldAccessRep: TYPE ~ RECORD [ name: Rope.ROPE, procs: WorldAccessProcs, data: WorldAccessData ]; WorldAccessProcs: TYPE ~ REF WorldAccessProcsRep ฌ nullWorldAccessProcs; nullWorldAccessProcs: WorldAccessProcs ~ NIL; WorldAccessProcsRep: TYPE ~ RECORD [ peekContents: PeekContentsProc, pokeContents: PokeContentsProc, getProcAddress: GetProcAddressProc, getProcDataSegment: GetProcDataSegmentProc, getPatchArea: GetPatchAreaProc, monitoredCall: MonitoredCallProc ]; PeekContentsProc: TYPE ~ PROCEDURE [address: Address] RETURNS [TargetArchitecture.Contents]; PokeContentsProc: TYPE ~ PROCEDURE [address: Address, contents: TargetArchitecture.Contents] RETURNS []; GetProcAddressProc: TYPE ~ PROCEDURE [breakWorld: BreakWorld, procName: Rope.ROPE] RETURNS [Address]; GetProcDataSegmentProc: TYPE ~ PROCEDURE [breakWorld: BreakWorld, address: Address] RETURNS [Address]; GetPatchAreaProc: TYPE ~ PROCEDURE [address: Address] RETURNS [PatchAreaRep]; PatchAreaRep: TYPE ~ RECORD [ address: Address, byteSize: ByteSize ] ฌ nullPatchAreaRep; nullPatchAreaRep: PatchAreaRep ~ [ address: nullAddress, byteSize: 0]; PatchArea: TYPE ~ REF PatchAreaRep ฌ nullPatchArea; nullPatchArea: PatchArea ~ NIL; MonitoredCallProc: TYPE ~ PROCEDURE [address: Address, proc: PROCEDURE [] RETURNS []] RETURNS []; WorldAccessData: TYPE ~ REF ANY ฌ nullWorldAccessData; nullWorldAccessData: WorldAccessData ~ NIL; BreakAccess: TYPE ~ REF BreakAccessRep ฌ nullBreakAccess; nullBreakAccess: BreakAccess ~ NIL; BreakAccessRep: TYPE; Address: TYPE ~ REF AddressRep ฌ nullAddress; nullAddress: Address ~ NIL; AddressRep: TYPE ~ RECORD [ breakWorld: BreakWorld, address: TargetArchitecture.Address ]; ByteSize: TYPE ~ CARD32; CreateBreakWorld: PROCEDURE [ name: Rope.ROPE, peekContents: PeekContentsProc, pokeContents: PokeContentsProc, getProcAddress: GetProcAddressProc, getProcDataSegment: GetProcDataSegmentProc, getPatchArea: GetPatchAreaProc, monitoredCall: MonitoredCallProc, worldAccessData: WorldAccessData] RETURNS [BreakWorld]; CreateWorldAccess: PROCEDURE [ name: Rope.ROPE, peekContents: PeekContentsProc, pokeContents: PokeContentsProc, getProcAddress: GetProcAddressProc, getProcDataSegment: GetProcDataSegmentProc, getPatchArea: GetPatchAreaProc, monitoredCall: MonitoredCallProc, worldAccessData: WorldAccessData] RETURNS [WorldAccess]; BreakWorldFromWorldAccess: PROCEDURE [worldAccess: WorldAccess] RETURNS [BreakWorld]; IsNullBreakWorld: PROCEDURE [breakWorld: BreakWorld] RETURNS [BOOLEAN]; WorldAccessFromBreakWorld: PROCEDURE [breakWorld: BreakWorld] RETURNS [WorldAccess]; BreakAccessFromBreakWorld: PROCEDURE [breakWorld: BreakWorld] RETURNS [BreakAccess]; PeekContents: PROCEDURE [ address: Address, displacement: TargetArchitecture.Displacement ฌ TargetArchitecture.nullDisplacement] RETURNS [TargetArchitecture.Contents]; PokeContents: PROCEDURE [ address: Address, displacement: TargetArchitecture.Displacement ฌ TargetArchitecture.nullDisplacement, contents: TargetArchitecture.Contents] RETURNS []; GetProcAddress: PROCEDURE [breakWorld: BreakWorld, procName: Rope.ROPE] RETURNS [Address]; GetProcDataSegment: PROCEDURE [breakWorld: BreakWorld, address: Address] RETURNS [Address]; GetPatchArea: PROCEDURE [address: Address] RETURNS [PatchArea]; MonitoredCall: PROCEDURE [address: Address, proc: PROCEDURE [] RETURNS []] RETURNS []; NewAddress: PROCEDURE [breakWorld: BreakWorld, address: TargetArchitecture.Address] RETURNS [Address]; TargetAddressFromBreakWorldAddress: PROCEDURE [address: Address] RETURNS [TargetArchitecture.Address]; BreakWorldFromBreakWorldAddress: PROCEDURE [address: Address] RETURNS [BreakWorld]; IsNullAddress: PROCEDURE [address: Address] RETURNS [BOOLEAN]; AddressEqual: PROCEDURE [this: Address, that: Address] RETURNS [BOOLEAN]; AddressFromDisplacement: PROCEDURE [ address: Address, displacement: TargetArchitecture.Displacement] RETURNS [Address]; NextInstruction: PROCEDURE [pc: Address] RETURNS [Address]; PrevInstruction: PROCEDURE [pc: Address] RETURNS [Address]; PeekInstruction: PROCEDURE [ pc: Address, displacement: TargetArchitecture.Displacement ฌ TargetArchitecture.nullDisplacement] RETURNS [TargetArchitecture.Instruction]; PokeInstruction: PROCEDURE [ pc: Address, displacement: TargetArchitecture.Displacement ฌ TargetArchitecture.nullDisplacement, instruction: TargetArchitecture.Instruction] RETURNS []; IsNullPatchArea: PROCEDURE [patchArea: PatchArea] RETURNS [BOOLEAN]; ErrorCode: TYPE ~ ATOM ฌ nullErrorCode; nullErrorCode: ErrorCode ~ NIL; ErrorMessage: TYPE ~ Rope.ROPE ฌ nullErrorMessage; nullErrorMessage: ErrorMessage ~ NIL; Cant: ERROR [code: ErrorCode, message: ErrorMessage]; WouldBlock: ERROR [message: ErrorMessage]; }. ฎ BreakWorldArchitecture.mesa Copyright ำ 1989, 1990, 1991 by Xerox Corporation. All rights reserved. Peter B. Kessler, April 18, 1990 12:20 pm PDT Laurie Horton, October 8, 1991 11:12 am PDT Willie-s, May 15, 1992 4:13 pm PDT Types. returns contents of given address. sets given address to have given contents. returns address of procedure with gien name. returns data segment address of procedure with given address. returns PatchAreaRep for a given address. Acquires monitor lock at given address for the duration of call to the given proc. Can raise WouldBlock if world is frozen and monitor lock is already held. Only remote worlds are frozen. Procedures. Major items: calls BreakWorldFromWorldAccess[CreateWorldAccess[...]]. BreakWorld accessors. Object style accessors: This had better be atomic! Useful procedures for object-style on Addresses, Instructions, etc.: This had better be atomic! Errors. Raised by MonitoredCall. สฐ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ ะerœ=™HK™-K™+K™"K™šฯk ˜ Kšœžœžœ˜KšœžœB˜Z——K˜unitšฯnœžœž œ˜-head™šœ žœžœ ˜6Kšœžœ˜!Kšœžœ˜K˜—šœ žœžœ"˜9Kšœžœ˜#šœžœžœ˜Kšœ žœ˜K˜K˜K˜—šœžœžœ,˜HKšœ)žœ˜-šœžœžœ˜$K˜K˜K˜#K˜+Kšœ˜K˜ K˜—šœžœ˜šž œžœ˜CK™"——šœžœ˜šž œ;žœ˜OK™*——šœžœ˜šž œ)žœžœ ˜JK™,——šœžœ˜šž œ,žœ ˜GK™=——šœžœ˜šž œžœ˜4K™)—šœžœžœ˜Kšœ˜Kšœ˜Kšœ˜šœ"˜"Kšœ˜Kšœ ˜ —šœ žœžœ˜3Kšœžœ˜———šœžœ˜šž œž œžœžœ˜GJ™R™IJ™———K˜—šœžœžœžœ˜6Kšœ'žœ˜+K˜——šœ žœžœ"˜9Kšœžœ˜#Kšœžœ˜K˜—šœ žœžœ˜-Kšœžœ˜šœ žœžœ˜K˜Kšœ#˜#K˜K˜—šœ žœžœ˜K˜———™ ™ š Ÿœž œžœgœ,œfžœ˜ปKšœ8™8K˜—šŸœž œžœ๚žœ˜พK˜—šŸœž œžœ˜VK˜—šœ™K™šŸœž œžœžœ˜GK˜—šŸœž œžœ˜UK˜—KšŸœž œžœ˜UK˜——™šŸ œž œlžœ˜ฉK˜—šŸ œž œ”žœ˜ถK™K˜—šŸœž œ)žœžœ ˜[K˜—šŸœž œ-žœ ˜\K˜—šŸ œž œžœ ˜?K˜—š Ÿ œž œž œžœžœ˜VK˜——™DšŸ œž œ@žœ ˜gK˜—šŸ"œž œžœ˜gK˜—šŸœž œžœ˜TK˜—šŸ œž œžœžœ˜>K˜—šŸ œž œ žœžœ˜JK˜—šŸœž œFžœ ˜zK˜—šŸœž œžœ ˜;K˜—šŸœž œžœ ˜;K˜—šŸœž œežœ"˜ฉK˜—šŸœž œfžœ-žœ˜บK™K˜—šŸœž œžœžœ˜DK˜———™šœ žœžœ˜'Kšœžœ˜—šœžœžœ˜2Kšœ!žœ˜%K˜—šŸœžœ*˜5K˜—šŸ œžœ˜*K™K˜——L˜——…—^