VirtualBox

source: vbox/trunk/include/VBox/vmm/ssm.h@ 55675

Last change on this file since 55675 was 55465, checked in by vboxsync, 10 years ago

SSM: Extended the SSMFIELD structure with a first-introduced-in-version member so we won't have to duplicate the descriptors. Currently only added one macro for specifying it called SSMFIELD_ENTRY_VER, more can be added as needed.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 54.0 KB
Line 
1/** @file
2 * SSM - The Save State Manager.
3 */
4
5/*
6 * Copyright (C) 2006-2013 Oracle Corporation
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
26#ifndef ___VBox_vmm_ssm_h
27#define ___VBox_vmm_ssm_h
28
29#include <VBox/types.h>
30#include <VBox/vmm/tm.h>
31#include <VBox/vmm/vmapi.h>
32
33
34RT_C_DECLS_BEGIN
35
36/** @defgroup grp_ssm The Saved State Manager API
37 * @{
38 */
39
40/**
41 * Determine the major version of the SSM version. If the major SSM version of two snapshots is
42 * different, the snapshots are incompatible.
43 */
44#define SSM_VERSION_MAJOR(ver) ((ver) & 0xffff0000)
45
46/**
47 * Determine the minor version of the SSM version. If the major SSM version of two snapshots is
48 * the same, the code must handle incompatibilies between minor version changes (e.g. use dummy
49 * values for non-existent fields).
50 */
51#define SSM_VERSION_MINOR(ver) ((ver) & 0x0000ffff)
52
53/**
54 * Determine if the major version changed between two SSM versions.
55 */
56#define SSM_VERSION_MAJOR_CHANGED(ver1,ver2) (SSM_VERSION_MAJOR(ver1) != SSM_VERSION_MAJOR(ver2))
57
58/** The special value for the final pass. */
59#define SSM_PASS_FINAL UINT32_MAX
60
61
62#ifdef IN_RING3
63/** @defgroup grp_ssm_r3 The SSM Host Context Ring-3 API
64 * @{
65 */
66
67
68/**
69 * What to do after the save/load operation.
70 */
71typedef enum SSMAFTER
72{
73 /** Invalid. */
74 SSMAFTER_INVALID = 0,
75 /** Will resume the loaded state. */
76 SSMAFTER_RESUME,
77 /** Will destroy the VM after saving. */
78 SSMAFTER_DESTROY,
79 /** Will continue execution after saving the VM. */
80 SSMAFTER_CONTINUE,
81 /** Will teleport the VM.
82 * The source VM will be destroyed (then one saving), the destination VM
83 * will continue execution. */
84 SSMAFTER_TELEPORT,
85 /** Will debug the saved state.
86 * This is used to drop some of the stricter consitentcy checks so it'll
87 * load fine in the debugger or animator. */
88 SSMAFTER_DEBUG_IT,
89 /** The file was opened using SSMR3Open() and we have no idea what the plan is. */
90 SSMAFTER_OPENED
91} SSMAFTER;
92
93
94/** Pointer to a structure field description. */
95typedef struct SSMFIELD *PSSMFIELD;
96/** Pointer to a const structure field description. */
97typedef const struct SSMFIELD *PCSSMFIELD;
98
99/**
100 * SSMFIELD Get/Put callback function.
101 *
102 * This is call for getting and putting the field it is associated with. It's
103 * up to the callback to work the saved state correctly.
104 *
105 * @returns VBox status code.
106 *
107 * @param pSSM The saved state handle.
108 * @param pField The field that is being processed.
109 * @param pvStruct Pointer to the structure.
110 * @param fFlags SSMSTRUCT_FLAGS_XXX.
111 * @param fGetOrPut True if getting, false if putting.
112 * @param pvUser The user argument specified to SSMR3GetStructEx or
113 * SSMR3PutStructEx.
114 */
115typedef DECLCALLBACK(int) FNSSMFIELDGETPUT(PSSMHANDLE pSSM, const struct SSMFIELD *pField, void *pvStruct,
116 uint32_t fFlags, bool fGetOrPut, void *pvUser);
117/** Pointer to a SSMFIELD Get/Put callback. */
118typedef FNSSMFIELDGETPUT *PFNSSMFIELDGETPUT;
119
120/**
121 * SSM field transformers.
122 *
123 * These are stored in the SSMFIELD::pfnGetPutOrTransformer and must therefore
124 * have values outside the valid pointer range.
125 */
126typedef enum SSMFIELDTRANS
127{
128 /** Invalid. */
129 SSMFIELDTRANS_INVALID = 0,
130 /** No transformation. */
131 SSMFIELDTRANS_NO_TRANSFORMATION,
132 /** Guest context (GC) physical address. */
133 SSMFIELDTRANS_GCPHYS,
134 /** Guest context (GC) virtual address. */
135 SSMFIELDTRANS_GCPTR,
136 /** Raw-mode context (RC) virtual address. */
137 SSMFIELDTRANS_RCPTR,
138 /** Array of raw-mode context (RC) virtual addresses. */
139 SSMFIELDTRANS_RCPTR_ARRAY,
140 /** Host context (HC) virtual address used as a NULL indicator. See
141 * SSMFIELD_ENTRY_HCPTR_NI. */
142 SSMFIELDTRANS_HCPTR_NI,
143 /** Array of SSMFIELDTRANS_HCPTR_NI. */
144 SSMFIELDTRANS_HCPTR_NI_ARRAY,
145 /** Host context (HC) virtual address used to hold a unsigned 32-bit value. */
146 SSMFIELDTRANS_HCPTR_HACK_U32,
147 /** Load a 32-bit unsigned filed from the state and zero extend it into a 64-bit
148 * structure member. */
149 SSMFIELDTRANS_U32_ZX_U64,
150
151 /** Ignorable field. See SSMFIELD_ENTRY_IGNORE. */
152 SSMFIELDTRANS_IGNORE,
153 /** Ignorable guest context (GC) physical address. */
154 SSMFIELDTRANS_IGN_GCPHYS,
155 /** Ignorable guest context (GC) virtual address. */
156 SSMFIELDTRANS_IGN_GCPTR,
157 /** Ignorable raw-mode context (RC) virtual address. */
158 SSMFIELDTRANS_IGN_RCPTR,
159 /** Ignorable host context (HC) virtual address. */
160 SSMFIELDTRANS_IGN_HCPTR,
161
162 /** Old field.
163 * Save as zeros and skip on restore (nowhere to restore it any longer). */
164 SSMFIELDTRANS_OLD,
165 /** Old guest context (GC) physical address. */
166 SSMFIELDTRANS_OLD_GCPHYS,
167 /** Old guest context (GC) virtual address. */
168 SSMFIELDTRANS_OLD_GCPTR,
169 /** Old raw-mode context (RC) virtual address. */
170 SSMFIELDTRANS_OLD_RCPTR,
171 /** Old host context (HC) virtual address. */
172 SSMFIELDTRANS_OLD_HCPTR,
173 /** Old host context specific padding.
174 * The lower word is the size of 32-bit hosts, the upper for 64-bit hosts. */
175 SSMFIELDTRANS_OLD_PAD_HC,
176 /** Old padding specific to the 32-bit Microsoft C Compiler. */
177 SSMFIELDTRANS_OLD_PAD_MSC32,
178
179 /** Padding that differs between 32-bit and 64-bit hosts.
180 * The first byte of SSMFIELD::cb contains the size for 32-bit hosts.
181 * The second byte of SSMFIELD::cb contains the size for 64-bit hosts.
182 * The upper word of SSMFIELD::cb contains the actual field size.
183 */
184 SSMFIELDTRANS_PAD_HC,
185 /** Padding for 32-bit hosts only.
186 * SSMFIELD::cb has the same format as for SSMFIELDTRANS_PAD_HC. */
187 SSMFIELDTRANS_PAD_HC32,
188 /** Padding for 64-bit hosts only.
189 * SSMFIELD::cb has the same format as for SSMFIELDTRANS_PAD_HC. */
190 SSMFIELDTRANS_PAD_HC64,
191 /** Automatic compiler padding that may differ between 32-bit and
192 * 64-bit hosts. SSMFIELD::cb has the same format as for
193 * SSMFIELDTRANS_PAD_HC. */
194 SSMFIELDTRANS_PAD_HC_AUTO,
195 /** Automatic compiler padding specific to the 32-bit Microsoft C
196 * compiler.
197 * SSMFIELD::cb has the same format as for SSMFIELDTRANS_PAD_HC. */
198 SSMFIELDTRANS_PAD_MSC32_AUTO
199} SSMFIELDTRANS;
200
201/** Tests if it's a padding field with the special SSMFIELD::cb format.
202 * @returns true / false.
203 * @param pfn The SSMFIELD::pfnGetPutOrTransformer value.
204 */
205#define SSMFIELDTRANS_IS_PADDING(pfn) \
206 ( (uintptr_t)(pfn) >= SSMFIELDTRANS_PAD_HC && (uintptr_t)(pfn) <= SSMFIELDTRANS_PAD_MSC32_AUTO )
207
208/** Tests if it's an entry for an old field.
209 *
210 * @returns true / false.
211 * @param pfn The SSMFIELD::pfnGetPutOrTransformer value.
212 */
213#define SSMFIELDTRANS_IS_OLD(pfn) \
214 ( (uintptr_t)(pfn) >= SSMFIELDTRANS_OLD && (uintptr_t)(pfn) <= SSMFIELDTRANS_OLD_PAD_MSC32 )
215
216/**
217 * A structure field description.
218 */
219typedef struct SSMFIELD
220{
221 /** Getter and putter callback or transformer index. */
222 PFNSSMFIELDGETPUT pfnGetPutOrTransformer;
223 /** Field offset into the structure. */
224 uint32_t off;
225 /** The size of the field. */
226 uint32_t cb;
227 /** This field was first saved by this unit version number. */
228 uint32_t uFirstVer;
229 /** Field name. */
230 const char *pszName;
231} SSMFIELD;
232
233/** Emit a SSMFIELD array entry.
234 * @internal */
235#define SSMFIELD_ENTRY_INT(Name, off, cb, enmTransformer, uFirstVer) \
236 { (PFNSSMFIELDGETPUT)(uintptr_t)(enmTransformer), (off), (cb), (uFirstVer), Name }
237/** Emit a SSMFIELD array entry.
238 * @internal */
239#define SSMFIELD_ENTRY_TF_INT(Type, Field, enmTransformer, uFirstVer) \
240 SSMFIELD_ENTRY_INT(#Type "::" #Field, RT_OFFSETOF(Type, Field), RT_SIZEOFMEMB(Type, Field), enmTransformer, uFirstVer)
241/** Emit a SSMFIELD array entry for an old field.
242 * @internal */
243#define SSMFIELD_ENTRY_OLD_INT(Field, cb, enmTransformer) \
244 SSMFIELD_ENTRY_INT("old::" #Field, UINT32_MAX / 2, (cb), enmTransformer, 0)
245/** Emit a SSMFIELD array entry for an alignment padding.
246 * @internal */
247#define SSMFIELD_ENTRY_PAD_INT(Type, Field, cb32, cb64, enmTransformer) \
248 SSMFIELD_ENTRY_INT(#Type "::" #Field, RT_OFFSETOF(Type, Field), \
249 (RT_SIZEOFMEMB(Type, Field) << 16) | (cb32) | ((cb64) << 8), enmTransformer, 0)
250/** Emit a SSMFIELD array entry for an alignment padding.
251 * @internal */
252#define SSMFIELD_ENTRY_PAD_OTHER_INT(Type, Field, cb32, cb64, enmTransformer) \
253 SSMFIELD_ENTRY_INT(#Type "::" #Field, UINT32_MAX / 2, 0 | (cb32) | ((cb64) << 8), enmTransformer, 0)
254
255/** Emit a SSMFIELD array entry. */
256#define SSMFIELD_ENTRY(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_NO_TRANSFORMATION, 0)
257/** Emit a SSMFIELD array entry with first version. */
258#define SSMFIELD_ENTRY_VER(Type, Field, uFirstVer) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_NO_TRANSFORMATION, uFirstVer)
259/** Emit a SSMFIELD array entry for a custom made field. This is intended
260 * for working around bitfields in old structures. */
261#define SSMFIELD_ENTRY_CUSTOM(Field, off, cb) SSMFIELD_ENTRY_INT("custom::" #Field, off, cb, \
262 SSMFIELDTRANS_NO_TRANSFORMATION, 0)
263/** Emit a SSMFIELD array entry for a RTGCPHYS type. */
264#define SSMFIELD_ENTRY_GCPHYS(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_GCPHYS, 0)
265/** Emit a SSMFIELD array entry for a RTGCPTR type. */
266#define SSMFIELD_ENTRY_GCPTR(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_GCPTR, 0)
267/** Emit a SSMFIELD array entry for a raw-mode context pointer. */
268#define SSMFIELD_ENTRY_RCPTR(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_RCPTR, 0)
269/** Emit a SSMFIELD array entry for a raw-mode context pointer. */
270#define SSMFIELD_ENTRY_RCPTR_ARRAY(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_RCPTR_ARRAY, 0)
271/** Emit a SSMFIELD array entry for a ring-0 or ring-3 pointer type that is only
272 * of interest as a NULL indicator.
273 *
274 * This is always restored as a 0 (NULL) or 1 value. When
275 * SSMSTRUCT_FLAGS_DONT_IGNORE is set, the pointer will be saved in its
276 * entirety, when clear it will be saved as a boolean. */
277#define SSMFIELD_ENTRY_HCPTR_NI(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI, 0)
278/** Same as SSMFIELD_ENTRY_HCPTR_NI, except it's an array of the buggers. */
279#define SSMFIELD_ENTRY_HCPTR_NI_ARRAY(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_HCPTR_NI_ARRAY, 0)
280/** Emit a SSMFIELD array entry for a ring-0 or ring-3 pointer type that has
281 * been hacked such that it will never exceed 32-bit. No sign extending. */
282#define SSMFIELD_ENTRY_HCPTR_HACK_U32(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_HCPTR_HACK_U32, 0)
283/** Emit a SSMFIELD array entry for loading a 32-bit field into a 64-bit
284 * structure member, zero extending the value. */
285#define SSMFIELD_ENTRY_U32_ZX_U64(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_U32_ZX_U64, 0)
286
287/** Emit a SSMFIELD array entry for a field that can be ignored.
288 * It is stored as zeros if SSMSTRUCT_FLAGS_DONT_IGNORE is specified to
289 * SSMR3PutStructEx. The member is never touched upon restore. */
290#define SSMFIELD_ENTRY_IGNORE(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGNORE, 0)
291/** Emit a SSMFIELD array entry for an ignorable RTGCPHYS type. */
292#define SSMFIELD_ENTRY_IGN_GCPHYS(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_GCPHYS, 0)
293/** Emit a SSMFIELD array entry for an ignorable RTGCPHYS type. */
294#define SSMFIELD_ENTRY_IGN_GCPTR(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_GCPTR, 0)
295/** Emit a SSMFIELD array entry for an ignorable raw-mode context pointer. */
296#define SSMFIELD_ENTRY_IGN_RCPTR(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_RCPTR, 0)
297/** Emit a SSMFIELD array entry for an ignorable ring-3 or/and ring-0 pointer. */
298#define SSMFIELD_ENTRY_IGN_HCPTR(Type, Field) SSMFIELD_ENTRY_TF_INT(Type, Field, SSMFIELDTRANS_IGN_HCPTR, 0)
299
300/** Emit a SSMFIELD array entry for an old field that should be ignored now.
301 * It is stored as zeros and skipped on load. */
302#define SSMFIELD_ENTRY_OLD(Field, cb) SSMFIELD_ENTRY_OLD_INT(Field, cb, SSMFIELDTRANS_OLD)
303/** Same as SSMFIELD_ENTRY_IGN_GCPHYS, except there is no structure field. */
304#define SSMFIELD_ENTRY_OLD_GCPHYS(Field) SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTGCPHYS), SSMFIELDTRANS_OLD_GCPHYS)
305/** Same as SSMFIELD_ENTRY_IGN_GCPTR, except there is no structure field. */
306#define SSMFIELD_ENTRY_OLD_GCPTR(Field) SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTGCPTR), SSMFIELDTRANS_OLD_GCPTR)
307/** Same as SSMFIELD_ENTRY_IGN_RCPTR, except there is no structure field. */
308#define SSMFIELD_ENTRY_OLD_RCPTR(Field) SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTRCPTR), SSMFIELDTRANS_OLD_RCPTR)
309/** Same as SSMFIELD_ENTRY_IGN_HCPTR, except there is no structure field. */
310#define SSMFIELD_ENTRY_OLD_HCPTR(Field) SSMFIELD_ENTRY_OLD_INT(Field, sizeof(RTHCPTR), SSMFIELDTRANS_OLD_HCPTR)
311/** Same as SSMFIELD_ENTRY_PAD_HC, except there is no structure field. */
312#define SSMFIELD_ENTRY_OLD_PAD_HC(Field, cb32, cb64) \
313 SSMFIELD_ENTRY_OLD_INT(Field, RT_MAKE_U32((cb32), (cb64)), SSMFIELDTRANS_OLD_PAD_HC)
314/** Same as SSMFIELD_ENTRY_PAD_HC64, except there is no structure field. */
315#define SSMFIELD_ENTRY_OLD_PAD_HC64(Field, cb) SSMFIELD_ENTRY_OLD_PAD_HC(Field, 0, cb)
316/** Same as SSMFIELD_ENTRY_PAD_HC32, except there is no structure field. */
317#define SSMFIELD_ENTRY_OLD_PAD_HC32(Field, cb) SSMFIELD_ENTRY_OLD_PAD_HC(Field, cb, 0)
318/** Same as SSMFIELD_ENTRY_PAD_HC, except there is no structure field. */
319#define SSMFIELD_ENTRY_OLD_PAD_MSC32(Field, cb) SSMFIELD_ENTRY_OLD_INT(Field, cb, SSMFIELDTRANS_OLD_PAD_MSC32)
320
321/** Emit a SSMFIELD array entry for a padding that differs in size between
322 * 64-bit and 32-bit hosts. */
323#define SSMFIELD_ENTRY_PAD_HC(Type, Field, cb32, cb64) SSMFIELD_ENTRY_PAD_INT( Type, Field, cb32, cb64, SSMFIELDTRANS_PAD_HC)
324/** Emit a SSMFIELD array entry for a padding that is exclusive to 64-bit hosts. */
325#if HC_ARCH_BITS == 64
326# define SSMFIELD_ENTRY_PAD_HC64(Type, Field, cb) SSMFIELD_ENTRY_PAD_INT( Type, Field, 0, cb, SSMFIELDTRANS_PAD_HC64)
327#else
328# define SSMFIELD_ENTRY_PAD_HC64(Type, Field, cb) SSMFIELD_ENTRY_PAD_OTHER_INT(Type, Field, 0, cb, SSMFIELDTRANS_PAD_HC64)
329#endif
330/** Emit a SSMFIELD array entry for a 32-bit padding for on 64-bits hosts. */
331#if HC_ARCH_BITS == 32
332# define SSMFIELD_ENTRY_PAD_HC32(Type, Field, cb) SSMFIELD_ENTRY_PAD_INT( Type, Field, cb, 0, SSMFIELDTRANS_PAD_HC32)
333#else
334# define SSMFIELD_ENTRY_PAD_HC32(Type, Field, cb) SSMFIELD_ENTRY_PAD_OTHER_INT(Type, Field, cb, 0, SSMFIELDTRANS_PAD_HC32)
335#endif
336/** Emit a SSMFIELD array entry for an automatic compiler padding that may
337 * differ in size between 64-bit and 32-bit hosts. */
338#if HC_ARCH_BITS == 64
339# define SSMFIELD_ENTRY_PAD_HC_AUTO(cb32, cb64) \
340 { \
341 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_HC_AUTO), \
342 UINT32_MAX / 2, (cb64 << 16) | (cb32) | ((cb64) << 8), 0, "<compiler-padding>" \
343 }
344#else
345# define SSMFIELD_ENTRY_PAD_HC_AUTO(cb32, cb64) \
346 { \
347 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_HC_AUTO), \
348 UINT32_MAX / 2, (cb32 << 16) | (cb32) | ((cb64) << 8), 0, "<compiler-padding>" \
349 }
350#endif
351/** Emit a SSMFIELD array entry for an automatic compiler padding that is unique
352 * to the 32-bit microsoft compiler. This is usually used together with
353 * SSMFIELD_ENTRY_PAD_HC*. */
354#if HC_ARCH_BITS == 32 && defined(_MSC_VER)
355# define SSMFIELD_ENTRY_PAD_MSC32_AUTO(cb) \
356 { \
357 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_MSC32_AUTO), \
358 UINT32_MAX / 2, ((cb) << 16) | (cb), 0, "<msc32-padding>" \
359 }
360#else
361# define SSMFIELD_ENTRY_PAD_MSC32_AUTO(cb) \
362 { \
363 (PFNSSMFIELDGETPUT)(uintptr_t)(SSMFIELDTRANS_PAD_MSC32_AUTO), \
364 UINT32_MAX / 2, (cb), 0, "<msc32-padding>" \
365 }
366#endif
367
368/** Emit a SSMFIELD array entry for a field with a custom callback. */
369#define SSMFIELD_ENTRY_CALLBACK(Type, Field, pfnGetPut) \
370 { (pfnGetPut), RT_OFFSETOF(Type, Field), RT_SIZEOFMEMB(Type, Field), 0, #Type "::" #Field }
371/** Emit the terminating entry of a SSMFIELD array. */
372#define SSMFIELD_ENTRY_TERM() \
373 { (PFNSSMFIELDGETPUT)(uintptr_t)SSMFIELDTRANS_INVALID, UINT32_MAX, UINT32_MAX, UINT32_MAX, NULL }
374
375
376/** @name SSMR3GetStructEx and SSMR3PutStructEx flags.
377 * @{ */
378/** The field descriptors must exactly cover the entire struct, A to Z. */
379#define SSMSTRUCT_FLAGS_FULL_STRUCT RT_BIT_32(0)
380/** No start and end markers, just the raw bits. */
381#define SSMSTRUCT_FLAGS_NO_MARKERS RT_BIT_32(1)
382/** Do not ignore any ignorable fields. */
383#define SSMSTRUCT_FLAGS_DONT_IGNORE RT_BIT_32(2)
384/** Saved using SSMR3PutMem, don't be too strict. */
385#define SSMSTRUCT_FLAGS_SAVED_AS_MEM RT_BIT_32(3)
386/** No introductory structure marker. Use when splitting up structures. */
387#define SSMSTRUCT_FLAGS_NO_LEAD_MARKER RT_BIT_32(4)
388/** No trailing structure marker. Use when splitting up structures. */
389#define SSMSTRUCT_FLAGS_NO_TAIL_MARKER RT_BIT_32(5)
390
391/** Band-aid for old SSMR3PutMem/SSMR3GetMem of structurs with host pointers.
392 * @remarks This type is normally only used up to the first changes to the
393 * structures take place in order to make sure the conversion from
394 * SSMR3PutMem to field descriptors went smoothly. Replace with
395 * SSMSTRUCT_FLAGS_MEM_BAND_AID_RELAXED when changing the structure. */
396#define SSMSTRUCT_FLAGS_MEM_BAND_AID ( SSMSTRUCT_FLAGS_DONT_IGNORE | SSMSTRUCT_FLAGS_FULL_STRUCT \
397 | SSMSTRUCT_FLAGS_NO_MARKERS | SSMSTRUCT_FLAGS_SAVED_AS_MEM)
398/** Band-aid for old SSMR3PutMem/SSMR3GetMem of structurs with host
399 * pointers, with relaxed checks. */
400#define SSMSTRUCT_FLAGS_MEM_BAND_AID_RELAXED ( SSMSTRUCT_FLAGS_DONT_IGNORE \
401 | SSMSTRUCT_FLAGS_NO_MARKERS | SSMSTRUCT_FLAGS_SAVED_AS_MEM)
402/** Mask of the valid bits. */
403#define SSMSTRUCT_FLAGS_VALID_MASK UINT32_C(0x0000003f)
404/** @} */
405
406
407/** The PDM Device callback variants.
408 * @{
409 */
410
411/**
412 * Prepare state live save operation.
413 *
414 * @returns VBox status code.
415 * @param pDevIns Device instance of the device which registered the data unit.
416 * @param pSSM SSM operation handle.
417 * @remarks The caller enters the device critical section prior to the call.
418 * @thread Any.
419 */
420typedef DECLCALLBACK(int) FNSSMDEVLIVEPREP(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
421/** Pointer to a FNSSMDEVLIVEPREP() function. */
422typedef FNSSMDEVLIVEPREP *PFNSSMDEVLIVEPREP;
423
424/**
425 * Execute state live save operation.
426 *
427 * This will be called repeatedly until all units vote that the live phase has
428 * been concluded.
429 *
430 * @returns VBox status code.
431 * @param pDevIns Device instance of the device which registered the data unit.
432 * @param pSSM SSM operation handle.
433 * @param uPass The pass.
434 * @remarks The caller enters the device critical section prior to the call.
435 * @thread Any.
436 */
437typedef DECLCALLBACK(int) FNSSMDEVLIVEEXEC(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass);
438/** Pointer to a FNSSMDEVLIVEEXEC() function. */
439typedef FNSSMDEVLIVEEXEC *PFNSSMDEVLIVEEXEC;
440
441/**
442 * Vote on whether the live part of the saving has been concluded.
443 *
444 * The vote stops once a unit has vetoed the decision, so don't rely upon this
445 * being called every time.
446 *
447 * @returns VBox status code.
448 * @retval VINF_SUCCESS if done.
449 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
450 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
451 * done and there is not need calling it again before the final pass.
452 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
453 *
454 * @param pDevIns Device instance of the device which registered the data unit.
455 * @param pSSM SSM operation handle.
456 * @param uPass The data pass.
457 * @remarks The caller enters the device critical section prior to the call.
458 * @thread Any.
459 */
460typedef DECLCALLBACK(int) FNSSMDEVLIVEVOTE(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uPass);
461/** Pointer to a FNSSMDEVLIVEVOTE() function. */
462typedef FNSSMDEVLIVEVOTE *PFNSSMDEVLIVEVOTE;
463
464/**
465 * Prepare state save operation.
466 *
467 * @returns VBox status code.
468 * @param pDevIns Device instance of the device which registered the data unit.
469 * @param pSSM SSM operation handle.
470 * @remarks The caller enters the device critical section prior to the call.
471 */
472typedef DECLCALLBACK(int) FNSSMDEVSAVEPREP(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
473/** Pointer to a FNSSMDEVSAVEPREP() function. */
474typedef FNSSMDEVSAVEPREP *PFNSSMDEVSAVEPREP;
475
476/**
477 * Execute state save operation.
478 *
479 * @returns VBox status code.
480 * @param pDevIns Device instance of the device which registered the data unit.
481 * @param pSSM SSM operation handle.
482 * @remarks The caller enters the device critical section prior to the call.
483 */
484typedef DECLCALLBACK(int) FNSSMDEVSAVEEXEC(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
485/** Pointer to a FNSSMDEVSAVEEXEC() function. */
486typedef FNSSMDEVSAVEEXEC *PFNSSMDEVSAVEEXEC;
487
488/**
489 * Done state save operation.
490 *
491 * @returns VBox status code.
492 * @param pDevIns Device instance of the device which registered the data unit.
493 * @param pSSM SSM operation handle.
494 * @remarks The caller enters the device critical section prior to the call.
495 */
496typedef DECLCALLBACK(int) FNSSMDEVSAVEDONE(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
497/** Pointer to a FNSSMDEVSAVEDONE() function. */
498typedef FNSSMDEVSAVEDONE *PFNSSMDEVSAVEDONE;
499
500/**
501 * Prepare state load operation.
502 *
503 * @returns VBox status code.
504 * @param pDevIns Device instance of the device which registered the data unit.
505 * @param pSSM SSM operation handle.
506 * @remarks The caller enters the device critical section prior to the call.
507 */
508typedef DECLCALLBACK(int) FNSSMDEVLOADPREP(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
509/** Pointer to a FNSSMDEVLOADPREP() function. */
510typedef FNSSMDEVLOADPREP *PFNSSMDEVLOADPREP;
511
512/**
513 * Execute state load operation.
514 *
515 * @returns VBox status code.
516 * @param pDevIns Device instance of the device which registered the data unit.
517 * @param pSSM SSM operation handle.
518 * @param uVersion Data layout version.
519 * @param uPass The pass. This is always SSM_PASS_FINAL for units
520 * that doesn't specify a pfnSaveLive callback.
521 * @remarks The caller enters the device critical section prior to the call.
522 */
523typedef DECLCALLBACK(int) FNSSMDEVLOADEXEC(PPDMDEVINS pDevIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
524/** Pointer to a FNSSMDEVLOADEXEC() function. */
525typedef FNSSMDEVLOADEXEC *PFNSSMDEVLOADEXEC;
526
527/**
528 * Done state load operation.
529 *
530 * @returns VBox load code.
531 * @param pDevIns Device instance of the device which registered the data unit.
532 * @param pSSM SSM operation handle.
533 * @remarks The caller enters the device critical section prior to the call.
534 */
535typedef DECLCALLBACK(int) FNSSMDEVLOADDONE(PPDMDEVINS pDevIns, PSSMHANDLE pSSM);
536/** Pointer to a FNSSMDEVLOADDONE() function. */
537typedef FNSSMDEVLOADDONE *PFNSSMDEVLOADDONE;
538
539/** @} */
540
541
542/** The PDM USB device callback variants.
543 * @{
544 */
545
546/**
547 * Prepare state live save operation.
548 *
549 * @returns VBox status code.
550 * @param pUsbIns The USB device instance of the USB device which
551 * registered the data unit.
552 * @param pSSM SSM operation handle.
553 * @thread Any.
554 */
555typedef DECLCALLBACK(int) FNSSMUSBLIVEPREP(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM);
556/** Pointer to a FNSSMUSBLIVEPREP() function. */
557typedef FNSSMUSBLIVEPREP *PFNSSMUSBLIVEPREP;
558
559/**
560 * Execute state live save operation.
561 *
562 * This will be called repeatedly until all units vote that the live phase has
563 * been concluded.
564 *
565 * @returns VBox status code.
566 * @param pUsbIns The USB device instance of the USB device which
567 * registered the data unit.
568 * @param pSSM SSM operation handle.
569 * @param uPass The pass.
570 * @thread Any.
571 */
572typedef DECLCALLBACK(int) FNSSMUSBLIVEEXEC(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM, uint32_t uPass);
573/** Pointer to a FNSSMUSBLIVEEXEC() function. */
574typedef FNSSMUSBLIVEEXEC *PFNSSMUSBLIVEEXEC;
575
576/**
577 * Vote on whether the live part of the saving has been concluded.
578 *
579 * The vote stops once a unit has vetoed the decision, so don't rely upon this
580 * being called every time.
581 *
582 * @returns VBox status code.
583 * @retval VINF_SUCCESS if done.
584 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
585 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
586 * done and there is not need calling it again before the final pass.
587 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
588 *
589 * @param pUsbIns The USB device instance of the USB device which
590 * registered the data unit.
591 * @param pSSM SSM operation handle.
592 * @param uPass The data pass.
593 * @thread Any.
594 */
595typedef DECLCALLBACK(int) FNSSMUSBLIVEVOTE(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM, uint32_t uPass);
596/** Pointer to a FNSSMUSBLIVEVOTE() function. */
597typedef FNSSMUSBLIVEVOTE *PFNSSMUSBLIVEVOTE;
598
599/**
600 * Prepare state save operation.
601 *
602 * @returns VBox status code.
603 * @param pUsbIns The USB device instance of the USB device which
604 * registered the data unit.
605 * @param pSSM SSM operation handle.
606 */
607typedef DECLCALLBACK(int) FNSSMUSBSAVEPREP(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM);
608/** Pointer to a FNSSMUSBSAVEPREP() function. */
609typedef FNSSMUSBSAVEPREP *PFNSSMUSBSAVEPREP;
610
611/**
612 * Execute state save operation.
613 *
614 * @returns VBox status code.
615 * @param pUsbIns The USB device instance of the USB device which
616 * registered the data unit.
617 * @param pSSM SSM operation handle.
618 */
619typedef DECLCALLBACK(int) FNSSMUSBSAVEEXEC(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM);
620/** Pointer to a FNSSMUSBSAVEEXEC() function. */
621typedef FNSSMUSBSAVEEXEC *PFNSSMUSBSAVEEXEC;
622
623/**
624 * Done state save operation.
625 *
626 * @returns VBox status code.
627 * @param pUsbIns The USB device instance of the USB device which
628 * registered the data unit.
629 * @param pSSM SSM operation handle.
630 */
631typedef DECLCALLBACK(int) FNSSMUSBSAVEDONE(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM);
632/** Pointer to a FNSSMUSBSAVEDONE() function. */
633typedef FNSSMUSBSAVEDONE *PFNSSMUSBSAVEDONE;
634
635/**
636 * Prepare state load operation.
637 *
638 * @returns VBox status code.
639 * @param pUsbIns The USB device instance of the USB device which
640 * registered the data unit.
641 * @param pSSM SSM operation handle.
642 */
643typedef DECLCALLBACK(int) FNSSMUSBLOADPREP(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM);
644/** Pointer to a FNSSMUSBLOADPREP() function. */
645typedef FNSSMUSBLOADPREP *PFNSSMUSBLOADPREP;
646
647/**
648 * Execute state load operation.
649 *
650 * @returns VBox status code.
651 * @param pUsbIns The USB device instance of the USB device which
652 * registered the data unit.
653 * @param pSSM SSM operation handle.
654 * @param uVersion Data layout version.
655 * @param uPass The pass. This is always SSM_PASS_FINAL for units
656 * that doesn't specify a pfnSaveLive callback.
657 */
658typedef DECLCALLBACK(int) FNSSMUSBLOADEXEC(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
659/** Pointer to a FNSSMUSBLOADEXEC() function. */
660typedef FNSSMUSBLOADEXEC *PFNSSMUSBLOADEXEC;
661
662/**
663 * Done state load operation.
664 *
665 * @returns VBox load code.
666 * @param pUsbIns The USB device instance of the USB device which
667 * registered the data unit.
668 * @param pSSM SSM operation handle.
669 */
670typedef DECLCALLBACK(int) FNSSMUSBLOADDONE(PPDMUSBINS pUsbIns, PSSMHANDLE pSSM);
671/** Pointer to a FNSSMUSBLOADDONE() function. */
672typedef FNSSMUSBLOADDONE *PFNSSMUSBLOADDONE;
673
674/** @} */
675
676
677/** The PDM Driver callback variants.
678 * @{
679 */
680
681/**
682 * Prepare state live save operation.
683 *
684 * @returns VBox status code.
685 * @param pDrvIns Driver instance of the driver which registered the
686 * data unit.
687 * @param pSSM SSM operation handle.
688 * @thread Any.
689 */
690typedef DECLCALLBACK(int) FNSSMDRVLIVEPREP(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
691/** Pointer to a FNSSMDRVLIVEPREP() function. */
692typedef FNSSMDRVLIVEPREP *PFNSSMDRVLIVEPREP;
693
694/**
695 * Execute state live save operation.
696 *
697 * This will be called repeatedly until all units vote that the live phase has
698 * been concluded.
699 *
700 * @returns VBox status code.
701 * @param pDrvIns Driver instance of the driver which registered the
702 * data unit.
703 * @param pSSM SSM operation handle.
704 * @param uPass The data pass.
705 * @thread Any.
706 */
707typedef DECLCALLBACK(int) FNSSMDRVLIVEEXEC(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uPass);
708/** Pointer to a FNSSMDRVLIVEEXEC() function. */
709typedef FNSSMDRVLIVEEXEC *PFNSSMDRVLIVEEXEC;
710
711/**
712 * Vote on whether the live part of the saving has been concluded.
713 *
714 * The vote stops once a unit has vetoed the decision, so don't rely upon this
715 * being called every time.
716 *
717 * @returns VBox status code.
718 * @retval VINF_SUCCESS if done.
719 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
720 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
721 * done and there is not need calling it again before the final pass.
722 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
723 *
724 * @param pDrvIns Driver instance of the driver which registered the
725 * data unit.
726 * @param pSSM SSM operation handle.
727 * @param uPass The data pass.
728 * @thread Any.
729 */
730typedef DECLCALLBACK(int) FNSSMDRVLIVEVOTE(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uPass);
731/** Pointer to a FNSSMDRVLIVEVOTE() function. */
732typedef FNSSMDRVLIVEVOTE *PFNSSMDRVLIVEVOTE;
733
734
735/**
736 * Prepare state save operation.
737 *
738 * @returns VBox status code.
739 * @param pDrvIns Driver instance of the driver which registered the data unit.
740 * @param pSSM SSM operation handle.
741 */
742typedef DECLCALLBACK(int) FNSSMDRVSAVEPREP(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
743/** Pointer to a FNSSMDRVSAVEPREP() function. */
744typedef FNSSMDRVSAVEPREP *PFNSSMDRVSAVEPREP;
745
746/**
747 * Execute state save operation.
748 *
749 * @returns VBox status code.
750 * @param pDrvIns Driver instance of the driver which registered the data unit.
751 * @param pSSM SSM operation handle.
752 */
753typedef DECLCALLBACK(int) FNSSMDRVSAVEEXEC(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
754/** Pointer to a FNSSMDRVSAVEEXEC() function. */
755typedef FNSSMDRVSAVEEXEC *PFNSSMDRVSAVEEXEC;
756
757/**
758 * Done state save operation.
759 *
760 * @returns VBox status code.
761 * @param pDrvIns Driver instance of the driver which registered the data unit.
762 * @param pSSM SSM operation handle.
763 */
764typedef DECLCALLBACK(int) FNSSMDRVSAVEDONE(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
765/** Pointer to a FNSSMDRVSAVEDONE() function. */
766typedef FNSSMDRVSAVEDONE *PFNSSMDRVSAVEDONE;
767
768/**
769 * Prepare state load operation.
770 *
771 * @returns VBox status code.
772 * @param pDrvIns Driver instance of the driver which registered the data unit.
773 * @param pSSM SSM operation handle.
774 */
775typedef DECLCALLBACK(int) FNSSMDRVLOADPREP(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
776/** Pointer to a FNSSMDRVLOADPREP() function. */
777typedef FNSSMDRVLOADPREP *PFNSSMDRVLOADPREP;
778
779/**
780 * Execute state load operation.
781 *
782 * @returns VBox status code.
783 * @param pDrvIns Driver instance of the driver which registered the data unit.
784 * @param pSSM SSM operation handle.
785 * @param uVersion Data layout version.
786 * @param uPass The pass. This is always SSM_PASS_FINAL for units
787 * that doesn't specify a pfnSaveLive callback.
788 */
789typedef DECLCALLBACK(int) FNSSMDRVLOADEXEC(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
790/** Pointer to a FNSSMDRVLOADEXEC() function. */
791typedef FNSSMDRVLOADEXEC *PFNSSMDRVLOADEXEC;
792
793/**
794 * Done state load operation.
795 *
796 * @returns VBox load code.
797 * @param pDrvIns Driver instance of the driver which registered the data unit.
798 * @param pSSM SSM operation handle.
799 */
800typedef DECLCALLBACK(int) FNSSMDRVLOADDONE(PPDMDRVINS pDrvIns, PSSMHANDLE pSSM);
801/** Pointer to a FNSSMDRVLOADDONE() function. */
802typedef FNSSMDRVLOADDONE *PFNSSMDRVLOADDONE;
803
804/** @} */
805
806
807/** The internal callback variants.
808 * @{
809 */
810
811
812/**
813 * Prepare state live save operation.
814 *
815 * @returns VBox status code.
816 * @param pVM VM Handle.
817 * @param pSSM SSM operation handle.
818 * @thread Any.
819 */
820typedef DECLCALLBACK(int) FNSSMINTLIVEPREP(PVM pVM, PSSMHANDLE pSSM);
821/** Pointer to a FNSSMINTLIVEPREP() function. */
822typedef FNSSMINTLIVEPREP *PFNSSMINTLIVEPREP;
823
824/**
825 * Execute state live save operation.
826 *
827 * This will be called repeatedly until all units vote that the live phase has
828 * been concluded.
829 *
830 * @returns VBox status code.
831 * @param pVM VM Handle.
832 * @param pSSM SSM operation handle.
833 * @param uPass The data pass.
834 * @thread Any.
835 */
836typedef DECLCALLBACK(int) FNSSMINTLIVEEXEC(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
837/** Pointer to a FNSSMINTLIVEEXEC() function. */
838typedef FNSSMINTLIVEEXEC *PFNSSMINTLIVEEXEC;
839
840/**
841 * Vote on whether the live part of the saving has been concluded.
842 *
843 * The vote stops once a unit has vetoed the decision, so don't rely upon this
844 * being called every time.
845 *
846 * @returns VBox status code.
847 * @retval VINF_SUCCESS if done.
848 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
849 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
850 * done and there is not need calling it again before the final pass.
851 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
852 *
853 * @param pVM VM Handle.
854 * @param pSSM SSM operation handle.
855 * @param uPass The data pass.
856 * @thread Any.
857 */
858typedef DECLCALLBACK(int) FNSSMINTLIVEVOTE(PVM pVM, PSSMHANDLE pSSM, uint32_t uPass);
859/** Pointer to a FNSSMINTLIVEVOTE() function. */
860typedef FNSSMINTLIVEVOTE *PFNSSMINTLIVEVOTE;
861
862/**
863 * Prepare state save operation.
864 *
865 * @returns VBox status code.
866 * @param pVM VM Handle.
867 * @param pSSM SSM operation handle.
868 */
869typedef DECLCALLBACK(int) FNSSMINTSAVEPREP(PVM pVM, PSSMHANDLE pSSM);
870/** Pointer to a FNSSMINTSAVEPREP() function. */
871typedef FNSSMINTSAVEPREP *PFNSSMINTSAVEPREP;
872
873/**
874 * Execute state save operation.
875 *
876 * @returns VBox status code.
877 * @param pVM VM Handle.
878 * @param pSSM SSM operation handle.
879 */
880typedef DECLCALLBACK(int) FNSSMINTSAVEEXEC(PVM pVM, PSSMHANDLE pSSM);
881/** Pointer to a FNSSMINTSAVEEXEC() function. */
882typedef FNSSMINTSAVEEXEC *PFNSSMINTSAVEEXEC;
883
884/**
885 * Done state save operation.
886 *
887 * @returns VBox status code.
888 * @param pVM VM Handle.
889 * @param pSSM SSM operation handle.
890 */
891typedef DECLCALLBACK(int) FNSSMINTSAVEDONE(PVM pVM, PSSMHANDLE pSSM);
892/** Pointer to a FNSSMINTSAVEDONE() function. */
893typedef FNSSMINTSAVEDONE *PFNSSMINTSAVEDONE;
894
895/**
896 * Prepare state load operation.
897 *
898 * @returns VBox status code.
899 * @param pVM VM Handle.
900 * @param pSSM SSM operation handle.
901 */
902typedef DECLCALLBACK(int) FNSSMINTLOADPREP(PVM pVM, PSSMHANDLE pSSM);
903/** Pointer to a FNSSMINTLOADPREP() function. */
904typedef FNSSMINTLOADPREP *PFNSSMINTLOADPREP;
905
906/**
907 * Execute state load operation.
908 *
909 * @returns VBox status code.
910 * @param pVM VM Handle.
911 * @param pSSM SSM operation handle.
912 * @param uVersion Data layout version.
913 * @param uPass The pass. This is always SSM_PASS_FINAL for units
914 * that doesn't specify a pfnSaveLive callback.
915 */
916typedef DECLCALLBACK(int) FNSSMINTLOADEXEC(PVM pVM, PSSMHANDLE pSSM, uint32_t uVersion, uint32_t uPass);
917/** Pointer to a FNSSMINTLOADEXEC() function. */
918typedef FNSSMINTLOADEXEC *PFNSSMINTLOADEXEC;
919
920/**
921 * Done state load operation.
922 *
923 * @returns VBox load code.
924 * @param pVM VM Handle.
925 * @param pSSM SSM operation handle.
926 */
927typedef DECLCALLBACK(int) FNSSMINTLOADDONE(PVM pVM, PSSMHANDLE pSSM);
928/** Pointer to a FNSSMINTLOADDONE() function. */
929typedef FNSSMINTLOADDONE *PFNSSMINTLOADDONE;
930
931/** @} */
932
933
934/** The External callback variants.
935 * @{
936 */
937
938/**
939 * Prepare state live save operation.
940 *
941 * @returns VBox status code.
942 * @param pSSM SSM operation handle.
943 * @param pvUser User argument.
944 * @thread Any.
945 */
946typedef DECLCALLBACK(int) FNSSMEXTLIVEPREP(PSSMHANDLE pSSM, void *pvUser);
947/** Pointer to a FNSSMEXTLIVEPREP() function. */
948typedef FNSSMEXTLIVEPREP *PFNSSMEXTLIVEPREP;
949
950/**
951 * Execute state live save operation.
952 *
953 * This will be called repeatedly until all units vote that the live phase has
954 * been concluded.
955 *
956 * @returns VBox status code.
957 * @param pSSM SSM operation handle.
958 * @param pvUser User argument.
959 * @param uPass The data pass.
960 * @thread Any.
961 */
962typedef DECLCALLBACK(int) FNSSMEXTLIVEEXEC(PSSMHANDLE pSSM, void *pvUser, uint32_t uPass);
963/** Pointer to a FNSSMEXTLIVEEXEC() function. */
964typedef FNSSMEXTLIVEEXEC *PFNSSMEXTLIVEEXEC;
965
966/**
967 * Vote on whether the live part of the saving has been concluded.
968 *
969 * The vote stops once a unit has vetoed the decision, so don't rely upon this
970 * being called every time.
971 *
972 * @returns VBox status code.
973 * @retval VINF_SUCCESS if done.
974 * @retval VINF_SSM_VOTE_FOR_ANOTHER_PASS if another pass is needed.
975 * @retval VINF_SSM_VOTE_DONE_DONT_CALL_AGAIN if the live saving of the unit is
976 * done and there is not need calling it again before the final pass.
977 * @retval VERR_SSM_VOTE_FOR_GIVING_UP if its time to give up.
978 *
979 * @param pSSM SSM operation handle.
980 * @param pvUser User argument.
981 * @param uPass The data pass.
982 * @thread Any.
983 */
984typedef DECLCALLBACK(int) FNSSMEXTLIVEVOTE(PSSMHANDLE pSSM, void *pvUser, uint32_t uPass);
985/** Pointer to a FNSSMEXTLIVEVOTE() function. */
986typedef FNSSMEXTLIVEVOTE *PFNSSMEXTLIVEVOTE;
987
988/**
989 * Prepare state save operation.
990 *
991 * @returns VBox status code.
992 * @param pSSM SSM operation handle.
993 * @param pvUser User argument.
994 */
995typedef DECLCALLBACK(int) FNSSMEXTSAVEPREP(PSSMHANDLE pSSM, void *pvUser);
996/** Pointer to a FNSSMEXTSAVEPREP() function. */
997typedef FNSSMEXTSAVEPREP *PFNSSMEXTSAVEPREP;
998
999/**
1000 * Execute state save operation.
1001 *
1002 * @param pSSM SSM operation handle.
1003 * @param pvUser User argument.
1004 * @author The lack of return code is for legacy reasons.
1005 */
1006typedef DECLCALLBACK(void) FNSSMEXTSAVEEXEC(PSSMHANDLE pSSM, void *pvUser);
1007/** Pointer to a FNSSMEXTSAVEEXEC() function. */
1008typedef FNSSMEXTSAVEEXEC *PFNSSMEXTSAVEEXEC;
1009
1010/**
1011 * Done state save operation.
1012 *
1013 * @returns VBox status code.
1014 * @param pSSM SSM operation handle.
1015 * @param pvUser User argument.
1016 */
1017typedef DECLCALLBACK(int) FNSSMEXTSAVEDONE(PSSMHANDLE pSSM, void *pvUser);
1018/** Pointer to a FNSSMEXTSAVEDONE() function. */
1019typedef FNSSMEXTSAVEDONE *PFNSSMEXTSAVEDONE;
1020
1021/**
1022 * Prepare state load operation.
1023 *
1024 * @returns VBox status code.
1025 * @param pSSM SSM operation handle.
1026 * @param pvUser User argument.
1027 */
1028typedef DECLCALLBACK(int) FNSSMEXTLOADPREP(PSSMHANDLE pSSM, void *pvUser);
1029/** Pointer to a FNSSMEXTLOADPREP() function. */
1030typedef FNSSMEXTLOADPREP *PFNSSMEXTLOADPREP;
1031
1032/**
1033 * Execute state load operation.
1034 *
1035 * @returns VBox status code.
1036 * @param pSSM SSM operation handle.
1037 * @param pvUser User argument.
1038 * @param uVersion Data layout version.
1039 * @param uPass The pass. This is always SSM_PASS_FINAL for units
1040 * that doesn't specify a pfnSaveLive callback.
1041 * @remark The odd return value is for legacy reasons.
1042 */
1043typedef DECLCALLBACK(int) FNSSMEXTLOADEXEC(PSSMHANDLE pSSM, void *pvUser, uint32_t uVersion, uint32_t uPass);
1044/** Pointer to a FNSSMEXTLOADEXEC() function. */
1045typedef FNSSMEXTLOADEXEC *PFNSSMEXTLOADEXEC;
1046
1047/**
1048 * Done state load operation.
1049 *
1050 * @returns VBox load code.
1051 * @param pSSM SSM operation handle.
1052 * @param pvUser User argument.
1053 */
1054typedef DECLCALLBACK(int) FNSSMEXTLOADDONE(PSSMHANDLE pSSM, void *pvUser);
1055/** Pointer to a FNSSMEXTLOADDONE() function. */
1056typedef FNSSMEXTLOADDONE *PFNSSMEXTLOADDONE;
1057
1058/** @} */
1059
1060
1061/**
1062 * SSM stream method table.
1063 *
1064 * This is used by external parties for teleporting over TCP or any other media.
1065 * SSM also uses this internally for file access, thus the 2-3 file centric
1066 * methods.
1067 */
1068typedef struct SSMSTRMOPS
1069{
1070 /** Struct magic + version (SSMSTRMOPS_VERSION). */
1071 uint32_t u32Version;
1072
1073 /**
1074 * Write bytes to the stream.
1075 *
1076 * @returns VBox status code.
1077 * @param pvUser The user argument.
1078 * @param offStream The stream offset we're (supposed to be) at.
1079 * @param pvBuf Pointer to the data.
1080 * @param cbToWrite The number of bytes to write.
1081 */
1082 DECLCALLBACKMEMBER(int, pfnWrite)(void *pvUser, uint64_t offStream, const void *pvBuf, size_t cbToWrite);
1083
1084 /**
1085 * Read bytes to the stream.
1086 *
1087 * @returns VBox status code.
1088 * @param pvUser The user argument.
1089 * @param offStream The stream offset we're (supposed to be) at.
1090 * @param pvBuf Where to return the bytes.
1091 * @param cbToRead The number of bytes to read.
1092 * @param pcbRead Where to return the number of bytes actually
1093 * read. This may differ from cbToRead when the
1094 * end of the stream is encountered.
1095 */
1096 DECLCALLBACKMEMBER(int, pfnRead)(void *pvUser, uint64_t offStream, void *pvBuf, size_t cbToRead, size_t *pcbRead);
1097
1098 /**
1099 * Seeks in the stream.
1100 *
1101 * @returns VBox status code.
1102 * @retval VERR_NOT_SUPPORTED if the stream doesn't support this action.
1103 *
1104 * @param pvUser The user argument.
1105 * @param offSeek The seek offset.
1106 * @param uMethod RTFILE_SEEK_BEGIN, RTFILE_SEEK_END or
1107 * RTFILE_SEEK_CURRENT.
1108 * @param poffActual Where to store the new file position. Optional.
1109 */
1110 DECLCALLBACKMEMBER(int, pfnSeek)(void *pvUser, int64_t offSeek, unsigned uMethod, uint64_t *poffActual);
1111
1112 /**
1113 * Get the current stream position.
1114 *
1115 * @returns The correct stream position.
1116 * @param pvUser The user argument.
1117 */
1118 DECLCALLBACKMEMBER(uint64_t, pfnTell)(void *pvUser);
1119
1120 /**
1121 * Get the size/length of the stream.
1122 *
1123 * @returns VBox status code.
1124 * @retval VERR_NOT_SUPPORTED if the stream doesn't support this action.
1125 *
1126 * @param pvUser The user argument.
1127 * @param pcb Where to return the size/length.
1128 */
1129 DECLCALLBACKMEMBER(int, pfnSize)(void *pvUser, uint64_t *pcb);
1130
1131 /**
1132 * Check if the stream is OK or not (cancelled).
1133 *
1134 * @returns VBox status code.
1135 * @param pvUser The user argument.
1136 *
1137 * @remarks The method is expected to do a LogRel on failure.
1138 */
1139 DECLCALLBACKMEMBER(int, pfnIsOk)(void *pvUser);
1140
1141 /**
1142 * Close the stream.
1143 *
1144 * @returns VBox status code.
1145 * @param pvUser The user argument.
1146 * @param fCancelled True if the operation was cancelled.
1147 */
1148 DECLCALLBACKMEMBER(int, pfnClose)(void *pvUser, bool fCancelled);
1149
1150 /** Struct magic + version (SSMSTRMOPS_VERSION). */
1151 uint32_t u32EndVersion;
1152} SSMSTRMOPS;
1153/** Struct magic + version (SSMSTRMOPS_VERSION). */
1154#define SSMSTRMOPS_VERSION UINT32_C(0x55aa0001)
1155
1156
1157VMMR3_INT_DECL(void) SSMR3Term(PVM pVM);
1158VMMR3_INT_DECL(int)
1159SSMR3RegisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance, uint32_t uVersion,
1160 size_t cbGuess, const char *pszBefore,
1161 PFNSSMDEVLIVEPREP pfnLivePrep, PFNSSMDEVLIVEEXEC pfnLiveExec, PFNSSMDEVLIVEVOTE pfnLiveVote,
1162 PFNSSMDEVSAVEPREP pfnSavePrep, PFNSSMDEVSAVEEXEC pfnSaveExec, PFNSSMDEVSAVEDONE pfnSaveDone,
1163 PFNSSMDEVLOADPREP pfnLoadPrep, PFNSSMDEVLOADEXEC pfnLoadExec, PFNSSMDEVLOADDONE pfnLoadDone);
1164VMMR3_INT_DECL(int)
1165SSMR3RegisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
1166 PFNSSMDRVLIVEPREP pfnLivePrep, PFNSSMDRVLIVEEXEC pfnLiveExec, PFNSSMDRVLIVEVOTE pfnLiveVote,
1167 PFNSSMDRVSAVEPREP pfnSavePrep, PFNSSMDRVSAVEEXEC pfnSaveExec, PFNSSMDRVSAVEDONE pfnSaveDone,
1168 PFNSSMDRVLOADPREP pfnLoadPrep, PFNSSMDRVLOADEXEC pfnLoadExec, PFNSSMDRVLOADDONE pfnLoadDone);
1169VMMR3_INT_DECL(int)
1170SSMR3RegisterUsb(PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
1171 PFNSSMUSBLIVEPREP pfnLivePrep, PFNSSMUSBLIVEEXEC pfnLiveExec, PFNSSMUSBLIVEVOTE pfnLiveVote,
1172 PFNSSMUSBSAVEPREP pfnSavePrep, PFNSSMUSBSAVEEXEC pfnSaveExec, PFNSSMUSBSAVEDONE pfnSaveDone,
1173 PFNSSMUSBLOADPREP pfnLoadPrep, PFNSSMUSBLOADEXEC pfnLoadExec, PFNSSMUSBLOADDONE pfnLoadDone);
1174VMMR3DECL(int)
1175SSMR3RegisterInternal(PVM pVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
1176 PFNSSMINTLIVEPREP pfnLivePrep, PFNSSMINTLIVEEXEC pfnLiveExec, PFNSSMINTLIVEVOTE pfnLiveVote,
1177 PFNSSMINTSAVEPREP pfnSavePrep, PFNSSMINTSAVEEXEC pfnSaveExec, PFNSSMINTSAVEDONE pfnSaveDone,
1178 PFNSSMINTLOADPREP pfnLoadPrep, PFNSSMINTLOADEXEC pfnLoadExec, PFNSSMINTLOADDONE pfnLoadDone);
1179VMMR3DECL(int)
1180SSMR3RegisterExternal(PUVM pUVM, const char *pszName, uint32_t uInstance, uint32_t uVersion, size_t cbGuess,
1181 PFNSSMEXTLIVEPREP pfnLivePrep, PFNSSMEXTLIVEEXEC pfnLiveExec, PFNSSMEXTLIVEVOTE pfnLiveVote,
1182 PFNSSMEXTSAVEPREP pfnSavePrep, PFNSSMEXTSAVEEXEC pfnSaveExec, PFNSSMEXTSAVEDONE pfnSaveDone,
1183 PFNSSMEXTLOADPREP pfnLoadPrep, PFNSSMEXTLOADEXEC pfnLoadExec, PFNSSMEXTLOADDONE pfnLoadDone, void *pvUser);
1184VMMR3DECL(int) SSMR3RegisterStub(PVM pVM, const char *pszName, uint32_t uInstance);
1185VMMR3_INT_DECL(int) SSMR3DeregisterDevice(PVM pVM, PPDMDEVINS pDevIns, const char *pszName, uint32_t uInstance);
1186VMMR3_INT_DECL(int) SSMR3DeregisterDriver(PVM pVM, PPDMDRVINS pDrvIns, const char *pszName, uint32_t uInstance);
1187VMMR3_INT_DECL(int) SSMR3DeregisterUsb(PVM pVM, PPDMUSBINS pUsbIns, const char *pszName, uint32_t uInstance);
1188VMMR3DECL(int) SSMR3DeregisterInternal(PVM pVM, const char *pszName);
1189VMMR3DECL(int) SSMR3DeregisterExternal(PVM pVM, const char *pszName);
1190VMMR3DECL(int) SSMR3Save(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser, SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvUser);
1191VMMR3_INT_DECL(int) SSMR3LiveSave(PVM pVM, uint32_t cMsMaxDowntime,
1192 const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOps,
1193 SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser,
1194 PSSMHANDLE *ppSSM);
1195VMMR3_INT_DECL(int) SSMR3LiveDoStep1(PSSMHANDLE pSSM);
1196VMMR3_INT_DECL(int) SSMR3LiveDoStep2(PSSMHANDLE pSSM);
1197VMMR3_INT_DECL(int) SSMR3LiveDone(PSSMHANDLE pSSM);
1198VMMR3DECL(int) SSMR3Load(PVM pVM, const char *pszFilename, PCSSMSTRMOPS pStreamOps, void *pvStreamOpsUser,
1199 SSMAFTER enmAfter, PFNVMPROGRESS pfnProgress, void *pvProgressUser);
1200VMMR3DECL(int) SSMR3ValidateFile(const char *pszFilename, bool fChecksumIt);
1201VMMR3DECL(int) SSMR3Open(const char *pszFilename, unsigned fFlags, PSSMHANDLE *ppSSM);
1202VMMR3DECL(int) SSMR3Close(PSSMHANDLE pSSM);
1203VMMR3DECL(int) SSMR3Seek(PSSMHANDLE pSSM, const char *pszUnit, uint32_t iInstance, uint32_t *piVersion);
1204VMMR3DECL(int) SSMR3HandleGetStatus(PSSMHANDLE pSSM);
1205VMMR3DECL(int) SSMR3HandleSetStatus(PSSMHANDLE pSSM, int iStatus);
1206VMMR3DECL(SSMAFTER) SSMR3HandleGetAfter(PSSMHANDLE pSSM);
1207VMMR3DECL(bool) SSMR3HandleIsLiveSave(PSSMHANDLE pSSM);
1208VMMR3DECL(uint32_t) SSMR3HandleMaxDowntime(PSSMHANDLE pSSM);
1209VMMR3DECL(uint32_t) SSMR3HandleHostBits(PSSMHANDLE pSSM);
1210VMMR3DECL(uint32_t) SSMR3HandleRevision(PSSMHANDLE pSSM);
1211VMMR3DECL(uint32_t) SSMR3HandleVersion(PSSMHANDLE pSSM);
1212VMMR3DECL(const char *) SSMR3HandleHostOSAndArch(PSSMHANDLE pSSM);
1213VMMR3_INT_DECL(int) SSMR3HandleSetGCPtrSize(PSSMHANDLE pSSM, unsigned cbGCPtr);
1214VMMR3DECL(void) SSMR3HandleReportLivePercent(PSSMHANDLE pSSM, unsigned uPercent);
1215VMMR3DECL(int) SSMR3Cancel(PUVM pUVM);
1216
1217
1218/** Save operations.
1219 * @{
1220 */
1221VMMR3DECL(int) SSMR3PutStruct(PSSMHANDLE pSSM, const void *pvStruct, PCSSMFIELD paFields);
1222VMMR3DECL(int) SSMR3PutStructEx(PSSMHANDLE pSSM, const void *pvStruct, size_t cbStruct, uint32_t fFlags, PCSSMFIELD paFields, void *pvUser);
1223VMMR3DECL(int) SSMR3PutBool(PSSMHANDLE pSSM, bool fBool);
1224VMMR3DECL(int) SSMR3PutU8(PSSMHANDLE pSSM, uint8_t u8);
1225VMMR3DECL(int) SSMR3PutS8(PSSMHANDLE pSSM, int8_t i8);
1226VMMR3DECL(int) SSMR3PutU16(PSSMHANDLE pSSM, uint16_t u16);
1227VMMR3DECL(int) SSMR3PutS16(PSSMHANDLE pSSM, int16_t i16);
1228VMMR3DECL(int) SSMR3PutU32(PSSMHANDLE pSSM, uint32_t u32);
1229VMMR3DECL(int) SSMR3PutS32(PSSMHANDLE pSSM, int32_t i32);
1230VMMR3DECL(int) SSMR3PutU64(PSSMHANDLE pSSM, uint64_t u64);
1231VMMR3DECL(int) SSMR3PutS64(PSSMHANDLE pSSM, int64_t i64);
1232VMMR3DECL(int) SSMR3PutU128(PSSMHANDLE pSSM, uint128_t u128);
1233VMMR3DECL(int) SSMR3PutS128(PSSMHANDLE pSSM, int128_t i128);
1234VMMR3DECL(int) SSMR3PutUInt(PSSMHANDLE pSSM, RTUINT u);
1235VMMR3DECL(int) SSMR3PutSInt(PSSMHANDLE pSSM, RTINT i);
1236VMMR3DECL(int) SSMR3PutGCUInt(PSSMHANDLE pSSM, RTGCUINT u);
1237VMMR3DECL(int) SSMR3PutGCUIntReg(PSSMHANDLE pSSM, RTGCUINTREG u);
1238VMMR3DECL(int) SSMR3PutGCPhys32(PSSMHANDLE pSSM, RTGCPHYS32 GCPhys);
1239VMMR3DECL(int) SSMR3PutGCPhys64(PSSMHANDLE pSSM, RTGCPHYS64 GCPhys);
1240VMMR3DECL(int) SSMR3PutGCPhys(PSSMHANDLE pSSM, RTGCPHYS GCPhys);
1241VMMR3DECL(int) SSMR3PutGCPtr(PSSMHANDLE pSSM, RTGCPTR GCPtr);
1242VMMR3DECL(int) SSMR3PutGCUIntPtr(PSSMHANDLE pSSM, RTGCUINTPTR GCPtr);
1243VMMR3DECL(int) SSMR3PutRCPtr(PSSMHANDLE pSSM, RTRCPTR RCPtr);
1244VMMR3DECL(int) SSMR3PutIOPort(PSSMHANDLE pSSM, RTIOPORT IOPort);
1245VMMR3DECL(int) SSMR3PutSel(PSSMHANDLE pSSM, RTSEL Sel);
1246VMMR3DECL(int) SSMR3PutMem(PSSMHANDLE pSSM, const void *pv, size_t cb);
1247VMMR3DECL(int) SSMR3PutStrZ(PSSMHANDLE pSSM, const char *psz);
1248/** @} */
1249
1250
1251
1252/** Load operations.
1253 * @{
1254 */
1255VMMR3DECL(int) SSMR3GetStruct(PSSMHANDLE pSSM, void *pvStruct, PCSSMFIELD paFields);
1256VMMR3DECL(int) SSMR3GetStructEx(PSSMHANDLE pSSM, void *pvStruct, size_t cbStruct, uint32_t fFlags, PCSSMFIELD paFields, void *pvUser);
1257VMMR3DECL(int) SSMR3GetBool(PSSMHANDLE pSSM, bool *pfBool);
1258VMMR3DECL(int) SSMR3GetU8(PSSMHANDLE pSSM, uint8_t *pu8);
1259VMMR3DECL(int) SSMR3GetS8(PSSMHANDLE pSSM, int8_t *pi8);
1260VMMR3DECL(int) SSMR3GetU16(PSSMHANDLE pSSM, uint16_t *pu16);
1261VMMR3DECL(int) SSMR3GetS16(PSSMHANDLE pSSM, int16_t *pi16);
1262VMMR3DECL(int) SSMR3GetU32(PSSMHANDLE pSSM, uint32_t *pu32);
1263VMMR3DECL(int) SSMR3GetS32(PSSMHANDLE pSSM, int32_t *pi32);
1264VMMR3DECL(int) SSMR3GetU64(PSSMHANDLE pSSM, uint64_t *pu64);
1265VMMR3DECL(int) SSMR3GetS64(PSSMHANDLE pSSM, int64_t *pi64);
1266VMMR3DECL(int) SSMR3GetU128(PSSMHANDLE pSSM, uint128_t *pu128);
1267VMMR3DECL(int) SSMR3GetS128(PSSMHANDLE pSSM, int128_t *pi128);
1268VMMR3DECL(int) SSMR3GetUInt(PSSMHANDLE pSSM, PRTUINT pu);
1269VMMR3DECL(int) SSMR3GetSInt(PSSMHANDLE pSSM, PRTINT pi);
1270VMMR3DECL(int) SSMR3GetGCUInt(PSSMHANDLE pSSM, PRTGCUINT pu);
1271VMMR3DECL(int) SSMR3GetGCUIntReg(PSSMHANDLE pSSM, PRTGCUINTREG pu);
1272VMMR3DECL(int) SSMR3GetGCPhys32(PSSMHANDLE pSSM, PRTGCPHYS32 pGCPhys);
1273VMMR3DECL(int) SSMR3GetGCPhys64(PSSMHANDLE pSSM, PRTGCPHYS64 pGCPhys);
1274VMMR3DECL(int) SSMR3GetGCPhys(PSSMHANDLE pSSM, PRTGCPHYS pGCPhys);
1275VMMR3DECL(int) SSMR3GetGCPtr(PSSMHANDLE pSSM, PRTGCPTR pGCPtr);
1276VMMR3DECL(int) SSMR3GetGCUIntPtr(PSSMHANDLE pSSM, PRTGCUINTPTR pGCPtr);
1277VMMR3DECL(int) SSMR3GetRCPtr(PSSMHANDLE pSSM, PRTRCPTR pRCPtr);
1278VMMR3DECL(int) SSMR3GetIOPort(PSSMHANDLE pSSM, PRTIOPORT pIOPort);
1279VMMR3DECL(int) SSMR3GetSel(PSSMHANDLE pSSM, PRTSEL pSel);
1280VMMR3DECL(int) SSMR3GetMem(PSSMHANDLE pSSM, void *pv, size_t cb);
1281VMMR3DECL(int) SSMR3GetStrZ(PSSMHANDLE pSSM, char *psz, size_t cbMax);
1282VMMR3DECL(int) SSMR3GetStrZEx(PSSMHANDLE pSSM, char *psz, size_t cbMax, size_t *pcbStr);
1283VMMR3DECL(int) SSMR3GetTimer(PSSMHANDLE pSSM, PTMTIMER pTimer);
1284VMMR3DECL(int) SSMR3Skip(PSSMHANDLE pSSM, size_t cb);
1285VMMR3DECL(int) SSMR3SkipToEndOfUnit(PSSMHANDLE pSSM);
1286VMMR3DECL(int) SSMR3SetLoadError(PSSMHANDLE pSSM, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...);
1287VMMR3DECL(int) SSMR3SetLoadErrorV(PSSMHANDLE pSSM, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va);
1288VMMR3DECL(int) SSMR3SetCfgError(PSSMHANDLE pSSM, RT_SRC_POS_DECL, const char *pszFormat, ...);
1289
1290/** @} */
1291
1292/** @} */
1293#endif /* IN_RING3 */
1294
1295
1296/** @} */
1297
1298RT_C_DECLS_END
1299
1300#endif
1301
Note: See TracBrowser for help on using the repository browser.

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