SSMInternal.h revision 677833bc953b6cb418c701facbdcf4aa18d6c44e
/** @file
*
* SSM - Internal header file.
*/
/*
* Copyright (C) 2006 InnoTek Systemberatung GmbH
*
* This file is part of VirtualBox Open Source Edition (OSE), as
* available from http://www.virtualbox.org. This file is free software;
* General Public License as published by the Free Software Foundation,
* in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
* distribution. VirtualBox OSE is distributed in the hope that it will
* be useful, but WITHOUT ANY WARRANTY of any kind.
*
* If you received this file as part of a commercial VirtualBox
* distribution, then only the terms of your commercial VirtualBox
* license agreement apply instead of the previous paragraph.
*/
#ifndef __SSMInternal_h__
#define __SSMInternal_h__
/** @defgroup grp_ssm_int Internals
* @ingroup grp_ssm
* @internal
* @{
*/
/**
* Data unit callback type.
*/
typedef enum SSMUNITTYPE
{
/** PDM Device . */
SSMUNITTYPE_DEV = 1,
/** PDM Driver. */
/** VM Internal. */
/** External Wrapper. */
} SSMUNITTYPE;
/** Pointer to a data unit descriptor. */
/**
* Data unit descriptor.
*/
typedef struct SSMUNIT
{
/** Pointer ot the next one in the list. */
* The flag is used to determin whether there is need for a call to
* done or not. */
bool fCalled;
/** Callback interface type. */
/** Type specific data. */
union
{
/** SSMUNITTYPE_DEV. */
struct
{
/** Prepare save. */
/** Execute save. */
/** Done save. */
/** Prepare load. */
/** Execute load. */
/** Done load. */
/** Device instance. */
} Dev;
/** SSMUNITTYPE_DRV. */
struct
{
/** Prepare save. */
/** Execute save. */
/** Done save. */
/** Prepare load. */
/** Execute load. */
/** Done load. */
/** Driver instance. */
} Drv;
/** SSMUNITTYPE_INTERNAL. */
struct
{
/** Prepare save. */
/** Execute save. */
/** Done save. */
/** Prepare load. */
/** Execute load. */
/** Done load. */
} Internal;
/** SSMUNITTYPE_EXTERNAL. */
struct
{
/** Prepare save. */
/** Execute save. */
/** Done save. */
/** Prepare load. */
/** Execute load. */
/** Done load. */
/** User data. */
void *pvUser;
} External;
} u;
/** Data layout version. */
/** Instance number. */
/** The guessed size of the data unit - used only for progress indication. */
/** Name size. (bytes) */
/** Name of this unit. (extends beyond the defined size) */
char szName[1];
} SSMUNIT;
/**
* Converts a SSM pointer into a VM pointer.
* @returns Pointer to the VM structure the SSM is part of.
* @param pSSM Pointer to SSM instance data.
*/
/**
* SSM VM Instance data.
* Changes to this must checked against the padding of the cfgm union in VM!
*/
typedef struct SSM
{
/** Offset to the VM structure.
* See SSM2VM(). */
/** FIFO of data entity descriptors. */
} SSM;
/** Pointer to SSM VM instance data. */
/** @} */
#endif /* !__SSMInternal_h__ */