-struct IOHibernateImageHeader
-{
- uint64_t imageSize;
- uint64_t image1Size;
-
- uint32_t restore1CodePage;
- uint32_t restore1PageCount;
- uint32_t restore1CodeOffset;
- uint32_t restore1StackOffset;
-
- uint32_t pageCount;
- uint32_t bitmapSize;
-
- uint32_t restore1Sum;
- uint32_t image1Sum;
- uint32_t image2Sum;
-
- uint32_t actualRestore1Sum;
- uint32_t actualImage1Sum;
- uint32_t actualImage2Sum;
-
- uint32_t actualUncompressedPages;
- uint32_t conflictCount;
- uint32_t nextFree;
-
- uint32_t signature;
- uint32_t processorFlags;
-
- uint32_t runtimePages;
- uint32_t runtimePageCount;
- uint64_t runtimeVirtualPages __attribute__ ((packed));
-
- uint32_t performanceDataStart;
- uint32_t performanceDataSize;
-
- uint64_t encryptStart __attribute__ ((packed));
- uint64_t machineSignature __attribute__ ((packed));
-
- uint32_t previewSize;
- uint32_t previewPageListSize;
-
- uint32_t diag[4];
-
- int32_t graphicsInfoOffset;
- int32_t cryptVarsOffset;
- int32_t memoryMapOffset;
- uint32_t memoryMapSize;
- uint32_t systemTableOffset;
-
- uint32_t debugFlags;
-
- uint32_t reserved[76]; // make sizeof == 512
-
- uint32_t fileExtentMapSize;
- IOPolledFileExtent fileExtentMap[2];
+struct IOHibernateImageHeader {
+ uint64_t imageSize;
+ uint64_t image1Size;
+
+ uint32_t restore1CodePhysPage;
+ uint32_t reserved1;
+ uint64_t restore1CodeVirt;
+ uint32_t restore1PageCount;
+ uint32_t restore1CodeOffset;
+ uint32_t restore1StackOffset;
+
+ uint32_t pageCount;
+ uint32_t bitmapSize;
+
+ uint32_t restore1Sum;
+ uint32_t image1Sum;
+ uint32_t image2Sum;
+
+ uint32_t actualRestore1Sum;
+ uint32_t actualImage1Sum;
+ uint32_t actualImage2Sum;
+
+ uint32_t actualUncompressedPages;
+ uint32_t conflictCount;
+ uint32_t nextFree;
+
+ uint32_t signature;
+ uint32_t processorFlags;
+
+ uint32_t runtimePages;
+ uint32_t runtimePageCount;
+ uint64_t runtimeVirtualPages __attribute__ ((packed));
+
+ uint32_t performanceDataStart;
+ uint32_t performanceDataSize;
+
+ uint64_t encryptStart __attribute__ ((packed));
+ uint64_t machineSignature __attribute__ ((packed));
+
+ uint32_t previewSize;
+ uint32_t previewPageListSize;
+
+ uint32_t diag[4];
+
+ uint32_t handoffPages;
+ uint32_t handoffPageCount;
+
+ uint32_t systemTableOffset;
+
+ uint32_t debugFlags;
+ uint32_t options;
+ uint32_t sleepTime;
+ uint32_t compression;
+
+ uint8_t bridgeBootSessionUUID[16];
+
+ uint32_t reserved[54]; // make sizeof == 512
+ uint32_t booterTime0;
+ uint32_t booterTime1;
+ uint32_t booterTime2;
+
+ uint32_t booterStart;
+ uint32_t smcStart;
+ uint32_t connectDisplayTime;
+ uint32_t splashTime;
+ uint32_t booterTime;
+ uint32_t trampolineTime;
+
+ uint64_t encryptEnd __attribute__ ((packed));
+ uint64_t deviceBase __attribute__ ((packed));
+ uint32_t deviceBlockSize;
+
+ uint32_t fileExtentMapSize;
+ IOPolledFileExtent fileExtentMap[2];
-#define DECLARE_IOHIBERNATEPROGRESSALPHA \
-static const uint8_t gIOHibernateProgressAlpha \
-[kIOHibernateProgressHeight][kIOHibernateProgressWidth] = \
-{ \
- { 0x00,0x63,0xd8,0xf0,0xd8,0x63,0x00 }, \
- { 0x51,0xff,0xff,0xff,0xff,0xff,0x51 }, \
- { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
- { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \
- { 0x54,0xff,0xff,0xff,0xff,0xff,0x54 }, \
- { 0x00,0x66,0xdb,0xf3,0xdb,0x66,0x00 } \
+#define DECLARE_IOHIBERNATEPROGRESSALPHA \
+static const uint8_t gIOHibernateProgressAlpha \
+[kIOHibernateProgressHeight][kIOHibernateProgressWidth] = \
+{ \
+ { 0x00,0x63,0xd8,0xf0,0xd8,0x63,0x00 }, \
+ { 0x51,0xff,0xff,0xff,0xff,0xff,0x51 }, \
+ { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xc3,0xff,0xff,0xff,0xff,0xff,0xc3 }, \
+ { 0xae,0xff,0xff,0xff,0xff,0xff,0xae }, \
+ { 0x54,0xff,0xff,0xff,0xff,0xff,0x54 }, \
+ { 0x00,0x66,0xdb,0xf3,0xdb,0x66,0x00 } \
+struct hibernate_preview_t {
+ uint32_t imageCount; // Number of images
+ uint32_t width; // Width
+ uint32_t height; // Height
+ uint32_t depth; // Pixel Depth
+ uint32_t lockTime; // Lock time
+ uint32_t reservedG[8];// reserved
+ uint32_t reservedK[8];// reserved
+};
+typedef struct hibernate_preview_t hibernate_preview_t;
+
+struct hibernate_statistics_t {
+ uint64_t image1Size;
+ uint64_t imageSize;
+ uint32_t image1Pages;
+ uint32_t imagePages;
+ uint32_t booterStart;
+ uint32_t smcStart;
+ uint32_t booterDuration;
+ uint32_t booterConnectDisplayDuration;
+ uint32_t booterSplashDuration;
+ uint32_t booterDuration0;
+ uint32_t booterDuration1;
+ uint32_t booterDuration2;
+ uint32_t trampolineDuration;
+ uint32_t kernelImageReadDuration;
+
+ uint32_t graphicsReadyTime;
+ uint32_t wakeNotificationTime;
+ uint32_t lockScreenReadyTime;
+ uint32_t hidReadyTime;
+
+ uint32_t wakeCapability;
+ uint32_t resvA[15];
+};
+typedef struct hibernate_statistics_t hibernate_statistics_t;
+
+#define kIOSysctlHibernateStatistics "kern.hibernatestatistics"
+#define kIOSysctlHibernateGraphicsReady "kern.hibernategraphicsready"
+#define kIOSysctlHibernateWakeNotify "kern.hibernatewakenotification"
+#define kIOSysctlHibernateScreenReady "kern.hibernatelockscreenready"
+#define kIOSysctlHibernateHIDReady "kern.hibernatehidready"
+