#ifdef KERNEL
#include <crypto/aes.h>
+#include <uuid/uuid.h>
#endif
struct IOPolledFileExtent
uint64_t imageSize;
uint64_t image1Size;
- uint32_t restore1CodePage;
+ uint32_t restore1CodePhysPage;
+ uint32_t reserved1;
+ uint64_t restore1CodeVirt;
uint32_t restore1PageCount;
uint32_t restore1CodeOffset;
uint32_t restore1StackOffset;
uint32_t diag[4];
- int32_t graphicsInfoOffset;
- int32_t cryptVarsOffset;
- int32_t memoryMapOffset;
- uint32_t memoryMapSize;
+ uint32_t handoffPages;
+ uint32_t handoffPageCount;
+
uint32_t systemTableOffset;
uint32_t debugFlags;
uint32_t options;
- uint32_t reserved[71]; // make sizeof == 512
+ uint32_t reserved[70]; // make sizeof == 512
uint64_t encryptEnd __attribute__ ((packed));
uint64_t deviceBase __attribute__ ((packed));
#endif /* defined(_AES_H) */
+enum
+{
+ kIOHibernateHandoffType = 0x686f0000,
+ kIOHibernateHandoffTypeEnd = kIOHibernateHandoffType + 0,
+ kIOHibernateHandoffTypeGraphicsInfo = kIOHibernateHandoffType + 1,
+ kIOHibernateHandoffTypeCryptVars = kIOHibernateHandoffType + 2,
+ kIOHibernateHandoffTypeMemoryMap = kIOHibernateHandoffType + 3,
+ kIOHibernateHandoffTypeDeviceTree = kIOHibernateHandoffType + 4,
+ kIOHibernateHandoffTypeDeviceProperties = kIOHibernateHandoffType + 5,
+ kIOHibernateHandoffTypeKeyStore = kIOHibernateHandoffType + 6,
+};
+
+struct IOHibernateHandoff
+{
+ uint32_t type;
+ uint32_t bytecount;
+ uint8_t data[];
+};
+typedef struct IOHibernateHandoff IOHibernateHandoff;
enum
{
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,
- dev_t * device_result,
- uint64_t * partitionbase_result,
- uint64_t * maxiocount_result,
- boolean_t * solid_state);
-
-
+ void * callback_ref,
+ 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);
void
-kern_close_file_for_direct_io(struct kern_direct_file_io_ref_t * ref);
-int
-kern_write_file(struct kern_direct_file_io_ref_t * ref, off_t offset, caddr_t addr, vm_size_t len);
-int get_kernel_symfile(struct proc *p, char const **symfile);
+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,
+ off_t discard_offset, off_t discard_end);
#endif /* _SYS_CONF_H_ */
hibernate_page_list_t *
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);
kern_return_t
hibernate_teardown(hibernate_page_list_t * page_list,
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,
uint32_t * pagesOut);
// mark pages to be saved, or pages not to be saved but available
uint32_t
hibernate_page_bitmap_count(hibernate_bitmap_t * bitmap, uint32_t set, uint32_t page);
-void
+uintptr_t
hibernate_restore_phys_page(uint64_t src, uint64_t dst, uint32_t len, uint32_t procFlags);
void
hibernate_write_image(void);
long
-hibernate_machine_entrypoint(IOHibernateImageHeader * header, void * p2, void * p3, void * p4);
+hibernate_machine_entrypoint(uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4);
long
-hibernate_kernel_entrypoint(IOHibernateImageHeader * header, void * p2, void * p3, void * p4);
+hibernate_kernel_entrypoint(uint32_t p1, uint32_t p2, uint32_t p3, uint32_t p4);
void
hibernate_newruntime_map(void * map, vm_size_t map_size,
uint32_t system_table_offset);
extern uint8_t gIOHibernateRestoreStack[];
extern uint8_t gIOHibernateRestoreStackEnd[];
extern IOHibernateImageHeader * gIOHibernateCurrentHeader;
-extern hibernate_graphics_t * gIOHibernateGraphicsInfo;
-extern hibernate_cryptwakevars_t * gIOHibernateCryptWakeVars;
#define HIBLOG(fmt, args...) \
{ kprintf(fmt, ## args); printf(fmt, ## args); }
#define kIOHibernateMachineSignatureKey "machine-signature"
#define kIOHibernateRTCVariablesKey "IOHibernateRTCVariables"
+#define kIOHibernateSMCVariablesKey "IOHibernateSMCVariables"
#define kIOHibernateBootSwitchVarsKey "boot-switch-vars"
+#define kIOHibernateUseKernelInterpreter 0x80000000
#ifdef __cplusplus
}