&vars->page_list_wired,
&vars->page_list_pal);
if (KERN_SUCCESS != err) {
+ HIBLOG("%s err, hibernate_alloc_page_lists return 0x%x\n", __FUNCTION__, err);
break;
}
err = hibernate_pin_swap(TRUE);
if (KERN_SUCCESS != err) {
+ HIBLOG("%s error, hibernate_pin_swap return 0x%x\n", __FUNCTION__, err);
break;
}
swapPinned = true;
}
// set BootNext
if (!gIOHibernateBoot0082Data) {
- OSData * fileData = 0;
+ OSData * fileData = NULL;
data = OSDynamicCast(OSData, gIOChosenEntry->getProperty("boot-device-path"));
if (data && data->getLength() >= 4) {
fileData = OSDynamicCast(OSData, gIOChosenEntry->getProperty("boot-file-path"));
{
IOReturn ret = kIOReturnSuccess;
IOHibernateVars * vars = &gIOHibernateVars;
- OSObject * obj = 0;
+ OSObject * obj = NULL;
OSData * data;
IOLockLock(gFSLock);
vars->consoleMapping = NULL;
if (vars->previewBuffer && (kIOReturnSuccess != vars->previewBuffer->prepare())) {
vars->previewBuffer->release();
- vars->previewBuffer = 0;
+ vars->previewBuffer = NULL;
}
if ((kIOHibernateOptionProgress & gIOHibernateCurrentHeader->options)
if (vars->previewBuffer) {
vars->previewBuffer->release();
- vars->previewBuffer = 0;
+ vars->previewBuffer = NULL;
}
if (kIOHibernateStateWakingFromHibernate == gIOHibernateState) {
IOHibernateSystemPostWake(bool now)
{
gIOHibernateCurrentHeader->signature = kIOHibernateHeaderInvalidSignature;
- IOSetBootImageNVRAM(0);
+ IOSetBootImageNVRAM(NULL);
IOLockLock(gFSLock);
if (kFSTrimDelay == gFSState) {
uint32_t zvPageCount;
IOPolledFileCryptVars _cryptvars;
- IOPolledFileCryptVars * cryptvars = 0;
+ IOPolledFileCryptVars * cryptvars = NULL;
wiredPagesEncrypted = 0;
dirtyPagesEncrypted = 0;
}
}
err = IOHibernatePolledFileWrite(vars->fileVars,
- (uint8_t *) 0,
+ (uint8_t *) NULL,
&gIOHibernateRestoreStackEnd[0] - &gIOHibernateRestoreStack[0],
cryptvars);
if (kIOReturnSuccess != err) {
if (kWiredEncrypt != pageType) {
// end of image1/2 - fill to next block
- err = IOHibernatePolledFileWrite(vars->fileVars, 0, 0, cryptvars);
+ err = IOHibernatePolledFileWrite(vars->fileVars, NULL, 0, cryptvars);
if (kIOReturnSuccess != err) {
break;
}
if (kIOReturnSuccess != err) {
break;
}
- err = IOHibernatePolledFileWrite(vars->fileVars, 0, 0, cryptvars);
+ err = IOHibernatePolledFileWrite(vars->fileVars, NULL, 0, cryptvars);
}while (false);
clock_get_uptime(&endTime);
uint64_t compBytes;
uint32_t lastProgressStamp = 0;
uint32_t progressStamp;
- IOPolledFileCryptVars * cryptvars = 0;
+ IOPolledFileCryptVars * cryptvars = NULL;
IOHibernateVars * vars = &gIOHibernateVars;
bzero(gIOHibernateStats, sizeof(hibernate_statistics_t));
hibernate_page_list_discard(vars->page_list);
}
- cryptvars = (kIOHibernateModeEncrypt & gIOHibernateMode) ? &gIOHibernateCryptWakeContext : 0;
+ cryptvars = (kIOHibernateModeEncrypt & gIOHibernateMode) ? &gIOHibernateCryptWakeContext : NULL;
if (gIOHibernateCurrentHeader->handoffPageCount > gIOHibernateHandoffPageCount) {
panic("handoff overflow");
if (kIOReturnSuccess != err) {
panic("IOPolledFilePollersSetEncryptionKey(0x%x)", err);
}
- cryptvars = 0;
+ cryptvars = NULL;
}
IOPolledFileSeek(vars->fileVars, gIOHibernateCurrentHeader->image1Size);
vars->fileVars->cryptBytes = 0;
AbsoluteTime_to_scalar(&vars->fileVars->cryptTime) = 0;
- err = IOPolledFileRead(vars->fileVars, 0, 0, cryptvars);
+ err = IOPolledFileRead(vars->fileVars, NULL, 0, cryptvars);
vars->fileVars->bufferOffset = vars->fileVars->bufferLimit;
// --