Common data types
CAMELOTSTRINGLENGTH: INT = 256;
camelotStringT: TYPE = PACKED ARRAY [0..CAMELOTSTRINGLENGTH) OF CHAR;
serverIdT: TYPE = RECORD [value: CARD16];
applicationIdT: TYPE = RECORD [value: INT32];
segmentIdT: TYPE = RECORD [value: CARD16];
uChar: TYPE = CHAR;
uInt: TYPE = CARD32;
segmentDescT:
TYPE =
RECORD [
serverId: serverIdT,
segmentId: segmentIdT,
logicalDisk: uChar,
unused: uChar,
highSize: CARD16,
lowSize: CARD32
];
segmentDescListT: TYPE = POINTER TO segmentDescT;
ListOfSegmentDesc: TYPE = LIST OF segmentDescT;
optrT:
TYPE =
RECORD [
segmentId: segmentIdT,
highOffset: CARD16,
lowOffset: CARD32
];
lsnT:
TYPE =
RECORD [
high: uInt,
low: uInt
];
nodeIdT: TYPE = RECORD [value: CARD32 ← 0];
btidT:
TYPE =
MACHINE
DEPENDENT
RECORD [
nodeId(0): nodeIdT,
ovnv (2:0..0): BOOL ← FALSE,
serverBased (2:1..1): BOOL ← FALSE,
reserved (2:2..7): CARD [0..64) ← 0,
randomBitsHigh (2:8..15): BYTE ← 0,
randomBits (2:16..23): BYTE ← 0,
highTicker (2:24..31): CARD[0..256) ← 0,
lowTicker (4:0..31): CARD ← 0
];
tidT:
TYPE =
RECORD [
top: btidT,
bottom: btidT
];
tidListT: TYPE = LONG POINTER TO tidT;
TIDARRAYSIZE: INT = 10;
tidArrayT: TYPE = ARRAY [0..TIDARRAYSIZE) OF tidT;
lamportClockT:
TYPE =
RECORD [
high: CARD32,
low: CARD32
];
timestampT:
TYPE =
RECORD [
time: lamportClockT,
nodeId: nodeIdT
];
transactionTypeT: TYPE = MACHINE DEPENDENT {ttOvnvHybridatomic (1), ttOvnvStandard (2), ttNvHybridatomic (3), ttNvStandard (4), ttOvnvServerBased (5), ttNvServerBased (6)};
protocolTypeT: TYPE = MACHINE DEPENDENT {ptTwoPhased (1), ptNonBlocking (2), ptLazy (3)};
voteT: TYPE = MACHINE DEPENDENT {voteYes (1), voteNo (2), voteReadOnly (3)};
DSQUEUESIZE: INT = ((1024-3*SIZE[uInt])/SIZE[uInt]);
dsQueueT:
TYPE =
RECORD [
head: uInt,
tail: uInt,
unused: uInt,
queue: ARRAY [0..DSQUEUESIZE) OF uInt
];
transactionState: TYPE = MACHINE DEPENDENT {tsActive (1), tsPrepared (2), tsCommitted (3), tsAborted (4)};
ObjectNameLength: INT = 80;
objectNameT:
TYPE = RECORD[
name: PACKED ARRAY [0..ObjectNameLength) OF CHAR
];
Error codes: classes and codes
ErClassMask: CARD32 = 0FFFF0000h;
ErCodeMask: WORD = 00000FFFFh;
ServFailure: CARD32 = 07f1fch; -- Generic server failure
TwoToTheSixteen: INT = 65536;
ErMigErrorCode: INT = (-1 * TwoToTheSixteen);
ErMachErrorCode: INT = (0 * TwoToTheSixteen);
ErCamelotErrorCode: INT = (2 * TwoToTheSixteen);
ErUserAbortCode: INT = (3 * TwoToTheSixteen);
ErSystemAbortCode: INT = (4 * TwoToTheSixteen);
ErRestrictedUserAbortCode: INT = (5 * TwoToTheSixteen);
ErNonAbortingExceptionCode: INT = (6 * TwoToTheSixteen);
ErSuccess: INT = Mach.KernSuccess;
ErFailure: INT = (ErCamelotErrorCode + 0);
ErBadPort: INT = (ErCamelotErrorCode + 1);
ErBadTid: INT = (ErCamelotErrorCode + 2);
ErBadUserName: INT = (ErCamelotErrorCode + 3);
ErBadPassword: INT = (ErCamelotErrorCode + 4);
ErBadPrivileges: INT = (ErCamelotErrorCode + 5);
ErTooManyConnections: INT = (ErCamelotErrorCode + 6);
ErEntryExists: INT = (ErCamelotErrorCode + 7);
ErNoEntry: INT = (ErCamelotErrorCode + 8);
ErTooManyEntries: INT = (ErCamelotErrorCode + 9);
ErEntryBusy: INT = (ErCamelotErrorCode + 10);
ErTidSuspended: INT = (ErCamelotErrorCode + 11);
ErBadValue: INT = (ErCamelotErrorCode + 12);
ErBadOptr: INT = (ErCamelotErrorCode + 13);
ErRunningRecovery: INT = (ErCamelotErrorCode + 14);
ErNotPinned: INT = (ErCamelotErrorCode + 15);
ErBadLength: INT = (ErCamelotErrorCode + 16);
ErWaitingTransAborted: INT = (ErCamelotErrorCode + 17);
ErBadProtocol: INT = (ErCamelotErrorCode + 18);
ErApplNotFound: INT = (ErCamelotErrorCode + 19);
ErTransNotFound: INT = (ErCamelotErrorCode + 20);
ErTranmanError: INT = (ErCamelotErrorCode + 21);
ErServerError: INT = (ErCamelotErrorCode + 22);
ErBadTransType: INT = (ErCamelotErrorCode + 23);
ErServerNotFound: INT = (ErCamelotErrorCode + 24);
ErCallNotAllowed: INT = (ErCamelotErrorCode + 25);
ErActiveChildren: INT = (ErCamelotErrorCode + 26);
ErNotBeginner: INT = (ErCamelotErrorCode + 27);
ErTransAlreadyAborted: INT = (ErCamelotErrorCode + 28);
ErAlreadyJoined: INT = (ErCamelotErrorCode + 29);
ErTooManyServers: INT = (ErCamelotErrorCode + 30);
ErPagesPinned: INT = (ErCamelotErrorCode + 31);
ErPagesQueuedForFlush: INT = (ErCamelotErrorCode + 32);
ErNonAbortingException: INT = (ErNonAbortingExceptionCode + 33);
ErTooManyTids: INT = (ErCamelotErrorCode + 34);
ErServerNotDown: INT = (ErCamelotErrorCode + 35);
ErLwmMismatch: INT = (ErCamelotErrorCode + 36);
AcIllegalAbortCode: INT = (ErSystemAbortCode + 1);
AcCommitFailed: INT = (ErSystemAbortCode + 2);
AcServerDied: INT = (ErSystemAbortCode + 5);
AcApplicationDied: INT = (ErSystemAbortCode + 6);
AcAncestorAborted: INT = (ErSystemAbortCode + 8);
AcCommittedChildAborted: INT = (ErSystemAbortCode + 9);
AcLongRunning: INT = (ErSystemAbortCode + 10);
Recoverable Storage Management
DSInitialize:
PROC [dsPort: Mach.portT, raiseSignal:
BOOL]
RETURNS [serverID: serverIdT, tsPort, mPort, sPort: Mach.portT, sharedMemAddr: Mach.vmAddressT, seqDescList: ListOfSegmentDesc, seqPortList: Mach.ListOfPorts, kernCode: Mach.kernReturnT];
Initialize the data server.
DSPinObject:
PROC [dsPort: Mach.portT, tid: tidT, optr: optrT, size: uInt, raiseSignal:
BOOL]
RETURNS [kernCode: Mach.kernReturnT];
Pin an object in preparation for modification.
DSLogNewValue:
PROC [dsPort: Mach.portT, tid: tidT, optr: optrT, newValue: Mach.pointerT, newValueCnt:
INT, raiseSignal:
BOOL]
RETURNS [kernCode: Mach.kernReturnT];
Send a new value of an object to the log.
DSLogOldValueNewValue:
PROC [dsPort: Mach.portT, tid: tidT, optr: optrT, oldValue: Mach.pointerT, oldValueCnt: INT, newValue: Mach.pointerT, newValueCnt: INT
, raiseSignal:
BOOL]
RETURNS [kernCode: Mach.kernReturnT];
Send a new value of an object to the log.
DSPrepare:
PROC [dsPort: Mach.portT, topBTid: btidT, prepareData: Mach.pointerT, prepareDataCnt:
INT, raiseSignal:
BOOL]
RETURNS [kernCode: Mach.kernReturnT];
Send a new value of an object to the log.
DSQInit:
PROC [sharedMemAddr
: Mach.vmAddressT];
Send a new value of an object to the log.
DSQPreflush:
PROC [dsPort: Mach.portT, optr: optrT, sizeInBytes: uInt];
Preflush some dirty memory.
DSQZeroFill:
PROC [dsPort: Mach.portT, optr: optrT, sizeInBytes: uInt];
Zero some memory.
Transaction Management
TAAddApplication:
PROC [tPort: Mach.portT, atPort: Mach.portT, authName: Rope.
ROPE, raiseSignal:
BOOL]
RETURNS [applicationID: applicationIdT, taPort: Mach.portT, kernCode: Mach.kernReturnT];
Initialize an application to the transaction manager.
TABegin:
PROC [taPort: Mach.portT, parentTid: tidT, transType: transactionTypeT
, raiseSignal:
BOOL]
RETURNS [newTid: tidT, kernCode: Mach.kernReturnT];
Start a new transaction.
TAEnd:
PROC [taPort: Mach.portT, tid: tidT, protocolType: protocolTypeT
, raiseSignal:
BOOL]
RETURNS [timestamp: timestampT, status:
INT, kernCode: Mach.kernReturnT];
Try to commit a transaction.
TAKill:
PROC [taPort: Mach.portT, tid: tidT, status:
INT, raiseSignal:
BOOL]
RETURNS [kernCode: Mach.kernReturnT] ;
Try to abort a transaction.
TDAddDataServer:
PROC [tdPort: Mach.portT, serverID: serverIdT, sendPort: Mach.portT
, raiseSignal:
BOOL]
RETURNS [rcvPort: Mach.portT, kernCode: Mach.kernReturnT];
Initialize the data server to the transaction manager.
TSJoin:
PROC [tsPort: Mach.portT, tid: tidT
, raiseSignal:
BOOL]
RETURNS [kernCode: Mach.kernReturnT];
Join an existing transaction.