VBoxPciInternal.h revision d50b5e3e6c603275de6811050f6c304c5be7ae31
de4157257515400c2c25373591135f110227b68cvboxsync * VBoxPci - PCI driver (Host), Internal Header.
de4157257515400c2c25373591135f110227b68cvboxsync * Copyright (C) 2011 Oracle Corporation
b263fac6f6e7fa933c7bfb2a45d598fe8e458c09vboxsync * This file is part of VirtualBox Open Source Edition (OSE), as
b263fac6f6e7fa933c7bfb2a45d598fe8e458c09vboxsync * available from http://www.virtualbox.org. This file is free software;
b263fac6f6e7fa933c7bfb2a45d598fe8e458c09vboxsync * you can redistribute it and/or modify it under the terms of the GNU
b263fac6f6e7fa933c7bfb2a45d598fe8e458c09vboxsync * General Public License (GPL) as published by the Free Software
b263fac6f6e7fa933c7bfb2a45d598fe8e458c09vboxsync * Foundation, in version 2 as it comes in the "COPYING" file of the
b263fac6f6e7fa933c7bfb2a45d598fe8e458c09vboxsync * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
b263fac6f6e7fa933c7bfb2a45d598fe8e458c09vboxsync * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
de4157257515400c2c25373591135f110227b68cvboxsync//# ifdef DEBUG_nike
de4157257515400c2c25373591135f110227b68cvboxsync/* Forward declaration. */
de4157257515400c2c25373591135f110227b68cvboxsynctypedef struct VBOXRAWPCIGLOBALS *PVBOXRAWPCIGLOBALS;
de4157257515400c2c25373591135f110227b68cvboxsync * The per-instance data of the VBox raw PCI interface.
de4157257515400c2c25373591135f110227b68cvboxsync * This is data associated with a host PCI card attached to the VM.
de4157257515400c2c25373591135f110227b68cvboxsync /** Pointer to the globals. */
de4157257515400c2c25373591135f110227b68cvboxsync /** Mutex protecting device access. */
de4157257515400c2c25373591135f110227b68cvboxsync /** The spinlock protecting the state variables and device access. */
de4157257515400c2c25373591135f110227b68cvboxsync /** Pointer to the next device in the list. */
de4157257515400c2c25373591135f110227b68cvboxsync /** Reference count. */
de4157257515400c2c25373591135f110227b68cvboxsync /* Host PCI address of this device. */
de4157257515400c2c25373591135f110227b68cvboxsync /** Temporary: host IRQ we were given. Assumes single IRQ devices. */
de4157257515400c2c25373591135f110227b68cvboxsync /** Port, given to the outside world. */
de4157257515400c2c25373591135f110227b68cvboxsync * Per-VM data of the VBox PCI driver. Pointed to by pGVM->rawpci.s.pDriverData.
de4157257515400c2c25373591135f110227b68cvboxsync /** Mutex protecting state changes. */
de4157257515400c2c25373591135f110227b68cvboxsync /* IOMMU domain. */
de4157257515400c2c25373591135f110227b68cvboxsync /* Back pointer to pGVM->rawpci.s. */
de4157257515400c2c25373591135f110227b68cvboxsync * The global data of the VBox PCI driver.
de4157257515400c2c25373591135f110227b68cvboxsync * This contains the bit required for communicating with support driver, VBoxDrv
de4157257515400c2c25373591135f110227b68cvboxsync * (start out as SupDrv).
de4157257515400c2c25373591135f110227b68cvboxsync /** Mutex protecting the list of instances and state changes. */
de4157257515400c2c25373591135f110227b68cvboxsync /** Pointer to a list of instance data. */
de4157257515400c2c25373591135f110227b68cvboxsync /** The raw PCI interface factory. */
de4157257515400c2c25373591135f110227b68cvboxsync /** The SUPDRV component factory registration. */
de4157257515400c2c25373591135f110227b68cvboxsync /** The number of current factory references. */
de4157257515400c2c25373591135f110227b68cvboxsync /** Whether the IDC connection is open or not.
de4157257515400c2c25373591135f110227b68cvboxsync * This is only for cleaning up correctly after the separate IDC init on Windows. */
de4157257515400c2c25373591135f110227b68cvboxsync /** The SUPDRV IDC handle (opaque struct). */
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciInit(PVBOXRAWPCIGLOBALS pGlobals);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(void) vboxPciShutdown(PVBOXRAWPCIGLOBALS pGlobals);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsInitVm(PVBOXRAWPCIDRVVM pThis, PVM pVM, PRAWPCIPERVM pVmData);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(void) vboxPciOsDeinitVm(PVBOXRAWPCIDRVVM pThis, PVM pVM);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevInit (PVBOXRAWPCIINS pIns, uint32_t fFlags);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevDeinit(PVBOXRAWPCIINS pIns, uint32_t fFlags);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevDestroy(PVBOXRAWPCIINS pIns);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevGetRegionInfo(PVBOXRAWPCIINS pIns,
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevMapRegion(PVBOXRAWPCIINS pIns,
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevUnmapRegion(PVBOXRAWPCIINS pIns,
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevPciCfgWrite(PVBOXRAWPCIINS pIns, uint32_t Register, PCIRAWMEMLOC *pValue);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevPciCfgRead (PVBOXRAWPCIINS pIns, uint32_t Register, PCIRAWMEMLOC *pValue);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevRegisterIrqHandler (PVBOXRAWPCIINS pIns, PFNRAWPCIISR pfnHandler, void* pIrqContext, int32_t *piHostIrq);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevUnregisterIrqHandler(PVBOXRAWPCIINS pIns, int32_t iHostIrq);
de4157257515400c2c25373591135f110227b68cvboxsyncDECLHIDDEN(int) vboxPciOsDevPowerStateChange(PVBOXRAWPCIINS pIns, PCIRAWPOWERSTATE aState);