ReadRestartRecord:
PUBLIC
ENTRY
PROC []
RETURNS [wordNumberForCheckpointCompleteRecord: WordNumber, recordIDForCheckpointCompleteRecord: RecordID] ~ {
mappedAddress: Mach.vmAddressT;
kernCode: Mach.kernReturnT;
pointerToCards: LONG POINTER TO ARRAY [0..4) OF CARD32;
[mappedAddress: mappedAddress, kernCode: kernCode] ← Mach.vmAllocateWithPager[targetTask: Mach.taskSelf[], address: 0, size: 4096, anywhere: TRUE, pagingObject: [9], offset: 0, raiseSignal: TRUE];
pointerToCards ← LOOPHOLE[mappedAddress];
TRUSTED {
recordIDForCheckpointCompleteRecord ← [sign: positive, low: pointerToCards[0], high: pointerToCards[1]];
wordNumberForCheckpointCompleteRecord ← [sign: positive, low: pointerToCards[2], high: pointerToCards[3]];
};
[] ← Mach.vmDeallocate[targetTask: Mach.taskSelf[], address: mappedAddress, size: 4096, raiseSignal: TRUE];
};
WriteRestartRecord:
PUBLIC
ENTRY
PROC [ wordNumberForCheckpointCompleteRecord: WordNumber, recordIDForCheckpointCompleteRecord: RecordID] = {
mappedAddress: Mach.vmAddressT;
kernCode: Mach.kernReturnT;
pointerToCards: LONG POINTER TO ARRAY [0..4) OF CARD32;
[mappedAddress: mappedAddress, kernCode: kernCode] ← Mach.vmAllocateWithPager[targetTask: Mach.taskSelf[], address: 0, size: 4096, anywhere: TRUE, pagingObject: [9], offset: 0, raiseSignal: TRUE];
pointerToCards ← LOOPHOLE[mappedAddress];
TRUSTED {
pointerToCards[0] ← recordIDForCheckpointCompleteRecord.low;
pointerToCards[1] ← recordIDForCheckpointCompleteRecord.high;
pointerToCards[2] ← wordNumberForCheckpointCompleteRecord.low;
pointerToCards[3] ← wordNumberForCheckpointCompleteRecord.high;
};
[] ← Mach.vmDeallocate[targetTask: Mach.taskSelf[], address: mappedAddress, size: 4096, raiseSignal: TRUE];
};