]> git.saurik.com Git - apple/xnu.git/blame - iokit/Kernel/IOHibernateInternal.h
xnu-792.6.61.tar.gz
[apple/xnu.git] / iokit / Kernel / IOHibernateInternal.h
CommitLineData
3a60a9f5
A
1/*
2 * Copyright (c) 2004 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
37839358
A
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.
3a60a9f5 11 *
37839358
A
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
3a60a9f5
A
14 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
15 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
37839358
A
16 * FITNESS FOR A PARTICULAR PURPOSE OR NON-INFRINGEMENT. Please see the
17 * License for the specific language governing rights and limitations
18 * under the License.
3a60a9f5
A
19 *
20 * @APPLE_LICENSE_HEADER_END@
21 */
22
23#include <stdint.h>
24
25#ifdef __cplusplus
26
27enum { kIOHibernateAESKeySize = 128 }; /* bits */
28
29struct IOHibernateVars
30{
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;
36 OSData * previewData;
37 OSData * fileExtents;
38 OSObject * saveBootDevice;
39
40 struct IOPolledFileIOVars * fileVars;
41 vm_offset_t videoMapping;
42 vm_size_t videoAllocSize;
43 vm_size_t videoMapSize;
44 uint8_t haveFastBoot;
45 uint8_t saveBootAudioVolume;
46 uint8_t wiredCryptKey[kIOHibernateAESKeySize / 8];
47 uint8_t cryptKey[kIOHibernateAESKeySize / 8];
48};
49typedef struct IOHibernateVars IOHibernateVars;
50
51
52struct IOPolledFileIOVars
53{
54 struct kern_direct_file_io_ref_t * fileRef;
55 class OSArray * pollers;
56 IOByteCount blockSize;
57 uint8_t * buffer;
58 IOByteCount bufferSize;
59 IOByteCount bufferLimit;
60 IOByteCount bufferOffset;
61 IOByteCount bufferHalf;
62 IOByteCount extentRemaining;
63 IOByteCount lastRead;
64 uint64_t block0;
65 uint64_t position;
66 uint64_t extentPosition;
67 uint64_t encryptStart;
68 IOPolledFileExtent * extentMap;
69 IOPolledFileExtent * currentExtent;
70 bool io;
71 IOReturn ioStatus;
72};
73typedef struct IOPolledFileIOVars IOPolledFileIOVars;
74
75#endif /* __cplusplus */
76
77enum
78{
79 kIOHibernateTagSignature = 0x53000000,
80 kIOHibernateTagLength = 0x00001fff,
81};
82
83#ifdef __cplusplus
84extern "C"
85#endif /* __cplusplus */
86uint32_t
87hibernate_sum(uint8_t *buf, int32_t len);
88
89extern vm_offset_t sectHIBB;
90extern int sectSizeHIB;
91extern vm_offset_t sectDATAB;
92extern int sectSizeDATA;
93