DIRECTORY AMTypes USING[Status, TV], PrincOps USING[FrameHandle, GlobalFrameHandle, BytePC, StateVector], Rope USING[ROPE], SafeStorage USING[Type], WorldVM USING[World, Address, ShortAddress]; AMBridge: DEFINITIONS = BEGIN OPEN AMTypes, PrincOps, Rope, SafeStorage, WorldVM; RemoteRef: TYPE = RECORD [ world: World _ , worldIncarnation: LONG CARDINAL, ref: WorldVM.Address]; nilRemoteRef: RemoteRef = [world: NIL, ref: 0, worldIncarnation: 0]; RemotePointer: TYPE = RECORD [ world: World _ , worldIncarnation: LONG CARDINAL, ptr: WorldVM.Address]; nilRemotePointer: RemotePointer = [world: NIL, ptr: 0, worldIncarnation: 0]; RemoteFrameHandle: TYPE = RECORD [ world: World _ , worldIncarnation: LONG CARDINAL, fh: WorldVM.ShortAddress]; nilRemoteFrameHandle: RemoteFrameHandle = [world: NIL, fh: 0, worldIncarnation: 0]; RemoteGlobalFrameHandle: TYPE = RECORD [ world: World _ , worldIncarnation: LONG CARDINAL, gfh: WorldVM.ShortAddress]; nilRemoteGlobalFrameHandle: RemoteGlobalFrameHandle = [world: NIL, gfh: 0, worldIncarnation: 0]; RemotePD: TYPE = RECORD [ world: World _ , worldIncarnation: LONG CARDINAL, pd: UNSPECIFIED]; nilRemotePD: RemotePD = [world: NIL, pd: 0, worldIncarnation: 0]; RemoteSED: TYPE = RECORD [ world: World _ , worldIncarnation: LONG CARDINAL, sed: UNSPECIFIED]; nilRemoteSED: RemoteSED = [world: NIL, sed: 0, worldIncarnation: 0]; IsRemote: PROC[tv: TV] RETURNS[BOOLEAN]; GetWorld: PROC[tv: TV] RETURNS[World]; GetWorldIncarnation: PROC[tv: TV] RETURNS[LONG CARDINAL]; 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: POINTER TO PrincOps.StateVector _ 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[PrincOps.BytePC]; TVForGFHReferent: PROC[gfh: GlobalFrameHandle] RETURNS[TV]; TVForRemoteGFHReferent: PROC[remoteGlobalFrameHandle: RemoteGlobalFrameHandle] RETURNS[TV]; --all such tvs have the same (distinguished) type: gfhType 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[LONG CARDINAL]; TVToInteger: PROC[tv: TV] RETURNS[INTEGER]; -- raises RangeFault TVToLI: PROC[tv: TV] RETURNS[LONG INTEGER]; TVToCardinal: PROC[tv: TV] RETURNS[CARDINAL]; -- raises RangeFault TVToCharacter: PROC[tv: TV] RETURNS[CHARACTER]; -- raises RangeFault TVToReal: PROC[tv: TV] RETURNS[REAL]; TVToRef: PROC[tv: TV] RETURNS[REF ANY]; TVToRemoteRef: PROC[tv: TV] RETURNS[RemoteRef]; --For use by Wizards. BEWARE. SetTVFromLC: PROC[tv: TV, lc: LONG CARDINAL]; SetTVFromLI: PROC[tv: TV, li: LONG INTEGER]; SetTVFromWordSequence: PROC[tv: TV, ws: WordSequence]; Loophole: PROC[tv: TV, type: Type, tag: TV _ NIL] RETURNS[TV]; -- Shudder. 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. jAMBridge.Mesa last modified on July 13, 1983 1:35 pm by Paul Rovner 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 (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 LONG CARDINAL. 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. escape hatch. If you need this, chances are good you're doing something wrong TVToWordSequence copies the tv. escape hatch. If you need this, chances are good you're doing something wrong Κ ά– "cedar" style˜Iprocšœ ™ Kšœ5™5K˜šΟk ˜ Kšœœ œ˜Kšœ œ6˜DKšœœœ˜Kšœ œ˜Kšœœ˜,—K˜Kšœ  ˜Kšœœœ/˜;K™K™šœ™K˜šœ œœ˜Kšœ˜Kšœœœ˜ Kšœ˜—Kšœ"œ˜DK˜šœœ˜Kšœ˜Kšœœœ˜ Kšœ˜—Kšœ*œ˜LK˜šœœ˜"Kšœ˜Kšœœœ˜ Kšœ˜—Kšœ2œ˜SK˜šœœ˜(Kšœ˜Kšœœœ˜ Kšœ˜—šœ˜Kšœ"œ˜D—K˜šœ œ˜Kšœ˜Kšœœœ˜ Kšœ œ˜—Kšœ œ˜AK˜šœ œ˜Kšœ˜Kšœœœ˜ Kšœ œ˜—Kšœ"œ˜D—K™Kšœ™šœ)™)K˜Kš Οnœœœœœ˜(K˜Kšžœœœœ˜&K˜Kš žœœœœœœ˜9K™—šœ.™.K˜Kš ž œœœœœœ˜HK˜Kšžœœ1œœ˜VK˜š ž œœœœœœ˜)Kšœ£™£—K˜šžœœœœ ˜1Kšœ£™£—K˜š ž œœœœœœ˜-Kšœ8™8—K˜Kšžœœœœœœœ˜@K˜KšžœœœΟcœœœœœ˜P—K™šœ&™&K˜šžœœœœ'˜SKšœœ˜ —K˜šžœœ˜!Kšœ˜Kšœ ˜ Kšœ˜Kšœ˜Kšœœ˜ —K˜š ž œœœœœœ˜2KšœΗ™Η—K˜šžœœœœ˜9Kšœώ™ώ——K™šœ2™2K˜Kšž œœœœœœœŸ œ˜EK˜Kš žœœœŸ œ˜CK˜KšžœœŸœœœœœœ˜KK˜Kš žœœŸœœ ˜EK˜Kšž œœ œœœœœŸœ˜NK˜Kš žœœœŸœ˜KK˜Kšž œœœœœœœœ˜8K˜Kšžœœœœ ˜2—K™šœ+™+K™šž œœ˜Kšœ˜Kšœ œœœ˜1Kšœœœ˜Kšœ œ˜Kšœ˜Kšœœ˜ Kšœη™η—K˜šžœœ˜Kšœ%˜%Kšœœ˜Kšœœœ˜Kšœ œ˜Kšœ˜Kšœœ˜ Kšœ7™7—K˜Kšžœœœœ˜,K˜Kšžœœœœ˜8K˜Kš ž œœŸœœ˜?K˜šžœœœœ˜;Kšœ8™8—K˜šžœœ2˜NKšœœŸ:˜G—K˜Kšž œœœœ˜3K˜Kšžœœœœ˜?K˜Kš ž œœŸœœœ˜5K˜Kš žœœŸœœœ˜4—K™šœ*™*K˜Kš ž œœœœŸœ˜0K˜Kš žœœŸœœœ˜-K˜š ž œœœœŸœ˜0Kšœ!™!——K™šœI™IK˜šž œœ œœ˜)J˜—š žœœœœœœ˜,Kšœ~™~—K˜Kš ž œœœœœŸ˜AK˜Kš žœœœœœœ˜+K˜Kš ž œœœœœŸ˜BK˜Kš ž œœœœ œŸ˜DK˜Kš žœœœœœ˜%K˜Kš žœœœœœœ˜'K˜Kš ž œœœœŸ˜NK˜š ž œœœœœ˜-Kšœ™—K˜Kš ž œœœœœ˜,K˜Kšžœœœ˜6K˜KšžœœœœœœœŸ ˜KK˜š ž œœœ œœœ˜7KšœM™M—K˜šžœœœœ˜9Kšœ™—K˜Kšœœœ˜,š œœœœœœœ˜AKšœM™M—K˜Kšžœœœœ ˜)K˜šœ œ˜Kšœ‹˜‹Kšœ˜——K˜Kšœ˜K˜—…—Φ&