DIRECTORY LoadState USING [ Handle ], PrincOps USING [ op, BytePC ], Rope USING [ ROPE ]; WorldVM: DEFINITIONS = BEGIN OPEN Rope; World: TYPE = REF WorldObject; WorldObject: TYPE; GetWorld: PROC[where: ROPE] RETURNS[ World ]; OtherWorld: PROC RETURNS[ World ]; LocalWorld: PROC RETURNS[ World ]; NoWorld: PROC RETURNS[ World ]; InvalidateWorld: PROC[ World ]; BadWorld: ERROR; LookupFailed: ERROR; Incarnation: TYPE = LONG CARDINAL; CurrentIncarnation: PROC[world: World] RETURNS[ Incarnation ]; WorldName: PROC[ World ] RETURNS[ ROPE ]; Address: TYPE = LONG CARDINAL; ShortAddress: TYPE = CARDINAL; Long: PROC[world: World, addr: ShortAddress] RETURNS[Address]; AddressFault: ERROR[addr: Address]; Read: PROC[world: World, addr: Address] RETURNS[ CARDINAL ]; Write: PROC[world: World, addr: Address, value: CARDINAL]; LongRead: PROC[world: World, addr: Address] RETURNS[ LONG CARDINAL ]; LongWrite: PROC[world: World, addr: Address, value: LONG CARDINAL]; CopyRead: PROC[world: World, from: Address, nwords: INT, to: LONG POINTER]; CopyWrite: PROC[world: World, from: LONG POINTER, nwords: INT, to: Address]; IllegalPatch: ERROR; SetBreak: PROC[world: World, addr: Address, offset: PrincOps.BytePC] RETURNS[oldByte: PrincOps.op]; ClearBreak: PROC[world: World, addr: Address, offset: PrincOps.BytePC, oldByte: PrincOps.op]; Lock: PROC[world: World]; Unlock: PROC[world: World]; Go: PROC[world: World]; Loadstate: PROC[world: World] RETURNS[ LoadState.Handle ]; END. NWorldVM.mesa: raw access to client virtual memory Copyright c 1985 by Xerox Corporation. All rights reserved. Andrew Birrell September 20, 1983 2:25 pm Russ Atkinson (RRA) February 6, 1985 9:11:40 pm PST This interface provides access to the VM on other machines running a teledbug server, and to the client side of a world-swap. Access to multiple clients is ok. The implementation takes care of the communication (or disk accesses), interpreting the client's MapLog, and a page-level (write-through) cache of the client's VM. Part I: Obtaining a World Obtains "World" described by "where". "where" may be: a Pup address constant, e.g. "3#14#", a Pup NLS host name, e.g. "Cabernet", a Grapevine individual name, e.g. "Cabernet.ms". May raise "LookupFailed" or "BadWorld". Returns when client responds to teledebug protocol. Returns "World" for the client side of a disk world swap of which we're the debugger side. May raise "BadWorld". First call of this causes us to outload and boot our physical volume; returns when we are inloaded. Subsequent calls just returns the same value. Returns "World" for our address space. All calls return the same value. Returns an invalid "World". Makes "world" no longer usable; subsequent uses will raiss "BadWorld". Raised by VM access procedures if passed an invalid world; Raised by "GetWorld" if the ROPE doesn't decribe a host; Raised by "OtherWorld" if our system volume has type "normal". Raised by "GetWorld" if communication with name lookup services failed. A world has an "incarnation". This is initialised to FIRST[Incarnation] and is incremented on each call of "Go[world]". The intention is to permit clients to detect out-of-date cached information. For remote worlds, returns the name given to "GetWorld". For disk world swap, returns "Outload". For local world, returns "Local". Part II: Accessing the Virtual Memory of a world The following procedures will each raise "BadWorld" if passed "NoWorld[]" or an invalid world as argument. In case of communication difficulties, they will retry indefinitely. Use Process.Abort to terminate if necessary. General world-relative address world- and MDS-relative address Lengthens a client MDS address. Raised by VM access procedures if address isn't mapped or if it's swapped out and the client has no MapLog. Reads (and caches) from World's VM Writes to cache and world's VM. Reads (and caches) double-word from World's VM Writes double-word to cache and World's VM. Reads (and caches) block from World's VM Writes block to cache and World's VM. Part III: Breakpoint primitives. Raised by SetBreak or ClearBreak PRIVATE: call only from AMEventsImpl Set breakpoint in code segment, whose base address is "address", at byte offset "offset", with bytes numbered as in PrincOps. Returns previous contents of location. Raises IllegalPatch[] if there's already a break there. PRIVATE: call only from AMEventsImpl Raises IllegalPatch[] if there is no break there. Part IV: Allowing a remote or world-swap world to continue processing. Increments a lock-count for this world. While the lock-count is > 0, the world is not allowed the processor. Decrements the lock-count. PRIVATE: call only from AMEventsImpl Primitive control transfer: allows world-swap or teledebug client to continue processing as soon as its lock-count comes down to 0. For world-swap, outloads us and inloads client, then returns when we are inloaded. For teledebugging, returns when client once again responds to teledebug protocol. Part V: Finding the loadstate This doesn't really belong here, but the loadstate address comes inside the ESV with the present protocols. Κo˜codešœ1™1Kšœ Οmœ1™™>—K˜šœžœ˜KšœG™G—K˜Kšœ žœžœžœ˜"K˜šŸœžœžœ˜>KšœΖ™Ζ—K˜šŸ œžœ žœžœ˜)Kšœ„™„—K˜K˜—Kšœ0™0™Kšœή™ήK˜šœ žœžœžœ˜Kšœ™—K˜šœžœžœ˜Kšœ™—K˜šŸœžœ#žœ ˜>Kšœ™—K˜šœžœ˜#Kšœk™k—K˜šŸœžœžœžœ˜