Shepherd.mesa
Copyright Ó 1989, 1990 by Xerox Corporation. All rights reserved.
Peter B. Kessler, April 18, 1990 12:55 pm PDT
This interface is dedicated to Ernest H. Shepherd.
DIRECTORY
TargetArchitecture,
BreakWorldArchitecture,
Rope USING [ROPE];
Shepherd: CEDAR DEFINITIONS ~ {
Types.
Patch: TYPE ~ REF PatchRep ← nullPatch;
nullPatch: Patch ~ NIL;
PatchRep: TYPE;
Each patch has a PatchHeader prepended to it to say what pc it's a patch for (so various clients don't compete for pc's, and a size, to say how big the patch is.
PatchHeaderStruct: PRIVATE TYPE ~ MACHINE DEPENDENT RECORD [
This is a translation of the structs declared in patch.h.
size (0:0..7): PatchSize,
relPCMS (0:8..15): RelPCMS,
relPCLS (0:16..31): RelPCLS
];
PatchSize: TYPE ~ CARDINAL [0..255];
in words!
RelPCMS: TYPE ~ CARDINAL [firstRelPCMS .. lastRelPCMS];
firstRelPCMS: CARDINAL ~ 0;
lastRelPCMS: CARDINAL ~ 255;
RelPCLS: TYPE ~ CARDINAL [firstRelPCLS .. lastRelPCLS];
firstRelPCLS: CARDINAL ~ 0;
lastRelPCLS: CARDINAL ~ 65535;
RelPC: TYPE ~ TargetArchitecture.Displacement;
firstRelPC: INT32 ~ -8388608;
lastRelPC: INT32 ~ +8388607;
Meadow: TYPE ~ REF MeadowRep ← nullMeadow;
nullMeadow: Meadow ~ NIL;
MeadowRep: TYPE;
Procedures.
IsNullMeadow: PROCEDURE [meadow: Meadow] RETURNS [BOOLEAN];
ReservePatch: PROCEDURE [
pc: BreakWorldArchitecture.Address, codeSize: BreakWorldArchitecture.ByteSize]
RETURNS [Patch];
! NoRoom, NoMeadow, BusyMeadow, BusyAddress.
ReleasePatch: PROCEDURE [patch: Patch] RETURNS [];
! NoMeadow, BusyMeadow
IsNullPatch: PROCEDURE [patch: Patch] RETURNS [BOOLEAN];
IsBusyPC: PROCEDURE [pc: BreakWorldArchitecture.Address] RETURNS [BOOLEAN];
MeadowFromPatch: PROCEDURE [patch: Patch]
RETURNS [Meadow];
PCFromPatch: PROCEDURE [patch: Patch]
RETURNS [BreakWorldArchitecture.Address];
PatchAddressFromPatch: PROCEDURE [patch: Patch]
RETURNS [BreakWorldArchitecture.Address];
CodeAddressFromPatch: PROCEDURE [patch: Patch]
RETURNS [BreakWorldArchitecture.Address];
PatchFromPC: PROCEDURE [pc: BreakWorldArchitecture.Address]
RETURNS [Patch];
IsAllocatedPatch: PROCEDURE [patch: Patch] RETURNS [BOOLEAN];
Errors.
ErrorMessage: TYPE ~ Rope.ROPE ← nullErrorMessage;
nullErrorMessage: ErrorMessage ~ NIL;
NoRoom: ERROR [message: ErrorMessage];
NoMeadow: ERROR [message: ErrorMessage];
BusyMeadow: ERROR [message: ErrorMessage];
BusyPC: ERROR [message: ErrorMessage];
CantReach: ERROR [message: ErrorMessage];
Cant: ERROR [message: ErrorMessage];
}.