Text preview for : SegmentDefs.mesa_Oct77.pdf part of xerox SegmentDefs.mesa Oct77 xerox mesa 3.0_1977 listing SegmentDefs.mesa_Oct77.pdf



Back to : SegmentDefs.mesa_Oct77.pd | Home

segmentdefs.mESA 21\-OCT-77 18:44:36 Page 1


-- SegmentDefs.Mesa Edited by Sandman on August 23, 1977 9:16 PM
DIRECTORY
AltoDefs: FROM "altodefs",
AltoFileDefs: FROM "altoflledefs";
DEFINITIONS FROM AltoDefs, AltoFileDefs;
SegmentDefs: DEFINITIONS = BEGIN
FileHint: TYPE = AltoFileDefs.FH:
FileIndex: TYPE = AltoFileDefs.FI;
PageCount: TYPE = AltoDefs.PageCount;
PageNumber: TYPE = AltoDefs.PageNumber:

-- Basic Memory Addressing:
PagePointer: PROCEDURE [a:POINTER] RETURNS [POINTER]:
PageFromAddress: PROCEDURE [a:POINTER] RETURNS [PageNumber]:
AddressFromPage: PROCEDURE [p:PageNumber] RETURNS [POINTER]:
PageFree: PROCEDURE [page: PageNumber] RETURNS [BOOLEAN]:
PagesFree: PROCEDURE [base: PageNumber. pages: PageCount] RETURNS [BOOLEAN]:

-- Primative System Objects:
ObjectType: PRIVATE TYPE = {Free. Data, Segment, File}:
ObjectHandle: PRIVATE TYPE = POINTER TO Object:
Object: TYPE = RECORD [
inuse, busy: PRIVATE BOOLEAN.
body: SELECT COMPUTED ObjectType FROM
Free => [
fill: PRIVATE [0 .. 37777B].
link: PRIVATE POINTER TO Free Object],
Data => [
pages: [l .. MaxVMPage+l].
VMpage: [O .. MaxVMPage]].
Segment => [
swappedin: BOOLEAN.
read. write: BOOLEAN.
cl ass: FileSegmentCl ass,
lock: [0 .. MaxLocks],
pages: [l .. MaxVMPage+l].
VMpage: [O .. MaxVMPage].
file: FileHandle.
base: PageNumber,
hint: FileHint],
File =) [
open: BOOLEAN.
lengthvalid: BOOLEAN.
lengthchanged: BOOLEAN.
read. write. append: BOOLEAN.
lock: [O .. MaxLocks].
swapcount: [O .. MaxRefs].
segcoun t: [0 .. MaxSegs].
fp: FP
eor: FA].
ENDCASE]:
MaxRefs: CARDINAL = 255:
Maxlocks: CARDINAL = 255:
MaxSegs: CARDINAl = 177777B:
segmentdefs.mESA 24-0CT-77 18:44:36 Page 2


-- Segments:
DefaultPages: PageCount = 0:
DefaultBase: PageNumber MaxFilePage:

-- Data Segments:
DataSegmentObject: TYPE = Data Object:
DataSegmentHandle: TYPE = POINTER TO DataSegmentObject:
VMNotFree: SIGNAL [base:PageNumber, pages:PageCount]:
NewDataSegment: PROCEDURE [base:PageNumber, pages:PageCount] RETURNS [DataSegmentHandle]:
NewFrameSegment: PROCEDURE [pages: PageCount] RETURNS [DataSegmentHandle]:
DeleteDataSegment: PROCEDURE [seg:DataSegmentHandle]:
VMtoDataSegment: PROCEDURE [a:POINTER] RETURNS [DataSegmentHandle]:
DataSegmentAddress: PROCEDURE [seg:DataSegmentHandle] RETURNS [POINTER]:
EnumerateDataSegments: PROCEDURE [
proc: PROCEDURE [DataSegmentHandle] RETURNS [BOOLEAN]]
RETURNS [DataSegmentHandle]:

