X-Git-Url: https://git.saurik.com/apple/xnu.git/blobdiff_plain/316670eb35587141e969394ae8537d66b9211e80..22ba694c5857e62b5a553b1505dcf2e509177f28:/iokit/IOKit/IOHibernatePrivate.h diff --git a/iokit/IOKit/IOHibernatePrivate.h b/iokit/IOKit/IOHibernatePrivate.h index 6e758273d..525fb5d7a 100644 --- a/iokit/IOKit/IOHibernatePrivate.h +++ b/iokit/IOKit/IOHibernatePrivate.h @@ -100,11 +100,23 @@ struct IOHibernateImageHeader uint32_t debugFlags; uint32_t options; uint32_t sleepTime; + uint32_t compression; - uint32_t reserved[69]; // make sizeof == 512 + uint32_t reserved[58]; // 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]; @@ -251,6 +263,39 @@ struct hibernate_preview_t }; 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" + #ifdef KERNEL #ifdef __cplusplus @@ -264,6 +309,8 @@ IOReturn IOHibernateSystemWake(void); IOReturn IOHibernateSystemPostWake(void); bool IOHibernateWasScreenLocked(void); void IOHibernateSetScreenLocked(uint32_t lockState); +void IOHibernateSetWakeCapabilities(uint32_t capability); +void IOHibernateSystemRestart(void); #endif /* __cplusplus */ @@ -274,14 +321,18 @@ struct kern_direct_file_io_ref_t * kern_open_file_for_direct_io(const char * name, kern_get_file_extents_callback_t callback, void * callback_ref, + + off_t set_file_size, + + off_t write_file_offset, + caddr_t write_file_addr, + vm_size_t write_file_len, + dev_t * partition_device_result, dev_t * image_device_result, uint64_t * partitionbase_result, uint64_t * maxiocount_result, - uint32_t * oflags, - off_t offset, - caddr_t addr, - vm_size_t len); + uint32_t * oflags); void kern_close_file_for_direct_io(struct kern_direct_file_io_ref_t * ref, off_t write_offset, caddr_t addr, vm_size_t write_length, @@ -289,20 +340,27 @@ kern_close_file_for_direct_io(struct kern_direct_file_io_ref_t * ref, #endif /* _SYS_CONF_H_ */ hibernate_page_list_t * -hibernate_page_list_allocate(void); +hibernate_page_list_allocate(boolean_t log); + +kern_return_t +hibernate_alloc_page_lists( + hibernate_page_list_t ** page_list_ret, + hibernate_page_list_t ** page_list_wired_ret, + hibernate_page_list_t ** page_list_pal_ret); kern_return_t hibernate_setup(IOHibernateImageHeader * header, uint32_t free_page_ratio, uint32_t free_page_time, boolean_t vmflush, - hibernate_page_list_t ** page_list_ret, - hibernate_page_list_t ** page_list_wired_ret, - hibernate_page_list_t ** page_list_pal_ret, - boolean_t * encryptedswap); + hibernate_page_list_t * page_list, + hibernate_page_list_t * page_list_wired, + hibernate_page_list_t * page_list_pal); + kern_return_t hibernate_teardown(hibernate_page_list_t * page_list, - hibernate_page_list_t * page_list_wired); + hibernate_page_list_t * page_list_wired, + hibernate_page_list_t * page_list_pal); kern_return_t hibernate_processor_setup(IOHibernateImageHeader * header); @@ -312,6 +370,11 @@ hibernate_gobble_pages(uint32_t gobble_count, uint32_t free_page_time); void hibernate_free_gobble_pages(void); +void +hibernate_vm_lock_queues(void); +void +hibernate_vm_unlock_queues(void); + void hibernate_vm_lock(void); void @@ -322,6 +385,8 @@ void hibernate_page_list_setall(hibernate_page_list_t * page_list, hibernate_page_list_t * page_list_wired, hibernate_page_list_t * page_list_pal, + boolean_t preflight, + boolean_t discard_all, uint32_t * pagesOut); // mark pages to be saved, or pages not to be saved but available @@ -329,6 +394,7 @@ hibernate_page_list_setall(hibernate_page_list_t * page_list, void hibernate_page_list_setall_machine(hibernate_page_list_t * page_list, hibernate_page_list_t * page_list_wired, + boolean_t preflight, uint32_t * pagesOut); // mark pages not to be saved and not for scratch usage during restore @@ -412,6 +478,7 @@ enum kIOHibernateModeSwitch = 0x00000020, kIOHibernateModeRestart = 0x00000040, kIOHibernateModeSSDInvert = 0x00000080, + kIOHibernateModeFileResize = 0x00000100, }; // IOHibernateImageHeader.signature @@ -431,6 +498,8 @@ enum #define kIOHibernateModeKey "Hibernate Mode" #define kIOHibernateFileKey "Hibernate File" +#define kIOHibernateFileMinSizeKey "Hibernate File Min" +#define kIOHibernateFileMaxSizeKey "Hibernate File Max" #define kIOHibernateFreeRatioKey "Hibernate Free Ratio" #define kIOHibernateFreeTimeKey "Hibernate Free Time" @@ -464,7 +533,10 @@ enum { #define kIOHibernateRTCVariablesKey "IOHibernateRTCVariables" #define kIOHibernateSMCVariablesKey "IOHibernateSMCVariables" -#define kIOHibernateBootSwitchVarsKey "boot-switch-vars" +#define kIOHibernateBootSwitchVarsKey "boot-switch-vars" + +#define kIOHibernateBootNoteKey "boot-note" + #define kIOHibernateUseKernelInterpreter 0x80000000