<> <> <> <> <> <> <> <> <<>> <> <<>> DIRECTORY VM; <> <> <<>> YggDummyVM: CEDAR DEFINITIONS = BEGIN <> PageNumber: TYPE = VM.PageNumber; PageCount: TYPE = VM.PageCount; <> <> <<>> nullInterval: VM.Interval = [page: 0, count: 0]; <> <> PageState: TYPE = RECORD [ dataState: DataState, -- state of the contents of the page (see below) readOnly: BOOL, -- altered only by MakeReadOnly and MakeReadWrite hasRealMemory: BOOL, -- altered only by SwapIn and MakeUndefined needsCleaning: BOOL, -- a hint for clients of "Clean" pinCount: INT -- altered only by Pin and Unpin ]; <> <> DataState: TYPE = { none, -- page is unallocated; it has no associated backing storage undefined, -- page is allocated, but content is undefined unchanged, -- page content has not changed since MakeUnchanged was last called changed -- page content has changed }; <> <> State: PROC [page: PageNumber] RETURNS [state: PageState]; <<... returns the current PageState of the indicated page.>> <> <<... sets the dataState of all pages in the indicated interval.>> <> <<>> <> <<>> <> <> <> SwapIn: UNSAFE PROC [interval: VM.Interval, kill: BOOL _ FALSE, pin: BOOL _ FALSE, nextPage: PageNumber _ 0]; <> <> <> <> <> <> <> <> <> <> <> Kill, MakeUndefined: UNSAFE PROC [interval: VM.Interval]; <<... performs SetDataState[interval, undefined].>> <> <> Touch: PROC [interval: VM.Interval]; <<... performs SwapIn[interval: interval].>> <> <> <> <<>> <> Pin: PROC [interval: VM.Interval]; <<... performs SwapIn[interval: interval, pin: TRUE].>> <> <> <> <> Unpin: PROC [interval: VM.Interval]; <> <> <> <<>> <> <> <<>> MakeReadOnly: PROC [interval: VM.Interval]; <> <> <> <<>> MakeReadWrite: PROC [interval: VM.Interval]; <> <> <<>> <<>> <> <<>> MakeUnchanged: PROC [interval: VM.Interval]; <<... performs SetDataState[interval, unchanged].>> <> <> <> <<>> MakeChanged: PROC [interval: VM.Interval]; <<... performs SetDataState[interval, changed].>> <> <> <<>> <> <> <<>> Clean: PROC [interval: VM.Interval]; <<... ensures that the backing storage for each page in the interval contains the same information as the associated real memory (if any).>> <> <<>> Age: PROC [interval: VM.Interval]; <<... increases the likelihood that the backing storage associated with pages in the interval will be selected for replacement. However, this procedure does not initiate any I/O operations.>> <> <<>> ForceCleaning: PROC; <<... forces the VM laundry process to clean some memory.>> <<>> <> AddressFault: ERROR [address: LONG POINTER]; WriteProtectFault: ERROR [address: LONG POINTER]; <> <<>> IOErrorType: TYPE = {software, hardware}; CantDoIO: ERROR [reason: IOErrorType, page: PageNumber]; <> <<>> LaundryError: TYPE = RECORD [ errorType: IOErrorType, -- error classification page: PageNumber -- page that gave trouble ]; <<>> LastLaundryError: PROC RETURNS [LaundryError]; <> END. <<>> <> <> <> <<>> <> <> <<>> <> <> <>