DIRECTORY AtomPrivate USING [UnsafeMakeAtomFromString], ProcessorFace USING [ProcessorID, ProcessorType]; ProcessorFaceImpl: CEDAR PROGRAM IMPORTS AtomPrivate EXPORTS ProcessorFace = BEGIN processorID: PUBLIC ProcessorFace.ProcessorID = GetProcessorID[]; GetProcessorID: PRIVATE PROC RETURNS [processorID: ProcessorFace.ProcessorID] ~ TRUSTED { GetProcessorIDInner: PROC [pid: POINTER TO ProcessorFace.ProcessorID] = TRUSTED MACHINE CODE { "+extern void XR_getxnshostid();.XR_getxnshostid" }; GetProcessorIDInner[@processorID]; }; GetProcessorType: PUBLIC PROC RETURNS [ProcessorFace.ProcessorType] = TRUSTED { Doit: PROC [] RETURNS [ProcessorFace.ProcessorType] ~ TRUSTED MACHINE CODE { "XR_GetProcessorType" }; RETURN[ Doit[] ]; }; decAtom, rs6000Atom, sun3Atom, sun4Atom, unknownAtom: ATOM; lastProcessorType: ProcessorFace.ProcessorType ~ decstation; GetProcessorTypeName: PUBLIC PROC [type: ProcessorFace.ProcessorType] RETURNS [ATOM] = { SELECT type FROM sun3 => RETURN [sun3Atom]; sun4 => RETURN [sun4Atom]; rs6000 => RETURN [rs6000Atom]; decstation => RETURN [decAtom]; ENDCASE => RETURN [unknownAtom]; }; ProcessorTypeFromName: PUBLIC PROC [name: ATOM] RETURNS [ProcessorFace.ProcessorType] = { SELECT name FROM sun3Atom => RETURN [sun3]; sun4Atom => RETURN [sun4]; rs6000Atom => RETURN [rs6000]; decAtom => RETURN [decstation]; ENDCASE => RETURN [LAST[ProcessorFace.ProcessorType]]; }; LastProcessorType: PUBLIC PROC RETURNS[ProcessorFace.ProcessorType] ~ { RETURN[lastProcessorType] }; TRUSTED { decAtom ¬ AtomPrivate.UnsafeMakeAtomFromString["decstation"]; rs6000Atom ¬ AtomPrivate.UnsafeMakeAtomFromString["rs6000"]; sun3Atom ¬ AtomPrivate.UnsafeMakeAtomFromString["sun3"]; sun4Atom ¬ AtomPrivate.UnsafeMakeAtomFromString["sun4"]; unknownAtom ¬ AtomPrivate.UnsafeMakeAtomFromString["unknown"]; }; END. ² ProcessorFaceImpl.mesa Copyright Σ 1985, 1986, 1991 by Xerox Corporation. All rights reserved. JKF August 24, 1988 5:16:16 pm PDT Carl Hauser, September 6, 1988 4:33:06 pm PDT Willie-s, August 1, 1991 5:19 pm PDT Processor ID At any moment in time, no two processors will have the same processor id. The processor id remains constant as long as a system element remains running, but may change across system restarts. Programs should make no assumptions about the structure of a processor id. Note: processorID=NullProcessorID indicates that the processor has not had a unique processor id assigned. This is likely to prevent many client systems (e.g. Pilot) from running. Κζ•NewlineDelimiter –(cedarcode) style™codešœ™Kšœ Οeœ=™HK™"K™-K™$K™K™—šΟk ˜ Kšœ žœ˜-Kšœžœ˜1—K˜KšΟnœžœž˜!Kšžœ ˜Kšžœ˜Kšœž˜headšœ ž™ Kšœ™K˜Kšœ žœ.˜AK˜˜Kšœ΄™΄K™—šŸœž œžœ)˜MKšœžœ˜ šŸœžœžœžœ˜HKšžœžœžœ˜˜1K˜——Kšœ"˜"K˜K˜K˜—š Ÿœžœžœžœ!žœ˜Oš Ÿœžœžœ!žœžœžœ˜LK˜K˜—Kšžœ ˜Kšœ˜K˜—Kšœ6žœ˜;Kšœ<˜˜>Kšœ˜K™——Kšžœ˜—…—& Ύ