-- File Segments:
FileSegmentObject: TYPE = Segment Object:
FileSegmentHandle: TYPE = POINTER TO FileSegmentObject:
FileSegmentClass: TYPE = {code, symbols, bcd, other};
InvalidSegmentSize: SIGNAL [pages:PageCount]:
NewFileSegment: PROCEDURE [ ~~
file:FileHandle, base:PagENumber, pages:PageCount, access:AccessOptions]
RETURNS [File~1gmentHandle];
MoveFlleSegment: PROCEDURE [seg:FIleSegmentHandle, base:PageNumber, pages:PageCount]:
MapFileSegment: PROCEDURE [seg: FileSegmentHandle, file: FileHandle, base: PageNumber];
DeleteFileSegment: PROCEDURE [seg:FileSegmentHandle];
VMtoFlleSegment: PROCEDURE [a:POINTER] RETURNS [FlleSegmentHandle]:
FileSegmentAddress: PROCEDURE [seg:FileSegmentHandle] RETURNS [POINTER]:
GetFileSegmentDA: PROCEDURE [seg: FileSegmentHandle] RETURNS [vDA];
SetFileSegmentDA: PROCEDURE [seg: FileSegmentHandle, da: vDA];
EnumerateF i 1 eSegmen ts: PROCEDURE [
proc: PROCEDURE [FileSegmentHandle] RETURNS [BOOLEAN]]
RETURNS [FileSegmentHandle]:

-- File Segment Swapping:
SwapError: SIGNAL [seg:FileSegmentHandle];
SegmentFault: SIGNAL [seg:FileSegmentHandle, pages:PageColint];
Swapln, SwapUp, SwapOut. Unlock: PROC[DURE [seg:FileSegmentHandle]:
-- Initializing File and Data Segments
CopyDataToFileSegment: PROCEDURE [dataseg: DataSegrnentHandle. fileseg: F ileSegmentHandle];
CopyFileToDataSegment: PROcrDURE [fileseg: FileSegrnentllandle. dalaseg: DataSegmentilandle]:
ChangeDataTofileSegment: PROCEDURE [dalaseg: DataSegmentHandle. f'ileseg: FileSegmentilandle]:
-- Swap Slrategies and Swapping Procedures:
InsufficientVM: SIGNAL [needed:PageCount]:
TryCoriaSwapping. CantSwap: SwappingProcedure;
Swapp ingProcedure: TYPE = PROC[f)URr RETURNS [SOOI rAN];
SwapSlralegy: TYPE = RrCORD [
1 ink: PO[NHR TO SwapStrategy.
proc: SwappingProcedure];
AddSwapSLraLegy: PROCEDURr [straLegy:PO[NTER TO SwapSlralegy);
RemoveSwapSLralegy: PROCrOURE [sLralegy:POINTrR [0 SwnpSLraLegy);
segmentdefs.mESA 24-0CT-77 1B:44:36 Page 4


-- Files:
FileObject: TYPE = File Object:
FileHandle: TYPE = POINTER TO FileObject:
AccessOptions: TYPE = [0 .. 7]:
Read: AccessOptions = 1:
Write: AccessOptions = 2:
Append: AccessOptions = 4:
Delete: AccessOptions = B;
VersionOptions: TYPE = [0 .. 3];
NewFileOnly: VersionOptions = 1;
OldFileOnly: VersionOptions = 2;
DefaijltAccess: AccessOptions = 0;
DefaultVersion: VersionOptions = 0;
FileNameError: SIGNAL [name:STRING]:
InvalidFP: SIGNAL [fp:POINTER TO FP];
FileError. FileAccessError: SIGNAL [file:FileHandle]:
NewFile: PROCEDURE [name:STRING, access:AccessOptions, version:VersionOptions] RETURNS [FileHandle];
InsertFile: PROCEDURE [fp:POINTER TO FP, access:AccessOptions] RETURNS [FileHandle];
OpenFile, CloseFile: PROCEDURE [ftle:FileHandle]:
LockFile, UnlockFile: PROCEDURE [file:FileHandle]:
ReleaseFile, DestroyFile: PROCEDURE [file:FileHandle];
GetFileAccess: PROCEDURE [file:FileHandle] RETURNS [access:AccessOptions];
SetFileAccess: PROCEDURE [file:FileHandle. access:AccessOptions];
GetEndOfFile: PROCEDURE [file:FileHandle] RETURNS [page:PageNumber. byte:CARDINAL];
SetEndOfFile: PROCEDURE [file:FileHandle. page: PageNumber , byte:CARDINAL];
UpdateFileLength: PROCEDURE [file: FileHandle. fa: POINTER TO FA];
JumpToPage: PROCEDURE [
cfa:POtNTER TO CFA. page:PageNumber. buf:POINTER]
RETURNS [prev.next:vDA];
GetFileFP: PROCEDURE [file:FileHandle. fp:POINTER TO FP];
FindFile: PROCEDURE [fp:POINTER TO FP] RETURNS [FileHandle];
EnumerateFiles: PROCEDURE (
proc: PROCEDURE [FileHandle] RETURNS [BOOLEAN]]
RETURNS (file:Fileliandle];
END.