-- File: DispatcherLocked.mesa, Last Edit: HGM July 15, 1979 6:05 PM

-- Copyright Xerox Corporation 1979, 1980

DIRECTORY
DriverDefs: FROM "DriverDefs" USING [
dispatcherLock, dispatcherReady, globalInputQueue, globalOutputQueue],
BufferDefs: FROM "BufferDefs" USING [Buffer, Enqueue];

DispatcherLocked: MONITOR LOCKS DriverDefs.dispatcherLock
IMPORTS DriverDefs, BufferDefs
EXPORTS DriverDefs =
BEGIN

-- These are called from interrupt routines,
on the Alto, they must be locked in memory

PutOnGlobalInputQueue: PUBLIC ENTRY PROCEDURE [ b: BufferDefs.Buffer ] =
BEGIN
BufferDefs.Enqueue[@DriverDefs.globalInputQueue,b];
NOTIFY DriverDefs.dispatcherReady;
END;

PutOnGlobalDoneQueue: PUBLIC ENTRY PROCEDURE [ b: BufferDefs.Buffer ] =
BEGIN
BufferDefs.Enqueue[@DriverDefs.globalOutputQueue,b];
NOTIFY DriverDefs.dispatcherReady;
END;

END.