-- ProcessorFace.mesa (last edited by: McJones on: August 12, 1980 10:01 AM)
DIRECTORY
Environment USING [PageCount, PageNumber],
MiscAlpha USING [aRCLK, aSETMP],
Mopcodes USING [zMISC];
ProcessorFace: DEFINITIONS =
BEGIN
-- Initialization
Start: PROCEDURE;
-- Initialize the implementation of ProcessorFace. After Start has been called all exported variables in this interface are defined.
-- Maintenance panel
SetMP: PROCEDURE [CARDINAL] =
MACHINE CODE BEGIN Mopcodes.zMISC, MiscAlpha.aSETMP END; -- the truth is in the Principles of Operation
-- Set maintenance panel display to given value.
-- 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.
ProcessorID: TYPE = PRIVATE RECORD [a, b, c: UNSPECIFIED];
processorID: READONLY ProcessorID;
-- Note: processorID=[0, 0, 0] 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.
-- Real memory configuration
-- Some processors may have dedicated real memory not placed in virtual memory at initialization. Various device face implementations will use, and perhaps place into client-provided virtual memory, this real memory.
dedicatedRealMemory: READONLY Environment.PageCount;
-- Amount of dedicated real memory, if any. This may be useful, for example, in allocating secondary storage to hold a snapshot of the processor state. Note: dedicatedRealMemory remains constant independent of whether the dedicated memory is in use or not.
-- Virtual memory layout
GetNextAvailableVM: PROCEDURE [page: Environment.PageNumber]
RETURNS [firstPage: Environment.PageNumber, count: Environment.PageCount];
-- Return next area of virtual memory, beginning at or after given page, which is available on this processor. Return a count of zero if no such available area exists. The available areas exclude pages used by device face implementations and unimplemented page map entries but not pages allocated in the Principles of Operation (e.g. process data area, AV, SD, GFT).
-- Greenwich mean time
-- A greenwich mean time t represents the time which is t-gmtEpoch (mod 232) seconds after midnight, 1 January 1968, where gmtEpoch (defined below) is the number of seconds between midnight, 1 January 1968, and midnight, 1 January 1901. This representation was chosen because it assigns the same bit pattern to times as does the Alto time standard for times between 1968 and 2037 but provides an additional 67 years of range.
-- NOTE: Before operating on greenwich mean times (e.g. converting to external representation, comparing for other than equality), it is best to convert them to "seconds since epoch", by subtracting gmtEpoch.
GreenwichMeanTime: TYPE = LONG CARDINAL;
gmtEpoch: LONG CARDINAL = 2114294400;
-- (67years*365daysPerYear+16leapDays)*24hoursPerDay*60minutesPerHour*60secondsPerMinute
GetGreenwichMeanTime: PROCEDURE RETURNS [GreenwichMeanTime];
-- Return the current value of the system’s greenwich mean time clock. This clock runs continuously and, once set, maintains reasonable accuracy.
-- NOTE: If the clock has not been set, GetGreenwichMeanTime returns gmtEpoch.
SetGreenwichMeanTime: PROCEDURE [GreenwichMeanTime];
-- Set the system’s greenwich mean time clock to the given value.
-- Interval time
-- The interval timer is 32 bits long, and is incremented by one at a constant rate, but this rate may vary from processor to processor. It should be somewhere between 104/second and 106/second, so that reasonable assumptions about precision and period may be made by timing software.
-- NOTE: The interval timer is considered to be unsigned, so one may measure an interval up to 232 pulses simply by subtracting initial from final timer reading, with no concern for wrap-around.
GetClockPulses: PROCEDURE RETURNS [LONG CARDINAL] =
MACHINE CODE BEGIN Mopcodes.zMISC, MiscAlpha.aRCLK END; -- the truth is in the Principles of Operation
-- Return the current value of the interval timer.
microsecondsPerHundredPulses: READONLY CARDINAL; -- max error is .33%
-- Naked notifies
reservedNakedNotifyMask: READONLY WORD;
-- A bit-mask with a one in each position corresponding to a naked-notify ‘‘channel’’ used for some private purpose below the Principles of Operation and therefore not available to normal programs.
-- Condition variable time
-- A timeout value may be specified for any condition variable, in units of "ticks". The size of a tick should be between about 15 and 50 milliseconds.
millisecondsPerTick: READONLY CARDINAL;
-- Booting and power control
BootButton: PROCEDURE;
-- Simulate pressing the processor "boot button".
PowerOff: PROCEDURE;
-- If the processor is suitably equipped, turn off electrical power to the system.
-- NOTE: On processors not equipped with a power control relay, this may be implemented as disabling interrupts, turning off devices using DeviceCleanup.Perform[turnOff], and spinning.
SetAutomaticPowerOn: PROCEDURE [gmt: GreenwichMeanTime, externalEvent: BOOLEAN];
-- If the processor is suitably equipped, cause system electrical power to be turned on at or after the given time: if externalEvent is FALSE, turn power on at the given time; if externalEvent is TRUE, turn power on in response to the first external event occurring after the given time.
-- NOTE: On processors not equipped with an independently powered alarm clock connected to a power control relay, this may be implemented by causing a subsequent PowerOff to wait for the appropriate condition and then execute BootButton.
ResetAutomaticPowerOn: PROCEDURE;
-- Cancel a previous SetAutomaticPowerOn.
END.
LOG
Time: August 7, 1979 12:05 PMBy: RedellAction: Create file from White’s OISProcFace; replace DeviceNumber machinery with DeviceHandles and GetNextDevice
Time: January 30, 1980 2:16 PMBy: McJonesAction: Delete all but GreenwichMeanTime; add maintenance panel, process id, virtual memory layout, greenwich mean time, interval time, and power control facilities
Time: May 14, 1980 3:59 PMBy: McJonesAction: Add Start, reservedNakedNotifyMask
Time: May 30, 1980 10:00 AMBy: McJonesAction: Change ProcessorID from 32 to 48 bits; drop OIS from interface name
Time: August 12, 1980 10:01 AMBy: McJonesAction: Add dedicatedRealMemory; use MiscAlpha