pdmdev.h revision 86b620001857a05e9e7b83b11525094c34637e23
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * PDM - Pluggable Device Manager, Devices.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * available from http://www.virtualbox.org. This file is free software;
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * you can redistribute it and/or modify it under the terms of the GNU
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * General Public License (GPL) as published by the Free Software
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * The contents of this file may alternatively be used under the terms
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * of the Common Development and Distribution License Version 1.0
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * VirtualBox OSE distribution, in which case the provisions of the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * CDDL are applicable instead of those of the GPL.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * You may elect to license modified versions of this file under the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * terms and conditions of either the GPL or the CDDL or both.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * additional information or have any questions.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** @defgroup grp_pdm_device The PDM Devices API
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @ingroup grp_pdm
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Construct a device instance for a VM.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBox status.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pDevIns The device instance data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * If the registration structure is needed, pDevIns->pDevReg points to it.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param iInstance Instance number. Use this to figure out which registers and such to use.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * The instance number is also found in pDevIns->iInstance, but since it's
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * likely to be freqently used PDM passes it as parameter.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pCfgHandle Configuration node handle for the device. Use this to obtain the configuration
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * of the device instance. It's also found in pDevIns->pCfgHandle, but since it's
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * primary usage will in this function it's passed as a parameter.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(int) FNPDMDEVCONSTRUCT(PPDMDEVINS pDevIns, int iInstance, PCFGMNODE pCfgHandle);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVCONSTRUCT() function. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Destruct a device instance.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Most VM resources are freed by the VM. This callback is provided so that any non-VM
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * resources can be freed correctly.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBox status.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pDevIns The device instance data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(int) FNPDMDEVDESTRUCT(PPDMDEVINS pDevIns);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVDESTRUCT() function. */
c3d815a42d27fd8f006bade5dba5d5f4b364655evboxsync * Device relocation callback.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * When this callback is called the device instance data, and if the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * device have a GC component, is being relocated, or/and the selectors
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * have been changed. The device must use the chance to perform the
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * necessary pointer relocations and data updates.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Before the GC code is executed the first time, this function will be
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * called with a 0 delta so GC pointer calculations can be one in one place.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pDevIns Pointer to the device instance.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param offDelta The relocation delta relative to the old location.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @remark A relocation CANNOT fail.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(void) FNPDMDEVRELOCATE(PPDMDEVINS pDevIns, RTGCINTPTR offDelta);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVRELOCATE() function. */
7d7c3dba7ea44027b3adf273ef13b638271a4f58vboxsync * Device I/O Control interface.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * This is used by external components, such as the COM interface, to
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * communicate with devices using a class wide interface or a device
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * specific interface.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBox status code.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @param pDevIns Pointer to the device instance.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param uFunction Function to perform.
2a7c2c6cf74b4bf69770343650059641a1c00a6avboxsync * @param pvIn Pointer to input data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param cbIn Size of input data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pvOut Pointer to output data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param cbOut Size of output data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pcbOut Where to store the actual size of the output data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(int) FNPDMDEVIOCTL(PPDMDEVINS pDevIns, RTUINT uFunction,
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVIOCTL() function. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Power On notification.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBox status.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pDevIns The device instance data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(void) FNPDMDEVPOWERON(PPDMDEVINS pDevIns);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVPOWERON() function. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * Reset notification.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBox status.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pDevIns The device instance data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(void) FNPDMDEVRESET(PPDMDEVINS pDevIns);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVRESET() function. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Suspend notification.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBox status.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @param pDevIns The device instance data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(void) FNPDMDEVSUSPEND(PPDMDEVINS pDevIns);
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync/** Pointer to a FNPDMDEVSUSPEND() function. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * Resume notification.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @returns VBox status.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @param pDevIns The device instance data.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(void) FNPDMDEVRESUME(PPDMDEVINS pDevIns);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVRESUME() function. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * Power Off notification.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @param pDevIns The device instance data.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsynctypedef DECLCALLBACK(void) FNPDMDEVPOWEROFF(PPDMDEVINS pDevIns);
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync/** Pointer to a FNPDMDEVPOWEROFF() function. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * Attach command.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * This is called to let the device attach to a driver for a specified LUN
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * at runtime. This is not called during VM construction, the device
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * constructor have to attach to all the available drivers.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * This is like plugging in the keyboard or mouse after turning on the PC.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @returns VBox status code.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @param pDevIns The device instance.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @param iLUN The logical unit which is being detached.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsynctypedef DECLCALLBACK(int) FNPDMDEVATTACH(PPDMDEVINS pDevIns, unsigned iLUN);
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync/** Pointer to a FNPDMDEVATTACH() function. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * Detach notification.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * This is called when a driver is detaching itself from a LUN of the device.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * The device should adjust it's state to reflect this.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * This is like unplugging the network cable to use it for the laptop or
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * something while the PC is still running.
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync * @param pDevIns The device instance.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param iLUN The logical unit which is being detached.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(void) FNPDMDEVDETACH(PPDMDEVINS pDevIns, unsigned iLUN);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVDETACH() function. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Query the base interface of a logical unit.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBOX status code.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pDevIns The device instance.
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync * @param iLUN The logicial unit to query.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param ppBase Where to store the pointer to the base interface of the LUN.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(int) FNPDMDEVQUERYINTERFACE(PPDMDEVINS pDevIns, unsigned iLUN, PPDMIBASE *ppBase);
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync/** Pointer to a FNPDMDEVQUERYINTERFACE() function. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef FNPDMDEVQUERYINTERFACE *PFNPDMDEVQUERYINTERFACE;
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Init complete notification.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * This can be done to do communication with other devices and other
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * initialization which requires everything to be in place.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @returns VBOX status code.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * @param pDevIns The device instance.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef DECLCALLBACK(int) FNPDMDEVINITCOMPLETE(PPDMDEVINS pDevIns);
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a FNPDMDEVINITCOMPLETE() function. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef FNPDMDEVINITCOMPLETE *PFNPDMDEVINITCOMPLETE;
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** PDM Device Registration Structure,
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * This structure is used when registering a device from
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * VBoxInitDevices() in HC Ring-3. PDM will continue use till
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * the VM is terminated.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsynctypedef struct PDMDEVREG
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Structure version. PDM_DEVREG_VERSION defines the current version. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** Device name. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Name of the raw-mode context module (no path).
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Only evalutated if PDM_DEVREG_FLAGS_RC is set. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Name of the ring-0 module (no path).
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * Only evalutated if PDM_DEVREG_FLAGS_R0 is set. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** The description of the device. The UTF-8 string pointed to shall, like this structure,
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * remain unchanged from registration till VM destruction. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Flags, combination of the PDM_DEVREG_FLAGS_* \#defines. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Device class(es), combination of the PDM_DEVREG_CLASS_* \#defines. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** Maximum number of instances (per VM). */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** Size of the instance data. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** Construct instance - required. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** Destruct instance - optional. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** Relocation command - optional. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** I/O Control interface - optional. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync /** Power on notification - optional. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Reset notification - optional. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Suspend notification - optional. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Resume notification - optional. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Attach command - optional. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Detach notification - optional. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync /** Query a LUN base interface - optional. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync /** Init complete notification - optional. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync /** Power off notification - optional. */
094bd1aaada16d47495d62f7c3324f9df84c999avboxsync /** @todo */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync /** Initialization safty marker. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Pointer to a PDM Device Structure. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Const pointer to a PDM Device Structure. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** Current DEVREG version number. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** PDM Device Flags.
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** This flag is used to indicate that the device has a RC component. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** This flag is used to indicate that the device has a R0 component. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** @def PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync * The bit count for the current host. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# define PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT 0x00000010
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync# define PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT 0x00000020
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync/** The host bit count mask. */
decf6daa697ed0e43daab9dc84769165b23f5abavboxsync/** The device support only 32-bit guests. */
1d42c7799e7c35c5b36a2494cde9a47e5651ceadvboxsync/** The device support only 64-bit guests. */
#define PDM_DEVREG_FLAGS_DEFAULT_BITS (PDM_DEVREG_FLAGS_GUEST_BITS_DEFAULT | PDM_DEVREG_FLAGS_HOST_BITS_DEFAULT)
#define PDM_IRQ_LEVEL_LOW 0
typedef struct PDMPCIBUSREG
DECLR3CALLBACKMEMBER(int, pfnRegisterR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, const char *pszName, int iDev));
DECLR3CALLBACKMEMBER(int, pfnIORegionRegisterR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback));
DECLR3CALLBACKMEMBER(void, pfnSetConfigCallbacksR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel));
DECLR3CALLBACKMEMBER(int, pfnSaveExecR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PSSMHANDLE pSSMHandle));
DECLR3CALLBACKMEMBER(int, pfnLoadExecR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PSSMHANDLE pSSMHandle));
const char *pszSetIrqRC;
const char *pszSetIrqR0;
} PDMPCIBUSREG;
typedef struct PDMPCIHLPRC
} PDMPCIHLPRC;
typedef struct PDMPCIHLPR0
} PDMPCIHLPR0;
typedef struct PDMPCIHLPR3
DECLR3CALLBACKMEMBER(bool, pfnIsMMIO2Base,(PPDMDEVINS pDevIns, PPDMDEVINS pOwner, RTGCPHYS GCPhys));
} PDMPCIHLPR3;
typedef struct PDMPICREG
const char *pszSetIrqRC;
const char *pszGetInterruptRC;
const char *pszSetIrqR0;
const char *pszGetInterruptR0;
} PDMPICREG;
typedef struct PDMPICHLPRC
} PDMPICHLPRC;
typedef struct PDMPICHLPR0
} PDMPICHLPR0;
typedef struct PDMPICHLPR3
} PDMPICHLPR3;
typedef struct PDMAPICREG
DECLR3CALLBACKMEMBER(int, pfnWriteMSRR3, (PPDMDEVINS pDevIns, VMCPUID idCpu, uint32_t u32Reg, uint64_t u64Value));
DECLR3CALLBACKMEMBER(int, pfnReadMSRR3, (PPDMDEVINS pDevIns, VMCPUID idCpu, uint32_t u32Reg, uint64_t *pu64Value));
DECLR3CALLBACKMEMBER(int, pfnBusDeliverR3,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
const char *pszGetInterruptRC;
const char *pszHasPendingIrqRC;
const char *pszSetBaseRC;
const char *pszGetBaseRC;
const char *pszSetTPRRC;
const char *pszGetTPRRC;
const char *pszWriteMSRRC;
const char *pszReadMSRRC;
const char *pszBusDeliverRC;
const char *pszGetInterruptR0;
const char *pszHasPendingIrqR0;
const char *pszSetBaseR0;
const char *pszGetBaseR0;
const char *pszSetTPRR0;
const char *pszGetTPRR0;
const char *pszWriteMSRR0;
const char *pszReadMSRR0;
const char *pszBusDeliverR0;
} PDMAPICREG;
typedef enum PDMAPICVERSION
typedef struct PDMAPICHLPRC
} PDMAPICHLPRC;
typedef struct PDMAPICHLPR0
} PDMAPICHLPR0;
typedef struct PDMAPICHLPR3
} PDMAPICHLPR3;
typedef struct PDMIOAPICREG
const char *pszSetIrqRC;
const char *pszSetIrqR0;
} PDMIOAPICREG;
typedef struct PDMIOAPICHLPRC
DECLRCCALLBACKMEMBER(int, pfnApicBusDeliver,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
typedef struct PDMIOAPICHLPR0
DECLR0CALLBACKMEMBER(int, pfnApicBusDeliver,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
typedef struct PDMIOAPICHLPR3
DECLR3CALLBACKMEMBER(int, pfnApicBusDeliver,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
#ifdef IN_RING3
typedef DECLCALLBACK(uint32_t) FNDMATRANSFERHANDLER(PPDMDEVINS pDevIns, void *pvUser, unsigned uChannel, uint32_t off, uint32_t cb);
typedef struct PDMDMAREG
* @returns A more work indiciator. I.e. 'true' if there is more to be done, and 'false' if all is done.
DECLR3CALLBACKMEMBER(void, pfnRegister,(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser));
DECLR3CALLBACKMEMBER(uint32_t, pfnReadMemory,(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock));
DECLR3CALLBACKMEMBER(uint32_t, pfnWriteMemory,(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock));
} PDMDMACREG;
typedef struct PDMDMACHLP
} PDMDMACHLP;
typedef struct PDMRTCREG
} PDMRTCREG;
typedef struct PDMRTCHLP
} PDMRTCHLP;
#ifdef IN_RING3
typedef struct PDMDEVHLPR3
DECLR3CALLBACKMEMBER(int, pfnIOPortRegister,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser,
DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterGC,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser,
* Register R3 (HC) handlers before R0 (R0) handlers! There must be a R3 (HC) handler for every R0 handler!
DECLR3CALLBACKMEMBER(int, pfnIOPortRegisterR0,(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
DECLR3CALLBACKMEMBER(int, pfnMMIORegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
const char *pszDesc));
DECLR3CALLBACKMEMBER(int, pfnMMIORegisterGC,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
const char *pszDesc));
DECLR3CALLBACKMEMBER(int, pfnMMIORegisterR0,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
const char *pszDesc));
DECLR3CALLBACKMEMBER(int, pfnMMIODeregister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange));
* @param fFlags Shadow ROM flags, PGMPHYS_ROM_FLAGS_* in pgm.h.
DECLR3CALLBACKMEMBER(int, pfnROMRegister,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, uint32_t fFlags, const char *pszDesc));
DECLR3CALLBACKMEMBER(int, pfnSSMRegister,(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess,
DECLR3CALLBACKMEMBER(int, pfnTMTimerCreate,(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer));
DECLR3CALLBACKMEMBER(PTMTIMERR3, pfnTMTimerCreateExternal,(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMEREXT pfnCallback, void *pvUser, const char *pszDesc));
DECLR3CALLBACKMEMBER(int, pfnPCIIORegionRegister,(PPDMDEVINS pDevIns, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback));
DECLR3CALLBACKMEMBER(void, pfnPCISetConfigCallbacks,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
DECLR3CALLBACKMEMBER(int, pfnDriverAttach,(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc));
DECLR3CALLBACKMEMBER(int, pfnVMSetError,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...));
DECLR3CALLBACKMEMBER(int, pfnVMSetErrorV,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va));
DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...));
DECLR3CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va));
DECLR3CALLBACKMEMBER(bool, pfnAssertEMT,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction));
DECLR3CALLBACKMEMBER(bool, pfnAssertOther,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction));
DECLR3CALLBACKMEMBER(int, pfnDBGFStopV,(PPDMDEVINS pDevIns, const char *pszFile, unsigned iLine, const char *pszFunction, const char *pszFormat, va_list args));
DECLR3CALLBACKMEMBER(int, pfnDBGFInfoRegister,(PPDMDEVINS pDevIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler));
DECLR3CALLBACKMEMBER(void, pfnSTAMRegister,(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc));
DECLR3CALLBACKMEMBER(void, pfnSTAMRegisterF,(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
DECLR3CALLBACKMEMBER(void, pfnSTAMRegisterV,(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility,
DECLR3CALLBACKMEMBER(int, pfnRTCRegister,(PPDMDEVINS pDevIns, PCPDMRTCREG pRtcReg, PCPDMRTCHLP *ppRtcHlp));
DECLR3CALLBACKMEMBER(int, pfnPDMQueueCreate,(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
DECLR3CALLBACKMEMBER(int, pfnCritSectInit,(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, const char *pszName));
DECLR3CALLBACKMEMBER(int, pfnPDMThreadCreate,(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread,
DECLR3CALLBACKMEMBER(int, pfnPhysGCPtr2GCPhys, (PPDMDEVINS pDevIns, RTGCPTR GCPtr, PRTGCPHYS pGCPhys));
DECLR3CALLBACKMEMBER(int, pfnPCIBusRegister,(PPDMDEVINS pDevIns, PPDMPCIBUSREG pPciBusReg, PCPDMPCIHLPR3 *ppPciHlpR3));
DECLR3CALLBACKMEMBER(int, pfnPICRegister,(PPDMDEVINS pDevIns, PPDMPICREG pPicReg, PCPDMPICHLPR3 *ppPicHlpR3));
DECLR3CALLBACKMEMBER(int, pfnAPICRegister,(PPDMDEVINS pDevIns, PPDMAPICREG pApicReg, PCPDMAPICHLPR3 *ppApicHlpR3));
DECLR3CALLBACKMEMBER(int, pfnIOAPICRegister,(PPDMDEVINS pDevIns, PPDMIOAPICREG pIoApicReg, PCPDMIOAPICHLPR3 *ppIoApicHlpR3));
DECLR3CALLBACKMEMBER(int, pfnDMACRegister,(PPDMDEVINS pDevIns, PPDMDMACREG pDmacReg, PCPDMDMACHLP *ppDmacHlp));
DECLR3CALLBACKMEMBER(int, pfnPhysRead,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead));
DECLR3CALLBACKMEMBER(int, pfnPhysWrite,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite));
DECLR3CALLBACKMEMBER(int, pfnPhysGCPhys2CCPtr,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv, PPGMPAGEMAPLOCK pLock));
DECLR3CALLBACKMEMBER(int, pfnPhysGCPhys2CCPtrReadOnly,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv, PPGMPAGEMAPLOCK pLock));
DECLR3CALLBACKMEMBER(void, pfnPhysReleasePageMappingLock,(PPDMDEVINS pDevIns, PPGMPAGEMAPLOCK pLock));
DECLR3CALLBACKMEMBER(int, pfnPhysReadGCVirt,(PPDMDEVINS pDevIns, void *pvDst, RTGCPTR GCVirtSrc, size_t cb));
DECLR3CALLBACKMEMBER(int, pfnPhysWriteGCVirt,(PPDMDEVINS pDevIns, RTGCPTR GCVirtDst, const void *pvSrc, size_t cb));
DECLR3CALLBACKMEMBER(int, pfnDMARegister,(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser));
DECLR3CALLBACKMEMBER(int, pfnDMAReadMemory,(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbRead));
DECLR3CALLBACKMEMBER(int, pfnDMAWriteMemory,(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbWritten));
DECLR3CALLBACKMEMBER(void, pfnGetCpuId,(PPDMDEVINS pDevIns, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx));
DECLR3CALLBACKMEMBER(int, pfnROMProtectShadow,(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt));
DECLR3CALLBACKMEMBER(int, pfnMMIO2Register,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc));
DECLR3CALLBACKMEMBER(int, pfnMMHyperMapMMIO2,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
DECLR3CALLBACKMEMBER(int, pfnMMIO2MapKernel,(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
DECLR3CALLBACKMEMBER(int, pfnRegisterVMMDevHeap,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize));
} PDMDEVHLPR3;
typedef struct PDMDEVHLPRC
DECLRCCALLBACKMEMBER(int, pfnPhysRead,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead));
DECLRCCALLBACKMEMBER(int, pfnPhysWrite,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite));
DECLRCCALLBACKMEMBER(int, pfnVMSetError,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...));
DECLRCCALLBACKMEMBER(int, pfnVMSetErrorV,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va));
DECLRCCALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...));
DECLRCCALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va));
DECLRCCALLBACKMEMBER(int, pfnPATMSetMMIOPatchInfo,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData));
} PDMDEVHLPRC;
typedef struct PDMDEVHLPR0
DECLR0CALLBACKMEMBER(int, pfnPhysRead,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, void *pvBuf, size_t cbRead));
DECLR0CALLBACKMEMBER(int, pfnPhysWrite,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite));
DECLR0CALLBACKMEMBER(int, pfnVMSetError,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, ...));
DECLR0CALLBACKMEMBER(int, pfnVMSetErrorV,(PPDMDEVINS pDevIns, int rc, RT_SRC_POS_DECL, const char *pszFormat, va_list va));
DECLR0CALLBACKMEMBER(int, pfnVMSetRuntimeError,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...));
DECLR0CALLBACKMEMBER(int, pfnVMSetRuntimeErrorV,(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, va_list va));
DECLR0CALLBACKMEMBER(int, pfnPATMSetMMIOPatchInfo,(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTGCPTR pCachedData));
} PDMDEVHLPR0;
typedef struct PDMDEVINS
#ifdef PDMDEVINSINT_DECLARED
PDMDEVINSINT s;
} Internal;
} PDMDEVINS;
#define PDMIBASE_2_PDMDEV(pInterface) ( (PPDMDEVINS)((char *)(pInterface) - RT_OFFSETOF(PDMDEVINS, IBase)) )
#ifdef VBOX_STRICT
# define PDMDEV_ASSERT_EMT(pDevIns) pDevIns->pDevHlpR3->pfnAssertEMT(pDevIns, __FILE__, __LINE__, __FUNCTION__)
#ifdef VBOX_STRICT
# define PDMDEV_ASSERT_OTHER(pDevIns) pDevIns->pDevHlpR3->pfnAssertOther(pDevIns, __FILE__, __LINE__, __FUNCTION__)
#ifdef VBOX_STRICT
# define PDMDEV_ASSERT_VMLOCK_OWNER(pDevIns) pDevIns->pDevHlpR3->pfnAssertVMLock(pDevIns, __FILE__, __LINE__, __FUNCTION__)
#define PDMDEVINS_2_RCPTR(pDevIns) ( (RCPTRTYPE(PPDMDEVINS))((RTGCUINTPTR)(pDevIns)->pvInstanceDataRC - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
#define PDMDEVINS_2_R3PTR(pDevIns) ( (R3PTRTYPE(PPDMDEVINS))((RTHCUINTPTR)(pDevIns)->pvInstanceDataR3 - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
#define PDMDEVINS_2_R0PTR(pDevIns) ( (R0PTRTYPE(PPDMDEVINS))((RTR0UINTPTR)(pDevIns)->pvInstanceDataR0 - RT_OFFSETOF(PDMDEVINS, achInstanceData)) )
#ifdef VBOX_STRICT
# ifdef IN_RING3
int rc;
return rc;
return VINF_EM_DBG_STOP;
return VINF_SUCCESS;
#ifdef IN_RING3
DECLINLINE(int) PDMDevHlpIOPortRegister(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTHCPTR pvUser,
return pDevIns->pDevHlpR3->pfnIOPortRegister(pDevIns, Port, cPorts, pvUser, pfnOut, pfnIn, pfnOutStr, pfnInStr, pszDesc);
DECLINLINE(int) PDMDevHlpIOPortRegisterGC(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTRCPTR pvUser,
return pDevIns->pDevHlpR3->pfnIOPortRegisterGC(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
DECLINLINE(int) PDMDevHlpIOPortRegisterR0(PPDMDEVINS pDevIns, RTIOPORT Port, RTUINT cPorts, RTR0PTR pvUser,
return pDevIns->pDevHlpR3->pfnIOPortRegisterR0(pDevIns, Port, cPorts, pvUser, pszOut, pszIn, pszOutStr, pszInStr, pszDesc);
DECLINLINE(int) PDMDevHlpMMIORegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTHCPTR pvUser,
const char *pszDesc)
return pDevIns->pDevHlpR3->pfnMMIORegister(pDevIns, GCPhysStart, cbRange, pvUser, pfnWrite, pfnRead, pfnFill, pszDesc);
DECLINLINE(int) PDMDevHlpMMIORegisterGC(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTGCPTR pvUser,
return pDevIns->pDevHlpR3->pfnMMIORegisterGC(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
DECLINLINE(int) PDMDevHlpMMIORegisterR0(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, RTR0PTR pvUser,
return pDevIns->pDevHlpR3->pfnMMIORegisterR0(pDevIns, GCPhysStart, cbRange, pvUser, pszWrite, pszRead, pszFill, NULL);
DECLINLINE(int) PDMDevHlpROMRegister(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, const void *pvBinary, uint32_t fFlags, const char *pszDesc)
return pDevIns->pDevHlpR3->pfnROMRegister(pDevIns, GCPhysStart, cbRange, pvBinary, fFlags, pszDesc);
DECLINLINE(int) PDMDevHlpROMProtectShadow(PPDMDEVINS pDevIns, RTGCPHYS GCPhysStart, RTUINT cbRange, PGMROMPROT enmProt)
DECLINLINE(int) PDMDevHlpMMIO2Register(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS cb, uint32_t fFlags, void **ppv, const char *pszDesc)
DECLINLINE(int) PDMDevHlpMMHyperMapMMIO2(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
DECLINLINE(int) PDMDevHlpMMIO2MapKernel(PPDMDEVINS pDevIns, uint32_t iRegion, RTGCPHYS off, RTGCPHYS cb,
DECLINLINE(int) PDMDevHlpRegisterVMMDevHeap(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, RTR3PTR pvHeap, unsigned cbSize)
DECLINLINE(int) PDMDevHlpSSMRegister(PPDMDEVINS pDevIns, const char *pszName, uint32_t u32Instance, uint32_t u32Version, size_t cbGuess,
DECLINLINE(int) PDMDevHlpTMTimerCreate(PPDMDEVINS pDevIns, TMCLOCK enmClock, PFNTMTIMERDEV pfnCallback, const char *pszDesc, PPTMTIMERR3 ppTimer)
DECLINLINE(int) PDMDevHlpPCIIORegionRegister(PPDMDEVINS pDevIns, int iRegion, uint32_t cbRegion, PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback)
return pDevIns->pDevHlpR3->pfnPCIIORegionRegister(pDevIns, iRegion, cbRegion, enmType, pfnCallback);
DECLINLINE(void) PDMDevHlpPCISetConfigCallbacks(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead, PPFNPCICONFIGREAD ppfnReadOld,
pDevIns->pDevHlpR3->pfnPCISetConfigCallbacks(pDevIns, pPciDev, pfnRead, ppfnReadOld, pfnWrite, ppfnWriteOld);
DECLINLINE(int) PDMDevHlpDriverAttach(PPDMDEVINS pDevIns, RTUINT iLun, PPDMIBASE pBaseInterface, PPDMIBASE *ppBaseInterface, const char *pszDesc)
return pDevIns->pDevHlpR3->pfnDriverAttach(pDevIns, iLun, pBaseInterface, ppBaseInterface, pszDesc);
DECLINLINE(int) PDMDevHlpDBGFInfoRegister(PPDMDEVINS pDevIns, const char *pszName, const char *pszDesc, PFNDBGFHANDLERDEV pfnHandler)
DECLINLINE(void) PDMDevHlpSTAMRegister(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, const char *pszName, STAMUNIT enmUnit, const char *pszDesc)
DECLINLINE(void) PDMDevHlpSTAMRegisterF(PPDMDEVINS pDevIns, void *pvSample, STAMTYPE enmType, STAMVISIBILITY enmVisibility, STAMUNIT enmUnit,
pDevIns->pDevHlpR3->pfnSTAMRegisterV(pDevIns, pvSample, enmType, enmVisibility, enmUnit, pszDesc, pszName, va);
DECLINLINE(int) PDMDevHlpPDMQueueCreate(PPDMDEVINS pDevIns, RTUINT cbItem, RTUINT cItems, uint32_t cMilliesInterval,
return pDevIns->pDevHlpR3->pfnPDMQueueCreate(pDevIns, cbItem, cItems, cMilliesInterval, pfnCallback, fGCEnabled, ppQueue);
DECLINLINE(int) PDMDevHlpCritSectInit(PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, const char *pszName)
DECLINLINE(int) PDMDevHlpPhysReadGCVirt(PPDMDEVINS pDevIns, void *pvDst, RTGCPTR GCVirtSrc, size_t cb)
DECLINLINE(int) PDMDevHlpPhysWriteGCVirt(PPDMDEVINS pDevIns, RTGCPTR GCVirtDst, const void *pvSrc, size_t cb)
DECLINLINE(int) PDMDevHlpDMARegister(PPDMDEVINS pDevIns, unsigned uChannel, PFNDMATRANSFERHANDLER pfnTransferHandler, void *pvUser)
DECLINLINE(int) PDMDevHlpDMAReadMemory(PPDMDEVINS pDevIns, unsigned uChannel, void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbRead)
DECLINLINE(int) PDMDevHlpDMAWriteMemory(PPDMDEVINS pDevIns, unsigned uChannel, const void *pvBuffer, uint32_t off, uint32_t cbBlock, uint32_t *pcbWritten)
return pDevIns->pDevHlpR3->pfnDMAWriteMemory(pDevIns, uChannel, pvBuffer, off, cbBlock, pcbWritten);
DECLINLINE(void) PDMDevHlpGetCpuId(PPDMDEVINS pDevIns, uint32_t iLeaf, uint32_t *pEax, uint32_t *pEbx, uint32_t *pEcx, uint32_t *pEdx)
DECLINLINE(int) PDMDevHlpPDMThreadCreate(PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread,
return pDevIns->pDevHlpR3->pfnPDMThreadCreate(pDevIns, ppThread, pvUser, pfnThread, pfnWakeup, cbStack, enmType, pszName);
#ifdef IN_RING0
DECLINLINE(int) PDMDevHlpPhysWrite(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, const void *pvBuf, size_t cbWrite)
#ifdef IN_RING3
DECLINLINE(int) PDMDevHlpPhysGCPhys2CCPtr(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t fFlags, void **ppv, PPGMPAGEMAPLOCK pLock)
DECLINLINE(int) PDMDevHlpPhysGCPhys2CCPtrReadOnly(PPDMDEVINS pDevIns, RTGCPHYS GCPhys, uint32_t fFlags, void const **ppv, PPGMPAGEMAPLOCK pLock)
return pDevIns->CTX_SUFF(pDevHlp)->pfnPhysGCPhys2CCPtrReadOnly(pDevIns, GCPhys, fFlags, ppv, pLock);
DECLINLINE(int) PDMDevHlpVMSetError(PPDMDEVINS pDevIns, const int rc, RT_SRC_POS_DECL, const char *pszFormat, ...)
return rc;
DECLINLINE(int) PDMDevHlpVMSetRuntimeError(PPDMDEVINS pDevIns, uint32_t fFlags, const char *pszErrorId, const char *pszFormat, ...)
int rc;
return rc;
typedef struct PDMDEVREGCB
} PDMDEVREGCB;