VirtualBox

source: vbox/trunk/include/VBox/ssm.h@ 23771

Last change on this file since 23771 was 23771, checked in by vboxsync, 15 years ago

SSM: Added SSMFIELD_ENTRY_PAD_MSC32_AUTO.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 40.7 KB
Line 
1/** @file
2 * SSM - The Save State Manager. (VMM)
3 */
4
5/*
6 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
7 *
8 * This file is part of VirtualBox Open Source Edition (OSE), as
9 * available from http://www.virtualbox.org. This file is free software;
10 * you can redistribute it and/or modify it under the terms of the GNU
11 * General Public License (GPL) as published by the Free Software
12 * Foundation, in version 2 as it comes in the "COPYING" file of the
13 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
14 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
15 *
16 * The contents of this file may alternatively be used under the terms
17 * of the Common Development and Distribution License Version 1.0
18 * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
19 * VirtualBox OSE distribution, in which case the provisions of the
20 * CDDL are applicable instead of those of the GPL.
21 *
22 * You may elect to license modified versions of this file under the
23 * terms and conditions of either the GPL or the CDDL or both.
24 *
25 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
26 * Clara, CA 95054 USA or visit http://www.sun.com if you need
27 * additional information or have any questions.
28 */
29
30#ifndef ___VBox_ssm_h
31#define ___VBox_ssm_h
32
33#include <VBox/cdefs.h>
34#include <VBox/types.h>
35#include <VBox/tm.h>
36#include <VBox/vmapi.h>
37
38RT_C_DECLS_BEGIN
39
40/** @defgroup grp_ssm The Saved State Manager API
41 * @{
42 */
43
44/**
45 * Determine the major version of the SSM version. If the major SSM version of two snapshots is
46 * different, the snapshots are incompatible.
47 */
48#define SSM_VERSION_MAJOR(ver) ((ver) & 0xffff0000)
49
50/**
51 * Determine the minor version of the SSM version. If the major SSM version of two snapshots is
52 * the same, the code must handle incompatibilies between minor version changes (e.g. use dummy
53 * values for non-existent fields).
54 */
55#define SSM_VERSION_MINOR(ver) ((ver) & 0x0000ffff)
56
57/**
58 * Determine if the major version changed between two SSM versions.
59 */
60#define SSM_VERSION_MAJOR_CHANGED(ver1,ver2) (SSM_VERSION_MAJOR(ver1) != SSM_VERSION_MAJOR(ver2))
61
62/** The special value for the final pass. */
63#define SSM_PASS_FINAL UINT32_MAX
64
65
66#ifdef IN_RING3
67/** @defgroup grp_ssm_r3 The SSM Host Context Ring-3 API
68 * @{
69 */
70
71
72/**
73 * What to do after the save/load operation.
74 */
75typedef enum SSMAFTER
76{
77 /** Invalid. */
78 SSMAFTER_INVALID = 0,
79 /** Will resume the loaded state. */
80 SSMAFTER_RESUME,
81 /** Will destroy the VM after saving. */
82 SSMAFTER_DESTROY,
83 /** Will continue execution after saving the VM. */
84 SSMAFTER_CONTINUE,
85 /** Will migrate the VM.
86 * The source VM will be destroyed (then one saving), the destination VM
87 * will continue execution. */
88 SSMAFTER_MIGRATE,
89 /** Will debug the saved state.
90 * This is used to drop some of the stricter consitentcy checks so it'll
91 * load fine in the debugger or animator. */
92 SSMAFTER_DEBUG_IT,
93 /** The file was opened using SSMR3Open() and we have no idea what the plan is. */
94 SSMAFTER_OPENED
95} SSMAFTER;
96
97
98/** Pointer to a structure field description. */
99typedef struct SSMFIELD *PSSMFIELD;
100/** Pointer to a const structure field description. */
101typedef const struct SSMFIELD *PCSSMFIELD;
102
103/**
104 * SSMFIELD Get/Put callback function.
105 *
106 * This is call for getting and putting the field it is associated with. It's
107 * up to the callback to work the saved state correctly.
108 *
109 * @returns VBox status code.
110 *
111 * @param pSSM The saved state handle.
112 * @param pField The field that is being processed.
113 * @param pvStruct Pointer to the structure.
114 * @param fFlags SSMSTRUCT_FLAGS_XXX.
115 * @param fGetOrPut True if getting, false if putting.
116 * @param pvUser The user argument specified to SSMR3GetStructEx or
117 * SSMR3PutStructEx.
118 */
119typedef DECLCALLBACK(int) FNSSMFIELDGETPUT(PSSMHANDLE pSSM, const struct SSMFIELD *pField, void *pvStruct,
120 uint32_t fFlags, bool fGetOrPut, void *pvUser);
121/** Pointer to a SSMFIELD Get/Put callback. */
122typedef FNSSMFIELDGETPUT *PFNSSMFIELDGETPUT;
123
124/**
125 * SSM field transformers.
126 *
127 * These are stored in the SSMFIELD::pfnGetPutOrTransformer and must therefore
128 * have values outside the valid pointer range.
129 */
130typedef enum SSMFIELDTRANS
131{
132 /** Invalid. */
133 SSMFIELDTRANS_INVALID = 0,
134 /** No transformation. */
135 SSMFIELDTRANS_NO_TRANSFORMATION,
136 /** Guest context (GC) virtual address. */
137 SSMFIELDTRANS_GCPTR,
138 /** Guest context (GC) physical address. */
139 SSMFIELDTRANS_GCPHYS,
140 /** Raw-mode context (RC) virtual address. */
141 SSMFIELDTRANS_RCPTR,
142 /** Array of raw-mode context (RC) virtual addresses. */
143 SSMFIELDTRANS_RCPTR_ARRAY,
144 /** Host context (HC) virtual address used as a NULL indicator. See
145 * SSMFIELD_ENTRY_HCPTR_NI. */
146 SSMFIELDTRANS_HCPTR_NI,
147 /** Array of SSMFIELDTRANS_HCPTR_NI. */
148 SSMFIELDTRANS_HCPTR_NI_ARRAY,
149 /** Ignorable Host context (HC) virtual address. See SSMFIELD_ENTRY_HCPTR. */
150 SSMFIELDTRANS_HCPTR,
151 /** Ignorable field. See SSMFIELD_ENTRY_IGNORE. */
152 SSMFIELDTRANS_IGNORE,
153 /** Padding that differs between 32-bit and 64-bit hosts.
154 * The first byte of SSMFIELD::cb contains the size for 32-bit hosts.
155 * The second byte of SSMFIELD::cb contains the size for 64-bit hosts.
156 * The upper word of SSMFIELD::cb contains the actual field size.
157 */
158 SSMFIELDTRANS_PAD_HC,
159 /** Padding for 32-bit hosts only.
160 * SSMFIELD::cb has the same format as for SSMFIELDTRANS_PAD_HC. */
161 SSMFIELDTRANS_PAD_HC32,
162 /** Padding for 64-bit hosts only.
163 * SSMFIELD::cb has the same format as for SSMFIELDTRANS_PAD_HC. */
164 SSMFIELDTRANS_PAD_HC64,
165 /** Automatic compiler padding that may differ between 32-bit and
166 * 64-bit hosts. SSMFIELD::cb has the same format as for
167 * SSMFIELDTRANS_PAD_HC. */
168 SSMFIELDTRANS_PAD_HC_AUTO,
169 /** Automatic compiler padding specific to the 32-bit Microsoft C
170 * compiler.
171 * SSMFIELD::cb has the same format as for SSMFIELDTRANS_PAD_HC. */
172 SSMFIELDTRANS_PAD_MSC32_AUTO
173} SSMFIELDTRANS;
174
175/** Tests if it's a padding field with the special SSMFIELD::cb format.
176 * @returns true / false.
177 * @param pfn The SSMFIELD::pfnGetPutOrTransformer value.
178 */
179#define SSMFIELDTRANS_IS_PADDING(pfn) \
180 ( (uintptr_t)(pfn) >= SSMFIELDTRANS_PAD_HC && (uintptr_t)(pfn) <= SSMFIELDTRANS_PAD_MSC32_AUTO )
181
182/**
183 * A structure field description.
184 */
185typedef struct SSMFIELD
186{
187 /** Getter and putter callback or transformer index. */
188 PFNSSMFIELDGETPUT pfnGetPutOrTransformer;
189 /** Field offset into the structure. */
190 uint32_t off;
191 /** The size of the field. */
192 uint32_t cb;
193 /** Field name. */
194 const char *pszName;
195} SSMFIELD;
196
197/** Emit a SSMFIELD array entry.
198 * @internal */
199#define SSMFIELD_ENTRY_INT(Type, Field, enmTransformer) \
200 { \
201 (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
202 RT_OFFSETOF(Type, Field), \
203 RT_SIZEOFMEMB(Type, Field), \
204 #Type "::" #Field \
205 }
206/** Emit a SSMFIELD array entry for an alignment padding.
207 * @internal */
208#define SSMFIELD_ENTRY_PAD_INT(Type, Field, cb32, cb64, enmTransformer) \
209 { \
210 (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
211 RT_OFFSETOF(Type, Field), \
212 (RT_SIZEOFMEMB(Type, Field) << 16) | (cb32) | ((cb64) << 8), \
213 #Type "::" #Field \
214 }
215/** Emit a SSMFIELD array entry for an alignment padding.
216 * @internal */
217#define SSMFIELD_ENTRY_PAD_OTHER_INT(Type, Field, cb32, cb64, enmTransformer) \
218 { \
219 (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), \
220 UINT32_MAX / 2, \
221 0 | (cb32) | ((cb64) << 8), \
222 #Type "::" #Field \
223 }
224
225/** Emit a SSMFIELD array entry. */
226#define SSMFIELD_ENTRY(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_NO_TRANSFORMATION)
227/** Emit a SSMFIELD array entry for a RTGCPTR type. */
228#define SSMFIELD_ENTRY_GCPTR(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_GCPTR)
229/** Emit a SSMFIELD array entry for a RTGCPHYS type. */
230#define SSMFIELD_ENTRY_GCPHYS(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_GCPHYS)
231/** Emit a SSMFIELD array entry for a raw-mode context pointer. */
232#define SSMFIELD_ENTRY_RCPTR(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_RCPTR)
233/** Emit a SSMFIELD array entry for a raw-mode context pointer. */
234#define SSMFIELD_ENTRY_RCPTR_ARRAY(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_RCPTR_ARRAY)
235/** Emit a SSMFIELD array entry for a ring-0 or ring-3 pointer type that is only
236 * of interest as a NULL indicator.
237 *
238 * This is always restored as a 0 (NULL) or 1 value. When
239 * SSMSTRUCT_FLAGS_DONT_IGNORE is set, the pointer will be saved in its
240 * entirety, when clear it will be saved as a boolean. */
241#define SSMFIELD_ENTRY_HCPTR_NI(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI)
242/** Same as SSMFIELD_ENTRY_HCPTR_NI, except it's an array of the buggers. */
243#define SSMFIELD_ENTRY_HCPTR_NI_ARRAY(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI_ARRAY)
244/** Emit a SSMFIELD array entry for a ring-0 or ring-3 pointer type that is
245 * of no real interest to the saved state. It follows the same save and restore
246 * rules as SSMFIELD_ENTRY_IGNORE. */
247#define SSMFIELD_ENTRY_HCPTR(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_HCPTR)
248/** Emit a SSMFIELD array entry for a field that can be ignored.
249 * It is stored as zeros if SSMSTRUCT_FLAGS_DONT_IGNORE is specified to
250 * SSMR3PutStructEx. The member is never touched upon restore. */
251#define SSMFIELD_ENTRY_IGNORE(Type, Field) SSMFIELD_ENTRY_INT(Type, Field, SSMFIELDTRANS_IGNORE)
252/** Emit a SSMFIELD array entry for a padding that differs in size between
253 * 64-bit and 32-bit hosts. */
254#define SSMFIELD_ENTRY_PAD_HC(Type, Field, cb32, cb64) SSMFIELD_ENTRY_PAD_INT( Type, Field, cb32, cb64, SSMFIELDTRANS_PAD_HC)
255/** Emit a SSMFIELD array entry for a padding that is exclusive to 64-bit hosts. */
256#if HC_ARCH_BITS == 64
257# define SSMFIELD_ENTRY_PAD_HC64(Type, Field, cb) SSMFIELD_ENTRY_PAD_INT( Type, Field, 0, cb, SSMFIELDTRANS_PAD_HC64)
258#else
259# define SSMFIELD_ENTRY_PAD_HC64(Type, Field, cb) SSMFIELD_ENTRY_PAD_OTHER_INT(Type, Field, 0, cb, SSMFIELDTRANS_PAD_HC64)
260#endif
261/** Emit a SSMFIELD array entry for a 32-bit padding for on 64-bits hosts. */
262#if HC_ARCH_BITS == 32
263# define SSMFIELD_ENTRY_PAD_HC32(Type, Field, cb) SSMFIELD_ENTRY_PAD_INT( Type, Field, cb, 0, SSMFIELDTRANS_PAD_HC32)
264#else
265# define SSMFIELD_ENTRY_PAD_HC32(Type, Field, cb) SSMFIELD_ENTRY_PAD_OTHER_INT(Type, Field, cb, 0, SSMFIELDTRANS_PAD_HC32)
266#endif
267/** Emit a SSMFIELD array entry for an automatic compiler padding that may
268 * differ in size between 64-bit and 32-bit hosts. */
269#if HC_ARCH_BITS == 64
270# define SSMFIELD_ENTRY_PAD_HC_AUTO(cb32, cb64) \
271 { \
272 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_HC_AUTO), \
273 UINT32_MAX / 2, (cb64 << 16) | (cb32) | ((cb64) << 8), "<compiler-padding>" \
274 }
275#else
276# define SSMFIELD_ENTRY_PAD_HC_AUTO(cb32, cb64) \
277 { \
278 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_HC_AUTO), \
279 UINT32_MAX / 2, (cb32 << 16) | (cb32) | ((cb64) << 8), "<compiler-padding>" \
280 }
281#endif
282/** Emit a SSMFIELD array entry for an automatic compiler padding that is unique
283 * to the 32-bit microsoft compiler. This is usually used together with
284 * SSMFIELD_ENTRY_PAD_HC*. */
285#if HC_ARCH_BITS == 32 && defined(_MSC_VER)
286# define SSMFIELD_ENTRY_PAD_MSC32_AUTO(cb) \
287 { \
288 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_MSC32_AUTO), \
289 UINT32_MAX / 2, ((cb) << 16 | (cb), "<msc32-padding>" \
290 }
291#else
292# define SSMFIELD_ENTRY_PAD_MSC32_AUTO(cb) \
293 { \
294 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_MSC32_AUTO), \
295 UINT32_MAX / 2, (cb), "<msc32-padding>" \
296 }
297#endif
298
299/** Emit a SSMFIELD array entry for a field with a custom callback. */
300#define SSMFIELD_ENTRY_CALLBACK(Type, Field, pfnGetPut) \
301 { (pfnGetPut), RT_OFFSETOF(Type, Field), RT_SIZEOFMEMB(Type, Field), #Type "::" #Field }
302/** Emit the terminating entry of a SSMFIELD array. */
303#define SSMFIELD_ENTRY_TERM() { (PFNSSMFIELDGETPUT)(uintptr_t)SSMFIELDTRANS_INVALID, UINT32_MAX, UINT32_MAX, NULL }
304
305
306/** @name SSMR3GetStructEx and SSMR3PutStructEx flags.
307 * @{ */
308/** The field descriptors must exactly cover the entire struct, A to Z. */
309#define SSMSTRUCT_FLAGS_FULL_STRUCT RT_BIT_32(0)
310/** No start and end markers, just the raw bits. */
311#define SSMSTRUCT_FLAGS_NO_MARKERS RT_BIT_32(1)
312/** Do not ignore any ignorable fields. */
313#define SSMSTRUCT_FLAGS_DONT_IGNORE RT_BIT_32(2)
314/** Band-aid for old SSMR3PutMem/SSMR3GetMem of structurs with host pointers. */
315#define SSMSTRUCT_FLAGS_MEM_BAND_AID (SSMSTRUCT_FLAGS_DONT_IGNORE | SSMSTRUCT_FLAGS_FULL_STRUCT | SSMSTRUCT_FLAGS_NO_MARKERS)
316/** Mask of the valid bits. */
317#define SSMSTRUCT_FLAGS_VALID_MASK UINT32_C(0x00000007)
318/** @} */
319
320
321/** The PDM Device callback variants.
322 * @{
323 */
324
325/**
326 * Prepare state live save operation.
327 *
328 * @returns VBox status code.
329 * @param pDevIns Device instance of the device which registered the data unit.
330 * @param pSSM SSM operation handle.
331 * @thread Any.
332 */
333typedef DECLCALLBACK(int) FNSSMDEVLIVEPREP(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
334/** Pointer to a FNSSMDEVLIVEPREP() function. */
335typedef FNSSMDEVLIVEPREP *PFNSSMDEVLIVEPREP;
336
337/**
338 * Execute state live save operation.
339 *
340 * This will be called repeatedly until all units vote that the live phase has
341 * been concluded.
342 *
343 * @returns VBox status code.
344 * @param pDevIns Device instance of the device which registered the data unit.
345 * @param pSSM SSM operation handle.
346 * @param uPass The pass.
347 * @thread Any.
348 */
349typedef DECLCALLBACK(int) FNSSMDEVLIVEEXEC(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass);
350/** Pointer to a FNSSMDEVLIVEEXEC() function. */
351typedef FNSSMDEVLIVEEXEC *PFNSSMDEVLIVEEXEC;
352
353/**
354 * Vote on whether the live part of the saving has been concluded.
355 *
356 * The vote stops once a unit has vetoed the decision, so don't rely upon this
357 * being called every time.
358 *
359 * @returns VBox status code.
360 * @retval VINF_SUCCESS if done.
361 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
362 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
363 * done and there is not need calling it again before the final pass.
364 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
365 *
366 * @param pDevIns Device instance of the device which registered the data unit.
367 * @param pSSM SSM operation handle.
368 * @thread Any.
369 */
370typedef DECLCALLBACK(int) FNSSMDEVLIVEVOTE(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
371/** Pointer to a FNSSMDEVLIVEVOTE() function. */
372typedef FNSSMDEVLIVEVOTE *PFNSSMDEVLIVEVOTE;
373
374/**
375 * Prepare state save operation.
376 *
377 * @returns VBox status code.
378 * @param pDevIns Device instance of the device which registered the data unit.
379 * @param pSSM SSM operation handle.
380 */
381typedef DECLCALLBACK(int) FNSSMDEVSAVEPREP(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
382/** Pointer to a FNSSMDEVSAVEPREP() function. */
383typedef FNSSMDEVSAVEPREP *PFNSSMDEVSAVEPREP;
384
385/**
386 * Execute state save operation.
387 *
388 * @returns VBox status code.
389 * @param pDevIns Device instance of the device which registered the data unit.
390 * @param pSSM SSM operation handle.
391 */
392typedef DECLCALLBACK(int) FNSSMDEVSAVEEXEC(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
393/** Pointer to a FNSSMDEVSAVEEXEC() function. */
394typedef FNSSMDEVSAVEEXEC *PFNSSMDEVSAVEEXEC;
395
396/**
397 * Done state save operation.
398 *
399 * @returns VBox status code.
400 * @param pDevIns Device instance of the device which registered the data unit.
401 * @param pSSM SSM operation handle.
402 */
403typedef DECLCALLBACK(int) FNSSMDEVSAVEDONE(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
404/** Pointer to a FNSSMDEVSAVEDONE() function. */
405typedef FNSSMDEVSAVEDONE *PFNSSMDEVSAVEDONE;
406
407/**
408 * Prepare state load operation.
409 *
410 * @returns VBox status code.
411 * @param pDevIns Device instance of the device which registered the data unit.
412 * @param pSSM SSM operation handle.
413 */
414typedef DECLCALLBACK(int) FNSSMDEVLOADPREP(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
415/** Pointer to a FNSSMDEVLOADPREP() function. */
416typedef FNSSMDEVLOADPREP *PFNSSMDEVLOADPREP;
417
418/**
419 * Execute state load operation.
420 *
421 * @returns VBox status code.
422 * @param pDevIns Device instance of the device which registered the data unit.
423 * @param pSSM SSM operation handle.
424 * @param uVersion Data layout version.
425 * @param uPass The pass. This is always SSM_PASS_FINAL for units
426 * that doesn't specify a pfnSaveLive callback.
427 */
428typedef DECLCALLBACK(int) FNSSMDEVLOADEXEC(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
429/** Pointer to a FNSSMDEVLOADEXEC() function. */
430typedef FNSSMDEVLOADEXEC *PFNSSMDEVLOADEXEC;
431
432/**
433 * Done state load operation.
434 *
435 * @returns VBox load code.
436 * @param pDevIns Device instance of the device which registered the data unit.
437 * @param pSSM SSM operation handle.
438 */
439typedef DECLCALLBACK(int) FNSSMDEVLOADDONE(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
440/** Pointer to a FNSSMDEVLOADDONE() function. */
441typedef FNSSMDEVLOADDONE *PFNSSMDEVLOADDONE;
442
443/** @} */
444
445
446/** The PDM Driver callback variants.
447 * @{
448 */
449
450/**
451 * Prepare state live save operation.
452 *
453 * @returns VBox status code.
454 * @param pDrvIns Driver instance of the device which registered the
455 * data unit.
456 * @param pSSM SSM operation handle.
457 * @thread Any.
458 */
459typedef DECLCALLBACK(int) FNSSMDRVLIVEPREP(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
460/** Pointer to a FNSSMDRVLIVEPREP() function. */
461typedef FNSSMDRVLIVEPREP *PFNSSMDRVLIVEPREP;
462
463/**
464 * Execute state live save operation.
465 *
466 * This will be called repeatedly until all units vote that the live phase has
467 * been concluded.
468 *
469 * @returns VBox status code.
470 * @param pDrvIns Driver instance of the device which registered the
471 * data unit.
472 * @param pSSM SSM operation handle.
473 * @param uPass The data pass.
474 * @thread Any.
475 */
476typedef DECLCALLBACK(int) FNSSMDRVLIVEEXEC(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uPass);
477/** Pointer to a FNSSMDRVLIVEEXEC() function. */
478typedef FNSSMDRVLIVEEXEC *PFNSSMDRVLIVEEXEC;
479
480/**
481 * Vote on whether the live part of the saving has been concluded.
482 *
483 * The vote stops once a unit has vetoed the decision, so don't rely upon this
484 * being called every time.
485 *
486 * @returns VBox status code.
487 * @retval VINF_SUCCESS if done.
488 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
489 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
490 * done and there is not need calling it again before the final pass.
491 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
492 *
493 * @param pDrvIns Driver instance of the device which registered the
494 * data unit.
495 * @param pSSM SSM operation handle.
496 * @thread Any.
497 */
498typedef DECLCALLBACK(int) FNSSMDRVLIVEVOTE(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
499/** Pointer to a FNSSMDRVLIVEVOTE() function. */
500typedef FNSSMDRVLIVEVOTE *PFNSSMDRVLIVEVOTE;
501
502
503/**
504 * Prepare state save operation.
505 *
506 * @returns VBox status code.
507 * @param pDrvIns Driver instance of the driver which registered the data unit.
508 * @param pSSM SSM operation handle.
509 */
510typedef DECLCALLBACK(int) FNSSMDRVSAVEPREP(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
511/** Pointer to a FNSSMDRVSAVEPREP() function. */
512typedef FNSSMDRVSAVEPREP *PFNSSMDRVSAVEPREP;
513
514/**
515 * Execute state save operation.
516 *
517 * @returns VBox status code.
518 * @param pDrvIns Driver instance of the driver which registered the data unit.
519 * @param pSSM SSM operation handle.
520 */
521typedef DECLCALLBACK(int) FNSSMDRVSAVEEXEC(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
522/** Pointer to a FNSSMDRVSAVEEXEC() function. */
523typedef FNSSMDRVSAVEEXEC *PFNSSMDRVSAVEEXEC;
524
525/**
526 * Done state save operation.
527 *
528 * @returns VBox status code.
529 * @param pDrvIns Driver instance of the driver which registered the data unit.
530 * @param pSSM SSM operation handle.
531 */
532typedef DECLCALLBACK(int) FNSSMDRVSAVEDONE(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
533/** Pointer to a FNSSMDRVSAVEDONE() function. */
534typedef FNSSMDRVSAVEDONE *PFNSSMDRVSAVEDONE;
535
536/**
537 * Prepare state load operation.
538 *
539 * @returns VBox status code.
540 * @param pDrvIns Driver instance of the driver which registered the data unit.
541 * @param pSSM SSM operation handle.
542 */
543typedef DECLCALLBACK(int) FNSSMDRVLOADPREP(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
544/** Pointer to a FNSSMDRVLOADPREP() function. */
545typedef FNSSMDRVLOADPREP *PFNSSMDRVLOADPREP;
546
547/**
548 * Execute state load operation.
549 *
550 * @returns VBox status code.
551 * @param pDrvIns Driver instance of the driver which registered the data unit.
552 * @param pSSM SSM operation handle.
553 * @param uVersion Data layout version.
554 * @param uPass The pass. This is always SSM_PASS_FINAL for units
555 * that doesn't specify a pfnSaveLive callback.
556 */
557typedef DECLCALLBACK(int) FNSSMDRVLOADEXEC(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
558/** Pointer to a FNSSMDRVLOADEXEC() function. */
559typedef FNSSMDRVLOADEXEC *PFNSSMDRVLOADEXEC;
560
561/**
562 * Done state load operation.
563 *
564 * @returns VBox load code.
565 * @param pDrvIns Driver instance of the driver which registered the data unit.
566 * @param pSSM SSM operation handle.
567 */
568typedef DECLCALLBACK(int) FNSSMDRVLOADDONE(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
569/** Pointer to a FNSSMDRVLOADDONE() function. */
570typedef FNSSMDRVLOADDONE *PFNSSMDRVLOADDONE;
571
572/** @} */
573
574
575/** The internal callback variants.
576 * @{
577 */
578
579
580/**
581 * Prepare state live save operation.
582 *
583 * @returns VBox status code.
584 * @param pVM VM Handle.
585 * @param pSSM SSM operation handle.
586 * @thread Any.
587 */
588typedef DECLCALLBACK(int) FNSSMINTLIVEPREP(PVM pVM, PSSMHANDLE pSSM);
589/** Pointer to a FNSSMINTLIVEPREP() function. */
590typedef FNSSMINTLIVEPREP *PFNSSMINTLIVEPREP;
591
592/**
593 * Execute state live save operation.
594 *
595 * This will be called repeatedly until all units vote that the live phase has
596 * been concluded.
597 *
598 * @returns VBox status code.
599 * @param pVM VM Handle.
600 * @param pSSM SSM operation handle.
601 * @param uPass The data pass.
602 * @thread Any.
603 */
604typedef DECLCALLBACK(int) FNSSMINTLIVEEXEC(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
605/** Pointer to a FNSSMINTLIVEEXEC() function. */
606typedef FNSSMINTLIVEEXEC *PFNSSMINTLIVEEXEC;
607
608/**
609 * Vote on whether the live part of the saving has been concluded.
610 *
611 * The vote stops once a unit has vetoed the decision, so don't rely upon this
612 * being called every time.
613 *
614 * @returns VBox status code.
615 * @retval VINF_SUCCESS if done.
616 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
617 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
618 * done and there is not need calling it again before the final pass.
619 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
620 *
621 * @param pVM VM Handle.
622 * @param pSSM SSM operation handle.
623 * @thread Any.
624 */
625typedef DECLCALLBACK(int) FNSSMINTLIVEVOTE(PVM pVM, PSSMHANDLE pSSM);
626/** Pointer to a FNSSMINTLIVEVOTE() function. */
627typedef FNSSMINTLIVEVOTE *PFNSSMINTLIVEVOTE;
628
629/**
630 * Prepare state save operation.
631 *
632 * @returns VBox status code.
633 * @param pVM VM Handle.
634 * @param pSSM SSM operation handle.
635 */
636typedef DECLCALLBACK(int) FNSSMINTSAVEPREP(PVM pVM, PSSMHANDLE pSSM);
637/** Pointer to a FNSSMINTSAVEPREP() function. */
638typedef FNSSMINTSAVEPREP *PFNSSMINTSAVEPREP;
639
640/**
641 * Execute state save operation.
642 *
643 * @returns VBox status code.
644 * @param pVM VM Handle.
645 * @param pSSM SSM operation handle.
646 */
647typedef DECLCALLBACK(int) FNSSMINTSAVEEXEC(PVM pVM, PSSMHANDLE pSSM);
648/** Pointer to a FNSSMINTSAVEEXEC() function. */
649typedef FNSSMINTSAVEEXEC *PFNSSMINTSAVEEXEC;
650
651/**
652 * Done state save operation.
653 *
654 * @returns VBox status code.
655 * @param pVM VM Handle.
656 * @param pSSM SSM operation handle.
657 */
658typedef DECLCALLBACK(int) FNSSMINTSAVEDONE(PVM pVM, PSSMHANDLE pSSM);
659/** Pointer to a FNSSMINTSAVEDONE() function. */
660typedef FNSSMINTSAVEDONE *PFNSSMINTSAVEDONE;
661
662/**
663 * Prepare state load operation.
664 *
665 * @returns VBox status code.
666 * @param pVM VM Handle.
667 * @param pSSM SSM operation handle.
668 */
669typedef DECLCALLBACK(int) FNSSMINTLOADPREP(PVM pVM, PSSMHANDLE pSSM);
670/** Pointer to a FNSSMINTLOADPREP() function. */
671typedef FNSSMINTLOADPREP *PFNSSMINTLOADPREP;
672
673/**
674 * Execute state load operation.
675 *
676 * @returns VBox status code.
677 * @param pVM VM Handle.
678 * @param pSSM SSM operation handle.
679 * @param uVersion Data layout version.
680 * @param uPass The pass. This is always SSM_PASS_FINAL for units
681 * that doesn't specify a pfnSaveLive callback.
682 */
683typedef DECLCALLBACK(int) FNSSMINTLOADEXEC(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
684/** Pointer to a FNSSMINTLOADEXEC() function. */
685typedef FNSSMINTLOADEXEC *PFNSSMINTLOADEXEC;
686
687/**
688 * Done state load operation.
689 *
690 * @returns VBox load code.
691 * @param pVM VM Handle.
692 * @param pSSM SSM operation handle.
693 */
694typedef DECLCALLBACK(int) FNSSMINTLOADDONE(PVM pVM, PSSMHANDLE pSSM);
695/** Pointer to a FNSSMINTLOADDONE() function. */
696typedef FNSSMINTLOADDONE *PFNSSMINTLOADDONE;
697
698/** @} */
699
700
701/** The External callback variants.
702 * @{
703 */
704
705/**
706 * Prepare state live save operation.
707 *
708 * @returns VBox status code.
709 * @param pSSM SSM operation handle.
710 * @param pvUser User argument.
711 * @thread Any.
712 */
713typedef DECLCALLBACK(int) FNSSMEXTLIVEPREP(PSSMHANDLE pSSM, void *pvUser);
714/** Pointer to a FNSSMEXTLIVEPREP() function. */
715typedef FNSSMEXTLIVEPREP *PFNSSMEXTLIVEPREP;
716
717/**
718 * Execute state live save operation.
719 *
720 * This will be called repeatedly until all units vote that the live phase has
721 * been concluded.
722 *
723 * @returns VBox status code.
724 * @param pSSM SSM operation handle.
725 * @param pvUser User argument.
726 * @param uPass The data pass.
727 * @thread Any.
728 */
729typedef DECLCALLBACK(int) FNSSMEXTLIVEEXEC(PSSMHANDLE pSSM, void *pvUser, uint32_t uPass);
730/** Pointer to a FNSSMEXTLIVEEXEC() function. */
731typedef FNSSMEXTLIVEEXEC *PFNSSMEXTLIVEEXEC;
732
733/**
734 * Vote on whether the live part of the saving has been concluded.
735 *
736 * The vote stops once a unit has vetoed the decision, so don't rely upon this
737 * being called every time.
738 *
739 * @returns VBox status code.
740 * @retval VINF_SUCCESS if done.
741 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
742 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
743 * done and there is not need calling it again before the final pass.
744 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
745 *
746 * @param pSSM SSM operation handle.
747 * @param pvUser User argument.
748 * @thread Any.
749 */
750typedef DECLCALLBACK(int) FNSSMEXTLIVEVOTE(PSSMHANDLE pSSM, void *pvUser);
751/** Pointer to a FNSSMEXTLIVEVOTE() function. */
752typedef FNSSMEXTLIVEVOTE *PFNSSMEXTLIVEVOTE;
753
754/**
755 * Prepare state save operation.
756 *
757 * @returns VBox status code.
758 * @param pSSM SSM operation handle.
759 * @param pvUser User argument.
760 */
761typedef DECLCALLBACK(int) FNSSMEXTSAVEPREP(PSSMHANDLE pSSM, void *pvUser);
762/** Pointer to a FNSSMEXTSAVEPREP() function. */
763typedef FNSSMEXTSAVEPREP *PFNSSMEXTSAVEPREP;
764
765/**
766 * Execute state save operation.
767 *
768 * @param pSSM SSM operation handle.
769 * @param pvUser User argument.
770 * @author The lack of return code is for legacy reasons.
771 */
772typedef DECLCALLBACK(void) FNSSMEXTSAVEEXEC(PSSMHANDLE pSSM, void *pvUser);
773/** Pointer to a FNSSMEXTSAVEEXEC() function. */
774typedef FNSSMEXTSAVEEXEC *PFNSSMEXTSAVEEXEC;
775
776/**
777 * Done state save operation.
778 *
779 * @returns VBox status code.
780 * @param pSSM SSM operation handle.
781 * @param pvUser User argument.
782 */
783typedef DECLCALLBACK(int) FNSSMEXTSAVEDONE(PSSMHANDLE pSSM, void *pvUser);
784/** Pointer to a FNSSMEXTSAVEDONE() function. */
785typedef FNSSMEXTSAVEDONE *PFNSSMEXTSAVEDONE;
786
787/**
788 * Prepare state load operation.
789 *
790 * @returns VBox status code.
791 * @param pSSM SSM operation handle.
792 * @param pvUser User argument.
793 */
794typedef DECLCALLBACK(int) FNSSMEXTLOADPREP(PSSMHANDLE pSSM, void *pvUser);
795/** Pointer to a FNSSMEXTLOADPREP() function. */
796typedef FNSSMEXTLOADPREP *PFNSSMEXTLOADPREP;
797
798/**
799 * Execute state load operation.
800 *
801 * @returns VBox status code.
802 * @param pSSM SSM operation handle.
803 * @param pvUser User argument.
804 * @param uVersion Data layout version.
805 * @param uPass The pass. This is always SSM_PASS_FINAL for units
806 * that doesn't specify a pfnSaveLive callback.
807 * @remark The odd return value is for legacy reasons.
808 */
809typedef DECLCALLBACK(int) FNSSMEXTLOADEXEC(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
810/** Pointer to a FNSSMEXTLOADEXEC() function. */
811typedef FNSSMEXTLOADEXEC *PFNSSMEXTLOADEXEC;
812
813/**
814 * Done state load operation.
815 *
816 * @returns VBox load code.
817 * @param pSSM SSM operation handle.
818 * @param pvUser User argument.
819 */
820typedef DECLCALLBACK(int) FNSSMEXTLOADDONE(PSSMHANDLE pSSM, void *pvUser);
821/** Pointer to a FNSSMEXTLOADDONE() function. */
822typedef FNSSMEXTLOADDONE *PFNSSMEXTLOADDONE;
823
824/** @} */
825
826
827/**
828 * SSM stream method table.
829 *
830 * This is used for live migration as well as internally in SSM.
831 */
832typedef struct SSMSTRMOPS
833{
834 /** Struct magic + version (SSMSTRMOPS_VERSION). */
835 uint32_t u32Version;
836
837 /**
838 * Write bytes to the stream.
839 *
840 * @returns VBox status code.
841 * @param pvUser The user argument.
842 * @param offStream The stream offset we're (supposed to be) at.
843 * @param pvBuf Pointer to the data.
844 * @param cbToWrite The number of bytes to write.
845 */
846 DECLCALLBACKMEMBER(int, pfnWrite)(void *pvUser, uint64_t offStream, const void *pvBuf, size_t cbToWrite);
847
848 /**
849 * Read bytes to the stream.
850 *
851 * @returns VBox status code.
852 * @param pvUser The user argument.
853 * @param offStream The stream offset we're (supposed to be) at.
854 * @param pvBuf Where to return the bytes.
855 * @param cbToRead The number of bytes to read.
856 * @param pcbRead Where to return the number of bytes actually
857 * read. This may differ from cbToRead when the
858 * end of the stream is encountered.
859 */
860 DECLCALLBACKMEMBER(int, pfnRead)(void *pvUser, uint64_t offStream, void *pvBuf, size_t cbToRead, size_t *pcbRead);
861
862 /**
863 * Seeks in the stream.
864 *
865 * @returns VBox status code.
866 * @retval VERR_NOT_SUPPORTED if the stream doesn't support this action.
867 *
868 * @param pvUser The user argument.
869 * @param offSeek The seek offset.
870 * @param uMethod RTFILE_SEEK_BEGIN, RTFILE_SEEK_END or
871 * RTFILE_SEEK_CURRENT.
872 * @param poffActual Where to store the new file position. Optional.
873 */
874 DECLCALLBACKMEMBER(int, pfnSeek)(void *pvUser, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
875
876 /**
877 * Get the current stream position.
878 *
879 * @returns The correct stream position.
880 * @param pvUser The user argument.
881 */
882 DECLCALLBACKMEMBER(uint64_t, pfnTell)(void *pvUser);
883
884 /**
885 * Get the size/length of the stream.
886 *
887 * @returns VBox status code.
888 * @retval VERR_NOT_SUPPORTED if the stream doesn't support this action.
889 *
890 * @param pvUser The user argument.
891 * @param pcb Where to return the size/length.
892 */
893 DECLCALLBACKMEMBER(int, pfnSize)(void *pvUser, uint64_t *pcb);
894
895 /**
896 * Close the stream.
897 *
898 * @returns VBox status code.
899 * @param pvUser The user argument.
900 */
901 DECLCALLBACKMEMBER(int, pfnClose)(void *pvUser);
902
903 /** Struct magic + version (SSMSTRMOPS_VERSION). */
904 uint32_t u32EndVersion;
905} SSMSTRMOPS;
906/** Struct magic + version (SSMSTRMOPS_VERSION). */
907#define SSMSTRMOPS_VERSION UINT32_C(0x55aa0001)
908
909
910VMMR3_INT_DECL(void) SSMR3Term(PVM pVM);
911VMMR3DECL(int) SSMR3RegisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess, const char *pszBefore,
912 PFNSSMDEVLIVEPREP pfnLivePrep, PFNSSMDEVLIVEEXEC pfnLiveExec, PFNSSMDEVLIVEVOTE pfnLiveVote,
913 PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone,
914 PFNSSMDEVLOADPREP pfnLoadPrep, PFNSSMDEVLOADEXEC pfnLoadExec, PFNSSMDEVLOADDONE pfnLoadDone);
915VMMR3DECL(int) SSMR3RegisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
916 PFNSSMDRVLIVEPREP pfnLivePrep, PFNSSMDRVLIVEEXEC pfnLiveExec, PFNSSMDRVLIVEVOTE pfnLiveVote,
917 PFNSSMDRVSAVEPREP pfnSavePrep, PFNSSMDRVSAVEEXEC pfnSaveExec, PFNSSMDRVSAVEDONE pfnSaveDone,
918 PFNSSMDRVLOADPREP pfnLoadPrep, PFNSSMDRVLOADEXEC pfnLoadExec, PFNSSMDRVLOADDONE pfnLoadDone);
919VMMR3DECL(int) SSMR3RegisterInternal(PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
920 PFNSSMINTLIVEPREP pfnLivePrep, PFNSSMINTLIVEEXEC pfnLiveExec, PFNSSMINTLIVEVOTE pfnLiveVote,
921 PFNSSMINTSAVEPREP pfnSavePrep, PFNSSMINTSAVEEXEC pfnSaveExec, PFNSSMINTSAVEDONE pfnSaveDone,
922 PFNSSMINTLOADPREP pfnLoadPrep, PFNSSMINTLOADEXEC pfnLoadExec, PFNSSMINTLOADDONE pfnLoadDone);
923VMMR3DECL(int) SSMR3RegisterExternal(PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
924 PFNSSMEXTLIVEPREP pfnLivePrep, PFNSSMEXTLIVEEXEC pfnLiveExec, PFNSSMEXTLIVEVOTE pfnLiveVote,
925 PFNSSMEXTSAVEPREP pfnSavePrep, PFNSSMEXTSAVEEXEC pfnSaveExec, PFNSSMEXTSAVEDONE pfnSaveDone,
926 PFNSSMEXTLOADPREP pfnLoadPrep, PFNSSMEXTLOADEXEC pfnLoadExec, PFNSSMEXTLOADDONE pfnLoadDone, void *pvUser);
927VMMR3_INT_DECL(int) SSMR3DeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance);
928VMMR3_INT_DECL(int) SSMR3DeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance);
929VMMR3DECL(int) SSMR3DeregisterInternal(PVM pVM, const char *pszName);
930VMMR3DECL(int) SSMR3DeregisterExternal(PVM pVM, const char *pszName);
931VMMR3DECL(int) SSMR3Save(PVM pVM, const char *pszFilename, SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvUser);
932VMMR3_INT_DECL(int) SSMR3LiveSave(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOps,
933 SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser, PSSMHANDLE *ppSSM);
934VMMR3_INT_DECL(int) SSMR3LiveDoStep1(PSSMHANDLE pSSM);
935VMMR3_INT_DECL(int) SSMR3LiveDoStep2(PSSMHANDLE pSSM);
936VMMR3_INT_DECL(int) SSMR3LiveDone(PSSMHANDLE pSSM);
937VMMR3DECL(int) SSMR3Load(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
938 SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser);
939VMMR3DECL(int) SSMR3ValidateFile(const char *pszFilename, bool fChecksumIt);
940VMMR3DECL(int) SSMR3Open(const char *pszFilename, unsigned fFlags, PSSMHANDLE *ppSSM);
941VMMR3DECL(int) SSMR3Close(PSSMHANDLE pSSM);
942VMMR3DECL(int) SSMR3Seek(PSSMHANDLE pSSM, const char *pszUnit, uint32_t iInstance, uint32_t *piVersion);
943VMMR3DECL(int) SSMR3HandleGetStatus(PSSMHANDLE pSSM);
944VMMR3DECL(int) SSMR3HandleSetStatus(PSSMHANDLE pSSM, int iStatus);
945VMMR3DECL(SSMAFTER) SSMR3HandleGetAfter(PSSMHANDLE pSSM);
946VMMR3DECL(bool) SSMR3HandleIsLiveSave(PSSMHANDLE pSSM);
947VMMR3DECL(uint32_t) SSMR3HandleHostBits(PSSMHANDLE pSSM);
948VMMR3_INT_DECL(int) SSMR3SetGCPtrSize(PSSMHANDLE pSSM, unsigned cbGCPtr);
949VMMR3DECL(int) SSMR3Cancel(PVM pVM);
950
951
952/** Save operations.
953 * @{
954 */
955VMMR3DECL(int) SSMR3PutStruct(PSSMHANDLE pSSM, const void *pvStruct, PCSSMFIELD paFields);
956VMMR3DECL(int) SSMR3PutStructEx(PSSMHANDLE pSSM, const void *pvStruct, size_t cbStruct, uint32_t fFlags, PCSSMFIELD paFields, void *pvUser);
957VMMR3DECL(int) SSMR3PutBool(PSSMHANDLE pSSM, bool fBool);
958VMMR3DECL(int) SSMR3PutU8(PSSMHANDLE pSSM, uint8_t u8);
959VMMR3DECL(int) SSMR3PutS8(PSSMHANDLE pSSM, int8_t i8);
960VMMR3DECL(int) SSMR3PutU16(PSSMHANDLE pSSM, uint16_t u16);
961VMMR3DECL(int) SSMR3PutS16(PSSMHANDLE pSSM, int16_t i16);
962VMMR3DECL(int) SSMR3PutU32(PSSMHANDLE pSSM, uint32_t u32);
963VMMR3DECL(int) SSMR3PutS32(PSSMHANDLE pSSM, int32_t i32);
964VMMR3DECL(int) SSMR3PutU64(PSSMHANDLE pSSM, uint64_t u64);
965VMMR3DECL(int) SSMR3PutS64(PSSMHANDLE pSSM, int64_t i64);
966VMMR3DECL(int) SSMR3PutU128(PSSMHANDLE pSSM, uint128_t u128);
967VMMR3DECL(int) SSMR3PutS128(PSSMHANDLE pSSM, int128_t i128);
968VMMR3DECL(int) SSMR3PutUInt(PSSMHANDLE pSSM, RTUINT u);
969VMMR3DECL(int) SSMR3PutSInt(PSSMHANDLE pSSM, RTINT i);
970VMMR3DECL(int) SSMR3PutGCUInt(PSSMHANDLE pSSM, RTGCUINT u);
971VMMR3DECL(int) SSMR3PutGCUIntReg(PSSMHANDLE pSSM, RTGCUINTREG u);
972VMMR3DECL(int) SSMR3PutGCPhys32(PSSMHANDLE pSSM, RTGCPHYS32 GCPhys);
973VMMR3DECL(int) SSMR3PutGCPhys64(PSSMHANDLE pSSM, RTGCPHYS64 GCPhys);
974VMMR3DECL(int) SSMR3PutGCPhys(PSSMHANDLE pSSM, RTGCPHYS GCPhys);
975VMMR3DECL(int) SSMR3PutGCPtr(PSSMHANDLE pSSM, RTGCPTR GCPtr);
976VMMR3DECL(int) SSMR3PutGCUIntPtr(PSSMHANDLE pSSM, RTGCUINTPTR GCPtr);
977VMMR3DECL(int) SSMR3PutRCPtr(PSSMHANDLE pSSM, RTRCPTR RCPtr);
978VMMR3DECL(int) SSMR3PutIOPort(PSSMHANDLE pSSM, RTIOPORT IOPort);
979VMMR3DECL(int) SSMR3PutSel(PSSMHANDLE pSSM, RTSEL Sel);
980VMMR3DECL(int) SSMR3PutMem(PSSMHANDLE pSSM, const void *pv, size_t cb);
981VMMR3DECL(int) SSMR3PutStrZ(PSSMHANDLE pSSM, const char *psz);
982/** @} */
983
984
985
986/** Load operations.
987 * @{
988 */
989VMMR3DECL(int) SSMR3GetStruct(PSSMHANDLE pSSM, void *pvStruct, PCSSMFIELD paFields);
990VMMR3DECL(int) SSMR3GetStructEx(PSSMHANDLE pSSM, void *pvStruct, size_t cbStruct, uint32_t fFlags, PCSSMFIELD paFields, void *pvUser);
991VMMR3DECL(int) SSMR3GetBool(PSSMHANDLE pSSM, bool *pfBool);
992VMMR3DECL(int) SSMR3GetU8(PSSMHANDLE pSSM, uint8_t *pu8);
993VMMR3DECL(int) SSMR3GetS8(PSSMHANDLE pSSM, int8_t *pi8);
994VMMR3DECL(int) SSMR3GetU16(PSSMHANDLE pSSM, uint16_t *pu16);
995VMMR3DECL(int) SSMR3GetS16(PSSMHANDLE pSSM, int16_t *pi16);
996VMMR3DECL(int) SSMR3GetU32(PSSMHANDLE pSSM, uint32_t *pu32);
997VMMR3DECL(int) SSMR3GetS32(PSSMHANDLE pSSM, int32_t *pi32);
998VMMR3DECL(int) SSMR3GetU64(PSSMHANDLE pSSM, uint64_t *pu64);
999VMMR3DECL(int) SSMR3GetS64(PSSMHANDLE pSSM, int64_t *pi64);
1000VMMR3DECL(int) SSMR3GetU128(PSSMHANDLE pSSM, uint128_t *pu128);
1001VMMR3DECL(int) SSMR3GetS128(PSSMHANDLE pSSM, int128_t *pi128);
1002VMMR3DECL(int) SSMR3GetUInt(PSSMHANDLE pSSM, PRTUINT pu);
1003VMMR3DECL(int) SSMR3GetSInt(PSSMHANDLE pSSM, PRTINT pi);
1004VMMR3DECL(int) SSMR3GetGCUInt(PSSMHANDLE pSSM, PRTGCUINT pu);
1005VMMR3DECL(int) SSMR3GetGCUIntReg(PSSMHANDLE pSSM, PRTGCUINTREG pu);
1006VMMR3DECL(int) SSMR3GetGCPhys32(PSSMHANDLE pSSM, PRTGCPHYS32 pGCPhys);
1007VMMR3DECL(int) SSMR3GetGCPhys64(PSSMHANDLE pSSM, PRTGCPHYS64 pGCPhys);
1008VMMR3DECL(int) SSMR3GetGCPhys(PSSMHANDLE pSSM, PRTGCPHYS pGCPhys);
1009VMMR3DECL(int) SSMR3GetGCPtr(PSSMHANDLE pSSM, PRTGCPTR pGCPtr);
1010VMMR3DECL(int) SSMR3GetGCUIntPtr(PSSMHANDLE pSSM, PRTGCUINTPTR pGCPtr);
1011VMMR3DECL(int) SSMR3GetRCPtr(PSSMHANDLE pSSM, PRTRCPTR pRCPtr);
1012VMMR3DECL(int) SSMR3GetIOPort(PSSMHANDLE pSSM, PRTIOPORT pIOPort);
1013VMMR3DECL(int) SSMR3GetSel(PSSMHANDLE pSSM, PRTSEL pSel);
1014VMMR3DECL(int) SSMR3GetMem(PSSMHANDLE pSSM, void *pv, size_t cb);
1015VMMR3DECL(int) SSMR3GetStrZ(PSSMHANDLE pSSM, char *psz, size_t cbMax);
1016VMMR3DECL(int) SSMR3GetStrZEx(PSSMHANDLE pSSM, char *psz, size_t cbMax, size_t *pcbStr);
1017VMMR3DECL(int) SSMR3GetTimer(PSSMHANDLE pSSM, PTMTIMER pTimer);
1018VMMR3DECL(int) SSMR3Skip(PSSMHANDLE pSSM, size_t cb);
1019VMMR3DECL(int) SSMR3SkipToEndOfUnit(PSSMHANDLE pSSM);
1020
1021/** @} */
1022
1023/** @} */
1024#endif /* IN_RING3 */
1025
1026
1027/** @} */
1028
1029RT_C_DECLS_END
1030
1031#endif
1032
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette