DIRECTORY AMTypes USING [Status, TV], Basics USING [CARD], PrincOps USING [FrameHandle, GlobalFrameHandle, BytePC, SVPointer], Rope USING [ROPE], SafeStorage USING [Type], WorldVM USING [World, Address, ShortAddress]; AMBridge: DEFINITIONS = BEGIN OPEN AMTypes, Basics, PrincOps, Rope, SafeStorage, WorldVM; RemoteRef: TYPE = RECORD [ world: World _ , worldIncarnation: CARD, ref: Address]; nilRemoteRef: RemoteRef = [world: NIL, ref: 0, worldIncarnation: 0]; RemotePointer: TYPE = RECORD [ world: World _ , worldIncarnation: CARD, ptr: Address]; nilRemotePointer: RemotePointer = [world: NIL, ptr: 0, worldIncarnation: 0]; RemoteFrameHandle: TYPE = RECORD [ world: World _ , worldIncarnation: CARD, fh: ShortAddress]; nilRemoteFrameHandle: RemoteFrameHandle = [world: NIL, fh: 0, worldIncarnation: 0]; RemoteGlobalFrameHandle: TYPE = RECORD [ world: World _ , worldIncarnation: CARD, gfh: ShortAddress]; nilRemoteGlobalFrameHandle: RemoteGlobalFrameHandle = [world: NIL, gfh: 0, worldIncarnation: 0]; RemotePD: TYPE = RECORD [ world: World _ , worldIncarnation: CARD, pd: WORD]; nilRemotePD: RemotePD = [world: NIL, pd: 0, worldIncarnation: 0]; RemoteSED: TYPE = RECORD [ world: World _ , worldIncarnation: CARD, sed: WORD]; nilRemoteSED: RemoteSED = [world: NIL, sed: 0, worldIncarnation: 0]; IsRemote: PROC [tv: TV] RETURNS [BOOL]; GetWorld: PROC [tv: TV] RETURNS [World]; GetWorldIncarnation: PROC [tv: TV] RETURNS [CARD]; TVForReferent: PROC [ref: REF ANY, status: Status _ mutable] RETURNS [TV]; TVForRemoteReferent: PROC [remoteRef: RemoteRef, status: Status _ mutable] RETURNS [TV]; RefFromTV: PROC [tv: TV] RETURNS [REF ANY]; RemoteRefFromTV: PROC [tv: TV] RETURNS [RemoteRef]; SomeRefFromTV: PROC [tv: TV] RETURNS [REF ANY]; TVForReadOnlyReferent: PROC [ref: REF READONLY ANY] RETURNS [TV]; ReadOnlyRefFromTV: PROC [tv: TV -- status: readOnly--] RETURNS [REF READONLY ANY]; TVForPointerReferent: PROC [ptr: LONG POINTER, type: Type, status: Status _ mutable] RETURNS [TV]; TVForRemotePointerReferent: PROC [remotePointer: RemotePointer, type: Type, status: Status _ mutable] RETURNS [TV]; PointerFromTV: PROC [tv: TV] RETURNS [LONG POINTER]; RemotePointerFromTV: PROC [tv: TV] RETURNS [RemotePointer]; TVForProc: PROC [proc: PROC ANY RETURNS ANY] RETURNS [TV--procedure--]; TVForRemoteProc: PROC [remotePD: RemotePD] RETURNS [TV--procedure--]; TVToProc: PROC [tv: TV--procedure, program--] RETURNS [PROC ANY RETURNS ANY]; TVToRemoteProc: PROC [tv: TV--procedure, program--] RETURNS [RemotePD]; TVForSignal: PROC [signal: ERROR ANY RETURNS ANY] RETURNS [TV--signal, error--]; TVForRemoteSignal: PROC [remoteSED: RemoteSED] RETURNS [TV--signal, error--]; TVToSignal: PROC [tv: TV] RETURNS [ERROR ANY RETURNS ANY]; TVToRemoteSignal: PROC [tv: TV] RETURNS [RemoteSED]; TVForFrame: PROC [fh: FrameHandle, evalStack: SVPointer _ NIL, return: BOOL _ FALSE, contextPC: BOOL _ FALSE] RETURNS [TV]; TVForRemoteFrame: PROC [remoteFrameHandle: RemoteFrameHandle, evalStack: WordSequence _ NIL, return: BOOL _ FALSE, contextPC: BOOL _ FALSE] RETURNS [TV]; FHFromTV: PROC [tv: TV] RETURNS [FrameHandle]; RemoteFHFromTV: PROC [tv: TV] RETURNS [RemoteFrameHandle]; ContextPC: PROC [tv: TV--localFrame--] RETURNS [BytePC]; TVForGFHReferent: PROC [gfh: GlobalFrameHandle] RETURNS [TV]; TVForRemoteGFHReferent: PROC [remoteGlobalFrameHandle: RemoteGlobalFrameHandle] RETURNS [TV]; GFHFromTV: PROC [tv: TV] RETURNS [GlobalFrameHandle]; RemoteGFHFromTV: PROC [tv: TV] RETURNS [RemoteGlobalFrameHandle]; IsStarted: PROC [tv: TV--globalFrame--] RETURNS [BOOL]; IsCopied: PROC [tv: TV--globalFrame--] RETURNS [BOOL]; TVForATOM: PROC [atom: ATOM] RETURNS [TV--atom--]; TVToATOM: PROC [tv: TV--atom--] RETURNS [ATOM]; TVForROPE: PROC [rope: ROPE] RETURNS [TV--rope--]; TVForType: PROC [type: Type] RETURNS [TV]; TVToLC: PROC [tv: TV] RETURNS [CARD]; TVToInteger: PROC [tv: TV] RETURNS [INTEGER]; TVToLI: PROC [tv: TV] RETURNS [INT]; TVToCardinal: PROC [tv: TV] RETURNS [CARDINAL]; TVToCharacter: PROC [tv: TV] RETURNS [CHARACTER]; TVToReal: PROC [tv: TV] RETURNS [REAL]; TVToRef: PROC [tv: TV] RETURNS [REF ANY]; TVToRemoteRef: PROC [tv: TV] RETURNS [RemoteRef]; SetTVFromLC: PROC [tv: TV, lc: CARD]; SetTVFromLI: PROC [tv: TV, li: INT]; SetTVFromWordSequence: PROC [tv: TV, ws: WordSequence]; Loophole: PROC [tv: TV, type: Type, tag: TV _ NIL] RETURNS [TV]; OctalRead: PROC [tv: TV, offset: INT] RETURNS [CARDINAL]; TVToWordSequence: PROC [tv: TV] RETURNS [s: WordSequence]; WordSequence: TYPE = REF WordSequenceRecord; WordSequenceRecord: TYPE = RECORD[s: SEQUENCE size: NAT OF WORD]; TVHead: PROC [tv: TV] RETURNS [TVHeadType]; TVHeadType: TYPE = { constant, remoteConstant, reference, remoteReference, copiedRemoteObject, pointer, remotePointer, gfh, remoteGFH, fh, remoteFH, notTVRecord }; END. (AMBridge.Mesa Copyright c 1985 by Xerox Corporation. All rights reserved. Rovner, July 13, 1983 1:35 pm Russ Atkinson (RRA) February 7, 1985 10:24:30 am PST T Y P E S, C O N S T A N T S P R O C E D U R E S (1) Access to World information for a TV. (2) Mappings between TVs, REFs and RemoteRefs. If possible, this returns the REF which points to the value represented by the specified TV. Raises InternalTV if tv is embedded, NotVar if TVStatus[tv] # mutable. If possible, this returns the REF which points to the value represented by the specified TV. Raises InternalTV if tv is embedded, NotVar if TVStatus[tv] # mutable. Like RefFromTV, but copies instead of raising an error. (3) Mappings between TVs and pointers. If possible, this returns the LONG POINTER which points to the value represented by the specified TV. Raises InternalTV if tv is embedded and not word aligned Raises NotVar if TVStatus[tv] # mutable. If possible, this returns the LONG POINTER which points to the value represented by the specified TV. Raises MalformedTV if tv is a REF or a REF's component Raises InternalTV if tv is embedded and not word aligned Raises NotVar if TVStatus[tv] # mutable. (4) Mappings between TVs and transfer descriptors. (5) Mappings between TVs and frame goodies. "return" is TRUE iff the next instruction would be RET ContextPC will subtract one from the fh.pc if NOT contextPC ContinuationPC will ignore contextPC and always return fh.pc all such tvs have the same (distinguished) type: fhType all such tvs have the same (distinguished) type: fhType all such tvs have the same (distinguished) type: gfhType all such tvs have the same (distinguished) type: gfhType (6) Mappings between TVs and ATOMs, ROPEs. use TVToName to get the ROPE back (7) ENGINE ROOM PROPER procs. See me (Paul Rovner) if you use this stuff. Raises TypeFault if the field is bigger than 32 bits, else PUNs its value (right justified, zero filled) into a CARD. raises RangeFault raises RangeFault raises RangeFault For use by Wizards. BEWARE. Raises TypeFault if the tv type is not basic, enumeration or subrange else PUNs lc into TVType[tv] and assigns it to the field specified by tv. Shudder. escape hatch to read words from a TV. TVToWordSequence copies the tv. escape hatch. If you need this, chances are good you're doing something wrong Κ v– "cedar" style˜codešœ ™ Kšœ Οmœ1™