2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
21 * @APPLE_LICENSE_HEADER_END@
28 enum { kIOHibernateAESKeySize
= 128 }; /* bits */
30 struct IOHibernateVars
32 hibernate_page_list_t
* page_list
;
33 hibernate_page_list_t
* page_list_wired
;
34 class IOBufferMemoryDescriptor
* ioBuffer
;
35 class IOBufferMemoryDescriptor
* srcBuffer
;
36 class IOMemoryDescriptor
* previewBuffer
;
39 OSObject
* saveBootDevice
;
41 struct IOPolledFileIOVars
* fileVars
;
42 vm_offset_t videoMapping
;
43 vm_size_t videoAllocSize
;
44 vm_size_t videoMapSize
;
46 uint8_t saveBootAudioVolume
;
47 uint8_t wiredCryptKey
[kIOHibernateAESKeySize
/ 8];
48 uint8_t cryptKey
[kIOHibernateAESKeySize
/ 8];
50 typedef struct IOHibernateVars IOHibernateVars
;
53 struct IOPolledFileIOVars
55 struct kern_direct_file_io_ref_t
* fileRef
;
56 class OSArray
* pollers
;
57 IOByteCount blockSize
;
59 IOByteCount bufferSize
;
60 IOByteCount bufferLimit
;
61 IOByteCount bufferOffset
;
62 IOByteCount bufferHalf
;
63 IOByteCount extentRemaining
;
67 uint64_t extentPosition
;
68 uint64_t encryptStart
;
69 IOPolledFileExtent
* extentMap
;
70 IOPolledFileExtent
* currentExtent
;
74 typedef struct IOPolledFileIOVars IOPolledFileIOVars
;
76 #endif /* __cplusplus */
80 kIOHibernateTagSignature
= 0x53000000,
81 kIOHibernateTagLength
= 0x00001fff,
86 #endif /* __cplusplus */
88 hibernate_sum(uint8_t *buf
, int32_t len
);
90 extern vm_offset_t sectHIBB
;
91 extern int sectSizeHIB
;
92 extern vm_offset_t sectDATAB
;
93 extern int sectSizeDATA
;