]> git.saurik.com Git - apple/xnu.git/blobdiff - iokit/IOKit/IOHibernatePrivate.h
xnu-1228.tar.gz
[apple/xnu.git] / iokit / IOKit / IOHibernatePrivate.h
index e6046f5c155d028d67572c7c8c3ab773e9cc4c3e..ab897a850b8a28e157ff42b9b26237177eae6b12 100644 (file)
@@ -1,23 +1,29 @@
 /*
  * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
  *
- * @APPLE_LICENSE_HEADER_START@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_START@
  * 
- * The contents of this file constitute Original Code as defined in and
- * are subject to the Apple Public Source License Version 1.1 (the
- * "License").  You may not use this file except in compliance with the
- * License.  Please obtain a copy of the License at
- * http://www.apple.com/publicsource and read it before using this file.
+ * This file contains Original Code and/or Modifications of Original Code
+ * as defined in and that are subject to the Apple Public Source License
+ * Version 2.0 (the 'License'). You may not use this file except in
+ * compliance with the License. The rights granted to you under the License
+ * may not be used to create, or enable the creation or redistribution of,
+ * unlawful or unlicensed copies of an Apple operating system, or to
+ * circumvent, violate, or enable the circumvention or violation of, any
+ * terms of an Apple operating system software license agreement.
  * 
- * This Original Code and all software distributed under the License are
- * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
+ * Please obtain a copy of the License at
+ * http://www.opensource.apple.com/apsl/ and read it before using this file.
+ * 
+ * The Original Code and all software distributed under the License are
+ * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
  * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
  * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT.  Please see the
- * License for the specific language governing rights and limitations
- * under the License.
+ * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
+ * Please see the License for the specific language governing rights and
+ * limitations under the License.
  * 
- * @APPLE_LICENSE_HEADER_END@
+ * @APPLE_OSREFERENCE_LICENSE_HEADER_END@
  */
 
 #include <stdint.h>
@@ -110,27 +116,23 @@ struct hibernate_page_list_t
 };
 typedef struct hibernate_page_list_t hibernate_page_list_t;
 
+#if defined(_AES_H)
+
 struct hibernate_cryptwakevars_t
 {
-#ifdef _AES_H
     uint8_t aes_iv[AES_BLOCK_SIZE];
-#else
-#warning undef _AES_H
-#endif
 };
 typedef struct hibernate_cryptwakevars_t hibernate_cryptwakevars_t;
 
 struct hibernate_cryptvars_t
 {
-#ifdef _AES_H
     uint8_t aes_iv[AES_BLOCK_SIZE];
     aes_ctx ctx;
-#else
-#warning undef _AES_H
-#endif
 };
 typedef struct hibernate_cryptvars_t hibernate_cryptvars_t;
 
+#endif /* defined(_AES_H) */
+
 
 enum 
 {
@@ -147,6 +149,15 @@ enum
     kIOHibernateProgressDarkGray      = 92
 };
 
+enum
+{
+    kIOHibernatePostWriteSleep   = 0,
+    kIOHibernatePostWriteWake    = 1,
+    kIOHibernatePostWriteHalt    = 2,
+    kIOHibernatePostWriteRestart = 3
+};
+
+
 struct hibernate_graphics_t
 {
     uint32_t physicalAddress;          // Base address of video memory
@@ -209,7 +220,7 @@ 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 **symfile);
+int get_kernel_symfile(struct proc *p, char const **symfile);
 #endif /* _SYS_CONF_H_ */
 
 hibernate_page_list_t *
@@ -277,7 +288,8 @@ hibernate_restore_phys_page(uint64_t src, uint64_t dst, uint32_t len, uint32_t p
 
 void
 hibernate_machine_init(void);
-boolean_t
+
+uint32_t
 hibernate_write_image(void);
 
 long
@@ -320,9 +332,10 @@ enum
     kIOHibernateModeOn      = 0x00000001,
     kIOHibernateModeSleep   = 0x00000002,
     kIOHibernateModeEncrypt = 0x00000004,
-
     kIOHibernateModeDiscardCleanInactive = 0x00000008,
-    kIOHibernateModeDiscardCleanActive   = 0x00000010
+    kIOHibernateModeDiscardCleanActive   = 0x00000010,
+    kIOHibernateModeSwitch     = 0x00000020,
+    kIOHibernateModeRestart    = 0x00000040
 };
 
 // IOHibernateImageHeader.signature
@@ -349,6 +362,13 @@ enum
 #define kIOHibernateFeatureKey         "Hibernation"
 #define kIOHibernatePreviewBufferKey   "IOPreviewBuffer"
 
+#define kIOHibernatePreviewActiveKey   "IOHibernatePreviewActive"
+// values for kIOHibernatePreviewActiveKey
+enum {
+    kIOHibernatePreviewActive  = 0x00000001,
+    kIOHibernatePreviewUpdates = 0x00000002
+};
+
 #define kIOHibernateBootImageKey       "boot-image"
 #define kIOHibernateBootImageKeyKey    "boot-image-key"
 #define kIOHibernateBootSignatureKey   "boot-signature"
@@ -359,6 +379,9 @@ enum
 
 #define kIOHibernateRTCVariablesKey    "IOHibernateRTCVariables"
 
+#define kIOHibernateBootSwitchVarsKey                  "boot-switch-vars"
+
+
 #ifdef __cplusplus
 }
 #endif