PDMInternal.h revision 7521bd76d764c3c9534c162e2a37fefb446f2071
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/* $Id$ */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @file
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * PDM - Internal header file.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/*
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync * Copyright (C) 2006-2007 Sun Microsystems, Inc.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync *
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * available from http://www.virtualbox.org. This file is free software;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * you can redistribute it and/or modify it under the terms of the GNU
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * General Public License (GPL) as published by the Free Software
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync *
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * Clara, CA 95054 USA or visit http://www.sun.com if you need
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync * additional information or have any questions.
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync */
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync#ifndef ___PDMInternal_h
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync#define ___PDMInternal_h
0d12c7f9423f2745f8e282523d0930f91bff03b3vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#include <VBox/cdefs.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#include <VBox/types.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#include <VBox/param.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#include <VBox/cfgm.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#include <VBox/stam.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#include <VBox/vusb.h>
032a52c5b2984e26e84c2961f8f7f98a3954c8f2vboxsync#include <VBox/pdmasynccompletion.h>
6ba706e9f431401d425d16817fdcd6316f83b584vboxsync#include <iprt/critsect.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#ifdef IN_RING3
590bfe12ce22cd3716448fbb9f4dc51664bfe5e2vboxsync# include <iprt/thread.h>
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync#endif
45c3e41d012100c5f4a3f77e391e4c6da8f5b97avboxsync
45c3e41d012100c5f4a3f77e391e4c6da8f5b97avboxsync__BEGIN_DECLS
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** @defgroup grp_pdm_int Internal
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * @ingroup grp_pdm
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * @internal
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * @{
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/*******************************************************************************
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync* Structures and Typedefs *
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync*******************************************************************************/
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to a PDM Device. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsynctypedef struct PDMDEV *PPDMDEV;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/** Pointer to a pointer to a PDM Device. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsynctypedef PPDMDEV *PPPDMDEV;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to a PDM USB Device. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsynctypedef struct PDMUSB *PPDMUSB;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync/** Pointer to a pointer to a PDM USB Device. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsynctypedef PPDMUSB *PPPDMUSB;
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync/** Pointer to a PDM Driver. */
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsynctypedef struct PDMDRV *PPDMDRV;
c2046db2cc346cc299f0cd9b2d1e160179159cfcvboxsync/** Pointer to a pointer to a PDM Driver. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef PPDMDRV *PPPDMDRV;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/** Pointer to a PDM Logical Unit. */
2d8870843ff566fee9bd3a6a5942414254106479vboxsynctypedef struct PDMLUN *PPDMLUN;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync/** Pointer to a pointer to a PDM Logical Unit. */
2d8870843ff566fee9bd3a6a5942414254106479vboxsynctypedef PPDMLUN *PPPDMLUN;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync
2d8870843ff566fee9bd3a6a5942414254106479vboxsync/** Pointer to a PDM PCI Bus instance. */
2d8870843ff566fee9bd3a6a5942414254106479vboxsynctypedef struct PDMPCIBUS *PPDMPCIBUS;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync/** Pointer to a DMAC instance. */
2d8870843ff566fee9bd3a6a5942414254106479vboxsynctypedef struct PDMDMAC *PPDMDMAC;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync/** Pointer to a RTC instance. */
2d8870843ff566fee9bd3a6a5942414254106479vboxsynctypedef struct PDMRTC *PPDMRTC;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync
2d8870843ff566fee9bd3a6a5942414254106479vboxsync/** Pointer to an USB HUB registration record. */
044af0d1e6474076366759db86f101778c5f20ccvboxsynctypedef struct PDMUSBHUB *PPDMUSBHUB;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync/**
044af0d1e6474076366759db86f101778c5f20ccvboxsync * Private device instance data.
044af0d1e6474076366759db86f101778c5f20ccvboxsync */
044af0d1e6474076366759db86f101778c5f20ccvboxsynctypedef struct PDMDEVINSINT
044af0d1e6474076366759db86f101778c5f20ccvboxsync{
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Pointer to the next instance (HC Ptr).
044af0d1e6474076366759db86f101778c5f20ccvboxsync * (Head is pointed to by PDM::pDevInstances.) */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3PTRTYPE(PPDMDEVINS) pNextHC;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Pointer to the next per device instance (HC Ptr).
044af0d1e6474076366759db86f101778c5f20ccvboxsync * (Head is pointed to by PDMDEV::pInstances.) */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3PTRTYPE(PPDMDEVINS) pPerDeviceNextHC;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Pointer to device structure - HC Ptr. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3PTRTYPE(PPDMDEV) pDevHC;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Pointer to the VM this instance was created for - HC Ptr. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3R0PTRTYPE(PVM) pVMHC;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Pointer to the list of logical units associated with the device. (FIFO) */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3PTRTYPE(PPDMLUN) pLunsHC;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Configuration handle to the instance node. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3PTRTYPE(PCFGMNODE) pCfgHandle;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** HC pointer to associated PCI device structure. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3R0PTRTYPE(struct PCIDevice *) pPciDeviceHC;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** HC pointer to associated PCI bus structure. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3R0PTRTYPE(PPDMPCIBUS) pPciBusHC;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** GC pointer to associated PCI device structure. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync RCPTRTYPE(struct PCIDevice *) pPciDeviceGC;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to the VM this instance was created for - GC Ptr. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync RCPTRTYPE(PVM) pVMGC;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** GC pointer to associated PCI bus structure. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RCPTRTYPE(PPDMPCIBUS) pPciBusGC;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Alignment padding. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync uint32_t Alignment0;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync} PDMDEVINSINT;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync/**
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * Private USB device instance data.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync */
044af0d1e6474076366759db86f101778c5f20ccvboxsynctypedef struct PDMUSBINSINT
044af0d1e6474076366759db86f101778c5f20ccvboxsync{
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** The UUID of this instance. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync RTUUID Uuid;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Pointer to the next instance.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * (Head is pointed to by PDM::pUsbInstances.) */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync R3PTRTYPE(PPDMUSBINS) pNext;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to the next per USB device instance.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * (Head is pointed to by PDMUSB::pInstances.) */
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3PTRTYPE(PPDMUSBINS) pPerDeviceNext;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to device structure. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync R3PTRTYPE(PPDMUSB) pUsbDev;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to the VM this instance was created for. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync PVMR3 pVM;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to the list of logical units associated with the device. (FIFO) */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync R3PTRTYPE(PPDMLUN) pLuns;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** The per instance device configuration. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync R3PTRTYPE(PCFGMNODE) pCfg;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Same as pCfg if the configuration should be deleted when detaching the device. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync R3PTRTYPE(PCFGMNODE) pCfgDelete;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** The global device configuration. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync R3PTRTYPE(PCFGMNODE) pCfgGlobal;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Pointer to the USB hub this device is attached to.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * This is NULL if the device isn't connected to any HUB. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync R3PTRTYPE(PPDMUSBHUB) pHub;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** The port number that we're connected to. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync uint32_t iPort;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync#if HC_ARCH_BITS == 64
a1df400bbe9d64aad400442e56eb637019300a5evboxsync uint32_t Alignment0;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync#endif
a1df400bbe9d64aad400442e56eb637019300a5evboxsync} PDMUSBINSINT;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync/**
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * Private driver instance data.
a1df400bbe9d64aad400442e56eb637019300a5evboxsync */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsynctypedef struct PDMDRVINSINT
a1df400bbe9d64aad400442e56eb637019300a5evboxsync{
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Pointer to the driver instance above.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * This is NULL for the topmost drive. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync PPDMDRVINS pUp;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Pointer to the driver instance below.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * This is NULL for the bottommost driver. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync PPDMDRVINS pDown;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to the logical unit this driver chained on. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync PPDMLUN pLun;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to driver structure from which this was instantiated. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync PPDMDRV pDrv;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to the VM this instance was created for. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync PVM pVM;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Flag indicating that the driver is being detached and destroyed.
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync * (Helps detect potential recursive detaching.) */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync bool fDetaching;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync /** Configuration handle to the instance node. */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync PCFGMNODE pCfgHandle;
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync} PDMDRVINSINT;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync/**
044af0d1e6474076366759db86f101778c5f20ccvboxsync * Private critical section data.
044af0d1e6474076366759db86f101778c5f20ccvboxsync */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsynctypedef struct PDMCRITSECTINT
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync{
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** The critical section core which is shared with IPRT. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RTCRITSECT Core;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Pointer to the next critical section.
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync * This chain is used for relocating pVMGC and device cleanup. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync R3PTRTYPE(struct PDMCRITSECTINT *) pNext;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** Owner identifier.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * This is pDevIns if the owner is a device. Similarily for a driver or service.
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * PDMR3CritSectInit() sets this to point to the critsect itself. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync RTR3PTR pvKey;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** Pointer to the VM - R3Ptr. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync R3PTRTYPE(PVM) pVMR3;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** Pointer to the VM - R0Ptr. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync R0PTRTYPE(PVM) pVMR0;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** Pointer to the VM - GCPtr. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync RCPTRTYPE(PVM) pVMGC;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync#if HC_ARCH_BITS == 64
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync uint32_t padding;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync#endif
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** Event semaphore that is scheduled to be signaled upon leaving the
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync * critical section. This is Ring-3 only of course. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync RTSEMEVENT EventToSignal;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** R0/GC lock contention. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync STAMCOUNTER StatContentionR0GCLock;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** R0/GC unlock contention. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync STAMCOUNTER StatContentionR0GCUnlock;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** R3 lock contention. */
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync STAMCOUNTER StatContentionR3;
7d80dfbe5d66fc4c6de6fe109ce96a081496dcd4vboxsync /** Profiling the time the section is locked. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync STAMPROFILEADV StatLocked;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync} PDMCRITSECTINT, *PPDMCRITSECTINT;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * The usual device/driver/internal/external stuff.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef enum
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** The usual invalid entry. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE_INVALID = 0,
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Device type. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE_DEVICE,
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** USB Device type. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE_USB,
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Driver type. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE_DRIVER,
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Internal type. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE_INTERNAL,
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** External type. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE_EXTERNAL,
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** The usual 32-bit hack. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE_32BIT_HACK = 0x7fffffff
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync} PDMTHREADTYPE;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * The internal structure for the thread.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef struct PDMTHREADINT
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** The VM pointer. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PVMR3 pVM;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** The event semaphore the thread blocks on. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTSEMEVENTMULTI BlockEvent;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the next thread. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(struct PDMTHREAD *) pNext;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** The thread type. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PDMTHREADTYPE enmType;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync} PDMTHREADINT;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/* Must be included after PDMDEVINSINT is defined. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#define PDMDEVINSINT_DECLARED
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#define PDMUSBINSINT_DECLARED
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#define PDMDRVINSINT_DECLARED
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#define PDMCRITSECTINT_DECLARED
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#define PDMTHREADINT_DECLARED
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#ifdef ___VBox_pdm_h
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync# error "Invalid header PDM order. Include PDMInternal.h before VBox/pdm.h!"
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#endif
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync__END_DECLS
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#include <VBox/pdm.h>
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync__BEGIN_DECLS
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * PDM Logical Unit.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync *
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * This typically the representation of a physical port on a
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * device, like for instance the PS/2 keyboard port on the
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * keyboard controller device. The LUNs are chained on the
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * device the belong to (PDMDEVINSINT::pLunsHC).
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef struct PDMLUN
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** The LUN - The Logical Unit Number. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTUINT iLun;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the next LUN. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMLUN pNext;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the top driver in the driver chain. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMDRVINS pTop;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the bottom driver in the driver chain. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMDRVINS pBottom;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the device instance which the LUN belongs to.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * Either this is set or pUsbIns is set. Both is never set at the same time. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMDEVINS pDevIns;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the USB device instance which the LUN belongs to. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMUSBINS pUsbIns;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the device base interface. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMIBASE pBase;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Description of this LUN. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync const char *pszDesc;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync} PDMLUN;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * PDM Device.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef struct PDMDEV
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the next device (HC Ptr). */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(PPDMDEV) pNext;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Device name length. (search optimization) */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTUINT cchName;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Registration structure. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(const struct PDMDEVREG *) pDevReg;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Number of instances. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTUINT cInstances;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to chain of instances (HC Ptr). */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(PPDMDEVINS) pInstances;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync} PDMDEV;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * PDM USB Device.
0109a2240391a89f6556b1545e6cc57f9efab060vboxsync */
0109a2240391a89f6556b1545e6cc57f9efab060vboxsynctypedef struct PDMUSB
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the next device (R3 Ptr). */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(PPDMUSB) pNext;
0109a2240391a89f6556b1545e6cc57f9efab060vboxsync /** Device name length. (search optimization) */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTUINT cchName;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Registration structure. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(const struct PDMUSBREG *) pUsbReg;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Next instance number. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTUINT iNextInstance;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to chain of instances (R3 Ptr). */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(PPDMUSBINS) pInstances;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync} PDMUSB;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * PDM Driver.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef struct PDMDRV
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the next device. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMDRV pNext;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Registration structure. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync const struct PDMDRVREG * pDrvReg;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Number of instances. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTUINT cInstances;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync} PDMDRV;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * PDM registered PIC device.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef struct PDMPIC
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the PIC device instance - HC. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R3PTRTYPE(PPDMDEVINS) pDevInsR3;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMPICREG::pfnSetIrqHC */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMPICREG::pfnGetInterruptHC */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(int, pfnGetInterruptR3,(PPDMDEVINS pDevIns));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the PIC device instance - R0. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync R0PTRTYPE(PPDMDEVINS) pDevInsR0;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMPICREG::pfnSetIrqHC */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR0CALLBACKMEMBER(void, pfnSetIrqR0,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMPICREG::pfnGetInterruptHC */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR0CALLBACKMEMBER(int, pfnGetInterruptR0,(PPDMDEVINS pDevIns));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the PIC device instance - GC. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RCPTRTYPE(PPDMDEVINS) pDevInsGC;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMPICREG::pfnSetIrqHC */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLGCCALLBACKMEMBER(void, pfnSetIrqGC,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMPICREG::pfnGetInterruptHC */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLGCCALLBACKMEMBER(int, pfnGetInterruptGC,(PPDMDEVINS pDevIns));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Alignment padding. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync RTRCPTR GCPtrPadding;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync} PDMPIC;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync/**
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync * PDM registered APIC device.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef struct PDMAPIC
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the APIC device instance - R3 Ptr. */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync PPDMDEVINSR3 pDevInsR3;
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMAPICREG::pfnGetInterruptR3 */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(int, pfnGetInterruptR3,(PPDMDEVINS pDevIns));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(bool, pfnHasPendingIrqR3,(PPDMDEVINS pDevIns));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMAPICREG::pfnSetBaseR3 */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(void, pfnSetBaseR3,(PPDMDEVINS pDevIns, uint64_t u64Base));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMAPICREG::pfnGetBaseR3 */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(uint64_t, pfnGetBaseR3,(PPDMDEVINS pDevIns));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMAPICREG::pfnSetTPRR3 */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(void, pfnSetTPRR3,(PPDMDEVINS pDevIns, uint8_t u8TPR));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMAPICREG::pfnGetTPRR3 */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(uint8_t, pfnGetTPRR3,(PPDMDEVINS pDevIns));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** @copydoc PDMAPICREG::pfnBusDeliverR3 */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync DECLR3CALLBACKMEMBER(void, pfnBusDeliverR3,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync /** Pointer to the APIC device instance - R0. */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync R0PTRTYPE(PPDMDEVINS) pDevInsR0;
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnGetInterruptR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLR0CALLBACKMEMBER(int, pfnGetInterruptR0,(PPDMDEVINS pDevIns));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLR0CALLBACKMEMBER(bool, pfnHasPendingIrqR0,(PPDMDEVINS pDevIns));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnSetBaseR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLR0CALLBACKMEMBER(void, pfnSetBaseR0,(PPDMDEVINS pDevIns, uint64_t u64Base));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnGetBaseR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLR0CALLBACKMEMBER(uint64_t, pfnGetBaseR0,(PPDMDEVINS pDevIns));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnSetTPRR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLR0CALLBACKMEMBER(void, pfnSetTPRR0,(PPDMDEVINS pDevIns, uint8_t u8TPR));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnGetTPRR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLR0CALLBACKMEMBER(uint8_t, pfnGetTPRR0,(PPDMDEVINS pDevIns));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnBusDeliverR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLR0CALLBACKMEMBER(void, pfnBusDeliverR0,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** Pointer to the APIC device instance - RC Ptr. */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync PPDMDEVINSRC pDevInsRC;
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnGetInterruptR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLRCCALLBACKMEMBER(int, pfnGetInterruptRC,(PPDMDEVINS pDevIns));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnHasPendingIrqR3 */
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync DECLRCCALLBACKMEMBER(bool, pfnHasPendingIrqRC,(PPDMDEVINS pDevIns));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync /** @copydoc PDMAPICREG::pfnSetBaseR3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync DECLRCCALLBACKMEMBER(void, pfnSetBaseRC,(PPDMDEVINS pDevIns, uint64_t u64Base));
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** @copydoc PDMAPICREG::pfnGetBaseR3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync DECLRCCALLBACKMEMBER(uint64_t, pfnGetBaseRC,(PPDMDEVINS pDevIns));
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** @copydoc PDMAPICREG::pfnSetTPRR3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync DECLRCCALLBACKMEMBER(void, pfnSetTPRRC,(PPDMDEVINS pDevIns, uint8_t u8TPR));
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** @copydoc PDMAPICREG::pfnGetTPRR3 */
9af7167fa39f1f139899c989da973e59b9cccc3fvboxsync DECLRCCALLBACKMEMBER(uint8_t, pfnGetTPRRC,(PPDMDEVINS pDevIns));
9af7167fa39f1f139899c989da973e59b9cccc3fvboxsync /** @copydoc PDMAPICREG::pfnBusDeliverR3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync DECLRCCALLBACKMEMBER(void, pfnBusDeliverRC,(PPDMDEVINS pDevIns, uint8_t u8Dest, uint8_t u8DestMode, uint8_t u8DeliveryMode,
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync uint8_t iVector, uint8_t u8Polarity, uint8_t u8TriggerMode));
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync} PDMAPIC;
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync/**
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync * PDM registered I/O APIC device.
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsynctypedef struct PDMIOAPIC
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync{
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** Pointer to the APIC device instance - R3 Ptr. */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync PPDMDEVINSR3 pDevInsR3;
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** Pointer to the PIC device instance - R0. */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync R0PTRTYPE(PPDMDEVINS) pDevInsR0;
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync DECLR0CALLBACKMEMBER(void, pfnSetIrqR0,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** Pointer to the APIC device instance - GC Ptr. */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync PPDMDEVINSGC pDevInsRC;
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync /** @copydoc PDMIOAPICREG::pfnSetIrqR3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync DECLGCCALLBACKMEMBER(void, pfnSetIrqRC,(PPDMDEVINS pDevIns, int iIrq, int iLevel));
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync} PDMIOAPIC;
6ba706e9f431401d425d16817fdcd6316f83b584vboxsync
6ba706e9f431401d425d16817fdcd6316f83b584vboxsync
6ba706e9f431401d425d16817fdcd6316f83b584vboxsync/**
d6f8b76ab3b2ec0c270c96f9db6e2568fc41b5fevboxsync * PDM PCI Bus instance.
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync */
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsynctypedef struct PDMPCIBUS
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync{
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync /** PCI bus number. */
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RTUINT iBus;
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync RTUINT uPadding0; /**< Alignment padding.*/
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to PCI Bus device instance. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PPDMDEVINSR3 pDevInsR3;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnSetIrqHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR3CALLBACKMEMBER(void, pfnSetIrqR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnRegisterHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR3CALLBACKMEMBER(int, pfnRegisterR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, const char *pszName, int iDev));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnIORegionRegisterHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR3CALLBACKMEMBER(int, pfnIORegionRegisterR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iRegion, uint32_t cbRegion,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PCIADDRESSSPACE enmType, PFNPCIIOREGIONMAP pfnCallback));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnSetConfigCallbacksHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR3CALLBACKMEMBER(void, pfnSetConfigCallbacksR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PFNPCICONFIGREAD pfnRead,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PPFNPCICONFIGREAD ppfnReadOld, PFNPCICONFIGWRITE pfnWrite, PPFNPCICONFIGWRITE ppfnWriteOld));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnSaveExecHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR3CALLBACKMEMBER(int, pfnSaveExecR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PSSMHANDLE pSSMHandle));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnLoadExecHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR3CALLBACKMEMBER(int, pfnLoadExecR3,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, PSSMHANDLE pSSMHandle));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnFakePCIBIOSHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR3CALLBACKMEMBER(int, pfnFakePCIBIOSR3,(PPDMDEVINS pDevIns));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the PIC device instance - R0. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R0PTRTYPE(PPDMDEVINS) pDevInsR0;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnSetIrqHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLR0CALLBACKMEMBER(void, pfnSetIrqR0,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to PCI Bus device instance. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PPDMDEVINSGC pDevInsGC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** @copydoc PDMPCIBUSREG::pfnSetIrqHC */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync DECLGCCALLBACKMEMBER(void, pfnSetIrqGC,(PPDMDEVINS pDevIns, PPCIDEVICE pPciDev, int iIrq, int iLevel));
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync} PDMPCIBUS;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#ifdef IN_RING3
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * PDM registered DMAC (DMA Controller) device.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsynctypedef struct PDMDMAC
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync{
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the DMAC device instance. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PPDMDEVINS pDevIns;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Copy of the registration structure. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMDMACREG Reg;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync} PDMDMAC;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/**
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * PDM registered RTC (Real Time Clock) device.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsynctypedef struct PDMRTC
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync{
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Pointer to the RTC device instance. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync PPDMDEVINS pDevIns;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Copy of the registration structure. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync PDMRTCREG Reg;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync} PDMRTC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#endif /* IN_RING3 */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Module type.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsynctypedef enum PDMMODTYPE
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync{
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Guest context module. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMMOD_TYPE_GC,
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Ring-0 (host) context module. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMMOD_TYPE_R0,
31771163041e3661403a806eb3382d2a165c003bvboxsync /** Ring-3 (host) context module. */
31771163041e3661403a806eb3382d2a165c003bvboxsync PDMMOD_TYPE_R3
31771163041e3661403a806eb3382d2a165c003bvboxsync} PDMMODTYPE, *PPDMMODTYPE;
31771163041e3661403a806eb3382d2a165c003bvboxsync
31771163041e3661403a806eb3382d2a165c003bvboxsync
31771163041e3661403a806eb3382d2a165c003bvboxsync/** The module name length including the terminator. */
31771163041e3661403a806eb3382d2a165c003bvboxsync#define PDMMOD_NAME_LEN 32
31771163041e3661403a806eb3382d2a165c003bvboxsync
31771163041e3661403a806eb3382d2a165c003bvboxsync/**
31771163041e3661403a806eb3382d2a165c003bvboxsync * Loaded module instance.
31771163041e3661403a806eb3382d2a165c003bvboxsync */
31771163041e3661403a806eb3382d2a165c003bvboxsynctypedef struct PDMMOD
31771163041e3661403a806eb3382d2a165c003bvboxsync{
31771163041e3661403a806eb3382d2a165c003bvboxsync /** Module name. This is used for refering to
31771163041e3661403a806eb3382d2a165c003bvboxsync * the module internally, sort of like a handle. */
31771163041e3661403a806eb3382d2a165c003bvboxsync char szName[PDMMOD_NAME_LEN];
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Module type. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMMODTYPE eType;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Loader module handle. Not used for R0 modules. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RTLDRMOD hLdrMod;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Loaded address.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * This is the 'handle' for R0 modules. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RTUINTPTR ImageBase;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Old loaded address.
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * This is used during relocation of GC modules. Not used for R0 modules. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RTUINTPTR OldImageBase;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Where the R3 HC bits are stored.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * This can be equal to ImageBase but doesn't have to. Not used for R0 modules. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync void *pvBits;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to next module. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync struct PDMMOD *pNext;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Module filename. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync char szFilename[1];
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync} PDMMOD;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/** Pointer to loaded module instance. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsynctypedef PDMMOD *PPDMMOD;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/** Extra space in the free array. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#define PDMQUEUE_FREE_SLACK 16
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Queue type.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsynctypedef enum PDMQUEUETYPE
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync{
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Device consumer. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMQUEUETYPE_DEV = 1,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Driver consumer. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMQUEUETYPE_DRV,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Internal consumer. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMQUEUETYPE_INTERNAL,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** External consumer. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMQUEUETYPE_EXTERNAL
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync} PDMQUEUETYPE;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/** Pointer to a PDM Queue. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsynctypedef struct PDMQUEUE *PPDMQUEUE;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync/**
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync * PDM Queue.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsynctypedef struct PDMQUEUE
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync{
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Pointer to the next queue in the list. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync R3PTRTYPE(PPDMQUEUE) pNext;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Type specific data. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync union
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync {
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** PDMQUEUETYPE_DEV */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync struct
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync {
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Pointer to consumer function. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync R3PTRTYPE(PFNPDMQUEUEDEV) pfnCallback;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the device instance owning the queue. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMDEVINS) pDevIns;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync } Dev;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** PDMQUEUETYPE_DRV */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync struct
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync {
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to consumer function. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PFNPDMQUEUEDRV) pfnCallback;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the driver instance owning the queue. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMDRVINS) pDrvIns;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync } Drv;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** PDMQUEUETYPE_INTERNAL */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync struct
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync {
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to consumer function. */
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync R3PTRTYPE(PFNPDMQUEUEINT) pfnCallback;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync } Int;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** PDMQUEUETYPE_EXTERNAL */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync struct
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync {
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to consumer function. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PFNPDMQUEUEEXT) pfnCallback;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to user argument. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(void *) pvUser;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync } Ext;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync } u;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Queue type. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMQUEUETYPE enmType;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The interval between checking the queue for events.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * The realtime timer below is used to do the waiting.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * If 0, the queue will use the VM_FF_PDM_QUEUE forced action. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync uint32_t cMilliesInterval;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Interval timer. Only used if cMilliesInterval is non-zero. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PTMTIMERR3 pTimer;
9939c713bffcfc4305d99d994552aa2ad9bce097vboxsync /** Pointer to the VM. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3R0PTRTYPE(PVM) pVMHC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** LIFO of pending items - HC. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3R0PTRTYPE(PPDMQUEUEITEMCORE) volatile pPendingHC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the GC VM and indicator for GC enabled queue.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * If this is NULL, the queue cannot be used in GC.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RCPTRTYPE(PVM) pVMGC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** LIFO of pending items - GC. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RCPTRTYPE(PPDMQUEUEITEMCORE) pPendingGC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Item size (bytes). */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RTUINT cbItem;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Number of items in the queue. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RTUINT cItems;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Index to the free head (where we insert). */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync uint32_t volatile iFreeHead;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Index to the free tail (where we remove). */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync uint32_t volatile iFreeTail;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Array of pointers to free items. Variable size. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync struct PDMQUEUEFREEITEM
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync {
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the free item - HC Ptr. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3R0PTRTYPE(PPDMQUEUEITEMCORE) volatile pItemHC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the free item - GC Ptr. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RCPTRTYPE(PPDMQUEUEITEMCORE) volatile pItemGC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#if HC_ARCH_BITS == 64
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync uint32_t Alignment0;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#endif
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync } aFreeItems[1];
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync} PDMQUEUE;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Queue device helper task operation.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsynctypedef enum PDMDEVHLPTASKOP
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync{
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The usual invalid 0 entry. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMDEVHLPTASKOP_INVALID = 0,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** ISASetIrq */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMDEVHLPTASKOP_ISA_SET_IRQ,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** PCISetIrq */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMDEVHLPTASKOP_PCI_SET_IRQ,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** PCISetIrq */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMDEVHLPTASKOP_IOAPIC_SET_IRQ,
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The usual 32-bit hack. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMDEVHLPTASKOP_32BIT_HACK = 0x7fffffff
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync} PDMDEVHLPTASKOP;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Queued Device Helper Task.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsynctypedef struct PDMDEVHLPTASK
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync{
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The queue item core (don't touch). */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMQUEUEITEMCORE Core;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the device instance (HC Ptr). */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3R0PTRTYPE(PPDMDEVINS) pDevInsHC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** This operation to perform. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMDEVHLPTASKOP enmOp;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#if HC_ARCH_BITS == 64
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync uint32_t Alignment0;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#endif
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Parameters to the operation. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync union PDMDEVHLPTASKPARAMS
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync {
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * PDMDEVHLPTASKOP_ISA_SET_IRQ and PDMDEVHLPTASKOP_PCI_SET_IRQ.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
ad27e1d5e48ca41245120c331cc88b50464813cevboxsync struct PDMDEVHLPTASKSETIRQ
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync {
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The IRQ */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync int iIrq;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The new level. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync int iLevel;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync } SetIRQ;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync } u;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync} PDMDEVHLPTASK;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync/** Pointer to a queued Device Helper Task. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsynctypedef PDMDEVHLPTASK *PPDMDEVHLPTASK;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync/** Pointer to a const queued Device Helper Task. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsynctypedef const PDMDEVHLPTASK *PCPDMDEVHLPTASK;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync/**
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync * An USB hub registration record.
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsynctypedef struct PDMUSBHUB
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync{
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync /** The USB versions this hub support.
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync * Note that 1.1 hubs can take on 2.0 devices. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync uint32_t fVersions;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync /** The number of ports on the hub. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync uint32_t cPorts;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync /** The number of available ports (0..cPorts). */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync uint32_t cAvailablePorts;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync /** The driver instance of the hub. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync PPDMDRVINS pDrvIns;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync /** Copy of the to the registration structure. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync PDMUSBHUBREG Reg;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync /** Pointer to the next hub in the list. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync struct PDMUSBHUB *pNext;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync} PDMUSBHUB;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync/** Pointer to a const USB HUB registration record. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsynctypedef const PDMUSBHUB *PCPDMUSBHUB;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync/** Pointer to a PDM Async I/O template. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsynctypedef struct PDMASYNCCOMPLETIONTEMPLATE *PPDMASYNCCOMPLETIONTEMPLATE;
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsync/** Pointer to the main PDM Async completion structure. */
9b19ad593b379ebfcc8273f85b90763b14b1da63vboxsynctypedef struct PDMASYNCCOMPLETIONMANAGER *PPDMASYNCCOMPLETIONMANAGER;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Converts a PDM pointer into a VM pointer.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @returns Pointer to the VM structure the PDM is part of.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * @param pPDM Pointer to PDM instance data.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync#define PDM2VM(pPDM) ( (PVM)((char*)pPDM - pPDM->offVM) )
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync/**
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * PDM VM Instance data.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Changes to this must checked against the padding of the cfgm union in VM!
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync */
ca3da10d05961c339b5180fbd40a54587d6bad35vboxsynctypedef struct PDM
044af0d1e6474076366759db86f101778c5f20ccvboxsync{
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Offset to the VM structure.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * See PDM2VM(). */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RTUINT offVM;
044af0d1e6474076366759db86f101778c5f20ccvboxsync RTUINT uPadding0; /**< Alignment padding.*/
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** List of registered devices. (FIFO) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMDEV) pDevs;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** List of devices instances. (FIFO) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMDEVINS) pDevInstances;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** List of registered USB devices. (FIFO) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMUSB) pUsbDevs;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync /** List of USB devices instances. (FIFO) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMUSBINS) pUsbInstances;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** List of registered drivers. (FIFO) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMDRV) pDrvs;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync /** List of initialized critical sections. (LIFO) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMCRITSECTINT) pCritSects;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** PCI Buses. */
88acfa6629a7976c0583c1712d2b5b22a87a5121vboxsync PDMPCIBUS aPciBuses[1];
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync /** The register PIC device. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMPIC Pic;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync /** The registerd APIC device. */
2d8870843ff566fee9bd3a6a5942414254106479vboxsync PDMAPIC Apic;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The registerd I/O APIC device. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync PDMIOAPIC IoApic;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The registered DMAC device. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMDMAC) pDmac;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The registered RTC device. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMRTC) pRtc;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** The registered USB HUBs. (FIFO) */
2d8870843ff566fee9bd3a6a5942414254106479vboxsync R3PTRTYPE(PPDMUSBHUB) pUsbHubs;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Queue in which devhlp tasks are queued for R3 execution - HC Ptr. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3R0PTRTYPE(PPDMQUEUE) pDevHlpQueueHC;
2d8870843ff566fee9bd3a6a5942414254106479vboxsync /** Queue in which devhlp tasks are queued for R3 execution - GC Ptr. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RCPTRTYPE(PPDMQUEUE) pDevHlpQueueGC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
a1df400bbe9d64aad400442e56eb637019300a5evboxsync /** The number of entries in the apQueuedCritSectsLeaves table that's currnetly in use. */
a1df400bbe9d64aad400442e56eb637019300a5evboxsync RTUINT cQueuedCritSectLeaves;
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync /** Critical sections queued in GC/R0 because of contention preventing leave to complete. (R3 Ptrs)
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * We will return to Ring-3 ASAP, so this queue doesn't has to be very long. */
2d8870843ff566fee9bd3a6a5942414254106479vboxsync R3PTRTYPE(PPDMCRITSECT) apQueuedCritSectsLeaves[8];
2d8870843ff566fee9bd3a6a5942414254106479vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Linked list of timer driven PDM queues. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(struct PDMQUEUE *) pQueuesTimer;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Linked list of force action driven PDM queues. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(struct PDMQUEUE *) pQueuesForced;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the queue which should be manually flushed - HCPtr.
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync * Only touched by EMT. */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3R0PTRTYPE(struct PDMQUEUE *) pQueueFlushHC;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Pointer to the queue which should be manually flushed - GCPtr. */
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync RCPTRTYPE(struct PDMQUEUE *) pQueueFlushGC;
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync#if HC_ARCH_BITS == 64
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync uint32_t padding0;
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync#endif
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync /** Head of the PDM Thread list. (singly linked) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMTHREAD) pThreads;
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync /** Tail of the PDM Thread list. (singly linked) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMTHREAD) pThreadsTail;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync /** Head of the asychronous tasks managers. (singly linked) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMASYNCCOMPLETIONMANAGER) pAsyncCompletionManagerHead;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** Head of the templates. (singly linked) */
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PPDMASYNCCOMPLETIONTEMPLATE) pAsyncCompletionTemplates;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync /** TEMPORARY HACKS FOR NETWORK POLLING.
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @todo fix NAT and kill this!
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync * @{ */
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync RTUINT cPollers;
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync#if HC_ARCH_BITS == 64
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync RTUINT padding1;
9d020a0622f95aec3aabaff436a495e88dbbd71avboxsync#endif
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync R3PTRTYPE(PFNPDMDRVPOLLER) apfnPollers[16];
044af0d1e6474076366759db86f101778c5f20ccvboxsync R3PTRTYPE(PPDMDRVINS) aDrvInsPollers[16];
044af0d1e6474076366759db86f101778c5f20ccvboxsync PTMTIMERR3 pTimerPollers;
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** @} */
682342827b0e80c493c820603508e79e76c42658vboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** The PDM lock.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * This is used to protect everything that deals with interrupts, i.e.
044af0d1e6474076366759db86f101778c5f20ccvboxsync * the PIC, APIC, IOAPIC and PCI devices pluss some PDM functions. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync PDMCRITSECT CritSect;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync /** Number of times a critical section leave requesed needed to be queued for ring-3 execution. */
044af0d1e6474076366759db86f101778c5f20ccvboxsync STAMCOUNTER StatQueuedCritSectLeaves;
044af0d1e6474076366759db86f101778c5f20ccvboxsync} PDM;
044af0d1e6474076366759db86f101778c5f20ccvboxsync/** Pointer to PDM VM instance data. */
044af0d1e6474076366759db86f101778c5f20ccvboxsynctypedef PDM *PPDM;
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync
044af0d1e6474076366759db86f101778c5f20ccvboxsync/**
044af0d1e6474076366759db86f101778c5f20ccvboxsync * PDM data kept in the UVM.
044af0d1e6474076366759db86f101778c5f20ccvboxsync */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsynctypedef struct PDMUSERPERVM
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync{
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync /** Pointer to list of loaded modules. */
682342827b0e80c493c820603508e79e76c42658vboxsync PPDMMOD pModules;
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync /** @todo move more stuff over here. */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync} PDMUSERPERVM;
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/** Pointer to the PDM data kept in the UVM. */
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsynctypedef PDMUSERPERVM *PPDMUSERPERVM;
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync/*******************************************************************************
682342827b0e80c493c820603508e79e76c42658vboxsync* Global Variables *
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsync*******************************************************************************/
682342827b0e80c493c820603508e79e76c42658vboxsync#ifdef IN_RING3
5eda82e218d35ae0691febd531e1bfc0324cc4a6vboxsyncextern const PDMDRVHLP g_pdmR3DrvHlp;
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#endif
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
682342827b0e80c493c820603508e79e76c42658vboxsync/*******************************************************************************
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync* Internal Functions *
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync*******************************************************************************/
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync#ifdef IN_RING3
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncint pdmR3CritSectInit(PVM pVM);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncint pdmR3CritSectTerm(PVM pVM);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncvoid pdmR3CritSectRelocate(PVM pVM);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncint pdmR3CritSectInitDevice(PVM pVM, PPDMDEVINS pDevIns, PPDMCRITSECT pCritSect, const char *pszName);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncint pdmR3CritSectDeleteDevice(PVM pVM, PPDMDEVINS pDevIns);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
682342827b0e80c493c820603508e79e76c42658vboxsyncint pdmR3DevInit(PVM pVM);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncPPDMDEV pdmR3DevLookup(PVM pVM, const char *pszName);
682342827b0e80c493c820603508e79e76c42658vboxsyncint pdmR3DevFindLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMLUN *ppLun);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsync
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncint pdmR3UsbLoadModules(PVM pVM);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncint pdmR3UsbInstantiateDevices(PVM pVM);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsyncPPDMUSB pdmR3UsbLookup(PVM pVM, const char *pszName);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsyncint pdmR3UsbFindLun(PVM pVM, const char *pszDevice, unsigned iInstance, unsigned iLun, PPDMLUN *ppLun);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsyncint pdmR3UsbRegisterHub(PVM pVM, PPDMDRVINS pDrvIns, uint32_t fVersions, uint32_t cPorts, PCPDMUSBHUBREG pUsbHubReg, PPCPDMUSBHUBHLP ppUsbHubHlp);
4a1654dd5b9f0ae4e149d909843a3ab07b8bec33vboxsyncint pdmR3UsbVMInitComplete(PVM pVM);
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsync
3a4a6501d0ccd629d9951b644d380c7bb2d46086vboxsyncint pdmR3DrvInit(PVM pVM);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3DrvDetach(PPDMDRVINS pDrvIns);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncvoid pdmR3DrvDestroyChain(PPDMDRVINS pDrvIns);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncPPDMDRV pdmR3DrvLookup(PVM pVM, const char *pszName);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3LdrInitU(PUVM pUVM);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncvoid pdmR3LdrTermU(PUVM pUVM);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncchar * pdmR3FileR3(const char *pszFile, bool fShared = false);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3LoadR3U(PUVM pUVM, const char *pszFilename, const char *pszName);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncvoid pdmR3QueueRelocate(PVM pVM, RTGCINTPTR offDelta);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3ThreadCreateDevice(PVM pVM, PPDMDEVINS pDevIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDEV pfnThread,
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync PFNPDMTHREADWAKEUPDEV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3ThreadCreateUsb(PVM pVM, PPDMDRVINS pUsbIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADUSB pfnThread,
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync PFNPDMTHREADWAKEUPUSB pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3ThreadCreateDriver(PVM pVM, PPDMDRVINS pDrvIns, PPPDMTHREAD ppThread, void *pvUser, PFNPDMTHREADDRV pfnThread,
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsync PFNPDMTHREADWAKEUPDRV pfnWakeup, size_t cbStack, RTTHREADTYPE enmType, const char *pszName);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3ThreadDestroyDevice(PVM pVM, PPDMDEVINS pDevIns);
c0e27f622f9bd6d9e77d2d959aab71d69dabf0d3vboxsyncint pdmR3ThreadDestroyUsb(PVM pVM, PPDMUSBINS pUsbIns);
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsyncint pdmR3ThreadDestroyDriver(PVM pVM, PPDMDRVINS pDrvIns);
6ba706e9f431401d425d16817fdcd6316f83b584vboxsyncvoid pdmR3ThreadDestroyAll(PVM pVM);
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsyncint pdmR3ThreadResumeAll(PVM pVM);
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsyncint pdmR3ThreadSuspendAll(PVM pVM);
830a019ad79a45e6bf7a5419efd5a729a36e599evboxsync
830a019ad79a45e6bf7a5419efd5a729a36e599evboxsync#ifdef VBOX_WITH_PDM_ASYNC_COMPLETION
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsyncint pdmR3AsyncCompletionInit(PVM pVM);
daa94352f51be2329ac8660f70396e03a7cb983bvboxsyncint pdmR3AsyncCompletionTerm(PVM pVM);
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#endif
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync
b7a07b07543924f45c1fffd2f90de582038b8ba6vboxsync#endif /* IN_RING3 */
daa94352f51be2329ac8660f70396e03a7cb983bvboxsync
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsyncvoid pdmLock(PVM pVM);
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsyncint pdmLockEx(PVM pVM, int rc);
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsyncvoid pdmUnlock(PVM pVM);
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync/** @} */
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync__END_DECLS
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync#endif
2a2b173b54c259e34320ce0acf26f18e9382ce2avboxsync