2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * The contents of this file constitute Original Code as defined in and
7 * are subject to the Apple Public Source License Version 1.1 (the
8 * "License"). You may not use this file except in compliance with the
9 * License. Please obtain a copy of the License at
10 * http://www.apple.com/publicsource and read it before using this file.
12 * This Original Code and all software distributed under the License are
13 * distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, EITHER
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
20 * @APPLE_LICENSE_HEADER_END@
27 enum { kIOHibernateAESKeySize
= 128 }; /* bits */
29 struct IOHibernateVars
31 hibernate_page_list_t
* page_list
;
32 hibernate_page_list_t
* page_list_wired
;
33 class IOBufferMemoryDescriptor
* ioBuffer
;
34 class IOBufferMemoryDescriptor
* srcBuffer
;
35 class IOMemoryDescriptor
* previewBuffer
;
38 OSObject
* saveBootDevice
;
40 struct IOPolledFileIOVars
* fileVars
;
41 vm_offset_t videoMapping
;
42 vm_size_t videoAllocSize
;
43 vm_size_t videoMapSize
;
45 uint8_t saveBootAudioVolume
;
46 uint8_t wiredCryptKey
[kIOHibernateAESKeySize
/ 8];
47 uint8_t cryptKey
[kIOHibernateAESKeySize
/ 8];
49 typedef struct IOHibernateVars IOHibernateVars
;
52 struct IOPolledFileIOVars
54 struct kern_direct_file_io_ref_t
* fileRef
;
55 class OSArray
* pollers
;
56 IOByteCount blockSize
;
58 IOByteCount bufferSize
;
59 IOByteCount bufferLimit
;
60 IOByteCount bufferOffset
;
61 IOByteCount bufferHalf
;
62 IOByteCount extentRemaining
;
66 uint64_t extentPosition
;
67 uint64_t encryptStart
;
68 IOPolledFileExtent
* extentMap
;
69 IOPolledFileExtent
* currentExtent
;
73 typedef struct IOPolledFileIOVars IOPolledFileIOVars
;
75 #endif /* __cplusplus */
79 kIOHibernateTagSignature
= 0x53000000,
80 kIOHibernateTagLength
= 0x00001fff,
85 #endif /* __cplusplus */
87 hibernate_sum(uint8_t *buf
, int32_t len
);
89 extern vm_offset_t sectHIBB
;
90 extern int sectSizeHIB
;
91 extern vm_offset_t sectDATAB
;
92 extern int sectSizeDATA
;
94 extern vm_offset_t gIOHibernateWakeMap
; // ppnum
95 extern vm_size_t gIOHibernateWakeMapSize
;